Re: Why does a converted v13 db limit text vars to 32k?

2017-01-06 Thread JPR
[JPR]

> I’m sure JPR has an email filter that flags messages that includes “JPR” so 
> he’s reading this. 
Gosh! Tim, you've caught red-handed! 

> On a serious note, assuming JPR is reading this message, are you going to be 
> doing the 4D World Tour this year? I enjoyed your presentation last time. 
Yes I will be in 10 cities, including 6 cities in USA. It will be 2 days in 
each city, 1st for presentation of many practical examples, and the second one 
will be a training day with my friend Add in USA.

> I’m wondering if you’ve got some more cool v16 multiprocess, preemptive CALL 
> WORKER demos and ideas to share with the 4D community. It’s a new area and we 
> need ideas on how to best utilize it. 
I'm finishing my program for the 2nd day, and I can tell you that yes, it will 
be some cool stuff and explanations regarding v16 multiprocess, preemptive CALL 
WORKER and CALL FORM, and obviously the results of my tests. New ideas are not 
enough, explaining how it works internally is not enough either, what I would 
like to share with the 4D community is how to use these new ideas in practical 
programming. And because I've tried many ways, and because most of these ways 
could be hard or no-thru, I would like to share with all of you which one is 
the easiest, safest, most opened to the future, according to my own experience.

So I look forward to meeting you, and it will be with a great pleasure!

My very best,

JPR

> On 07 Jan 2017, at 03:28, 4d_tech-requ...@lists.4d.com wrote:
> 
> Subject: Re: Why does a converted v13 db limit text vars to 32k?
> Message-ID: <30167d9f-3015-4b5e-9546-c42e35853...@mac.com>
> Content-Type: text/plain; charset=windows-1252
> 
> On Jan 6, 2017, at 7:18 PM, Keisuke Miyako wrote:
> 
>> I remember there was a bug where if you upgrade from v11 straight to v13
>> unicode mode was deactivated yet the compatibility dialog told otherwise.
> 
> Miyako, you are the king of 4D secrets and details. You are a human 4D 
> wikipedia!
> 
> OK, there may be others that know more about 4D. The initials JPR comes to 
> mind. But they don’t regularly contribute their 4D knowledge on the iNUG. So 
> they don’t really count… now do they?  Just teasing JPR. :)
> 
> I’m sure JPR has an email filter that flags messages that includes “JPR” so 
> he’s reading this. 
> 
> On a serious note, assuming JPR is reading this message, are you going to be 
> doing the 4D World Tour this year? I enjoyed your presentation last time. 
> 
> I’m wondering if you’ve got some more cool v16 multiprocess, preemptive CALL 
> WORKER demos and ideas to share with the 4D community. It’s a new area and we 
> need ideas on how to best utilize it. 
> 
> Tim

**
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: Why does a converted v13 db limit text vars to 32k?

2017-01-06 Thread Tim Nevels
On Jan 6, 2017, at 8:28 PM, David Adams wrote:

> Will the initials DPA serve? I don't have insights into the 4D internals.
> I've always approached 4D as a black box and only believe what I can
> measure. That's served me very well down the years.

Now that you mention it, I think DPA should definitely be included as another 
human 4D wikipedia. People forget that when 4D included the web server you were 
the go-to-guy for how to do web stuff with 4D. I went to many seminars you gave 
on that topic. You wrote a book or two on the subject as well. 

And you do provide a unique perspective on using 4D to tackle some common data 
processing tasks. 

Didn’t mean to slight you. And you definitely do contribute more than JPR on 
the iNUG now. 

Come to think of it, it would be great to have David Adams once again being a 
presenter of new 4D information. Any chance you could be dragged from Australia 
to wander America once again doing seminars for something like the 4D World 
Tour?

> Logging!
> If you write  a custom log file, it's a total pain to have to manage writes
> from multiple processes. Don't. Everything calls into CALL PROCESS and only
> that process has write access to the log. This is how servers do logs, and
> now so can we. (In the past, you could do the same with NTK's IPC tools.
> This is how to write a Web server log, as an example.) Going out to the
> file system is slow and lock/unlocks are unexpectedly expensive. Having
> lived through a switchover of this description some years back, I'll say
> that the speed gains can be *massive.*

Yes this is a great use of CALL WORKER. Eliminates the need for semaphores and 
IP variables. Just CALL WORKER with some parameters and let it do it’s thing. 
Automatic message queuing. It scales effortlessly to hundreds of processes and 
hundreds of calls per second.  Super efficient. 4D handles all the hard stuff. 

