Detail Design
Detail Design
We will describe the design choices that we made while implementing DistributedLog and why we built such layered architecture.
Consistency
DistributedLog achieves strong consistency, using the fencing mechanism provided in the log segment store to guarantee data consistency and versioned updates in the metadata store to guarantee metadata consistency.
LastAddConfirmed
DistributedLog leverages bookkeeper's LAC (LastAddConfirmed) protocol - a variation of two-phase-commit algorithm to build its data pipeline and achieve consistency around it. Figure 1 illustrates the basic concepts of this protocol.
Each batched entry appended to a log segment will be assigned a monotonically increasing entry id by the log segment writer. All the entries are written asynchronously in a pipeline. The log segment writer therefore updates an in-memory pointer, called LAP (LastAddPushed), which is the entry id of the last batched entry pushed to log segment store by the writer. The entries could be written out of order but only be acknowledged in entry id order. Along with the successful acknowledges, the log segment writer also updates an in-memory pointer, called LAC (LastAddConfirmed). LAC is the entry id of the last entry that already acknowledged by the writer. All the entries written between LAC and LAP are unacknowledged data, which they are not visible to readers.
The readers can read entries up to LAC as those entries are known to be durably replicated - thereby can be safely read without the risk of violating read ordering. The writer includes the current LAC in each entry that it sends to BookKeeper. Therefore each subsequent entry makes the records in the previous entry visible to the readers. LAC updates can be piggybacked on the next entry that are written by the writer. Since readers are strictly followers, they can leverage LAC to read durable data from any of the replicas without need for any communication or coordination with the writer.
DL introduces one type of system record, which is called control record - it acts as the commit request in two-phases-commit algorithm. If no application records arrive within the specified SLA, the writer will generate a control record. With writing the control record, it would advance the LAC of the log stream. The control record is added either immediately after receiving acknowledges from writing a user record or periodically if no application records are added. It is configured as part of writer's flushing policy. While control log records are present in the physical log stream, they are not delivered by the log readers to the application.
Fencing
LAC is a very simple and useful mechanism to guarantee consistency across readers. But it is not enough to guarantee correctness when the ownership of a log stream is changed - there might be multiple writers exist at the same time when network partition happens. DistributedLog addresses this by fencing data in log segment store and conditionally (via versioned set) updating log segment metadata in metadata store. Fencing is a built-in mechanism in bookkeeper - when a client wants to fence a ledger, it would send a special fence request to all the replicas of that ledger; the bookies that host that ledger will change the state of that ledger to fenced. once a ledger's state is changed to fenced, all the write attempts to it would be failed immediately. Client claims a success fence when it receives successful fence responses from majorities of the replicas.
Figure 2 illustrates how does DistributedLog work when ownership is changed for a log stream.
Whenever the ownership is changed from one writer to the other writer (step 0), the new owner of the log stream will first retrieve the list of log segments of that log stream along with their versions (the versions will used for versioned set on updating log segments' metadata). The new owner will find current inprogress log segment and recover the log segment in following sequence:
- It would first fence the log segment (step 2.1). Fencing successfully means no writes will succeed any more after that.
- If the old owner is just network partitioned, it might still think itself is the owner and keep adding records to that log segment. But because the log segment has been fenced, so all writes by the old owner will be rejected and failed (step 2.2). The old owner will realize that it already lost the ownership and gave up.
- Once the log segment is fenced, the new owner will proceed a recovery process to recover the log segment. Once the log segment is recovered, it would issue a versioned set operation to metadata store to convert the log segment status from inprogress to completed (step 2.3).
- A new inprogress log segment will be created by the new writer to continue writing to this log stream (step 3).
Completing an inprogress log segment and creating a new log segment could be executed in parallel to achieve fast log stream recovery. It will reduce the latency penalty for writes during ownership changed.
Creating a new log segment during ownership change is known as 'obtaining an epoch during leader election' in distributed consensus algorithms. It makes clean implementation for a replicated log service, as the client that lost the ownership (aka mastership, lock) doesn't even know the identity of the new epoch (in DL, it is the new log segment id) so it can't accidentally write to the new log segment. We leverage zookeeper's sequential znode on generating new log segment id.
Ownership Tracking
With the built-in fencing mechanism in storage layer and metadata updates, DistributedLog doesn't require strict leader election to guarantee correctness. Therefore we use 'ownership tracking' as opposed to 'leader election' for the log stream ownership management.
DistributedLog uses ZooKeeper ephemeral znodes for tracking the ownerships of log streams. Since ZooKeeper already provides sessions that can be used to track leases for failure detection. In production environment, we tuned the zookeeper settings to ensure failures could be detected within one second. An aggressive bound on failure detection increases the possibility of false positives. If ownerships flap between write proxies, delays will result from writes blocking for log stream recovery. Deterministic routing allows multiple clients to choose the same write proxy to fail over when the current owner proxy is unavailable. The details are described in Figure 3.
Applications write the log records by the write client. Write client will first look up the ownership cache, a local cache that caches mapping between log stream name and its corresponding log stream owner. If the stream is not cached yet, the client will use consistent hashing based routing service to compute a candidate write proxy (step 1.1) and then send the write request to this candidate write proxy (step 1.2). If it already owns the log stream or it could successfully claim the ownership, it would satisfy the write request and respond back to the client (step 1.3). If it can't claim the ownership, it then send the response back to the client to ask it redirect to the right owner (1.4). All succeed write requests will keep the local ownership cache up-to-date, which help avoiding the subsequent requests being redirected.
Streaming Reads
After the readers have caught up to the current tail of the log, DistributedLog provides readers the ability to read new log records as they are published - a mechanism commonly known as tailing the log. Readers start out by positioning to a record in the log stream based on either DLSN or Transaction ID. The reader starts reading records until it reaches the tail of the log stream. Once it has caught up with the writer, the reader waits for notifications about new log records or new log segments.
Positioning
As mentioned above, there are 3 types of sequence numbers are associated with a log record. Except sequence id is computed at reading time, both DLSN (implicit) and Transaction ID (explicit) are attached to log records in writing time. Applications could use either of them for positioning. DLSN is the best sequence number on positioning, as it already tells which log segment, which entry and which slot of the record in the log stream. No additional search operations are required. While Transaction ID is assigned by applications, positioning a reader by transaction id will first look up the list of log segments to find which log segment contains the given transaction id and then look up the records in the found log segment to figure out the actual position within that log segment. Both looking up in the log segment list and the found log segment use binary search to speed up the searching. Although positioning by transaction id could be a bit slower than positioning by DLSN, it is useful for analytics workloads to rewind to analyze old data in hours if the transaction id is timestamp.
Reading
Figure 4 illustrates reading batched entries from log segment store. The are two basic read operations: read a given entry by entry id (a) and read LAC (b).
Since an entry is immutable after it is appended to a log segment, reading a given entry by entry id could go to any replicas of that log segment and retry others if encountered failures. In order to achieve low predictable 99.9 percentile latency even during bookie failures, a speculative read mechanism is deployed: a read request will be sent to first replica; if client doesn't receive the response with a speculative timeout, it would send another request to second replica; then wait for the responses of both first replica and second replica; and so forth until receiving a valid response to complete the read request or timeout.
Reading LAC is an operation for readers to catch up with the writer. It is typically a quorum-read operation to guarantee freshness: the client sends the read requests to all replicas in the log segment and waits for the responses from the majority of them. It could be optimized to be a best-effort quorum-read operation for tailing reads, which it doesn't have to wait for quorum responses from the replicas and could return whenever it sees an advanced LAC.
Figure 4(c) illustrates the third type of read request, which is called "Long Poll Read". It is a combination of (a) and (b), serving the purpose of reading next available entry in the log segment. The client sends a long poll read request along with next read entry id to the log segment store. If the log segment store already saw the entry and it is committed (entry id is not greater than LAC), it responds the request immediately with latest LAC and requested entry. Otherwise, it would wait for LAC being advanced to given entry id and respond back requested entry. Similar speculative mechanism is deployed in long polling to achieve predictable low 99.9 percentile latency.
Notifications
Once the reader is caught up with the writer, it would turn itself into 'notification' mode. In this mode, it would wait notifications of new records by long polling reads (described above) and notification of state changes of log segments. The notification mechanism for state changes of log segments is provided by Metadata Store. Currently it is ZooKeeper watcher. The notifications are triggered when an inprogress log segment is completed or a new inprogress log segment is created.
ReadAhead
The reader will read ahead to proactively bring new data into cache, for applications to consume. It helps reducing the read latency as it proactively brings newer data into cache while applications consuming them. DistributedLog uses LAC as an indicator to detect if a reader is still catching up or already caught up and adjusting the readahead pace based on the reader state and its consuming rate.
LogSegment Lifecycle
DistributedLog breaks a log stream down into multiple log segments based configured rolling policy. The current inprogress log segment will be completed and a new log segment will be created when either the log segment has been written for more than a configured rolling interval (aka time-based rolling), the size of the log segment has reached a configured threshold (aka size-based rolling), or whenever the ownership of a log stream is changed.
A new log segment is created in Inprogress state. It is completed as a Completed log segment when either the writer rolls into a new log segment or recovered when ownership changed. Once the log segment is completed, it will be truncated later either by explicit truncation or expired due to TTL timeout. The log segment will be marked as Partial Truncated along with a Min-Active-DLSN pointer when only portion of its data is truncated, and Truncated when the Min-Active-DLSN pointer reaches the end of the log segment. The truncated log segments will be moved to Cold Storage for longer retention or backup for disaster recovery, and eventually be deleted after TTL expiration. Figure 5 illustrates a log stream that contains 5 log segments which each of them are in different states. The dot line describes the transition between states.
Distribution
A log segment is placed on multiple log segment storage nodes according configured placement policy. DistributedLog uses a rack-aware placement policy on placing log segments in a local datacenter setup, which the rack-aware placement policy will guarantee all the replicas of same log segment placed in different racks for network fault-tolerance. It uses a region-aware placement policy on placing log segments among multiple datacenters for a global setup (see more in section "Global Replicated Log"), which guarantees all the replicas of same log segment placed in multiple datacenters and ensures receiving acknowledges from majority of the data centers.
As DistributedLog breaks down the streams into multiple log segments, the log segments could be evenly distributed across multiple log segment storage nodes for load balancing. It helps the data distribution balancing and read workload balancing. Figure 6 shows an example how the data of 2 streams (x, y) is stored as 3 replicas in a 5-nodes cluster in a balanced way.
Truncation
As the writers keep writing records into the log streams, the data will be accumulated. In DistributedLog, there are two ways to delete old data, one is Explicit Truncation while the other is TTL Expiration.
Applications are allowed to explicitly truncate a log stream to a given DLSN. Once the truncation request is received by the writer, the writer will mark all the log segments whose log segment sequence number is less than the sequence number of that DLSN as Truncated. The log segment segment whose sequence number is same as that DLSN will be marked as Partially Truncated along and the DLSN as the last active DLSN. So positioning the reader will be advanced to last active DLSN if the provided position is already truncated. All the truncated log segments will be still kept for a configured time period for disaster recovery and the actual log segments will be deleted and garbage collected via TTL Expiration.
When a log segment is completed, the completion time will be recorded as part of the log segment metadata. DistributedLog uses completion time for TTL Expiration: all the log segments whose completion time already passed the configured TTL period will be deleted from metadata store. After the log segments are deleted from metadata store, the log segments will be garbage collected from log segment store and their disk spaces will be reclaimed.


--- layout: post title: no title date: '2016-04-29T18:30:28+02:00' categories: - Storyboards picture_url: https://film-Storyboards.tumblr.com/post/143604322133 ---


Punjab: Dalit man tied to pillar, beaten, forced to drink urine; succumbs to injuries
He was admitted to PGIMER and his legs were amputated.
by PTIChandigarh: A 37-year-old Dalit man, who was mercilessly thrashed and forced to drink urine in Punjab's Sangrur district, succumbed to his injuries Saturday morning at a hospital here, police said.
"He succumbed to his injuries at the Post Graduate Institute of Medical Education & Research (PGIMER)," Sangrur Senior Superintendent of Police Sandeep Garg said.
He was admitted to PGIMER and his legs were amputated.
Garg said section 302 (murder) of the IPC has been added to the FIR registered in this matter.
The Dalit man, a resident of Changaliwala village, had an altercation with Rinku and some other persons on October 21 but the matter was resolved with the intervention of villagers.
He had told police that on November 7, Rinku called him to his house and they discussed the matter.
The man had alleged that he was then thrashed by four persons after being tied to a pillar and when he asked for water, he was forced to drink urine.
Four persons were arrested on the charges of abduction, wrongful confinement, and under various sections of the IPC, and the Scheduled Caste and Scheduled Tribes (Prevention of Atrocities) Act at the Lehra police station in Sangrur, police said.
Punjab State Scheduled Castes Commission has also sought a report from Sangrur Senior Superintendent of Police over the incident.
Chairperson Tejinder Kaur on Friday said the commission learnt about the incident through media reports and took suo motu cognisance and sought the report.
Catch the latest news, live coverage and in-depth analyses from India and World. Follow us on Facebook and Twitter.


Upon request, you can get NooBaa as a qcow2 format.
Once you download the disk image, follow the steps below in order to deploy it.
Open the Virtual Machine Manager
Click on "Create a new virtual machine" button. Select the option "Import existing disk image" and click on the Forward button
When choosing a storage volume click on the Browse Local button
Select the downloaded image you got from NooBaa.
Keep the defaults of Generic OS type and Generic Version and click on Forward.
For POC, you can keep the default RAM and CPU or increase it for better performance. Click on Forward.
Name the VM and click Finish.
You are ready to go. Enter the user name and password (in green), set up the network and access the web UI.


Why you should come here?
Huaiyin institute of Technology is one of the key institutes in China.
HYIT is dedicated to training superior personnel possessing qualities harmoniously integrating humanistic spirit, scientific cultivation and innovative ability.
HYIT attaches great importance to the cultivation of its students’ personality and teaches students in accordance with their capability. The University offers individual guidance to those who have difficulty in their studies and provides the ideal conditions for each able student to complete his studies easily.
HYIT is well equipped with all necessary infrastructure and public service system in support of modernized higher education and scientific research.
HYIT pays much attention to the improvement of teachers’ overall quality in a bid to build an internationally competitive faculty competent for teaching, research and social services.
HYIT has fine facilities for both teaching and recreation. Apart from library and all kinds of laboratories which are open to students all day long, students can make full use of the gymnasium, artistic activity center to mould their own minds and bodies.
Accomodation
The Accommodation unit of Alumni & Support Services Department under the Student Affairs & Alumni. As management, part of our role is to observe cleanliness and maintenance of the hostel, to establish security and safety in the residential halls, to ensure that integration between the residents is maintained, and that the rules and regulations of the hostel are adhered, to ensure students would enjoy their learning and living at HYIT.
Our Objectives
We are committed to provide students:
• a safe and secure, comfortable and clean living environment
• the assurance that our residents have opportunities for personal development and growth
• our understanding and a quick response to the needs of our resident-students collectively and individually
• the independence of a self-catering accommodation or the more traditional feel of a catered residence
Holidays
All International Students are to enjoy the same school holidays as the Chinese students. The university does not schedule any school breaks for foreign holidays/celebrations. Students may find the university’s holiday schedule in the academic calendar.


ViewVC 1.3.0 is the superset of all previous ViewVC releases.
Each ViewVC release strives to maintain URL stability with previous releases, and 1.3.0 is no exception. All URLs considered valid for previous ViewVC releases should continue to work correctly in this release, though possibly only via the use of HTTP redirects (generated by ViewVC itself).


{% extends "themes/" + sysSettings.systemTheme + "/layout.html" %} {% block head %}
To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video
{{video.description|markdown}}
{{comment.comment|markdown}}
{{comment.comment|markdown}}


|
| class | Corale.Colore.Annotations.CanBeNullAttribute |
| | Indicates that the value of the marked element could be null sometimes, so the check for null is necessary before its usage More...
|
| |
| class | Corale.Colore.Annotations.NotNullAttribute |
| | Indicates that the value of the marked element could never be null More...
|
| |
| class | Corale.Colore.Annotations.ItemNotNullAttribute |
| | Indicates that collection or enumerable value does not contain null elements More...
|
| |
| class | Corale.Colore.Annotations.ItemCanBeNullAttribute |
| | Indicates that collection or enumerable value can contain null elements More...
|
| |
| class | StringFormatMethodAttribute |
| |
| class | ValueProviderAttribute |
| | For a parameter that is expected to be one of the limited set of values. Specify fields of which type should be used as values for this parameter. More...
|
| |
| class | InvokerParameterNameAttribute |
| | Indicates that the function argument should be string literal and match one of the parameters of the caller function. For example, ReSharper annotates the parameter of System.ArgumentNullException More...
|
| |
| class | NotifyPropertyChangedInvocatorAttribute |
| |
| class | ContractAnnotationAttribute |
| | Describes dependency between method input and output More...
|
| |
| class | LocalizationRequiredAttribute |
| | Indicates that marked element should be localized or not More...
|
| |
| class | CannotApplyEqualityOperatorAttribute |
| | Indicates that the value of the marked type (or its derivatives) cannot be compared using '==' or '!=' operators and Equals() should be used instead. However, using '==' or '!=' for comparison with null is always permitted. More...
|
| |
| class | BaseTypeRequiredAttribute |
| | When applied to a target attribute, specifies a requirement for any type marked with the target attribute to implement or inherit specific type or types. More...
|
| |
| class | UsedImplicitlyAttribute |
| | Indicates that the marked symbol is used implicitly (e.g. via reflection, in external library), so this symbol will not be marked as unused (as well as by other usage inspections) More...
|
| |
| class | MeansImplicitUseAttribute |
| | Should be used on attributes and causes ReSharper to not mark symbols marked with such attributes as unused (as well as by other usage inspections) More...
|
| |
| class | PublicAPIAttribute |
| | This attribute is intended to mark publicly available API which should not be removed and so is treated as used More...
|
| |
| class | InstantHandleAttribute |
| | Tells code analysis engine if the parameter is completely handled when the invoked method is on stack. If the parameter is a delegate, indicates that delegate is executed while the method is executed. If the parameter is an enumerable, indicates that it is enumerated while the method is executed More...
|
| |
| class | PureAttribute |
| | Indicates that a method does not make any observable state changes. The same as System.Diagnostics.Contracts.PureAttribute More...
|
| |
| class | PathReferenceAttribute |
| | Indicates that a parameter is a path to a file or a folder within a web project. Path can be relative or absolute, starting from web root (~) More...
|
| |
| class | AspMvcAreaMasterLocationFormatAttribute |
| |
| class | AspMvcAreaPartialViewLocationFormatAttribute |
| |
| class | AspMvcAreaViewLocationFormatAttribute |
| |
| class | AspMvcMasterLocationFormatAttribute |
| |
| class | AspMvcPartialViewLocationFormatAttribute |
| |
| class | AspMvcViewLocationFormatAttribute |
| |
| class | AspMvcActionAttribute |
| | ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC action. If applied to a method, the MVC action name is calculated implicitly from the context. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String) More...
|
| |
| class | AspMvcAreaAttribute |
| | ASP.NET MVC attribute. Indicates that a parameter is an MVC area. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String) More...
|
| |
| class | AspMvcControllerAttribute |
| | ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC controller. If applied to a method, the MVC controller name is calculated implicitly from the context. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String) More...
|
| |
| class | AspMvcMasterAttribute |
| | ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. Use this attribute for custom wrappers similar to System.Web.Mvc.Controller.View(String, String) More...
|
| |
| class | AspMvcModelTypeAttribute |
| | ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. Use this attribute for custom wrappers similar to System.Web.Mvc.Controller.View(String, Object) More...
|
| |
| class | AspMvcPartialViewAttribute |
| | ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC partial view. If applied to a method, the MVC partial view name is calculated implicitly from the context. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String) More...
|
| |
| class | AspMvcSupressViewErrorAttribute |
| | ASP.NET MVC attribute. Allows disabling inspections for MVC views within a class or a method More...
|
| |
| class | AspMvcDisplayTemplateAttribute |
| | ASP.NET MVC attribute. Indicates that a parameter is an MVC display template. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String) More...
|
| |
| class | AspMvcEditorTemplateAttribute |
| | ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template. Use this attribute for custom wrappers similar to System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String) More...
|
| |
| class | AspMvcTemplateAttribute |
| | ASP.NET MVC attribute. Indicates that a parameter is an MVC template. Use this attribute for custom wrappers similar to System.ComponentModel.DataAnnotations.UIHintAttribute(System.String) More...
|
| |
| class | AspMvcViewAttribute |
| | ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter is an MVC view. If applied to a method, the MVC view name is calculated implicitly from the context. Use this attribute for custom wrappers similar to System.Web.Mvc.Controller.View(Object) More...
|
| |
| class | AspMvcActionSelectorAttribute |
| | ASP.NET MVC attribute. When applied to a parameter of an attribute, indicates that this parameter is an MVC action name More...
|
| |
| class | HtmlElementAttributesAttribute |
| |
| class | HtmlAttributeValueAttribute |
| |
| class | RazorSectionAttribute |
| | Razor attribute. Indicates that a parameter or a method is a Razor section. Use this attribute for custom wrappers similar to System.Web.WebPages.WebPageBase.RenderSection(String) More...
|
| |
| class | CollectionAccessAttribute |
| | Indicates how method invocation affects content of the collection More...
|
| |
| class | AssertionMethodAttribute |
| | Indicates that the marked method is assertion method, i.e. it halts control flow if one of the conditions is satisfied. To set the condition, mark one of the parameters with AssertionConditionAttribute attribute More...
|
| |
| class | AssertionConditionAttribute |
| | Indicates the condition parameter of the assertion method. The method itself should be marked by AssertionMethodAttribute attribute. The mandatory argument of the attribute is the assertion type. More...
|
| |
| class | TerminatesProgramAttribute |
| | Indicates that the marked method unconditionally terminates control flow execution. For example, it could unconditionally throw exception More...
|
| |
| class | LinqTunnelAttribute |
| | Indicates that method is pure LINQ method, with postponed enumeration (like Enumerable.Select, .Where). This annotation allows inference of [InstantHandle] annotation for parameters of delegate type by analyzing LINQ method chains. More...
|
| |
| class | NoEnumerationAttribute |
| | Indicates that IEnumerable, passed as parameter, is not enumerated. More...
|
| |
| class | RegexPatternAttribute |
| | Indicates that parameter is regular expression pattern. More...
|
| |
| class | XamlItemsControlAttribute |
| | XAML attribute. Indicates the type that has ItemsSource property and should be treated as ItemsControl -derived type, to enable inner items DataContext type resolve. More...
|
| |
| class | XamlItemBindingOfItemsControlAttribute |
| | XAML attibute. Indicates the property of some BindingBase -derived type, that is used to bind some item of ItemsControl -derived type. This annotation will enable the DataContext type resolve for XAML bindings for such properties. More...
|
| |
| class | AspChildControlTypeAttribute |
| |
| class | AspDataFieldAttribute |
| |
| class | AspDataFieldsAttribute |
| |
| class | AspMethodPropertyAttribute |
| |
| class | AspRequiredAttributeAttribute |
| |
| class | AspTypePropertyAttribute |
| |
| class | RazorImportNamespaceAttribute |
| |
| class | RazorInjectionAttribute |
| |
| class | RazorHelperCommonAttribute |
| |
| class | RazorLayoutAttribute |
| |
| class | RazorWriteLiteralMethodAttribute |
| |
| class | RazorWriteMethodAttribute |
| |
| class | RazorWriteMethodParameterAttribute |
| |
| class | NoReorder |
| | Prevents the Member Reordering feature from tossing members of the marked class. More...
|
| |


Class: RSpec::Core::Configuration
- Inherits:
-
Object
- Object
- RSpec::Core::Configuration
- Includes:
- Module.new, Hooks
- Defined in:
- lib/rspec/core/configuration.rb
Overview
Stores runtime configuration information.
Configuration options are loaded from ~/.rspec
, .rspec
,
.rspec-local
, command line switches, and the SPEC_OPTS
environment
variable (listed in lowest to highest precedence; for example, an option
in ~/.rspec
can be overridden by an option in .rspec-local
).
Constant Summary
Instance Attribute Summary (collapse)
-
- (void) default_color
The default output color.
-
- (void) default_path
Path to use if no path is provided to the
rspec
command (default:"spec"
). -
- (void) detail_color
Color used to print details.
-
- (void) drb
Run examples over DRb (default:
false
). -
- (void) drb_port
The drb_port (default: nil).
-
- (void) dry_run
Prints the formatter output of your suite without running any examples or hooks.
-
- (void) error_stream
Default:
$stderr
. -
- (void) exclude_pattern
Exclude files matching this pattern.
-
- (void) fail_fast
Clean up and exit after the first failure (default:
false
). -
- (void) failure_color
Color to use to indicate failure.
-
- (void) failure_exit_code
The exit code to return if there are any failures (default: 1).
-
- (Array) files_to_run
readonly
The spec files RSpec will run.
-
- (void) fixed_color
Color used when a pending example is fixed.
-
- (void) libs
readonly
Returns dirs that have been prepended to the load path by the
-I
command line option. -
- (void) output_stream
Determines where RSpec will send its output.
-
- (void) pattern
Load files matching this pattern (default:
'**{,/*/**}/*_spec.rb'
). -
- (void) pending_color
Color to use to print pending examples.
-
- (void) profile_examples
private
Defaults
profile_examples
to 10 examples when@profile_examples
istrue
. -
- (void) requires
readonly
Indicates files configured to be required.
-
- (void) run_all_when_everything_filtered
Run all examples if none match the configured filters (default:
false
). -
- (void) success_color
Color to use to indicate success.
Instance Method Summary (collapse)
-
- (void) add_formatter(formatter)
(also: #formatter=)
Adds a formatter to the formatters collection.
-
- (void) add_setting(name, opts = {})
Adds a custom setting to the RSpec.configuration object.
-
- (void) after(*args, &block)
(also: #prepend_after)
Defines a
after
hook. -
- (void) alias_example_group_to(new_name, *args)
Creates a method that defines an example group with the provided metadata.
-
- (void) alias_example_to(name, *args)
Creates a method that delegates to
example
including the submittedargs
. -
- (void) alias_it_behaves_like_to(new_name, report_label = '')
(also: #alias_it_should_behave_like_to)
Define an alias for it_should_behave_like that allows different language (like "it_has_behavior" or "it_behaves_like") to be employed when including shared examples.
-
- (void) append_after(*args, &block)
Adds
block
to the end of the list ofafter
blocks in the same scope (:example
,:context
, or:suite
), in contrast to #after, which adds the hook to the start of the list. -
- (void) backtrace_exclusion_patterns
Regexps used to exclude lines from backtraces.
-
- (void) backtrace_exclusion_patterns=(patterns)
Set regular expressions used to exclude lines in backtrace.
-
- (void) backtrace_inclusion_patterns
Regexps used to include lines in backtraces.
-
- (void) backtrace_inclusion_patterns=(patterns)
Set regular expressions used to include lines in backtrace.
-
- (void) before(*args, &block)
(also: #append_before)
Defines a
before
hook. -
- (Boolean) color
Returns the configuration option for color, but should not be used to check if color is supported.
-
- (void) color=(true_or_false)
Toggle output color.
-
- (Boolean) color_enabled?(output = output_stream)
Check if color is enabled for a particular output.
-
- (void) default_formatter
The formatter that will be used if no formatter has been set.
-
- (void) default_formatter=(value)
Sets a fallback formatter to use if none other has been set.
-
- (void) define_derived_metadata(*filters) {|metadata| ... }
Defines a callback that can assign derived metadata values.
-
- (IO, String) deprecation_stream
Determines where deprecation warnings are printed.
-
- (void) deprecation_stream=(value)
Determines where deprecation warnings are printed.
-
- (void) disable_monkey_patching!
Enables zero monkey patching mode for RSpec.
-
- (void) exclusion_filter
Returns the
exclusion_filter
. -
- (void) exclusion_filter=(filter)
Clears and reassigns the
exclusion_filter
. -
- (void) expect_with(*frameworks)
Sets the expectation framework module(s) to be included in each example group.
-
- (void) expectation_framework=(framework)
Delegates to expect_with(framework).
-
- (void) expectation_frameworks
Returns the configured expectation framework adapter module(s).
-
- (void) expose_current_running_example_as(method_name)
Exposes the current running example via the named helper method.
-
- (void) expose_dsl_globally=(value)
Use this to expose the core RSpec DSL via
Module
and themain
object. -
- (Boolean) expose_dsl_globally?
Indicates if the DSL has been exposed off of modules and
main
. -
- (void) extend(mod, *filters)
Tells RSpec to extend example groups with
mod
. -
- (void) filter_gems_from_backtrace(*gem_names)
Adds #backtrace_exclusion_patterns that will filter lines from the named gems from backtraces.
-
- (void) filter_run_excluding(*args)
Adds key/value pairs to the
exclusion_filter
. -
- (void) filter_run_including(*args)
(also: #filter_run)
Adds key/value pairs to the
inclusion_filter
. -
- (void) format_docstrings(&block)
Formats the docstring output using the block provided.
-
- (Array) formatters
Returns a duplicate of the formatters currently loaded in the
FormatterLoader
for introspection. -
- (void) full_backtrace=(true_or_false)
Toggle full backtrace.
-
- (Boolean) full_backtrace?
Check if full backtrace is enabled.
-
- (Array) full_description
Full description filter.
-
- (void) full_description=(description)
Run examples matching on
description
in all files to run. -
- (void) include(mod, *filters)
Tells RSpec to include
mod
in example groups. -
- (void) inclusion_filter
(also: #filter)
Returns the
inclusion_filter
. -
- (void) inclusion_filter=(filter)
(also: #filter=)
Clears and reassigns the
inclusion_filter
. -
- (Configuration) initialize
constructor
A new instance of Configuration.
-
- (void) mock_framework
Returns the configured mock framework adapter module.
-
- (void) mock_framework=(framework)
Delegates to mock_framework=(framework).
-
- (void) mock_with(framework)
Sets the mock framework adapter module.
-
- (void) order=
Sets the default global order and, if order is
'rand:'
, also sets the seed. -
- (void) prepend(mod, *filters)
Tells RSpec to prepend example groups with
mod
. -
- (void) prepend_before(*args, &block)
Adds
block
to the start of the list ofbefore
blocks in the same scope (:example
,:context
, or:suite
), in contrast to #before, which adds the hook to the end of the list. -
- (void) raise_errors_for_deprecations!
Turns deprecation warnings into errors, in order to surface the full backtrace of the call site.
-
- (void) register_ordering {|list| ... }
Registers a named ordering strategy that can later be used to order an example group's subgroups by adding
:order =>
metadata to the example group. -
- (void) seed
Seed for random ordering (default: generated randomly each run).
-
- (void) seed=
Sets the seed value and sets the default global ordering to random.
-
- (void) treat_symbols_as_metadata_keys_with_true_values=(_value)
Deprecated.
-
- (void) warnings=(value)
Set Ruby warnings on or off.
-
- (Boolean) warnings?
Whether or not ruby warnings are enabled.
Methods included from Hooks
Constructor Details
- (Configuration) initialize
Returns a new instance of Configuration
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
# File 'lib/rspec/core/configuration.rb', line 295 def initialize # rubocop:disable Style/GlobalVars @start_time = $_rspec_core_load_started_at || ::RSpec::Core::Time.now # rubocop:enable Style/GlobalVars @expectation_frameworks = [] @include_modules = FilterableItemRepository::QueryOptimized.new(:any?) @extend_modules = FilterableItemRepository::QueryOptimized.new(:any?) @prepend_modules = FilterableItemRepository::QueryOptimized.new(:any?) @before_suite_hooks = [] @after_suite_hooks = [] @mock_framework = nil @files_or_directories_to_run = [] @loaded_spec_files = Set.new @color = false @pattern = '**{,/*/**}/*_spec.rb' @exclude_pattern = '' @failure_exit_code = 1 @spec_files_loaded = false @backtrace_formatter = BacktraceFormatter.new @default_path = 'spec' @deprecation_stream = $stderr @output_stream = $stdout @reporter = nil @reporter_buffer = nil @filter_manager = FilterManager.new @static_config_filter_manager = FilterManager.new @ordering_manager = Ordering::ConfigurationManager.new @preferred_options = {} @failure_color = :red @success_color = :green @pending_color = :yellow @default_color = :white @fixed_color = :blue @detail_color = :cyan @profile_examples = false @requires = [] @libs = [] @derived_metadata_blocks = FilterableItemRepository::QueryOptimized.new(:any?) end |
Instance Attribute Details
- (void) default_color
The default output color.
253 |
# File 'lib/rspec/core/configuration.rb', line 253 add_setting :default_color |
- (void) default_path
Other scripts invoking rspec
indirectly will ignore this
setting.
Path to use if no path is provided to the rspec
command (default:
"spec"
). Allows you to just type rspec
instead of rspec spec
to
run all the examples in the spec
directory.
103 |
# File 'lib/rspec/core/configuration.rb', line 103 add_setting :default_path |
- (void) detail_color
Color used to print details.
267 |
# File 'lib/rspec/core/configuration.rb', line 267 add_setting :detail_color |
- (void) drb
Run examples over DRb (default: false
). RSpec doesn't supply the DRb
server, but you can use tools like spork.
108 |
# File 'lib/rspec/core/configuration.rb', line 108 add_setting :drb |
- (void) drb_port
The drb_port (default: nil).
112 |
# File 'lib/rspec/core/configuration.rb', line 112 add_setting :drb_port |
- (void) dry_run
Prints the formatter output of your suite without running any examples or hooks.
164 |
# File 'lib/rspec/core/configuration.rb', line 164 add_setting :dry_run |
- (void) error_stream
Default: $stderr
.
116 |
# File 'lib/rspec/core/configuration.rb', line 116 add_setting :error_stream |
- (void) exclude_pattern
Exclude files matching this pattern.
209 |
# File 'lib/rspec/core/configuration.rb', line 209 define_reader :exclude_pattern |
- (void) fail_fast
Clean up and exit after the first failure (default: false
).
159 |
# File 'lib/rspec/core/configuration.rb', line 159 add_setting :fail_fast |
- (void) failure_color
Color to use to indicate failure.
246 |
# File 'lib/rspec/core/configuration.rb', line 246 add_setting :failure_color |
- (void) failure_exit_code
The exit code to return if there are any failures (default: 1).
168 |
# File 'lib/rspec/core/configuration.rb', line 168 add_setting :failure_exit_code |
- (Array) files_to_run
The spec files RSpec will run.
802 803 804 |
# File 'lib/rspec/core/configuration.rb', line 802 def files_to_run @files_to_run ||= get_files_to_run(@files_or_directories_to_run) end |
- (void) fixed_color
Color used when a pending example is fixed.
260 |
# File 'lib/rspec/core/configuration.rb', line 260 add_setting :fixed_color |
- (void) libs
Returns dirs that have been prepended to the load path by the -I
command line option.
177 |
# File 'lib/rspec/core/configuration.rb', line 177 define_reader :libs |
- (void) output_stream
Determines where RSpec will send its output.
Default: $stdout
.
182 |
# File 'lib/rspec/core/configuration.rb', line 182 define_reader :output_stream |
- (void) pattern
Load files matching this pattern (default: '**{,/*/**}/*_spec.rb'
).
199 |
# File 'lib/rspec/core/configuration.rb', line 199 define_reader :pattern |
- (void) pending_color
Color to use to print pending examples.
239 |
# File 'lib/rspec/core/configuration.rb', line 239 add_setting :pending_color |
- (void) profile_examples
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Defaults profile_examples
to 10 examples when @profile_examples
is
true
.
220 |
# File 'lib/rspec/core/configuration.rb', line 220 add_setting :profile_examples |
- (void) requires
Indicates files configured to be required.
172 |
# File 'lib/rspec/core/configuration.rb', line 172 define_reader :requires |
- (void) run_all_when_everything_filtered
Run all examples if none match the configured filters
(default: false
).
225 |
# File 'lib/rspec/core/configuration.rb', line 225 add_setting :run_all_when_everything_filtered |
- (void) success_color
Color to use to indicate success.
232 |
# File 'lib/rspec/core/configuration.rb', line 232 add_setting :success_color |
Instance Method Details
- (void) add_formatter(formatter) Also known as: formatter=
Adds a formatter to the formatters collection. formatter
can be a
string representing any of the built-in formatters (see
built_in_formatter
), or a custom formatter class.
Note
For internal purposes, add_formatter
also accepts the name of a class
and paths to use for output streams, but you should consider that a
private api that may change at any time without notice.
705 706 707 708 |
# File 'lib/rspec/core/configuration.rb', line 705 def add_formatter(formatter_to_use, *paths) paths << output_stream if paths.empty? formatter_loader.add formatter_to_use, *paths end |
- (void) add_setting(name) - (void) add_setting(name, opts)
Adds a custom setting to the RSpec.configuration object.
RSpec.configuration.add_setting :foo
Used internally and by extension frameworks like rspec-rails, so they can add config settings that are domain specific. For example:
RSpec.configure do |c|
c.add_setting :use_transactional_fixtures,
:default => true,
:alias_with => :use_transactional_examples
end
add_setting
creates three methods on the configuration object, a
setter, a getter, and a predicate:
RSpec.configuration.foo=(value)
RSpec.configuration.foo
RSpec.configuration.foo? # Returns true if foo returns anything but nil or false.
400 401 402 403 404 405 406 |
# File 'lib/rspec/core/configuration.rb', line 400 def add_setting(name, opts={}) default = opts.delete(:default) (class << self; self; end).class_exec do add_setting(name, opts) end __send__("#{name}=", default) if default end |
- (void) after(*args, &block) Also known as: prepend_after
Defines a after
hook. See Hooks#after for full docs.
This method differs from Hooks#after in only one way: it supports
the :suite
scope. Hooks with the :suite
scope will be run once after
the last example of the entire suite is executed.
1495 1496 1497 1498 |
# File 'lib/rspec/core/configuration.rb', line 1495 def after(*args, &block) handle_suite_hook(args, @after_suite_hooks, :unshift, Hooks::AfterHook, block) || super(*args, &block) end |
- (void) alias_example_group_to(new_name, *args)
The defined aliased will also be added to the top level
(e.g. main
and from within modules) if
expose_dsl_globally
is set to true.
Creates a method that defines an example group with the provided metadata. Can be used to define example group/metadata shortcuts.
870 871 872 873 |
# File 'lib/rspec/core/configuration.rb', line 870 def alias_example_group_to(new_name, *args) = Metadata.build_hash_from(args) RSpec::Core::ExampleGroup.define_example_group_method(new_name, ) end |
- (void) alias_example_to(name, *args)
The specific example alias below (pending
) is already
defined for you.
Use with caution. This extends the language used in your
specs, but does not add any additional documentation. We use this
in RSpec to define methods like focus
and xit
, but we also add
docs for those methods.
Creates a method that delegates to example
including the submitted
args
. Used internally to add variants of example
like pending
:
838 839 840 841 |
# File 'lib/rspec/core/configuration.rb', line 838 def alias_example_to(name, *args) = Metadata.build_hash_from(args) RSpec::Core::ExampleGroup.define_example_method(name, ) end |
- (void) alias_it_behaves_like_to(new_name, report_label = '') Also known as: alias_it_should_behave_like_to
Use with caution. This extends the language used in your
specs, but does not add any additional documentation. We use this
in RSpec to define it_should_behave_like
(for backward
compatibility), but we also add docs for that method.
Define an alias for it_should_behave_like that allows different language (like "it_has_behavior" or "it_behaves_like") to be employed when including shared examples.
901 902 903 |
# File 'lib/rspec/core/configuration.rb', line 901 def alias_it_behaves_like_to(new_name, report_label='') RSpec::Core::ExampleGroup.define_nested_shared_group_method(new_name, report_label) end |
- (void) append_after(*args, &block)
Adds block
to the end of the list of after
blocks in the same
scope (:example
, :context
, or :suite
), in contrast to #after,
which adds the hook to the start of the list.
See Hooks#after for full after
hook docs.
This method differs from Hooks#append_after in only one way: it supports
the :suite
scope. Hooks with the :suite
scope will be run once after
the last example of the entire suite is executed.
1514 1515 1516 1517 |
# File 'lib/rspec/core/configuration.rb', line 1514 def append_after(*args, &block) handle_suite_hook(args, @after_suite_hooks, :push, Hooks::AfterHook, block) || super(*args, &block) end |
- (void) backtrace_exclusion_patterns
Regexps used to exclude lines from backtraces.
Excludes lines from ruby (and jruby) source, installed gems, anything in any "bin" directory, and any of the RSpec libs (outside gem installs) by default.
You can modify the list via the getter, or replace it with the setter.
To override this behaviour and display a full backtrace, use
--backtrace
on the command line, in a .rspec
file, or in the
rspec_options
attribute of RSpec's rake task.
436 437 438 |
# File 'lib/rspec/core/configuration.rb', line 436 def backtrace_exclusion_patterns @backtrace_formatter.exclusion_patterns end |
- (void) backtrace_exclusion_patterns=(patterns)
Set regular expressions used to exclude lines in backtrace.
442 443 444 |
# File 'lib/rspec/core/configuration.rb', line 442 def backtrace_exclusion_patterns=(patterns) @backtrace_formatter.exclusion_patterns = patterns end |
- (void) backtrace_inclusion_patterns
Regexps used to include lines in backtraces.
Defaults to [Regexp.new Dir.getwd].
Lines that match an exclusion and an inclusion pattern will be included.
You can modify the list via the getter, or replace it with the setter.
454 455 456 |
# File 'lib/rspec/core/configuration.rb', line 454 def backtrace_inclusion_patterns @backtrace_formatter.inclusion_patterns end |
- (void) backtrace_inclusion_patterns=(patterns)
Set regular expressions used to include lines in backtrace.
460 461 462 |
# File 'lib/rspec/core/configuration.rb', line 460 def backtrace_inclusion_patterns=(patterns) @backtrace_formatter.inclusion_patterns = patterns end |
- (void) before(*args, &block) Also known as: append_before
Defines a before
hook. See Hooks#before for full docs.
This method differs from Hooks#before in only one way: it supports
the :suite
scope. Hooks with the :suite
scope will be run once before
the first example of the entire suite is executed.
1462 1463 1464 1465 |
# File 'lib/rspec/core/configuration.rb', line 1462 def before(*args, &block) handle_suite_hook(args, @before_suite_hooks, :push, Hooks::BeforeHook, block) || super(*args, &block) end |
- (Boolean) color
Returns the configuration option for color, but should not be used to check if color is supported.
648 649 650 |
# File 'lib/rspec/core/configuration.rb', line 648 def color value_for(:color) { @color } end |
- (void) color=(true_or_false)
Toggle output color.
662 663 664 665 666 667 668 669 670 671 672 673 |
# File 'lib/rspec/core/configuration.rb', line 662 def color=(true_or_false) return unless true_or_false if RSpec::Support::OS.windows? && !ENV['ANSICON'] RSpec.warning "You must use ANSICON 1.31 or later " \ "(http://adoxa.3eeweb.com/ansicon/) to use colour " \ "on Windows" @color = false else @color = true end end |
- (Boolean) color_enabled?(output = output_stream)
Check if color is enabled for a particular output.
656 657 658 |
# File 'lib/rspec/core/configuration.rb', line 656 def color_enabled?(output=output_stream) output_to_tty?(output) && color end |
- (void) default_formatter
The formatter that will be used if no formatter has been set. Defaults to 'progress'.
713 714 715 |
# File 'lib/rspec/core/configuration.rb', line 713 def default_formatter formatter_loader.default_formatter end |
- (void) default_formatter=(value)
Sets a fallback formatter to use if none other has been set.
724 725 726 |
# File 'lib/rspec/core/configuration.rb', line 724 def default_formatter=(value) formatter_loader.default_formatter = value end |
- (void) define_derived_metadata(*filters) {|metadata| ... }
Defines a callback that can assign derived metadata values.
1441 1442 1443 1444 |
# File 'lib/rspec/core/configuration.rb', line 1441 def (*filters, &block) = Metadata.build_hash_from(filters, :warn_about_example_group_filtering) @derived_metadata_blocks.append(block, ) end |
- (IO, String) deprecation_stream
Determines where deprecation warnings are printed.
Defaults to $stderr
.
141 |
# File 'lib/rspec/core/configuration.rb', line 141 define_reader :deprecation_stream |
- (void) deprecation_stream=(value)
Determines where deprecation warnings are printed.
145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/rspec/core/configuration.rb', line 145 def deprecation_stream=(value) if @reporter && !value.equal?(@deprecation_stream) warn "RSpec's reporter has already been initialized with " \ "#{deprecation_stream.inspect} as the deprecation stream, so your change to "\ "`deprecation_stream` will be ignored. You should configure it earlier for " \ "it to take effect, or use the `--deprecation-out` CLI option. " \ "(Called from #{CallerFilter.first_non_rspec_line})" else @deprecation_stream = value end end |
- (void) disable_monkey_patching!
It configures rspec-mocks and rspec-expectations only
if the user is using those (either explicitly or implicitly
by not setting mock_with
or expect_with
to anything else).
If the user uses this options with mock_with :mocha
(or similiar) they will still have monkey patching active
in their test environment from mocha.
Enables zero monkey patching mode for RSpec. It removes monkey
patching of the top-level DSL methods (describe
,
shared_examples_for
, etc) onto main
and Module
, instead
requiring you to prefix these methods with RSpec.
. It enables
expect-only syntax for rspec-mocks and rspec-expectations. It
simply disables monkey patching on whatever pieces of RSpec
the user is using.
1414 1415 1416 1417 1418 1419 |
# File 'lib/rspec/core/configuration.rb', line 1414 def disable_monkey_patching! self.expose_dsl_globally = false self.disable_monkey_patching = true conditionally_disable_mocks_monkey_patching conditionally_disable_expectations_monkey_patching end |
- (void) exclusion_filter
Returns the exclusion_filter
. If none has been set, returns an empty
hash.
1016 1017 1018 |
# File 'lib/rspec/core/configuration.rb', line 1016 def exclusion_filter filter_manager.exclusions end |
- (void) exclusion_filter=(filter)
Clears and reassigns the exclusion_filter
. Set to nil
if you don't
want any exclusion filter at all.
Warning
This overrides any exclusion filters/tags set on the command line or in configuration files.
1009 1010 1011 1012 |
# File 'lib/rspec/core/configuration.rb', line 1009 def exclusion_filter=(filter) = Metadata.build_hash_from([filter], :warn_about_example_group_filtering) filter_manager.exclude_only end |
- (void) expect_with(*frameworks)
Sets the expectation framework module(s) to be included in each example group.
frameworks
can be :rspec
, :test_unit
, :minitest
, a custom
module, or any combination thereof:
config.expect_with :rspec
config.expect_with :test_unit
config.expect_with :minitest
config.expect_with :rspec, :minitest
config.expect_with OtherExpectationFramework
RSpec will translate :rspec
, :minitest
, and :test_unit
into the
appropriate modules.
Configuration
If the module responds to configuration
, expect_with
will
yield the configuration
object if given a block:
config.expect_with OtherExpectationFramework do |custom_config|
custom_config.custom_setting = true
end
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 |
# File 'lib/rspec/core/configuration.rb', line 596 def expect_with(*frameworks) modules = frameworks.map do |framework| case framework when Module framework when :rspec require 'rspec/expectations' ::RSpec::Matchers when :test_unit require 'rspec/core/test_unit_assertions_adapter' ::RSpec::Core::TestUnitAssertionsAdapter when :minitest require 'rspec/core/minitest_assertions_adapter' ::RSpec::Core::MinitestAssertionsAdapter else raise ArgumentError, "#{framework.inspect} is not supported" end end if (modules - @expectation_frameworks).any? assert_no_example_groups_defined(:expect_with) end if block_given? raise "expect_with only accepts a block with a single argument.  if modules.length > 1 raise "#{modules.first} must respond to `configuration` so that " \ "expect_with can yield it." unless modules.first.respond_to?(:configuration) yield modules.first.configuration end @expectation_frameworks.push(*modules) end |
- (void) expectation_framework=(framework)
Delegates to expect_with(framework).
569 570 571 |
# File 'lib/rspec/core/configuration.rb', line 569 def expectation_framework=(framework) expect_with(framework) end |
- (void) expectation_frameworks
Returns the configured expectation framework adapter module(s)
557 558 559 560 561 562 563 564 565 566 |
# File 'lib/rspec/core/configuration.rb', line 557 def expectation_frameworks if @expectation_frameworks.empty? begin expect_with :rspec rescue LoadError expect_with Module.new end end @expectation_frameworks end |
- (void) expose_current_running_example_as(method_name)
Exposes the current running example via the named
helper method. RSpec 2.x exposed this via example
,
but in RSpec 3.0, the example is instead exposed via
an arg yielded to it
, before
, let
, etc. However,
some extension gems (such as Capybara) depend on the
RSpec 2.x's example
method, so this config option
can be used to maintain compatibility.
1352 1353 1354 1355 1356 1357 1358 1359 |
# File 'lib/rspec/core/configuration.rb', line 1352 def expose_current_running_example_as(method_name) ExposeCurrentExample.module_exec do extend RSpec::SharedContext let(method_name) { |ex| ex } end include ExposeCurrentExample end |
- (void) expose_dsl_globally=(value)
Use this to expose the core RSpec DSL via Module
and the main
object. It will be set automatically but you can override it to
remove the DSL.
Default: true
128 129 130 131 132 133 134 135 136 |
# File 'lib/rspec/core/configuration.rb', line 128 def expose_dsl_globally=(value) if value Core::DSL.expose_globally! Core::SharedExampleGroup::TopLevelDSL.expose_globally! else Core::DSL.remove_globally! Core::SharedExampleGroup::TopLevelDSL.remove_globally! end end |
- (Boolean) expose_dsl_globally?
Indicates if the DSL has been exposed off of modules and main
.
Default: true
120 121 122 |
# File 'lib/rspec/core/configuration.rb', line 120 def expose_dsl_globally? Core::DSL.exposed_globally? end |
- (void) extend(mod, *filters)
Tells RSpec to extend example groups with mod
. Methods defined in
mod
are exposed to example groups (not examples). Use filters
to
constrain the groups to extend.
Similar to include
, but behavior is added to example groups, which
are classes, rather than the examples, which are instances of those
classes.
1095 1096 1097 1098 |
# File 'lib/rspec/core/configuration.rb', line 1095 def extend(mod, *filters) = Metadata.build_hash_from(filters, :warn_about_example_group_filtering) @extend_modules.append(mod, ) end |
- (void) filter_gems_from_backtrace(*gem_names)
The patterns this adds will match the named gems in their common locations (e.g. system gems, vendored with bundler, installed as a :git dependency with bundler, etc) but is not guaranteed to work for all possible gem locations. For example, if you have the gem source in a directory with a completely unrelated name, and use bundler's :path option, this will not filter it.
Adds #backtrace_exclusion_patterns that will filter lines from the named gems from backtraces.
480 481 482 483 484 |
# File 'lib/rspec/core/configuration.rb', line 480 def filter_gems_from_backtrace(*gem_names) gem_names.each do |name| @backtrace_formatter.filter_gem(name) end end |
- (void) filter_run_excluding(*args)
Adds key/value pairs to the exclusion_filter
. If args
includes any symbols that are not part of the hash, each symbol
is treated as a key in the hash with the value true
.
Note
Filters set using this method can be overridden from the command line
or config files (e.g. .rspec
).
996 997<PHONE_NUMBER> |
# File 'lib/rspec/core/configuration.rb', line 996 def filter_run_excluding(*args) = Metadata.build_hash_from(args, :warn_about_example_group_filtering) filter_manager.exclude_with_low_priority static_config_filter_manager.exclude_with_low_priority Metadata.deep_hash_dup() end |
- (void) filter_run_including(*args) Also known as: filter_run
Adds key/value pairs to the inclusion_filter
. If args
includes any symbols that are not part of the hash, each symbol
is treated as a key in the hash with the value true
.
Note
Filters set using this method can be overridden from the command line
or config files (e.g. .rspec
).
936 937 938 939 940 |
# File 'lib/rspec/core/configuration.rb', line 936 def filter_run_including(*args) = Metadata.build_hash_from(args, :warn_about_example_group_filtering) filter_manager.include_with_low_priority static_config_filter_manager.include_with_low_priority Metadata.deep_hash_dup() end |
- (void) format_docstrings(&block)
Formats the docstring output using the block provided.
1244 1245 1246 |
# File 'lib/rspec/core/configuration.rb', line 1244 def format_docstrings(&block) @format_docstrings_block = block_given? ? block : DEFAULT_FORMATTER end |
- (Array) formatters
Returns a duplicate of the formatters currently loaded in
the FormatterLoader
for introspection.
Note as this is a duplicate, any mutations will be disregarded.
734 735 736 |
# File 'lib/rspec/core/configuration.rb', line 734 def formatters formatter_loader.formatters.dup end |
- (void) full_backtrace=(true_or_false)
Toggle full backtrace.
639 640 641 |
# File 'lib/rspec/core/configuration.rb', line 639 def full_backtrace=(true_or_false) @backtrace_formatter.full_backtrace = true_or_false end |
- (Boolean) full_backtrace?
Check if full backtrace is enabled.
633 634 635 |
# File 'lib/rspec/core/configuration.rb', line 633 def full_backtrace? @backtrace_formatter.full_backtrace? end |
- (Array) full_description
Returns full description filter
690 691 692 |
# File 'lib/rspec/core/configuration.rb', line 690 def full_description filter.fetch :full_description, nil end |
- (void) full_description=(description)
Run examples matching on description
in all files to run.
685 686 687 |
# File 'lib/rspec/core/configuration.rb', line 685 def full_description=(description) filter_run :full_description => Regexp.union(*Array(description).map { |d| Regexp.new(d) }) end |
- (void) include(mod, *filters)
Filtered module inclusions can also be applied to individual examples that have matching metadata. Just like Ruby's object model is that every object has a singleton class which has only a single instance, RSpec's model is that every example has a singleton example group containing just the one example.
Tells RSpec to include mod
in example groups. Methods defined in
mod
are exposed to examples (not example groups). Use filters
to
constrain the groups or examples in which to include the module.
1060 1061 1062 1063 |
# File 'lib/rspec/core/configuration.rb', line 1060 def include(mod, *filters) = Metadata.build_hash_from(filters, :warn_about_example_group_filtering) @include_modules.append(mod, ) end |
- (void) inclusion_filter Also known as: filter
Returns the inclusion_filter
. If none has been set, returns an empty
hash.
960 961 962 |
# File 'lib/rspec/core/configuration.rb', line 960 def inclusion_filter filter_manager.inclusions end |
- (void) inclusion_filter=(filter) Also known as: filter=
Clears and reassigns the inclusion_filter
. Set to nil
if you don't
want any inclusion filter at all.
Warning
This overrides any inclusion filters/tags set on the command line or in configuration files.
951 952 953 954 |
# File 'lib/rspec/core/configuration.rb', line 951 def inclusion_filter=(filter) = Metadata.build_hash_from([filter], :warn_about_example_group_filtering) filter_manager.include_only end |
- (void) mock_framework
Returns the configured mock framework adapter module.
409 410 411 412 413 414 415 416 417 418 |
# File 'lib/rspec/core/configuration.rb', line 409 def mock_framework if @mock_framework.nil? begin mock_with :rspec rescue LoadError mock_with :nothing end end @mock_framework end |
- (void) mock_framework=(framework)
Delegates to mock_framework=(framework).
421 422 423 |
# File 'lib/rspec/core/configuration.rb', line 421 def mock_framework=(framework) mock_with framework end |
- (void) mock_with(framework)
Sets the mock framework adapter module.
framework
can be a Symbol or a Module.
Given any of :rspec
, :mocha
, :flexmock
, or :rr
, configures the
named framework.
Given :nothing
, configures no framework. Use this if you don't use
any mocking framework to save a little bit of overhead.
Given a Module, includes that module in every example group. The module should adhere to RSpec's mock framework adapter API:
setup_mocks_for_rspec
- called before each example
verify_mocks_for_rspec
- called after each example if the example hasn't yet failed.
Framework should raise an exception when expectations fail
teardown_mocks_for_rspec
- called after verify_mocks_for_rspec (even if there are errors)
If the module responds to configuration
and mock_with
receives a
block, it will yield the configuration object to the block e.g.
config.mock_with OtherMockFrameworkAdapter do |mod_config|
mod_config.custom_setting = true
end
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/rspec/core/configuration.rb', line 524 def mock_with(framework) framework_module = if framework.is_a?(Module) framework else const_name = MOCKING_ADAPTERS.fetch(framework) do raise ArgumentError, "Unknown mocking framework: #{framework.inspect}. " \ "Pass a module or one of #{MOCKING_ADAPTERS.keys.inspect}" end RSpec::Support.require_rspec_core "mocking_adapters/#{const_name.to_s.downcase}" RSpec::Core::MockingAdapters.const_get(const_name) end new_name, old_name = [framework_module, @mock_framework].map do |mod| mod.respond_to?(:framework_name) ? mod.framework_name : :unnamed end unless new_name == old_name assert_no_example_groups_defined(:mock_framework) end if block_given? raise "#{framework_module} must respond to `configuration` so that " \ "mock_with can yield it." unless framework_module.respond_to?(:configuration) yield framework_module.configuration end @mock_framework = framework_module end |
- (void) order=
Sets the default global order and, if order is 'rand:<seed>'
, also
sets the seed.
1287 |
# File 'lib/rspec/core/configuration.rb', line 1287 delegate_to_ordering_manager :order= |
- (void) prepend(mod, *filters)
Tells RSpec to prepend example groups with mod
. Methods defined in
mod
are exposed to examples (not example groups). Use filters
to
constrain the groups in which to prepend the module.
Similar to include
, but module is included before the example group's class
in the ancestor chain.
1133 1134 1135 1136 |
# File 'lib/rspec/core/configuration.rb', line 1133 def prepend(mod, *filters) = Metadata.build_hash_from(filters, :warn_about_example_group_filtering) @prepend_modules.append(mod, ) end |
- (void) prepend_before(*args, &block)
Adds block
to the start of the list of before
blocks in the same
scope (:example
, :context
, or :suite
), in contrast to #before,
which adds the hook to the end of the list.
See Hooks#before for full before
hook docs.
This method differs from Hooks#prepend_before in only one way: it supports
the :suite
scope. Hooks with the :suite
scope will be run once before
the first example of the entire suite is executed.
1481 1482 1483 1484 |
# File 'lib/rspec/core/configuration.rb', line 1481 def prepend_before(*args, &block) handle_suite_hook(args, @before_suite_hooks, :unshift, Hooks::BeforeHook, block) || super(*args, &block) end |
- (void) raise_errors_for_deprecations!
Turns deprecation warnings into errors, in order to surface the full backtrace of the call site. This can be useful when you need more context to address a deprecation than the single-line call site normally provided.
1374 1375 1376 |
# File 'lib/rspec/core/configuration.rb', line 1374 def raise_errors_for_deprecations! self.deprecation_stream = Formatters::DeprecationFormatter::RaiseErrorStream.new end |
- (void) register_ordering {|list| ... }
Pass the symbol :global
to set the ordering strategy that
will be used to order the top-level example groups and any example
groups that do not have declared :order
metadata.
Registers a named ordering strategy that can later be
used to order an example group's subgroups by adding
:order => <name>
metadata to the example group.
1315 |
# File 'lib/rspec/core/configuration.rb', line 1315 delegate_to_ordering_manager :register_ordering |
- (void) seed
Seed for random ordering (default: generated randomly each run).
When you run specs with --order random
, RSpec generates a random seed
for the randomization and prints it to the output_stream
(assuming
you're using RSpec's built-in formatters). If you discover an ordering
dependency (i.e. examples fail intermittently depending on order), set
this (on Configuration or on the command line with --seed
) to run
using the same seed while you debug the issue.
We recommend, actually, that you use the command line approach so you don't accidentally leave the seed encoded.
1281 |
# File 'lib/rspec/core/configuration.rb', line 1281 delegate_to_ordering_manager :seed |
- (void) seed=
Sets the seed value and sets the default global ordering to random.
1267 |
# File 'lib/rspec/core/configuration.rb', line 1267 delegate_to_ordering_manager :seed= |
- (void) treat_symbols_as_metadata_keys_with_true_values=(_value)
Deprecated. This config option was added in RSpec 2 to pave the way for this being the default behavior in RSpec 3. Now this option is a no-op.
272 273 274 275 276 277 278 279 |
# File 'lib/rspec/core/configuration.rb', line 272 def (_value) RSpec.deprecate( "RSpec::Core::Configuration#treat_symbols_as_metadata_keys_with_true_values=", :message => "RSpec::Core::Configuration#treat_symbols_as_metadata_keys_with_true_values= " \ "is deprecated, it is now set to true as default and " \ "setting it to false has no effect." ) end |
- (void) warnings=(value)
Set Ruby warnings on or off.
1321 1322 1323 |
# File 'lib/rspec/core/configuration.rb', line 1321 def warnings=(value) $VERBOSE = !!value end |
- (Boolean) warnings?
Returns Whether or not ruby warnings are enabled.
1326 1327 1328 |
# File 'lib/rspec/core/configuration.rb', line 1326 def warnings? $VERBOSE end |


WITNESS LIST Agriculture & Livestock Committee (Subcommittee on on Forestry) October 19, 2000-3:00P Forestry On: Alders, David (Self) Barron, Ed (Texas Forest Service) Beasley, Scott (Stephen F. Austin State University) Davis, W.I. (Self) Hull, James (Texas Forest Service) Kroll, James (Stephen F. Austin State University)


Simple Room Generation
During this tutorial we’ll handle adding rooms to our map. We’ll save connecting the rooms via hallways until the next tutorial.
Dungeon Map Rooms
The first thing we’ll need to do is create a place to hold our room information in DungeonMap.cs
. Since all of our rooms are going to start out simple and be rectangular in nature we’ll simple use the Rectangle
class included with RogueSharp
to represent a room.
Some of you might ask why Rectangle
in RogueSharp
is a class
and not a struct
like in many other libraries. The answer is that it’s a mistake on my part. It really should be a struct
. Here is an article on MSDN explaining the difference and when to use one over the other.
Choosing Between Class and Struct: https://msdn.microsoft.com/en-us/library/ms229017(v=vs.110).aspx
Thanks to James Neal for pointing this out and for submitting a pull request to fix it. For our purposes it will work just fine as a class
. On to creating our rooms! Add the following code to DungeonMap.cs
.
public class DungeonMap : Map
{
// ... start of new code
public List<Rectangle> Rooms;
public DungeonMap()
{
// Initialize the list of rooms when we create a new DungeonMap
Rooms = new List<Rectangle>();
}
// ... old code continues here
}
Random Number Generator Singleton
Since our levels will be randomly generated it will be nice to have easy access to a random number generator. By using the same random number generator that was created with a known seed we can always regenerate a level exactly as it was generated before by using the same seed. Open Game.cs
and add the following code:
// Singleton of IRandom used throughout the game when generating random numbers
public static IRandom Random { get; private set; }
public static void Main()
{
// Establish the seed for the random number generator from the current time
int seed = (int) DateTime.UtcNow.Ticks;
Random = new DotNetRandom( seed );
// The title will appear at the top of the console window
// also include the seed used to generate the level
string consoleTitle = $"RougeSharp V3 Tutorial - Level 1 - Seed {seed}";
// ... old code continues here
}
RogueSharp
has several different random number generators that you can read about.
For our purposes we’ll use DotNetRandom
which uses the standard RNG included with .NET. To establish a unique seed each time we start a new game we’ll get the Ticks (The value of this property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001) of the current time. We’re also writing this seed into the title so that we could generate the level again in the future which could be useful for testing or debugging.
Generating Rooms with MapGenerator.cs
If you remember previously we generated our map by only making the outside edges walls, and the entire rest of the map wide open floors. Because we are changing this completely I’m going to paste the entire source code for the new MapGenerator.cs
below and then I’ll review the changes.
public class MapGenerator
{
private readonly int _width;
private readonly int _height;
private readonly int _maxRooms;
private readonly int _roomMaxSize;
private readonly int _roomMinSize;
private readonly DungeonMap _map;
// Constructing a new MapGenerator requires the dimensions of the maps it will create
// as well as the sizes and maximum number of rooms
public MapGenerator( int width, int height,
int maxRooms, int roomMaxSize, int roomMinSize )
{
_width = width;
_height = height;
_maxRooms = maxRooms;
_roomMaxSize = roomMaxSize;
_roomMinSize = roomMinSize;
_map = new DungeonMap();
}
// Generate a new map that places rooms randomly
public DungeonMap CreateMap()
{
// Set the properties of all cells to false
_map.Initialize( _width, _height );
// Try to place as many rooms as the specified maxRooms
// Note: Only using decrementing loop because of WordPress formatting
for ( int r = _maxRooms; r > 0; r-- )
{
// Determine the size and position of the room randomly
int roomWidth = Game.Random.Next( _roomMinSize, _roomMaxSize );
int roomHeight = Game.Random.Next( _roomMinSize, _roomMaxSize );
int roomXPosition = Game.Random.Next( 0, _width - roomWidth - 1 );
int roomYPosition = Game.Random.Next( 0, _height - roomHeight - 1 );
// All of our rooms can be represented as Rectangles
var newRoom = new Rectangle( roomXPosition, roomYPosition,
roomWidth, roomHeight );
// Check to see if the room rectangle intersects with any other rooms
bool newRoomIntersects = _map.Rooms.Any( room => newRoom.Intersects( room ) );
// As long as it doesn't intersect add it to the list of rooms
if ( !newRoomIntersects )
{
_map.Rooms.Add( newRoom );
}
}
// Iterate through each room that we wanted placed
// call CreateRoom to make it
foreach ( Rectangle room in _map.Rooms )
{
CreateRoom( room );
}
return _map;
}
// Given a rectangular area on the map
// set the cell properties for that area to true
private void CreateRoom( Rectangle room )
{
for ( int x = room.Left + 1; x < room.Right; x++ )
{
for ( int y = room.Top + 1; y < room.Bottom; y++ )
{
_map.SetCellProperties( x, y, true, true, true );
}
}
}
}
You’ll notice that we added 3 new parameters to the MapGenerator
constructor. The new parameters are maxRooms
, roomMaxSize
, and roomMinSize
. The way this algorithm works is it will try to create a number of rooms up to maxRooms
on the map. Each room it will try to place in a random position on the map. It will also choose a width and height for the room between roomMinSize
and roomMaxSize
. The final step when placing the room is to see if it overlaps with any other room. If it does overlap then we throw it out.
Hooking up the MapGenerator
Technically the MapGenerator
is already used in Game.cs
however if you tried to build you would get errors. We need to make sure we provide the new parameters that our MapGenerator
requires. In Game.cs
update the following line:
// Old code to change
MapGenerator mapGenerator = new MapGenerator( _mapWidth, _mapHeight );
// New code to replace with
MapGenerator mapGenerator = new MapGenerator( _mapWidth, _mapHeight, 20, 13, 7 );
We’ll attempt to create 20 rooms with sides that are between 7 and 13 cells long. The result should be less than 20 rooms as we throw out any that overlap.
Results
If you run the program now and you are lucky you’ll end up with the Rogue in a room and will be able to move around in that room. Unfortunately since the rooms are not connected you will not be able to leave the room.
If you’re not so lucky you’ll end up with your poor Rogue being stuck in a wall outside of the room. OutsideOfRoomBug
We’ll fix this issue in the next tutorial post where we’ll also get all of our rooms connected. If you are bored waiting for the next tutorial you should try and see if you can come up with a fix for this and also start experimenting with ways to connect the rooms.
Code on GitHub
As always the code for the tutorial series so far can be found on GitHub:
Bored waiting for the next tutorial? The complete tutorial project is already finished and the source code is available on Github:
- Sample Roguelike game using RogueSharp and RLNet console
- Sample Roguelike game using RogueSharp and SadConsole


|
BLE_API
v2.1.3
|
BleDisConnReason | |
| typedef uint8_t | BleDisConnReason |
| #define | BLEDISCONNREASON_AUTHENTICATION_FAILURE (0x05u) |
| #define | BLEDISCONNREASON_PIN_OR_KEY_MISSING (0x06u) |
| #define | BLEDISCONNREASON_CONNECTION_TIMEOUT (0x08u) |
| #define | BLEDISCONNREASON_REMOTE_USER_TERMINATED_CONNECTION (0x13u) |
| #define | BLEDISCONNREASON_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES (0x14u) |
| #define | BLEDISCONNREASON_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_POWER_OFF (0x15u) |
| #define | BLEDISCONNREASON_CONNECTION_TERMINATED_BY_LOCAL_HOST (0x16u) |
| #define | BLEDISCONNREASON_UNSUPPORTED_REMOTE_FEATURE_UNSUPPORTED_LMP_FEATURE (0x1Au) |
| #define | BLEDISCONNREASON_LMP_RESPONSE_TIMEOUT_LL_RESPONSE_TIMEOUT (0x22u) |
| #define | BLEDISCONNREASON_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED (0x29u) |
| #define | BLEDISCONNREASON_UNACCEPTABLE_CONNECTION_INTERVAL (0x3Bu) |
| #define | BLEDISCONNREASON_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE (0x3Du) |
| #define | BLEDISCONNREASON_CONNECTION_FAILED_TO_BE_ESTABLISHED (0x3Eu) |
BLE disconnect reason definition.
| #define BLEDISCONNREASON_AUTHENTICATION_FAILURE (0x05u) |
Authentication failure.
| #define BLEDISCONNREASON_CONNECTION_FAILED_TO_BE_ESTABLISHED (0x3Eu) |
Connection failed to be established.
| #define BLEDISCONNREASON_CONNECTION_TERMINATED_BY_LOCAL_HOST (0x16u) |
Disconnection by the local device host stack.
| #define BLEDISCONNREASON_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE (0x3Du) |
Connection terminated due to MIC failure.
| #define BLEDISCONNREASON_CONNECTION_TIMEOUT (0x08u) |
Connection timeout.
| #define BLEDISCONNREASON_LMP_RESPONSE_TIMEOUT_LL_RESPONSE_TIMEOUT (0x22u) |
LMP response timeout.
| #define BLEDISCONNREASON_PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED (0x29u) |
Pairing with unit key unsupported.
| #define BLEDISCONNREASON_PIN_OR_KEY_MISSING (0x06u) |
Encryption key is missing or not saved on the remote device.
| #define BLEDISCONNREASON_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_LOW_RESOURCES (0x14u) |
Disconnection by the remote device due to low resources.
| #define BLEDISCONNREASON_REMOTE_DEVICE_TERMINATED_CONNECTION_DUE_TO_POWER_OFF (0x15u) |
Disconnection by the remote device due to power off.
| #define BLEDISCONNREASON_REMOTE_USER_TERMINATED_CONNECTION (0x13u) |
Disconnection requested by the remote device users.
| #define BLEDISCONNREASON_UNACCEPTABLE_CONNECTION_INTERVAL (0x3Bu) |
Connection interval unacceptable.
| #define BLEDISCONNREASON_UNSUPPORTED_REMOTE_FEATURE_UNSUPPORTED_LMP_FEATURE (0x1Au) |
Unsupported remote feature.


{% load opening_hours %} {% with periods=store.opening_periods.all %} {% if periods|length %} {% regroup periods by weekday as grouped_periods %}
| {{ weekday.list.0|printable_weekday }} |
{% for period in weekday.list %}
{{ period|printable_period:"H:i" }} {% endfor %} |


I Don’t Need Money For Heart Surgery But For Medicine And Upkeep… - Actor Psalm Adjetefio
by Peace FM OnlineVeteran Ghanaian actor, Psalm Adjetefio has denied calling on Ghanaians to help him raise money for a heart surgery.
In an interview with Kwesi Aboagye on Peace FM Entertainment Review programme, 'TT', as he is popularly called explained how reports emerged that he was soliciting for funds and further went on to disclose his current health condition and what his Doctors have told him so far.
Listen to him in the video below
Featured Video


Hi, I'm Arthur Charles Edwards. I'm a Visual Web Designer, Front-End Enthusiast and Quasi-Sneakerhead. This portfolio showcases the past 7 years of my professional work.
An application to compare medical cost In your Network. A fun application introducing new patterns, sticky navs and new card designs in the Florida Blue Brand
In my career I've worked on responsive web applications, motion media and design systems. I'm looking for more opportunities to expand my design experience.


{% load static %}
Choose from a variety of items sold by our trusted dealers.The product is inspected by our Customer Satisfaction Team before it's Dispached!
To make your Shopping Experience Seamless,we have designated a team to quickly resolve any issues and answer queries by mail or messages.
Buyers and Sellers have been provided with different login sites to ensure only required information to be presented,either to the buyer or the seller. We are also always open to feedback and can answer any questions a user may have about """"""""""""""""".
To Effectively deliver premium products to the user with Assistance
Python
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum at lacus congue, suscipit elit nec, tincidunt orci.
Mauris dolor augue, vulputate in pharetra ac, facilisis nec libero. Fusce condimentum gravida urna, vitae scelerisque erat ornare nec.
Sql
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum at lacus congue, suscipit elit nec, tincidunt orci.
Mauris dolor augue, vulputate in pharetra ac, facilisis nec libero. Fusce condimentum gravida urna, vitae scelerisque erat ornare nec.


What is MSMQ ? Message Queuing (also known as MSMQ) is a messaging infrastructure and a development tool for creating distributed messaging applications for Microsoft Windows operating systems. Applications developed for Message Queuing send messages to queues, which are temporary storage locations, from which messages can proceed to their final destination as conditions permit.
Installing MSMQ The procedures to install MSMQ on Windows Server 2008, Winows Server 2008 R2, Windows 7, Windows Vista, Windows XP, and Windows Server 2003 are available here
Basic Messaging
The image shows the basic messaging scenario. You have two applications: a sending application and a receiving application. A sending application prepares a message and puts it into a queue. A message can be any piece of information that the receiving application understands. The receiving application receives the message from the queue and processes it. One thing to note here is that the sender and the receiver are not tightly coupled and they can work without the other application being online.
Messaging in .Net To build a messaging application we need to create at least three components: queue, application to send messages, and another application to receive these messages.
Types of queues The basic types of MSMQ queues are: private and public. Public queues are those that are published in the active directory. So, applications running on different servers throughout the network can find and use public queues through the active directory. Private queues on the other hand are available locally on a particular machine and are not published in the active directory.
Creating a Queue Queues can be created either programmatically or through the computer management snap-in (if you installed MSMQ on your machine).
Programmatically The System.Messaging.MessageQueue
class
provides all the necessary functionality to work with and manipulate
MSMQ queues. It is like a wrapper around message queuing.
MessageQueue.Create(path) creates a non-transactional message queue
at the specified path (we will talk about transactional and
non-transactional queues later). For public queues, path is
MachineName\QueueName. For private queues,
MachineName\Private$\QueueName. You can use “.” for the local
computer. Code should look like:
MessageQueue privateQueue = MessageQueue.Create(".\Private$\privateQueue");
Through the computer management snap-in Open the computer management snap-in (right click computer, then manage). Navigate to Services and Applications, then Message Queuing. Right click on Private Queues –> New –> Private Queue. Or right click on public Queues –> New –> Public Queue.
Sending a message Use Send() method of your previously created MessageQueue object like so
privateQueue.Send("Message Body (could be any managed object)", "Message Label");
Receiving a message There are two types of operations with respect to reading a message fom the Queue: Peeking and Receiving. When we receive a message from the queue, the message is removed from the queue. Peeking is similar to Receiving but here the message is not removed from the queue. Code could look like
MessageQueue anotherPrivateQueue = new MessageQueue(".\\Private$\\privateQueue");
System.Messaging.Message msg = anotherPrivateQueue.Receive();
Additional Considerations before writing the first complete messaging application
Now, let’s get things together into a “Hello, World” example. Open Visual Studio, New project, Windows forms. All reference to System.Messaging namespace. Then edit your code to look like so:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Messaging;
namespace MSMQ_Demo
{
class Program
{
static void Main(string[] args)
{
try
{
MessageQueue privateQueue;
if (!MessageQueue.Exists(".\\Private$\\privateQueue"))
privateQueue = MessageQueue.Create(".\\Private$\\privateQueue");
else
privateQueue = new MessageQueue(".\\Private$\\privateQueue");
privateQueue.Send("Hello, World !", "Message Label");
MessageQueue anotherPrivateQueue = new MessageQueue(".\\Private$\\privateQueue");
System.Messaging.Message msg = anotherPrivateQueue.Receive();
msg.Formatter = new System.Messaging.XmlMessageFormatter(new Type[1] { typeof(string) });
Console.WriteLine(msg.Body.ToString());
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
If you run the project, you will see a message-box displaying “Hello, World !”. This message content created by had been sent from MSMQ queue, received by another MSMQ, and processed. In our example both the sending and the receiving queues exist in the same application for the sake of simplicity. In real world applications they reside in very different areas.
This is a very basic introduction to MSMQ and non-transactional queues. In future posts, we will explore more advanced topics in MSMQ.


Video by Basstronix This track is original content created by the following artist, inspired by the music from the James Bond Universe for use in the HL2 Mod...
this shit is sick
@fmproductions no need to document the unreal / komodo integration later, I made an API scraper from their docs and a DSL with Haxe.
read: markup markup markup
\o/
powerrrrr
@fmproductions hang on, I'll send you something in DM in a jiffy, need to finish these scripts first, almost done
fmproductions11-Mar-19 06:47 PM
sounds awesome!
TwilightPunkster K6411-Mar-19 06:48 PM
not so much, got to do per line, compile
1
else I'll blow unity up
already pushing the max amount of GPU clips
hehehe, well a fog of war pure on the shader isnt that easy
massive overdraw, so I gotta occlude on the fly
and overcourse... hoverable icons
HAH
I have a great name for a gamedev team
MI-Force
dum dum da da dum dum(edited)
1
in a blink of an eye I'll be there too
tillll their dyingggg dayyyy heeeeyyyy
I gotta license to kill
done, just made some quads with colliders reversed 1 unit behind the icon
them c00l h4x
mhm if I mark them as static, I even get the colliders for free as they are convex
i am a dangerous man with someeee money in ma pocket
Put your pinky rings up to the moon
hashtag blessed
Paul11-Mar-19 09:05 PM
That's my favorite good mood song!!! Party Time
2
TwilightPunkster K6411-Mar-19 09:11 PM
you can't do magic without some good music
Cryptofist11-Mar-19 09:33 PM
FAX
(i havent been hanging in game dev channels..... )
TwilightPunkster K6411-Mar-19 09:35 PM
well, if you want to build community, you need to be embedded in their habitats
Cryptofist11-Mar-19 09:35 PM
Top 3 favorite genres of music?
TwilightPunkster K6411-Mar-19 09:35 PM
I like all kinds of music
Cryptofist11-Mar-19 09:35 PM
Absolutely, i lurked in crypto for close to a year before speaking up(edited)
TwilightPunkster K6411-Mar-19 09:35 PM
but I like powerful, uptempo music
basically what I call "shit-that-makes-me-feel-like-a-fucking-hero" genre
Cryptofist11-Mar-19 09:36 PM
Understood!
TwilightPunkster K6411-Mar-19 09:38 PM
mhm, to make this game more appealing, I think it needs a 4:3 look
@fmproductions the reason why UI objects are bitching with raycasting isn't object related, but caused by some form of "z-fighting" only for the cursor.
@Cryptofist that HODDLLLL taunt is just epic
@Cryptofist are you busy today?
Cryptofist11-Mar-19 09:51 PM
Yeah, up until 3 hours from now
I can record more stuff after boy scouts and kiddo goes to bed if need be.
TwilightPunkster K6411-Mar-19 09:52 PM
I want the elves to be the evil ones
Cryptofist11-Mar-19 09:52 PM
And thanks!!!
Ah ok!
 Lol
Blub blub
TwilightPunkster K6411-Mar-19 09:54 PM
raptors from jurassic park make turtle noises
1
Cryptofist11-Mar-19 09:54 PM
Really
TwilightPunkster K6411-Mar-19 09:54 PM
why I know that is a mystery
Cryptofist11-Mar-19 09:58 PM
Ok ill be back in a few. drop ideas and suggestions here. any new orc noises if needed
if you give ma a list to fill with sounds I can. I was basing what i did off of WC2
hence the burping. lol
TwilightPunkster K6411-Mar-19 10:34 PM
Elves:
"Back to the pit, foul beast"
"I'll end you and with it, your smell"
"Onwards, slay these green bastards"
"Hahahaha, all your base are belong to us"
"Disgusting."
"It reeks like Orc around here."
"Blow them into the ground. Where they belong."
"No... no... Noo!"
"My end.. by the hands of these creatures.."
<damage sounds>
<combat sounds>
- wolf (cry, growl, panting)
- bear (roar, growl aggressive, growl warning)
- tortoise (aggressive, passive)
- lion (growl, roar)
- raccoon (passive/ambient like)
Song: Harder Better Faster Stronger (remix) Artist: Daft Punk Nightcored by: SupraNightcored Image: Vocaloid Fan Made character from Monocross Road Image Lin...


When browsing medals and ribbons, it would be nifty if the ribbon information popped up as well as the Medal info.
Less mouse movement in awards tab = more efficient browsing.
That is all.
Thank you.
xXJumpyXx
Helping Hand
I like this idea. It's a really small feature but it does help quite a bit.
ORFK
Global Moderator
i like it too =)
Topicstarter
slayzakattack
Awesome! Does this mean we may see this feature soon?
ORFK
Global Moderator
maybe, we will see what brain thinks about it.
Topicstarter
slayzakattack
Well regardless of the outcome, better battlelog has been a great addon to my battlefield experience. Thanks, Brian!
chuzuki
I liked the idea so I put together a User JS to do it. This just pulls the info directly from the ribbons and appends to the medals. The reverse is possible too, and of course the formatting can be changed, but as a proof of concept and/or starting point this works well.
var readyStateCheckInterval = setInterval(function() {
if (document.readyState === "complete") {
init();
clearInterval(readyStateCheckInterval);
}
}, 10);
function init() {
var medals = document.getElementsByClassName("profile-stats-awards-progression-item-medal");
var ribbons = document.getElementsByClassName("profile-stats-awards-progression-item-ribbon");
for (var i = 0; i " + ribbonInfo);
break;
}
}
}
};
Topicstarter
slayzakattack
Awesome! Great Job.
Meaurk
Global Moderator
I'd say make a plugin of it. :)
chuzuki
Turns out you can use that exact code for a BBlog plugin, no changes necessary afaik. If you know where I could host the file, I'll make one and put it up. Otherwise, feel free to do whatever you want with the code.
Meaurk
Global Moderator
Oh man, I love the Dropbox feature! :)
Here's the link:
https://dl.dropbox.com/u/97057514/HoverInfoBox.js
EDIT: Moved to the plugin section.
Nano
Global Moderator
chuzuki wrote:
Turns out you can use that exact code for a BBlog plugin, no changes necessary afaik. If you know where I could host the file, I'll make one and put it up. Otherwise, feel free to do whatever you want with the code.
https://github.com/
or
http://code.google.com/
No_Other_xD
how i install this ? =( sorry for my noob question
Firewalker95
Open BB-Log menu -> Plugins -> Add own Plugin -> And theire you insert the plugin url (in this case: "https://dl.dropbox.com/u/97057514/HoverInfoBox.js")
No_Other_xD
Firewalker95 wrote:
Open BB-Log menu -> Plugins -> Add own Plugin -> And theire you insert the plugin url (in this case: "https://dl.dropbox.com/u/97057514/HoverInfoBox.js")


-
Statistical inference with quantum measurements: methodologies for nitrogen vacancy centers in diamond,
Hincks et al. (2018). -
Practical adaptive quantum tomography,
Granade et al. (2016). -
Practical Bayesian tomography,
Granade et al. (2016). -
Quantum bootstrapping via compressed quantum Hamiltonian learning,
Wiebe et al. (2015). -
Accelerated randomized benchmarking,
Granade and Ferrie (2015). -
Quantum Hamiltonian learning using imperfect quantum resources,
Wiebe et al. (2014). -
Hamiltonian Learning and Certification Using Quantum Resources,
Wiebe et al. (2014). -
High posterior density ellipsoids of quantum states,
Ferrie (2014). -
Quantum model averaging,
Ferrie (2014).