Re: [Pharo-users] OpenGL minimum working example?

2018-11-12 Thread Ronie Salgado
Hi Hernan,

I just added two new examples, UFFIOpenGLOffscreenSamples >> #triangle and
UFFIOpenGLOffscreenSamples >> #quad (using your vertices). I tested it on
Linux and on OS X.

triangle
"
self new triangle
"
| context gl fb colorProgram vertexBuffer |
context := UFFIOpenGLContext new.
colorProgram := self colorProgramFor: context.
vertexBuffer := self immutableVertexBufferFor: context
withPackedFloats: {
"   x  y z r g b a "
{ -0.5 . 0.5 . 0.0 . 1.0 . 0.0 . 0.0 . 1.0 }.
{  0.5 . 0.5 . 0.0 . 0.0 . 1.0 . 0.0 . 1.0 }.
{  0.0 . -0.5 . 0.0 . 0.0 . 0.0 . 1.0 . 1.0 }.
}.

gl := context gl.
fb := context offscreenBufferExtent: 640@480.

context asCurrentDo: [
fb activate.
gl
viewport_x: 0 y: 0 width: 640 height: 480;

clearColor_red: 0.0 green: 0.0 blue: 0.0 alpha: 1.0;
clear: GL_COLOR_BUFFER_BIT;

useProgram: colorProgram validHandle;

bindBuffer_target: GL_ARRAY_BUFFER buffer: vertexBuffer
validHandle.
self activateDefaultVertexLayoutOn: context.

gl drawArrays_mode: GL_TRIANGLES first: 0 count: 3
].

fb asForm asMorph openInWindow.

Best regards,
Ronie

El mar., 13 nov. 2018 a las 1:23, Ben Coman ()
escribió:

>
>
> On Tue, 13 Nov 2018 at 03:37, Hernán Morales Durand <
> hernan.mora...@gmail.com> wrote:
>
>> Hi.
>>
>> I tried to get an OpenGL MWE from
>> https://github.com/ronsaldo/uffi-opengl in both Windows 8.1 and MacOS
>> without luck. What I tried so far is to render a simple figure in a
>> new window, adding this method to UFFIOpenGLOffscreenSamples:
>>
>
> You may also be interested in "Use Metal instead of OpenGL for the main VM
> Window in OS X" ...
> https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/306
>
> cheers -ben
>


Re: [Pharo-users] OpenGL minimum working example?

2018-11-12 Thread Ben Coman
On Tue, 13 Nov 2018 at 03:37, Hernán Morales Durand <
hernan.mora...@gmail.com> wrote:

> Hi.
>
> I tried to get an OpenGL MWE from
> https://github.com/ronsaldo/uffi-opengl in both Windows 8.1 and MacOS
> without luck. What I tried so far is to render a simple figure in a
> new window, adding this method to UFFIOpenGLOffscreenSamples:
>

You may also be interested in "Use Metal instead of OpenGL for the main VM
Window in OS X" ...
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/306

cheers -ben


Re: [Pharo-users] Canonical download location for Pharo VMs

2018-11-12 Thread Ben Coman
On Tue, 13 Nov 2018 at 08:03, Esteban Maringolo 
wrote:

> What is the canonical repository/ci to download the latest VM for Pharo?
>
> I'm trying to get pharo launcher to launch a 32 bit image in Windows, but
> it complains it can't determine the image version, so I'm trying to
> download the latest 32 bit VM for Windows to launch it manually, but
> https://files.pharo.org/vm/ doesn't have anyting updated, and links to a
> Jenkins that seems abandoned, same thing for
> https://github.com/pharo-project/pharo-vm, and
> https://github.com/OpenSmalltalk/opensmalltalk-vm/ doesn't link to a
> successful build.
>
> Any hints on how to download the proper VM for windows 32 bit or
> successfully configure Pharo-Launcher to determine itself how to do it?
>
> Thank you.
>
> Esteban A. Maringolo
>

http://files.pharo.org/vm/pharo-spur32/win/pharo-win-i386-201811120325-a3f516f.zip
looks like its from yesterday.  :^)

cheers -ben


Re: [Pharo-users] OpenGL minimum working example?

2018-11-12 Thread Hernán Morales Durand
Hello Tomo,