Another side note. What ever happened to Dan Beckett? Has he left the 4D 
community? 

Wasn’t he part of the Foresight Technology after Rich Gay sold it? Are they 
still around and doing 4D work?

Tim


Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.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: Why does a converted v13 db limit text vars to 32k?

2017-01-06 Thread David Adams
> Anything computationally expensive that's naturally suitable for
> parallelization. Not all problems are easy to parallelize. Dividing the
work
> and marshaling the results can end up being more trouble than it's worth.
Then
> again, when it's good...it's great.

Well, a few ideas...keeping in mind that this is all actually a bit harder
to implement. Why? Because if you split one task into several parts but
still need a single result, you need to figure out correctly how to divide
the task, how to send the instructions to process each part, how you return
the final results, and how you stitch them together and use them. The
payoff can be huge, in the right situation, but the startup costs are
higher than some other uses of CALL PROCESS/CALL FORM. Anyway, a few
examples:

* Long searches/calculations:
These can be divided up by some kind of condition (ID ranges, date ranges,
record numbers, etc.) and then the final results can be pushed to a
controller for assembly and final disposition.

* Fuzzy matching:
The problem with the better fuzzy match algorithms is that they tend to be
too slow to run in real time. Perhaps that can be changed.

* Burst mode:
Say you've got a surge of SMS messages (or whatever) to send out. I think
that you can use 4DIC from within a worker. (I couldn't see this after a
quick look at the docs - but I think I remember Thomas saying that in his
presentation?) Fine. Start a bunch of named workers and push the tasks out
to them. This could be a big win.

* Analysis:
Lots and lots of interesting information may be buried in your systems'
data...but it's not information until you extract and refine it. Who knows
what sorts of interesting results you'll get from scanning for interesting
trends? If you can use idle cores, why not?

I'm sure other people have nice, specific examples...

On Sat, Jan 7, 2017 at 1:27 PM, David Adams  wrote:

