Forum

• Feb 19
Re: [eiffel-users] Re: AutoTest
Thanks a lot for the shared thoughts, Larry. Best Regards, Rosivaldo. Em 19/02/2019 15:32, Larry Rix escreveu: > I have not put in any serious effort on automated testing, so my > experience does not count for much on that topic. > > The very brief and cursory attempts at creating
• Feb 19
Re: [eiffel-users] Re: AutoTest
I have not put in any serious effort on automated testing, so my experience does not count for much on that topic. The very brief and cursory attempts at creating automated tests did not come with results where I thought I would give it more time and serious effort. My view of the resulting
• Feb 18
Get last inserted ID from Eiffel=>ODBC
Hi all, I was wondering how to get the latest inserted ID subsequent to an insert (execute_update) with ODBC in Eiffel. Found some postgresql answers on my case but what would be a more generic case with ODBC? Thx in advance
• Feb 18
Re: Get last inserted ID from Eiffel=>ODBC
Could be nice @ least to be able to get the result of last update, to be able to parse it... thats the psql console result # INSERT INTO ..... RETURNING id; id ------ 6972 (1 row) On Monday, February 18, 2019 at 5:03:29 PM UTC-3, Gachoud Philippe wrote: > > Hi all, > > I was wondering how
• Feb 18
Re: [eiffel-users] Re: AutoTest
Manu has previously told me that generated tests are no compatible with void-safty. I think this is probably why I included a non_safe.ecf in eiffel_gmp. I used generated tests heavily on that library. Best value insurance policy I know. On Mon, 18 Feb 2019 at 13:59, Rosivaldo Fernandes Alves
• Feb 18
Re: [eiffel-users] AutoTest
Indeed AutoTest works with void-safe projects. Well... for *manual* tests only. Automatic ones fail to be compiled or even to be generated. I have hundreds of tests successfully run under AutoTest but all of them are manually crafted. So the documentation is (fortunately, just) partially true.
• Feb 18
Re: [eiffel-users] Re: AutoTest
Hi, Larry. My experience with void-safe projects has been: OK for manual tests; no luck with automatic ones. The same with you? Best regards. Em 28/12/2018 11:39, Larry Rix escreveu: I have nothing but Void-safe projects and use AutoTest on each of them to prove and fail code as I go. -- You
• Feb 18
Hi, This was a temporary issue, now everything should be back to normal on the downloads side. Thanks for the report. On Mon, Feb 18, 2019 at 2:04 AM wrote: > Hi Folks > I went to grab the 18.07 version of studio for windows (64, msi) and it > started downloading the
• Feb 18
Eiffel: a way to display assertion violation on runtime of executable

As I have the choice on finalizing a project to keep assertions, I'd think that assertion violation would be shown or displayed on console (hopefully on stderr on linux). What would be the proper way to do such, like seems that I have to add it or enable something to get it...

