Re: Rotate Picture in 4D

2017-06-26 Thread Bernd Fröhlich via 4D_Tech
Peter Mew:

> I am trying to use Miyako's rotate picture component in v13.
> I dont know if its not compatible but It wont run.

Hi Peter,
I had some problems also (not sure what exactly), so I rolled my own:

  // Methode: PIC_Rotate
  // Angelegt: BF 04.04.12
  // Objekt: Bildbearbeitung
  // Beschreibung: Dreht das übergebene Bild um 90,180 oder 270 Grad im 
Uhrzeigersinn
  // 

C_PICTURE($1;$Pict)
C_LONGINT($2)  //Rotationsgrad
C_PICTURE($0)

C_LONGINT($lWidth;$lHeigth;$lMax)
C_TEXT($tSVGRoot;$tPicRef)

PICTURE PROPERTIES($1;$lWidth;$lHeigth)
CREATE THUMBNAIL($1;$Pict;$lWidth;$lHeigth)  //EXIF-Daten entfernen, sonst geht 
SVG_SET_TRANSFORM_ROTATE schief, wenn EXIF-Tags am Bild kleben, die auch schon 
Rotationsinfos enthalten!
$lMax:=MaxInt ($lWidth;$lHeigth)
$tSVGRoot:=SVG_New ($lMax*2;$lMax*2)  //Bereich der gross genug ist, Platz für 
das Bild und die Rotation zu haben
$tPicRef:=SVG_New_embedded_image ($tSVGRoot;$Pict;$lMax;$lMax)  //Obere Linke 
Ecke des Bildes ist jetzt am Punkt $lMax,$lMax. Um diesen Punkt wird das Bild 
rotiert
SVG_SET_TRANSFORM_ROTATE ($tPicRef;$2;$lMax;$lMax)
$0:=SVG_Export_to_picture ($tSVGRoot;1)
  //Jetzt noch den gedrehten Teil wieder extrahieren:
Case of 
: ($2=90)
TRANSFORM 
PICTURE($0;Crop;$lMax-$lHeigth;$lMax;$lHeigth;$lWidth)  //Breite und Höhe 
vertauscht, da das Bild gedreht wurde
: ($2=180)
TRANSFORM 
PICTURE($0;Crop;$lMax-$lWidth;$lMax-$lHeigth;$lWidth;$lHeigth)
: ($2=270)
TRANSFORM PICTURE($0;Crop;$lMax;$lMax-$lWidth;$lHeigth;$lWidth) 
 //Breite und Höhe vertauscht, da das Bild gedreht wurde
Else 
g4D_AlertErrCaseOf (Current method name;String($2))
End case 
SVG_CLEAR ($tSVGRoot)


Works, but unfortunately is quite slow.
I wonder when 4D will implement a native picture rotate method.
I think it is much needed.

Greetings from Germany,
Bernd Fröhlich
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Contextual Cut, Copy & Paste...?

2017-06-26 Thread Kirk Brooks via 4D_Tech
Robert,

I second Tim's approach - just build your own menu based on the On clicked
event with Contextual Click. I don't think a user could tell the difference
between it being a '4D menu' and an 'OS menu'. I'm not even sure there is
any.

The only thing I'd do differently is not bother with an IP var for the menu
ref. Just use it and loose it:

$menu:=Create menu

APPEND MENU ITEM($menu;"Cut")
SET MENU ITEM PARAMETER($menu;-1;"cut")

APPEND MENU ITEM($menu;"Copy")
SET MENU ITEM PARAMETER($menu;-1;"copy")

etc

// display the menu, get the result, clear the menu
$result:=Dynamic pop up menu($menu)
RELEASE MENU($menu)

Case of
  :($result="cut")
  
End case




On Wed, Jun 21, 2017 at 7:05 PM, Robert ListMail via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Is there a way to use the contextual menu of the host OS (Mac or Windows)
> for Cut, Copy & Paste within 4D?
>
> Thanks,
>
> Robert
>
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **




-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Contextual Cut, Copy & Paste...?

2017-06-26 Thread Robert ListMail via 4D_Tech
This Windows-based client sees this as a glaring omission from modern software… 
I would expect it to work by default or easy to implement although I personally 
accepted the fact that I can’t right-click for a useful contextual menu at 
times. Tim, care to share how you implemented this for one of your clients?

