Crab Log

Entradas categorizadas em ‘Smalltalk’

Alphabetic Batched List Hack

Maio 31, 2008 · Deixe um comentário

WAAlphabeticBatchedList efetua a paginação de uma lista de forma alfabética.

Para testar crie a classe com o código:

WAComponent subclass: #AlphabeticBatchedListHack

instanceVariableNames: ‘items batchedlist’

classVariableNames:

poolDictionaries:

category: ‘Seaside-Hacks’

Os métodos são:

initialize

super initialize.

items := Collection allSubclasses..

batchedlist := WAAlphabeticBatchedList new.

batchedlist items: items

renderContentOn: html

html heading: self class description.

html heading: ‘All subclasses of Collection’ level: 2.

batchedlist batch

do: [:item | html render: item. html break].

html render: batchedlist

children

^ Array with: batchedlist

A página apresentada é como abaixo:

Categorias: Smalltalk
Etiquetado: ,

Batched List Hack

Maio 30, 2008 · Deixe um comentário

Neste hack colocamos alguns códigos que podem esclarecer como usar o componente WABatchedList no Seaside. Primeiro crie a classe de teste com:

WAComponent subclass: #BatchedListHack

instanceVariableNames: ‘items batchedlist’

classVariableNames:

poolDictionaries:

category: ‘Seaside-Hacks’

Depois implemente os seguintes métodos:

initialize
super initialize.
items := OrderedCollection new.
1
to: 100
do: [:k | items add: 'item ' , (k asString padded: #left to: 3 with: $0)].
batchedlist := WABatchedList new.
batchedlist batchSize: 15.
batchedlist items: items

renderContentOn: html

html heading: ‘Batched List Test’.

batchedlist batch

do: [:item |

html render: item.

html break].

html render: batchedlist

children

^ Array with: batchedlist

A página gerada é como abaixo:

Categorias: Smalltalk
Etiquetado: ,

Smalltalk is dangerous. It is a drug.

Maio 30, 2008 · Deixe um comentário

“Smalltalk is dangerous. It is a drug. My advice to you would be don’t try it; it could ruin your life. Once you take the time to learn it (to REALLY learn it) you will see that there is nothing out there (yet) to touch it. Of course, like all drugs, how dangerous it is depends on your character. It may be that once you’ve got to this stage you’ll find it difficult (if not impossible) to “go back” to other languages and, if you are forced to, you might become an embittered character constantly muttering ascerbic comments under your breath. Who knows, you may even have to quit the software industry altogether because nothing else lives up to your new expectations.”

Andy Bower

Fonte: Seaside, ROR and retiring Java from the spotlight of web applications

Categorias: Smalltalk · Software · Tecnologia

Smalltalk em *batteries not included

Abril 27, 2008 · 2 Comentários

O blog de Daniel Martins, além da abordagem agradável de outros assuntos, é também uma excelente fonte de esclarecimentos sobre Smalltalk, Squeak, Seaside e Magritte.

Ah, o filme também é bacana.

Categorias: Smalltalk · post-citação
Etiquetado: , , ,

Smalltalk Quine

Abril 26, 2008 · Deixe um comentário

null
Um quine em Smalltalk:

| prog quote |
quote := Character value: 39.
prog := '| prog quote |
quote := Character value: 39.
prog := .
Transcript show: (prog copyFrom: 1 to: 53).
Transcript show: quote asString; show: prog; show: quote asString.
Transcript show: (prog copyFrom: 54 to: 212).
'.
Transcript show: (prog copyFrom: 1 to: 53).
Transcript show: quote asString; show: prog; show: quote asString.
Transcript show: (prog copyFrom: 54 to: 212).

Fonte: http://www.nyx.net/~gthompso/self_smalltalk.txt

Links relacionados:

Categorias: Smalltalk
Etiquetado:

Seaside reference

Abril 22, 2008 · Deixe um comentário

  • Seaside dandelionOutput
  • Dandelion
  • Dandelion is a generic Smalltalk code analysis/output framework. You can analyze your code and output the information in various formats (currently HTML, SMIX, Petal, XMI).Dandelion looks like a “doclet” in Smalltalk. And the impression is 80% right. However, I believe Dandelion has more flexibility. You can customize not only outputting format, but also analysis policy(what/how code elements will be analyzed) and analyzed information storage(how the analysis information is stored).

Categorias: Smalltalk
Etiquetado:

Encontrando código no Squeak

Abril 19, 2008 · Deixe um comentário

Categorias: Knowledge Base · Smalltalk
Etiquetado:

Dr. Geo II

Março 25, 2008 · 2 Comentários

Há alguns anos, inspirado no programa Geometer Sketchpad (por sua vez inspirado no programa Cabri Géomètre) comecei a fazer um similar em Object Pascal (Delphi). Recentemente encontrei uma implementação open source muito boa em Squeak: o Dr Geo II, um programa para experimentação dinâmica com geometria. Brinquei um pouco com ele e gostei bastante (Clique na imagem abaixo para ampliá-la).

drgeoii.png

Links relacionados:

Categorias: Matemática · Smalltalk · Software

What to do if Squeak crashes or freezes

Fevereiro 13, 2008 · Deixe um comentário

Categorias: Knowledge Base · Smalltalk · Software · Tecnologia · post-citação

Dolphin Community Edition

Fevereiro 9, 2008 · Deixe um comentário

Instalei hoje o Dolphin Community Edition da

Quero investigar o MVP e as maravilhas que falam deste ambiente.

Categorias: Cotidiano · Smalltalk · Software · Tecnologia