• Feb 18
Hi Folks I went to grab the 18.07 version of studio for windows (64, msi) and it started downloading the solaris tarball. Hovering over the links, it seems that all of the 18.07 downloads point to solaris versions. I gave up and decided to try 18.11, though any time I switch revs, it's an
• Feb 17
Re: [eiffel-users] Calling close on a closed file causes a segmentation fault
Many of those are because of stale W_Code. I find that I must refreeze more often to avoid these issues. Whether it is needful or not, I tend to do a two-step process: Find All Classes & Recompile (Alt-F8) and then Freeze (Ctrl+F7). It is my experience that it handles a vast majority of stale
• Feb 16
Re: [eiffel-users] Calling close on a closed file causes a segmentation fault
On 18.07, I get segfaults regularly because of memory allocation failures.
• Feb 15
Re: [eiffel-users] Calling close on a closed file causes a segmentation fault
https://github.com/EiffelSoftware/EiffelStudio/blob/master/Src/library/base/elks/kernel/file.e The precondition is inherited from IO_MEDIUM. -- Eric Bezault mailto:er...@gobosoft.com http://www.gobosoft.com
• Feb 15
Re: [eiffel-users] Calling close on a closed file causes a segmentation fault
I forgot FILE is not top of the hierarchy.
• Feb 15
Calling close on a closed file causes a segmentation fault
Calling close on a closed file causes a segmentation fault Wondering if anyone else has run into this problem on gcc. I am surprised that I seem to be the first person to have reported it.I figure that if I was not the first then there would already be a precondition on close' "not is_closed"
• Feb 13
Re: Project PF_HP with two targets classic and test
Can somebody please investigate my error in running F_code/finish_freezing: ------------------------- In file included from big_file_C37_c.c:4:0: cu1842.c:10:25: fatal error: eiffel_curl.h: No such file or directory compilation terminated. Makefile:35: recipe for target 'big_file_C37_c.o' failed
• Feb 12
Re: [eiffel-users] Re: 3 small questions
What about: implication alias "implies", implication_unicode alias "⇒" ... with synonyms? Ugly, but that would with the current Eiffel standard. -- Eric Bezault mailto:er...@gobosoft.com http://www.gobosoft.com On 12/02/2019 12:55, 'Alexander Kogtenkov' via Eiffel Users wrote: > The
• Feb 12
Re: [eiffel-users] Re: 3 small questions
A proper meta-model for that would be to consider that 'implies' etc is not just a name alias for 'implication' but instead as the name for an 'operator' which can be used in syntax instead of the function call form. Then, if an operator is an entity, it can have a name, and a symbolic alias. In
• Feb 12
RE: Re[2]: [eiffel-users] Re: 3 small questions
Perhaps, as these math-like expressions seem very much like extensions, they should look like extensions - and be obvious about it. That way, the object- (class-)oriented model is not corrupted and the language doesn't become like C++ with a slide rule. It has, from where I'm sitting, always
• Feb 12
Re: [eiffel-users] Re: 3 small questions
This is quite sensible! It's obvious by this example, I have not encountered all of the good, bad, and ugly of use cases where semicolon use is or is not sensible and improves readability. I find the code below to be concise. > > multiple lines on the same line separated by semicolons is a
• Feb 12
RE: Re[2]: [eiffel-users] Re: 3 small questions
Indeed. But if we wanted to lift that restriction I think we could. Does not seem like a big deal to implement. The question is whether it’s worth it or we fear it would lead to a baroque explosion of multiple names for the same thing. As to me in the absence of clear counter-arguments I would
• Feb 12
Re[2]: [eiffel-users] Re: 3 small questions
The ability to enter Unicode without switching from the usual keyboard input is on our radar. However, adding Unicode Boolean and set operators for kernel classes might become problematic because multiple aliases are not allowed. For example, one cannot change the class BOOLEAN to have:
• Feb 12
Re: [eiffel-users] Re: 3 small questions
related: prior to across thing_list as thing_csr loop | some | all ... I was doing from thing_list.start until thing_list.off loop on a single line for many years now. Much clearer. No semi-colons though... On making programming expressions more like maths, I completely agree. I
• Feb 12
RE: [eiffel-users] Re: 3 small questions
Dear Philippe, > multiple lines on the same line separated by semicolons is a "code smell". Here our tastes differ. I prefer this if x > y then -- Swap t := x ; x := y ; y := t end to the version using
• Feb 12
Re: No automatic extraction RE: [eiffel-users] 3 small questions
Dear Bertrands, please see below On Friday, February 8, 2019 at 12:40:55 PM UTC+3, Bertrand Meyer wrote: > > Dear Alexey, > > > > If I understand you right you are saying that my example is bad style. In > fact I think that the example, not itself but as an abstraction of things > that people
• Feb 11
Re: [eiffel-users] Need a small project done in Eiffel
• Feb 11
Eiffel: how do I set the command line arguments of an autotest?

Some of my tests needs something like

{EXECUTION_ENVIRONMENT}.arguments.separate_character_option_value ('l')


to be attached (not Void), how do I set commandline arguments to eiffel autotest?

• Feb 11
Eiffel: a proper way to inherit from a class and convert Current object to it

It's not the first time I'm trying to inherit from a class and convert an object to it, in this case extend functionalities of HTTP_CLIENT_RESPONSE with valid_http_response => response.status = 200, valid_http_json_body => validate json content, etc...

For that, I'd like to inherit from HTTP_CLIENT_RESPONSE and add features and create my custom DB_ENTITY_HTTP_CLIENT_RESPONSE from an HTTP_CLIENT_RESPONSE