> Will the initials DPA serve? I don't have insights into the 4D internals.
> I've always approached 4D as a black box and only believe what I can
> measure. That's served me very well down the years.
>
> Below are some thoughts on CALL WORKER and CALL FORM. For what it's worth,
> I consider these the most important new commands in the 4D language since,
> well, I can't even remember. They are potentially revolutionary for 4D
> developers and are very, very welcome indeed. They're what have convinced
> me to look seriously at 4D again and to move to V15/V16. I'll also again
> encourage everyone to check out Thomas Mauls *excellent* presentation on
> the subject. Look for it here and scroll ahead to around minute 36+:
>
> https://4dmethod.com/
>
> > I’m wondering if you’ve got some more cool v16 multiprocess, preemptive
> CALL WORKER demos and
> > ideas to share with the 4D community. It’s a new area and we need ideas
> on how to best utilize it.
>
> Use it as a non-persistent, first-in-first-out message/task queue. That's
> what they've given us. The cores business is a side-effect, or at least I'd
> encourage you to think of them that way. EVERYONE can benefit from CALL
> WORKER/CALL PROCESS, but not everyone has a problem that immediately
> benefits from multiple cores. If you do, so much the better. It would be a
> real shame if people didn't look at these commands because they think that
> they're for problems they don't have. While they do solve some problems
> that most people don't have, they solve more problems that all of us have.
> Get in there early and experiment! (I'm working on getting myself numbers
> organized so that I can actually try the 4D implementation. It looks sweet
> to me.)
>
> Here's what to use it for - just a couple of ideas off the top of my head:
>
> Anything computationally expensive that's naturally suitable for
> parallelization.
> Not all problems are easy to parallelize. Dividing the work and marshaling
> the results can end up being more trouble than it's worth. Then again, when
> it's good...it's great.
>
> IP messaging
> Finally, we've got a native message queue. At last. These commands should
> have been introduced with New process and then we could have skipped ~20
> years of people messing around with 4D's Rohypnol commands.
> Message-oriented architectures are, well, the wave of the present. It
> promotes loose coupling and better reusability. In my coding religion, it's
> one of the pillars of the creed. Think of everything as messages.
>
> Moving towards a native MVC-like GUI control system
> It's becoming more plausible to do something MVC-like in 4D now with
> objects, form variables, and CALL FORM. Important. This is a huge subject,
> but something that everyone should try and get their heads around. Right
> away.
>
> Logging!
> If you write  a custom log file, it's a total pain to have to manage
> writes from multiple processes. Don't. Everything calls into CALL PROCESS
> and only that process has write access to the log. This is how servers do
> logs, and now so can we. (In the past, 

Re: Why does a converted v13 db limit text vars to 32k?

2017-01-06 Thread David Adams
Will the initials DPA serve? I don't have insights into the 4D internals.
I've always approached 4D as a black box and only believe what I can
measure. That's served me very well down the years.

Below are some thoughts on CALL WORKER and CALL FORM. For what it's worth,
I consider these the most important new commands in the 4D language since,
well, I can't even remember. They are potentially revolutionary for 4D
developers and are very, very welcome indeed. They're what have convinced
me to look seriously at 4D again and to move to V15/V16. I'll also again
encourage everyone to check out Thomas Mauls *excellent* presentation on
the subject. Look for it here and scroll ahead to around minute 36+:

https://4dmethod.com/

> I’m wondering if you’ve got some more cool v16 multiprocess, preemptive
CALL WORKER demos and
> ideas to share with the 4D community. It’s a new area and we need ideas
on how to best utilize it.

Use it as a non-persistent, first-in-first-out message/task queue. That's
what they've given us. The cores business is a side-effect, or at least I'd
encourage you to think of them that way. EVERYONE can benefit from CALL
WORKER/CALL PROCESS, but not everyone has a problem that immediately
benefits from multiple cores. If you do, so much the better. It would be a
real shame if people didn't look at these commands because they think that
they're for problems they don't have. While they do solve some problems
that most people don't have, they solve more problems that all of us have.
Get in there early and experiment! (I'm working on getting myself numbers
organized so that I can actually try the 4D implementation. It looks sweet
to me.)

Here's what to use it for - just a couple of ideas off the top of my head:

Anything computationally expensive that's naturally suitable for
parallelization.
Not all problems are easy to parallelize. Dividing the work and marshaling
the results can end up being more trouble than it's worth. Then again, when
it's good...it's great.

IP messaging
Finally, we've got a native message queue. At last. These commands should
have been introduced with New process and then we could have skipped ~20
years of people messing around with 4D's Rohypnol commands.
Message-oriented architectures are, well, the wave of the present. It
promotes loose coupling and better reusability. In my coding religion, it's
one of the pillars of the creed. Think of everything as messages.

Moving towards a native MVC-like GUI control system
It's becoming more plausible to do something MVC-like in 4D now with
objects, form variables, and CALL FORM. Important. This is a huge subject,
but something that everyone should try and get their heads around. Right
away.

Logging!
If you write  a custom log file, it's a total pain to have to manage writes
from multiple processes. Don't. Everything calls into CALL PROCESS and only
that process has write access to the log. This is how servers do logs, and
now so can we. (In the past, you could do the same with NTK's IPC tools.
This is how to write a Web server log, as an example.) Going out to the
file system is slow and lock/unlocks are unexpectedly expensive. Having
lived through a switchover of this description some years back, I'll say
that the speed gains can be *massive.*

Note: As far as I can see, the 4D message queues die with the server or at
least their contents are not preserved. That kind of makes sense as they
operate in a context that would be hard to restore. So, you might need to
address that if you need a 100% perfect log. Skipping many thoughts on
solutions here...that's a big thread of its own. But a good one...there are
some pretty understandable and interesting design choices to make there.

Unique access
Logging is a specific example of managing a shared resource, but generalize
it in your mind to other tasks where you are fighting for access to a
shared or unique resource. Some of them will do quite well in a worker
process. *Reducing contention is a big win.* It can also make your code a
whole lot simpler and more reliable.

Cores?
Instead of focusing on cores, focus on messaging. I'll argue that it's very
likely that most developers do not have a wide range of problems that will
meaningfully benefit from multiple cores. Many should have a few problems
where it's a *massive* benefit, but probably not day to day. 4D Server/4D
themselves absolutely, absolutely do. Us? Not so much. I'm happy to be
wrong about this, but I've been working with message and task queues since
I wrote one at 4D, Inc. in the 1980's and they're part of my toolkit for
any project. That's not the same thing as CALL FORM/CALL WORKER, but you
end up with a lot of the same questions on a design level. In all of that
time, I haven't ended up finding a huge range of tasks that customers had
that could really be split up in real time for massive benefit. Keep in
mind that if more cores are what you need, a multi-machine system gives you
that in a big fat hurry. The CALL 

Re: Why does a converted v13 db limit text vars to 32k?

2017-01-06 Thread Tim Nevels
On Jan 6, 2017, at 7:18 PM, Keisuke Miyako wrote:

> I remember there was a bug where if you upgrade from v11 straight to v13
> unicode mode was deactivated yet the compatibility dialog told otherwise.

Miyako, you are the king of 4D secrets and details. You are a human 4D 
wikipedia!

OK, there may be others that know more about 4D. The initials JPR comes to 
mind. But they don’t regularly contribute their 4D knowledge on the iNUG. So 
they don’t really count… now do they?  Just teasing JPR. :)

