LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-02-2004, 01:59 PM   #1
Stranger
Member
 
Registered: Feb 2004
Posts: 38

Rep: Reputation: 15
Rich Text Widget/Database Front End


I have a pet project for which I'd like to find a database front end with an available formatted-text widget. Unfortunately, I can't seem to find such utility in a GPLed or low-end system. (OpenOffice does plan to implement such a beast when they break out the standalone database application in version 2.0, due out in November.) I don't much like XML, but it seems to have the best features for the task.

I've looked at Rekall and Knoda and wondered how easily I might script the widget in Python for use with either front end. I haven't played much with Python, so I hoped to find some example code that I could study. A search hasn't yielded much of anything relevant.

I looked at Scintilla, but I haven't found any examples that use it for text formatting for anything other than syntax highlighting, eg. PyEditor. Also, I don't recall seeing any examples utilizing XML for persistence..

I did find a few in-place, through-the-web editors, including Bitflux. Though I don't plan to use a browser-based solution, I considered what I might learn from looking at them. The Bitflux demo complained that my version of Mozilla (1.7.3) has known bugs in its XML streamer, which led me to cross it off the list of possibly useful specimens, since I presume that it relies on the browser's API for parsing and persistence-though I haven't looked at the code.

I also came across Vex (http://vex.sourceforge.net/screenshots.html), which at first glance appears to have the features that I want in a WYSIWYG XML editor. The author(s) wrote it in Java, with which I have more experience. However, this leaves me without a database front end written in Java.

I've looked high and low. I just wonder if I haven't looked in the right places. Has anyone seen a decent Java-based, database front end which might be suitable for this kind of extension? Otherwise, does anyone know of a full-featured, Python-based, rich-text editor or word processor that I could study?

Thanks in advance.
 
Old 10-02-2004, 06:13 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
QT has both database support and RTF entry fields,
and designer as a development tool ... :)


Cheers,
Tink
 
Old 10-03-2004, 03:59 AM   #3
Stranger
Member
 
Registered: Feb 2004
Posts: 38

Original Poster
Rep: Reputation: 15
Thanks for the suggestion, Tinkster. I had hoped for a less piecemeal solution. Digging into the internals of a large C++-based API such as QT to build a database front end nearly from scratch would entail quite a large undertaking. With all of the code floating about the web, such a strategy for an intermediate solution sounds like overkill, especially when we have such nearly complete projects as Rekall and other soon-to-be-available utilities such as the aforementioned OpenOffice database access application. By the way, the specifictation for the proposed Rich Text Control of the database project reveals that it won't bind to database fields in the initial release, which brings to question any reason for its inclusion in the release (in my understanding of the language used), so I don't intend to hold my breath waiting for it to come out. Of course, I realize that OpenOffice already has a database access utility, but I've read horror stories about the complexity involved in its configuration. I've also noticed the dearth of documentation about the tool.

I suggested a Python- or Java-based approach because these newer languages have features which lend to more rapid prototyping. I managed to cobble together part of an image browser in Java, including a fairly well-designed directory tree component, in a fraction of the time in which I could have done it with C or C++. In fact, through years of tinkering with C and C++ I have developed quite a distaste for those older languages.

It truly surprises me that with all of the open-sourced projects I'd have any trouble finding examples of a PyGTK-based formatted text widget or XML editor widget. I mention a PyGTK-based example because Rekall scripts use PyGTK widgets, which suggests that other PyGTK-based widgets would fit more easily into scripts for the Rekall front end, and I suggest Rekall due to its apparent completeness and readiness for use. If I could cobble together a script to bind an XML editor widget to a database field-and I could do this if I had more knowledge about the involved systems-I'd have what I need.

I see all of the pieces to the puzzle out there. They already exist. I just haven't discovered any obvious ways to put them together, due to poor documentation and lack of examples. Even the available source code I've seen hasn't offered any obvious solutions, due to either poor design or poor coding style.

My pet project involves reinventing a different wheel. Of course, I like to think of it as building a better mousetrap. At the risk of sounding crazy, I'll summarize my ideas.

I've grown weary of wresting with formal programming languages and plain text editors. All programming languages that I've encountered have basically the same major flaws, which put the burden on the programmer instead of on the computer, where it belongs. Even newer languages, such as Java, Python, etc., continue to incorporate these flaws. Nowadays, our computers have enough processing power that we can start to shift the burden.

What specific flaws do I see?