test_case
local
l_http_client_r: HTTP_CLIENT_RESPONSE
l_db_entity_http_client_r: DB_ENTITY_HTTP_CLIENT_RESPONSE
do
l_http_client_r := execute_get("someURL") -- returns an HTTP_CLIENT_RESPONSE
l_db_entity_http_client_r := l_http_client_r
assert("valid response", l_db_entity_http_client_r.valid_response)
end


it seems I've difficulties having the internal properties set... what would be the best way to do this? I had the same case trying to create a WATT class inheriting from NATURAL_32 which is an expanded.

In my strategy, I tried to call in creator

• a parent creation procedure
• then call a deep_copy

Here is the rest of my class attempt:

class
DB_ENTITY_HTTP_CLIENT_RESPONSE

inherit
HTTP_CLIENT_RESPONSE

create
make_from_http_client_response

convert
make_from_http_client_response ({HTTP_CLIENT_RESPONSE})

feature -- Initialization

make_from_http_client_response (a_client_response: HTTP_CLIENT_RESPONSE)
do
make (a_client_response.url)
deep_copy (a_client_response)
end

feature -- Status report

valid_response: BOOLEAN
do
Result := status = 200
end


The only way I found working for now is by setting all attributes to other which is the semantic of deep_copy normally...

make_from_http_client_response (a_client_response: HTTP_CLIENT_RESPONSE)
do
make (a_client_response.url)
set_body (a_client_response.body)
set_http_version (a_client_response.http_version)
set_error_occurred (a_client_response.error_occurred)
set_error_message (a_client_response.error_message)
set_status_line (a_client_response.status_line)
... I surely forgot something...
end

• Feb 10
Eiffel: is there a way with do_all or do_if to search for an element in a collection without having to write a whole feature?
across
collection as l_item
until
Result /= Void
loop
if l_item.item.name.is_equal ("foo") then
Result := l_item.item
end
end


is there a way and if so which one to do something like

collection.do_if (agent ...)


an example of use can be:

search_item_with_id (an_id: INTEGER)
local
l_found: BOOLEAN
do
from
items.start
until
items.after or l_found
loop
l_found := items.item.primary_key = an_id
if not l_found then
items.forth
end
end
ensure
cursor_on_element_if_found: not items.after implies items.item.primary_key = an_id
end

• Feb 01
Eiffel: ODBC Dealing with BIGINT

Eiffel

Seems I'm getting an INTEGER_32_REF from a BIGINT from ODBC with Eiffel DB_SELECTION.cursor. Sometimes I seem to have the adecuate value, but sometimes not...

946383958 => good INTEGER_32_REF (id->4 of following table)
9475984837 => 886050245 WRONG INTEGER_32_REF (id->4 of following table)

646383958 => good INTEGER_32_REF (id->3 of following table)
6475984837 => -2113949755 WRONG INTEGER_32_REF (id->4 of following table)

...


It seems to behave like not treating the BIGINT and giving the INTEGER_32_REF value directly interpreted from the DB value, typical case passing over the 2^32

Postgresql

Having a table with following data as electricity_amount BIGINT NOT NULL DEFAULT 0

id |   a_date   |  amount   | electricity_amount | consumption_sector_id | electricity_rate_id
----+------------+-----------+--------------------+-----------------------+---------------------
1 | 2019-01-01 | 746383958 |         7475984837 |                     1 |                   1
2 | 2019-02-01 | 846383958 |         8475984837 |                     1 |                   1
3 | 2019-03-01 | 646383958 |         6475984837 |                     1 |                   1
4 | 2019-04-01 | 946383958 |         9475984837 |                     1 |                   1


• Jan 31
Eiffel: non-compatible actual argument in feature call

I don't understand why it is so.

• If I say attached {G} it works
• If I say nothing which would be the expected behavior for me calling_entity: detachable RELATED_DB_ENTITY should be conform (once attached) to G which is -> DB_ENTITY
• If I say DB_ENTITY it doesn't
• If I say RELATED_DB_ENTITY either does it pass

Why do I have to specify {G}???

SIT_HANDLER

class
SIT_HANDLER[G -> DB_ENTITY create default_create, make_from_db_service, make_from_json end]

feature --

some_feature
do
if attached {G} l_rest_request.calling_entity as l_calling_entity then
db_service.set_item_prototype (l_calling_entity) -- Complains here!!!!!!!!!!!!
...
end
end -- class