Thanks,

Robert

> On Jun 22, 2017, at 5:29 PM, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> A client requested this feature. He’s a mouse nut. So I figured out a way to 
> easily implement it. He paid for it, he liked the end result. 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: [Ann] 4D Set Component

2017-06-26 Thread David Adams via 4D_Tech
On Tue, Jun 27, 2017 at 4:07 AM, Jeffrey Kain via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Never heard of this.  I'd be interested to know.
>

Nope, doesn't seem to work in 16.1.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Generating Random Numbers

2017-06-26 Thread Cannon Smith via 4D_Tech
I can’t agree more with what David has said about passwords. Here is another 
article about it including a comic that I like:




--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236




> On Jun 26, 2017, at 3:49 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
>  I didn't
> find the reference I wanted for this

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Generating Random Numbers

2017-06-26 Thread David Adams via 4D_Tech
On Tue, Jun 27, 2017 at 1:32 AM, Jim Medlen via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I concatenate 8 characters to build a ³random²
> password which then has to meet a few simple rules.

> contains a number
> contains a lower case letter
> No Double characters
> Not 3 or more consecutive numbers
> The password must be unique.

Hi, I'm not smart enough about this to rant, but as a user, I can half-rant
;-) If you want to skip my ramblings, here's the take-away:

Long, easy to remember passwords are strong than short, impossible to
remember passwords.
Because science.

I mostly think about passwords as a user since I have to use a lot of
passwords. I just checked my 1Password and see that I've got over 700
entries with passwords. Yeah, hat's a lot. But it it? Probably, but I've
got a good reason. (Nothing exciting, I need to manage a ton of accounts
for family members, etc.) Anyway, even if you don't have that many, chances
are you've got more passwords than you can remember and keep unique.
Everyone does these days. As a user, some pet peeves:

* Man, I hate those complicated formulas. It just reeks of "Users? Screw
users. We hate them."

* Okay, you've got some complicated formula. So you'll put instructions up
to tell me the rules? No? How about a little indicator that shows the parts
of the rules that are matched/not matched by what I've typed? No? Oh I see,
I just keep typing things in and trying them until I stop getting an error
back. There should be a law

* Okay, you've got a horrible formula and you made me figure it out by
trial and error. Now I'm back...oh, I can't see what I'm typing. And what's
up with hiding the password when I type? First it has to be gibberish, then
you won't let me see my typing? It's got nothing to do with security over
the network, it's just making the typing harder. The whole hiding the
password thing kind of makes sense for anyone worried about
shoulder-surfing. But I'm most often in a private/office setting,not in
public. So why hide my typing from *me*? It's so user-hostile. Good ideas:

-- Lots of sites now seem to use a Bootstrap style that briefly shows the
password before obscuring it.
-- Some sites have a little checkbox that lets you show/obscure the
password. That seems like a decent compromise.

* Some (rarely now) sites won't let me copy-and-paste my password in.
Inevitably, they also won't allow you to see what you're typing. Who is
this making more "secure"? I hate them. So much.

Unpleasant sign-ins make me avoid logging into some apps and sites. That's
how dramatically bad the user experience is - I end up feeling consciously
unwilling to even enter the app.

Oh, and what's up with recovery questions? They're generally terrible. Like
"favorite island" or "favorite movie", etc. I mean, if a hacker has your
post code and year of birth, they should be able to guess favorite island
and favorite movie for a pretty significant % of people in a few tries. I
use nonsense answers or answers to different questions entirely...or a
different question as the answer and then I write everything into my
1Password. The whole idea that people can memorize everything isn't working
out.

We've all doubtlessly heard the standard rules for password:
* Change them every x days/weeks/months. (Why? I guess because you assume
every site is getting its passwords stollen regularly. Or that you are.)

* Don't reuse passwords. (Great advice, but impossible to follow without a
password manager. I'd be lost without 1Password.)

* Don't use stupid passwords like 12345678 or password. And yet people do.
Like, a huge percentage of people.

* Don't use simple words from a dictionary. Why? Because if a hacker can
get at the hash for the passwords, they've already got pre-built versions
with the hashed forms of zillions of common words! Instead of
you-need-a-quantum-computer-to-break-this difficulty, you get to
this-is-totally-breakable territory instantly.

* Don't write down your passwords. (Again, 1Password or one of its
competitors to the rescue.)

* Don't share passwords. (Why not? My wife and I each have our own
1Password and make sure that the other one knows the password to get into
each other's 1Password. Helpful.)

It's pretty clear that the whole password thing is failing. So if you have
to use passwords, it's okay to improve on standard practice. Standard
practice isn't working. After big hacks, I often read pieces that explain
exactly what went wrong. And, now and then, listen to or read pieces by
security researchers. Here are a couple of good strategies and ideas I've
picked up that way:

* Don't memorize passwords, use a password manager.

* Visiting a site you don't expect to use again or use often, but it
requires a password? Pick something random and don't record it. If you ever
do need the password again, use their password recovery feature. (I find
this suggestion somehow risqué and always feel a bit daring when I follow
it. Clearly, I need to get out mor

Re: Is there a way to get a list of set semaphores?

2017-06-26 Thread Kirk Brooks via 4D_Tech
Okey dokey - here's the list to my feature request:

http://forums.4d.fr/Post//19605563/1/



On Mon, Jun 26, 2017 at 11:23 AM, Kirk Brooks  wrote:

> Just wondering.
>
> --
> Kirk Brooks
> San Francisco, CA
> ===
>
> *The only thing necessary for the triumph of evil is for good men to do
> nothing.*
>
> *- Edmund Burke*
>
>


-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13+ - component method parameters

2017-06-26 Thread Alan Tilson via 4D_Tech
Chip,
Thanks for the link. I'll try to check it out. Is it your component?
Alan

On Mon, Jun 26, 2017 at 11:13 AM, Chip Scheide <4d_o...@pghrepository.org>
wrote:

> Alan,
> First the specific problem was/is trying to compile (testing database)
> with interpreted component.
> The error provided "Invalid parameter" is not really the correct error
> to generate.
>
> As to your question regarding sets.
> download the (shareware) component.
> https://www.dropbox.com/s/075k0ap7afervs8/Sets_Component_v1.0.zip?dl=0
>
> Basically, you run all your set creation code through the component, it
> tracks everything.
> This makes it possible to ask (and answer!!) questions you could not do
> so before.
> Such as:
> - To which table does a set belong?
> - What set(s) exists for a specified table?
> - Does a set exist?
>
> Chip
>
>
> On Mon, 26 Jun 2017 10:43:52 -0400, Alan Tilson wrote:
> > Hello Chip,
> > Sorry, I don't know the answer to your issues, but I am curious about how
> > you determine what sets if any exist for a table? I thought the only test
> > available was Records in Set()>0?
> > Thanks,
> > Alan
> >
> > On Wed, Jun 21, 2017 at 12:30 PM, Chip Scheide via 4D_Tech <
> > 4d_tech@lists.4d.com> wrote:
> >
> >> Thanks.
> >>
> >> The code runs, interpretably just fine.
> >> I have to re-test, but I think the code runs fine when the component is
> >> compiled and built.
> >>
> >> The method (from original code I posted, and this code posted below) :
> >> utl_sets_whatsets_Validate
> >> does all of this validation and returns a boolean (true - everything is
> >> OK)
> >>
> >> I do not do a parameter count check, in that I believe that 4D is
> >> *supposed* to do that
> >> However, tracing this code, interpretedly it works correctly.
> >>
> >> The problem is when I try to compile the test database. It is when
> >> compiling the test database that I get the invalid parameter errors,
> >> when making calls to (for example, and as previously posted)
> >> utl_sets_What_Sets.
> >>
> >>
> >> code for utl_sets_whatsets_Validate
> >>   //(m) utl_whatsets_Validate
> >>   // $1 - pointer - to a table to determine what, if any sets exist
> >>   // $2 - pointer - to text Array
> >>   // $3 - pointer - to error text
> >>
> >>   //RETURNS - boolean - are parameters valid
> >>   // • Created 06-09-17 by Chip -
> >> C_POINTER($1;$2;$Table;$Array;$3;$Errors)
> >> C_TEXT($Sets;$msg)
> >> C_BOOLEAN($0)
> >>
> >> $Table:=$1
> >> $Array:=$2
> >> $Errors:=$3
> >>
> >> Case of
> >> : (Nil($Table))  //nil table pointer (nil passed, or nothing)
> >>   $msg:="Table pointer is Nil."
> >>
> >> : (Not(utl_type_Is_Table ($Table)))  // pointer passed, but not to a
> >> table
> >>   $msg:="Table pointer does not point to a table."
> >>
> >> : (Nil($Array))  //nil array pointer (nil passed, or nothing)
> >>   $msg:="Array pointer is Nil."
> >>
> >> : (Not(utl_type_Is_An_Array ($Array;"Text")))  // array is not text
> >>   $msg:="Array pointer does not point to an Array."
> >> Else   //everything is OK
> >>   $0:=True
> >> End case
> >>
> >> If (Not(utl_Is_Empty (->$msg)))  // there was an error above
> >> utl_errtxt_Add ($msg)  //add it to the error handler
> >> End if
> >> utl_errtxt_End (Current method name;$Errors)  //report the error
> >>   //End utl_whatsets_Validate
> >>
> >>
> >> On Wed, 21 Jun 2017 17:37:19 +0200, Arnaud de Montard via 4D_Tech wrote:
> >>>
>  Le 21 juin 2017 à 16:38, Chip Scheide via 4D_Tech
>  <4d_tech@lists.4d.com> a écrit :
> 
>  $Table:=$1
>  $Array:=$2
> >>>
> >>> Hi Chip,
> >>> If you trace in the component code, nothing helps?
> >>>
> >>> Some times it helps to "look into the pointer", for example:
> >>>
> >>> case of
> >>>  :(count parameters < 2)
> >>>   //err 1
> >>>  :(not(Ptr_isTable($1)))
> >>>   //err 2
> >>>  :(not(Ptr_isArray($2;is text array)))
> >>>   //err 3
> >>>  else
> >>>   //run method
> >>> end case
> >>>
> >>> --
> >>> Arnaud
> >>>
> >>>
> >>>
> >>> **
> >>> 4D Internet Users Group (4D iNUG)
> >>> FAQ:  http://lists.4d.com/faqnug.html
> >>> Archive:  http://lists.4d.com/archives.html
> >>> Options: http://lists.4d.com/mailman/options/4d_tech
> >>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> >>> **
> >> ---
> >> Gas is for washing parts
> >> Alcohol is for drinkin'
> >> Nitromethane is for racing
> >> **
> >> 4D Internet Users Group (4D iNUG)
> >> FAQ:  http://lists.4d.com/faqnug.html
> >> Archive:  http://lists.4d.com/archives.html
> >> Options: http://lists.4d.com/mailman/options/4d_tech
> >> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> >> **
> >>
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing
>
***

Re: [Ann] 4D Set Component

2017-06-26 Thread Jeffrey Kain via 4D_Tech
Never heard of this.  I'd be interested to know.

--
Jeffrey Kain
jeffrey.k...@gmail.com

> On Jun 24, 2017, at 9:41 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I keep meaning to test this out or ask...is wildcard set clearing still
> supported? Deep into some numbers now so I'm not trying it out myself. But
> does anyone know? It used to be that you could clear everything like this:

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Generating Random Numbers

2017-06-26 Thread Jim Medlen via 4D_Tech


Tim,

Thanks for the help.

I think that my method was based on your original tech note
http://kb.4d.com/assetid=76055

I found the PHP command mt_rand which generates a random number using
Mersenne Twister.
This function was recommended on several web pages regarding random number
generators.

Using vbOK:=PHP Execute("";"mt_rand";vi1;1;36) in place of
vi1:=(Random%35)+1 works well.

It is fast and has not created any collisions with existing passwords in
initial testing.

vText:=""
vtSet:="abcdefghijklmnopqrstuvwxyz0123456789"

For (vi2;1;8)
  //vi1:=(Random%35)+1
vbOK:=PHP Execute("";"mt_rand";vi1;1;36)  // Mersenne 
Twister
vText:=vText+vtSet[[vi1]]
End for 


Thanks,

Jim Medlen
Computer & Information Systems
Functional Devices, Inc.
j.med...@functionaldevices.com
phone (765) 883-5538 x 428
fax (765) 883-4262
http://www.functionaldevices.com
This email was transmitted on 100 percent recycled electrons



Confidentiality Notice:
The information transmitted is intended only for the person or entity
to which it is addressed and may contain confidential and/or
privileged material. If the reader of this message is not the intended
recipient, you are hereby notified that your access is unauthorized,
and any review, dissemination, distribution or copying of this message
including any attachments is strictly prohibited. If you are not the
intended recipient, please contact the sender at (800) 888-5538 and
permanently delete the original and any copy including printed copies
of this e-mail and any attachments.





On 6/26/17, 12:54 PM, "Timothy Penner"  wrote:

>> Is the 4D Random function considered a good random number generator ?
>
>It's OK, it produces a 15-bit random number between 1 and 32,767.
>If you need numbers above 32,767 you can use this:
>http://kb.4d.com/assetid=7
>
>If the built in command doesn't meet your need then you can use PHP (like
>David said).
>
>There is also this plugin: https://github.com/miyako/4d-plugin-PRNG
>
>> I concatenate 8 characters to build a ³random² password which then has
>>to meet a few simple rules.
>
>I wrote this tech tip 7 years ago, maybe it will help:
>http://kb.4d.com/assetid=76055
>
>-Tim PENNER
>
>
>Timothy Penner
>Technical Services Engineer
>
>4D Inc
>95 S. Market Street, Suite #240
>CA 95113 San Jose
>United States
>
>Telephone : +1-408-557-4600
>Standard :  +1-408-557-4600
>Fax :   +1-408-271-5080
>Email : tpen...@4d.com
>Web :   www.4D.com
>
>


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Is there a way to get a list of set semaphores?