The first one I'd like to mention involves the second of my two aforementioned peeves, the plain text editor. How long have we had applications and standards for formatted text? Why do we still use plain text editors for writing code? I've spent too much time editing comments when changes in comments fouled the right margins. I've spent too much time dinking around with indentation when changes introduced new scopes. I've spent too much time trying to identify which files contains specific constructs. Even the new-fangled IDEs, for old and new languages alike, fail miserably in functionality and usability.

What do I see as a solution? Using formatted text would solve half of the problem. Indentation tags would allow proper layout with word wrapping. Changes to the code which add or delete a scope would only entail the click of a button or a CTRL-key sequence to increase or decrease the indentation. You could still have your syntax highlighting. You could also make changes to the layout to highlight specific constructs or to make the code more readable. Want to change the appearance of specific items throughout the entire project? Change a global stylesheet. You could comment portions of code by simply changing the tag applied to it (with a simple click of a button or key combination), and whereas you could have visual cues as a result of the styles applied to the tag (eg., italics, font size, etc.), you wouldn't have to add line noise with // or /*...*/ or # or ; or any of the other symbols that different languages have used to delineate comments.

I see another method to improve code-related information management. Putting code in a database would offer many advantages and possiblities. (Before anyone suggests it, I'm aware that such systems do exist, e.g. Suneido, etc.) A database of code would simplify browsing that code. A database of code would allow you more choices involving how you wanted to view it without making any changes to the code. A database of code would increase the available options for querying that code. Surely you can envision other advantages and possibilities.

Alright, we have tables of formatted text, which will address some problems related to information management and productivity. With that out of the way, let's address the flaws of existing programming language. First, what do we see as flaws?

The syntaxes of most languages impede productivity. For example, look at any C++ or Java class definition, and you'll see the following:

class ....
int ...
void ...
int ....
int ....
void ....

In Java, it gets even worse, as illustrated by the following:

public class ...
private int ...
public void ...
int ...
protected int ...
public void ...

Of course, I omitted the names to exaggerate my point. For some reason, the language designers decided that the type and the visibility should appear first. This syntax hides the attribute that conveys the most information to the programmer, the most unique attribute of an element: its name. Even the javadoc utility gets this backwards. When you look up a word in a dictionary or a glossary, do you search for the word by its part of speech? Do you search for it by its definition? (Though this might be useful sometimes, it's the exception rather than the rule.) NO! You look for the word! Otherwise our dictionaries would list entries by part of speech or by definition. Why would the syntax of a programming language define it the other way around? Mathematical convention? I can't think of any other possible reason.

Sure we have tools and IDEs that will extract the information for you and give you a list or a tree with the names sorted any which way. Sure, when you want to see the definition of a function, you can use your editor to search an open file for the name of the function. But when you click on the tree node or when you hit CTRL-F and type in the name you want to find and your tool takes you to the function definition, you still face this ugly wart in your code. What if you want to use grep to recursively search a directory tree for the definition of the symbol? For each line that grep returns, you'll have to scan past the beginning of the line to find the name.

This "convention" obscures information, and it's simply backwards. After all, what is source code but a dictionary of terms and their definitions? Why shouldn't the syntax of a programming language reflect this basic fact?

Almost every time I look at someone else's code, it amazes me how difficult it is to read, partly due to sloppy naming conventions and the mixture of sloppy naming conventions in separate APIs, but mostly due to problems in the language design which encourage and even demand these ugly naming conventions. Most programming languages force you to give a name to every element. Most programming languages prohibit delimiting compound names with spaces. Many programming languages use case-sensitivity, which also makes code more difficult to read and more difficult to type.

This only begins to describe the flaws I have noticed. Natural language... Don't get me started. I've ranted long enough for tonight.

Of course, some of these issues have been the topic of many language wars. Let's not go there. I merely wanted to identify some issues that I plan to address with a new programming language to hopefully make programming a more productive endeavor.

Now, I need some tools to achieve these aims. As I mentioned, it completely surprises me that I haven't found any open source projects that will fit my needs out of the box. Thus, I realize that I'll have to put some of the tools together myself. I can reinvent part of the wheel, but I can't do it from scratch, especially when I intend to reinvent a whole other wheel. I can't afford to reinvent too many wheels. Nobody lives forever.

Last edited by Stranger; 10-03-2004 at 04:37 AM.
 
Old 10-03-2004, 01:47 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
I see a flaw in your attitude :)

If you don't like the OS projects (or their features)
their several ways for you to go ...

a) Buy JBuilder Enterprise.
b) Enhance existing projects by contributing the
modifications you'd like to see.
c) Since you seem to have a strong dislike for a
lot of features of a lot of languages, just pay someone
else to code for you



