Any application accepting passwords from users must use password hashing, which pays off in the event of a website breach by limiting the damage. The basic idea is that you do not store the passwords but a "one-way" derived token, then make it difficult enough (in terms of money and time) to reverse the stored token and get the original password.
We say "difficult" because if you have pre computed...
domingo, 30 de septiembre de 2018
sábado, 29 de septiembre de 2018
Pharo Script of the Day: Configure R <-> Pharo Smalltalk with RProjectConnector
RProjectConnector is a package to access the R programming language in Pharo. The following script shows how to install and configure it in a clean image, using OSWindows to automatically get the R path installation:Install OS-WindowsMetacello new
baseline: 'OSWindows';
repository: 'github://astares/Pharo-OS-Windows/src';
load.
Install RProjectConnectorGofer it
smalltalkhubUser: 'VincentBlondeau'...
viernes, 28 de septiembre de 2018
Pharo Script of the Day: Migrate FileReferences from Linux/MacOS to Windows
A very simple porting script today: If you move a Pharo image from MacOS/GNU Linux to Windows you could experiment issues with FileReferences file system not automatically converted. In that case, you can evaluate this code to update to the Windows platform and prevent annoying exceptions when accessing file references:
| winFS |
winFS := FileSystem allInstances detect: [ :fs | fs store isKindOf:...
jueves, 27 de septiembre de 2018
Pharo Script of the Day: Prefix all class names in a package
The following Pharo script takes a String with the first letters of a package as input (pkgPrefix) and a two-letter String used to prefix all its classes. It creates then a refactoring environment for such packages and renames all its classes with the provided newClassPrefix:
| pkgPrefix newClassPrefix env model |
pkgPrefix := ''.
newClassPrefix := 'NP'.
env := RBBrowserEnvironment new forPackageNames:...
miércoles, 26 de septiembre de 2018
Pharo Script of the Day: Replay cookies with Zinc HTTP components
For this one we will use a browser plug-in called CookieBro. It will allow us to import existing cookies from a web browser session into Pharo Smalltalk just using the Zinc HTTP Components, which are by default installed in the image, and NeoJSON. Let's assume then we have exported the cookies in a "cookiebro-cookies.json" file, the script translates the cookie's JSON format into a name–value pair...
martes, 25 de septiembre de 2018
Pharo Script of the Day: Sort a column in a CSV file
Hi there. Today I wanted to translate to Pharo Smalltalk the code in a Bash one-liner to sort a column in a CSV file:cat myfile.txt | cut -d \; -f 2 | sortFor replicating this one, you will need the NeoCSV package (doc), and just use the power of SortedCollection:SortedCollection streamContents: [ : out |
'myfile.txt' asFileReference readStreamDo: [ : in |
(NeoCSVReader on: (ZnBufferedReadStream...
lunes, 24 de septiembre de 2018
Pharo Script of the Day: Parsing Gene Ontology terms

Today a script from the Bioinformatics world, accessing an EBI REST service called QuickGO, to retrieve Gene Ontology information. For the first script I use the NeoJSON library, and return a Pharo dictionary which we can inspect interactively through the Inspector:(NeoJSONReader on: (ZnClient new
accept: ZnMimeType applicationJson;
url: 'http://www.ebi.ac.uk/QuickGO/services/ontology/go/terms/GO:0005623,GO:0017071,GO:0030680';
...
domingo, 23 de septiembre de 2018
Pharo Script of the Day: Rename instance variables programmatically
Today I am starting a series of posts sharing some short (I hope) Pharo scripts which can be useful for others in the community. I have published some of them in the mailing list, so it is also an attempt to resurrect them from the oblivion. The first script goal is to programmatically rename an instance variable in MyClass from oldName to newName (tested in Pharo 6.1):(RBRenameInstanceVariableRefactoring
...
Suscribirse a:
Entradas (Atom)