I’m sure JPR has an email filter that flags messages that includes “JPR” so 
he’s reading this. 

On a serious note, assuming JPR is reading this message, are you going to be 
doing the 4D World Tour this year? I enjoyed your presentation last time. 

I’m wondering if you’ve got some more cool v16 multiprocess, preemptive CALL 
WORKER demos and ideas to share with the 4D community. It’s a new area and we 
need ideas on how to best utilize it. 

Tim


Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.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: pointer and array element issue

2017-01-06 Thread Tim Nevels
On Jan 6, 2017, at 7:18 PM, Chip Scheide wrote:

> However, it might be useful to know how to go about setting to be able 
> to pass a pointer in this manner.
> Any more Ideas?

I would try using a local pointer variable. Maybe something like this:

 If ($New_Size=0)  //clear {0} value
   $temp_p:=$Current_Array->{0}
   utl_text_Convert_From_Text ($temp_p;"")  
 End if

Since it is all pointers it should, in theory, resolve to produce the desired 
result. 

You appear to be pushing the limits of what the compiler’s tokenizer can deal 
with. Or possibly you have uncovered the fact that pointers to individual array 
elements are not yet fully implemented by the compiler. At least it knows it 
can’t handle it and gives you an error message. 

Tim


Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.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: Tip (?): Escaping escape characters

2017-01-06 Thread Keisuke Miyako
are you sure that doesn't over-escape?

http://www.json.org

says

\"
\\
\/
\b
\f
\n
\r
\t

so forward slash might have a problem (forget the bell and form feed)


宮古 啓介
セールス・エンジニア

株式会社フォーディー・ジャパン
〒150-0043
東京都渋谷区道玄坂1-10-2 渋谷THビル6F
Tel: 03-6427-8441
Fax: 03-6427-8449

keisuke.miy...@4d.com
www.4D.com/JP

**
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
**

Fast scrolling was v 14/Mac OS graphics issues

2017-01-06 Thread Paul Ringsmuth
Sometime in around December 2016 the fast scrolling in a text field was fixed. 
I don’t know if it was changes in 4D v15.3 HF1 or if it was repairing fonts 
with font book. But now the scrolling is smooth as butter, not too fast and not 
too slow and I am able to read scrolling text using the trackpad on my laptop. 

Paul Ringsmuth

> On Dec 22, 2015, at 11:34 AM, Paul Ringsmuth  wrote:
> 
> I reported a similar bug report with scrolling in a text field. ACI0093924: 
> Scrolling text is so fast that 4D is unusable. I checked on that bug today 
> and it is totally gone, no longer in the bug database.
> 
> So I submitted another bug report. ACI0094354: Scrolling speed difficulty 
> with trackpad. This is an issue in both 4Dv14.4 and 4Dv15.1 latest builds. 
> Not a problem in 4Dv13.6.
> 
> Paul Ringsmuth
> 
>> On Dec 22, 2015, at 9:23 AM, Koen Van Hooreweghe  
>> wrote:
>> 
>> Hi Bob,
>> 
>> I noticed and reported a troublesome scrolling behaviour in v15, compared to 
>> v13. Easy to reproduce. Just created a brand new db in v13 with a 4D View 
>> area on a form. Imported some 20 columns with a few hundred rows. Scrolling 
>> is smooth and correctly follows the finger scroll movement on mouse or 
>> trackpad.
>> Converted the db to v15 and the scrolling is jumping by a number of rows at 
>> a time or sometimes not at all. It just doesn't follow the scroll movements 
>> and makes 4D view useless for eg examining a bunch of data.
>> 
>> Reported this on july 30th (ACI0093268). Got a message from 4D Q they 
>> could reproduce the problem on december 12th... After 4 months and a half.
>> No word yet if and when this will be fixed. Fingers crossed.
>> 
>> Please don't hesitate to create a bug report or report to TAOW or whatever 
>> means to draw 4D's attention to this issue.
>> 
>> Kind regards,
>> Koen
>> 
>> 
>> Op 21-dec.-2015, om 20:41 heeft Bill Weale  het 
>> volgende geschreven:
>> 
>>> I’m getting complaints from some Mac users regarding choppy and uneven 
>>> scrolling through lists, mainly output forms, after a recent update to v 14 
>>> from v12. I am using a recent overnight build, for the reason that it 
>>> resolved a “disappearing” records issue in some list forms. That problem 
>>> was universal to all machines. The current one seems to involve those with 
>>> lower amounts of graphics ram.
>>> 
>>> Minimum system requirements for 4D address screen resolution, but nothing 
>>> else regarding graphics resources.
>>> 
>>> Anu thoughts or ides would be helpful.
>> 
>> **
>> 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
> **