Cheers,
Tink
 
Old 10-03-2004, 03:24 PM   #5
Stranger
Member
 
Registered: Feb 2004
Posts: 38

Original Poster
Rep: Reputation: 15
Did I display a bit too much narcissism? I tend to do that. I've tried to repress it, but I have issues.

I have the utmost respect for the developers of open-source projects. I dig having a stable, open operating system, tool chain, desktop and utilities, all optimized specifically for my PC, as much as the source code will allow (Gentoo, thank you), and for which I don't need to shell out wads of cash to a one-eyed, one-horned, flying, purple... err... umm... monstrous corporation. (I did buy the RedHat box, not once but twice, so I'm not that cheap.) I enjoy having the opportunity to dig through all of the source code of open-source projects, even though I see a lot of ugly code. (I'm sure it's beautiful to someone. Parents of ugly children still have to love them. I think it's a law.) I can't really blame the programmers, because we've given them inadequate tools, and nobody has improved them... to my standards. Going through even bad code, especially bad code, fuels my imagination and strengthens my conviction that I must create a better path, for myself, for the generations of computer tinkerers to come and for society at large. (I'm being facetious-at least I amuse myself-I'm not really so altruistic. But I'll bet you already figured that one out.)

a) No way. I gave Borland enough money back in the early to mid 90s, when I bought Borland C++, not once but twice. Then I started throwing money at Microsoft until I realized that I had a problem. I needed to get that monkey off my back. I ran myself into the ground. I live in a van down by the river, don't have a pot to pee in and don't have $3500 to give to Borland for another flawed tool. Of course, I wouldn't dissuade anyone else from going for it. I'm sure it's a pretty tool, and the CD-ROMs would make lovely coasters. And Borland could use the money to keep trying to get it right, even though they'll never actually succeed because they're looking at the problem the wrong way.

b) I'd love to help. I'm here to serve. It's why I exist. However, enhancing existing products would be like putting band-aids on compound fractures. We need to look at these systems as write-only technologies, springboards to our ultimate destinations. We need to use these vehicles as temporary shelters, while we build new foundations and make better wheels, until those wheels can make themselves.

c) I live in a van down by the river... Oh, wait. I already explained that... If these developers could make me lots of money-or at least enough to live a decent living-I'd be happy to toss them a few crumbs.

Cheerio,
Strange

Last edited by Stranger; 10-03-2004 at 04:39 PM.
 
Old 10-03-2004, 06:37 PM   #6
Stranger
Member
 
Registered: Feb 2004
Posts: 38

Original Poster
Rep: Reputation: 15
Doh! I am such a dumbass!

Rekall is a KDE application and thus uses QT, NOT GTK! Rekall has nothing to do with GTK! WTF was I thinking? Perhaps I confused myself when I tried to find a rich text widget and found some GTK-based solutions.

In any case, we'll just blame it on the proactive interference. I even have a doctor's note. See!

Furthermore, grepping for QT in the Rekall documentation tree led me to Chapter 05, and in Chapter 05, in a table listing available controls, I spotted... What else? You guessed it. "Rich Text."

I am so embarrassed. See, look. My ass is completely bare. Woohoo! (kidding)

Thank you, Tink, for showing me the error of my ways. (I must stop talking to myself.)

Now, I'll have to actually run Rekall and see if it is at all useful to me. Then I'll need to check some things regarding...

But first, I need sleep. Yes. Sleep is good.

Quote:
Now, come, Pinky. We must prepare for tomorrow night.

Pinky: Why, Brain? What are we going to do tomorrow night?

The same thing we do every night, Pinky... Try to take over the world.

They're Pinky and The Brain, Brain, Brain, Brain....


NARF!

(Pinky and the Brain and all related characters and elements are trademarks of and © Warner Bros. Entertainment Inc. 2004. Tax, tags and title not included. Check with your local dealer for current prices and listings. Void where prohibited.)

Last edited by Stranger; 10-03-2004 at 07:24 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Front End Advice Please thadco Programming 2 06-21-2005 04:02 AM
no rich text formatting bar in Mozilla marsguy Linux - Software 2 04-29-2005 01:33 AM
How to view Rich Text Format documents edwal Linux - Newbie 1 04-06-2005 02:16 PM
Front- End for Qmail Koven Linux - Software 1 03-09-2005 02:56 PM
after a web front end acid_kewpie Linux - Networking 1 08-15-2002 05:51 PM


All times are GMT -5. The time now is 06:47 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration