SlideShare una empresa de Scribd logo
1 de 72
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
21
22
23
24
n = IO.read("count.txt") rescue "0"
open("count.txt","w") {|f| f.puts n.to_i + 1}




                       26
n = IO.read("count.txt") rescue "0"                  n = IO.read("count.txt") rescue "0"

open("count.txt","w") {|f| f.puts n.to_i + 1}        open("count.txt","w") {|f| f.puts n.to_i + 1}




                                                27
n = IO.read("count.txt") rescue "0"
open("count.txt","w") {|f| f.puts n.to_i + 1}




                     28
29
30
while (true)
  begin
    break if Dir.mkdir("lock.txt")
  rescue
    sleep(1)
  end
end

n = IO.read("count.txt") rescue "0"
open("count.txt","w") {|f| f.puts n.to_i + 1}

Dir.rmdir("lock.txt")


                        31
lock(“a”)          lock(“b”)
lock(“b”)          lock(“a”)


unlock(“b”)        unlock(“a”)
unlock(“a”)        unlock(“b”)



              32
34
35
36
37
- (void)countThread:(id)param{

 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];




   [pool release];
}




   [NSThread detachNewThreadSelector:@selector(countThread:)

   
   
   
   
   
   toTarget:self withObject:self];

   NSLog(@"Thread started.");




                                         38
39
40
- (int) maxOfArray:(int *)a count:(int)n {
  static int max = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] > max) max = a[i];
  }
  return max;
}




                         41
- (int)randomNumber {
  static int rand = 7654321;
  rand = (rand * 12345 + 678901) & 0x7fff;
  return rand;
}




                         42
43
NSMutableDictionary *threadLoacl =
   [[NSTread currentThread] threadDictonary];

[threadLocal setObject:@”Test” forKey:@”mode”];


s = [threadLocal objectForKey:@”mode”]




                        44
@interface MyInt : NSObject {
  int intValue;
}
@end
@implementation MyInt
-(int) getInt {
  return intValue;
}
-(void) setOddInt:(int)i {
  intValue = i;
  intValue = (intValue >> 1) << 1;
}
@end


                        45
@interface MyString : NSObject {
  NSMutableString *str;
}
@end
@implementation MyInt
-(MyString *) getString {
  return str;
}
-(void) addString:(NSString *)s {
  [str appendString:s];
}
@end



                        46
47
48
@interface MyPoint : NSObject {
  GCPoint point;
}
@end
@implementation MyInt
-(GCPoint) getPoint {
  return point;
}
-(void) setPoint:(GCPoint)p {
  point = p;
}
@end



                        49
@interface MyString : NSObject {
  NSString *string;
}
@property (nonatomic, retain) NSString *string;
@end

@implementation MyString
@synthesize string;
@end




                           50
51
52
54
55
57
58
59
@interface CountOperation : NSOperation {

   id delegate;
}


@implementation CountOperation

- (id)initWithDelegate:(id)aDelegate {

    self = [super init];

    if (self != nil) {

    
       delegate = aDelegate;

    }

    return self;
}

- (void)main {

   NSAutoreleasePool *pool = [NSAutoreleasePool new];


  

  [pool release];
}
@end



   queue = [[NSOperationQueue alloc] init];



   CountOperation *op = [[[CountOperation alloc] initWithDelegate:self] autorelease];

   [queue addOperation:op];

   NSLog(@"Thread started.");
}


                                                     60
62
63
{|ary|           ^(NSArray *ary) {
  s = “”           NSMutableString *s = [NSMutableString string];
  for a in ary     for (NSString *a in ary) {
    s += a           [s appendString:a];
  end              }
  s                return s;
}                }



                               64
__block NSMutableString *s = [NSMutableString string];
^(NSArray *ary) {
  for (NSString *a in ary) {
    [s appendString:a];
  }
}




                            65
- (NSArray *)sortedArrayUsingSelector:
(SEL)comparator

- (NSArray *)sortedArrayUsingComparator:
(NSComparator)cmptr




                66
67
68
70
72

Más contenido relacionado

La actualidad más candente

Zone.js 2017
Zone.js 2017Zone.js 2017
Zone.js 2017Jia Li
 
Parallel Computing with R
Parallel Computing with RParallel Computing with R
Parallel Computing with RPeter Solymos
 
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...Databricks
 
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"OdessaJS Conf
 
Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.UA Mobile
 
The Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High PerformanceThe Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High PerformanceMongoDB
 
Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...
Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...
Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...Databricks
 
Quantum circuit example in Qiskit
Quantum circuit example in QiskitQuantum circuit example in Qiskit
Quantum circuit example in QiskitVijayananda Mohire
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3Simon Su
 
Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...
 Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt... Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...
Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...Databricks
 
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)Daniel Luxemburg
 
Engineering fast indexes
Engineering fast indexesEngineering fast indexes
Engineering fast indexesDaniel Lemire
 
The Ring programming language version 1.2 book - Part 42 of 84
The Ring programming language version 1.2 book - Part 42 of 84The Ring programming language version 1.2 book - Part 42 of 84
The Ring programming language version 1.2 book - Part 42 of 84Mahmoud Samir Fayed
 
Next Generation Indexes For Big Data Engineering (ODSC East 2018)
Next Generation Indexes For Big Data Engineering (ODSC East 2018)Next Generation Indexes For Big Data Engineering (ODSC East 2018)
Next Generation Indexes For Big Data Engineering (ODSC East 2018)Daniel Lemire
 
The Ring programming language version 1.2 book - Part 43 of 84
The Ring programming language version 1.2 book - Part 43 of 84The Ring programming language version 1.2 book - Part 43 of 84
The Ring programming language version 1.2 book - Part 43 of 84Mahmoud Samir Fayed
 

La actualidad más candente (20)

Zone.js 2017
Zone.js 2017Zone.js 2017
Zone.js 2017
 
Parallel Computing with R
Parallel Computing with RParallel Computing with R
Parallel Computing with R
 
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...
Analyzing the Performance Effects of Meltdown + Spectre on Apache Spark Workl...
 
C# Assignmet Help
C# Assignmet HelpC# Assignmet Help
C# Assignmet Help
 
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
Yurii Shevtsov "V8 + libuv = Node.js. Under the hood"
 
Sol6
Sol6Sol6
Sol6
 
Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.
 
The Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High PerformanceThe Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High Performance
 
NVT MD
NVT MDNVT MD
NVT MD
 
Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...
Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...
Extending Spark SQL API with Easier to Use Array Types Operations with Marek ...
 
Quantum circuit example in Qiskit
Quantum circuit example in QiskitQuantum circuit example in Qiskit
Quantum circuit example in Qiskit
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
 
Multi qubit entanglement
Multi qubit entanglementMulti qubit entanglement
Multi qubit entanglement
 
Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...
 Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt... Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...
Apply Hammer Directly to Thumb; Avoiding Apache Spark and Cassandra AntiPatt...
 
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
Exploring Color Spaces
 with Gesture Tracking and Smart Bulbs (Distill 2014)
 
Engineering fast indexes
Engineering fast indexesEngineering fast indexes
Engineering fast indexes
 
The Ring programming language version 1.2 book - Part 42 of 84
The Ring programming language version 1.2 book - Part 42 of 84The Ring programming language version 1.2 book - Part 42 of 84
The Ring programming language version 1.2 book - Part 42 of 84
 
Next Generation Indexes For Big Data Engineering (ODSC East 2018)
Next Generation Indexes For Big Data Engineering (ODSC East 2018)Next Generation Indexes For Big Data Engineering (ODSC East 2018)
Next Generation Indexes For Big Data Engineering (ODSC East 2018)
 
Efficient Programs
Efficient ProgramsEfficient Programs
Efficient Programs
 
The Ring programming language version 1.2 book - Part 43 of 84
The Ring programming language version 1.2 book - Part 43 of 84The Ring programming language version 1.2 book - Part 43 of 84
The Ring programming language version 1.2 book - Part 43 of 84
 

Destacado

Communiqué de presse réforme du régime des pensions des magistrats
Communiqué de presse  réforme du régime des pensions des magistratsCommuniqué de presse  réforme du régime des pensions des magistrats
Communiqué de presse réforme du régime des pensions des magistratsOBFG
 
Gaucheを使った簡易出版システム
Gaucheを使った簡易出版システムGaucheを使った簡易出版システム
Gaucheを使った簡易出版システムYuumi Yoshida
 
Programme actualisé
Programme actualiséProgramme actualisé
Programme actualiséOBFG
 
Réponse du CCBE au livre vert
Réponse du CCBE au livre vertRéponse du CCBE au livre vert
Réponse du CCBE au livre vertOBFG
 
今さら聞けないAWS on Rails
今さら聞けないAWS on Rails今さら聞けないAWS on Rails
今さら聞けないAWS on RailsYuumi Yoshida
 
新人教育に もっと Rubyを!
新人教育に もっと Rubyを!新人教育に もっと Rubyを!
新人教育に もっと Rubyを!Yuumi Yoshida
 

Destacado (8)

Communiqué de presse réforme du régime des pensions des magistrats
Communiqué de presse  réforme du régime des pensions des magistratsCommuniqué de presse  réforme du régime des pensions des magistrats
Communiqué de presse réforme du régime des pensions des magistrats
 
More rubyeducation
More rubyeducationMore rubyeducation
More rubyeducation
 
Gaucheを使った簡易出版システム
Gaucheを使った簡易出版システムGaucheを使った簡易出版システム
Gaucheを使った簡易出版システム
 
Programme actualisé
Programme actualiséProgramme actualisé
Programme actualisé
 
Réponse du CCBE au livre vert
Réponse du CCBE au livre vertRéponse du CCBE au livre vert
Réponse du CCBE au livre vert
 
今さら聞けないAWS on Rails
今さら聞けないAWS on Rails今さら聞けないAWS on Rails
今さら聞けないAWS on Rails
 
EvernoteAPI入門
EvernoteAPI入門EvernoteAPI入門
EvernoteAPI入門
 
新人教育に もっと Rubyを!
新人教育に もっと Rubyを!新人教育に もっと Rubyを!
新人教育に もっと Rubyを!
 

Similar a Grand centraldispatch

in this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdfin this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdfmichardsonkhaicarr37
 
PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...Andrey Karpov
 
Advance features of C++
Advance features of C++Advance features of C++
Advance features of C++vidyamittal
 
Cppt 101102014428-phpapp01
Cppt 101102014428-phpapp01Cppt 101102014428-phpapp01
Cppt 101102014428-phpapp01Getachew Ganfur
 
連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」matuura_core
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -Wataru Kani
 
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...DevGAMM Conference
 
Sparse Matrix and Polynomial
Sparse Matrix and PolynomialSparse Matrix and Polynomial
Sparse Matrix and PolynomialAroosa Rajput
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Er Ritu Aggarwal
 
Data structures lab manual
Data structures lab manualData structures lab manual
Data structures lab manualSyed Mustafa
 
java experiments and programs
java experiments and programsjava experiments and programs
java experiments and programsKaruppaiyaa123
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Platonov Sergey
 
The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88Mahmoud Samir Fayed
 
Agile Iphone Development
Agile Iphone DevelopmentAgile Iphone Development
Agile Iphone DevelopmentGiordano Scalzo
 
Java, Up to Date Sources
Java, Up to Date SourcesJava, Up to Date Sources
Java, Up to Date Sources輝 子安
 
design and analysis of algorithm Lab files
design and analysis of algorithm Lab filesdesign and analysis of algorithm Lab files
design and analysis of algorithm Lab filesNitesh Dubey
 

Similar a Grand centraldispatch (20)

in this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdfin this assignment you are asked to write a simple driver program an.pdf
in this assignment you are asked to write a simple driver program an.pdf
 
PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...PVS-Studio team experience: checking various open source projects, or mistake...
PVS-Studio team experience: checking various open source projects, or mistake...
 
Advance features of C++
Advance features of C++Advance features of C++
Advance features of C++
 
Cppt 101102014428-phpapp01
Cppt 101102014428-phpapp01Cppt 101102014428-phpapp01
Cppt 101102014428-phpapp01
 
連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」連邦の白いヤツ 「Objective-C」
連邦の白いヤツ 「Objective-C」
 
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
第二回 冬のスイッチ大勉強会 - FullColorLED & MPU-6050編 -
 
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
Самые вкусные баги из игрового кода: как ошибаются наши коллеги-программисты ...
 
Sparse Matrix and Polynomial
Sparse Matrix and PolynomialSparse Matrix and Polynomial
Sparse Matrix and Polynomial
 
Chapter 6 arrays part-1
Chapter 6   arrays part-1Chapter 6   arrays part-1
Chapter 6 arrays part-1
 
Google Guava
Google GuavaGoogle Guava
Google Guava
 
Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02Daapracticals 111105084852-phpapp02
Daapracticals 111105084852-phpapp02
 
Data structures lab manual
Data structures lab manualData structures lab manual
Data structures lab manual
 
java experiments and programs
java experiments and programsjava experiments and programs
java experiments and programs
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.
 
The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88
 
Agile Iphone Development
Agile Iphone DevelopmentAgile Iphone Development
Agile Iphone Development
 
ADA FILE
ADA FILEADA FILE
ADA FILE
 
WOTC_Import
WOTC_ImportWOTC_Import
WOTC_Import
 
Java, Up to Date Sources
Java, Up to Date SourcesJava, Up to Date Sources
Java, Up to Date Sources
 
design and analysis of algorithm Lab files
design and analysis of algorithm Lab filesdesign and analysis of algorithm Lab files
design and analysis of algorithm Lab files
 

Más de Yuumi Yoshida

教育というお仕事
教育というお仕事教育というお仕事
教育というお仕事Yuumi Yoshida
 
Nu program language on Shibuya.lisp#5 LT
Nu program language on  Shibuya.lisp#5 LTNu program language on  Shibuya.lisp#5 LT
Nu program language on Shibuya.lisp#5 LTYuumi Yoshida
 
流行るLisp用Webフレームワーク(Gauche on Railsから学んだ事)
流行るLisp用Webフレームワーク(Gauche on Railsから学んだ事)流行るLisp用Webフレームワーク(Gauche on Railsから学んだ事)
流行るLisp用Webフレームワーク(Gauche on Railsから学んだ事)Yuumi Yoshida
 
Ruby on Rails導入に付いて
Ruby on Rails導入に付いてRuby on Rails導入に付いて
Ruby on Rails導入に付いてYuumi Yoshida
 
6年前に作ったプログラムにテストコードを書きました ^^); 〜〜 テスト駆動開発の薦め
6年前に作ったプログラムにテストコードを書きました ^^); 〜〜 テスト駆動開発の薦め6年前に作ったプログラムにテストコードを書きました ^^); 〜〜 テスト駆動開発の薦め
6年前に作ったプログラムにテストコードを書きました ^^); 〜〜 テスト駆動開発の薦めYuumi Yoshida
 

Más de Yuumi Yoshida (8)

教育というお仕事
教育というお仕事教育というお仕事
教育というお仕事
 
Nu program language on Shibuya.lisp#5 LT
Nu program language on  Shibuya.lisp#5 LTNu program language on  Shibuya.lisp#5 LT
Nu program language on Shibuya.lisp#5 LT
 
ObjectiveResource
ObjectiveResourceObjectiveResource
ObjectiveResource
 
Lisp Primer Key
Lisp Primer KeyLisp Primer Key
Lisp Primer Key
 
流行るLisp用Webフレームワーク(Gauche on Railsから学んだ事)
流行るLisp用Webフレームワーク(Gauche on Railsから学んだ事)流行るLisp用Webフレームワーク(Gauche on Railsから学んだ事)
流行るLisp用Webフレームワーク(Gauche on Railsから学んだ事)
 
Ruby on Rails導入に付いて
Ruby on Rails導入に付いてRuby on Rails導入に付いて
Ruby on Rails導入に付いて
 
6年前に作ったプログラムにテストコードを書きました ^^); 〜〜 テスト駆動開発の薦め
6年前に作ったプログラムにテストコードを書きました ^^); 〜〜 テスト駆動開発の薦め6年前に作ったプログラムにテストコードを書きました ^^); 〜〜 テスト駆動開発の薦め
6年前に作ったプログラムにテストコードを書きました ^^); 〜〜 テスト駆動開発の薦め
 
Rails南蛮通事
Rails南蛮通事Rails南蛮通事
Rails南蛮通事
 