**
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: Tip (?): Escaping escape characters

2017-01-06 Thread David Adams
> On Sat, Jan 7, 2017 at 11:51 AM, Keisuke Miyako 
wrote:
> maybe it's better not to include the seed values as static text in the
code
> itself.

Is it okay if I agree with you while carrying on what I'm doing ;-)
Seriously, your suggestions are spot on and I'd advise anyone following
along at home to heed them.

So, yes, I find myself surprised that I'm heading down this road. I *hate*
finding long screeds of hard-coded text in 4D methods. It's just not a
great look, it's virtually impossible to maintain, it's unreadable, etc.
But I'm experimenting. I've gotten into some habits and am giving myself
more of a clean slate to see what happens. In this particular case, I'm
seeding records and then running the cases against the records. For sure,
the data could be stored in an external file. That obviously has a couple
of small costs and some big advantages. For example, after building you can
automatically clear the file and keep it from bloating the distribution.
(Assuming this magic file is in the /resources path in the first place.)

For what it's worth, this is just a developmental phase. The painful part
of starting with a blank slate is that I'm missing a lot of my magic
scaffolding. So, I'm building back up piece-by-piece, but with a fresh
look. A couple of milestones down the road, I should be generating the
predictable test cases automatically and can then run them in memory, write
them to disk, write them to records, use them to produce documentation,
etc. For now, it's kind of fun to do things the hard way. One of the great
things about the hard way is it gives me a good reminder of what I'm trying
to simplify.

I listen to podcasts while I'm doing boring tasks like yardwork of chopping
veggies and lately Tim Harford has been making the rounds in support of his
newest book, "Messy":

http://timharford.com/books/messy/

I've heard him about three times now and he's great. Lots of good reminders
about changing your point of view and giving serendipity a chance to
intervene in your life. (I even have one of the early editions of the
Oblique Strategies cards he goes on about...although I never did find them
that helpful for programming.) Tiny example:

Someone spilled coffee on my external keyboard yesterday and it's dead.
(Well, not "dead", but to keep using it I'll need to learn a language
without the letter "d".) So I rearranged my computer and monitors after
many, many years of using them "the way I like them." Guess what, the new
arrangement is way better, and I never would have tried it out on my own.
Once again, the virtues of coffee cannot be overstated. Just a little
reminder of how helpful it can be to do things a bit differently.

So, yeah, I'm doing something kind of stupid in my code and enjoying it for
a minute.

> if you really need to put the string in 4D code,
> why not stick "Get text from pasteboard" in the debugger "expression"
pane and
> save that state.
>
> just copy whatever text you want to paste in code and open the debugger.
> the text in the "value" pane will be ready to take away.

Yeah, I did that first...it got old in a hurry. This way I can run a few
dozen or hundreds of tests and pretty quickly convert the text as needed
for the seed method. But, yeah, it's not an approach with a great future...
**
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: Tip (?): Escaping escape characters

2017-01-06 Thread Keisuke Miyako
maybe it's better not to include the seed values as static text in the code 
itself.

either an external plain text document,
or structure resources such as lists, method comments, that is easily 
accessible from the code at runtime,
but that doesn't impose some kind of escaping system (so XLIFF is out).

or,

if you really need to put the string in 4D code,
why not stick "Get text from pasteboard" in the debugger "expression" pane and 
save that state.

just copy whatever text you want to paste in code and open the debugger.
the text in the "value" pane will be ready to take away.

> 2017/01/07 9:13、David Adams  のメール:
> Yes, exactly. I need to defeat 4D's automatic escaping.



宮古 啓介
セールス・エンジニア

