diff --git a/pr1dna.xcodeproj/project.pbxproj b/pr1dna.xcodeproj/project.pbxproj new file mode 100644 index 00000000..e15e30cd --- /dev/null +++ b/pr1dna.xcodeproj/project.pbxproj @@ -0,0 +1,242 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 84E292DB164FE133009BA631 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84E292DA164FE133009BA631 /* Foundation.framework */; }; + 84E292DE164FE133009BA631 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E292DD164FE133009BA631 /* main.m */; }; + 84E292E2164FE133009BA631 /* pr1dna.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 84E292E1164FE133009BA631 /* pr1dna.1 */; }; + 84E292EA164FE341009BA631 /* Cell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84E292E9164FE341009BA631 /* Cell.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 84E292D4164FE133009BA631 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + 84E292E2164FE133009BA631 /* pr1dna.1 in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 84E292D6164FE133009BA631 /* pr1dna */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = pr1dna; sourceTree = BUILT_PRODUCTS_DIR; }; + 84E292DA164FE133009BA631 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 84E292DD164FE133009BA631 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 84E292E0164FE133009BA631 /* pr1dna-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "pr1dna-Prefix.pch"; sourceTree = ""; }; + 84E292E1164FE133009BA631 /* pr1dna.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = pr1dna.1; sourceTree = ""; }; + 84E292E8164FE341009BA631 /* Cell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Cell.h; sourceTree = ""; }; + 84E292E9164FE341009BA631 /* Cell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Cell.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 84E292D3164FE133009BA631 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 84E292DB164FE133009BA631 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 84E292CB164FE133009BA631 = { + isa = PBXGroup; + children = ( + 84E292DC164FE133009BA631 /* pr1dna */, + 84E292D9164FE133009BA631 /* Frameworks */, + 84E292D7164FE133009BA631 /* Products */, + ); + sourceTree = ""; + }; + 84E292D7164FE133009BA631 /* Products */ = { + isa = PBXGroup; + children = ( + 84E292D6164FE133009BA631 /* pr1dna */, + ); + name = Products; + sourceTree = ""; + }; + 84E292D9164FE133009BA631 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 84E292DA164FE133009BA631 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 84E292DC164FE133009BA631 /* pr1dna */ = { + isa = PBXGroup; + children = ( + 84E292DD164FE133009BA631 /* main.m */, + 84E292E8164FE341009BA631 /* Cell.h */, + 84E292E9164FE341009BA631 /* Cell.m */, + 84E292E1164FE133009BA631 /* pr1dna.1 */, + 84E292DF164FE133009BA631 /* Supporting Files */, + ); + path = pr1dna; + sourceTree = ""; + }; + 84E292DF164FE133009BA631 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 84E292E0164FE133009BA631 /* pr1dna-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 84E292D5164FE133009BA631 /* pr1dna */ = { + isa = PBXNativeTarget; + buildConfigurationList = 84E292E5164FE133009BA631 /* Build configuration list for PBXNativeTarget "pr1dna" */; + buildPhases = ( + 84E292D2164FE133009BA631 /* Sources */, + 84E292D3164FE133009BA631 /* Frameworks */, + 84E292D4164FE133009BA631 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = pr1dna; + productName = pr1dna; + productReference = 84E292D6164FE133009BA631 /* pr1dna */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 84E292CD164FE133009BA631 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0420; + }; + buildConfigurationList = 84E292D0164FE133009BA631 /* Build configuration list for PBXProject "pr1dna" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 84E292CB164FE133009BA631; + productRefGroup = 84E292D7164FE133009BA631 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 84E292D5164FE133009BA631 /* pr1dna */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 84E292D2164FE133009BA631 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 84E292DE164FE133009BA631 /* main.m in Sources */, + 84E292EA164FE341009BA631 /* Cell.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 84E292E3164FE133009BA631 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 84E292E4164FE133009BA631 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ENABLE_OBJC_ARC = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + SDKROOT = macosx; + }; + name = Release; + }; + 84E292E6164FE133009BA631 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "pr1dna/pr1dna-Prefix.pch"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 84E292E7164FE133009BA631 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "pr1dna/pr1dna-Prefix.pch"; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 84E292D0164FE133009BA631 /* Build configuration list for PBXProject "pr1dna" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 84E292E3164FE133009BA631 /* Debug */, + 84E292E4164FE133009BA631 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 84E292E5164FE133009BA631 /* Build configuration list for PBXNativeTarget "pr1dna" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 84E292E6164FE133009BA631 /* Debug */, + 84E292E7164FE133009BA631 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = 84E292CD164FE133009BA631 /* Project object */; +} diff --git a/pr1dna.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/pr1dna.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..2b5fda53 --- /dev/null +++ b/pr1dna.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/pr1dna.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate b/pr1dna.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 00000000..4e7c20fd Binary files /dev/null and b/pr1dna.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/pr1dna.xcodeproj/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist b/pr1dna.xcodeproj/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist new file mode 100644 index 00000000..05301bc2 --- /dev/null +++ b/pr1dna.xcodeproj/xcuserdata/admin.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/pr1dna.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/pr1dna.xcscheme b/pr1dna.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/pr1dna.xcscheme new file mode 100644 index 00000000..8fde4b63 --- /dev/null +++ b/pr1dna.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/pr1dna.xcscheme @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pr1dna.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist b/pr1dna.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 00000000..f9a17604 --- /dev/null +++ b/pr1dna.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + pr1dna.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 84E292D5164FE133009BA631 + + primary + + + + + diff --git a/pr1dna/Cell.h b/pr1dna/Cell.h new file mode 100644 index 00000000..01d872ea --- /dev/null +++ b/pr1dna/Cell.h @@ -0,0 +1,19 @@ +// +// Cell.h +// pr1dna +// +// Created by админ on 11.11.12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import + +@interface Cell : NSObject { + NSMutableArray *DNA; +} + + +-(int) hammingDistance: (Cell*) myCell; +-(NSString *) getLetter; + +@end diff --git a/pr1dna/Cell.m b/pr1dna/Cell.m new file mode 100644 index 00000000..8b72600e --- /dev/null +++ b/pr1dna/Cell.m @@ -0,0 +1,56 @@ +// +// Cell.m +// pr1dna +// +// Created by админ on 11.11.12. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#import "Cell.h" + +@implementation Cell + +-(id) init { + self = [super init]; + + if (self) { + DNA = [[NSMutableArray alloc] init]; + for (int i = 0 ; i < 100; i++) { + [DNA addObject:[NSString stringWithString:[self getLetter]]]; + } + } + return self; +} + +-(NSString *) getLetter { + NSString *newElement; + int r = arc4random_uniform(4); + if (r == 0) + newElement = @"A"; + else if (r == 1) + newElement = @"T"; + else if (r == 2) + newElement = @"G"; + else + newElement = @"C"; + return newElement; +} + +-(int) hammingDistance: (Cell*) myCell { + int hammingDistance=0;//Сколько всего элементов не совпало + //Сравнение элементов: + NSArray *cell1 = DNA; + NSArray *cell2 = myCell->DNA; + + for (int i=0; i +#import "Cell.h" + +@interface Cell (mutator) + -(void) mutate: (int) x; +@end + +@implementation Cell (mutator) + +-(void) mutate:(int)x { + //Копируем массив. Кажется плохим решением + NSMutableArray *tempArray = [[NSMutableArray alloc] initWithArray:DNA]; + + for (int i =0; i +#endif diff --git a/pr1dna/pr1dna.1 b/pr1dna/pr1dna.1 new file mode 100644 index 00000000..682e7f63 --- /dev/null +++ b/pr1dna/pr1dna.1 @@ -0,0 +1,79 @@ +.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples. +.\"See Also: +.\"man mdoc.samples for a complete listing of options +.\"man mdoc for the short list of editing options +.\"/usr/share/misc/mdoc.template +.Dd 11.11.12 \" DATE +.Dt pr1dna 1 \" Program name and manual section number +.Os Darwin +.Sh NAME \" Section Header - required - don't modify +.Nm pr1dna, +.\" The following lines are read in generating the apropos(man -k) database. Use only key +.\" words here as the database is built based on the words here and in the .ND line. +.Nm Other_name_for_same_program(), +.Nm Yet another name for the same program. +.\" Use .Nm macro to designate other names for the documented program. +.Nd This line parsed for whatis database. +.Sh SYNOPSIS \" Section Header - required - don't modify +.Nm +.Op Fl abcd \" [-abcd] +.Op Fl a Ar path \" [-a path] +.Op Ar file \" [file] +.Op Ar \" [file ...] +.Ar arg0 \" Underlined argument - use .Ar anywhere to underline +arg2 ... \" Arguments +.Sh DESCRIPTION \" Section Header - required - don't modify +Use the .Nm macro to refer to your program throughout the man page like such: +.Nm +Underlining is accomplished with the .Ar macro like this: +.Ar underlined text . +.Pp \" Inserts a space +A list of items with descriptions: +.Bl -tag -width -indent \" Begins a tagged list +.It item a \" Each item preceded by .It macro +Description of item a +.It item b +Description of item b +.El \" Ends the list +.Pp +A list of flags and their descriptions: +.Bl -tag -width -indent \" Differs from above in tag removed +.It Fl a \"-a flag as a list item +Description of -a flag +.It Fl b +Description of -b flag +.El \" Ends the list +.Pp +.\" .Sh ENVIRONMENT \" May not be needed +.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1 +.\" .It Ev ENV_VAR_1 +.\" Description of ENV_VAR_1 +.\" .It Ev ENV_VAR_2 +.\" Description of ENV_VAR_2 +.\" .El +.Sh FILES \" File used or created by the topic of the man page +.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact +.It Pa /usr/share/file_name +FILE_1 description +.It Pa /Users/joeuser/Library/really_long_file_name +FILE_2 description +.El \" Ends the list +.\" .Sh DIAGNOSTICS \" May not be needed +.\" .Bl -diag +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .It Diagnostic Tag +.\" Diagnostic informtion here. +.\" .El +.Sh SEE ALSO +.\" List links in ascending order by section, alphabetically within a section. +.\" Please do not reference files that do not exist without filing a bug report +.Xr a 1 , +.Xr b 1 , +.Xr c 1 , +.Xr a 2 , +.Xr b 2 , +.Xr a 3 , +.Xr b 3 +.\" .Sh BUGS \" Document known, unremedied bugs +.\" .Sh HISTORY \" Document history if command behaves in a unique manner \ No newline at end of file