1. Why no post in Stackoverflow.com

I have recently started using OpenEuphoria and I am finding it very interesting. However, I could not find any question on Euphoria or OpenEuphoria on Stackoverflow, which is a very active site for programming related topics. This seemed surprising since OpenEuphoria appears to be very well developed now. I posted a question there but there was no response: https://stackoverflow.com/questions/44353495/reading-a-text-file-line-by-line-in-euphoria . I will be interested to know others' views on this.

new topic     » topic index » view message » categorize

2. Re: Why no post in Stackoverflow.com

rneu said...

I have recently started using OpenEuphoria and I am finding it very interesting. However, I could not find any question on Euphoria or OpenEuphoria on Stackoverflow, which is a very active site for programming related topics. This seemed surprising since OpenEuphoria appears to be very well developed now. I posted a question there but there was no response: https://stackoverflow.com/questions/44353495/reading-a-text-file-line-by-line-in-euphoria . I will be interested to know others' views on this.

from stackoverflow

I am trying to read a simple csv (comma separated text file) using Euphoria langauge:  
#! /usr/bin/eui 
 
include get.e 
 
integer file_id = open("myfile.csv","r") 
if file_id != -1 then 
    sequence input_data = gets(file_id) 
    while sequence(input_data) do 
        printf(1, "The string read is: %s", {input_data}) 
        input_data = gets(file_id) 
    end while 
end if 
printf(1, "before closing..\n") 
close(file_id) 
printf(1, "after closing..\n") 
 

However, it end with error at the end of the file and never reaches "before closing" statement. type_check failure, input_data is -1

How can I make this detect end of the file so as to end the program normally? I tried checking documentation but could not find it.


Problems in Euphoria simplify down to atom and sequence; if you need both then use the object data-type.

Therefore you want

object input_data = gets(file_id) 

The result is when a line of code is read you are reading a sequence of values. At the end of file the return is an atom, which you use to end the input loop.

If you use the object declaration you can use both data-types at the same time.

You "could" use object for every variable and you program will run. However, it is easier to read code when it is divided into atom and sequence. You can even declare your own data-types based on the default data-types.


The easy way to read a text file is:

include std/io.e 
 
fh = open ( " my_file.txt " , "r" ) 
data = read_file ( fh ) 
close ( fh ) 
 
 
-- data contains the entire contents of ## my_file.txt ## 
 
-- there is also write_file 
 

If you have problems use this Forum. If you don't like the documentation complain to me directly. In the world of Euphoria, RTFM means "redact the fine manual", if it doesn't work we will fix it.


They say: "Stack Overflow has 7.3 million programmers."

I guess they need more programmers!

_tom

new topic     » goto parent     » topic index » view message » categorize

3. Re: Why no post in Stackoverflow.com

In your code you are using

include get.e 

That would be code from the original RDS Euphoria 3.1

So what version of ⵚE are you using?

Euphoria users now include:

  • RDS Euphoria 3.1 {legacy}
  • ⵚpenEuphoria 4.1
  • Phix

_tom

new topic     » goto parent     » topic index » view message » categorize

4. Re: Why no post in Stackoverflow.com

rneu said...

I have recently started using OpenEuphoria and I am finding it very interesting. However, I could not find any question on Euphoria or OpenEuphoria on Stackoverflow, which is a very active site for programming related topics. This seemed surprising since OpenEuphoria appears to be very well developed now. I posted a question there but there was no response: https://stackoverflow.com/questions/44353495/reading-a-text-file-line-by-line-in-euphoria . I will be interested to know others' views on this.

Congratulations on posting the first ever properly-tagged Euphoria question on stackoverflow!

I've taken the liberty of answering it there, as above [object not sequence input_data]

Tom, do you have any thoughts on writing a tag wiki for OpenEuphoria?

Pete

new topic     » goto parent     » topic index » view message » categorize

5. Re: Why no post in Stackoverflow.com

Thank you all for your replies. The code now works.

I am using ⵚpenEuphoria 4.1 .

I still think there should be a good presence of Euphoria on Stackoverflow now.