REST_REQUEST

class
REST_REQUEST

feature -- Access
calling_entity: detachable RELATED_DB_ENTITY -- RELATED_DB_ENTITY inherits DB_ENTITY
...
end -- class


DB_SERVICE

class
DB_SERVICE [G -> DB_ENTITY create default_create, make_from_db_service, make_from_json end]

feature -- Status setting

item_prototype: G

set_item_prototype (v: like item_prototype)
do
item_prototype := v
ensure
item_prototype = v
end

...
end -- class


• Jan 30
Eiffel: setting a constant with reference to other class constant

How to set a constant refering to another class constant in Eiffel?

Something like that doesn't compile unfortunately

Default_log_level: like {MY_LOGGER}.log_level = {MY_LOGGER}.Log_level_info

• Jan 27
Eiffel: REAL_32.to_double gives a strange value

Trying to transform a real_32 to real_64, I'm getting

real_32: 61.55
real_64: 61.54999923706055


Am I wrong with the to_double function?

• Jan 26
Eiffel: multilines string formating

Didn't find a better way to format a multiline string than this way... seems complicated. What would be the best way to format this type of code?

l_qry := "SELECT%
%    * %
%FROM %
%    enumerate %
%WHERE %
%    " + {like item_prototype}.Primary_key_db_column_name + " = " + l_category_id + " %
%UNION %
%   SELECT %
%       e.* %
%   FROM %
%       enumerate e %
%INNER JOIN  %
%   enumerates_leaves s ON s." + {like item_prototype}.Primary_key_db_column_name + " = e." + {like item_prototype}.Category_db_column_name + " %
%) SELECT * FROM enumerates_leaves WHERE enumerates_leaves." + {like item_prototype}.Category_db_column_name + " IS NOT NULL;"

• Jan 26
eiffel: does the across structure move the cursor of current iterable structure?

I was wondering if the across structure uses an own cursor or a separated one? does it ensure that cursor hasn't moved and if so how can it be expressed for other examples?

• Jan 25
Eiffel: how to use old keyword in ensure contract clause with detached

How to use the old keyword into ensure clause of a feature, the current statement doesn't seem to be valid at runtime

relationships: CHAIN -- any chain

some_feature
do
(...)
ensure
relationship_added: attached relationships as l_rel implies
attached old relationships as l_old_rel and then
l_rel.count = l_old_rel.count
end


For the whole case, following screenshots demonstrate the case

start of routine execution end of routine execution

• Jan 24
Eiffel: void safety, a concise way to test if an object exists and then call its feature

I was wondering if there is a clearer statement then

if not attached foo then
create foo
end
if attached foo as l_foo then
l_foo.bark
end


as

if not attached foo then
create foo
foo.bark
else
foo.bark
end


would repeat the foo.bark and obviously I want to avoid it... and even the last statement won't compile with void-safety as foo on else could be void...

• Jan 24
Eiffel: a way to ensure db_cursor: DB_RESULT has not moved

I'm looking for a way to ensure that cursor: detachable DB_RESULT from DB_SELECTION class hasn't moved. I didn't find any method to get access to it. Does the following statement ensure it?

    ensure
cursor_not_moved: a_db_service.cursor.is_equal(old a_db_service.cursor)


The item method for example doesn't seem to ensure that even if it is only consulting a value of a given row index

• Jan 13
Eiffel: Error: variable is not properly set. in make calling default_create or any parent calling/redefining default_create

Not sure exactly, but it makes various time I got a Error: variable is not properly set. in creation procedures' calling order. I figured out that creating class attributes before calling default_create seemed to solve the problem. Why is that so? It doesn't seem that default_create calls something in my make routine??!!!

Try to make an example even if I don't think I can reproduce it with a simple example...

Working

class A

feature

attr: B

make
do
create attr
default_create
end

end


Error: variable is not properly set.

class A

feature

attr: B

make
do
default_create
create attr
end

end

• Jan 13
Eiffel: change the signature of a inherited feature

How is the correct way to change the signature of a feature in Eiffel if any? if there is no option as I understood, how would be the correct way to define in a parent class that there will be a feature to be able to select but still don't know arguments number and types (types are resolvable with polymorphism...)

Is the only available playing with polymorphism having an argument into class a to select of type ANY?

class SELECTABLE

class SELECTABLE