Thank you, very interesting project!
BTW to load Jun4Pharo with UFFI OpenGL the expression is:

Gofer new
smalltalkhubUser: 'tomooda' project: 'Jun4Pharo';
configurationOf: #Jun;
load.
(Smalltalk at: #ConfigurationOfJun) project development load: #('Core').

There are only a few warnings during installation:

This package depends on the following classes:
  TabActionButton
  NewListRenderer
  NewList
  Tab
  TabBar
You must resolve these dependencies before you will be able to load
these definitions:
  NewList>>#drawOnAthensCanvas:
  NewListRenderer>>#drawOnAthensCanvas:
  NewListRenderer>>#drawSubmorphsOnAthensCanvas:
  Tab>>#createClosedPolygonPathFrom:on:
  Tab>>#createLinesPathFrom:on:
  Tab>>#drawOnAthensCanvas:
  TabActionButton>>#drawOnAthensCanvas:
  TabBar>>#drawLinesOnAthensCanvas:
  TabBar>>#drawLinesWithSelection:
  TabBar>>#drawSubmorphsOnAthensCanvas:

Most examples works also on Windows on Pharo 7. However the UFFI
OpenGL freezes the image if launched on full-screen.

Cheers,

Hernán


El lun., 12 nov. 2018 a las 20:41, Tomohiro Oda
() escribió:
>
> Hello Hernan,
>
> I tested the code only on Mac.
> ---
> tomo
>
> 2018/11/13(Tue) 8:27 Tomohiro Oda  wrote:
> >
> > Hello Hernan,
> >
> > I have partially working code at
> > http://smalltalkhub.com/#!/~tomooda/Jun4Pharo
> >
> > My code still have two problems that
> > * depending on resolution, projection matrix can't be properly set, and
> > * it freezes pharo when switching to fullscreen
> >
> > Best Regards,
> > ---
> > tomo
>



[Pharo-users] Canonical download location for Pharo VMs

2018-11-12 Thread Esteban Maringolo
What is the canonical repository/ci to download the latest VM for Pharo?

I'm trying to get pharo launcher to launch a 32 bit image in Windows, but
it complains it can't determine the image version, so I'm trying to
download the latest 32 bit VM for Windows to launch it manually, but
https://files.pharo.org/vm/ doesn't have anyting updated, and links to a
Jenkins that seems abandoned, same thing for
https://github.com/pharo-project/pharo-vm, and
https://github.com/OpenSmalltalk/opensmalltalk-vm/ doesn't link to a
successful build.

Any hints on how to download the proper VM for windows 32 bit or
successfully configure Pharo-Launcher to determine itself how to do it?

Thank you.

Esteban A. Maringolo


Re: [Pharo-users] OpenGL minimum working example?

2018-11-12 Thread Tomohiro Oda
Hello Hernan,

I tested the code only on Mac.
---
tomo

2018/11/13(Tue) 8:27 Tomohiro Oda  wrote:
>
> Hello Hernan,
>
> I have partially working code at
> http://smalltalkhub.com/#!/~tomooda/Jun4Pharo
>
> My code still have two problems that
> * depending on resolution, projection matrix can't be properly set, and
> * it freezes pharo when switching to fullscreen
>
> Best Regards,
> ---
> tomo



Re: [Pharo-users] OpenGL minimum working example?

2018-11-12 Thread Tomohiro Oda
Hello Hernan,

I have partially working code at
http://smalltalkhub.com/#!/~tomooda/Jun4Pharo

My code still have two problems that
* depending on resolution, projection matrix can't be properly set, and
* it freezes pharo when switching to fullscreen

Best Regards,
---
tomo



Re: [Pharo-users] Metacello baseline loading from cmd

2018-11-12 Thread Vitor Medina Cruz
Using directly the remote repository with https I got ZnTooManyRedirects :´(

On Mon, Nov 12, 2018 at 8:56 PM Vitor Medina Cruz 
wrote:

> Thanks Cédrick, this partly worked because I also had a git repository,
> but I noted that if the .git folder is not present the procedure don't work
> as well. It, however, cannot load remote dependent projects or baselines,
> and thus fail. :(
>
>
>
>
> 
>  Livre
> de vírus. www.avg.com
> .
> <#m_9098696167481251908_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>
> On Mon, Nov 12, 2018 at 5:03 PM Cédrick Béler  wrote:
>
>> Hi Vitor,
>>
>> Le 12 nov. 2018 à 19:53, Vitor Medina Cruz  a
>> écrit :
>>
>> Hello,
>>
>> How do I load a baseline located at disk? I tried inside
>> /home/vitormcruz/testpharo/:
>>
>> ./pharo Pharo.image eval "Metacello new baseline: 'Employees';
>>> repository: 'filetree://employees/pharo'; load: #(core)"
>>>
>>
>> But then I got:
>>
>> Could not resolve: BaselineOfEmployees [BaselineOfEmployees] in
>>> */home/vitormcruz/testpharo/pharo-local/package-cache*
>>> filetree:///home/vitormcruz/testpharo/employees/pharo
>>>
>>
>> I use towel format.
>>
>> I could load from local repo by using something like:
>>
>> Metacello new
>> baseline: 'ICTWorkbench';
>> repository: 'gitlocal://../../iceberg/cdrick65/ICTWorkbench' ;
>> load.
>>
>> Not sure if it’s the correct way.
>>
>> My git repo are in a common iceberg dir. I use the launcher, so iceberg
>> dir is in the root Pharo dir (I changed the default).
>>
>> HTH,
>>
>> Cédrick
>>
>>
>>
>>
>>
>>
>> And ls -la of /home/vitormcruz/testpharo/employees/pharo gives:
>>
>> drwxrwxr-x 4 vitormcruz vitormcruz 4096 Nov 12 16:21 .
>>> drwxrwxr-x 4 vitormcruz vitormcruz 4096 Nov 12 15:57 ..
>>> -rw-rw-r-- 1 vitormcruz vitormcruz 69 Nov 12 16:21 .filetree
>>> -rw-rw-r-- 1 vitormcruz vitormcruz 21 Nov 12 15:57 .propertiesdrwxrwxr
>>> -x 2 vitormcruz vitormcruz 4096 Nov 12 15:57 BaselineOfEmployeesdrwxrwxr
>>> -x 2 vitormcruz vitormcruz 4096 Nov 12 15:57 Employees
>>
>>
>>  It is strange that it tried to access the local cache, is that correct?
>> Im am using an Ubuntu 16 lst distribution.
>>
>> Regards,
>> Vitor
>>
>>
>>


Re: [Pharo-users] Metacello baseline loading from cmd

2018-11-12 Thread Vitor Medina Cruz
Thanks Cédrick, this partly worked because I also had a git repository, but
I noted that if the .git folder is not present the procedure don't work as
well. It, however, cannot load remote dependent projects or baselines, and
thus fail. :(




Livre
de vírus. www.avg.com
.
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Mon, Nov 12, 2018 at 5:03 PM Cédrick Béler  wrote:

> Hi Vitor,
>
> Le 12 nov. 2018 à 19:53, Vitor Medina Cruz  a écrit
> :
>
> Hello,
>
> How do I load a baseline located at disk? I tried inside
> /home/vitormcruz/testpharo/:
>
> ./pharo Pharo.image eval "Metacello new baseline: 'Employees'; repository:
>> 'filetree://employees/pharo'; load: #(core)"
>>
>
> But then I got:
>
> Could not resolve: BaselineOfEmployees [BaselineOfEmployees] in
>> */home/vitormcruz/testpharo/pharo-local/package-cache*
>> filetree:///home/vitormcruz/testpharo/employees/pharo
>>
>
> I use towel format.
>
> I could load from local repo by using something like:
>
> Metacello new
> baseline: 'ICTWorkbench';
> repository: 'gitlocal://../../iceberg/cdrick65/ICTWorkbench' ;
> load.
>
> Not sure if it’s the correct way.
>
> My git repo are in a common iceberg dir. I use the launcher, so iceberg
> dir is in the root Pharo dir (I changed the default).
>
> HTH,
>
> Cédrick
>
>
>
>
>
>
> And ls -la of /home/vitormcruz/testpharo/employees/pharo gives:
>
> drwxrwxr-x 4 vitormcruz vitormcruz 4096 Nov 12 16:21 .
>> drwxrwxr-x 4 vitormcruz vitormcruz 4096 Nov 12 15:57 ..
>> -rw-rw-r-- 1 vitormcruz vitormcruz 69 Nov 12 16:21 .filetree
>> -rw-rw-r-- 1 vitormcruz vitormcruz 21 Nov 12 15:57 .propertiesdrwxrwxr
>> -x 2 vitormcruz vitormcruz 4096 Nov 12 15:57 BaselineOfEmployeesdrwxrwxr
>> -x 2 vitormcruz vitormcruz 4096 Nov 12 15:57 Employees
>
>
>  It is strange that it tried to access the local cache, is that correct?
> Im am using an Ubuntu 16 lst distribution.
>
> Regards,
> Vitor
>
>
>


[Pharo-users] OpenGL minimum working example?

2018-11-12 Thread Hernán Morales Durand
Hi.

I tried to get an OpenGL MWE from
https://github.com/ronsaldo/uffi-opengl in both Windows 8.1 and MacOS
without luck. What I tried so far is to render a simple figure in a
new window, adding this method to UFFIOpenGLOffscreenSamples:

>>sample2

" self new sample2
"

| context gl fb |
context := UFFIOpenGLContext new.
gl := context gl.
fb := context offscreenBufferExtent: 300@300.
context asCurrentDo: [
fb activate.
gl
" loadIdentity;"
clear: GL_COLOR_BUFFER_BIT;
begin: GL_QUADS;
color3f_red: 1.0 green: 0.0 blue: 0.0;
vertex3f_x: 0.0 y: 0.0 z: 0.0;
vertex3f_x: 0.5 y: 0.0 z: 0.0;
vertex3f_x: 0.5 y: 0.5 z: 0.0;
vertex3f_x: 0.0 y: 0.5 z: 0.0;
end;
flush ].
fb asForm asMorph openInWindow.

However the result is that VM hangs in both platforms.
Any advice what I'm missing?

Cheers,

Hernán



[Pharo-users] Iceberg + BaselinOf + Metacello - how to manage interdependencies ?

2018-11-12 Thread Cédrick Béler
Hi all,

I’m trying to declare a BaselinOf to load lots of Packages. My aim is to have a 
kind of distribution (so students don’t have to load packages).
I’m new to Iceberg + BaselinOf + Metacello. I target only P7.

Let's say I want to load Teapot and NeoJSON (development version).
Teapot depends on NeoJSON (#stable).

So, whatever the order of declaration in the BaselineOfMyProject, I’d like not 
to have the following conflict:



So is it possible to tell to load :

- Teapot , then NeoJSON (updating to NeoJSON the dependancies of Teapot)
- NeoJSON (#latest) then Teapot (ignoring the NeoJSON stable of Teapot 
baseline).

I know I risk breaking Teapot (but I don’t care :), I want latest NeoJSON.

So is it possible to define such constraints ?

I’m aware of that way of loading from Metacello :

Metacello new
baseline: 'NeoCSV';
repository: 'gitlocal://../../iceberg/svenvc/NeoCSV' ;
onConflict: [ :err | err useIncoming ];
onUpgrade: [ :err | err useIncoming ];
load
Still, not sure, of the meaning of #useIncoming (#allow #disallow). 
1) Does one mean keep/load the latest ?
2) is it possible to launch such Metacello installation from Iceberg ?



TIA,

Cédrick

Re: [Pharo-users] Metacello baseline loading from cmd

2018-11-12 Thread Cédrick Béler
Hi Vitor,

> Le 12 nov. 2018 à 19:53, Vitor Medina Cruz  a écrit :
> 
> Hello,
> 
> How do I load a baseline located at disk? I tried inside 
> /home/vitormcruz/testpharo/:
> 
> ./pharo Pharo.image eval "Metacello new baseline: 'Employees'; repository: 
> 'filetree://employees/pharo'; load: #(core)"
> 
> But then I got:
> 
> Could not resolve: BaselineOfEmployees [BaselineOfEmployees] in 
> /home/vitormcruz/testpharo/pharo-local/package-cache 
> filetree:///home/vitormcruz/testpharo/employees/pharo 
> 

I use towel format.

I could load from local repo by using something like:

Metacello new
baseline: 'ICTWorkbench';
repository: 'gitlocal://../../iceberg/cdrick65/ICTWorkbench' ;
load.

Not sure if it’s the correct way.

My git repo are in a common iceberg dir. I use the launcher, so iceberg dir is 
in the root Pharo dir (I changed the default).

HTH,

Cédrick




> 
> 
> And ls -la of /home/vitormcruz/testpharo/employees/pharo gives:
> 
> drwxrwxr-x 4 vitormcruz vitormcruz 4096 Nov 12 16:21 .
> drwxrwxr-x 4 vitormcruz vitormcruz 4096 Nov 12 15:57 ..
> -rw-rw-r-- 1 vitormcruz vitormcruz 69 Nov 12 16:21 .filetree
> -rw-rw-r-- 1 vitormcruz vitormcruz 21 Nov 12 15:57 .propertiesdrwxrwxr
> -x 2 vitormcruz vitormcruz 4096 Nov 12 15:57 BaselineOfEmployeesdrwxrwxr
> -x 2 vitormcruz vitormcruz 4096 Nov 12 15:57 Employees
> 
>  It is strange that it tried to access the local cache, is that correct? Im 
> am using an Ubuntu 16 lst distribution.
> 
> Regards,
> Vitor
> 



[Pharo-users] Metacello baseline loading from cmd

2018-11-12 Thread Vitor Medina Cruz
Hello,

How do I load a baseline located at disk? I tried inside
/home/vitormcruz/testpharo/:

./pharo Pharo.image eval "Metacello new baseline: 'Employees'; repository:
> 'filetree://employees/pharo'; load: #(core)"
>

But then I got:

Could not resolve: BaselineOfEmployees [BaselineOfEmployees] in
> */home/vitormcruz/testpharo/pharo-local/package-cache*
> filetree:///home/vitormcruz/testpharo/employees/pharo
>


And ls -la of /home/vitormcruz/testpharo/employees/pharo gives:

drwxrwxr-x 4 vitormcruz vitormcruz 4096 Nov 12 16:21 .
> drwxrwxr-x 4 vitormcruz vitormcruz 4096 Nov 12 15:57 ..
> -rw-rw-r-- 1 vitormcruz vitormcruz 69 Nov 12 16:21 .filetree
> -rw-rw-r-- 1 vitormcruz vitormcruz 21 Nov 12 15:57 .propertiesdrwxrwxr
> -x 2 vitormcruz vitormcruz 4096 Nov 12 15:57 BaselineOfEmployeesdrwxrwxr
> -x 2 vitormcruz vitormcruz 4096 Nov 12 15:57 Employees


 It is strange that it tried to access the local cache, is that correct? Im
am using an Ubuntu 16 lst distribution.

Regards,
Vitor


Re: [Pharo-users] Examples of bad code

2018-11-12 Thread webwarrior
In old Pharo code (Morphic, etc.) there's a lot of wierd stuff. 

My favourite is DockingBarMorph>>#predominantDockingBarsOfChastes:

Though it explains what "predominant" means in a long comment, it's
absolutely unclear what the heck "chaste" is.



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



[Pharo-users] Examples of bad code

2018-11-12 Thread Oleksandr Zaytsev
Hello,

Do you know of some good examples of code that is unreadable because of the
bad and inconsistent naming?
I want to show some motivating example in my thesis about the aspects of
software naturalness through the generation of identifier names.

I'm sure that Pharo has many bad code inside, but this has to be something

1. From the real project written by experienced developers or a nice
community (not some toy example or a code of bad developers)
2. With identifier names so bad that 2-3 chunks of code are enough to
demonstrate how incomprehensible this code is.

I need it to prove the point that

1. Bad naming can really harm the readability
2. Bad naming is not just a result of carelessness and lack of experience.
Bad names often appear in successful projects and are introduced by
experienced developers as a result of software evolution (many people write
and rewrite the same code many times introducing inconsistencies and
failing to understand each other's intentions and different parts of the
system).

Do you know some good examples of bad code from PolyMath, Seaside, Moose
etc.?

Oleks


Re: [Pharo-users] ToManyRelationSlot variant with an ordered collection?

2018-11-12 Thread Marcus Denker



> On 10 Nov 2018, at 22:52, Tudor Girba  wrote:
> 
> Hi,
> 
> The current implementation of ToManyRelationSlot is based on a RelationSet 
> which holds the items in a Set.
> 
> Is there an implementation that holds the items in an ordered collection?


Not that I know, but it would be interesting to experiment with this!

Marcus