new topic     » goto parent     » topic index » view message » categorize

6. Re: Why no post in Stackoverflow.com

rneu said...

Thank you all for your replies. The code now works.

I am using ⵚpenEuphoria 4.1 .

I still think there should be a good presence of Euphoria on Stackoverflow now.

Welcome to the Euphoria Languages: Euphoria, ⵚpenEuphoria, and Phix.

Thanks for your observation about Stackoverflow; it is valid and should be addressed.

Sorry, but I'm still trying to catch up on updating the ⵚE docs.

Pete. Yes, we need tag wikis. We will need to work together on this.

We are always short handed here. Here is hoping that you like Euphoria enough that you will be willing to help out.


The wordmark ⵚE is a new gimic I'm trying. It is so new that I haven't got any feedback on it.

_tom

new topic     » goto parent     » topic index » view message » categorize

7. Re: Why no post in Stackoverflow.com

_tom said...

The wordmark ⵚE is a new gimic I'm trying. It is so new that I haven't got any feedback on it.

I think it is not a good idea and it really scares the beginners. As soon as I saw ⵚE, I wondered if this is something too technical or hard-coded. What exactly does it mean? How do I pronounce it? How am I going to type it? Will I need to type Alt-numbers every time or can I copy-paste it? What functionality does it add? IMHO, it is just not in line with 'Simplicity' principle of the language.

new topic     » goto parent     » topic index » view message » categorize

8. Re: Why no post in Stackoverflow.com

rneu said...
_tom said...

The wordmark ⵚE is a new gimic I'm trying. It is so new that I haven't got any feedback on it.

I think it is not a good idea and it really scares the beginners. As soon as I saw ⵚE, it wondered if this is something too technical or hard-coded. What exactly does it mean? How do I pronounce it? How am I going to type it? Will I need to type Alt-numbers every time or can I copy-paste it? What functionality does it add? IMHO, it is just not in line with 'Simplicity' principle of the language.

I didn't find this sign in Windows character table which is already huge in size. Maybe Π(Latin capital ligature OE) would be easier to type (Alt+0140).

Jean-Marc

new topic     » goto parent     » topic index » view message » categorize

9. Re: Why no post in Stackoverflow.com

Personally, I wouldn't bother, because of stackoverflow's poor reputation.

I won't enumerate the reasons for that poor reputation, a Google search will suffice.

If we do post Eu questions on stackoverflow, we can expect that Google searches for OpenEuphoria will soon be filled with negative, uninformed, and troll answers. That isn't going to help Eu's reputation.

"All publicity is good if it is intelligent." - Atlanta Constitution, January 1915

Note the 'intelligent' part :)

new topic     » goto parent     » topic index » view message » categorize

10. Re: Why no post in Stackoverflow.com

Either of

"\xE2\xB5\x9A"&"E" 
"\u2D5A"&"E" 

should work. (tested on Phix, using MessageBoxW anyway)

Pete

new topic     » goto parent     » topic index » view message » categorize

11. Re: Why no post in Stackoverflow.com

  • Stack Overflow
irv said...

I won't enumerate the reasons for that poor reputation, a Google search will suffice.

A quick search reveals that SO (stackoverflow) has its problems.

I certainly don't have time to hang out at SO, collect points, and frustrate myself.

  • Tag Wiki at SO
pete said...

Tom, do you have any thoughts on writing a tag wiki for OpenEuphoria?

Can we write a tag that essentially redirects a user to our Forum?

It looks like in six months tags get auto-deleted if not used much. Will a "Euphoria" tag survive?

  • End of ⵚE
rneu said...

I think it is not a good idea and it really scares the beginners.

That is enough to kill the ⵚE wordmark.

_tom

new topic     » goto parent     » topic index » view message » categorize

12. Re: Why no post in Stackoverflow.com

_tom said...

The easy way to read a text file is:

include std/io.e 
 
fh = open ( " my_file.txt " , "r" ) 
data = read_file ( fh ) 
close ( fh ) 
 
-- data contains the entire contents of ## my_file.txt ## 
-- there is also write_file 

Thanks for this most convenient method.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu