Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 1 participants
- 144619 messages
Re: [Pharo-project] Initial PetitC parser
by Ricardo Moran
On Fri, Apr 8, 2011 at 1:57 PM, Javier Pimás <elpochodelagente(a)gmail.com>wrote:
>
>
> On Fri, Apr 8, 2011 at 1:08 PM, Alexandre Bergel <alexandre.bergel(a)me.com>wrote:
>
>> What is tricky with analyzing C are macros and preprocessors directive.
>> srcML does a satisfactory job. But indeed, having a solution based on
>> PetitParser is indeed promising.
>
>
> Yes, and I don't know what to do, and would like to know if you or someone
> else have any idea of how to solve it. I will think some approach, but if
> you have some idea to share it would be better so I go directly to a good
> solution. I'm thinking that to feed the parser I'll have to preprocess the
> string with another parser, and make a string to string conversion by having
> a set of defines and paths so that #includes and #ifdefs work. But probably
> I'll need a cache because the generated string will be huge.
>
> What do you think?
>
Can't macros and preprocessor directives be represented as just another
nodes in the AST?
>
> Regards,
> Javier.
>
>>
>> Cheers,
>> Alexandre
>>
>>
>> On 7 Apr 2011, at 23:53, Javier Pimás wrote:
>>
>> > by the way, the grammar is based on
>> >
>> > http://www.quut.com/c/ANSI-C-grammar-l-1998.html
>> >
>> > and
>> >
>> > http://www.quut.com/c/ANSI-C-grammar-y.html
>> >
>> > I'd be very grateful if you contribute to cover the full extent of it!
>> >
>> >
>> > On Fri, Apr 8, 2011 at 12:37 AM, Javier Pimás <
>> elpochodelagente(a)gmail.com> wrote:
>> > Hi,
>> > I took some time to start developing a C parser with PetitParser. I
>> used the slides of the smalltalk school, they were pretty useful, and after
>> some hours I have a very basic tokens scanner. The idea of this work is to
>> be able to feed the parser with C headers and automagically get the C
>> bindings done in smalltalk.
>> >
>> > Now I have to actually start doing something with the scanned code. How
>> should I do that, all in the same class? What if I want to generate bindings
>> for different kinds of FFIs? Other question, how should I handle
>> preprocessing? (now there isn't any kind of preprocessing)
>> >
>> > You can see the code, download it and commit improvements to the repo at
>> www.squeaksource.com/Bindings
>> >
>> > Anybody who is interested is welcomed to help in the development!
>> >
>> > Regards,
>> > Javier.
>> >
>> > --
>> > Javier Pimás
>> > Ciudad de Buenos Aires
>> >
>> >
>> >
>> > --
>> > Javier Pimás
>> > Ciudad de Buenos Aires
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>>
>>
>
>
> --
> Javier Pimás
> Ciudad de Buenos Aires
>
April 8, 2011
Re: [Pharo-project] Initial PetitC parser
by Ricardo Moran
On Fri, Apr 8, 2011 at 1:49 PM, Javier Pimás <elpochodelagente(a)gmail.com>wrote:
> On Fri, Apr 8, 2011 at 3:41 AM, Tudor Girba <tudor.girba(a)gmail.com> wrote:
>
>> Hi Javier,
>>
>> On 8 Apr 2011, at 05:37, Javier Pimás wrote:
>>
>> > Hi,
>> > I took some time to start developing a C parser with PetitParser. I
>> used the slides of the smalltalk school, they were pretty useful, and after
>> some hours I have a very basic tokens scanner. The idea of this work is to
>> be able to feed the parser with C headers and automagically get the C
>> bindings done in smalltalk.
>>
>>
>> Nice. I took a quick look. If you want to scale, please write tests (one
>> small example per test). Grammars become complex and if you do not have
>> close to 100% coverage, you will get stuck.
>>
>>
> OK, I'll try. One question regarding PP: I started coding by looking at
> PPArithmeticParser, and noticed that for each sub-grammar you have a method
> and an instance named the same way, is that a requirement? If I don't add
> the instances this sub-grammars are not shown in the PPBrowser.
>
Yes, I think it is a requirement. Otherwise, the parsers can't be
initialized. Look at: PPCompositeParser>>#initializeStartingAt:
>
> Regards,
> Javier.
>
> Cheers,
>> Doru
>>
>>
>>
>> > Now I have to actually start doing something with the scanned code. How
>> should I do that, all in the same class? What if I want to generate bindings
>> for different kinds of FFIs? Other question, how should I handle
>> preprocessing? (now there isn't any kind of preprocessing)
>> >
>> > You can see the code, download it and commit improvements to the repo at
>> www.squeaksource.com/Bindings
>> >
>> > Anybody who is interested is welcomed to help in the development!
>> >
>> > Regards,
>> > Javier.
>> >
>> > --
>> > Javier Pimás
>> > Ciudad de Buenos Aires
>>
>> --
>> www.tudorgirba.com
>>
>> "Sometimes the best solution is not the best solution."
>>
>>
>>
>
>
> --
> Javier Pimás
> Ciudad de Buenos Aires
>
April 8, 2011
Re: [Pharo-project] Initial PetitC parser
by Ricardo Moran
On Fri, Apr 8, 2011 at 1:44 PM, Javier Pimás <elpochodelagente(a)gmail.com>wrote:
>
>
> On Fri, Apr 8, 2011 at 2:05 AM, Ricardo Moran <richi.moran(a)gmail.com>wrote:
>
>>
>> On Fri, Apr 8, 2011 at 12:37 AM, Javier Pimás <elpochodelagente(a)gmail.com
>> > wrote:
>>
>>> Hi,
>>> I took some time to start developing a C parser with PetitParser. I
>>> used the slides of the smalltalk school, they were pretty useful, and after
>>> some hours I have a very basic tokens scanner. The idea of this work is to
>>> be able to feed the parser with C headers and automagically get the C
>>> bindings done in smalltalk.
>>>
>>>
>> Hi Javier,
>>
>> That's a great project and I'm highly interested in it. I'm not
>> experienced in PetitParser so I won't be a lot of help, but I'll give it a
>> try.
>>
>
> excelent
>
>
>>
>>
>>> Now I have to actually start doing something with the scanned code. How
>>> should I do that, all in the same class? What if I want to generate bindings
>>> for different kinds of FFIs? Other question, how should I handle
>>> preprocessing? (now there isn't any kind of preprocessing)
>>>
>>
>> Maybe you already thought of this but what if you make your parser build
>> some simple C AST and then you make specific visitors for each kind of FFI?
>>
>
> I didn't think of it because I never did a parser before and have no
> experience with PP. Is it the clean way to do it? How is that implented?
> maybe have for each expression in the bnf a class that represents it, and
> make PP create the instances?
>
Well, I have no experience with parsers, either. I just played with PP a
little (I learned a lot by looking at PetitSmalltalk), and I'm currently
using the visitor pattern to translate smalltalk to NXC. You know what they
said: "if you have a hammer, then everything looks like a nail" so I'm
probably biased towards this pattern :)
I don't know if this is the clean way to do it, but I think it's clean
enough for me :)
I would implement it just as you said: a class for each expression, and make
PP create the instances.
>
>
>> Cheers
>> Richo
>>
>>
>>>
>>> You can see the code, download it and commit improvements to the repo at
>>> www.squeaksource.com/Bindings
>>>
>>> Anybody who is interested is welcomed to help in the development!
>>>
>>> Regards,
>>> Javier.
>>>
>>> --
>>> Javier Pimás
>>> Ciudad de Buenos Aires
>>>
>>
>>
>
>
> --
> Javier Pimás
> Ciudad de Buenos Aires
>
April 8, 2011
Re: [Pharo-project] [Vm-dev] Debugging Cog crash
by Schwab,Wilhelm K
Levente,
It is indeed not the UUID plugin - Dave already suggested deleting it, and I tried that w/o success.
As for running gdb, I will gladly do so, but I have zero experience with it. The most relevant posts I can find mention attaching to a vm that is already running, and I can't get that far. Below is my attempt to modify the one-click shell script to run the vm under gdb. Perhaps you or someone else can show me the errors of my ways and produce something that would yield a callstack.
Bill
#!/bin/sh
# path
ROOT=`dirname $0`
LINUX="$ROOT/Contents/Linux"
RESOURCES="$ROOT/Contents/Resources"
# icon
gvfs-set-attribute \
"$0" \
"metadata::custom-icon" \
"file://$RESOURCES/Squeak.png" \
2> /dev/null
# execute
gdb "$LINUX/squeakvm"
gdb run -plugins "$LINUX" \
-encoding latin1 \
-vm-display-X11 \
"$RESOURCES/Pharo.image"
Levente wrote:
Well, the file OneClick.txt says the vm is "Linux Intel x86 4.0.3.2202".
But that's not true, because that's not a CogVM.
The UUIDPlugin seems to have the patch which avoids the crash, so it's
pretty unlikely that it's an issue with the UUIDPlugin. Even if the patch
is wrong (which is unlikely, because we're using Eliot's latest build on
64-bit Ubuntu 8.04 and it doesn't crash, but previous unpatched builds did
crash), it's pretty unlikely that the cause of the crash is the related to
UUIDPlugin at all, because UUIDs are normally not created during startup
and your image is crashing on startup.
To be 100% sure you can try deleting UUIDPlugin and see if your image
is crashing or not.
If it still crashes, then use gdb to see where it crashes. The VM seems to
be unstripped (8MB), so it should be easy to identify the cause of the
crash.
Levente
________________________________________
From: pharo-project-bounces(a)lists.gforge.inria.fr [pharo-project-bounces(a)lists.gforge.inria.fr] On Behalf Of Schwab,Wilhelm K [bschwab(a)anest.ufl.edu]
Sent: Friday, April 08, 2011 11:56 AM
To: Pharo-project(a)lists.gforge.inria.fr; Squeak Virtual Machine Development Discussion
Subject: Re: [Pharo-project] [Vm-dev] FW: Debugging Cog crash
Levente,
The image will not load at all. It simply dies with "Segmentation fault" - NOTHING else happens. gdb is maybe a possibility, but it is not an approach I ordinarily take, so some guidance would be helpful.
I have a reproducible crash, but poor access to the affected box.
Bill
On Fri, 8 Apr 2011, Schwab,Wilhelm K wrote:
>
> Gratuitous default recipient...
>
> If there is a verbose dump option or other diagnostic efforts that will help, I will do my best to run them and report the results. I am fairly certain the vm is 'Croquet Closure Cog VM [CoInterpreter VMMaker-oscog.54]' (can verify later today), but this happened with an earlier Cog one-click too. There is something about the machine (UUID again?) that is different. I do not have root access to it, but I can get to a terminal. Ubuntu 10.10.
Where did you download the VM?
Does it crash when you're trying to evaluate [UUID new]?
Did you try gdb?
Levente
________________________________________
From: pharo-project-bounces(a)lists.gforge.inria.fr [pharo-project-bounces(a)lists.gforge.inria.fr] On Behalf Of Schwab,Wilhelm K [bschwab(a)anest.ufl.edu]
Sent: Friday, April 08, 2011 11:42 AM
To: Pharo-project(a)lists.gforge.inria.fr; Squeak Virtual Machine Development Discussion
Subject: Re: [Pharo-project] [Vm-dev] FW: Debugging Cog crash
Dave,
It was, I did :) No help :( What else can I try?
Bill
________________________________________
From: pharo-project-bounces(a)lists.gforge.inria.fr [pharo-project-bounces(a)lists.gforge.inria.fr] On Behalf Of David T. Lewis [lewis(a)mail.msen.com]
Sent: Friday, April 08, 2011 10:32 AM
To: Squeak Virtual Machine Development Discussion
Cc: Pharo-project(a)lists.gforge.inria.fr
Subject: Re: [Pharo-project] [Vm-dev] FW: Debugging Cog crash
Yes, the libuuid.so bug would be a likely suspect. If the UUIDPlugin was
built as an external library, just delete it and you will probably be
good to go.
If you need further info, look here:
http://bugs.squeak.org/view.php?id=7358
Dave
On Fri, Apr 08, 2011 at 07:58:39AM -0400, Schwab,Wilhelm K wrote:
>
> Gratuitous default recipient...
>
> If there is a verbose dump option or other diagnostic efforts that will help, I will do my best to run them and report the results. I am fairly certain the vm is 'Croquet Closure Cog VM [CoInterpreter VMMaker-oscog.54]' (can verify later today), but this happened with an earlier Cog one-click too. There is something about the machine (UUID again?) that is different. I do not have root access to it, but I can get to a terminal. Ubuntu 10.10.
>
>
> ________________________________________
> From: Schwab,Wilhelm K
> Sent: Friday, April 08, 2011 7:44 AM
> To: Mariano Martinez Peck
> Subject: RE: [Pharo-project] Debugging Cog crash
>
> Mariano,
>
> I first identified this problem/opportunity a while ago. At the time, there was no log - the vm just died. I can sniff around again as there might be one this time. My question at the time was whether there was something that I could enable to perhaps get more info.
>
> The output from the vm is, and I quote<g> "Segmentation fault". There is no other output. Perhaps it does not get far enough to have a call stack??
>
> Bill
>
>
>
> ________________________________________
> From: Mariano Martinez Peck [marianopeck(a)gmail.com]
> Sent: Friday, April 08, 2011 3:42 AM
> To: Squeak Development Discussion Virtual Machine; Pharo Development
> Cc: Schwab,Wilhelm K
> Subject: Re: [Pharo-project] Debugging Cog crash
>
> also...shouldn't be a crash/dump file somewhere?
>
> can you write the output of the console where you invoke the VM into a file ? (using > to redirect)
>
> Cheers
>
> Mariano
>
> On Thu, Apr 7, 2011 at 11:10 PM, Schwab,Wilhelm K <bschwab(a)anest.ufl.edu<mailto:bschwab@anest.ufl.edu>> wrote:
> Hello all,
>
> I have an account on an Ubuntu terminal server (at least I think that's what it would be called) running 10.10. The Cog one-click image crashes with "Segmentation fault" (if run from a terminal); the legacy VM seems to run the image nicely on the box. Any ideas? I will happily collect any facts that will be of help, but I need some
> direction.
>
> Bill
>
>
>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
April 8, 2011
Re: [Pharo-project] jtalk fun
by Richard Durr
Cool. The only problem in JTalk is for interfacing with JS you have to
create new classes and use jsbody-methods ({'alert("hello")'}). In OMeta's
JS/Smalltalk, you can reference and call JS-Objects directly (alert value:
'hello') at the cost of semantic ("atput" "a: t: p: u: t:" and "atput:" all
refer to the same method/function, for example).
Somehow I find CoffeeScript cleaner in this regard. CoffeeScript is no
Smalltalk, though. :(
On Wed, Apr 6, 2011 at 1:34 PM, laurent laffont
<laurent.laffont(a)gmail.com>wrote:
>
> On Wed, Apr 6, 2011 at 12:48 PM, Nicolas Petton <petton.nicolas(a)gmail.com>wrote:
>
>> Le mercredi 06 avril 2011 à 12:28 +0200, Noury Bouraqadi a écrit :
>> > Cool. But how do we move parts?
>>
>> Hmm, you don't...
>>
>> I only wrote the field and pieces, the game isn't working yet (and I
>> didn't think someone would find it... kudos to Laurent :-)
>>
>
> Ahaha I was just looking for examples and this is in the example category
> ;)
>
> Laurent
>
>
>>
>> Cheers,
>> Nico
>> >
>> >
>> > On 5 avr. 2011, at 15:16, laurent laffont wrote:
>> >
>> > > Go to http://jtalk-project.org/
>> > >
>> > > Open development tools -> Workspace
>> > >
>> > > Evaluate:
>> > >
>> > > Tetris new appendToJQuery: 'body' asJQuery
>> > >
>> > > play.
>> > >
>> > >
>> > > Laurent.
>> >
>> > Noury Bouraqadi
>> > http://car.mines-douai.fr/noury
>> > --
>> > -6th National Conference on
>> > âControl Architecture of Robotsâ
>> > 24-25 may 2011, Grenoble area, France
>> > http://car2011.inrialpes.fr/
>> >
>> > -19th ESUG International Smalltalk Conference
>> > 22-26 August 2011, Edinburgh, UK
>> > http://www.esug.org/Conferences/2011
>> >
>> > -19èmes Journées Francophones sur les Systèmes Multi-Agents (JFSMAâ11)
>> > http://www.univ-valenciennes.fr/congres/jfsma2011/
>> > 17-19 Octobre 2011, Valenciennes, France
>> >
>> >
>> >
>> >
>> >
>> >
>>
>> --
>> Nicolas Petton
>> http://www.nicolas-petton.fr
>>
>>
>>
>
April 8, 2011
Re: [Pharo-project] relational database and id field
by Guillermo Polito
And one more remark about ids. I prefer not to use domain related ids like
ISBN, because some day those rules will change and become obsolet, and your
whole schema will need to be changed :/.
Using autogenerated ids are more confortable if you take that into account.
On Fri, Apr 8, 2011 at 3:43 PM, Richard Durr <richard.durr(a)googlemail.com>wrote:
> I recommend ids because without them, objects that are *equal* but not *
> identicall* do not really fit into the db. ^^
>
>
>
> On Thu, Apr 7, 2011 at 3:43 PM, Schwab,Wilhelm K <bschwab(a)anest.ufl.edu>wrote:
>
>> That sounds like a one-to-many relationship. In those cases, I create two
>> tables, one for the singleton side and one for the many side. The many side
>> includes the key field(s) from the one side, and setting it/them establishes
>> the relationship. A unique ID field for the singleton side is helpful,
>> especially if things get edited. For many to many, I create a third table
>> that does nothing but associate keys between the two tables - I'm not even
>> sure if there is another way to do it??
>>
>>
>>
>> ________________________________________
>> From: pharo-project-bounces(a)lists.gforge.inria.fr [
>> pharo-project-bounces(a)lists.gforge.inria.fr] On Behalf Of Benoit St-Jean
>> [bstjean(a)yahoo.com]
>> Sent: Thursday, April 07, 2011 8:57 AM
>> To: Alexandre Bergel
>> Cc: Pharo-project(a)lists.gforge.inria.fr
>> Subject: Re: [Pharo-project] relational database and id field
>>
>> One more remark,
>>
>> Since you're storing objects into a RDBMS, I guess what you're trying to
>> express into "the relational world" is a notion of pointer (such as an
>> object contains a collection of something in one of its instance variable,
>> or a child has a mother kinda relationship, link). In that case, to save
>> you headaches and lots of "weird object-oriented modeling", an oid (object
>> id) is what is used normally. Any sequence (the shorter the better, don't
>> use GUID for instance!) would do...
>>
>> -----------------
>> Benoit St-Jean
>> Yahoo! Messenger: bstjean
>> A standpoint is an intellectual horizon of radius zero.
>> (Albert Einstein)
>>
>>
>> ________________________________
>> From: Alexandre Bergel <alexandre.bergel(a)me.com>
>> To: Benoit St-Jean <bstjean(a)yahoo.com>
>> Cc: Pharo-project(a)lists.gforge.inria.fr
>> Sent: Thu, April 7, 2011 9:49:11 AM
>> Subject: Re: [Pharo-project] relational database and id field
>>
>> > Normally, you should always have a primary key to uniquely identify a
>> record in a database table. If you have an attribute (or a set of
>> attributes) that can uniquely identify your ComicBook, you don't need an id
>> field. BUT, if you tell me you're going to store lots and lots and lots of
>> those ComicBook instances, having an id (integer) as the primary key has
>> potential non-negligeable advantages over, say, something like a name.
>> Mainly because an id (let's suppose it's an INT) takes way less storage
>> than say a name (VARCHAR(30) for instance) and thus more index records can
>> fit into the key buffer in memory.
>>
>> Ok, I understand.
>>
>> > 1) yes, always provide a primary key
>> > 2) if you have already A primary key (even a composite one)
>> > 2a) if you need performance and are gonna store LOTS of those
>> objects, the smaller the key the better so you could create a surrogate key
>> (the id key) instead of using the "real" primary key
>> > 2b) if performance is not an issue, you can use what is already
>> available that uniquely identifies your object (row) in the database table
>>
>> Thanks!
>>
>> > P.S. Are you using a particular OO-RDBMS framework?
>>
>> No, I am correcting a student thesis :-)
>> I would probably not use SQL if I had to :-)
>>
>> Cheers,
>> Alexandre
>>
>>
>> >
>> > -----------------
>> > Benoit St-Jean
>> > Yahoo! Messenger: bstjean
>> > A standpoint is an intellectual horizon of radius zero.
>> > (Albert Einstein)
>> >
>> >
>> > From: Alexandre Bergel <alexandre.bergel(a)me.com<mailto:
>> alexandre.bergel(a)me.com>>
>> > To: Pharo Development <Pharo-project(a)lists.gforge.inria.fr<mailto:
>> Pharo-project(a)lists.gforge.inria.fr>>
>> > Sent: Thu, April 7, 2011 9:19:03 AM
>> > Subject: [Pharo-project] relational database and id field
>> >
>> > Hi!
>> >
>> > Since there are some experts in databases here, I ask a general question
>> about it.
>> > Assume that I have to use a relational database to store, let's stay
>> instances of Stef's ComicBook class.
>> > Should the class ComicBook have a field id to uniquely identify a book?
>> >
>> > Cheers,
>> > Alexandre
>> > --
>> > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> > Alexandre Bergel http://www.bergel.eu
>> > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>> >
>> >
>> >
>> >
>> >
>> >
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>>
>>
>
April 8, 2011
Re: [Pharo-project] relational database and id field
by Richard Durr
I recommend ids because without them, objects that are *equal* but not *
identicall* do not really fit into the db. ^^
On Thu, Apr 7, 2011 at 3:43 PM, Schwab,Wilhelm K <bschwab(a)anest.ufl.edu>wrote:
> That sounds like a one-to-many relationship. In those cases, I create two
> tables, one for the singleton side and one for the many side. The many side
> includes the key field(s) from the one side, and setting it/them establishes
> the relationship. A unique ID field for the singleton side is helpful,
> especially if things get edited. For many to many, I create a third table
> that does nothing but associate keys between the two tables - I'm not even
> sure if there is another way to do it??
>
>
>
> ________________________________________
> From: pharo-project-bounces(a)lists.gforge.inria.fr [
> pharo-project-bounces(a)lists.gforge.inria.fr] On Behalf Of Benoit St-Jean [
> bstjean(a)yahoo.com]
> Sent: Thursday, April 07, 2011 8:57 AM
> To: Alexandre Bergel
> Cc: Pharo-project(a)lists.gforge.inria.fr
> Subject: Re: [Pharo-project] relational database and id field
>
> One more remark,
>
> Since you're storing objects into a RDBMS, I guess what you're trying to
> express into "the relational world" is a notion of pointer (such as an
> object contains a collection of something in one of its instance variable,
> or a child has a mother kinda relationship, link). In that case, to save
> you headaches and lots of "weird object-oriented modeling", an oid (object
> id) is what is used normally. Any sequence (the shorter the better, don't
> use GUID for instance!) would do...
>
> -----------------
> Benoit St-Jean
> Yahoo! Messenger: bstjean
> A standpoint is an intellectual horizon of radius zero.
> (Albert Einstein)
>
>
> ________________________________
> From: Alexandre Bergel <alexandre.bergel(a)me.com>
> To: Benoit St-Jean <bstjean(a)yahoo.com>
> Cc: Pharo-project(a)lists.gforge.inria.fr
> Sent: Thu, April 7, 2011 9:49:11 AM
> Subject: Re: [Pharo-project] relational database and id field
>
> > Normally, you should always have a primary key to uniquely identify a
> record in a database table. If you have an attribute (or a set of
> attributes) that can uniquely identify your ComicBook, you don't need an id
> field. BUT, if you tell me you're going to store lots and lots and lots of
> those ComicBook instances, having an id (integer) as the primary key has
> potential non-negligeable advantages over, say, something like a name.
> Mainly because an id (let's suppose it's an INT) takes way less storage
> than say a name (VARCHAR(30) for instance) and thus more index records can
> fit into the key buffer in memory.
>
> Ok, I understand.
>
> > 1) yes, always provide a primary key
> > 2) if you have already A primary key (even a composite one)
> > 2a) if you need performance and are gonna store LOTS of those objects,
> the smaller the key the better so you could create a surrogate key (the id
> key) instead of using the "real" primary key
> > 2b) if performance is not an issue, you can use what is already
> available that uniquely identifies your object (row) in the database table
>
> Thanks!
>
> > P.S. Are you using a particular OO-RDBMS framework?
>
> No, I am correcting a student thesis :-)
> I would probably not use SQL if I had to :-)
>
> Cheers,
> Alexandre
>
>
> >
> > -----------------
> > Benoit St-Jean
> > Yahoo! Messenger: bstjean
> > A standpoint is an intellectual horizon of radius zero.
> > (Albert Einstein)
> >
> >
> > From: Alexandre Bergel <alexandre.bergel(a)me.com<mailto:
> alexandre.bergel(a)me.com>>
> > To: Pharo Development <Pharo-project(a)lists.gforge.inria.fr<mailto:
> Pharo-project(a)lists.gforge.inria.fr>>
> > Sent: Thu, April 7, 2011 9:19:03 AM
> > Subject: [Pharo-project] relational database and id field
> >
> > Hi!
> >
> > Since there are some experts in databases here, I ask a general question
> about it.
> > Assume that I have to use a relational database to store, let's stay
> instances of Stef's ComicBook class.
> > Should the class ComicBook have a field id to uniquely identify a book?
> >
> > Cheers,
> > Alexandre
> > --
> > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> > Alexandre Bergel http://www.bergel.eu
> > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> >
> >
> >
> >
> >
> >
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>
>
April 8, 2011
Re: [Pharo-project] An idea about Pluggable widgets
by Richard Durr
Why not do it like in Cocoa?
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Coco…
On Thu, Apr 7, 2011 at 9:26 PM, Nicolas Cellier <
nicolas.cellier.aka.nice(a)gmail.com> wrote:
> 2011/4/7 Alain Plantec <alain.plantec(a)yahoo.com>:
> > Le 07/04/2011 19:23, Igor Stasenko a écrit :
> >>
> >> button1 model: (self for: #performAction adapt: #turnRed)
> >> button2 model: (self for: #performAction adapt: #turnGreen)
> >
> > yes, cool!
> > It seems to be a good way to clean morphic
> > cheers
> > Alain
> >
> >
>
> Yes, it's delegating the job to specialized objects.
> Specialized objects shall know how to.
> That should prevent Morphs to be omniscient.
>
> My favourite name for the opposite pattern is "god programming": we
> all encountered the thousand lines functions with tons of imbricated
> if/switch logic in C or C// world, didn't we ?
>
> Somehow, Igor proposal reminds me the VW UI architecture were they
> pushed the wrapper pattern very far.
> Personnally, I found myself comfortable with it, but it had its detractors
> too.
> It would be interesting to analyze their arguments.
>
> cheers.
>
> Nicolas
>
>
April 8, 2011
Re: [Pharo-project] Initial PetitC parser
by Alexandre Bergel
A good source of ideas: http://www.sdml.info/projects/srcml/
Alexandre
On 8 Apr 2011, at 12:57, Javier Pimás wrote:
>
>
> On Fri, Apr 8, 2011 at 1:08 PM, Alexandre Bergel <alexandre.bergel(a)me.com> wrote:
> What is tricky with analyzing C are macros and preprocessors directive.
> srcML does a satisfactory job. But indeed, having a solution based on PetitParser is indeed promising.
>
> Yes, and I don't know what to do, and would like to know if you or someone else have any idea of how to solve it. I will think some approach, but if you have some idea to share it would be better so I go directly to a good solution. I'm thinking that to feed the parser I'll have to preprocess the string with another parser, and make a string to string conversion by having a set of defines and paths so that #includes and #ifdefs work. But probably I'll need a cache because the generated string will be huge.
>
> What do you think?
>
> Regards,
> Javier.
>
> Cheers,
> Alexandre
>
>
> On 7 Apr 2011, at 23:53, Javier Pimás wrote:
>
> > by the way, the grammar is based on
> >
> > http://www.quut.com/c/ANSI-C-grammar-l-1998.html
> >
> > and
> >
> > http://www.quut.com/c/ANSI-C-grammar-y.html
> >
> > I'd be very grateful if you contribute to cover the full extent of it!
> >
> >
> > On Fri, Apr 8, 2011 at 12:37 AM, Javier Pimás <elpochodelagente(a)gmail.com> wrote:
> > Hi,
> > I took some time to start developing a C parser with PetitParser. I used the slides of the smalltalk school, they were pretty useful, and after some hours I have a very basic tokens scanner. The idea of this work is to be able to feed the parser with C headers and automagically get the C bindings done in smalltalk.
> >
> > Now I have to actually start doing something with the scanned code. How should I do that, all in the same class? What if I want to generate bindings for different kinds of FFIs? Other question, how should I handle preprocessing? (now there isn't any kind of preprocessing)
> >
> > You can see the code, download it and commit improvements to the repo at www.squeaksource.com/Bindings
> >
> > Anybody who is interested is welcomed to help in the development!
> >
> > Regards,
> > Javier.
> >
> > --
> > Javier Pimás
> > Ciudad de Buenos Aires
> >
> >
> >
> > --
> > Javier Pimás
> > Ciudad de Buenos Aires
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
>
>
>
>
> --
> Javier Pimás
> Ciudad de Buenos Aires
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
April 8, 2011
Re: [Pharo-project] Unexpected behavior of roundTo:
by Nicolas Cellier
2011/4/8 Hilaire Fernandes <hilaire.fernandes(a)gmail.com>:
> Well, whatever the underneath representation, one can expect roundedTo:
> 2 to return a float with two decimals.
>
> I am only interested in roundedTo: to display in the DrGeo canvas
> numbers. It was still funny to see sometimes number with 10 digits.
>
> Thanks for the info.
>
>
> Hilaire
>
Previous versions were lying too by not printing a number that would
be reinterpreted into itself.
But if it is what you want, then you should use the old print message,
#absPrintOn:base:
Maybe it could be wrapped into a printApproximatelyOn: to be
polymorphic with other numbers ?
Nicolas
> --
> Education 0.2 -- http://blog.ofset.org/hilaire
>
>
>
April 8, 2011