The time now is Fri 20 Apr 2018, 16:34
All times are UTC - 4 |
Author |
Message |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15238 Location: Paradox Realm
|
Posted: Tue 17 Mar 2009, 00:27 Post subject:
|
|
MU wrote: | Lobster, be certain to activate "view - bottom view".
That displays the internal console, where the messages from your program are printed.
|
Thank goodness there are smart people guiding the idiot cructaceans . . .
That did it
Works fine
_________________ YinYana AI Buddhism
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15238 Location: Paradox Realm
|
Posted: Tue 17 Mar 2009, 01:14 Post subject:
|
|
Mark are you more inclined to use Vala
because of your java experience?
I am more inclined to Genie . . .
The reason I ask is because if we have a list
of reserved words for Genie that might be a way for the programmers of
Valide to provide some colour coding
and support both languages?
I believe this exists for Vala but not Genie?
_________________ YinYana AI Buddhism
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13648 Location: Karlsruhe, Germany
|
Posted: Tue 17 Mar 2009, 13:02 Post subject:
|
|
No, I like both.
Vala is more like C/Java, Genie like Basic.
I concentrate on vala, because there is more documentation.
So to get startet, I tried vala, then I can try to port the programs to Genie.
Concerning Syntax-highlighting, I think further modifications of the IDE would be required.
I hesitate to mess around in foreign code.
I would suggest, that you contact the author:
http://code.google.com/p/valide/
http://valaide.blogspot.com/
I think it would be better, if you do it, not me.
I already have this "tunnel-view", so would not see requirements for beginners.
So I think you could suggest more "basic" issues, that would have priority at the current state.
---------------------------------------------------
I attach a new example.
This was a "pain in the *", it took a whole day, to find out, how it works.
It is an extended version of the Glade example now written in Genie.
During compilation you get a warning, but you can ignore it.
I added two helper functions, that allow to set values like a buttontext on the Window, that was generated from the gladesample.glade.
If you use other widgets, you had to add corresponding helperfunctions, but they are very simple.
Make a copy of "get_button", and rename "button" to the type of widget, that you need to access.
Unlike C, vala/genie does not allow Widget-conversion.
This will not work:
Code: | GtkWidget *w;
w=glade_xml_get_widget(xml, "button1");
Gtk_button_set_label(GTK_BUTTON(w) , "testtext"); |
This is not possible:
GTK_BUTTON(w)
The new helperfunctions work around that issue.
Mark
Description |
buttons change size and text, if you click on them. |
Filesize |
16.91 KB |
Viewed |
2559 Time(s) |

|
_________________ my recommended links
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15238 Location: Paradox Realm
|
Posted: Wed 18 Mar 2009, 05:18 Post subject:
|
|
Quote: | I already have this "tunnel-view", so would not see requirements for beginners. |
OK I am in a strange place (quite usual for me)
I could not drag .gs files into an editor or open them in a text editor
the only command that worked was
from the terminal . . .
So I am in the process of reinstalling genie
and getting it to work from the command line again . . .
in a new run of Puppy (setting puppy up was easy)
I have no idea what or how I broke things . . .
downloading every stray pet under the sun and
wearing no tin hat might be part of it
Is anyone else playing with genie?
What ya doing?
_________________ YinYana AI Buddhism
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15238 Location: Paradox Realm
|
Posted: Wed 18 Mar 2009, 08:18 Post subject:
|
|
Quote: | I would suggest, that you contact the author: |
Hey Mark
I wrote to the author:
Quote: | Barry Kauler (creator of Puppy Linux) is adopting Vala/Genie
http://puppylinux.com/genie/
and MU one of our top coders is exploring and adapting
Valide to run Genie
Is Genie support and colour syntax coding planned for future valide releases? |
with a link to this forum
and have got 'Geni(e)de' working again
Now to try your GTK example . ..
_________________ YinYana AI Buddhism
|
Back to top
|
|
 |