2017-06-26 Thread Chip Scheide via 4D_Tech
The only way I can think of is to know* all the semaphores and use
Test Semaphore

* - if you create 'random' semaphores - add them to an IP array, 
otherwise build an IP array with all the possible semaphores

On Mon, 26 Jun 2017 11:23:28 -0700, Kirk Brooks via 4D_Tech wrote:
> Just wondering.
> 
> -- 
> Kirk Brooks
> San Francisco, CA
> ===
> 
> *The only thing necessary for the triumph of evil is for good men to do
> nothing.*
> 
> *- Edmund Burke*
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Is there a way to get a list of set semaphores?

2017-06-26 Thread Kirk Brooks via 4D_Tech
Just wondering.

-- 
Kirk Brooks
San Francisco, CA
===

*The only thing necessary for the triumph of evil is for good men to do
nothing.*

*- Edmund Burke*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: [Ann] 4D Set Component

2017-06-26 Thread Chip Scheide via 4D_Tech
David,
This will not work in my component, mostly because I didn't know such a 
thing existed...

I will look into it later this week, and if this behavior exists, I'll 
update and include it.
And post back to let you know.

Chip

On Sun, 25 Jun 2017 11:41:31 +1000, David Adams via 4D_Tech wrote:
> I keep meaning to test this out or ask...is wildcard set clearing still
> supported? Deep into some numbers now so I'm not trying it out myself. But
> does anyone know? It used to be that you could clear everything like this:
> 
> CLEAR SET("@")
> 
> ...or be more selective, like:
> 
> CLEAR SET("Items_@")
> 
> Does anyone know off the top of their heads about this old behavior in
> modern versions? Since I'm being lazy, don't go to trouble...I'll circle
> back at some point if no one already knows.
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Generating Random Numbers