Último

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Último (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Grand centraldispatch

  • 1.
  • 2. 2
  • 3. 3
  • 4. 4
  • 5. 5
  • 6. 6
  • 7. 7
  • 8. 8
  • 9. 9
  • 10. 10
  • 11.
  • 12. 12
  • 13. 13
  • 14. 14
  • 15. 15
  • 16. 16
  • 17. 17
  • 18. 18
  • 19. 19
  • 20.
  • 21. 21
  • 22. 22
  • 23. 23
  • 24. 24
  • 25.
  • 26. n = IO.read("count.txt") rescue "0" open("count.txt","w") {|f| f.puts n.to_i + 1} 26
  • 27. n = IO.read("count.txt") rescue "0" n = IO.read("count.txt") rescue "0" open("count.txt","w") {|f| f.puts n.to_i + 1} open("count.txt","w") {|f| f.puts n.to_i + 1} 27
  • 28. n = IO.read("count.txt") rescue "0" open("count.txt","w") {|f| f.puts n.to_i + 1} 28
  • 29. 29
  • 30. 30
  • 31. while (true) begin break if Dir.mkdir("lock.txt") rescue sleep(1) end end n = IO.read("count.txt") rescue "0" open("count.txt","w") {|f| f.puts n.to_i + 1} Dir.rmdir("lock.txt") 31
  • 32. lock(“a”) lock(“b”) lock(“b”) lock(“a”) unlock(“b”) unlock(“a”) unlock(“a”) unlock(“b”) 32
  • 33.
  • 34. 34
  • 35. 35
  • 36. 36
  • 37. 37
  • 38. - (void)countThread:(id)param{ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [pool release]; } [NSThread detachNewThreadSelector:@selector(countThread:) toTarget:self withObject:self]; NSLog(@"Thread started."); 38
  • 39. 39
  • 40. 40
  • 41. - (int) maxOfArray:(int *)a count:(int)n { static int max = 0; for (int i = 0; i < n; i++) { if (a[i] > max) max = a[i]; } return max; } 41
  • 42. - (int)randomNumber { static int rand = 7654321; rand = (rand * 12345 + 678901) & 0x7fff; return rand; } 42
  • 43. 43
  • 44. NSMutableDictionary *threadLoacl = [[NSTread currentThread] threadDictonary]; [threadLocal setObject:@”Test” forKey:@”mode”]; s = [threadLocal objectForKey:@”mode”] 44
  • 45. @interface MyInt : NSObject { int intValue; } @end @implementation MyInt -(int) getInt { return intValue; } -(void) setOddInt:(int)i { intValue = i; intValue = (intValue >> 1) << 1; } @end 45
  • 46. @interface MyString : NSObject { NSMutableString *str; } @end @implementation MyInt -(MyString *) getString { return str; } -(void) addString:(NSString *)s { [str appendString:s]; } @end 46
  • 47. 47
  • 48. 48
  • 49. @interface MyPoint : NSObject { GCPoint point; } @end @implementation MyInt -(GCPoint) getPoint { return point; } -(void) setPoint:(GCPoint)p { point = p; } @end 49
  • 50. @interface MyString : NSObject { NSString *string; } @property (nonatomic, retain) NSString *string; @end @implementation MyString @synthesize string; @end 50
  • 51. 51
  • 52. 52
  • 53.
  • 54. 54
  • 55. 55
  • 56.
  • 57. 57
  • 58. 58
  • 59. 59
  • 60. @interface CountOperation : NSOperation { id delegate; } @implementation CountOperation - (id)initWithDelegate:(id)aDelegate { self = [super init]; if (self != nil) { delegate = aDelegate; } return self; } - (void)main { NSAutoreleasePool *pool = [NSAutoreleasePool new]; [pool release]; } @end queue = [[NSOperationQueue alloc] init]; CountOperation *op = [[[CountOperation alloc] initWithDelegate:self] autorelease]; [queue addOperation:op]; NSLog(@"Thread started."); } 60
  • 61.
  • 62. 62
  • 63. 63
  • 64. {|ary| ^(NSArray *ary) { s = “” NSMutableString *s = [NSMutableString string]; for a in ary for (NSString *a in ary) { s += a [s appendString:a]; end } s return s; } } 64
  • 65. __block NSMutableString *s = [NSMutableString string]; ^(NSArray *ary) { for (NSString *a in ary) { [s appendString:a]; } } 65
  • 66. - (NSArray *)sortedArrayUsingSelector: (SEL)comparator - (NSArray *)sortedArrayUsingComparator: (NSComparator)cmptr 66
  • 67. 67
  • 68. 68
  • 69.
  • 70. 70
  • 71.
  • 72. 72

Notas del editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n
  72. \n