MUguest
Joined: 09 Dec 2006 Posts: 73
|
Posted: Wed 18 Mar 2009, 10:38 Post subject:
|
|
The examples now also work in Windows.
They require to add some files to a standard Vala installation, and to add options to the compiler.
Everything is here:
http://dotpups.de/puppy4/dotpups/Programming/Vala/Vala-for-Windows/
see "readme.txt" for details.
Mark
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15238 Location: Paradox Realm
|
Posted: Wed 18 Mar 2009, 14:41 Post subject:
|
|
Mark
Vala or Valide is making my system unstable (running 4.2 rc3)
Ideally I would recompile for 4.2 or wait for an update of Vala or use 4.12
The main problem is not being able to edit text files.
They seem to lock.
I may have wait until 4.2 final is released this week
and take it from there . . .
or maybe go straight to woof alpha 3 hopefully with added Vala
It is good to be on the cutting edge but I am being shredded . . .
Hopefully more intrepid programmers will join us soon
_________________ YinYana AI Buddhism
Last edited by Lobster on Thu 19 Mar 2009, 07:46; edited 1 time in total
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13648 Location: Karlsruhe, Germany
|
Posted: Wed 18 Mar 2009, 15:11 Post subject:
|
|
Lob, first thanks for writing to the author.
Second, I'm very surprised, about your issues.
I can not imagine, what causes this, as vala and valaide do not modify anything in the system.
Do your problems remain after a reboot?
When exactly do they begin?
I would compile an example in console.
Then try the IDE.
Mark
_________________ my recommended links
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15238 Location: Paradox Realm
|
Posted: Wed 18 Mar 2009, 22:54 Post subject:
|
|
MU wrote: | Lob, first thanks for writing to the author. |
No problem
This is what Nicolas has written back
Quote: | Hello,
I have planned Genie support for Val(a)IDE.
Currently I work on auto completion, after this I think I will work on
genie support. |
So Genie support is coming.
Quote: | Second, I'm very surprised, about your issues.
I can not imagine, what causes this, as vala and valaide do not modify anything in the system. |
not good.
I install nvidia support
and flash 10 Beta
then Vala
then Valide
Valide is working
but I need to access files
Text editing is basic and I get a lock up
- I can not open .gs as text files
Rebooting does not help
Quote: | Do your problems remain after a reboot?
When exactly do they begin?
I would compile an example in console.
Then try the IDE. |
The problem is Mark
Any level of programming is quite hard for me
Takes a lot of concentration
If the base OS is doing odd stuff
then obviously I become distracted.
Vala and Genie are far too important to let
Lobsterian glitches slow it down.
The difficulties seem to occur when valide is installed
Because it has a file manager this makes me suspect Valide
is taking some liberties.
What I will do is work without it and see what happens.
Need to set up my system again
Puppy has Vala
and valour
Brave Pup
_________________ YinYana AI Buddhism
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15238 Location: Paradox Realm
|
Posted: Fri 20 Mar 2009, 02:02 Post subject:
|
|
Quote: | What I will do is work without it and see what happens. |
What I have done so far is run 4.2 rc3 and not tweaked Deep Thought- run in Icewm etc
I have been running vala/genie from the command line all yesterday without incident
I have simplified my IMT program
and trying different code
So far . . . (does not quite work incidentally)
Code: | // Infinite Monkey Theorem
// Lobster March 2009
// myLine = myLine.concat(myChars[GLib.Random.int_range(0,myChars.length)])
init
a:int
myChars:array of string = {" ", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
myText:string = "i"
myLine:string = ""
i:int = 0
while i<10
a = GLib.Random.int_range(0,27)
if myChars[a] is not "i" do continue
if myChars[a] is not "n" do continue
print("%d",a)
print(myChars[a])
if myChars[a] is "n" do break |
Do you know how to use 'Print' continuously rather than with a line break?
Shadow did it here:
Code: | // myLine = myLine.concat(myChars[GLib.Random.int_range(0,myChars.length)])
|
however that is too hard for me to work out why it works . . .
Anyway just to let you know how I am getting on
_________________ YinYana AI Buddhism
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13648 Location: Karlsruhe, Germany
|
Posted: Fri 20 Mar 2009, 03:59 Post subject:
|
|
Code: | stdout.printf("test")
stdout.printf("test")
stdout.printf("ok\n")
stdout.flush() |
Without "\n", no linefeed is printed.
stdout is printing to a buffer, so you finally in the end have to print a "\n", and you have to "flush" to be sure, it becomes visible.
The long line you mentioned also can be written like this:
Code: | [indent=2]
init
//-- define the random characters --
myChars:array of string = {" ", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
//-- fill the line with a word --
var myLine = "testline"
print ("%s" , myLine)
//-- this is like the long line with print statements included
//-- calculate the allowed random numbers --
var thelength = myChars.length
//-- create a random number --
var randomvalue = Random.int_range(0,thelength)
//-- get a random character --
var randomcharacter = myChars[randomvalue]
print ("%s" , randomcharacter)
//-- add the character to the line --
var alltogether = myLine.concat(randomcharacter)
print ("%s" , alltogether)
|
Notes:
I simplified the code.
Instead of:
Code: | myLine:string = "testline" |
you can use:
Code: | var myLine = "testline" |
And "GLib." can be ommited, as this library is always loaded.
So instead of:
Code: | var randomvalue = GLib.Random.int_range(0,thelength) |
we can use:
Code: | var randomvalue = Random.int_range(0,thelength) |
Mark
_________________ my recommended links
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13648 Location: Karlsruhe, Germany
|
Posted: Fri 20 Mar 2009, 05:24 Post subject:
|
|
I am not certain, what your program shall do, maybe this is working:
Code: | [indent=2]
init
myChars:array of string = {" ", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
var a = 0
while true
a = Random.int_range(0,27)
//print("%d",a)
if myChars[a] is not "i" do
if myChars[a] is not "n" do
stdout.printf("%d%s ",a, myChars[a])
if myChars[a] is "n" do
//stdout.printf("%d%s ",a, myChars[a])
break
stdout.printf("\n")
stdout.flush()
|
It will print random characters.
It will never print "i".
It stops, when "n" is the random character (it will not be printed).
Mark
_________________ my recommended links
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15238 Location: Paradox Realm
|
Posted: Fri 20 Mar 2009, 12:11 Post subject:
|
|
Quote: | I am not certain, what your program shall do, maybe this is working: |
Mark - many thanks for you help
My program is an implementation of the
infinite monkey theorem
http://en.wikipedia.org/wiki/Infinite_monkey_theorem
It randomly creates text and then looks for specific readable text
in this case it is looking for:
in the beginning god created the heaven and earth
A quantum computer would find the whole of the Bible in an instant
What computing power we have presently takes a lot longer . . .
Quote: | The infinite monkey theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type a given text, such as the complete works of William Shakespeare |
. . . anyway gonna look at your code now . . .
Incidentally I am editing from Geany with code set as shell script and the colour coding looks OK
_________________ YinYana AI Buddhism
|
Back to top
|
|
 |
gege2061
Joined: 20 Mar 2009 Posts: 4 Location: France
|
Posted: Fri 20 Mar 2009, 21:07 Post subject:
|
|
MU wrote: | We should inform the developer of the IDE about this thread.
I think it might be pretty motivating to see people using it
Mark |
Yes I have added the support for Genie: http://valaide.blogspot.com/2009/03/genie-support.html
Your feedbacks are welcome!
MU wrote: | Start the IDE again, and open your project.
Now right-click main.vala, and choose "add".
There add "main.gs".
And delete "main.vala" with a rightclick.
It still is listed, as you just renamed it, but it still is shown, as the IDE uses a internal filelist, to manage projects.
At this point, the IDE crashes.
It still is somewhat buggy  |
I have fixed this bug in trunk.
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13648 Location: Karlsruhe, Germany
|
Posted: Sat 21 Mar 2009, 01:53 Post subject:
|
|
fantastique, merci beaucoup
I will compile and package it this evening, must sleep first.
Just wrote my first "real" Genie program
http://www.murga-linux.com/puppy/viewtopic.php?p=286241#286241
We certainly will request more features in future.
I am certain, that Genie/Vala and ValaIDE will become a very important part in Puppylinux.
Mark
_________________ my recommended links
|
Back to top
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|