select
deferred
end

end -- class


class DB_SERVICE

class DB_SERVICE

inherit
SELECTABLE
(...)

feature -- Status setting

select (a_db_connection: DB_CONNECTION)
local
l_qry: STRING
do
item := first_item_from_qry (l_qry)
end

end -- class

• Jan 11
Eiffel: Error: type is based on unknown class

Trying to implement some test cases on EWF application with rest web services and JSON objects, I'm gettint a Error: type is based on unknown class. after adding my first class inheriting from EQA_TEST_SET

Seems pretty complicated to implement test cases for a simple curl -v --header "Content-Type: application/json" --request POST --data '{"id":11,"name":"someName","enumerate":{"id":5}}' http://localhost:9997/someEntity curl command! How can I do that? Where is there some example? I'm trying to copy-paste the example from $ISE_LIBRARY/contrib/library/web/framework/ewf/wsf/tests/src/test_wsf_request.e as a base, but for the moment.... I can find the class when browsing the dependencies as shown in screenshot, but the compiler not! strange behaviour! My app_ewf_app.ecf <?xml version="1.0" encoding="ISO-8859-1"?> <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-19-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-19-0 http://www.eiffel.com/developers/xml/configuration-1-19-0.xsd" name="sit_ewf_app" uuid="0AB55F0B-014A-4775-B93F-ACC31C9300D5"> <target name="common" abstract="true"> <file_rule> <exclude>/CVS$</exclude>
<exclude>/EIFGENs$</exclude> <exclude>/\.svn$</exclude>
</file_rule>
<option warning="true">
<assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/>
</option>
<capability>
<catcall_detection support="none"/>
<concurrency support="scoop"/>
<void_safety support="all" use="all"/>
</capability>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/> <library name="http" location="$ISE_LIBRARY\contrib\library\network\protocol\http\http-safe.ecf"/>
<library name="json" location="$ISE_LIBRARY\contrib\library\text\parser\json\library\json.ecf"/> <library name="lexical" location="$ISE_LIBRARY\contrib\library\gobo\library\lexical\library.ecf"/>
<library name="logging" location="$ISE_LIBRARY\library\runtime\logging\logging.ecf"/> <library name="odbc" location="$ISE_LIBRARY\library\store\dbms\rdbms\odbc\odbc.ecf"/>
<library name="store" location="$ISE_LIBRARY\library\store\store.ecf"/> <library name="time" location="$ISE_LIBRARY\library\time\time.ecf"/>
<library name="wsf" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf-safe.ecf"/> <library name="wsf_extension" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\wsf_extension.ecf"/>
<cluster name="database" location=".\database\" recursive="true"/>
<cluster name="entity" location=".\entity\" recursive="true"/>
<cluster name="error" location=".\error\" recursive="true"/>
<cluster name="handler" location=".\handler\" recursive="true"/>
<cluster name="logger" location=".\logger\" recursive="true"/>
<cluster name="misc" location=".\misc\" recursive="true"/>
<cluster name="relationship" location=".\relationship\" recursive="true"/>
<cluster name="rest" location=".\rest\" recursive="true"/>
<cluster name="service" location=".\service\" recursive="true"/>
<cluster name="sit-json" location=".\sit-json\" recursive="true"/>
<!-- TESTS -->
<cluster name="tests" location=".\tests\" recursive="true"/>
</target>
<target name="ewf_app_any" extends="common">
<root class="EWF_APP" feature="make_and_launch"/>
<capability>
<concurrency support="scoop"/>
</capability>
<library name="cgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\cgi-safe.ecf"/> <library name="libfcgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\libfcgi-safe.ecf"/>
<library name="standalone" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\connector\standalone-safe.ecf"/> <cluster name="launcher" location=".\launcher\"> <cluster name="any_launcher" location="$|any\"/>
</cluster>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="ewf_app_standalone" extends="common">
<root class="EWF_APP" feature="make_and_launch"/>
<capability>
<catcall_detection support="none"/>
<concurrency support="scoop"/>
<void_safety support="all"/>
</capability>
<variable name="httpd_ssl_disabled" value="true"/>
<library name="default_standalone" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\standalone-safe.ecf"/> <library name="eel" location="$ISE_LIBRARY\contrib\library\text\encryption\eel\eel.ecf"/>
<library name="ewsgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\ewsgi\ewsgi.ecf"/> <library name="http_client" location="$ISE_LIBRARY\contrib\library\network\http_client\http_client.ecf"/>
<library name="testing" location="$ISE_LIBRARY\library\testing\testing-safe.ecf"/> <cluster name="launcher" location=".\launcher\"> <cluster name="default_launcher" location="$|default\"/>
</cluster>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="ewf_app_cgi" extends="common">
<root class="EWF_APP" feature="make_and_launch"/>
<capability>
<concurrency support="scoop" use="none"/>
</capability>
<library name="default_cgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\cgi-safe.ecf"/> <cluster name="launcher" location=".\launcher\"> <cluster name="default_launcher" location="$|default\"/>
</cluster>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="ewf_app_libfcgi" extends="common">
<root class="EWF_APP" feature="make_and_launch"/>
<capability>
<concurrency support="scoop" use="none"/>
</capability>
<library name="default_libfcgi" location="$ISE_LIBRARY\contrib\library\web\framework\ewf\wsf\default\libfcgi-safe.ecf"/> <cluster name="launcher" location=".\launcher\"> <cluster name="default_launcher" location="$|default\"/>
</cluster>
<cluster name="src" location=".\src\" recursive="true"/>
</target>
<target name="ewf_app" extends="ewf_app_any">
</target>
</system>


