Arquivo da categoria: Programming

Programming

Clickable link | Pharo Smalltalk

Fiquei intrigado com o texto exibido na janela Welcome do Pharo 6.

Pharo 6 Welcome Window

Abaixo de Color theme há duas expressões: Pharo3Theme beCurrent e Pharo3DarkTheme beCurrent.

Como são expressões em Smalltalk cliquei por curiosidade. Como supostamente já estamos usando o Dark Theme cliquei na primeira expressão para ver o que acontecia. Surpresa! O tema mudou!

Pharo 6 Pharo3 Theme Again.png

Para restabelecer o Dark Theme basta um clique na segunda linha Pharo3DarkTheme beCurrent.

Um pouco de pesquisa na Internet me levou a um fórum onde o recurso é citado como um clickable coloured links.

Pharo 6 Clickable coloured links in Welcome Window cited in a forum

Resolvi então pesquisar no código fonte da imagem usando a ferramenta Finder.

Clique no fundo da janela principal para obter o World Menu.

Pharo 6 World Tools Finder menu selected

Pharo 6 Finder Tool Window

Vamos selecionar Source.

Pharo 6 Finder Tool Window Selecting Sources

E digitar Pharo3DarkTheme beCurrent ou Pharo3Theme beCurrent na caixa de edição.

Pharo 6 Finder Tool Window Edit Box with Pharo3Theme beCurrent

E clicar no botão Search.

Pharo 6 Finder Tool Window Pharo3Theme beCurrent search source result

No final do método Welcome encontrei o código procurado.

Pharo 6 Finder Tool Window welcome method

A criação dos clickable coloured links é feita com o método de classe WelcomeHelp class>>#doItFrom:.

Vamos localizar a implementação selecionando a mensagem doItFrom: e usando o menu Code Search….

Pharo 6 doItFrom Text Search for method implementation.png

Pharo 6 Implementors of doItFrom.png

Notamos que o método de classe WelcomeHelp class>>#doItFrom: retorna um Text.

Pharo 6 doItFrom returns Text

E que Text pode ser convertido em um Morph que é o retorno da mensagem asMorph.

Pharo 6 doItFrom Text return as Morph

Então construimos o código para abrir um morph e mostrar o texto Date today inspect como um clickable coloured link.

Pharo 6 Playground with clickable coloured link demo code

Usamos o botão Remote publish para compartilhar o código na Internet.

Pharo 6 Playground with clickable coloured link demo code published

Executar o script mostra um morph com o clickable coloured link e ao clicar no link a expressão Date today inspect é avaliada com Do it mostrando um Inspector para o retorno.

Pharo 6 clickable coloured link morph

Pharo 6 Date today inspect from a clickable coloured link

Bem… mistério solucionado!

Ao mesmo tempo várias ferramentas de investigação foram mostradas.

porkey

[Atualização] Descobri por acaso que inspecionar (Inspect it) a expressão, por exemplo, WelcomeHelp doItFrom: ‘Pharo3Theme beCurrent mostra no Inspector o clickable link de forma funcional.

Pharo 6 Functional Clickable Link on Inspector

Clique no link mostrado no Inspector e verá o efeito de mudar o tema.

Faça o mesmo no link do exemplo anterior com Date today inspect aparecendo como link no Inspector.

Anúncios

Pharo 6.0 released!

Pharo 6.0 released!

Dear World,

The time has come for Pharo 6.0!

Pharo is a pure object-oriented programming language and a powerful environment, focused on simplicity and immediate feedback.

This is our most significant release yet. Here are some highlights:

  • haro is now provided in 64-bit version in Linux and OSX and brings even better performance and stability (beware, 64bits version is a new technology and a small amount of tests is still failing)
  • A new code changes management system named Epicea for easier reviewing and recovering of your code easily
  • Integrated support for Git through an easy-to-use tool for repositories and commits management named Iceberg (as a preview for Pharo 6, it will be the default in Pharo 7)
  • The unified foreign function interface (UnifiedFFI) for interfacing with the outside world is significantly improved
  • The PharoVM is now part of OpenSmalltalk initiative
  • Introduction of object immutability, alternative bytecode sets and block closures independent of outer context
  • Pharo can now be bootstrapped from source code managed by Git
  • Pharo modularity is improved
  • Pharo is faster
  • The Dark Theme was improved and set as default color theme of Pharo
These are just the more prominent highlights, but the details are just as important. We have closed 1474 issues in Pharo 6.0 (a more complete changelog can be found at https://github.com/pharo-project/pharo-changelogs/blob/master/Pharo60ChangeLogs.md).

While the technical improvements are significant (starting the transition to 64bits is a remarkable achievement), still the most impressive fact is that the new code that got in the main Pharo 6.0 image was contributed by more than 80 people.

Pharo is more than code. It is an exciting project involving energetic people. We thank all the contributors of this release:

Alberto Bacchelli, Alejandro Infante, Alexandre Bergel, Aliaksei Syrel, Alistair Grant, Andrei Chis, Ben Coman, Bernardo Contreras, Bernhard Pieber, Boris Spasojevic, Christophe Demarey, Clement Bera, Cyril Ferlicot, Dale Henrichs, Damien Cassou, Damien Pollet, Dave Lewis, Denis Kudriashov, Dirk Roeleveld, Eliot Miranda, Esteban Lorenzano, Esteban Maringolo, Evan Donahue, Federico Balaguer, Franck Warlouzet, Glenn Cavarle, Guillermo Polito, Gustavo Santos, Henrik Johansen, Henrik Nergaard, Hilaire Fernandes, Holger Hans, Jan Kurs, Jan van de Sandt, Johan Fabry, Juraj Kubelka, K. K. Subramaniam, Ken Causey, Kris Gybels, Lionel Akue, Luc Fabresse, Lucas Godoy, Marcus Denker, Mariano Martinez Peck, Marion Noirbent, Martin Dias, Max Leske, Maxime Roelandt, Merwan Ouddane, Matteo Bellotto, Miguel Campusano, Milton Mamani, Myroslava Romaniuk, Nicolai Hess, Nicolas Cellier, Nicolas Passerini, Norbert Hartl, Offray Luna, Pablo Tesone, Paul De Bruicker, Pavel Krivanek, Peter Uhnak, Philippe Back, Roger Stebler, Ronie Salgado, Sean DeNigris, Serge Stinckwich, Skip Lentz, Sophie Kaleba, Stefan Reichhart, Stephan Eggermont, Stephane Ducasse, Sven Van Caekenberghe, Thibault Arloing, Thibault Arloing, Thibault Raffaillac, Thierry Goubier, Thomas Heniart, Tommaso Dal Sasso, Torsten Bergmann, Tudor Girba, Udo Schneider, Valentin Ryckewaert, Vincent Blondeau, Werner Kassens, Yuriy Tymchuk

(If you contributed with Pharo 6.0 development in any way and we missed your name, please send us a mail and we will add you).

Enjoy!

The Pharo Team

Try Pharo: http://pharo.org/download

Learn Pharo: http://pharo.org/documentation

Pharo By Example 5

Book Updated

Pharo By Example 5 is a new, updated version of Pharo By Example for Pharo 5. This book is the ideal introduction for anyone starting with Pharo, as well as a very useful reference for more experienced developers. The print version of this important community resource is still under work but the PDF is fully stable and released.

http://files.pharo.org/books/updated-pharo-by-example/

Pharo MOOC downloads e portal

s70kf

Links:

Unreal Engine

329122

Unreal Engine 4 is a complete suite of game development tools made by game developers, for game developers. From 2D mobile games to console blockbusters and VR, Unreal Engine 4 gives you everything you need to start, ship, grow and stand out from the crowd.

https://www.unrealengine.com/what-is-unreal-engine-4

Links:

Live Twitter Analysis and Visualization

Get list names from a Trello board with Pharo

trello3pharo-pic

English | Français | Español

Tenho um board no Trello denominado GTD. Veio a necessidade de listar os nomes das listas (lists) que tenho lá. No Trello não se consegue obter esta lista a não ser que se use a sua API. Resolvi então combinar a capacidade do Pharo e sua biblioteca Zinc com a API do Trello para criar um exemplo de como obter esta lista. O resultado deste pequeno esforço está no file out publicado em Shared Smalltalk Workspace M8PL4EBD9HXC.

Os valores hard coded para a API Key e Token do Trello são fakes. Substitua os seguindo as instruções em How to create Trello Cards from the Command Line. Para obter os nomes das listas no board desejado usamos a documentação na seção GET /1/boards/[board_id]/lists da API.