Re: [Gambas-user] gb.util GenUUID() function

2016-11-18 Thread Fabien Bodard
if there is only one function in your class ... why don't you use the
_Call special function ?

So you can use it like :

uuidgen(...)

2016-11-19 0:16 GMT+01:00 Karl Reinl :
> Am Donnerstag, den 17.11.2016, 10:49 +1030 schrieb adamn...@gmail.com:
>> Every now and then I come across a need for a (locally) unique ID. Shelling 
>> the ubiquitous gnu "uuidgen (-t/-r)" utility usually handles this 
>> effectively enough. However, I am thinking that maybe this is a possible 
>> candidate for the gb.util component.
>> In particular, most often times I am looking for the string representation 
>> of the UID. In which case "SHELL uuidgen TO $somevar" is all that is 
>> required.  On the other hand, and on somewhat rarer occasions, I need the 
>> binary rep of the generated UID. Now "uuid_parse" can handle that ... and 
>> some years ago (gb2) I had a bit of code that could call that routine, sadly 
>> now long lost.
>>
>> Anyway, if there is any interest in this, as an enhancement to gb.util I'll 
>> spend some effort trying to find that old code and adding it to the gb.util 
>> component. I'm thinking about two new functions here
>> a) "GenUUID" with optional params to force the -t/-r options which would 
>> just shell the uuidgen utility and return the string representation and
>> b) "GenUUIDBinary" that would return the binary version.
>>
>> Any thoughts?
>> B
>>
>>
>
> Salut B,
>
> I use the attached (now on gambas3 as library) uuidgen since 12 year
> now, works pretty simple and never failed since.
> I use it in a CRM DB as PK in every table.
>
>
>
> --
> Amicalement
> Charlie
>
> --
>
> ___
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
Fabien Bodard

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] gb.util GenUUID() function

2016-11-18 Thread Karl Reinl
Am Donnerstag, den 17.11.2016, 10:49 +1030 schrieb adamn...@gmail.com:
> Every now and then I come across a need for a (locally) unique ID. Shelling 
> the ubiquitous gnu "uuidgen (-t/-r)" utility usually handles this effectively 
> enough. However, I am thinking that maybe this is a possible candidate for 
> the gb.util component.  
> In particular, most often times I am looking for the string representation of 
> the UID. In which case "SHELL uuidgen TO $somevar" is all that is required.  
> On the other hand, and on somewhat rarer occasions, I need the binary rep of 
> the generated UID. Now "uuid_parse" can handle that ... and some years ago 
> (gb2) I had a bit of code that could call that routine, sadly now long lost. 
> 
> Anyway, if there is any interest in this, as an enhancement to gb.util I'll 
> spend some effort trying to find that old code and adding it to the gb.util 
> component. I'm thinking about two new functions here 
> a) "GenUUID" with optional params to force the -t/-r options which would just 
> shell the uuidgen utility and return the string representation and
> b) "GenUUIDBinary" that would return the binary version.
> 
> Any thoughts?
> B
> 
> 

Salut B,

I use the attached (now on gambas3 as library) uuidgen since 12 year
now, works pretty simple and never failed since.
I use it in a CRM DB as PK in every table.



-- 
Amicalement
Charlie


uuidgen-0.3.13.tar.gz
Description: application/compressed-tar
--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] gb.util GenUUID() function

2016-11-16 Thread Benoît Minisini
Le 17/11/2016 à 01:19, adamn...@gmail.com a écrit :
> Every now and then I come across a need for a (locally) unique ID.
> Shelling the ubiquitous gnu "uuidgen (-t/-r)" utility usually handles
> this effectively enough. However, I am thinking that maybe this is a
> possible candidate for the gb.util component. In particular, most
> often times I am looking for the string representation of the UID. In
> which case "SHELL uuidgen TO $somevar" is all that is required.  On
> the other hand, and on somewhat rarer occasions, I need the binary
> rep of the generated UID. Now "uuid_parse" can handle that ... and
> some years ago (gb2) I had a bit of code that could call that
> routine, sadly now long lost.
>
> Anyway, if there is any interest in this, as an enhancement to
> gb.util I'll spend some effort trying to find that old code and
> adding it to the gb.util component. I'm thinking about two new
> functions here a) "GenUUID" with optional params to force the -t/-r
> options which would just shell the uuidgen utility and return the
> string representation and b) "GenUUIDBinary" that would return the
> binary version.
>
> Any thoughts? B
>
>

What is the need to add that to a Gambas component if there is a tool 
for that?

Putting that in a Gambas component implies:
- Implementing a similar algorithm than genuuid, not necessarily better.
- Maintaining it, depending on what you put in that algorithm.

Moreover, you should not need to generate those uuid million times, so 
the time lost in running an external process is not important.

-- 
Benoît Minisini

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] gb.util GenUUID() function

2016-11-16 Thread adamn...@gmail.com
Every now and then I come across a need for a (locally) unique ID. Shelling the 
ubiquitous gnu "uuidgen (-t/-r)" utility usually handles this effectively 
enough. However, I am thinking that maybe this is a possible candidate for the 
gb.util component.  
In particular, most often times I am looking for the string representation of 
the UID. In which case "SHELL uuidgen TO $somevar" is all that is required.  On 
the other hand, and on somewhat rarer occasions, I need the binary rep of the 
generated UID. Now "uuid_parse" can handle that ... and some years ago (gb2) I 
had a bit of code that could call that routine, sadly now long lost. 

Anyway, if there is any interest in this, as an enhancement to gb.util I'll 
spend some effort trying to find that old code and adding it to the gb.util 
component. I'm thinking about two new functions here 
a) "GenUUID" with optional params to force the -t/-r options which would just 
shell the uuidgen utility and return the string representation and
b) "GenUUIDBinary" that would return the binary version.

Any thoughts?
B


-- 
B Bruen 

--
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user