2017-06-26 Thread Timothy Penner via 4D_Tech
> Is the 4D Random function considered a good random number generator ?

It's OK, it produces a 15-bit random number between 1 and 32,767.
If you need numbers above 32,767 you can use this:
http://kb.4d.com/assetid=7

If the built in command doesn't meet your need then you can use PHP (like David 
said).

There is also this plugin: https://github.com/miyako/4d-plugin-PRNG

> I concatenate 8 characters to build a ³random² password which then has to 
> meet a few simple rules.

I wrote this tech tip 7 years ago, maybe it will help:
http://kb.4d.com/assetid=76055

-Tim PENNER



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Generating Random Numbers

2017-06-26 Thread David Samson via 4D_Tech
Jim,

The standard random function in 4D is pretty basic. I looked into it once
and found a much better solution was to use PHP. This is mathematically a
much more "robust" generator.

Here is a code example. (I think I found this in the iNUG archives.)

  // 
  // Method: phpRandom_mt
  //
  // Description: Returns a Random number using PHP's mt_rand() function
  //
  // Required Parameters: none
  //
  // Optional Parameters: 2 (must specify both or none)
  // $1 = Min value for Random number
  // $2 = Max value for Random number
  //
  // 

C_LONGINT($0;$randResult)  // random number result

If (Count parameters=2)
C_BOOLEAN($phpSuccess)
C_LONGINT($1;$randMin)  // Random min value
C_LONGINT($2;$randMax)  // Random max value
$randMin:=$1
$randMax:=$2
$phpSuccess:=PHP Execute("";"mt_rand";$randResult;$randMin;$randMax)
$0:=$randResult
Else
If (Count parameters=0)
C_BOOLEAN($phpSuccess)
$phpSuccess:=PHP Execute("";"mt_rand";$randResult)
$0:=$randResult
Else
$0:=-1
End if
End if



>
> Is the 4D Random function considered a good random number generator ?
>
> Is there a better 4D function for generating a random number ?
>
> I am currently using vi1:=(Random%35)+1 to make a random selection of lower
> case letters or numbers.
>
> I concatenate 8 characters to build a ³random² password which then has to
> meet a few simple rules.
>
> contains a number
> contains a lower case letter
> No Double characters
> Not 3 or more consecutive numbers
> The password must be unique.
>
>


-- 
D Samson
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: [Ann] 4D Set Component

2017-06-26 Thread David Adams via 4D_Tech
I keep meaning to test this out or ask...is wildcard set clearing still
supported? Deep into some numbers now so I'm not trying it out myself. But
does anyone know? It used to be that you could clear everything like this:

CLEAR SET("@")

...or be more selective, like:

CLEAR SET("Items_@")

Does anyone know off the top of their heads about this old behavior in
modern versions? Since I'm being lazy, don't go to trouble...I'll circle
back at some point if no one already knows.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Generating Random Numbers

2017-06-26 Thread Dennis, Neil via 4D_Tech
Not considered a good random number generator when you are looking for random 
numbers.

Add in milliseconds or seed it by looking for a random number (from millisecond 
or something) of random numbers and tossing them.

I usually use something like this Random+Abs(Milliseconds) and they seem random 
enough.

Neil








--

Privacy Disclaimer: This message contains confidential information and is 
intended only for the named addressee. If you are not the named addressee you 
should not disseminate, distribute or copy this email. Please delete this email 
from your system and notify the sender immediately by replying to this email.  
If you are not the intended recipient you are notified that disclosing, 
copying, distributing or taking any action in reliance on the contents of this 
information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range 
of services to hedge funds, funds of funds and private equity funds.  Any tax 
advice in this communication is not intended to be used, and cannot be used, by 
a client or any other person or entity for the purpose of (a) avoiding 
penalties that may be imposed on any taxpayer or (b) promoting, marketing, or 
recommending to another party any matter addressed herein.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Generating Random Numbers

2017-06-26 Thread Jim Medlen via 4D_Tech

Is the 4D Random function considered a good random number generator ?

Is there a better 4D function for generating a random number ?

I am currently using vi1:=(Random%35)+1 to make a random selection of lower
case letters or numbers.

I concatenate 8 characters to build a ³random² password which then has to
meet a few simple rules.

contains a number
contains a lower case letter
No Double characters
Not 3 or more consecutive numbers
The password must be unique.


Thanks,

Jim Medlen
Computer & Information Systems
Functional Devices, Inc.
j.med...@functionaldevices.com
phone (765) 883-5538 x 428
fax (765) 883-4262
http://www.functionaldevices.com

This email was transmitted on 100 percent recycled electrons



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13+ - component method parameters

2017-06-26 Thread Chip Scheide via 4D_Tech
Alan,
First the specific problem was/is trying to compile (testing database) 
with interpreted component. 
The error provided "Invalid parameter" is not really the correct error 
to generate.

As to your question regarding sets. 
download the (shareware) component.
https://www.dropbox.com/s/075k0ap7afervs8/Sets_Component_v1.0.zip?dl=0

Basically, you run all your set creation code through the component, it 
tracks everything.
This makes it possible to ask (and answer!!) questions you could not do 
so before.
Such as:
- To which table does a set belong?
- What set(s) exists for a specified table?
- Does a set exist?

Chip


On Mon, 26 Jun 2017 10:43:52 -0400, Alan Tilson wrote:
> Hello Chip,
> Sorry, I don't know the answer to your issues, but I am curious about how
> you determine what sets if any exist for a table? I thought the only test
> available was Records in Set()>0?
> Thanks,
> Alan
> 
> On Wed, Jun 21, 2017 at 12:30 PM, Chip Scheide via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> Thanks.
>> 
>> The code runs, interpretably just fine.
>> I have to re-test, but I think the code runs fine when the component is
>> compiled and built.
>> 
>> The method (from original code I posted, and this code posted below) :
>> utl_sets_whatsets_Validate
>> does all of this validation and returns a boolean (true - everything is
>> OK)
>> 
>> I do not do a parameter count check, in that I believe that 4D is
>> *supposed* to do that
>> However, tracing this code, interpretedly it works correctly.
>> 
>> The problem is when I try to compile the test database. It is when
>> compiling the test database that I get the invalid parameter errors,
>> when making calls to (for example, and as previously posted)
>> utl_sets_What_Sets.
>> 
>> 
>> code for utl_sets_whatsets_Validate
>>   //(m) utl_whatsets_Validate
>>   // $1 - pointer - to a table to determine what, if any sets exist
>>   // $2 - pointer - to text Array
>>   // $3 - pointer - to error text
>> 
>>   //RETURNS - boolean - are parameters valid
>>   // • Created 06-09-17 by Chip -
>> C_POINTER($1;$2;$Table;$Array;$3;$Errors)
>> C_TEXT($Sets;$msg)
>> C_BOOLEAN($0)
>> 
>> $Table:=$1
>> $Array:=$2
>> $Errors:=$3
>> 
>> Case of
>> : (Nil($Table))  //nil table pointer (nil passed, or nothing)
>>   $msg:="Table pointer is Nil."
>> 
>> : (Not(utl_type_Is_Table ($Table)))  // pointer passed, but not to a
>> table
>>   $msg:="Table pointer does not point to a table."
>> 
>> : (Nil($Array))  //nil array pointer (nil passed, or nothing)
>>   $msg:="Array pointer is Nil."
>> 
>> : (Not(utl_type_Is_An_Array ($Array;"Text")))  // array is not text
>>   $msg:="Array pointer does not point to an Array."
>> Else   //everything is OK
>>   $0:=True
>> End case
>> 
>> If (Not(utl_Is_Empty (->$msg)))  // there was an error above
>> utl_errtxt_Add ($msg)  //add it to the error handler
>> End if
>> utl_errtxt_End (Current method name;$Errors)  //report the error
>>   //End utl_whatsets_Validate
>> 
>> 
>> On Wed, 21 Jun 2017 17:37:19 +0200, Arnaud de Montard via 4D_Tech wrote:
>>> 
 Le 21 juin 2017 à 16:38, Chip Scheide via 4D_Tech
 <4d_tech@lists.4d.com> a écrit :
 
 $Table:=$1
 $Array:=$2
>>> 
>>> Hi Chip,
>>> If you trace in the component code, nothing helps?
>>> 
>>> Some times it helps to "look into the pointer", for example:
>>> 
>>> case of
>>>  :(count parameters < 2)
>>>   //err 1
>>>  :(not(Ptr_isTable($1)))
>>>   //err 2
>>>  :(not(Ptr_isArray($2;is text array)))
>>>   //err 3
>>>  else
>>>   //run method
>>> end case
>>> 
>>> --
>>> Arnaud
>>> 
>>> 
>>> 
>>> **
>>> 4D Internet Users Group (4D iNUG)
>>> FAQ:  http://lists.4d.com/faqnug.html
>>> Archive:  http://lists.4d.com/archives.html
>>> Options: http://lists.4d.com/mailman/options/4d_tech
>>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>>> **
>> ---
>> Gas is for washing parts
>> Alcohol is for drinkin'
>> Nitromethane is for racing
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
>> 
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: v13+ - component method parameters

2017-06-26 Thread Alan Tilson via 4D_Tech
Hello Chip,
Sorry, I don't know the answer to your issues, but I am curious about how
you determine what sets if any exist for a table? I thought the only test
available was Records in Set()>0?
Thanks,
Alan