My error

• Jan 11
Eiffel: unknown identifier cursor on LINKED_LIST[STRING]

I have an unknown identifier on the local like some_values.cursor, I really don't understand why!

qry_update_set_fields (some_keys, some_values, some_unstored_field_names: LINKED_LIST[STRING]): STRING
require
same_some_keys_some_values_count: some_keys.count = some_values.count
local
l_val_c: like some_values.new_cursor
do
Result := ""
l_val_c := some_values.new_cursor
across
some_keys as l_key_c
loop
Result := l_key_c.item + "=" + l_val_c.item + ","
l_val_c.forth
end
if Result.ends_with (",") then
Result.remove_tail (1)
end
ensure
dont_modify_parameters: old some_keys.is_equal (some_keys) and old some_values.is_equal (some_values)
end


working

l_val_c: LINKED_LIST_CURSOR [STRING]


Neither working

l_val_c: LINKED_LIST_CURSOR [like some_values.item]

• Jan 11
Eiffel: Call use obsolete feature. Call to feature to_string_8': Use name_32' instead

I have a warning I cannot get rid of neither understand:

Eiffel: Call use obsolete feature. Call to feature to_string_8': Use 'name_32' instead

item_prototype is a DB_SERVICE where I redefine out

if attached {APP_CONFIGURATION}.application_instance.selected_entity_primary_key ({SIT_UTIL}.class_name_lowercase ({like item_prototype})) as l_pk then


One more point is that I wasn't able to copy the warning msg to my clipboard, how do I do that? if there is a way into EiffelStudio.

• 2018, Dec 26
Eiffel Web Framework, app run on linux raises Address already in use: IO_FAILURE raised

After stopping an EWF app and starting it again in a Address already in use: c_bind Address already in use: IO_FAILURE raised

As explained here, it seems that TCP socket timeout is not available for some time before being released by OS.

• 2018, Dec 20
Eiffel library: JSON_OBJECT.item and common method to get content

If I want to have the content value as string of a JSON_OBJECT.item ("key") without having to

some_json_value_as_string: STRING
do
if attached {JSON_STRING} l_json_o as l_s then
Result := l_s.unescaped_string_8
elseif attached {JSON_NUMBER} l_json_o as l_n then
Result := l_n.item.out
else
check
you_forgot_to_treat_a_case: False
end
end
end


for a json object like

{
|       |       "datasource_name": "DODBC",
|       |       "ewf_listening_port": 9997,
|       |       "log_file_path": "/var/log/ewf_app.log",
|       |       "default_selected_company": 1,
|       |       "default_selected_branch": 1,
|       |       "default_selected_consumption_sector": 1,
|       |       "default_selected_measuring_point": 1,
|       |       "default_selected_charge_unit": -1
|       }


the {JSON_VALUE}.representation with io.putstring is:

datasource_username=dev_db_usr


and not the value only!!!

is there a way to do that? I didn't find intuitive the different methods of JSON_VALUE: values as the out method gives the class and pointer address, which is really far from a string representation of the associated json object for me...

