iCloud Class Reference
| Inherits from | NSObject |
| Declared in | iCloud.h |
Overview
iCloud Document Sync makes it easy for developers to integrate the iCloud document storage APIs into iOS applications. This is how iCloud document-storage and management should’ve been out of the box from Apple. Integrate iCloud into iOS (OS X coming soon) Objective-C document projects with one-line code methods. Sync, upload, manage, and remove documents to and from iCloud with only a few lines of code (compared to the hundreds of lines and hours that it usually takes). Get iCloud up and running in your iOS app in only a few minutes. Updates and more details on this project can be found on GitHub. If you like the project, please star it on GitHub!
The iCloud
class provides methods to integrate iCloud into document projects.
Adding iCloud Document Sync to your project is easy. Follow these steps below to get everything up and running.
- Drag the iCloud Framework into your project
- Add
#import <iCloud/iCloud.h>
to your header file(s) iCloud Document Sync - Subscribe to the
iCloudDelegate
delegate. Call the following methods to setup iCloud when your app starts:
[[iCloud sharedCloud] setDelegate:self]; // Set this if you plan to use the delegate [[iCloud sharedCloud] setVerboseLogging:YES]; // We want detailed feedback about what’s going on with iCloud, this is OFF by default [[iCloud sharedCloud] updateFiles]; // Force iCloud Update: This is done automatically when changes are made, but we want to make sure the view is always updated when presented
Warning: Only available on iOS 6.0 and later on apps with valid code signing and entitlements. Requires Xcode 5.0.1 and later. Check the online documentation for more information on setting up iCloud in your app.
Tasks
Singleton
-
+ sharedCloud
iCloud shared instance object
Delegate
-
delegate
iCloud Delegate helps call methods when document processes begin or end
property
Properties
-
query
The current NSMetadataQuery object
property -
fileList
A list of iCloud files from the current query
property -
previousQueryResults
A list of iCloud files from the previous query
property -
verboseLogging
Enable verbose logging for detailed feedback in the log. Turning this off only prints crucial log notes such as errors.
property -
verboseAvailabilityLogging
Enable verbose availability logging for repeated feedback about iCloud availability in the log. Turning this off will prevent availability-related messages from being printed in the log. This property does not relate to the verboseLogging property.
property
Checking for iCloud
-
– checkCloudAvailability
Check whether or not iCloud is available and that it can be accessed. Returns a boolean value.
-
– checkCloudUbiquityContainer
Check that the current application’s iCloud Ubiquity Container is available. Returns a boolean value.
-
– ubiquitousContainerURL
Retrieve the current application’s ubiquitous root URL
-
– ubiquitousDocumentsDirectoryURL
Retrieve the current application’s ubiquitous documents directory URL
Syncing with iCloud
-
– updateFiles
Check for and update the list of files stored in your app’s iCloud Documents Folder. This method is automatically called by iOS when there are changes to files in the iCloud Directory. The iCloudFilesDidChange:withNewFileNames: delegate method is triggered by this method.
Uploading to iCloud
-
– saveAndCloseDocumentWithName:withContent:completion:
Create, save, and close a document in iCloud.
-
– uploadLocalOfflineDocumentsWithRepeatingHandler:completion:
Upload any local files that weren’t created with iCloud
-
– uploadLocalDocumentToCloudWithName:completion:
Upload a local file to iCloud
Sharing iCloud Content
-
– shareDocumentWithName:completion:
Share an iCloud document by uploading it to a public URL.
Deleting iCloud Content
-
– deleteDocumentWithName:completion:
Delete a document from iCloud.
-
– evictCloudDocumentWithName:completion:
Evict a document from iCloud, move it from iCloud to the current application’s local documents directory.
Retrieving iCloud Content and Info
-
– retrieveCloudDocumentWithName:completion:
Open a UIDocument stored in iCloud. If the document does not exist, a new blank document will be created using the documentName provided. You can use the doesFileExistInCloud: method to check if a file exists before calling this method.
-
– retrieveCloudDocumentObjectWithName:
Get the relevant iCloudDocument object for the specified file
-
– doesFileExistInCloud:
Check if a file exists in iCloud
-
– fileSize:
Get the size of a file stored in iCloud
-
– fileModifiedDate:
Get the last modified date of a file stored in iCloud
-
– fileCreatedDate:
Get the creation date of a file stored in iCloud
-
– listCloudFiles
Get a list of files stored in iCloud
Managing iCloud Content
-
– renameOriginalDocument:withNewName:completion:
Rename a document in iCloud
-
– duplicateOriginalDocument:withNewName:completion:
Duplicate a document in iCloud
iCloud Document State
-
– documentStateForFile:completion:
Get the current document state of a file stored in iCloud
-
– monitorDocumentStateForFile:onTarget:withSelector:
Monitor changes in the state of a document stored in iCloud
-
– stopMonitoringDocumentStateChangesForFile:onTarget:
Stop monitoring changes to the state of a document stored in iCloud
Resolving iCloud Conflicts
-
– findUnresolvedConflictingVersionsOfFile:
Find all the conflicting versions of a specified document
-
– resolveConflictForFile:withSelectedFileVersion:
Your application can follow one of three strategies for resolving document-version conflicts:
- Merge the changes from the conflicting versions.
- Choose one of the document versions based on some pertinent factor, such as the version with the latest modification date.
- Enable the user to view conflicting versions of a document and select the one to use.
Deprecated Methods
-
– getListOfCloudFiles
DEPRECATED. Use listCloudFiles instead. Get a list of files stored in iCloud (Deprecated: Deprecated in version 7.3. Use listCloudFiles instead.)
-
– saveChangesToDocumentWithName:withContent:completion:
DEPRECATED. Use saveAndCloseDocumentWithName:withContent:completion: instead. Record changes made to a document in iCloud. Changes are saved when the document is closed. (Deprecated: Deprecated beginning in version 7.1. Use saveAndCloseDocumentWithName:withContent:completion: instead. This method may become unavailable in a future version.)
-
+ uploadLocalOfflineDocumentsWithDelegate:
DEPRECATED. Use uploadLocalOfflineDocuments instead, like so: [[iCloud sharedCloud] uploadLocalOfflineDocuments]; (Deprecated: Deprecated in version 7.0. Use uploadLocalOfflineDocuments instead.)
-
+ updateFilesWithDelegate:
DEPRECATED. Use updateFiles instead, like so: [[iCloud sharedCloud] updateFiles]; (Deprecated: Deprecated in version 7.0. Use updateFiles instead.)
Properties
delegate
iCloud Delegate helps call methods when document processes begin or end
@property (weak, nonatomic) id<iCloudDelegate> delegate
Declared In
iCloud.h
fileList
A list of iCloud files from the current query
@property (strong) NSMutableArray *fileList
Declared In
iCloud.h
previousQueryResults
A list of iCloud files from the previous query
@property (strong) NSMutableArray *previousQueryResults
Declared In
iCloud.h
query
The current NSMetadataQuery object
@property (strong) NSMetadataQuery *query
Declared In
iCloud.h
verboseAvailabilityLogging
Enable verbose availability logging for repeated feedback about iCloud availability in the log. Turning this off will prevent availability-related messages from being printed in the log. This property does not relate to the verboseLogging property.
@property BOOL verboseAvailabilityLogging
Declared In
iCloud.h
Class Methods
sharedCloud
iCloud shared instance object
+ (instancetype)sharedCloud
Return Value
The shared instance of iCloud
Declared In
iCloud.h
updateFilesWithDelegate:
DEPRECATED. Use updateFiles instead, like so: [[iCloud sharedCloud] updateFiles]; (Deprecated: Deprecated in version 7.0. Use updateFiles instead.)
+ (void)updateFilesWithDelegate:(id<iCloudDelegate>)delegate
Parameters
- delegate
The iCloudDelegate object to be used for delegate notifications
Declared In
iCloud.h
uploadLocalOfflineDocumentsWithDelegate:
DEPRECATED. Use uploadLocalOfflineDocuments instead, like so: [[iCloud sharedCloud] uploadLocalOfflineDocuments]; (Deprecated: Deprecated in version 7.0. Use uploadLocalOfflineDocuments instead.)
+ (void)uploadLocalOfflineDocumentsWithDelegate:(id<iCloudDelegate>)delegate
Parameters
- delegate
The iCloudDelegate object to be used for delegate notifications
Declared In
iCloud.h
Instance Methods
checkCloudAvailability
Check whether or not iCloud is available and that it can be accessed. Returns a boolean value.
- (BOOL)checkCloudAvailability
Return Value
YES if iCloud is available. NO if iCloud is not available.
Discussion
You should always check if iCloud is available before performing any iCloud operations (every method checks to make sure iCloud is available before continuing). Additionally, you may want to check if your users want to opt-in to iCloud on a per-app basis (according to Apple’s documentation, you should only ask the user once to opt-in to iCloud). The Return value could be NO (iCloud Unavailable) for one or more of the following reasons:
- iCloud is turned off by the user
- The entitlements profile, code signing identity, and/or provisioning profile is invalid
This method uses the ubiquityIdentityToken to check if iCloud is available. The delegate method iCloudAvailabilityDidChangeToState:withUbiquityToken:withUbiquityContainer: can be used to automatically detect changes in the availability of iCloud. A ubiquity token is passed in that method which lets you know if the iCloud account has changed.
Declared In
iCloud.h
checkCloudUbiquityContainer
Check that the current application’s iCloud Ubiquity Container is available. Returns a boolean value.
- (BOOL)checkCloudUbiquityContainer
Return Value
YES if the iCloud ubiquity container is available. NO if the ubiquity container is not available.
Discussion
This method may not return immediately, depending on a number of factors. It is not necessary to call this method directly, although it may become useful in certain situations.
Declared In
iCloud.h
deleteDocumentWithName:completion:
Delete a document from iCloud.
- (void)deleteDocumentWithName:(NSString *)documentName completion:(void ( ^ ) ( NSError *error ))handler
Parameters
- documentName
The name of the document to delete from iCloud. This value must not be nil.
- handler
Code block called when a file is successfully deleted from iCloud. The NSError object contains any error information if an error occurred, otherwise it will be nil.
Discussion
Permanently delete a document stored in iCloud. This will only affect copies of the specified file stored in iCloud, if there is a copy stored locally it will not be affected.
Declared In
iCloud.h
documentStateForFile:completion:
Get the current document state of a file stored in iCloud
- (void)documentStateForFile:(NSString *)documentName completion:(void ( ^ ) ( UIDocumentState *documentState , NSString *userReadableDocumentState , NSError *error ))handler
Parameters
- documentName
The name of the file in iCloud. This value must not be nil.
- handler
Completion handler that passes three parameters, an NSError, NSString and a UIDocumentState. The documentState parameter represents the document state that the specified file is currently in (may be nil if the file does not exist). The userReadableDocumentState parameter is an NSString which succinctly describes the current document state; if the file does not exist, a non-scary error will be displayed. The NSError parameter will contain a 404 error if the file does not exist.
Declared In
iCloud.h
doesFileExistInCloud:
Check if a file exists in iCloud
- (BOOL)doesFileExistInCloud:(NSString *)documentName
Parameters
- documentName
The name of the UIDocument in iCloud. This value must not be nil.
Return Value
BOOL value, YES if the file does exist in iCloud, NO if it does not. May return NO if iCloud is unavailable.
Declared In
iCloud.h
duplicateOriginalDocument:withNewName:completion:
Duplicate a document in iCloud
- (void)duplicateOriginalDocument:(NSString *)documentName withNewName:(NSString *)newName completion:(void ( ^ ) ( NSError *error ))handler
Parameters
- documentName
The name of the document being duplicated in iCloud. The file specified should exist, otherwise an error will occur. This value must not be nil.
- newName
The new name which the document should be duplicated to (usually the same name with the word “copy” appended to the end). The file specified should not exist, otherwise an error will occur. This value must not be nil.
- handler
Code block called when the document duplication has completed. The completion block passes and NSError object which contains any error information if an error occurred, otherwise it will be nil.
Declared In
iCloud.h
evictCloudDocumentWithName:completion:
Evict a document from iCloud, move it from iCloud to the current application’s local documents directory.
- (void)evictCloudDocumentWithName:(NSString *)documentName completion:(void ( ^ ) ( NSError *error ))handler
Parameters
- documentName
The name of the iCloud document being downloaded from iCloud to the local documents directory. This value must not be nil.
- handler
Code block called after the file has been uploaded to iCloud. This value must not be nil.
Discussion
Remove a document from iCloud storage and move it into the local document’s directory. This method may call the iCloudFileConflictBetweenCloudFile:andLocalFile: iCloud Delegate method if there is a file conflict.
Declared In
iCloud.h
fileCreatedDate:
Get the creation date of a file stored in iCloud
- (NSDate *)fileCreatedDate:(NSString *)documentName
Parameters
- documentName
The name of the file in iCloud. This value must not be nil.
Return Value
The date that the file was created. Returns nil if the file does not exist. May return a nil value if iCloud is unavailable.
Declared In
iCloud.h
fileModifiedDate:
Get the last modified date of a file stored in iCloud
- (NSDate *)fileModifiedDate:(NSString *)documentName
Parameters
- documentName
The name of the file in iCloud. This value must not be nil.
Return Value
The date that the file was last modified. Returns nil if the file does not exist. May return a nil value if iCloud is unavailable.
Declared In
iCloud.h
fileSize:
Get the size of a file stored in iCloud
- (NSNumber *)fileSize:(NSString *)documentName
Parameters
- documentName
The name of the file in iCloud. This value must not be nil.
Return Value
The number of bytes in an unsigned long long. Returns nil if the file does not exist. May return a nil value if iCloud is unavailable.
Declared In
iCloud.h
findUnresolvedConflictingVersionsOfFile:
Find all the conflicting versions of a specified document
- (NSArray *)findUnresolvedConflictingVersionsOfFile:(NSString *)documentName
Parameters
- documentName
The name of the file in iCloud. This value must not be nil.
Return Value
An array of NSFileVersion objects, or nil if no such version object exists.
Declared In
iCloud.h
getListOfCloudFiles
DEPRECATED. Use listCloudFiles instead. Get a list of files stored in iCloud (Deprecated: Deprecated in version 7.3. Use listCloudFiles instead.)
- (NSArray *)getListOfCloudFiles
Return Value
NSArray with a list of all the files currently stored in your app’s iCloud Documents directory. May return a nil value if iCloud is unavailable.
Declared In
iCloud.h
listCloudFiles
Get a list of files stored in iCloud
- (NSArray *)listCloudFiles
Return Value
NSArray with a list of all the files currently stored in your app’s iCloud Documents directory. May return a nil value if iCloud is unavailable.
Declared In
iCloud.h
monitorDocumentStateForFile:onTarget:withSelector:
Monitor changes in the state of a document stored in iCloud
- (BOOL)monitorDocumentStateForFile:(NSString *)documentName onTarget:(id)sender withSelector:(SEL)selector
Parameters
- documentName
The name of the file in iCloud. This value must not be nil.
- sender
Object registering as an observer. This value must not be nil.
- selector
Selector to be called when the document state changes. Must only have one argument, an instance of NSNotifcation whose object is an iCloudDocument (UIDocument subclass). This value must not be nil.
Return Value
YES if the monitoring was successfully setup, NO if there was an issue setting up the monitoring.
Declared In
iCloud.h
renameOriginalDocument:withNewName:completion:
Rename a document in iCloud
- (void)renameOriginalDocument:(NSString *)documentName withNewName:(NSString *)newName completion:(void ( ^ ) ( NSError *error ))handler
Parameters
- documentName
The name of the document being renamed in iCloud. The file specified should exist, otherwise an error will occur. This value must not be nil.
- newName
The new name which the document should be renamed with. The file specified should not exist, otherwise an error will occur. This value must not be nil.
- handler
Code block called when the document renaming has completed. The completion block passes and NSError object which contains any error information if an error occurred, otherwise it will be nil.
Declared In
iCloud.h
resolveConflictForFile:withSelectedFileVersion:
Your application can follow one of three strategies for resolving document-version conflicts:
- Merge the changes from the conflicting versions.
- Choose one of the document versions based on some pertinent factor, such as the version with the latest modification date.
- Enable the user to view conflicting versions of a document and select the one to use.
- (void)resolveConflictForFile:(NSString *)documentName withSelectedFileVersion:(NSFileVersion *)documentVersion
Parameters
- documentName
The name of the file in iCloud. This value must not be nil.
- documentVersion
The version of the document which should be kept and saved. All other conflicting versions will be removed.
Declared In
iCloud.h
retrieveCloudDocumentObjectWithName:
Get the relevant iCloudDocument object for the specified file
- (iCloudDocument *)retrieveCloudDocumentObjectWithName:(NSString *)documentName
Parameters
- documentName
The name of the UIDocument stored in iCloud. This value must not be nil.
Return Value
An iCloudDocument (UIDocument subclass) object. May return nil if iCloud is unavailable or if an error occurred
Discussion
This method serves a very different purpose from the retrieveCloudDocumentWithName:completion: method. Understand the differences between both methods and ensure that you are using the correct one. This method does not open, create, or save any UIDocuments - it simply returns the iCloudDocument object which you can then use for various purposes.
Declared In
iCloud.h
retrieveCloudDocumentWithName:completion:
Open a UIDocument stored in iCloud. If the document does not exist, a new blank document will be created using the documentName provided. You can use the doesFileExistInCloud: method to check if a file exists before calling this method.
- (void)retrieveCloudDocumentWithName:(NSString *)documentName completion:(void ( ^ ) ( UIDocument *cloudDocument , NSData *documentData , NSError *error ))handler
Parameters
- documentName
The name of the document in iCloud. This value must not be nil.
- handler
Code block called when the document is successfully retrieved (opened or downloaded). The completion block passes UIDocument and NSData objects containing the opened document and it’s contents in the form of NSData. If there is an error, the NSError object will have an error message (may be nil if there is no error). This value must not be nil.
Discussion
This method will attempt to open the specified document. If the file does not exist, a blank one will be created. The completion handler is called when the file is opened or created (either successfully or not). The completion handler contains a UIDocument, NSData, and NSError all of which contain information about the opened document.
[[iCloud sharedCloud]<EMAIL_ADDRESS>completion:^(UIDocument *cloudDocument, NSData *documentData, NSError *error) {
if (error == nil) {
NSString *documentName = [cloudDocument.fileURL lastPathComponent];
NSData *fileData = documentData;
}
}];
Declared In
iCloud.h
saveAndCloseDocumentWithName:withContent:completion:
Create, save, and close a document in iCloud.
- (void)saveAndCloseDocumentWithName:(NSString *)documentName withContent:(NSData *)content completion:(void ( ^ ) ( UIDocument *cloudDocument , NSData *documentData , NSError *error ))handler
Parameters
- documentName
The name of the document being written to iCloud. This value must not be nil.
- content
The data to write to the document
- handler
Code block called when the document is successfully saved. The completion block passes UIDocument and NSData objects containing the saved document and it’s contents in the form of NSData. The NSError object contains any error information if an error occurred, otherwise it will be nil.
Discussion
First, iCloud Document Sync checks if the specified document exists. If the document exists it is saved and closed. If the document does not exist, it is created then closed.
iCloud Document Sync uses UIDocument and NSData to store and manage files. All of the heavy lifting with NSData and UIDocument is handled for you. There’s no need to actually create or manage any files, just give iCloud Document Sync your data, and the rest is done for you.
To create a new document or save an existing one (close the document), use this method. Below is a code example of how to use it.
[[iCloud sharedCloud]<EMAIL_ADDRESS>withContent:[NSData data] completion:^(UIDocument *cloudDocument, NSData *documentData, NSError *error) {
if (error == nil) {
// Code here to use the UIDocument or NSData objects which have been passed with the completion handler
}
}];
Documents can be created even if the user is not connected to the internet. The only case in which a document will not be created is when the user has disabled iCloud or if the current application is not setup for iCloud.
Declared In
iCloud.h
saveChangesToDocumentWithName:withContent:completion:
DEPRECATED. Use saveAndCloseDocumentWithName:withContent:completion: instead. Record changes made to a document in iCloud. Changes are saved when the document is closed. (Deprecated: Deprecated beginning in version 7.1. Use saveAndCloseDocumentWithName:withContent:completion: instead. This method may become unavailable in a future version.)
- (void)saveChangesToDocumentWithName:(NSString *)documentName withContent:(NSData *)content completion:(void ( ^ ) ( UIDocument *cloudDocument , NSData *documentData , NSError *error ))handler
Parameters
- documentName
The name of the document being written to iCloud. This value must not be nil.
- content
The data to write to the document
- handler
Code block called when the document changes are recorded. The completion block passes UIDocument and NSData objects containing the saved document and it’s contents in the form of NSData. The NSError object contains any error information if an error occurred, otherwise it will be nil.
Declared In
iCloud.h
shareDocumentWithName:completion:
Share an iCloud document by uploading it to a public URL.
- (NSURL *)shareDocumentWithName:(NSString *)documentName completion:(void ( ^ ) ( NSURL *sharedURL , NSDate *expirationDate , NSError *error ))handler
Parameters
- documentName
The name of the iCloud file being uploaded to a public URL. This value must not be nil.
- handler
Code block called when the document is successfully uploaded. The completion block passes NSURL, NSDate, and NSError objects. The NSURL object is the public URL where the file is available at, could be nil. The NSDate object is the date that the URL expires on, could be nil. The NSError object contains any error information if an error occurred, otherwise it will be nil.
Return Value
The public URL where the file is available
Discussion
Upload a document stored in iCloud to a public location on the internet for a limited amount of time.
Declared In
iCloud.h
stopMonitoringDocumentStateChangesForFile:onTarget:
Stop monitoring changes to the state of a document stored in iCloud
- (BOOL)stopMonitoringDocumentStateChangesForFile:(NSString *)documentName onTarget:(id)sender
Parameters
- documentName
The name of the file in iCloud. This value must not be nil.
- sender
Object registered as an observer that will no longer receive document state updates. This value must not be nil.
Return Value
YES if the monitoring was successfully setup, NO if there was an issue setting up the monitoring.
Declared In
iCloud.h
ubiquitousContainerURL
Retrieve the current application’s ubiquitous root URL
- (NSURL *)ubiquitousContainerURL
Return Value
An NSURL with the root iCloud Ubiquitous URL for the current app. May return nil if iCloud is not properly setup or available.
Declared In
iCloud.h
ubiquitousDocumentsDirectoryURL
Retrieve the current application’s ubiquitous documents directory URL
- (NSURL *)ubiquitousDocumentsDirectoryURL
Return Value
An NSURL with the iCloud ubiquitous documents directory URL for the current app. May return nil if iCloud is not properly setup or available.
Declared In
iCloud.h
updateFiles
Check for and update the list of files stored in your app’s iCloud Documents Folder. This method is automatically called by iOS when there are changes to files in the iCloud Directory. The iCloudFilesDidChange:withNewFileNames: delegate method is triggered by this method.
- (void)updateFiles
Declared In
iCloud.h
uploadLocalDocumentToCloudWithName:completion:
Upload a local file to iCloud
- (void)uploadLocalDocumentToCloudWithName:(NSString *)documentName completion:(void ( ^ ) ( NSError *error ))handler
Parameters
- documentName
The name of the local file stored in the application’s documents directory. This value must not be nil.
- handler
Code block called after the file has been uploaded to iCloud
Declared In
iCloud.h
uploadLocalOfflineDocumentsWithRepeatingHandler:completion:
Upload any local files that weren’t created with iCloud
- (void)uploadLocalOfflineDocumentsWithRepeatingHandler:(void ( ^ ) ( NSString *documentName , NSError *error ))repeatingHandler completion:(void ( ^ ) ( void ))completion
Parameters
- repeatingHandler
Code block called after each file is uploaded to iCloud. This block is called every-time a local file is uploaded, therefore it may be called multiple times. The NSError object contains any error information if an error occurred, otherwise it will be nil.
- completion
Code block called after all files have been uploaded to iCloud. This block is only called once at the end of the method, regardless of any successes or failures that may have occurred during the upload(s).
Discussion
Files in the local documents directory that do not already exist in iCloud will be moved into iCloud one by one. This process involves lots of file manipulation and as a result it may take a long time. This process will be performed on the background thread to avoid any lag or memory problems. When the upload processes end, the completion block is called on the main thread.
[[iCloud sharedCloud] uploadLocalOfflineDocumentsWithRepeatingHandler:^(NSString *documentName, NSError *error) {
if (error == nil) {
// This code block is called repeatedly until all files have been uploaded (or an upload has at least been attempted).
// Code here to use the NSString (the name of the uploaded file) which have been passed with the repeating handler
}
} completion:^{
// Completion handler could be used to tell the user that the upload has completed
}];
This method may call the iCloudFileConflictBetweenCloudFile:andLocalFile: iCloud Delegate method if there is a file conflict.
Declared In
iCloud.h


Generative Methods Assignments
| Assignment | Description | Objective |
|---|---|---|
| Assignment 1: | This! | Getting familiarized with Git, HTML, JS, and CSS. |
| Assignment 2: | Animation & GIFs | Learn about canvases, seamless loops, and animating in JS. |
| Assignment 3: | Drawing Tool | Create different pens for users to create with using P5. |
| Assignment 4: | Particle Movement | Have Braintenberg-style and other forces impact particles on-screen. |
| Assignment 5: | RosieBot | Create a chatbot that uses Tracery to respond. |


|
SPHinXsys
alpha version
|
The base of regression test for various method (time-averaged, ensemble-averaged, dynamic time warping) More...
#include <regression_test_base.h>
Inherits ObserveMethodType.
Inherited by SPH::RegressionTestTimeAveraged< ObserveMethodType >.
Public Member Functions | |
| template<typename... ConstructorArgs> | |
| RegressionTestBase (ConstructorArgs &&...args) | |
| void | writeToXml (ObservedQuantityRecording< VariableType > *observe_method, size_t iteration=0) |
| template<typename ReduceType > | |
| void | writeToXml (BodyReducedQuantityRecording< ReduceType > *reduce_method, size_t iteration=0) |
| void | readFromXml (ObservedQuantityRecording< VariableType > *observe_method) |
| template<typename ReduceType > | |
| void | readFromXml (BodyReducedQuantityRecording< ReduceType > *reduce_method) |
| void | transposeTheIndex () |
| void | readResultFromXml () |
| void | writeResultToXml () |
| void | readResultFromXml (int index_of_run_) |
| void | writeResultToXml (int index_of_run_) |
| void | writeToFile (size_t iteration=0) override |
| void | writeXmlToXmlFile () |
| void | readXmlFromXmlFile () |
Protected Attributes | |
| std::string | input_folder_path_ |
| std::string | in_output_filefullpath_ |
| std::string | result_filefullpath_ |
| std::string | runtimes_filefullpath_ |
| std::string | converged |
| XmlMemoryIO | xmlmemory_io_ |
| XmlEngine | observe_xml_engine_ |
| XmlEngine | result_xml_engine_in_ |
| XmlEngine | result_xml_engine_out_ |
| StdVec< std::string > | element_tag_ |
| DoubleVec< VariableType > | current_result_ |
| DoubleVec< VariableType > | current_result_trans_ |
| DoubleVec< VariableType > | result_in_ |
| TripleVec< VariableType > | result_ |
| int | snapshot_ |
| int | observation_ |
| int | difference_ |
| int | number_of_run_ |
| int | label_for_repeat_ |
| int | number_of_snapshot_old_ |
The base of regression test for various method (time-averaged, ensemble-averaged, dynamic time warping)
The results of current run is saved in a vector of vector. The inner vector gives the values on the observations points. The outer vector gives the snap shots of the observations. The results of all runs is saved in a triple vector, where the outermost vector gives the observations of the runs.
| void SPH::RegressionTestBase< ObserveMethodType >::readResultFromXml | ( | ) |
transpose the current result (from snapshot*observation to observation*snapshot).
| void SPH::RegressionTestBase< ObserveMethodType >::readResultFromXml | ( | int | index_of_run_ | ) |
write the result to the .xml file. (all result)
|
inline |
read current result from Xml file into Xml memory.
| void SPH::RegressionTestBase< ObserveMethodType >::writeResultToXml | ( | ) |
read the result from the .xml file. (all result)
| void SPH::RegressionTestBase< ObserveMethodType >::writeResultToXml | ( | int | index_of_run_ | ) |
write result to .xml (with different data structure to Base), here is observation * snapshot, which can be used for TA and DTW methods.
|
inlineoverride |
the interface to write observed quantity into xml memory.
|
inline |
the interface to write xml memory into Xml file.


Due to technical difficulties, our<EMAIL_ADDRESS>address failed to receive emails sent to it between January 6 and January 23, 2017.
If you sent us any emails during that time period, please re-send them to ensure that we receive them so we can best assist you!
After 13 years of business, Mosher Physical Therapy is no longer seeing patients. If you need patient records or still have questions a bill, you may still reach us at the contact info below.
Email<EMAIL_ADDRESS>Phone:<PHONE_NUMBER> (please leave us a message and your call will be returned)


--- layout: page title: "The Secure HyperText Transfer Protocol (S-HTTP)" description: "This memo describes a syntax for securing messages sent using the Hypertext Transfer Protocol (HTTP), which forms the basis for the World Wide Web. Secure HTTP (S-HTTP) provides independently applicable security services for transaction confidentiality, authenticity/integrity and non-repudiability of origin. The protocol emphasizes maximum flexibility in choice of key management mechanisms, security policies and cryptographic algorithms by supporting option negotiation between parties for each transaction." ---
| Document Name: | RFC 2660 |
|---|---|
| Document URI: |
urn:ietf:rfc:2660
|
| Online Version: |
https://datatracker.ietf.org/doc/html/rfc2660
|
| Organization: | Internet Engineering Task Force (IETF) |
| Series: | Request for Comments (RFC) |
| Abstract: | This memo describes a syntax for securing messages sent using the Hypertext Transfer Protocol (HTTP), which forms the basis for the World Wide Web. Secure HTTP (S-HTTP) provides independently applicable security services for transaction confidentiality, authenticity/integrity and non-repudiability of origin. The protocol emphasizes maximum flexibility in choice of key management mechanisms, security policies and cryptographic algorithms by supporting option negotiation between parties for each transaction. |
Security-Scheme
Return to ( Series | Organization | all Specifications )


Registration Form
Personal details
First name:
Last name:
Email Address:
Gender:
Male
Female
City
City:
Amman
Subscribe


|
Assimp
5.0.1, master @ cd42b955
|
Float key - quite similar to aiVectorKey and aiQuatKey. More...
Public Member Functions | |
| bool | operator!= (const aiFloatKey &o) const |
| bool | operator< (const aiFloatKey &o) const |
| bool | operator== (const aiFloatKey &o) const |
| bool | operator> (const aiFloatKey &o) const |
Public Attributes | |
| double | mTime |
| The time of this key. More... | |
| ai_real | mValue |
| The value of this key. More... | |
Float key - quite similar to aiVectorKey and aiQuatKey.
Both are in the C-API, so it would be difficult to make them a template.
|
inline |
|
inline |
|
inline |
|
inline |
| double Assimp::D3DS::aiFloatKey::mTime |
The time of this key.
| ai_real Assimp::D3DS::aiFloatKey::mValue |
The value of this key.


Zound
Online Store for Musical Instruments
Home
My Account
Customer Services
Contact Us
Best Choice for Your Music
String Instruments
Wind Instruments
Drums & Precussion
Key Boards
Our Best Offers for You
No-212/5, Main Street, Badulla.
<EMAIL_ADDRESS>+944658352464
|
+946789765432
Zound©2k17


Google Assistant rolling out personalized audio playlist with ‘Your News Update’
by Abner LiSince 2016, Google Assistant has let you ask for and hear the news. Users previously had to manually curate publications and sources, but a new “Your News Update” feature handles that work for you.
This “smarter way to listen to the news hosted by the Google Assistant” generates a hyper-personalized listening playlist every time you say “Hey Google, play me the news” on phones, Home, and Smart Displays.
Your News Update includes a “mix of short news stories chosen in that moment based on your interests, location, user history, and preferences, as well as the top news stories out there.” Following headline stories is longer-form content that provides deep dives.
If you’re a Steelers fan who follows the stock market and lives in Chicago, for example, you might hear a story about the latest “L” construction, an analysis of last Thursday’s Steelers game and a market update, in addition to the latest national headlines.
Once rolled out, visiting News in Assistant settings will let you select a “News playlist format.” The old manually curated “News briefing” option is still available, but Your News Update is now ranked first: “A mix of top headlines and stories based on your interests that refreshes every time you play it.”
Your News Update is rolling out now in English to the United States. Google plans to expand internationally next year.
Over the past two years, Google worked with publishers around the world and names 42 participating partners, including Politico, Reuters, AP, and the NBA. Today’s feature builds on an ability introduced in 2018 to ask for news about specific topics, like “Hey Google, what’s the latest news about Brexit?”
At Google, we saw an opportunity to help move digital audio forward by focusing on audio news. By analyzing what’s being said within a given audio file, we can apply our understanding around what text articles are about, how news stories evolve, how topics link together and what might be most relevant to a particular user’s interests.
FTC: We use income earning auto affiliate links. More.


QLocalServer Class Reference
Inherits QObject.
Constructor
- void QLocalServer(QObject parent)
Constructor Properties
- prototype: The QLocalServer prototype object
- bool removeServer(String name)
Prototype Object Properties
The QLocalServer prototype object inherits properties from the QObject prototype object and also has the following properties.
- void close()
- String errorString()
- String fullServerName()
- bool hasPendingConnections()
- bool isListening()
- bool listen(String name)
- int maxPendingConnections()
- QLocalSocket nextPendingConnection()
- SocketError serverError()
- String serverName()
- void setMaxPendingConnections(int numConnections)
- bool waitForNewConnection(int msec)
Instance Properties
QLocalServer objects have no special properties beyond those inherited from the QLocalServer prototype object.


China plans to complete space station construction around 2022: expert
by Staff WritersChina plans to complete the construction of a space station and have it put into operation around 2022, said Zhou Jianping, the chief designer of China's manned space program, at a forum held in south China's Guangdong Province.
The space station is designed to weigh 100 tonnes and accommodate three astronauts, which could be enlarged if needed, according to Zhou.
"The main goal of the construction of the space station is to enable China to become a country independently mastering the technology for long-term manned flight in near-Earth space, and having the capability to carry out long-term manned scientific experiments in near-Earth space and comprehensive development and utilization of space resources," said Zhou at the 4th
China Summit Forum on Human Factors Engineering, which was held at Sun Yat-sen University from Saturday to Sunday.
The space station will be built as China's main platform for space science research, with the purposes of mastering the technologies in constructing and operating large space facilities, the technologies that guarantee life and health of astronauts who often fly in orbit, and the construction of a national space lab, according to Zhou.
Source: Xinhua News Agency


{% extends "blocks/main-card.html" %} {% load static otree %} {% block page_title %}{{ page_title }}{% endblock %} {% block page_content %} {% include './blocks/examples-table.html' %}
Example 1 shows the result if everyone contributes 60% of their energy tokens toward the conservation goal, the minimum required to meet the group goal.


public abstract class FixedRdFinder
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static boolean |
s_bVerifierIncrementBlog
Flag Indicating whether the Verifier Increment Metrics are to be Traced
|
| Modifier and Type | Method and Description |
|---|---|
ConvergenceControl |
control()
Retrieve the Convergence Control Parameters
|
VariateInequalityConstraintMultiplier |
convergeObjectiveFunction(VariateInequalityConstraintMultiplier vicmStarting)
Solve for the Optimal Variate-Inequality Constraint Multiplier Tuple Using the Objective Function
Convergence
|
VariateInequalityConstraintMultiplier |
convergeVariate(VariateInequalityConstraintMultiplier vicmStarting)
Solve for the Optimal Variate-Inequality Constraint Multiplier Tuple Using the Variate/Inequality
Constraint Tuple Convergence
|
VariateInequalityConstraintMultiplier |
find(VariateInequalityConstraintMultiplier vicmStarting)
Find the Optimal Variate-Inequality Constraint Multiplier Tuple using the Iteration Parameters
provided by the Convergence Control Instance
|
abstract VariateInequalityConstraintMultiplier |
increment(VariateInequalityConstraintMultiplier vcmtCurrent)
Produce the Incremental Variate-Constraint Multiplier
|
double |
incrementFraction(VariateInequalityConstraintMultiplier vicm,
VariateInequalityConstraintMultiplier vicmFullIncrement)
Retrieve the Incremental Step Length Fraction
|
LineStepEvolutionControl |
lineStepEvolutionControl()
Retrieve the Line Step Evolution Control
|
abstract VariateInequalityConstraintMultiplier |
next(VariateInequalityConstraintMultiplier vcmtCurrent,
VariateInequalityConstraintMultiplier vcmtIncrement,
double dblIncrementFraction)
Iterate Over to the Next Variate-Constraint Multiplier Tuple
|
RdToR1 |
objectiveFunction()
Retrieve the Objective Function
|
public static boolean s_bVerifierIncrementBlog
public RdToR1 objectiveFunction()
public LineStepEvolutionControl lineStepEvolutionControl()
public ConvergenceControl control()
public VariateInequalityConstraintMultiplier convergeVariate(VariateInequalityConstraintMultiplier vicmStarting)
vicmStarting
- The Starting Variate/Inequality Constraint Tuple Setpublic VariateInequalityConstraintMultiplier convergeObjectiveFunction(VariateInequalityConstraintMultiplier vicmStarting)
vicmStarting
- The Starting Variate/Inequality Constraint Tuple Setpublic VariateInequalityConstraintMultiplier find(VariateInequalityConstraintMultiplier vicmStarting)
vicmStarting
- The Starting Variate-Inequality Constraint Multiplier Tuplepublic double incrementFraction(VariateInequalityConstraintMultiplier vicm, VariateInequalityConstraintMultiplier vicmFullIncrement)
vicm
- The VICM Base InstancevicmFullIncrement
- The Full VICM Instance Incrementpublic abstract VariateInequalityConstraintMultiplier increment(VariateInequalityConstraintMultiplier vcmtCurrent)
vcmtCurrent
- The Current Variate-Constraint Multiplier Tuplepublic abstract VariateInequalityConstraintMultiplier next(VariateInequalityConstraintMultiplier vcmtCurrent, VariateInequalityConstraintMultiplier vcmtIncrement, double dblIncrementFraction)
vcmtCurrent
- The Current Variate-Constraint Multiplier TuplevcmtIncrement
- The Incremental Variate-Constraint Multiplier TupledblIncrementFraction
- The Incremental Fraction to be applied


- add(Media) - Method in class cmput301f13t10.model.AnnotationModel
-
Insert a media at the end of the list of media.
- add(Media) - Method in class cmput301f13t10.model.SectionModel
-
Insert a media at the end of the list of media.
- addAdventure(AdventureModel) - Method in class cmput301f13t10.model.AdventureCache
-
Add an adventure to the cache.
- addAdventure(AdventureModel) - Method in class cmput301f13t10.model.DatabaseInteractor
-
Add a new adventure to the database.
- addChoice(SectionChoice) - Method in class cmput301f13t10.model.SectionModel
-
Set add a new choice for this section
- addListenerOnButton() - Method in class cmput301f13t10.view.LibraryEditView
-
Add the onCreateAdventure button
- addSection(SectionModel) - Method in class cmput301f13t10.model.AdventureModel
-
Add a section to the current list of sections
- addSection(SectionModel, AdventureModel) - Method in class cmput301f13t10.model.SectionArray
-
Add a section to the current list of sections
- addSectionChoice(Integer, String, String) - Method in class cmput301f13t10.presenter.SectionPresenter
-
This takes the separate information from the view and makes it into a
choice
- addText() - Method in class cmput301f13t10.view.SectionEditView
-
- ADVENTURE_EDIT_VIEW - Static variable in class cmput301f13t10.presenter.AppConstants
-
Tag.
- ADVENTURE_ID - Static variable in class cmput301f13t10.presenter.AppConstants
-
Tag.
- ADVENTURE_READ_VIEW - Static variable in class cmput301f13t10.presenter.AppConstants
-
Tag.
- AdventureArrayAdapter - Class in cmput301f13t10.view
-
Adapter for the library
- AdventureArrayAdapter(Context, ArrayList<AdventureModel>) - Constructor for class cmput301f13t10.view.AdventureArrayAdapter
-
Constructor
- AdventureCache - Class in cmput301f13t10.model
-
A store of adventures.
- AdventureCache() - Constructor for class cmput301f13t10.model.AdventureCache
-
Constructor
- AdventureEditView - Class in cmput301f13t10.view
-
A view that displays an adventure's sections, allows the adventure title to
be changed, allows sections to be deleted and created, and provides
navigation to the adventures different sections.
- AdventureEditView() - Constructor for class cmput301f13t10.view.AdventureEditView
-
- AdventureModel - Class in cmput301f13t10.model
-
Contains information about an adventure that the user can read, navigate
through, and edit.
- AdventureModel() - Constructor for class cmput301f13t10.model.AdventureModel
-
Constructor
- AdventureModel(String) - Constructor for class cmput301f13t10.model.AdventureModel
-
Constructor
- AdventureModelTest - Class in cmput301f13t10.tests
-
Test the AdventureModel
- AdventureModelTest() - Constructor for class cmput301f13t10.tests.AdventureModelTest
-
- AdventurePresenter - Class in cmput301f13t10.presenter
-
A Presenter that relays data between the adventure model and the adventure
view.
- AdventurePresenter(AdventureEditView) - Constructor for class cmput301f13t10.presenter.AdventurePresenter
-
Constructor
- AdventurePresenter(AdventureEditView, Integer) - Constructor for class cmput301f13t10.presenter.AdventurePresenter
-
Constructor
- ANNOTATION_ID - Static variable in class cmput301f13t10.presenter.AppConstants
-
Tag.
- AnnotationEditView - Class in cmput301f13t10.view
-
This is the view of an annotation it can have images added to it.
- AnnotationEditView() - Constructor for class cmput301f13t10.view.AnnotationEditView
-
- AnnotationModel - Class in cmput301f13t10.model
-
An annotation of a section.
- AnnotationModel() - Constructor for class cmput301f13t10.model.AnnotationModel
-
Constructor
- AnnotationModelTest - Class in cmput301f13t10.tests
-
- AnnotationModelTest() - Constructor for class cmput301f13t10.tests.AnnotationModelTest
-
- AnnotationPresenter - Class in cmput301f13t10.presenter
-
Presenter that relays data between the annotation model and the annotation
view.
- AnnotationPresenter(AnnotationEditView) - Constructor for class cmput301f13t10.presenter.AnnotationPresenter
-
Constructor
- AppConstants - Class in cmput301f13t10.presenter
-
A list of constants to be used by the app
- AppConstants() - Constructor for class cmput301f13t10.presenter.AppConstants
-
- assignLocalId(AdventureModel) - Method in class cmput301f13t10.model.IdFactory
-
Assign the given adventure (including its sections) a local id
- atLastSection() - Method in class cmput301f13t10.presenter.SectionPresenter
-


23Note the choice of a coeﬃcient of relative risk aversion of 6, in contrast with the choice of 2 made for the previous problems. This choice reﬂects the well-known ‘stockholding puzzle,’ which is the microeconomic equivalent of the equity premium puzzle: For plausible descriptions of income uncertainty, rate of return risk, and the equity premium, the typical consumer should hold all or nearly all of their portfolio in equities. Thus we choose a high value for the coeﬃcient of relative risk aversion in order to generate portfolio structure behavior more interesting than a choice of 100 percent equities in every period for every level of wealth.


Welcome To The Easter Egg
This is a page of another easter egg, find a way out to get to the home page. Can you do it?
This song was made by Onett and here is a link to his profile Onett's Profile.
This is a page of another easter egg, find a way out to get to the home page. Can you do it?
This song was made by Onett and here is a link to his profile Onett's Profile.


Filler used during "The Masters" of snooker.
Made with Adobe Illustrator, After Effects, and Premiere.
An Ident for Kendall branded cinema.
Made on Blender.
VTPP: Sketch comedy troupe,
where I provided video editing and ACTING!!
Another VTPP: Quality ProductTM!
Where I die everytime. Adobe Creative Suite.
An interactive gallery made with the Unreal gaming engine.
Download HERE. Currently only works on windows. (sorry)


Event logging tests
Open
Close
Add item
Change to first item
Refresh
Destroy
Slower
Slow
Medium
Fast
Faster
Disabled tests
Disabled select
Slower
Slow
Medium
Fast
Faster
Disabled options
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Disabled optgroup
jQuery.js
ui.jQuery.js
Some unknown file
Some other file
Disable specific element and refresh selectmenu on button click
jQuery.js
ui.jQuery.js
Some unknown file
Some other file
Toggle disable select
Toggle disable option
Toggle disable optgroup
Empty tests
Select with no option elements
Select with one empty option element
Select with some empty option elements
1
2
3
4
6
7
9
Select with empty optgroup
Some unknown file
Some other file
Width tests
Width auto
Width test 1
Width test 2
Width test 3
Width auto with long option
Width test 1
Width test 2
Width test 3 Width test 3 Width test 3
Width set by JS
Width test 1
Width test 2
Width test 3
Width set by JS with long option
Width test 1
Width test 2
Width test 3 Width test 3 Width test 3
Width set by JS with long option
Width test 1
Width test 2
Width test 3 Width test 3 Width test 3
Log:


| ETA (driving): 10 min |
| Credit? Y |
| Cash? Y |
| Budget: < $20 |
| Wi-fi? N |
| Hours Mon-Sun: 7:30am-3pm |
What more can I say about a place with 1,800+ reviews and such beautiful ratings and photos?  Service is equivalent of their high food standards, my boyfriend's number one breakfast spot (mission coffee cup is a tie for me foodwise). The LJ eggs benedict keeps us coming back, with a perfect poach and smooth hollandaise every time. Love their potatoes on the side, as well as any drink or coffee we've tried (except the Mexican mocha, but willing to over look since asking for it cold made it seem like the issue of wateriness).
One of my favorite breakfast spots in SD for sure! I'm an "omelette person", and the omelettes here are fantastic... near perfect even. Just the right amount of cheese and cooked to perfection! I try to avoid white flour, and pancakes aren't exactly healthy (yet I know some people embrace them as a food group). Shocking that something with the word "cake" in it isn't exactly a health food, I know... Occasionally I like to indulge in wheat pancakes though. Hey, they probably aren't that much better for you, but I'll buy into the illusion for sanity's sake. That being said, the wheat oatmeal pancakes here are OUT OF THIS WORLD. Add blueberries baked in and bananas on top = heavenly. I always order 2 on the side :D
My favorites are the sunday special (eggs benedict with crab) and the french toast stuffed with strawberries. Deliciously savory eggs benedict with a side of potatoes, and the french toast is great if you have a sweet tooth like me! The eggs la jolla is also very good but the crab cakes aren't my favorite for some reason. Don't mix up the sunday special eggs benedict with the regular crab cake benedict! They're quite different!


| 1 | /* | |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
| 3 | * contributor license agreements. See the NOTICE file distributed with | |
| 4 | * this work for additional information regarding copyright ownership. | |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| 6 | * (the "License"); you may not use this file except in compliance with | |
| 7 | * the License. You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | */ | |
| 17 | package org.apache.commons.math3.analysis.solvers; | |
| 18 | ||
| 19 | import org.apache.commons.math3.complex.Complex; | |
| 20 | import org.apache.commons.math3.complex.ComplexUtils; | |
| 21 | import org.apache.commons.math3.analysis.polynomials.PolynomialFunction; | |
| 22 | import org.apache.commons.math3.exception.NoBracketingException; | |
| 23 | import org.apache.commons.math3.exception.NullArgumentException; | |
| 24 | import org.apache.commons.math3.exception.NoDataException; | |
| 25 | import org.apache.commons.math3.exception.TooManyEvaluationsException; | |
| 26 | import org.apache.commons.math3.exception.NumberIsTooLargeException; | |
| 27 | import org.apache.commons.math3.exception.util.LocalizedFormats; | |
| 28 | import org.apache.commons.math3.util.FastMath; | |
| 29 | ||
| 30 | /** | |
| 31 | * Implements the  | |
| 32 | * Laguerre's Method for root finding of real coefficient polynomials. | |
| 33 | * For reference, see | |
| 34 | * <quote> | |
| 35 | * A First Course in Numerical Analysis | |
| 36 | * ISBN 048641454X, chapter 8. | |
| 37 | * </quote> | |
| 38 | * Laguerre's method is global in the sense that it can start with any initial | |
| 39 | * approximation and be able to solve all roots from that point. | |
| 40 | * The algorithm requires a bracketing condition. | |
| 41 | * | |
| 42 | * @version $Id: LaguerreSolver.java 1422195 2012-12-15 06:45:18Z psteitz $ | |
| 43 | * @since 1.2 | |
| 44 | */ | |
| 45 | public class LaguerreSolver extends AbstractPolynomialSolver { | |
| 46 | /** Default absolute accuracy. */ | |
| 47 | private static final double DEFAULT_ABSOLUTE_ACCURACY = 1e-6; | |
| 48 | /** Complex solver. */ | |
| 49 | private final ComplexSolver complexSolver = new ComplexSolver(); | |
| 50 | ||
| 51 | /** | |
| 52 | * Construct a solver with default accuracy (1e-6). | |
| 53 | */ | |
| 54 | public LaguerreSolver() { | |
| 55 | this(DEFAULT_ABSOLUTE_ACCURACY); | |
| 56 | } | |
| 57 | /** | |
| 58 | * Construct a solver. | |
| 59 | * | |
| 60 | * @param absoluteAccuracy Absolute accuracy. | |
| 61 | */ | |
| 62 | public LaguerreSolver(double absoluteAccuracy) { | |
| 63 | super(absoluteAccuracy); | |
| 64 | } | |
| 65 | /** | |
| 66 | * Construct a solver. | |
| 67 | * | |
| 68 | * @param relativeAccuracy Relative accuracy. | |
| 69 | * @param absoluteAccuracy Absolute accuracy. | |
| 70 | */ | |
| 71 | public LaguerreSolver(double relativeAccuracy, | |
| 72 | double absoluteAccuracy) { | |
| 73 | super(relativeAccuracy, absoluteAccuracy); | |
| 74 | } | |
| 75 | /** | |
| 76 | * Construct a solver. | |
| 77 | * | |
| 78 | * @param relativeAccuracy Relative accuracy. | |
| 79 | * @param absoluteAccuracy Absolute accuracy. | |
| 80 | * @param functionValueAccuracy Function value accuracy. | |
| 81 | */ | |
| 82 | public LaguerreSolver(double relativeAccuracy, | |
| 83 | double absoluteAccuracy, | |
| 84 | double functionValueAccuracy) { | |
| 85 | super(relativeAccuracy, absoluteAccuracy, functionValueAccuracy); | |
| 86 | } | |
| 87 | ||
| 88 | /** | |
| 89 | * {@inheritDoc} | |
| 90 | */ | |
| 91 | @Override | |
| 92 | public double doSolve() | |
| 93 | throws TooManyEvaluationsException, | |
| 94 | NumberIsTooLargeException, | |
| 95 | NoBracketingException { | |
| 96 | final double min = getMin(); | |
| 97 | final double max = getMax(); | |
| 98 | final double initial = getStartValue(); | |
| 99 | final double functionValueAccuracy = getFunctionValueAccuracy(); | |
| 100 | ||
| 101 | 1 | verifySequence(min, initial, max); |
| 102 | ||
| 103 | // Return the initial guess if it is good enough. | |
| 104 | final double yInitial = computeObjectiveValue(initial); | |
| 105 | 2 | if (FastMath.abs(yInitial) <= functionValueAccuracy) { |
| 106 | 1 | return initial; |
| 107 | } | |
| 108 | ||
| 109 | // Return the first endpoint if it is good enough. | |
| 110 | final double yMin = computeObjectiveValue(min); | |
| 111 | 2 | if (FastMath.abs(yMin) <= functionValueAccuracy) { |
| 112 | 1 | return min; |
| 113 | } | |
| 114 | ||
| 115 | // Reduce interval if min and initial bracket the root. | |
| 116 | 3 | if (yInitial * yMin < 0) { |
| 117 | 1 | return laguerre(min, initial, yMin, yInitial); |
| 118 | } | |
| 119 | ||
| 120 | // Return the second endpoint if it is good enough. | |
| 121 | final double yMax = computeObjectiveValue(max); | |
| 122 | 2 | if (FastMath.abs(yMax) <= functionValueAccuracy) { |
| 123 | 1 | return max; |
| 124 | } | |
| 125 | ||
| 126 | // Reduce interval if initial and max bracket the root. | |
| 127 | 3 | if (yInitial * yMax < 0) { |
| 128 | 1 | return laguerre(initial, max, yInitial, yMax); |
| 129 | } | |
| 130 | ||
| 131 | throw new NoBracketingException(min, max, yMin, yMax); | |
| 132 | } | |
| 133 | ||
| 134 | /** | |
| 135 | * Find a real root in the given interval. | |
| 136 | * | |
| 137 | * Despite the bracketing condition, the root returned by | |
| 138 | * {@link LaguerreSolver.ComplexSolver#solve(Complex[],Complex)} may | |
| 139 | * not be a real zero inside {@code [min, max]}. | |
| 140 | * For example, p(x) = x3 + 1, | |
| 141 | * with {@code min = -2}, {@code max = 2}, {@code initial = 0}. | |
| 142 | * When it occurs, this code calls | |
| 143 | * {@link LaguerreSolver.ComplexSolver#solveAll(Complex[],Complex)} | |
| 144 | * in order to obtain all roots and picks up one real root. | |
| 145 | * | |
| 146 | * @param lo Lower bound of the search interval. | |
| 147 | * @param hi Higher bound of the search interval. | |
| 148 | * @param fLo Function value at the lower bound of the search interval. | |
| 149 | * @param fHi Function value at the higher bound of the search interval. | |
| 150 | * @return the point at which the function value is zero. | |
| 151 | * @deprecated This method should not be part of the public API: It will | |
| 152 | * be made private in version 4.0. | |
| 153 | */ | |
| 154 | @Deprecated | |
| 155 | public double laguerre(double lo, double hi, | |
| 156 | double fLo, double fHi) { | |
| 157 | final Complex c[] = ComplexUtils.convertToComplex(getCoefficients()); | |
| 158 | ||
| 159 | 2 | final Complex initial = new Complex(0.5 * (lo + hi), 0); |
| 160 | final Complex z = complexSolver.solve(c, initial); | |
| 161 | 1 | if (complexSolver.isRoot(lo, hi, z)) { |
| 162 | 1 | return z.getReal(); |
| 163 | } else { | |
| 164 | double r = Double.NaN; | |
| 165 | // Solve all roots and select the one we are seeking. | |
| 166 | Complex[] root = complexSolver.solveAll(c, initial); | |
| 167 | 3 | for (int i = 0; i < root.length; i++) { |
| 168 | 1 | if (complexSolver.isRoot(lo, hi, root[i])) { |
| 169 | r = root[i].getReal(); | |
| 170 | break; | |
| 171 | } | |
| 172 | } | |
| 173 | 1 | return r; |
| 174 | } | |
| 175 | } | |
| 176 | ||
| 177 | /** | |
| 178 | * Find all complex roots for the polynomial with the given | |
| 179 | * coefficients, starting from the given initial value. | |
| 180 | *
 | |
| 181 | * Note: This method is not part of the API of {@link BaseUnivariateSolver}. | |
| 182 | * | |
| 183 | * @param coefficients Polynomial coefficients. | |
| 184 | * @param initial Start value. | |
| 185 | * @return the point at which the function value is zero. | |
| 186 | * @throws org.apache.commons.math3.exception.TooManyEvaluationsException | |
| 187 | * if the maximum number of evaluations is exceeded. | |
| 188 | * @throws NullArgumentException if the {@code coefficients} is | |
| 189 | * {@code null}. | |
| 190 | * @throws NoDataException if the {@code coefficients} array is empty. | |
| 191 | * @since 3.1 | |
| 192 | */ | |
| 193 | public Complex[] solveAllComplex(double[] coefficients, | |
| 194 | double initial) | |
| 195 | throws NullArgumentException, | |
| 196 | NoDataException, | |
| 197 | TooManyEvaluationsException { | |
| 198 | 1 | setup(Integer.MAX_VALUE, |
| 199 | new PolynomialFunction(coefficients), | |
| 200 | Double.NEGATIVE_INFINITY, | |
| 201 | Double.POSITIVE_INFINITY, | |
| 202 | initial); | |
| 203 | 1 | return complexSolver.solveAll(ComplexUtils.convertToComplex(coefficients), |
| 204 | new Complex(initial, 0d)); | |
| 205 | } | |
| 206 | ||
| 207 | /** | |
| 208 | * Find a complex root for the polynomial with the given coefficients, | |
| 209 | * starting from the given initial value. | |
| 210 | *
 | |
| 211 | * Note: This method is not part of the API of {@link BaseUnivariateSolver}. | |
| 212 | * | |
| 213 | * @param coefficients Polynomial coefficients. | |
| 214 | * @param initial Start value. | |
| 215 | * @return the point at which the function value is zero. | |
| 216 | * @throws org.apache.commons.math3.exception.TooManyEvaluationsException | |
| 217 | * if the maximum number of evaluations is exceeded. | |
| 218 | * @throws NullArgumentException if the {@code coefficients} is | |
| 219 | * {@code null}. | |
| 220 | * @throws NoDataException if the {@code coefficients} array is empty. | |
| 221 | * @since 3.1 | |
| 222 | */ | |
| 223 | public Complex solveComplex(double[] coefficients, | |
| 224 | double initial) | |
| 225 | throws NullArgumentException, | |
| 226 | NoDataException, | |
| 227 | TooManyEvaluationsException { | |
| 228 | 1 | setup(Integer.MAX_VALUE, |
| 229 | new PolynomialFunction(coefficients), | |
| 230 | Double.NEGATIVE_INFINITY, | |
| 231 | Double.POSITIVE_INFINITY, | |
| 232 | initial); | |
| 233 | 1 | return complexSolver.solve(ComplexUtils.convertToComplex(coefficients), |
| 234 | new Complex(initial, 0d)); | |
| 235 | } | |
| 236 | ||
| 237 | /** | |
| 238 | * Class for searching all (complex) roots. | |
| 239 | */ | |
| 240 | private class ComplexSolver { | |
| 241 | /** | |
| 242 | * Check whether the given complex root is actually a real zero | |
| 243 | * in the given interval, within the solver tolerance level. | |
| 244 | * | |
| 245 | * @param min Lower bound for the interval. | |
| 246 | * @param max Upper bound for the interval. | |
| 247 | * @param z Complex root. | |
| 248 | * @return {@code true} if z is a real zero. | |
| 249 | */ | |
| 250 | public boolean isRoot(double min, double max, Complex z) { | |
| 251 | 1 | if (isSequence(min, z.getReal(), max)) { |
| 252 | 1 | double tolerance = FastMath.max(getRelativeAccuracy() * z.abs(), getAbsoluteAccuracy()); |
| 253 | 5 | return (FastMath.abs(z.getImaginary()) <= tolerance) || |
| 254 | (z.abs() <= getFunctionValueAccuracy()); | |
| 255 | } | |
| 256 | 1 | return false; |
| 257 | } | |
| 258 | ||
| 259 | /** | |
| 260 | * Find all complex roots for the polynomial with the given | |
| 261 | * coefficients, starting from the given initial value. | |
| 262 | * | |
| 263 | * @param coefficients Polynomial coefficients. | |
| 264 | * @param initial Start value. | |
| 265 | * @return the point at which the function value is zero. | |
| 266 | * @throws org.apache.commons.math3.exception.TooManyEvaluationsException | |
| 267 | * if the maximum number of evaluations is exceeded. | |
| 268 | * @throws NullArgumentException if the {@code coefficients} is | |
| 269 | * {@code null}. | |
| 270 | * @throws NoDataException if the {@code coefficients} array is empty. | |
| 271 | */ | |
| 272 | public Complex[] solveAll(Complex coefficients[], Complex initial) | |
| 273 | throws NullArgumentException, | |
| 274 | NoDataException, | |
| 275 | TooManyEvaluationsException { | |
| 276 | 1 | if (coefficients == null) { |
| 277 | throw new NullArgumentException(); | |
| 278 | } | |
| 279 | 1 | final int n = coefficients.length - 1; |
| 280 | 1 | if (n == 0) { |
| 281 | throw new NoDataException(LocalizedFormats.POLYNOMIAL); | |
| 282 | } | |
| 283 | // Coefficients for deflated polynomial. | |
| 284 | 1 | final Complex c[] = new Complex[n + 1]; |
| 285 | 3 | for (int i = 0; i <= n; i++) { |
| 286 | c[i] = coefficients[i]; | |
| 287 | } | |
| 288 | ||
| 289 | // Solve individual roots successively. | |
| 290 | final Complex root[] = new Complex[n]; | |
| 291 | 3 | for (int i = 0; i < n; i++) { |
| 292 | 2 | final Complex subarray[] = new Complex[n - i + 1]; |
| 293 | 1 | System.arraycopy(c, 0, subarray, 0, subarray.length); |
| 294 | root[i] = solve(subarray, initial); | |
| 295 | // Polynomial deflation using synthetic division. | |
| 296 | 1 | Complex newc = c[n - i]; |
| 297 | Complex oldc = null; | |
| 298 | 5 | for (int j = n - i - 1; j >= 0; j--) { |
| 299 | oldc = c[j]; | |
| 300 | c[j] = newc; | |
| 301 | newc = oldc.add(newc.multiply(root[i])); | |
| 302 | } | |
| 303 | } | |
| 304 | ||
| 305 | 1 | return root; |
| 306 | } | |
| 307 | ||
| 308 | /** | |
| 309 | * Find a complex root for the polynomial with the given coefficients, | |
| 310 | * starting from the given initial value. | |
| 311 | * | |
| 312 | * @param coefficients Polynomial coefficients. | |
| 313 | * @param initial Start value. | |
| 314 | * @return the point at which the function value is zero. | |
| 315 | * @throws org.apache.commons.math3.exception.TooManyEvaluationsException | |
| 316 | * if the maximum number of evaluations is exceeded. | |
| 317 | * @throws NullArgumentException if the {@code coefficients} is | |
| 318 | * {@code null}. | |
| 319 | * @throws NoDataException if the {@code coefficients} array is empty. | |
| 320 | */ | |
| 321 | public Complex solve(Complex coefficients[], Complex initial) | |
| 322 | throws NullArgumentException, | |
| 323 | NoDataException, | |
| 324 | TooManyEvaluationsException { | |
| 325 | 1 | if (coefficients == null) { |
| 326 | throw new NullArgumentException(); | |
| 327 | } | |
| 328 | ||
| 329 | 1 | final int n = coefficients.length - 1; |
| 330 | 1 | if (n == 0) { |
| 331 | throw new NoDataException(LocalizedFormats.POLYNOMIAL); | |
| 332 | } | |
| 333 | ||
| 334 | final double absoluteAccuracy = getAbsoluteAccuracy(); | |
| 335 | final double relativeAccuracy = getRelativeAccuracy(); | |
| 336 | final double functionValueAccuracy = getFunctionValueAccuracy(); | |
| 337 | ||
| 338 | final Complex nC = new Complex(n, 0); | |
| 339 | 1 | final Complex n1C = new Complex(n - 1, 0); |
| 340 | ||
| 341 | Complex z = initial; | |
| 342 | Complex oldz = new Complex(Double.POSITIVE_INFINITY, | |
| 343 | Double.POSITIVE_INFINITY); | |
| 344 | while (true) { | |
| 345 | // Compute pv (polynomial value), dv (derivative value), and | |
| 346 | // d2v (second derivative value) simultaneously. | |
| 347 | Complex pv = coefficients[n]; | |
| 348 | Complex dv = Complex.ZERO; | |
| 349 | Complex d2v = Complex.ZERO; | |
| 350 | 4 | for (int j = n-1; j >= 0; j--) { |
| 351 | d2v = dv.add(z.multiply(d2v)); | |
| 352 | dv = pv.add(z.multiply(dv)); | |
| 353 | pv = coefficients[j].add(z.multiply(pv)); | |
| 354 | } | |
| 355 | d2v = d2v.multiply(new Complex(2.0, 0.0)); | |
| 356 | ||
| 357 | // Check for convergence. | |
| 358 | 1 | final double tolerance = FastMath.max(relativeAccuracy * z.abs(), |
| 359 | absoluteAccuracy); | |
| 360 | 2 | if ((z.subtract(oldz)).abs() <= tolerance) { |
| 361 | 1 | return z; |
| 362 | } | |
| 363 | 2 | if (pv.abs() <= functionValueAccuracy) { |
| 364 | 1 | return z; |
| 365 | } | |
| 366 | ||
| 367 | // Now pv != 0, calculate the new approximation. | |
| 368 | final Complex G = dv.divide(pv); | |
| 369 | final Complex G2 = G.multiply(G); | |
| 370 | final Complex H = G2.subtract(d2v.divide(pv)); | |
| 371 | final Complex delta = n1C.multiply((nC.multiply(H)).subtract(G2)); | |
| 372 | // Choose a denominator larger in magnitude. | |
| 373 | final Complex deltaSqrt = delta.sqrt(); | |
| 374 | final Complex dplus = G.add(deltaSqrt); | |
| 375 | final Complex dminus = G.subtract(deltaSqrt); | |
| 376 | 2 | final Complex denominator = dplus.abs() > dminus.abs() ? dplus : dminus; |
| 377 | // Perturb z if denominator is zero, for instance, | |
| 378 | // p(x) = x^3 + 1, z = 0. | |
| 379 | 1 | if (denominator.equals(new Complex(0.0, 0.0))) { |
| 380 | z = z.add(new Complex(absoluteAccuracy, absoluteAccuracy)); | |
| 381 | oldz = new Complex(Double.POSITIVE_INFINITY, | |
| 382 | Double.POSITIVE_INFINITY); | |
| 383 | } else { | |
| 384 | oldz = z; | |
| 385 | z = z.subtract(nC.divide(denominator)); | |
| 386 | } | |
| 387 | 1 | incrementEvaluationCount(); |
| 388 | } | |
| 389 | } | |
| 390 | } | |
| 391 | } | |
Mutations | ||
| 101 |
removed call to org/apache/commons/math3/analysis/solvers/LaguerreSolver::verifySequence : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testParameters(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 105 |
negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testParameters(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) changed conditional boundary : SURVIVED |
|
| 106 |
replaced return of double value with -(x + 1) for org/apache/commons/math3/analysis/solvers/LaguerreSolver::doSolve : NO_COVERAGE |
|
| 111 |
negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testParameters(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) changed conditional boundary : SURVIVED |
|
| 112 |
replaced return of double value with -(x + 1) for org/apache/commons/math3/analysis/solvers/LaguerreSolver::doSolve : NO_COVERAGE |
|
| 116 |
Replaced double multiplication with division : SURVIVED negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testParameters(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) changed conditional boundary : SURVIVED |
|
| 117 |
replaced return of double value with -(x + 1) for org/apache/commons/math3/analysis/solvers/LaguerreSolver::doSolve : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 122 |
changed conditional boundary : SURVIVED negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testParameters(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 123 |
replaced return of double value with -(x + 1) for org/apache/commons/math3/analysis/solvers/LaguerreSolver::doSolve : NO_COVERAGE |
|
| 127 |
changed conditional boundary : SURVIVED Replaced double multiplication with division : SURVIVED negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testParameters(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 128 |
replaced return of double value with -(x + 1) for org/apache/commons/math3/analysis/solvers/LaguerreSolver::doSolve : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 159 |
Replaced double addition with subtraction : SURVIVED Replaced double multiplication with division : SURVIVED |
|
| 161 |
negated conditional : SURVIVED |
|
| 162 |
replaced return of double value with -(x + 1) for org/apache/commons/math3/analysis/solvers/LaguerreSolver::laguerre : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 167 |
changed conditional boundary : NO_COVERAGE Changed increment from 1 to -1 : NO_COVERAGE negated conditional : NO_COVERAGE |
|
| 168 |
negated conditional : NO_COVERAGE |
|
| 173 |
replaced return of double value with -(x + 1) for org/apache/commons/math3/analysis/solvers/LaguerreSolver::laguerre : NO_COVERAGE |
|
| 198 |
removed call to org/apache/commons/math3/analysis/solvers/LaguerreSolver::setup : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 203 |
mutated return of Object value for org/apache/commons/math3/analysis/solvers/LaguerreSolver::solveAllComplex to ( if (x != null) null else throw new RuntimeException ) : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 228 |
removed call to org/apache/commons/math3/analysis/solvers/LaguerreSolver::setup : NO_COVERAGE |
|
| 233 |
mutated return of Object value for org/apache/commons/math3/analysis/solvers/LaguerreSolver::solveComplex to ( if (x != null) null else throw new RuntimeException ) : NO_COVERAGE |
|
| 251 |
negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 252 |
Replaced double multiplication with division : SURVIVED |
|
| 253 |
negated conditional : SURVIVED negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) changed conditional boundary : SURVIVED replaced return of integer sized value with (x == 0 ? 1 : 0) : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) changed conditional boundary : SURVIVED |
|
| 256 |
replaced return of integer sized value with (x == 0 ? 1 : 0) : NO_COVERAGE |
|
| 276 |
negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 279 |
Replaced integer subtraction with addition : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 280 |
negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 284 |
Replaced integer addition with subtraction : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 285 |
Changed increment from 1 to -1 : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) changed conditional boundary : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 291 |
Changed increment from 1 to -1 : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) changed conditional boundary : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 292 |
Replaced integer addition with subtraction : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) Replaced integer subtraction with addition : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 293 |
removed call to java/lang/System::arraycopy : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 296 |
Replaced integer subtraction with addition : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 298 |
Replaced integer subtraction with addition : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) Replaced integer subtraction with addition : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) changed conditional boundary : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) negated conditional : TIMED_OUT Changed increment from -1 to 1 : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 305 |
mutated return of Object value for org/apache/commons/math3/analysis/solvers/LaguerreSolver$ComplexSolver::solveAll to ( if (x != null) null else throw new RuntimeException ) : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 325 |
negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 329 |
Replaced integer subtraction with addition : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 330 |
negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 339 |
Replaced integer subtraction with addition : SURVIVED |
|
| 350 |
changed conditional boundary : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) Replaced integer subtraction with addition : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) Changed increment from -1 to 1 : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 358 |
Replaced double multiplication with division : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction2(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 360 |
negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) changed conditional boundary : SURVIVED |
|
| 361 |
mutated return of Object value for org/apache/commons/math3/analysis/solvers/LaguerreSolver$ComplexSolver::solve to ( if (x != null) null else throw new RuntimeException ) : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuinticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 363 |
negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) changed conditional boundary : SURVIVED |
|
| 364 |
mutated return of Object value for org/apache/commons/math3/analysis/solvers/LaguerreSolver$ComplexSolver::solve to ( if (x != null) null else throw new RuntimeException ) : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 376 |
negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) changed conditional boundary : SURVIVED |
|
| 379 |
negated conditional : KILLED -> org.apache.commons.math3.analysis.solvers.LaguerreSolverTest.testQuadraticFunction(org.apache.commons.math3.analysis.solvers.LaguerreSolverTest) |
|
| 387 |
removed call to org/apache/commons/math3/analysis/solvers/LaguerreSolver::incrementEvaluationCount : SURVIVED |


Thousands queue online to buy Aldi's Kevin the Carrot toys - but many are disappointed as they soon sell out
Website users were greeted with the message that they had been automatically placed in a queue - but the toys had all sold out online by 11am
by Brett Gibbons, https://www.birminghammail.co.uk/authors/brett-gibbons/Aldi's website was besieged on Sunday morning as thousands of shoppers queued to snap up Kevin the Carrot toys.
The discount supermarket chain launched sales of its range of merchandise depicting the fun figure made famous by its TV advertisements and there was soon a long line of customers waiting to purchase the toy.
But many were left disappointed with the toys soon selling out.
Website users were greeted with the message that they had been automatically placed in a queue due to the fact 'there are currently lots of people trying to access the Aldi website'.
The queue was around five minutes when our colleagues at StokeonTrentLive visited the site they were assigned queue number 224582 - with 2,321 other users ahead of them.
Unfortunately for people keen to get their hands on them, these had sold out by 11am.
A message on the queueing page stated: "Oops! It looks like we're all sold out of Kevin and friend's plush toys. Give your local Aldi store a try from Thursday 28th November to see what's on offer."
Aldi has branches across Birmingham and the Black Country and customers queued for hours to secure a bargain when a new store opened last week in Carters Green, West Bromwich.


Bale Booed By Own Fans, Defended By Zidane
by SL InternationalAfter Gareth Bale was once again booed by Real Madrid fans on Saturday, manager Zinedine Zidane came to the Wales star's defence.
Read: The 10 Richest Footballers In The World
Bale's already-frosty relationship with Los Blancos' fans plunged to new depths during the international break, when he celebrated Wales' 2020 UEFA European Championship qualifying win over Hungary by holding a flag that controversially insulted the Spanish club.
The former Tottenham Hotspur winger bore the brunt of the fans' anger on Saturday, when he was widely booed by the club's supporters during his substitute cameo in Real's 3-1 LaLiga win over Real Sociedad.
After the match, Zidane, who has endured a cold relationship with Bale himself, came to the defence of the Welshman, and even praised his performance off the bench.
"What we want is for our fans to be with us from start to finish, but we have no control over that," the Frenchman said, as reported by Wales Online.
"The fans can do as they please, but let's not focus on the jeers. Bale came on and did very well, he had a good 20 minutes, but let's focus on the win and the three points.
Choose the left-winger for SA's Real Madrid Dream Team & win a replica shirt!
"I congratulated Bale on his performance, as I did all of the players. I haven't spoken to him about the jeers. It's something that has happened to the best players in the past, and today it's Bale's turn.
"He came on and did very well and, at the end of the day, we need our fans to get behind us. That's all there is to say.
"It won't affect things because it's something that's always happened, and it'll happen to many of them.
"What we've got to do is keep working hard and delivering on the pitch, because what the fans want to see is that their team keep on winning.
"I can't say whether it's unfair or not. Everyone's entitled to their opinion and has to make a decision about what they say on it.
"The important thing in this is us and what we need. As I said yesterday, we need our fans, I can't control things, nor can Bale or anybody else. We always need our fans' backing because they give us that boost."
Read: Bale Booed By Real Fans In Comeback Victory
Bale was also defended by a number of his teammates following the match, including Thibaut Courtois, Raphael Varane and Federico Valverde.


After so many years, MIUI will finally get an app launcher
Source: Apoorva Bhardwaj/Android Central
What you need to know
- Xiaomi is adding an app launcher to MIUI 11.
- Users will still have the option of using the 'classic' iOS-style app lists.
- MIUI 11 will be rolling out to various Xiaomi phones by the end of the year.
If you've ever read a review for a Xiaomi phone or bought one for yourself, you've undoubtedly encountered the 'software shock' that comes with buying a smartphone from a Chinese company. One of the most glaring omissions on many Chinese smartphones — including Xiaomi's — seems to be their preference for an iOS-like app list in lieu of Android's trademark app launcher.
Well, the Redmi parent is finally addressing that particular pain point and recently announced on Weibo its intent to add a native app launcher to MIUI 11 (via Android Authority). Yay!
The update should roll out to Chinese users within the week, after which they should see an option to set their launcher to a 'Classic' mode or a 'Drawer' mode. It'll work similar to how most modern launchers work, and a swipe up from the home screen will bring up the app drawer. It seems there will also be a row of shortcut icons at the very top for your most frequently used apps, a welcome departure from the company's previous insistence on making you scroll through multiple screens just to find that one app you can't live without.
Unfortunately, the post did not address MIUI's Global version, which is what you're likely sporting if you live outside China. Hopefully, Xiaomi makes it available to the rest of the world sooner rather than later. In the meantime, if you're wondering when your phone will receive the MIUI 11 update, check out this page for the company's roadmap.
Redmi K20 Pro
The Redmi K20 Pro offers everything you're looking for in a value flagship. You get a gorgeous design backed by a Snapdragon 855 chipset. 6GB of RAM, 128GB of storage, and a 48MP camera that takes excellent shots.
We may earn a commission for purchases using our links. Learn more.


{include file="check/finance/_form" /}
{include file="check/finance/table"/}
{include file="layout/page" /}
{include file="common/meta" /} {block name='css'} {/block}


{% extends "master.html" %} {% load crispy_forms_tags %} {% block content %}
This contact cannot be used to create a sponsoring because the contact does not have a contact person. Please edit and add a contact person first.
{% else %}You can create a new partnership entry for the company {{sponsorContact.companyName}} here. You have to enter a unique account name for the sponsor. This account will be linked with the sponsoring and can be used by the partner only to enter information about the partnership. It should not be used to create projects etc.
Please note that the contact information gets copied from the contact database into the newly created account. Although the sponsoring is permanently linked to the contact entry, later changes in the contact database do not directly affect the created account.
{% endif %} {% endblock %}


--- layout: post title: Cowboy date: '2013-09-10T17:31:19+02:00' categories: - Sketches picture_url: https://film-Storyboards.tumblr.com/post/60878331756/cowboy ---
When in doubt, draw cowboys.


Groupiter was founded to support better collaboration for teams using Dropbox. We delivered a mobile app and set of web tools to allow teams to comment upon and annotate their Dropbox files. I managed the product strategy, conducted the user research, and completed the UX and visual design for the product.
I built the 10-strong design and user experience team at Wikia as our monthly traffic grew from 100mm to 280mm unique visitors. I led a complete design overhaul of the site to improve visual design and accessibility. I worked closely with the product management team to define the product roadmap, and built the company’s first user insights and usability program.


stable_sort
|
|
| Category: algorithms |
Component type: function |
Prototype
Stable_sort is an overloaded name; there are actually two stable_sort
functions.
template <class RandomAccessIterator>
void stable_sort(RandomAccessIterator first, RandomAccessIterator last);
template <class RandomAccessIterator, class StrictWeakOrdering>
void stable_sort(RandomAccessIterator first, RandomAccessIterator last,
StrictWeakOrdering comp);
Description
Stable_sort is much like sort: it sorts the elements in
[first, last) into ascending order, meaning that if i and j are
any two valid iterators in [first, last) such that i precedes j,
then *j is not less than *i. Stable_sort differs from
sort in two ways. First, stable_sort uses an algorithm that
has different run-time complexity than sort. Second, as the
name suggests, stable_sort is stable: it preserves the relative
ordering of equivalent elements. That is, if x and y are elements
in [first, last) such that x precedes y, and if the two
elements are equivalent (neither x < y nor y < x)
then a postcondition of stable_sort is that x still precedes y.
[1]
The two versions of stable_sort differ in how they define whether one
element is less than another. The first version compares
objects using operator<, and the second compares objects using
a function object comp.
Definition
Defined in algo.h.
Requirements on types
For the first version, the one that takes two arguments:
For the second version, the one that takes three arguments:
-
RandomAccessIterator is a model of Random Access Iterator.
-
RandomAccessIterator is mutable.
-
StrictWeakOrdering is a model of Strict Weak Ordering.
-
RandomAccessIterator's value type is convertible to
StrictWeakOrdering's argument type.
Preconditions
-
[first, last) is a valid range.
Complexity
Stable_sort is an adaptive algorithm: it attempts to
allocate a temporary memory buffer, and its run-time complexity depends
on how much memory is available. Worst-case behavior (if no auxiliary memory
is available) is N (log N)^2 comparisons, where N is last -
first, and best case
(if a large enough auxiliary memory buffer is available)
is N (log N). [2]
Example
Sort a sequence of characters, ignoring their case. Note that the
relative order of characters that differ only by case is preserved.
inline bool lt_nocase(char c1, char c2) { return tolower(c1) < tolower(c2); }
int main()
{
char A[] = "fdBeACFDbEac";
const int N = sizeof(A) - 1;
stable_sort(A, A+N, lt_nocase);
printf("%s\n", A);
// The printed result is ""AaBbCcdDeEfF".
}
Notes
[1]
Note that two elements may be equivalent without being equal.
One standard example is sorting a sequence of names by last name: if
two people have the same last name but different first names, then
they are equivalent but not equal. This is why stable_sort is
sometimes useful: if you are sorting a sequence of records that have
several different fields, then you may want to sort it by one field
without completely destroying the ordering that you previously
obtained from sorting it by a different field. You might, for
example, sort by first name and then do a stable sort by last name.
[2]
Stable_sort uses the merge sort algorithm; see section
5.2.4 of Knuth. (D. E. Knuth, The Art of Computer
Programming. Volume 3: Sorting and Searching. Addison-Wesley, 1975.)
See also
sort,
partial_sort,
partial_sort_copy,
binary_search,
lower_bound,
upper_bound,
less<T>,
StrictWeakOrdering,
LessThan Comparable
Copyright © 1996 Silicon Graphics, Inc.
|


Home
Image-Videos
Skills
Contact
Barbones-Portfolio-Project
In association with
DSC's 30 Days of Web Devlopement
This is header section
About me
I am a Computer Science Undergraduate student👨🎓 at KIIT University, Bhubaneshwar.
I love💛 watching and playing Cricket.
Tables
Education
10 - Dav Public School.
12 - Adwaita Mission High School.
UG- CSE B.Tech - KIIT Deemed to be University.
My Cricket Skills
Straight Drive: ⭐⭐⭐
Cover Drive: ⭐⭐
Lofted Stroke: ⭐⭐⭐⭐
Pull Shot: ⭐⭐⭐⭐
Slower Ball: ⭐⭐⭐⭐⭐
Yorker: ⭐⭐⭐⭐
Off Cutter: ⭐⭐⭐
Fielding: ⭐⭐⭐
The Image Element
The video element
Your browser does not support the video tag.
Contact Form
Send email
Email:
Phone No:
First Name:
Last Name:
Message:
Click to send


| lm.ridge {MASS} | R Documentation |
Fit a linear model by ridge regression.
lm.ridge(formula, data, subset, na.action, lambda = 0, model = FALSE, x = FALSE, y = FALSE, contrasts = NULL, ...)
formula |
a formula expression as for regression models, of the form
|
data |
an optional data frame in which to interpret the variables occurring
in |
subset |
expression saying which subset of the rows of the data should be used in the fit. All observations are included by default. |
na.action |
a function to filter missing data. |
lambda |
A scalar or vector of ridge constants. |
model |
should the model frame be returned? Not implemented. |
x |
should the design matrix be returned? Not implemented. |
y |
should the response be returned? Not implemented. |
contrasts |
a list of contrasts to be used for some or all of factor terms in the
formula. See the |
... |
additional arguments to |
If an intercept is present in the model, its coefficient is not penalized. (If you want to penalize an intercept, put in your own constant term and remove the intercept.)
A list with components
coef |
matrix of coefficients, one row for each value of |
scales |
scalings used on the X matrix. |
Inter |
was intercept included? |
lambda |
vector of lambda values |
ym |
mean of |
xm |
column means of |
GCV |
vector of GCV values |
kHKB |
HKB estimate of the ridge constant. |
kLW |
L-W estimate of the ridge constant. |
Brown, P. J. (1994) Measurement, Regression and Calibration Oxford.
longley # not the same as the S-PLUS dataset names(longley)[1] <- "y" lm.ridge(y ~ ., longley) plot(lm.ridge(y ~ ., longley, lambda = seq(0,0.1,0.001))) select(lm.ridge(y ~ ., longley, lambda = seq(0,0.1,0.0001)))


A quick introduction to the basics of Serial Key Manager platform
A Key, as you might have noticed, is an important part of the licensing process. During key creation in the previous tutorial, it could be seen that there are so many parameters that can be customized. The aim of this article is to describe how most of the parameters can be used.
MUYVD-LSEBY-CXHRQ-XFAGY
The set time option allows you to specify the number of days that the key should be valid. Note, the fact that a key has 'expired' does not mean it's invalid. In other words, it's up to your client application to decide whether the key should be invalid if the it has expired. Features are of great use for this situation, which we will cover later.
Usually, if you don't want to have a time restriction on the key, simply keep it set to 30 days.This is the number of keys you want to generate.Simple as that!
Sometimes, it can be useful to save some additional notes along with a key. These are not stored in the key itself. Using the Web API, it is possible to access these. This is not allowed by default, however, it can be changed here
In many cases, it is desired to allow certain set of features to be enabled based on the key that is provided. The simplest example is to have one key that works as a trial key and another as full-featured key. However, you are able to set up more complex features, for instance, one trial key, a registered trial or a registered unlimited key. This is illustrated below:
In order to keep track of what version the user should have, you could, for instance, connect trial key with Feature1, registered trial with Feature2 and registered unlimited key with Feature 3. Of course, we could also optimize this a little bit using two features only, one that indicates whether it is a registered version and another whether it is time limited. This is described more in details here.
In your client software, you could have similar code as shown below:
if Feature1 == True // this is a trial key, so we need to check the time left. if TimeDifference(Today, SetTime) >= 0 //execute as normal (with limited functionality) else //the trial key has expired, shutdown. else if Feature2 == True // this is a registered time limited key, so we check the time again if TimeDifference(Today, SetTime) >= 0 //execute as normal (with all functionality) else //the registered time limited key expired, shutdown. else if Feature3 == True // this is a unlimited registered key, so we execute as normal, with all functionality.
In the Web API, which we will cover in later articles, there is a method called Activate. It allows you to track all computers that have activated the license so that you can put restrictions, if desired. When this option is set to true, Activate method will be able to add new computers (to the list of activated computers) and change the key (when trial activation is enabled.)
In some cases, you might want to activate a trial key the same day the user activates the software. This can be achieved by enabling this option. Thanks to this, you will be able to generate say 1000 keys in June (valid in 30 days) and ensure that the trial only starts when the user activates the software (eg. in September). Then, a new key will replace the old one that will be valid in 30 days from September.
In order to restrict the number of computers that can use the same key, you can set enable this feature by enter a number greater than zero. This number represents the maximum number of computers that can activate the key.
In many applications nowadays, it is important to put additional restrictions on using a particular functionality, eg. a quota. This can be achieved by the Optional field option. Using the Web API, you are able to read or decrease the number you specify in this box. It may not be increased through the Web API.
In this article, we've looked at all the options that can be specified in a key. We made some references to the Web API, which we will discuss even further in the next article!
Copyright © Artem Los. All rights reserved.


Answers in this round:
ANIME BASIC FUNNEL PAISLEY WHY ME
Each of the answers can have one letter changed to make a spice or herb (which are notably sold by the McCormick company), as seen in this table:
| Answer | Spice/herb | Original letter | New letter | Position in word |
|---|---|---|---|---|
| ANIME | ANISE | M | S | 4 |
| BASIC | BASIL | C | L | 5 |
| FUNNEL | FENNEL | U | E | 2 |
| PAISLEY | PARSLEY | I | R | 3 |
| WHY ME | THYME | W | T | 1 |
Each of the letter changes occurs in a distinct position of the word from 1–5, which provides an ordering. Using this order, we can then plug the original and new letters into the blanks given by the meta and shift them by the offsets in parentheses. The results are:
| W (−4) → T (−4) | SP |
| U (−12) → E (−2) | IC |
| I (−4) → R (+2) | ET |
| M (+10) → S (−10) | WI |
| C (+0) → L (−7) | CE |
The answer is SPICE TWICE.


Light and Sound Memory Game
Pay attention to the pattern and repeat all eight steps in order to win!
Start
Stop