JavaScriptCore

Size: px
Start display at page:

Download "JavaScriptCore"

Transcription

1

2 24/7 twenty-four seven

3

4

5

6

7

8

9 JSContext *context = [[JSContext alloc] init]; JSValue *result = [context evaluatescript:@"2 + 8"]; NSLog(@"%d", result.toint32);

10 JSContext *context = [[JSContext alloc] init]; context[@"factorial"] = ^(int x) { int factorial = 1; for (; x > 1; x--) { factorial *= x; } return factorial; }; JSValue *result = [context evaluatescript:@"factorial(5);"]; NSLog(@"%d", result.toint32);

11 JSContext *context = [[JSContext alloc] init]; context[@"factorial"] = ^(int x) { int factorial = 1; for (; x > 1; x--) { factorial *= x; } return factorial; }; JSValue *function = context[@ factorial"]; JSValue *result = [function callwitharguments:@[@(5)]]; NSLog(@"%d", result.toint32);

12 JSContext *context = [[JSContext alloc] init]; [context sum(a, b) { return a + b; }" ]; JSValue *function = context[@ sum"]; JSValue *result = [function NSLog(@"%d", result.toint32);

13

14

15

16

17

18

19

20

21 NSBundle *bundle = [NSBundle mainbundle]; NSString *path = [bundle pathforresource:@"text-hatena" oftype:@"js"]; NSString *script = [NSString stringwithcontentsoffile:path encoding:nsutf8stringencoding error:nil]; JSContext *context = [[JSContext alloc] init]; [context evaluatescript:script]; [context evaluatescript:@"var parser = new TextHatena();"]; JSValue *parser = context[@"parser"]; NSString *text = [NSString stringwithcontentsoffile: [bundle pathforresource:@ sample oftype:@ txt"] encoding:nsutf8stringencoding error:nil]; NSLog(@"%@", [parser invokemethod:@"parse" witharguments:@[text]]); return YES;

22 * *[Objective-C][iOS]iOS - [ ios%e3%82%a2%e3%83%97%e3%83%aa%e3%81%a7%e5%a4%96%e9%83%a8%e3%82%ad%e3%83%bc%e3%83%9c%e3 %83%BC%E3%83%89%E3%81%8B%E3%82%89%E3%81%AE%E3%82%B7%E3%83%A7%E3%83%BC%E3%83%88%E3%82%AB %E3%83%83%E3%83%88:title=iOS - ios ] ios 7Safari[ ] ios 7API > readonly) NSArray *keycommands <

23 <div class="section"> <h3><a href="# " name=" "><span class="sanchor">o-</span></a> [<a class="sectioncategory" href="searchdiary?word=*[objective-c]">objective-c</a>][<a class="sectioncategory" href="searchdiary?word=*[ios]">ios</a>]ios </h3> <p> </p> <ul> <li> [ ios%e3%82%a2%e3%83%97%e3%83%aa%e3%81%a7%e5%a4%96%e9%83%a8%e3%82%ad%e3%83%bc%e3%83%9c%e3%83%bc%e3%8 3%89%E3%81%8B%E3%82%89%E3%81%AE%E3%82%B7%E3%83%A7%E3%83%BC%E3%83%88%E3%82%AB%E3%83%83%E3%83%88:tit le=ios - ios]</li> </ul> <br> <p>ios 7Safari[ <br> <p>ios 7API </p> <br> <p></p> <pre class="syntax-highlight prettyprint readonly) NSArray *keycommands </pre>

24

25 NSBundle *bundle = [NSBundle mainbundle]; NSString *path = [bundle pathforresource:@"textile" oftype:@"js"]; NSString *script = [NSString stringwithcontentsoffile:path encoding:nsutf8stringencoding error:nil]; JSContext *context = [[JSContext alloc] init]; [context evaluatescript:script]; JSValue *func = context[@"textile"]; NSString *text = [NSString stringwithcontentsoffile: [bundle pathforresource:@"sample" oftype:@ textile"] encoding:nsutf8stringencoding error:nil]; NSLog(@"%@", [func callwitharguments:@[text]]);

26 EvernoteMacEvernoteUI ["Jack Hirsch": h3. ["lesamoureuses": ["huin": ["myb": ["nun_": ["KohsakuNishida": ["": * 12:30* **** VOYAGE GROUP (8-16 8F)

27 <p>evernotemacevernoteui <a href=" Hirsch</a><br /> </p> <h3></h3> <p> </p> <p><a href=" /> <a href=" /> <a href=" /> <a href=" /> <a href=" /> <a href=" </p> <p><strong> 12:30</strong><br /> <b></b><br /> <span class="caps">voyage</span> <span class="caps">group</ span><br /> (8-16 8F)</p>

28

29

30

31 @protocol JSUIWindow (nonatomic) CGRect (nonatomic) UIColor *backgroundcolor; + (id)new; -

32 @interface JSUIWindow :

33 JSContext *context = [[JSContext alloc] init]; context[@"jsuiwindow"] = [JSUIWindow class]; JSContext *context = [[JSContext alloc] init]; context[@"jsuiwindow"] = [JSUIWindow class]; [context evaluatescript:@"var window = JSUIWindow.new();"]; JSValue *value = context[@"window"]; NSLog(@"%@", value.toobject);

34

35 class_addprotocol([uiwindow JSContext *context = [[JSContext alloc] init]; context[@"uiwindow"] = [UIWindow class]; [context evaluatescript:@"var window = UIWindow.new();"]; JSValue *value = context[@"window"]; NSLog(@"%@", value.toobject);

36

37 static void setup(jscontext *context) { const char *prefix = "JSUI"; unsigned int numberofclasses; Class *classes = objc_copyclasslist(&numberofclasses); for (unsigned int i = 0; i < numberofclasses; i++) { Class cls = classes[i]; const char *classname = class_getname(cls); NSString *name char protocolname[512]; snprintf(protocolname, sizeof(protocolname), "%s%s", prefix, classname); Protocol *proto = objc_allocateprotocol(protocolname); traverce_class(proto, cls); } objc_registerprotocol(proto); class_addprotocol(cls, proto); context[name] = cls; } free(classes);

38

39

40 @protocol JSBUIAlertView <JSExport, (nonatomic, readonly) NSInteger (nonatomic, readonly, getter = isvisible) BOOL (nonatomic) NSInteger (nonatomic, copy) NSString (nonatomic, copy) NSString (nonatomic, assign) id (nonatomic, assign) UIAlertViewStyle (nonatomic, readonly) NSInteger firstotherbuttonindex; - (id)initwithtitle:(nsstring *)title message:(nsstring *)message delegate:(id)delegate cancelbuttontitle:(nsstring *)cancelbuttontitle otherbuttontitles:(nsstring *)otherbuttontitles,...; - (NSInteger)addButtonWithTitle:(NSString *)title; - (NSString *)buttontitleatindex:(nsinteger)buttonindex; - (void)show; - (void)dismisswithclickedbuttonindex:(nsinteger)buttonindex animated: (BOOL)animated; - (UITextField *)textfieldatindex:(nsinteger)textfieldindex; #pragma clang diagnostic

41 @protocol JSBUIView <JSExport, (nonatomic, getter = isopaque) BOOL (nonatomic) CGRect (nonatomic, getter = ishidden) BOOL (nonatomic) BOOL (nonatomic, readonly, copy) NSArray *subviews; + (Class)layerClass; + (void)beginanimations:(nsstring *)animationid context:(void *)context; + (void)commitanimations;

42 @protocol JSBNSObject <JSExport, NSObject> - (BOOL)isEqual:(id)object; - (NSUInteger)hash; - (Class)superclass; - (Class)class; - (BOOL)isProxy; - (BOOL)isKindOfClass:(Class)aClass; - (BOOL)isMemberOfClass:(Class)aClass; - (BOOL)conformsToProtocol:(Protocol *)aprotocol; - (NSString *)description; - (NSString *)debugdescription; + (void)load; + (void)initialize; - (id)init; + (id)new; + (id)allocwithzone:(struct _NSZone *)zone;

43 JSContext *context = [JSBScriptingSupport globalcontext]; [context addscriptingsupport:@ AssetsLibrary"]; [context addscriptingsupport:@"accounts"]; [context addscriptingsupport:@"social"]; [context addscriptingsupport:@ MapKit"];

44 [context window = navigationcontroller tableviewcontroller = = alertview = = ];

45 UISlider *slider = [[UISlider alloc] initwithframe:frame]; slider.backgroundcolor = [UIColor clearcolor]; slider.minimumvalue = 0.0; slider.maximumvalue = 100.0; slider.continuous = YES; slider.value = 50.0; var slider = UISlider.alloc().initWithFrame(frame); slider.backgroundcolor = UIColor.clearColor(); slider.minimumvalue = 0.0; slider.maximumvalue = 100.0; slider.continuous = true; slider.value = 50.0;

46 UIWindow *window = [[UIWindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; var window = UIWindow.alloc().initWithFrame(UIScreen.mainScreen().bounds);

47 UIView *view = [UIView new]; view.frame = CGRectMake(20, 80, 280, 80); CGFloat x = view.frame.origin.x; CGFloat width = view.frame.size.width; var view = UIView.new(); view.frame = {x: 20, y: 80, width: 280, height: 80}; var x = view.frame.x; var width = view.frame.width;

48

49

50 var MainViewController = JSB.defineClass('MainViewController : UITableViewController', { // Instance Method Definitions viewdidload: function() { self.navigationitem.title = 'UICatalog'; }, viewwillappear: function(animated) { self.tableview.reloaddata(); } }, { // Class Method Definitions attemptrotationtodeviceorientation: function() {... } });

51 Class cls = objc_allocateclasspair(nsclassfromstring(parentclassname), classname.utf8string, 0); objc_registerclasspair(cls); Class superclass = class_getsuperclass(cls); if (superclass) { setupforwardingimplementations(cls, superclass, instancemembers, staticmembers); } NSString *types; BOOL result; Class metaclass = objc_getmetaclass(classname.utf8string); types = @encode(sel)]; result = (IMP)methodSignatureForSelector, types.utf8string); result = (IMP)methodSignatureForSelector, types.utf8string); types = @encode(nsinvocation)]; result = (IMP)forwardInvocation, types.utf8string); result = (IMP)forwardInvocation, types.utf8string); types = @encode(sel)]; result = (IMP)respondsToSelector, types.utf8string); result = (IMP)respondsToSelector, types.utf8string); for (NSString *protocol in [protocols componentsseparatedbystring:@","]) { class_addprotocol(cls, NSProtocolFromString([protocol stringbytrimmingcharactersinset:[nscharacterset whitespaceandnewlinecharacterset]])); } NSString *key = manglednamefromclass(cls); globalcontext[key] = cls; globalcontext[key][jsbinstancememberskey] = instancemembers; globalcontext[key][jsbstaticmemberskey] = staticmembers; return cls;

52 Class cls = objc_allocateclasspair(nsclassfromstring(parentclassname), classname.utf8string, 0); objc_registerclasspair(cls);

53 NSString *types; BOOL result; types = [NSString @encode(sel)]; result = (IMP)methodSignatureForSelector, types.utf8string);

54

55 NSMethodSignature *methodsignatureforselector(id self, SEL _cmd, SEL selector) { NSMethodSignature *methodsignature = nil; Class cls = object_getclass(self); if (class_ismetaclass(cls)) { methodsignature = [cls instancemethodsignatureforselector:selector]; if (methodsignature) { return methodsignature; } } else { methodsignature = [cls instancemethodsignatureforselector:selector]; if (methodsignature) { return methodsignature; } } NSUInteger numberofarguments = [[NSStringFromSelector(selector) componentsseparatedbystring:@":"] count] - 1; return [NSMethodSignature signaturewithobjctypes:[[@"@@:" stringbypaddingtolength:numberofarguments + 3 withstring:@"@" startingatindex:0] UTF8String]]; }

56 BOOL respondstoselector(id self, SEL _cmd, SEL selector) { NSString *propertyname = propertynamefromselector(selector); JSValue *function = propertyforobject(self, propertyname); } return function.isundefined;

57 void forwardinvocation(id self, SEL _cmd, NSInvocation *invocation) { JSContext *context = [JSBScriptingSupport globalcontext]; if ([[self superclass] instancesrespondtoselector:invocation.selector]) { invokesuper(invocation); } id currentself = context[@"self"]; context[@"self"] = self; NSString *propertyname = propertynamefromselector(invocation.selector); JSValue *function = propertyforobject(self, propertyname); if (function.isundefined) { NSArray *arguments = extractarguments(invocation); JSValue *returnvalue = [function callwitharguments:arguments]; } setreturnvalue(returnvalue, invocation); } context[@"self"] = currentself;

58 NSString *types; BOOL result; Class metaclass = objc_getmetaclass(classname.utf8string); types = @encode(sel)]; result = (IMP)methodSignatureForSelector, types.utf8string);

59 JSValue *propertyforobject(id obj, NSString *propertyname) { JSContext *context = [JSBScriptingSupport globalcontext]; JSValue *properties = nil; Class cls = object_getclass(obj); if (class_ismetaclass(cls)) { properties = context[manglednamefromclass(obj)][jsbstaticmemberskey]; } else { properties = context[manglednamefromclass(cls)][jsbinstancememberskey]; } } return properties[propertyname];

60 unsigned int numberofinstancemethods = 0; Method *instancemethods = class_copymethodlist(cls, &numberofinstancemethods); for (unsigned int i = 0; i < numberofinstancemethods; i++) { Method method = instancemethods[i]; struct objc_method_description *description = method_getdescription(method); NSString *propertyname = propertynamefromselector(description->name); JSValue *function = instancefunctions[propertyname]; if (function.isundefined) { class_addmethod(targetclass, description->name, _objc_msgforward, description->types); } } if (instancemethods) { free(instancemethods); }

61 class_addmethod(targetclass, description->name, _objc_msgforward, description->types);

62

63 OBJC_EXPORT id _objc_msgforward(id receiver, SEL sel,...) OSX_AVAILABLE_STARTING( MAC_10_0, IPHONE_2_0);

64 void forwardinvocation(id self, SEL _cmd, NSInvocation *invocation) { JSContext *context = [JSBScriptingSupport globalcontext]; if ([[self superclass] instancesrespondtoselector:invocation.selector]) { invokesuper(invocation); } id currentself = context[@"self"]; context[@"self"] = self; NSString *propertyname = propertynamefromselector(invocation.selector); JSValue *function = propertyforobject(self, propertyname); if (function.isundefined) { NSArray *arguments = extractarguments(invocation); JSValue *returnvalue = [function callwitharguments:arguments]; } setreturnvalue(returnvalue, invocation); } context[@"self"] = currentself;

65

66 var ButtonsViewController = JSB.require('buttonsViewController'); var ControlsViewController = JSB.require('controlsViewController'); var WebViewController = JSB.require('webViewController'); var MapViewController = JSB.require('mapViewController'); var MainViewController = JSB.defineClass('MainViewController : UITableViewController', { viewdidload: function() { self.navigationitem.title = 'UICatalog';... }); JSB.exports = MainViewController;

67

ARC Automatic Reference Counting clang 新しいコンパイラ LLVMプロジェクト (http://llvm.org/) のコンパイラ C Objective-C C++ の効率的なコードを生成 オプションなどは gcc とほぼ共通 Apple社独自の拡張機能を実現 ARC ブロックオブジェクトなど ARCを利用するには clang が必須 コンパイルオプションに

More information

AirPrintPublic

AirPrintPublic Printing on ios 4.2 Yutaka Yasuda, Kyoto Sangyo University AirPrint iphone / ipad Safari ios 4.2 2011 3 HP eprint ASCII.jp x MacPeople OS X AirPrint -- Apple Geeks 19 http://ascii.jp/elem/000/000/575/575397/

More information

lifedesign_contest_No3

lifedesign_contest_No3 1 3 5 Apple Developer Program 5 AWS 8 Raspberry Pi 14 18 19 { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "sns:createplatformendpoint" ], "Resource": [ ] ] #

More information

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool VDM-SL VDM++ 23 6 28 VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web 2 1 3 1.1............................................... 3 1.1.1 bool......................................... 3 1.1.2 real rat int

More information

index View Controller

index View Controller Creative Application Summer Camp Kengo Part - lesson 2 2011/08/26 index View Controller summer 2.1 View View (1) View View = View UIView View UIView (ex. ) UIView ( ) (, ) (c) / View (2) View 1. View 2.

More information

JavaScript の使い方

JavaScript の使い方 JavaScript Release10.5 JavaScript NXJ JavaScript JavaScript JavaScript 2 JavaScript JavaScript JavaScript NXJ JavaScript 1: JavaScript 2: JavaScript 3: JavaScript 4: 1 1: JavaScript JavaScript NXJ Static

More information

Lecture 3 Slides (January 12, 2010)

Lecture 3 Slides (January 12, 2010) CS193P - Lecture 3 iphone Application Development Custom Classes Object Lifecycle Autorelease Properties 1 Announcements Assignments 1A and 1B due Wednesday 1/13 at 11:59 PM Enrolled Stanford students

More information

Objective-C Objective-C C Toolbox API Cocoa Objective-C Java Carbon API C API Objective-C Java Pure Java Java AppleScript Java Objective-C Project Bui

Objective-C Objective-C C Toolbox API Cocoa Objective-C Java Carbon API C API Objective-C Java Pure Java Java AppleScript Java Objective-C Project Bui AppleScript Studio AppleScript AppleScript Stduio Objective-C Cocoa Cocoa Objective-C Java AppleScript AppleScript Studio Application Suite call method call method [of class ] [of object ] [with parameter

More information

Condition DAQ condition condition 2 3 XML key value

Condition DAQ condition condition 2 3 XML key value Condition DAQ condition 2009 6 10 2009 7 2 2009 7 3 2010 8 3 1 2 2 condition 2 3 XML key value 3 4 4 4.1............................. 5 4.2...................... 5 5 6 6 Makefile 7 7 9 7.1 Condition.h.............................

More information

program.dvi

program.dvi 2001.06.19 1 programming semi ver.1.0 2001.06.19 1 GA SA 2 A 2.1 valuename = value value name = valuename # ; Fig. 1 #-----GA parameter popsize = 200 mutation rate = 0.01 crossover rate = 1.0 generation

More information

cpp1.dvi

cpp1.dvi 2017 c 1 C++ (1) C C++, C++, C 11, 12 13 (1) 14 (2) 11 1 n C++ //, [List 11] 1: #include // C 2: 3: int main(void) { 4: std::cout

More information

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV [email protected] [email protected] http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 12 11 p.1/33 10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20

More information

paper.pdf

paper.pdf Cop: Web 1,a) 1,b) GUI, UI,,., GUI, Java Swing., Web HTML CSS,. CSS,, CSS,.,, HTML CSS Cop. Cop, JavaScript,,. Cop, Web,. Web, HTML, CSS, JavaScript, 1., GUI, Web., HTML CSS (UI), JavaScript, Web GUI.

More information

NSDate NSCalendarDate NSObject NSDate NSCalendarDate NSDate NSCalendarDate NSDate NSCalendar NSDate date NSDate *d = [ NSDate date ]; // NSDate : + (i

NSDate NSCalendarDate NSObject NSDate NSCalendarDate NSDate NSCalendarDate NSDate NSCalendar NSDate date NSDate *d = [ NSDate date ]; // NSDate : + (i 2002.7.30 ( 1 st Edition ) - 1 - NSDate NSCalendarDate NSObject NSDate NSCalendarDate NSDate NSCalendarDate NSDate NSCalendar NSDate date NSDate *d = [ NSDate date ]; // NSDate : + (id) date : init date

More information

Java演習(4) -- 変数と型 --

Java演習(4)   -- 変数と型 -- 50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends

More information

K227 Java 2

K227 Java 2 1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html

More information

haskell.gby

haskell.gby Haskell 1 2 3 Haskell ( ) 4 Haskell Lisper 5 Haskell = Haskell 6 Haskell Haskell... 7 qsort [8,2,5,1] [1,2,5,8] "Hello, " ++ "world!" "Hello, world!" 1 + 2 div 8 2 (+) 1 2 8 div 2 3 4 map even [1,2,3,4]

More information

RHEA key

RHEA key 2 P (k, )= k e k! 3 4 Probability 0.4 0.35 0.3 0.25 Poisson ( λ = 1) Poisson (λ = 3) Poisson ( λ = 10) Poisson (λ = 20) Poisson ( λ = 30) Gaussian (µ = 1, s = 1) Gaussian ( µ = 3, s = 3) Gaussian (µ =

More information

日 http://microformats.org/ 西 class class id class id title class id title rel class id 工 title rel

More information

ch31.dvi

ch31.dvi 1 1 1.1 1.1.1 ( ) ( 1.1 ): [ ] [ ] CPU[ + ] [ ] CPU( ) ( 1 2 1 1.1: ( 1.1 ): ( ) [ ] ( )[ ] + ( ) (+ ) ( ) ( ) 1.1. 3 1.2: ( ) ( ) ( 1.2) 4 1 1.3: 120m/ (432km/h) 0.5 2m/ 1 ( 1 ) ( ) ( ) ( 1.3) 1.1. 5

More information

P.1P.3 P.4P.7 P.8P.12 P.13P.25 P.26P.32 P.33

P.1P.3 P.4P.7 P.8P.12 P.13P.25 P.26P.32 P.33 : : P.1P.3 P.4P.7 P.8P.12 P.13P.25 P.26P.32 P.33 27 26 10 26 10 25 10 0.7% 331 % 26 10 25 10 287,018 280,446 6,572 30,236 32,708 2,472 317,254 313,154 4,100 172,724 168,173 4,551 6,420 6,579 159 179,144

More information

2016 IP 1 1 1 1.1............................................. 1 1.2.............................................. 1 1.3............................................. 1 1.4.............................................

More information

text_08.dvi

text_08.dvi C 8 12 6 6 8 Java (3) 1 8.1 8 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 1 8.2 : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :

More information

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( )

mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) 2008 3 10 1 mstrcpy char *mstrcpy(const char *src); mstrcpy malloc (main free ) stdio.h fgets char *fgets(char *s, int size, FILE *stream); s size ( ) stream FILE ( man ) 40 ( ) %./a.out String : test

More information

6 (1) app.html.eex 28 lib/nano_planner_web/templates/layout/app.html.eex 27 <footer> Oiax Inc <%= this_year() %> Oiax Inc. 29 </footer>

6 (1) app.html.eex 28 lib/nano_planner_web/templates/layout/app.html.eex 27 <footer> Oiax Inc <%= this_year() %> Oiax Inc. 29 </footer> 6 (1) of_today 6.1 Copyright 2017 lib/nano_planner_web/views layout_view.ex this_year/0 lib/nano_planner_web/views/layout_view.ex 1 defmodule NanoPlannerWeb.LayoutView do 2 use NanoPlannerWeb, view 3 +

More information

Parametric Polymorphism

Parametric Polymorphism ML 2 2011/04/19 Parametric Polymorphism Type Polymorphism ? : val hd_int : int list - > int val hd_bool : bool list - > bool val hd_i_x_b : (int * bool) list - > int * bool etc. let hd_int = function (x

More information

10 (1) s 10.2 rails c Rails 7 > item = PlanItem.new => #<PlanItem id nil, name nil,...> > item.name = "" => "" > item.valid? => true valid? true false

10 (1) s 10.2 rails c Rails 7 > item = PlanItem.new => #<PlanItem id nil, name nil,...> > item.name =  =>  > item.valid? => true valid? true false 10 (1) 16 7 PicoPlanner validations 10.1 PicoPlanner Web Web invalid values validations Rails validates validate 107 10 (1) s 10.2 rails c Rails 7 > item = PlanItem.new => #

More information

untitled

untitled II yacc 005 : 1, 1 1 1 %{ int lineno=0; 3 int wordno=0; 4 int charno=0; 5 6 %} 7 8 %% 9 [ \t]+ { charno+=strlen(yytext); } 10 "\n" { lineno++; charno++; } 11 [^ \t\n]+ { wordno++; charno+=strlen(yytext);}

More information

- - http://168iroha.net 018 10 14 i 1 1 1.1.................................................... 1 1.................................................... 7.1................................................

More information

JavaScript 1.! DOM Ajax Shelley Powers,, JavaScript David Flanagan, JavaScript 2

JavaScript 1.! DOM Ajax Shelley Powers,, JavaScript David Flanagan, JavaScript 2 JavaScript (2) 1 JavaScript 1.! 1. 2. 3. DOM 4. 2. 3. Ajax Shelley Powers,, JavaScript David Flanagan, JavaScript 2 (1) var a; a = 8; a = 3 + 4; a = 8 3; a = 8 * 2; a = 8 / 2; a = 8 % 3; 1 a++; ++a; (++

More information

VB.NETコーディング標準

VB.NETコーディング標準 (C) Copyright 2002 Java ( ) VB.NET C# AS-IS [email protected] [email protected] Copyright (c) 2000,2001 Eiwa System Management, Inc. Object Club Kenji Hiranabe02/09/26 Copyright

More information

Java updated

Java updated Java 2003.07.14 updated 3 1 Java 5 1.1 Java................................. 5 1.2 Java..................................... 5 1.3 Java................................ 6 1.3.1 Java.......................

More information

) 2013/7/27 iphone

) 2013/7/27 iphone ) 2013/7/27 iphone DJ / : takatronix Facebook/Twitter/Skype/LINE/Weibo -> takatronix http://takatronix.com LEGO FX SEXY SCAN... ( ) - - http://sexymirror-app.com 2013/1 iphone Objective-C Category( ) Objective-C

More information

presen.gby

presen.gby [email protected] 1 2 Paul Graham 3 Andrew Hunt and David Thomas 4 5 Java 6 Java Java Java 3 7 Haskell Scala Scala 8 9 Java Java Dean Wampler AWT ActionListener public interface ActionListener extends EventListener

More information

cssnitelp47_hasegawa_v02.key

cssnitelp47_hasegawa_v02.key 本当に利用は必要か デザイナーにとっての jquery と JavaScript フレームワーク HIROMU HASEGAWA " " show hide

More information

WinHPC ppt

WinHPC ppt MPI.NET C# 2 2009 1 20 MPI.NET MPI.NET C# MPI.NET C# MPI MPI.NET 1 1 MPI.NET C# Hello World MPI.NET.NET Framework.NET C# API C# Microsoft.NET java.net (Visual Basic.NET Visual C++) C# class Helloworld

More information

SmartBrowser_document_build30_update.pptx

SmartBrowser_document_build30_update.pptx SmartBrowser Update for ios / Version 1.3.1 build30 2017 年 8 月 株式会社ブルーテック 更新内容 - 概要 ios Version 1.3.1 build28 の更新内容について 1. 設定をQRから読み込み更新する機能 2.URLをQRから読み込み画面遷移する機能 3.WEBページのローカルファイル保存と外部インテントからの起動 4.JQuery-LoadImageライブラリの組み込み

More information

BW BW

BW BW Induced Sorting BW 11T2042B 2015 3 23 1 1 1.1................................ 1 1.2................................... 1 2 BW 1 2.1..................................... 2 2.2 BW.................................

More information

1153006 JavaScript try-catch JavaScript JavaScript try-catch try-catch try-catch try-catch try-catch 1 2 2 try-catch try-catch try-catch try-catch 25 1153006 26 2 12 1 1 1 2 3 2.1... 3 2.1.1... 4 2.1.2

More information

1.ppt

1.ppt /* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)

More information

アルゴリズムとデータ構造1

アルゴリズムとデータ構造1 1 200972 (sakai.keiichi@kochi [email protected]) http://www.info.kochi ://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2009/index.html 29 20 32 14 24 30 48 7 19 21 31 Object public class

More information

SystemC言語概論

SystemC言語概論 SystemC CPU S/W 2004/01/29 4 SystemC 1 SystemC 2.0.1 CPU S/W 3 ISS SystemC Co-Simulation 2004/01/29 4 SystemC 2 ISS SystemC Co-Simulation GenericCPU_Base ( ) GenericCPU_ISS GenericCPU_Prog GenericCPU_CoSim

More information

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World");

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println(Hello World); (Basic Theory of Information Processing) Java (eclipse ) Hello World! eclipse Java 1 3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello

More information

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

More information

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

More information

r08.dvi

r08.dvi 19 8 ( ) 019.4.0 1 1.1 (linked list) ( ) next ( 1) (head) (tail) ( ) top head tail head data next 1: NULL nil ( ) NULL ( NULL ) ( 1 ) (double linked list ) ( ) 1 next 1 prev 1 head cur tail head cur prev

More information

インターネットマガジン2001年9月号―INTERNET magazine No.80

インターネットマガジン2001年9月号―INTERNET magazine No.80 +CD-ROM Å 5 M0.9. A N S W E R function calc () { t = ocument.getelementbyi("tboy"); for(i = 0; i < t.rows.length; i++) { win = Number(t.rows[i].cells[3].firstChil.noeValue); lost = Number(t.rows[i].cells[].firstChil.noeValue);

More information

r3.dvi

r3.dvi 00 3 2000.6.10 0 Java ( 7 1 7 1 GSSM 1? 1 1.1 4 4a 4b / / 0 255 HTML X 0 255 16 (0,32,255 #0020FF Java xclock -bg #0020FF xclock ^C (Control C xclock 4c 1 import java.applet.applet; import java.awt.*;

More information

Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS Pascal

Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS Pascal Pascal Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS 2010 10 1 Pascal 2 1.1.......................... 2 1.2.................. 2 1.3........................ 3 2 4 2.1................................

More information

SGML HTML XML Markup Language Web HTML HTML SGML Standard Generalized Markup Language Markup Language DTD Document Type Definition XML SGML Markup Language HTML XML HTML XML JavaScript JAVA CGI HTML Web

More information

Smalltalk_

Smalltalk_ DLLCC VisualWorks C Mac OS SSK-LampControl/ VisualWorksWithJun SSK-LampControl.h include SSK SSK FileBrowser SSK-LampControl.st FIle in SSK-LampControl File in SSK File in ( Smalltalk.SSK) ( C ) Controller

More information

For_Beginners_CAPL.indd

For_Beginners_CAPL.indd CAPL Vector Japan Co., Ltd. 目次 1 CAPL 03 2 CAPL 03 3 CAPL 03 4 CAPL 04 4.1 CAPL 4.2 CAPL 4.3 07 5 CAPL 08 5.1 CANoe 5.2 CANalyzer 6 CAPL 10 7 CAPL 11 7.1 CAPL 7.2 CAPL 7.3 CAPL 7.4 CAPL 16 7.5 18 8 CAPL

More information

MPI MPI MPI.NET C# MPI Version2

MPI MPI MPI.NET C# MPI Version2 MPI.NET C# 2 2009 2 27 MPI MPI MPI.NET C# MPI Version2 MPI (Message Passing Interface) MPI MPI Version 1 1994 1 1 1 1 ID MPI MPI_Send MPI_Recv if(rank == 0){ // 0 MPI_Send(); } else if(rank == 1){ // 1

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double

More information

myx_backup Ver 1.10のPHP7対応

myx_backup Ver 1.10のPHP7対応 myx_backup Ver 1.10 の PHP7 対応 Published JJ1RLWon by 2016-05-03 (445 閲覧 ) XOOPS Cube の日頃のメンテナンスで使っているモジュールの myx_backup Ver 1.10 の PHP7 への対応お得意の ちょっとだけ改造 自前で行っています mysql 拡張から mysqli 拡張へ変更するため set_magic_quotes_runtime

More information

r03.dvi

r03.dvi 19 ( ) 019.4.0 CS 1 (comand line arguments) Unix./a.out aa bbb ccc ( ) C main void... argc argv argc ( ) argv (C char ) ( 1) argc 4 argv NULL. / a. o u t \0 a a \0 b b b \0 c c c \0 1: // argdemo1.c ---

More information

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1 Java (9) 1 Lesson 7 2008-05-20 Java System.out.println() 1 Java API 1 Java Java 1 GUI 2 Java 3 1.1 5 3 1.0 10.0, 1.0, 0.5 5.0, 3.0, 0.3 4.0, 1.0, 0.6 1 2 4 3, ( 2 3 2 1.2 Java (stream) 4 1 a 5 (End of

More information

ALG ppt

ALG ppt 2012614 ([email protected]) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html 1 2 2 3 29 20 32 14 24 30 48 7 19 21 31 4 N O(log N) 29 O(N) 20 32 14 24 30 48 7 19 21 31 5

More information

Hasegawa_pacsec.pptx

Hasegawa_pacsec.pptx NetAgent Co., Ltd. 自己 長谷 自己 用 行 ff http://developer.android.com/about/dashboards/index.html 示 示 示 h"p://media.admob.com/sdk core v40.js 入 言 // MainActivity.java public class foo{... public void method(

More information

Quartz OpenGL ES 注 3 注 4 図 2 注 5 3 3D 4 5 2 OpenGL ES Quartz Quartz Jun. 2011-135

Quartz OpenGL ES 注 3 注 4 図 2 注 5 3 3D 4 5 2 OpenGL ES Quartz Quartz Jun. 2011-135 iphone Quartz ios ios YOSHIDA Yuuichi http://sonson.jp 注 1 注 2 図 1 1 ios Objective-C 2 Google 1 Map Kit 3 Cocoa Touch 134 - Software Design Quartz OpenGL ES 注 3 注 4 図 2 注 5 3 3D 4 5 2 OpenGL ES Quartz

More information

monad.gby

monad.gby 2012.11.18 1 1 2 2 DSL 3 4 Q) A) 5 Q) A) 6 7 8 Haskell 9 10 Parser data Parser a = Parser (String -> [(a,string)]) Parser pwrap :: a -> Parser a pwrap v = Parser $ \inp -> [(v,inp)] Parser pbind :: Parser

More information

WPF アプリケーションの 多言語切替

WPF アプリケーションの 多言語切替 WPF アプリケーションの 多言語切替 YK S o f t w a r e 2015 年 6 月 2 日 @twyujiro15 プロフィール 加藤裕次郎 本職は製造業の開発業務 - 2009 年 4 月に入社 1982.03.03 生まれ ( うお座 ) 左利き ( お箸は右 ) twitter : @twyujiro15 プログラミング経験 Excel VBA MATLAB MATX C VC++

More information

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value = Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value

More information