Looking for help
[1/12] from: jrichards:starband at: 4-Mar-2002 13:37
Any help would be appreciated. I have been playing around with developing a data entry
and retrieval system and I am having trouble with the text-list display with the find
function. The find function itself works great but I can't figure out how to display
the found records.
Thanks
Jim
Rebol [
Title: "MySQL Data Entry"
Author: "Jim Richards"
Version: 0.1
Date: 22-Feb-2002
]
do %/d/rebol/view/mysql-protocol.r
g-fname: []
g-lname: []
fields: [f-fname f-lname f-addr1 f-addr2 f-city f-state f-zip1 f-zip2
f-email f-phone1 f-phone2]
main: layout [
style tx label right 100x24
style fld field 200x24
across
tx "First Name: " f-fname: fld 196 return
tx "Last Name: " f-lname: fld 196 return
tx "Address: " f-addr1: fld 196 return
tx "Address: " f-addr2: fld 196 return
tx "City: " f-city: fld 196 return
tx "State: " f-state: fld 196 return
tx "Zip: " f-zip1: fld 45 f-zip2: fld 45 return
tx "Email Address: " f-email: fld 196 return
tx "Home Phone: " f-phone1: fld 196 return
tx "Cell Phone: " f-phone2: fld 196 return
pad 90
button "Clear" [reset-fields show fields]
button "Add" [add-rec]
button "Find" [
view/new center-face find-scr: layout [
style tx label right 100x24
style fld field 100x24
across
tx "Last Name: " f-lname: fld return
tx "Home Phone: " f-phone1: fld return
button "Find" [find-rec]
below
pad 30
list: text-list [g-fname/text g-lname/text]
]
]
]
reset-fields: does [
unfocus
clear-fields main show main
focus f-fname
]
add-rec: does [
db: open mysql://richards:?@localhost/test
insert db [{insert into play (fname, lname, addr1, addr2, city,
state, zip1, zip2, email, phone1, phone2)
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
} f-fname/text f-lname/text f-addr1/text f-addr2/text
f-city/text f-state/text f-zip1/text f-zip2/text
f-email/text f-phone1/text f-phone2/text
]
close db
reset-fields
]
update-rec: does [
]
find-rec: does [
db: open mysql://richards:?@localhost/test
insert db [{select * from play where lname = (?)} f-lname/text]
foreach row copy db [
append g-fname probe row/1
append g-lname probe row/2
]
close db
show find-scr
]
reset-fields
view center-face main
[2/12] from: reboler:programmer at: 4-Mar-2002 14:50
Try the following function:
tell-list: func [
"changes data in 'text-list and resets everything. usage: tell-list text-list-face new-data"
fce value
][
append clear fce/data copy value
clear fce/picked
fce/sld/data: 0 ; resets slider position
fce/sn: 0 ; resets display position
fce/line-list: none
fce/sld/redrag fce/lc / max 1 length? head fce/lines ;resets slider size
show fce
]
[3/12] from: reboler:programmer at: 4-Mar-2002 14:50
Try the following function:
ell-list: func [
"changes data in 'text-list and resets everything. usage: tell-list text-list-face new-data"
fce value
][
append clear fce/data copy value
clear fce/picked
fce/sld/data: 0 ; resets slider position
fce/sn: 0 ; resets display position
fce/line-list: none
fce/sld/redrag fce/lc / max 1 length? head fce/lines ;resets slider size
show fce
]
[4/12] from: reboler:programmer at: 4-Mar-2002 14:58
p.s. You will also find it easier to use a 'list, if you want to display more than one
"column" of data (g-lname/text g-fname/text). 'text-lists only display one "column"
of data.
You could create a new list from the found data by 'joining the corresponding entries,
and appending them to a new list.
[5/12] from: carl:cybercraft at: 5-Mar-2002 12:18
On 05-Mar-02, Jim Richards wrote:
> Any help would be appreciated. I have been playing around with
> developing a data entry and retrieval system and I am having trouble
> with the text-list display with the find function. The find function
> itself works great but I can't figure out how to display the found
> records.
Are you trying to display just the records found, or highlight the
found ones amongst all the records in a text-list? (I couldn't get
your script to run.) If the former, change 'lines...
show-lines: func [blk][
t-list/lines: blk
show t-list
]
view layout [
t-list: text-list "Cat" "Rat" "Horse" "Dog"
button "Cat" [show-lines ["cat"]]
button "Cat & Rat" [show-lines ["Cat" "Rat"]]
button "Rat & Dog" [show-lines ["Rat" "Dog"]]
]
and if the later, use 'picked...
show-picked: func [blk][
clear t-list/picked
append t-list/picked blk
show t-list
]
view layout [
t-list: text-list "Cat" "Rat" "Horse" "Dog"
button "Cat" [show-picked ["cat"]]
button "Cat & Rat" [show-picked ["Cat" "Rat"]]
button "Rat & Dog" [show-picked ["Rat" "Dog"]]
]
That's the basic way, anyway, though it doesn't update the slider,
which Alan's post does, and hence is more useful. (:
--
Carl Read
[6/12] from: g:santilli:tiscalinet:it at: 5-Mar-2002 11:35
Hi Jim,
On Monday, March 04, 2002, 7:37:05 PM, you wrote:
JR> Any help would be appreciated. I have been playing around
JR> with developing a data entry and retrieval system and I am having
JR> trouble with the text-list display with the find function. The find
JR> function itself works great but I can't figure out how to display the found records.
I'll take the opportunity to make an announcement. :) I don't know
if I will be able to finish and release it in the way I'd like to,
but I'm developing a sort of IDE for "data base" applications. It
is currently done 50%, but it can already save 80% of your work
when developing form-based applications. Currently it is able to
automatically layout forms and data browser; I think I'll be able
to slap in a QBE module too (I have it working but it is not
modularized yet and cannot be fit into the whole thing). It is
completely asynchronous and you can open multiple views on a
table/result set and have them updated almost automagically. But
the most interesting thing is that you don't have to mess with the
List style as that is handled by the "wizard" (it uses a
multi-columnar multi-selection list with both vertical and
horizontal scrollers).
I think I can give a release date for about June. (This is because
I have a lot of things going on and the advancement of this
project depends 90% on them.)
Why am I making this announcement? First, because every now and
then there's people asking "what's people doing?". :) Second,
because I have a question for you REBOLs.
What kind of license should I release it on?
* Commercial only. (Personal, non-profit use could be free of
charge - so that people can evaluate it and learn how to use it
before doing real work.)
* GPL. You'll have to release your work with the GPL too, or
you'll need to get a commercial license from me.
(Please don't ask for alphas/betas now, I don't want to release it
unfinished, and there are too much things to decide yet.)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[7/12] from: greggirwin:mindspring at: 5-Mar-2002 9:21
Hi Gabriele,
<< What kind of license should I release it on? >>
I've been thinking about the same thing, even for little tools and scripts.
There are a number of licenses listed at opensource.org. I think the "free
for non-commercial use" and charging for commercial use is a good approach.
--Gregg
[8/12] from: robbo1mark:aol at: 5-Mar-2002 14:35
Hello Gabriele / Gregg
Do you reasonably expect to be able to make money
from the commercial use of your REBOL scripts?
If you do think so and there is an identifiable market
for your "product" that will pay your asking price
or demand driven price(s) - volume pricing & all that - then if you don't want to penalize
the non-commercial hobbyist then use a "free for non-commercial use" license and charge
"commercial" users the appropriate fee.
Alternatively if you want your scripts to be able to be used in a commercial products
as well as free software then the BSD style licenses allow for this without necessitating
all future works be "open source".
If you want to ensure that nobody can unfairly take your work and build it into their
own proprietary product and unfairly benefit from it then the GPL is your best bet as
it is quite strict regarding it's terms of usage and compliance requirements.
This is aside from the "ethical" issues of proprietary software.
If you just want your software to be USED as much as possible then explicitly make it
PUBLIC DOMAIN then anybody is free do whatever they will with it.
Whilst I personally agree with the goals and means of the GPL to protect and advance
"free software" within the current legislative climate my prefernce is for public domain
as this removes the need & cost of ensuring license compliance.
How do you really ensure absolute global compliance with the terms of whichever license
you choose to use without having to resort to severely restrictive methods which border
on totalitarian?
The answer is of course you can't, it is impossible!
Even more so with binary only proprietary software because in that instance it is even
harder to discover if somebody is unfairly stealing your work.
Without trusting the honesty of people to comply with your license and use the software
under your chosen terms you have to accept that there will always be people who will
disregard your terms at best or blatantly abuse and steal from you at worst, whichever
license & terms you decide upon.
Do you really want the hassles of litigation & all the costs of trying to enforce compliance
or prove non-compliance with your license terms? this costs time and / or money (lots!)
and / or placing restrictions and burdens on your users.
Also how do you define "free for non-commercial use"?
What about the small guy working from home who just happens to love REBOL and see's the
benefit of using it to help him along in his business, there are loads of potential ambiguities
here.
Given the precarious nature of software patents, copyrights and other intellectual "property"
laws inherent within the software industry I can see why we have software licensesto
"protect" developers or to ensure the "freedoms" or "restrictons" upon users
but from my perspective for small developers / hobbyists if you release software whether
it be in binary or source form the easiest choice is just to make it PUBLIC DOMAIN.
This is the least cost, least hassle solution.
This doesn't answer of course how to make money selling REBOL scripts.
It's just my opinion but I think it is easier to make money from customers / business
enterprises & other organisations by incorporating REBOL as a technology which you use
to provide a SOLUTION or SERVICE offering rather than as "shrink wrapped in a box" software
product. I think RT Inc. make this mistake when they try to get people to buy / license
their non-free interpreters like /View/Pro & /Command etc.
Paul Graham at http://www.paulgraham.com talks about how his company used LISP, with
it's benefits in terms of lower development costs and the quicker development / testing
/ debugging cycle to produce high quality internet capable software as part of a SERVICE
/ SOLUTION offering for online shopping stores.
He found his market niche it is up to us / those who would wish to be able to make a
living using & developing in REBOL to find ours.
I certainly don't think anybody outside RT Inc. is going to be able to sell a REBOL "boxed"
software application except perhaps in certain specialist areas, definitely not across
the current spectrum of typical user applications there's just to much other competition
ranging from Microsoft to all the free software at places like freshmeat & tucows etc.
The best way for us advance the possibility to be able to earn a crust from REBOL is
by stressing it's benefits and getting it used inside enterprises and large and small
organisations so that there becomes a viable "job market" for REBOL programmers like
there currently is for JAVA & PERL.
One way to achieve this would be for REBOL Technologies Inc to remove some of the current
restrictions on the "commercial" use of REBOL Interpreters, we would then be free to
promote it's usage into our work places and enterprises.
Also more practical examples of the cross platform nature of REBOL and it's ability to
interface and manipulate LEGACY data as well as all the new whizz-bang XML / SOAP / WEB
data AND stressing REBOL's ability to do all this across the network / internet would
do no harm at all.
We need to encourage and develop more "success" stories of the practical applications
of REBOL in the real world of IT rather than fantasising about how great it's all going
to be in the REBOL/IOS & MS.NET X-INTERNET world of tomorrow. This rosy future is where
we all work and play via the web & internet is great / crap depending on your viewpoint
but it doesn't address the practical realities of today.
For REBOL to work we need to put it to practical use and publicise this loudly and show
the world how easy using REBOL can be and the benefits to bederived from this. More XML
/ TEXT / DATA / NUMERIC processing examples, more WEB-Agents & Email ROBOT's & SPIDERS,
more use of REBOL in science & schools & education and the not forgetting the lesser
developed economies in the world, not everybody can afford to pay western prices for
their computer upgrades and software.
We need more than just some pretty picture examples of REBOL/View.
PRACTICAL Real life examples and applications of REBOL as a technology to provide lower
cost or technically superior solutions to problems is what will SELL REBOL as a useful
technology to the outside world.
To become the "better means of expression" and "Universal Internet Messaging Language"
we need to use and promote REBOL more and RT can help us by restricting REBOL less. So
what if The Bank of America want to install REBOL on a hundred thousand desktops & servers,
let them go ahead and do it for "FREE".
Somebody has got to maintain & development software for them and most organisations are
willing to pay people for that. That creates a market and a demand for REBOL as a technology
and people with REBOL skills.
Trying to write some code and sell it only pitches you into the market with every other
commercial software developer out there and with all the same competition and pitfalls
of trying to compete against established industry giants who can kill you or your financial
revenues if they have to, to protect their position. Just think Netscape and browsers.
The lucky ones get bought out.
Programming is a skill which people will pay you for to either develop or maintain software
for them.
Programming languages can be used to create programs and services which are of "UTILITY"
to people and should help provide solutions for their needs.
Programs and programming languages are NOT an end in themselves except in an intellectual
way for developers / academics / hobbyists, they are only one tool in part of a greater
toolset that people need and use to get REAL work or activites achieved in their REAL
lives.
Trying to sell or license software solely as a product is problematic, and the smaller
the developer the greater and harder the challenges are and that's why,
to get back to my original point, it's probably best that once you release it you accept
it's in the public domain and treat it as such.
Trying to promote your software toolkit and services as part of a bigger or overall more
comprehensive solutions package is an easier way of trying to make a living than betting
on the revenues from software products or "reblets". Micropayments and a futurist fantasy
for just now anyway.
Sorry for my long ramblings.
Mark Dickson
In a message dated Tue, 5 Mar 2002 11:13:59 AM Eastern Standard Time, "Gregg Irwin" <[greggirwin--mindspring--com]>
writes:
[9/12] from: ryanc:iesco-dms at: 5-Mar-2002 12:15
Vey well put Mark! Thanks for the info on licenses. Suprisingly, it seems to me that
you and RT might share some ideology.
--Ryan
[Robbo1Mark--aol--com] wrote:
[10/12] from: g::santilli::tiscalinet::it at: 6-Mar-2002 11:34
Hi Robbo1Mark,
On Tuesday, March 05, 2002, 8:35:23 PM, you wrote:
Rac> Do you reasonably expect to be able to make money
Rac> from the commercial use of your REBOL scripts?
Not in this particular case, actually. Well, maybe people will
find it useful and will pay for it, but it has been developed for
my own use and not to make money. I will make money from the
programs I'll write using it.
Rac> If you want to ensure that nobody can unfairly take your work
Rac> and build it into their own proprietary product and unfairly
Rac> benefit from it then the GPL is your best bet as it is quite strict
Rac> regarding it's terms of usage and compliance requirements.
This is why I thought of GPL.
Rac> If you just want your software to be USED as much as possible
Rac> then explicitly make it PUBLIC DOMAIN then anybody is free do
Rac> whatever they will with it.
The thing is, I started developing it for two reasons:
- I write a lot of "data base" programs, so writing them from
scratch each time would be a pain.
- This way I have an advantage over competition, because I can
write customized products at almost the price of off-the-shelf
ones. I.e. people can have the final program to be exactly as they
wish, but they won't need to pay too much more for it.
If I release it as PD, the second reason vanishes: a competitor
could pick my tools and do the same as me.
Rac> Whilst I personally agree with the goals and means of the GPL
Rac> to protect and advance "free software" within the current legislative
Rac> climate my prefernce is for public domain as this removes the
Rac> need & cost of ensuring license compliance.
I agree, but see above. I have to show people that there's an
advantage in using REBOL wrt VB or Delphi etc. If not, I won't be
able to use REBOL.
Rac> How do you really ensure absolute global compliance with the terms
Of course you can't! But I can then sue a competitor stealing my
work. (Not that I think this will ever happen, but who knows.)
(I'm referring to "local" competitors; I'm not selling my programs
across the world currently, but mainly to local companies etc.)
Rac> Also how do you define "free for non-commercial use"?
In may case, it is very simple. If you write a REBOL script and it
requires my script to work, then you cannot sell or distribute it
without having a license to do so. (I have to decide the
details... and I'll be happy to give even free-of-charge licenses
to the great people on this list.)
Rac> What about the small guy working from home who just happens to love
Rac> REBOL and see's the benefit of using it to help him along in his business,
Rac> there are loads of potential ambiguities here.
Yes. Then you contact me and ask. I'm not aiming to become rich
with this. I just want to protect myself.
Rac> It's just my opinion but I think it is easier to make money
Rac> from customers / business enterprises & other organisations
Exactly what I want to do. But to be able to do so using REBOL I
have to show it's really better.
Rac> I certainly don't think anybody outside RT Inc. is going to be able to sell a
Rac> REBOL "boxed" software application except perhaps in certain specialist areas,
Rac> definitely not across the current
Rac> spectrum of typical user applications there's just to much other competition
Rac> ranging from Microsoft to all the free software at places like freshmeat & tucows
etc.
Imagine you have a small company. You are not a computer expert,
so even if Access or Excel could solve your problems you are not
able to do it. You need some tools to make your work easier; they
will be very useful to you if they work exactly as you want them
to; they won't be useful to anyone else.
Here I come and provide you a solution. Of course, I have
competition, as you say, so I must prove my solution to be better;
in this case, I cannot demo the solution prior to actually doing
it, so the only "better" here regards to price and time. If can
can offer a competitive price and finish the product in less time
my solution is "better"; then, when you have used it, you can even
appreciate other benefits wrt other solutions (i.e. if it is
smaller, faster, simpler, etc.), and come back to me when you want
other things to be done.
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r
[11/12] from: koopmans:itr:ing:nl at: 6-Mar-2002 14:32
Hi Gabriele,
If you want to protect yourself, ask a fee for commercial use, like RT does.
This is acceptable for most people, as they already pay to much to develop in
other environments.
Another option may be to keep it to yourself, and convince people to use
REBOL based on other grounds, or free software from other people in REBOL.
With you favourite broker as an example ;-)
I hope to be able to provide a good reason for everybody the next few months.
P2P, interesting.... very interesting....
--Maarten
[12/12] from: robbo1mark:aol at: 6-Mar-2002 8:45
Gabrielle,
Business Management & Economics is what I qualified in
at degree level at University so all this appeals to me.
It seems to me that you are doing that which I discussed
in my previous post and using your REBOL skills as a
vital component part in your overall customised business
solution offering to your customers.
They have a genuine business need or "problem" and you
apply your REBOL & programming skills to provide a
solution.
What you are offering is YOUR skills and knowledge
to develop & provide a "customised" solution for your
clients. Your business is a SERVICE product not a
boxed GOODS product. This is an important distinction.
Sure the software components you've developed are a very
valuable part of providing your solution and offer you
an advantage in terms of re-usable code and lowering your
development costs and speeding up your development times.
However your business does NOT appear to be based on selling
this software as a product rather it is merely a component
tool you use to your advantage.
With regards to licensing, the point I was trying to make
about choosing ANY license is that ALL licenses have not
insignificant costs in terms of YOUR time and money if you
wish to ensure proper license compliance.
Being a Small Developer you may also find that the client
might want a say in the terms of Software License which will
apply to the software and services they are paying you for.
They may demand source code availability as terms of the
contract to protect their investment and future interests
should anything bad happen or if you can or won't support
the product any longer. Admittedly not ALL clients are this
enlightened. However the main point is that the terms of
a contract are a TWO way thing to be negotiated and agreed,
he who pays the piper calls the tune & all that.
Lets assume a scenario here.
Firstly you package a REBOL database development solution
and distribute it in a binary format using REBOL/ENCAP having
come to some agreement with RT Inc. about per user royalties.
You make it freely available to the list members here and any
body else who wants it on a "free for non commercial use" license.
The terms of your license also state that to incorporate this
into a commercial product or for use in commercial organisations
having to make a certain payment or agree suitable terms with
yourself.
It's a good product, people like it and find it very useful and
start to use it to develop their own solutions to their own
problems. DO THEY SEND YOU THE MONEY or RECOMPENSE that the terms
of your license say you are due? Some people are honest and fair
and will send you money and all's well and good.
But not everybody will. What is to stop me or anybody else blatantly
disregarding your license and doing whatever one likes with the software.
I live in Scotland, You live in Italy, I could have it installed in
ten thousand machines, how would you stop me? How would you even know?
Now In no way am I saying that any of this is moral or ethical but it
does happen. Do you really want the costs in terms of time and money
and burden of proof in persuing this?
So I've got your software installed on a shed load of machines here
and in priciple Iam due you some form of payment, but YOU don't even
know about this and you are continuing with your business and providing
your customised solutions to your customers in your locality, you are
making a good living and are happy with the success of your business.
ARE YOU MATERIALLY AFFECTED? Does this detract from what you are doing?
Does this prevent you from being successful in your area?
ALL your license has achieved is in placing a legal "restriction" on
your software, it hasn't helped YOU in anyway. It doesn't directly
make your business anymore succesful it just creates potentially
illegitimate
activities by others, who most likely would never
have paid your costs anyway which presumably must have been prohibitive
to them hence they seek a lower cost solution by fair means or foul.
Iam not saying this is right Iam merely stating facts.
If you don't want DIRECT competition from people using your tools
to provide a similar solution then don't release your software.
keep it as an inhouse development tool. Trying to Compete is hard
enough without having to worry and try to discover and prove that
your competitors are using YOUR tools unfairly or to your
disadvantage.
Alternatively if you see distributing your REBOL Database Development
product as enhancing the overall market for YOUR skills and solutions
and will increase your earning capacity then I'd advise doing this on
as liberal terms as possible to ensure that your software gets optimal
spread and use.
There are three choices here.
PUBLIC DOMAIN - any one can do anything they want with it.
Upside: This is the least "restrictive" option and should provide the
maximum opportunity for your software getting used. No cost of trying
to ensure license compliance.
Downside: People could take & improve your software and compete directly
against you without you getting anything in return.
BSD Style Licenses - initial product is open source but people can
use to develop and build proprietary solutions on top.
Upside: This enables your software to be used in commercial products
as well as in free / open source software projects. Only marginally
more restrictive than public domain.
Downside: People could take & improve your software and compete directly
against you without you getting anything in return. Costs of trying to
ensure license compliance.
GPL - This product is Free Software and any software which uses it
must also be distributed in accordance with GPL or LGPL.
Upside: Offers Maximum protection from people using your work without
giving anything back in return. They have to GPL any improvements they
make. You Will likely recieve strong support from the free and open
source software community in any cases of license abuse.
Downside: People could take & improve your software and compete directly
against you. Costs of trying to ensure license compliance. May prevent
your software from being used in a commercial product or environment.
With any other commercial license (including free for non commercial)
you have inherent restrictions on the use of your software as well as
the costs of trying to ensure license compliance and discovering about
and deciding what is and what isn't deemed suitable as commercial use.
If your product is being used in the widest possible way under the
least restrictive of terms then for a small developer like yourself
I would say this is the maximum benefit / least cost & least hassle
scenario. This also is the best way to maximise your market potential.
There will always be various forms of competition but who knows your
toolset and your software and the best way to use it better than you?
You created it, you know it's strengths & weaknesses and capabilities
better than anyone. You really understand it and it's limitations.
This really gives you a headstart on any of your direct competitors.
THIS IS YOUR COMPETITIVE ADVANTAGE.
The point about Delphi or Visual Basic is not really relevant because
any vendor in any business has to SELL the utility and value of their
own product offering in relation to their competitors. If REBOL is part
of your solution and toolset then it has to stand on it's own merits
and provide tangible advantages in relation to Delphi or VB or anything
else otherwise you should be using something better.
Even if nobody else uses REBOL or your database software it doesn't
matter. YOU use it and it works for YOU. It helps provide you
with a core competence and certain competitive advantages, that in
itself is enough. If REBOL benefits you then that is all the
justification you need for using it.
If you think other people would benefit from studying or using what
you've created and you consider there is little direct downside
in you releasing it to the outside world then I suggest you either
make it public domain or use GPL or BSD licenses.
If you really think you can sell it and make money then from a
commercial viewpoint stick whatever license you want on it, good luck
and deal with whatever problems regarding due payment and piracy
and getting your software used that every other commercial software
developer faces.
I will leave aside the ethical and moral questions about whether
you should be able to study the source code and improve / modify
and ditribute the software you can buy or download. that is a different
but none the less important philosophical & economic argument.
Good luck with whatever you decide to do.
cheers,
Mark Dickson
In a message dated Wed, 6 Mar 2002 8:38:25 AM Eastern Standard Time, Maarten Koopmans
<[koopmans--itr--ing--nl]> writes: