smalltalk

Smalltalk Pharo ZdcSecureSMTPClient not showing html formatting in GMail?

这一生的挚爱 提交于 2019-12-05 15:56:13
I'm using ZdcSecureSMTPClient to send an html formatted string to a gmail account. But when I send it it displays the html encoding as plain text. ie) mailMessage := MailMessage empty. mailMessage setField: 'subject' toString: 'Trying to send html '. mailMessage body: (MIMEDocument contentType: 'text/html\n' content: '<html><head><b> Dear </b></head></html>' This shows is Gmail as: 'html> head> Dear /b>/head>/html>' Using Seaside/Pharo 2.0 one click image. What you use to set the mime type is not what is expected (additionally, the content of the message should be in body , not head ). Use

简介Objective-C语言

末鹿安然 提交于 2019-12-05 15:44:06
Objective-C,通常写作ObjC和较少用的Objective C或Obj-C,是扩充C的面向对象编程语言。它主要使用于Mac OS X和GNUstep这两个使用OpenStep标准的系统,而在NeXTSTEP和OpenStep中它更是基本语言。Objective-C可以在gcc运作的系统写和编译,因为gcc含Objective-C的编译器。1980年代初布莱德·确斯(Brad Cox)在其公司Stepstone发明Objective-C。他对软件设计和编程里的真实可用度问题十分关心。Objective-C最主要的描述是他1986年出版的Object Oriented Programming: An Evolutionary Approach. Addison Wesley. ISBN 0-201-54834-8. 优点及缺点 Objective-C是非常“实际”的语言。它使用一个用C写成、很小的运行库,只会令应用程序的大小增加很小,和大部分OO系统使用极大的VM执行时间会取代了整个系统的运作相反。ObjC写成的程序通常不会比其原始码大很多。而其函式库(通常没附在软件发行本)亦和Smalltalk系统要使用极大的内存来开启一个窗口的情况相反。 Objective-C的最初版本并不支持垃圾回收。在当时这是争论的焦点之一,很多人考虑到Smalltalk回收时有漫长的“死亡时间”

Sinatra-like web-framework for Pharo Smalltalk [closed]

佐手、 提交于 2019-12-05 15:18:39
Is there a Sinatra -like web-framework for Pharo? Or can the Zinc-HTTP-components do that more or less out-of-the-box? Thanks! Depending on your exact needs, Seaside-REST might also be interesting . I have been kindly pointed to Ratpack by Tim Felgentreff http://ss3.gemstone.com/ss/RatPack.html He also has a github repository, probably with more up-to-date code: https://github.com/timfel/ratpack 来源: https://stackoverflow.com/questions/13674859/sinatra-like-web-framework-for-pharo-smalltalk

Smalltalk runtime features absent on Objective-C?

ⅰ亾dé卋堺 提交于 2019-12-05 09:16:56
I don't know well Smalltalk, but I know some Objective-C. And I'm interested a lot in Smalltalk. Their syntax are a lot different, but essential runtime structures (that means features) are very similar. And runtime features are supported by runtime. I thought two languages are very similar in that meaning, but there are many features on Smalltalk that absent on Objective-C runtime. For an example, thisContext that manipulates call-stack. Or non-local return that unwinds block execution. The block s. It was only on Smalltalk, anyway now it's implemented on Objective-C too. Because I'm not

How do I ask the user for a file name?

冷暖自知 提交于 2019-12-05 08:31:10
Searching for the call of a FileDialog I would like to ask the user for a file name in Pharo 4.0 Through the spotter I found class FileDialogWindow with a method answerFileName Looking for the senders of #answerFileName I get to class UITheme where it is called in the method chooseFileNameIn: aThemedMorph title: title extensions: exts path: path preview: preview And from there I come to class TEasilyThemed with the method chooseFileName: title extensions: exts path: path preview: preview From there finally I get to class WidgetExamples class >> exampleDialogs And then I have the call

What's the difference between Polymorph and Spec?

喜欢而已 提交于 2019-12-05 08:13:41
Recently a Spec documentation was released on-line , how it is related with the Polymorph project? It would be nice to read about the future of these projects. Is Polymorph discontinued? Polymorph is a UI framework. Spec is a UI description framework based on literal arrays. In other words the widgets you see on the screen come from Polymorph. A UI builder takes a Spec specification and builds those widgets: "here's a button of this size, and this is its name". In Squeak, the same relationship exists between Morphic or MVC, and ToolBuilder. 来源: https://stackoverflow.com/questions/11251663

Explain a piece of Smalltalk code?

筅森魡賤 提交于 2019-12-05 08:08:55
I cannot understand this piece of Smalltalk code: [(line := self upTo: Character cr) size = 0] whileTrue. Can anybody help explain it? One easy thing to do, if you have the image where the code came from, is run a debugger on it and step through. If you came across the code out of context, like a mailing list post, then you could browse implementers of one of the messages and see what it does. For example, #size and #whileTrue are pretty standard, so we'll skip those for now, but #upTo: sounds interesting. It reminds me of the stream methods, and bringing up implementors on it confirms that

Elegant way to remove the last part of a string?

ε祈祈猫儿з 提交于 2019-12-05 05:40:37
In Smalltalk, if given the string 'OneTwoThree', I'd like to remove the last 'Three' part, .e., In Squeak method finder notation: 'OneTwoThree' . 'Three' . 'OneTwo' . The best I can come up with is: 'OneTwoThree' allButLast: 'Three' size , but it doesn't feel very Smalltalk-ish, because it uses the substring length, rather than the substring itself. How would you code it? 'OneTwoThree' readStream upToAll: 'Three' I usually use #copyReplaceAll:with: method, if the last string is not repeated elsewhere in the original string of course: 'OneTwoThree' copyReplaceAll: 'Three' with: '' In the Moose

What is the difference between a Morph in Morphic and a NSView in Cocoa?

China☆狼群 提交于 2019-12-05 04:22:08
I'd like to know about the things that make Morphic special. Morphic is much more than NSView or any other graphics class that simply allow the re-implementation of a limited set of features. Morphic is an extremely malleable UI construction kit. Some design ideas behind Morphic makes this intention clear: A comprehensive hierarchy of 2D coordinate systems is included. They are not restricted to Cartesian or linear. Useful nonlinear coordinate systems include polar, logarithmic,hyperbolic and geographic (map like) projections. Separation of the handling of coordinate systems from the morphs

Implementation Strategies for Object Orientation

非 Y 不嫁゛ 提交于 2019-12-05 02:51:53
I'm currently learning Smalltalk in the Squeak environment and I'm reading "Squeak - A Quick Trip To ObjectLand". I enter the object-oriented paradigm with some prior knowledge from Python and Java and this sentence from the book on page 36 has made me think: Smalltalk is a class-based implementation of an object-oriented language. Short sentence but very interesting. In OO all terms like class, object, instance seem to be well-defined and seem to point to the one and only true meaning and you're likely to come across generic sentences like "objects are instances of a class". But you hear