株式会社フォーディー・ジャパン
〒150-0043
東京都渋谷区道玄坂1-10-2 渋谷THビル6F
Tel: 03-6427-8441
Fax: 03-6427-8449

keisuke.miy...@4d.com
www.4D.com/JP

**
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: Tip (?): Escaping escape characters

2017-01-06 Thread Kirk Brooks
David,

On Fri, Jan 6, 2017 at 4:13 PM, David Adams  wrote:

> Out of interest, is automated testing in 4D an area of interest to many?
> And, yes, I'm aware of Mark Schaake's unit testing component:
>
​I'm interested.

But it's tough. Not just for 4D though ​it's particularly hard in this
environment. Pretty much everyone wants good testing until we have to spend
the resources to actually achieve it.

​What sort of stuff was the 'inspirational group' in Brisbane doing?​

-- 
Kirk Brooks
San Francisco, CA
===
**
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: Why does a converted v13 db limit text vars to 32k?

2017-01-06 Thread Kirk Brooks
Hi Miyako,
That may have been the issue. I wasn't part of the project at that time but
it's possible. It would be consistent with the behaviour I observed.

The good news is MSC/repair seems to fix it.

On Fri, Jan 6, 2017 at 4:29 PM, Keisuke Miyako 
wrote:

> I remember there was a bug where if you upgrade from v11 straight to v13
> unicode mode was deactivated yet the compatibility dialog told otherwise.
>

-- 
Kirk Brooks
San Francisco, CA
===
**
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: Why does a converted v13 db limit text vars to 32k?

2017-01-06 Thread Keisuke Miyako
I remember there was a bug where if you upgrade from v11 straight to v13
unicode mode was deactivated yet the compatibility dialog told otherwise.

> 2017/01/07 2:26、Kirk Brooks  のメール:
> ​Well, I'm not really sure what the deal is but I resolved it by running
> MSC, correcting a few other, unrelated problems, and then running 'repair'.


宮古 啓介
セールス・エンジニア

株式会社フォーディー・ジャパン
〒150-0043
東京都渋谷区道玄坂1-10-2 渋谷THビル6F
Tel: 03-6427-8441
Fax: 03-6427-8449

keisuke.miy...@4d.com
www.4D.com/JP

**
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: Tip (?): Escaping escape characters

2017-01-06 Thread David Adams
On Sat, Jan 7, 2017 at 3:52 AM, Kirk Brooks  wrote:

> I think what David is trying to do is something like this:
>
> $code:="$text:=\"\"damn\" dog \\on hill\r\n"
> $code:=$code+"ALERT(___escape ($text)+\"\r\r\"+$text)"
>
> and then run $code.
>
>
> ​In this context the method makes sense. I've found it challenging to have
> 4D write 4D code for anything beyond fairly simple structures for reasons
> just like this - it becomes really hard to debug and verify.
>
>
Yes, exactly. I need to defeat 4D's automatic escaping. I'm not using it
for SET METHOD CODE in this case, although that's a feature I lean on
pretty heavily in my work. In this situation I'm setting up automatic test
cases and want to seed the data with determined known outcomes. I've been
doing a lot of work with, reading about, and thinking about automated tests
over the past few months...and spent about a week with an inspirational
group up in Brisbane exploring ideas and options last month. In any case,
I'm bringing my tools up to date.

Out of interest, is automated testing in 4D an area of interest to many?
And, yes, I'm aware of Mark Schaake's unit testing component:

https://github.com/markschaake/UnitTester4D

I greatly admire what Mark accomplished and how beautiful the tool
looks...but I'm not using it for a variety of reasons.

In any case, automated tests have at their heart the comparison of a known
good output (value, value in a range, complex result, image) that you
compare with a live output. I've got various routines that produce C_OBJECT
results that I want to seed my system with. So, serialize the object,
escape the text and then you get something like this:

C_TEXT($expected_good_object_with_name)
$expected_good_object_with_name:="{\n\t\"header\": {\n\t\t\"type_name\":
\"Foo_Object\",\n\t\t\"version_number\": 1.1,\n\t\t\"instance_name\":
\"Test instance\"\n\t},\n\t\"body\": {}\n}"

Yeah, I'm going to write that sort of code by hand. Not. I run the test,
get the actual result and a 'fail' because I don't know what to expect. I
check the output, see that it's right and then escape it back into the seed
method. Rebuild the test case, run, it passes. Going forward, if I change
something somewhere and the case breaks, I'll know.

I build test cases a lot of different ways...this is just one.

