Opening SML file - use fail - sml

I opened a file in "SML of New Jersey" with the following command: use "c:\\work.sml", and it gives me the next problem:
[openning c:\\work5.sml]
[use failed: Io: openln failed on "c:\\work.sml", Win32TextPrimIO:openRd: failed]
uncaught Exception error
raised at:../complier/TopLevel/interact.sml:24.14-24.28
In work.sml, I have just this one line:
- datatype ’a seq = Nil | Cons of ’a * (unit -> ’a seq);

Your file contains two errors:
The - at the beginning of the line needs to be removed.
The ’s should be 's.
However these should cause a syntax error and a bunch of "illegal token" errors respectively, not an IO error.
The only reason I can think of that you get the error you do is that you mistyped the file name.

I suddenly started experiencing this problem as well after I pinned the shortcut to SML New Jersey to my task bar. If I ran SML from this shortcut and tried to "use" a .sml file it would give this error.
So basically make sure your SML.exe is in the same folder as your .sml programs and this should work fine again.

Related

Clojure compile error - Unable to resolve symbol: this in this context

Just when I thought I had seen it all in Clojure errors I get one that is baffling. When compiling my .clj file using lein compile I'm getting this exception:
java.lang.RuntimeException: Unable to resolve symbol: this in this context, compiling:(medical_notes/read_notes.clj:135:26)
the line in the read_notes.clj file that it is pointing to (135) is simply
{:type :compute}
that's it. The word "this" does not appear anywhere in the file. That line is inside this function:
(defn m-compute
"Message sent to master to start the computation"
[]
{:type :compute})
Anyone have any idea what is confusing it?
UPDATE: after troubleshooting and trying different things I can at least say now that the line number reported with the error is totally wrong for sure. It always reports exactly the same line number (135:26) no matter what. Right now line 135 in the file is a blank line and it's still calling out that line as the problem.

CI 3.0.4 large where_in query causes causes Message: preg_match(): Compilation failed: regular expression is too large at offset)

I am running a query where $sale_ids could potentially contain 100's to a thousands of sale_ids. I am looking for a way to fix the regex error without modifying the core of CI 3.
This didn't happen in version 2 and is NOT considered a bug in CI 3 (I brought up the issue before).
Is there a way I can get this to work? I could change the logic of the application but this would require days of work.
I am looking for a way to extend/override a class so I can allow for this query to work If there is not a way to do this by override I will have to hack the core (I don't know how).
$this->db->select('sales_payments.*, sales.sale_time');
$this->db->from('sales_payments');
$this->db->join('sales', 'sales.sale_id=sales_payments.sale_id');
$this->db->where_in('sales_payments.sale_id', $sale_ids);
$this->db->order_by('payment_date');
Error is:
Severity: Warning
Message: preg_match(): Compilation failed: regular expression is too large at offset 53249
Filename: database/DB_query_builder.php
Line Number: 2354
Backtrace:
File: /Applications/MAMP/htdocs/phppos/PHP-Point-Of-Sale/application/models/Sale.php
Line: 123
Function: get
File: /Applications/MAMP/htdocs/phppos/PHP-Point-Of-Sale/application/models/Sale.php
Line: 48
Function: _get_all_sale_payments
File: /Applications/MAMP/htdocs/phppos/PHP-Point-Of-Sale/application/models/reports/Summary_payments.php
Line: 60
Function: get_payment_data
File: /Applications/MAMP/htdocs/phppos/PHP-Point-Of-Sale/application/controllers/Reports.php
Line: 1887
Function: getData
File: /Applications/MAMP/htdocs/phppos/PHP-Point-Of-Sale/index.php
Line: 323
Function: require_once
There wasn't a good way to modify the core so I came up with a small change that I made to the code with large where_in's. Start a group and create where where_in's in smaller chunks
$this->db->group_start();
$sale_ids_chunk = array_chunk($sale_ids,25);
foreach($sale_ids_chunk as $sale_ids)
{
$this->db->or_where_in('sales_payments.sale_id', $sale_ids);
}
$this->db->group_end();

Error message : "Assertion 't = find_next_time_event( m )' failed at pulse/mainloop.c" ?...(C++)

Ok so I'm using CodeBlocks for programming in C++ . I have so "random" (it doesn't happen everytime, and I'm not able to predict when it happens) error message which makes the program crash, it says :
Assertion 't = find_next_time_event( m )' failed at pulse/mainloop.c:721,
function calc_next_timeout() . Aborting .
Aborted (core dumped) .
Process returned 134 (0x86)
Core dumped is when I should not have deleted some pointer, am I right?
The thing I don't understand is what is before "Aborted, core dumepd" . Can it guide me to which kind of error I made ?
Or is it a problem with CodeBlocks (I doubt it , but that could be great :p)
*I don't put code here because I just want information about what could theorically create this kind of message . Then I'll search and if I've problems with finding the error(s), I'll put some code here ;) *
It is telling you that an assertion failed on line 721 of the file pulse/mainloop.c that is part of your source code.
An assertion is typically placed to check invariants or preconditions/postconditions. Taking a precondition as an example, this is saying "this expression has to be true in order for the code below to work correctly".
By inspecting the condition (at line 721 of mainloop.c) and understanding why it was not true in your case, you should be able to find an error in your code that lead to the failed assertion.
This isn't really a solution but this issue actually has to do with PulseAudio. I assume OP is using Linux, possibly Ubuntu, which is when this error occurs. I sometimes get the same thing when using a program written in Python. There is a noted bug about this issue in the PulseAudio Launchpad bugs.

Datalog require field `unlock'

While compiling an OCaml application I get the following error:
File "/tmp/ocamlpp466ee0", line 308, characters 34-233:
Error: Signature mismatch:
...
The field `unlock' is required but not provided
The field `lock' is required but not provided
Command exited with code 2.
My guess is that the error is releated with the OCaml library Datalog (I've installed the version 0.3 from here) because the line 308 in the file is /tmp/ocamlpp466ee0 the first one in the following code
module Logic = Datalog.Logic.Make(struct
type t = atom
let equal = eq_atom
let hash = hash_atom
let to_string a = Utils.sprintf "%a" pp_atom a
let of_string s = atom_of_json (Json.from_string s)
end)
I would really appreciate if someone could help me to know what I am doing wrong.
Moreover, I would like to undestand why the file /tmp/ocamlpp466ee0 is generated each time I execute 'make'? I tried to understand by reading the Makefile but I did not succeed.
I think that something have changed in Datalog library and in some version > 0.3 functor Datalog.Logic.Make requires module argument with values lock and unlock declared. So, it's version problem.
About temporary file. As you can see, its name consists of ocaml literal, pp which means preprocessor and some number. Preprocessors in OCaml usually work this way: they read input source file and write output source files. That's why some temporary files are created.

Failed compiling ocaml-websocket

Trying to build ocaml-websocket, it fails with:
File "lib/websocket.ml", line 202, characters 29-42:
Error: The function applied to this argument has type
?buffer_size:int ->
(Lwt_io.input_channel * Lwt_io.output_channel) Lwt.t
This argument cannot be applied with label ~setup_socket
The function line in question is,
lwt ic, oc = Lwt_io.open_connection ~setup_socket sockaddr in
Any idea, if the lwt API was changed in previous release?
I used a customized version of Lwt, that’s why. I’m going to release a new version, compatible with normal Lwt, very soon.