• 2018, Dec 20
How do I initialize and fill a linked list in Eiffel?

Here's what I have so far.

create {LINKED_LIST[INTEGER]} list.make
from
i := 0
list.start
until
i = 11
loop
list.put(i)
i := i + 1
list.forth
end


The debugger points to line list.put(i). I think the problem is that list is not properly initialized? I'm having a bit of an issue with figuring out how to use linked_list because I can't find any proper tutorial to help with. As you can see, I am just trying to write a LINKED_LIST program that adds numbers [0,10] in a linked list. Not a school project. Just practicing ahead of an upcoming course. Please help!

• 2018, Dec 17
Eiffel: How do I handle timezones?

I didn't find any notion of timezone DATE_TIME class and TIME class. Am I wrong?

How do I handle timezones with Eiffel library?

Is there a way to specify it from the {DATE_TIME}.formated_out ("YYYY-MM-DD [0]hh:[0]mi:[0]ss")

Is there a setter for timezone?

I already got this problem with the logger which is logging with UTC...

The only workaround I found was l.hour_add (-3) before the formated_out which is really dirty

• 2018, Dec 17
How to check if file exists in Eiffel
feature

open_file_sample
local
l_file: UNIX_FILE_INFO
l_path: STRING
do
make
l_path := "/var/log/syslog"
l_file.update (l_path)
if l_file.parent_directory.exists and then l_file.parent_directory.is_writtable then
create l_file.make
end
-- AS the above statement doesn't exist!
check
end
end


Is this the proper way to check for file existence in Eiffel?

I was wondering if there is a way not to create 2 objects. I'll complete my check with following statement:

• define path l_file_path := "/some/path/with_file.log"
• check if parent directory exists and has rights to write into
• create log file
• 2018, Dec 13
Eiffel compilation through Makefile and dpkg-buildpackage -us -uc generating an error
• 2018, Dec 10
How to use CURSOR_TREE class in Eiffel?

Does this work for removing first two children from a node?

remove_children(current_node : CURSOR_TREE[EXPRESSION])
do
current_node.down (1)
current_node.remove
current_node.forth
current_node.remove
end


Or does that only remove the current_node?

• 2018, Dec 09
Is it possible to enforce Design by Contract checks at compile time?

Reading Design by Contract tutorial I stumbled upon the following line:

Contracts in Eiffel are not just wishful thinking. They can be monitored at run time under the control of compilation options.

followed by explanations that they will throw exceptions when fail. It makes me think that all the require ensure invariant all checks can be either performed at runtime or turned off. Is this correct? Or they can be enforced at compile time as well using appropriate compiler options?

• 2018, Dec 09
eiffel c compilation failure: error LNK2001: unresolved external symbol
• 2018, Dec 03
Eiffel: are the convert methods working in case of agent call arguments?

I'm calling a procedure with an argument which is an integer_64. I implemented a WATT class which can create it from an INTEGER_64 and it seems the execution stops when reached this point, where am I wrong?

Catcall detected for argument#1args': expected TUPLE [!WATT] but got TUPLE [INTEGER_64]

Attached case (Update)

Actually when checking with syntax

attached {INTEGER_64} my_watt_object as l_int


it doesn't pass either... is it the expected behaviour?

Actually it seems for me that the semantic cases are the same which have to validate the conformity step... for me (but seems not to be the case for the definition of the language between conformance/conformity) which says

Conformance and convertibility are exclusive of each other, p.87

Is the conformance rule valid for a type which defines as convert a type to another which is my case from WATT to INTEGER_64?

• 2018, Dec 03
Eiffel: how do I get the type of a particular operand of a procedure

As I can see into the debugger it's possible to get the operands, and name of procedure, is there a way to get it?

• PROCEDURE=>operands returns a detachable that seems return the operands only when they have been setted into the agent
• Do I have pass through any REFLECTOR class because the PROCEDURE class doesn't have this function and in this case why?

Seems that estudio has access to informations as ROUTINE client don't have, why is he a privileged one? is he cheating?

• 2018, Nov 15
Eiffel: What's the difference between an "eiffel" library and a gobo library?

Eiffel: What's the difference between an "eiffel" library and a gobo library? for example with xml, which should I choose and why?

• See more ...