SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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を!
 

Similaire à 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
 

Similaire à 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
 

Plus 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
 

Plus 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南蛮通事
 

Dernier

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

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

Notes de l'éditeur

  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