On Wed, Jun 21, 2017 at 12:30 PM, Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Thanks.
>
> The code runs, interpretably just fine.
> I have to re-test, but I think the code runs fine when the component is
> compiled and built.
>
> The method (from original code I posted, and this code posted below) :
> utl_sets_whatsets_Validate
> does all of this validation and returns a boolean (true - everything is
> OK)
>
> I do not do a parameter count check, in that I believe that 4D is
> *supposed* to do that
> However, tracing this code, interpretedly it works correctly.
>
> The problem is when I try to compile the test database. It is when
> compiling the test database that I get the invalid parameter errors,
> when making calls to (for example, and as previously posted)
> utl_sets_What_Sets.
>
>
> code for utl_sets_whatsets_Validate
>   //(m) utl_whatsets_Validate
>   // $1 - pointer - to a table to determine what, if any sets exist
>   // $2 - pointer - to text Array
>   // $3 - pointer - to error text
>
>   //RETURNS - boolean - are parameters valid
>   // • Created 06-09-17 by Chip -
> C_POINTER($1;$2;$Table;$Array;$3;$Errors)
> C_TEXT($Sets;$msg)
> C_BOOLEAN($0)
>
> $Table:=$1
> $Array:=$2
> $Errors:=$3
>
> Case of
> : (Nil($Table))  //nil table pointer (nil passed, or nothing)
>   $msg:="Table pointer is Nil."
>
> : (Not(utl_type_Is_Table ($Table)))  // pointer passed, but not to a
> table
>   $msg:="Table pointer does not point to a table."
>
> : (Nil($Array))  //nil array pointer (nil passed, or nothing)
>   $msg:="Array pointer is Nil."
>
> : (Not(utl_type_Is_An_Array ($Array;"Text")))  // array is not text
>   $msg:="Array pointer does not point to an Array."
> Else   //everything is OK
>   $0:=True
> End case
>
> If (Not(utl_Is_Empty (->$msg)))  // there was an error above
> utl_errtxt_Add ($msg)  //add it to the error handler
> End if
> utl_errtxt_End (Current method name;$Errors)  //report the error
>   //End utl_whatsets_Validate
>
>
> On Wed, 21 Jun 2017 17:37:19 +0200, Arnaud de Montard via 4D_Tech wrote:
> >
> >> Le 21 juin 2017 à 16:38, Chip Scheide via 4D_Tech
> >> <4d_tech@lists.4d.com> a écrit :
> >>
> >> $Table:=$1
> >> $Array:=$2
> >
> > Hi Chip,
> > If you trace in the component code, nothing helps?
> >
> > Some times it helps to "look into the pointer", for example:
> >
> > case of
> >  :(count parameters < 2)
> >   //err 1
> >  :(not(Ptr_isTable($1)))
> >   //err 2
> >  :(not(Ptr_isArray($2;is text array)))
> >   //err 3
> >  else
> >   //run method
> > end case
> >
> > --
> > Arnaud
> >
> >
> >
> > **
> > 4D Internet Users Group (4D iNUG)
> > FAQ:  http://lists.4d.com/faqnug.html
> > Archive:  http://lists.4d.com/archives.html
> > Options: http://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > **
> ---
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
>
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Rotate Picture in 4D

2017-06-26 Thread Chip Scheide via 4D_Tech
270 :)

On Sun, 25 Jun 2017 20:51:57 +0100, Peter Mew via 4D_Tech wrote:
> Can anyone see why and suggest a modification
> to make it so
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Rotate Picture in 4D

2017-06-26 Thread Peter Mew via 4D_Tech
Ok thanks
-pm

Sent from my iPad

> On 26 Jun 2017, at 02:38, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> it's not so much "my" component since rotating a picture is an innate feature 
> of SVG.
> the only the component does it is make sure the center of rotation is at the 
> center of the image.
> 
> did you look into the source of the resulting SVG?
> the center of rotation is probably wrong.
> 
> https://github.com/miyako/4d-component-rotate-picture
> 
>> 2017/06/26 4:51、Peter Mew via 4D_Tech <4d_tech@lists.4d.com> のメール:
>> I am trying to use Miyako's rotate picture component in v13.
> 
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**