Anyway, that's what I'm up to in this case and figured someone else might
sometime need to escape escape characters.
**
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: pointer and array element issue

2017-01-06 Thread Chip Scheide
Thanks
I saw that solution... but since the method
utl_text_Convert_From_Text
does the same/similar thing I was trying not to duplicate functionality.

I know I have used smiler syntax to 
->($Current_Array->{0})
in other places but probably not with an array element


On Fri, 6 Jan 2017 21:01:23 +, Dennis, Neil wrote:
>> However, it might be useful to know how to go about setting to
>> be able to pass a pointer in this manner.
>> ANy more IDeas?
> 
> The only alternative that I'm aware of is to use a case on the type 
> of the pointer to find the array type then copy to a local and pass a 
> pointer to the local array element. It is not practical for your 
> specific needs but will work in the general case... so for academic 
> sake here is one way...
> 
> Case of 
> : (Type($Current_Array->)=Text array)
> ARRAY TEXT($atTemp;0)
> COPY ARRAY($Current_Array->;$atTemp)
> $pParam:=->$atTemp{0}
> // ... other array types here
> End case 
> utl_text_Convert_From_Text (pParam;"")
> 
> What you were thinking earlier (->($Current_Array->{0});"") logically 
> should work, but neither the compiler nor 4D likes this syntax.
> 
> 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
> **
**
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
**

Listbox Mysteries

2017-01-06 Thread bob . miller
Hello Everyone,

(4Dv15r5, Windows)

I have an array-type listbox that I've configured so that every cell is 
enterable (the 'Single Click Edit' property is ON).  This has presented a 
few challenges:

> If someone clicks in a cell, that cell gets focus, but if I want to move 
focus completely away from the listbox using GOTO OBJECT(*;""), then the 
cell still *appears* to have focus, even though nothing on the form 
actually has focus (because if you type, it goes nowhere).  How to remove 
the appearance of focus from the listbox (cell) ?

> If the cell is tied to a numeric array, when you click in it, a "0" 
(zero) appears.  I don't want this, users tend to get annoyed when that 
extra zero is added to whatever number they are entering (particularly if 
the zero is added to the right side of the number - 20 becomes 200).  How 
to elimininate this behavior, of displaying a 'zero' in an empty cell that 
has focus?  Cells that don't have focus don't display zeros...

Many thanks!

Bob Miller
Chomerics, a division of Parker Hannifin Corporation



**
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: pointer and array element issue

2017-01-06 Thread Dennis, Neil
>   If ($New_Size=0)  //clear {0} value
>utl_text_Convert_From_Text (->($Current_Array->{0});"")  
>//**Fails here
>   End if

In this particular case you could just  use clear variable, it would be faster 
than a roll your own method to set the correct type.

If($New_Size=0)
  CLEAR VARIABLE($Current_Array->)
End if

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
**

pointer and array element issue

2017-01-06 Thread Chip Scheide
I have a method which resizes any number of arrays, regardless of type. 
In this method I want to clear the {0} elements of these arrays if the 
new size of the array is Zero [utl_array_Resize_Array]. In this method 
I am calling another method which converts text to an appropriate data 
type [utl_text_Convert_from_Text], for a pointer the method sets the 
pointer to NIL.

utl_array_Resize_Array(NewSize; pointer to array1{;pointer to 
array2...;pointer to arrayN})
utl_text_Convert_from_Text(pointer to Destination;Text)


I am having some trouble trying to get syntax correct in passing a 
pointer to an element of an array which is itself being referenced by a 
pointer.
ex:
$Array_pointer := -> My_Pointer_Array

From utl_array_Resize_Array

for ($i;1;count parameters)
   $Current_Array:=${$i}
   $Type:=Type($Current_Array->)
   
   
   If ($New_Size=0)  //clear {0} value
  utl_text_Convert_From_Text (->($Current_Array->{0});"")  
//**Fails here
   End if
end for
 
** fails with Error 56, Field, var, or table expected at ($Current


Any help in configuring this expression?
so I can pass a pointer to element {0} of an array referenced through a 
pointer?

Thanks
Chip
**
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
**

Client upgrade

2017-01-06 Thread stardata.info

Hi All,

I have a client server compiled application in 4D V13.2 on windows.
When i do an upgrade, i copy into the folder: server database these two
file: .4dc and .4dindy, and copy the folder Upgrade4Dclient.

For do an client's upgrade i must to delete even some settings, options or
folders?

Thanks
Ferdinando

**
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: Why does a converted v13 db limit text vars to 32k?

2017-01-06 Thread Kirk Brooks
On Thu, Jan 5, 2017 at 2:08 PM, Kirk Brooks  wrote:

> What's the dang deal here?
>

​Well, I'm not really sure what the deal is but I resolved it by running
MSC, correcting a few other, unrelated problems, and then running 'repair'.
Verified with:

​C_TEXT($text)
$text:="x"*5
$x:=Length($text)

​and $x = 50k.
​
-- 
Kirk Brooks
San Francisco, CA
===
**
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: Tip (?): Escaping escape characters

2017-01-06 Thread Kirk Brooks
Robert,

On Fri, Jan 6, 2017 at 3:17 AM, Robert Livingston 
wrote:

> C_TEXT($someText)
> $someText:=DavidEscapeMethod("dog \on hill")
> Alert($someText)
>
​I just pasted David's code into a new method and ran it and it gave back
what I expected:
"dog \\on hill"​

 If you pass "dog \on hill\r" it gives back "dog \\on hill\r".

4D seems to manage this stuff itself. For example,

$text:="\"damn\" dog \\on hill\r\n"
ALERT(___escape ($text)+"\r\r"+$text)


The Alert displays:

"\"damn\" dog \\on hill\r\n"

"damn" dog \\on hill"


In the first case displaying the variable with the text escaped and in the
second place displaying the text parsed. The only thing the __escape
function does is escape the '\' in front of the 'o'.

I think what David is trying to do is something like this:

$code:="$text:=\"\"damn\" dog \\on hill\r\n"
$code:=$code+"ALERT(___escape ($text)+\"\r\r\"+$text)"

and then run $code.


​In this context the method makes sense. I've found it challenging to have
4D write 4D code for anything beyond fairly simple structures for reasons
just like this - it becomes really hard to debug and verify.

-- 
Kirk Brooks
San Francisco, CA
===
**
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
**

[Off] Anyone in Spain?

2017-01-06 Thread Paul Lovejoy
Hi,

Are any of you based in Spain? If so, I’d like to talk off list about 4D and 
opportunities in Spain.

Send me a private e-mail please.

tia


Paul
**
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: Implementing Audit Trails

2017-01-06 Thread Pat Bensky
Daniel,
Yes, we have an Audit Trail feature in CatBase:

https://www.catbase.com/the-audit-trail-manager.html

Want the code?

Pat

On 6 January 2017 at 11:52, Daniel N. Solenthaler 
wrote:

> Hi everyone,
>
> We are thinking about adding Audit Trails to our database.
>
> Found a very old Tech Note on the topic:
> ftp://ftp.4d.com/ACI_TECHNICAL_NOTES/ACIDOC/CMU/CMU79933.HTM
>
> Are there any newer approaches or components available?
> Has anyone done this?
>
> I don’t want to start off with a solution from 1998 and do not intend to
> re-invent the wheel either.
>
> Any help appreciated!
>
> Thanks
> Daniel
>
> 
> Daniel Nestor Solenthaler
> eMail: dan...@solenthaler.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
> **




-- 
*
CatBase - The Database Publishing Solution
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
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: Tip (?): Escaping escape characters

2017-01-06 Thread Robert Livingston

> On Jan 5, 2017, at 7:37 PM, David Adams  wrote:
> 
> $escaped:=""
> 
> If (Count parameters>=1)// If this isn't true, you should deal with it.
>   $escaped:=$1
> 
>   $escaped:=Replace string($escaped;"\\";"";*)
>   $escaped:=Replace string($escaped;"\n";"\\n";*)
>   $escaped:=Replace string($escaped;"\r";"\\r";*)
>   $escaped:=Replace string($escaped;"\t";"\\t";*)
>   $escaped:=Replace string($escaped;"\"";"\\\"";*)
>   $escaped:=Char(Double quote)+$escaped+Char(Double quote)
> End if
> 
> $0:=$escaped


In the spirit of things shouldn't the line

  $escaped:=Char(Double quote)+$escaped+Char(Double quote)

be replaced with 

$escaped:="\""+$escaped+"\""


**********


But more seriously:

If I pass the as the parameter  "dog \on hill"  what do I 
expect the output of the method to be?


C_TEXT($someText)
$someText:=DavidEscapeMethod("dog \on hill")
Alert($someText)



What is and what should be  $someText?

I am one of those people who find escaping confusing.
**
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
**