[racket-users] New lightweight termios package: rktermios

2020-09-21 Thread Dominik Pantůček
Hello Racketeers,

as I learned that it is not possible to use the ansi package under CS,
because the C extensions do not work under CS, I decided to put together
a minimalistic termios wrapper using only Racket code.

It provides the bare minimum to set the terminal to "raw" mode and
should work under any POSIX system (tested on Linux and NetBSD). Usage
is VERY simple[1].

The ansi package can be patched immediately to use it and therefore work
under CS and charterm can be probably be patched as well - meaning it
will no longer rely on `stty' for this functionality.

The termios package uses similar approach but tries to implement all
termios capabilities which means it has to compile at least the
constants from termios headers. The same applies for serial package. It
might be possible to generate a .rkt file with those constants from the
header files during package build - but I didn't investigate that yet.

Any feedback is, of course, welcome. And all the ideas mentioned are
only suggestions.


Cheers,
Dominik

[1] https://docs.racket-lang.org/rktermios/index.html

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/756b73f6-919e-fef2-b81c-7ad19fa1378c%40trustica.cz.


Re: [racket-users] Package index

2020-09-21 Thread Dominik Pantůček
Hi,

I confirm the issue. I am already a registered user but adding a new
package fails with:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /pkgn/package/rktermios.

Reason: Error reading from remote server

Apache/2.4.7 (Ubuntu) Server at pkgd.racket-lang.org Port 443


Can anyone, please, look into it?


Cheers,
Dominik

On 19. 09. 20 18:01, Griffin Byatt wrote:
> Hi all,
> 
> I’ve been unable to register on the package index for the last two days. 
> Entering my email address for a registration code results in an error and 
> stack trace.
> 
> Can anyone confirm that this also happens for them? 
> 
> Thanks,
> Griffin
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2e36ecd1-a5cd-f018-40df-4dc5be46ba7c%40trustica.cz.


Re: [racket-users] querying MS SQL Server with db-lib (ODBC)

2020-09-21 Thread Jin-Ho King
Thanks, Ryan, for working through this with me.

In response to your questions, (1) my connection string does not have any 
non-ASCII characters, and it does not have any backslashes (nor does it need 
any), and (2) yes, I’ve been using Racket CS. Here is the output from Racket BC:

Allocating env handle... done: 0
0
Setting ODBC version... done: 0
0
Allocating db handle... done: 0
0
Connecting... done: -1
odbc-driver-connect: 
  SQLSTATE: 
  context...:
   /Applications/Racket v7.8/collects/db/private/generic/interfaces.rkt:170:0: 
raise-sql-error
   /Applications/Racket 
v7.8/share/pkgs/db-lib/db/private/odbc/connection.rkt:781:0: handle-status*
   "/Users/jinho/git/eoddata-rkt/test-odbc.rkt": [running body]
   temp35_0
   for-loop
   run-module-instance!
   perform-require!

We might be approaching a dead end, but I appreciate your help!

~ Jin-Ho.

--
"Ad astra per alia porci"

> On Sep 19, 2020, at 7:07 PM, Ryan Culpepper  wrote:
> 
> 
> So, it seems that there are two problems: (1) the connection fails (even 
> though it works with pyodbc) and (2) retrieving the diagnostic information 
> after the error hangs with the MS driver. I don't see an obvious reason for 
> either problem, but I have two thoughts.
> 
> Does your connection string have any non-ASCII characters? A difference in 
> string conversion is one of the few things I can imagine distinguishing 
> odbc-driver-connect's behavior from pyodbc, since IIUC both just pass the 
> connection string to SQLDriverConnect without any processing. Also, 
> double-check backslashes.
> 
> It looks like you're using Racket CS. Could you try the program with Racket 
> BC too? It's possible that there's some difference in the FFI's behavior 
> between the two versions that the db library is not accounting for.
> 
> Ryan
> 
> 
>> On Sat, Sep 19, 2020 at 10:06 PM Jin-Ho King  wrote:
>> Hi Ryan, thanks so much for your suggestions. Here is the output from 
>> running your program with my original connection string, which works in 
>> python using pyodbc:
>> 
>> Allocating env handle... done: 0
>> 0
>> Setting ODBC version... done: 0
>> 0
>> Allocating db handle... done: 0
>> 0
>> Connecting... done: -1
>> 
>> This is where it hangs.
>> 
>> Based on your suggestions about trying different drivers, I tried switching 
>> drivers from the "ODBC Driver 17 for SQL Server” that I had been using to 
>> the FreeTDS driver the example in your program uses. I was able to 
>> successfully connect using the FreeTDS driver in python using pyodbc. Using 
>> the same connection string, I ran your program again. This time, running 
>> your program didn't hang, but the output was not promising either:
>> 
>> Allocating env handle... done: 0
>> 0
>> Setting ODBC version... done: 0
>> 0
>> Allocating db handle... done: 0
>> 0
>> Connecting... done: -1
>> odbc-driver-connect:
>>   SQLSTATE:
>>   context...:
>>.../generic/interfaces.rkt:170:0: raise-sql-error
>>.../odbc/connection.rkt:781:0: handle-status*
>>call-with-values
>>call-in-empty-metacontinuation-frame
>>body of "/Users/jinho/git/eoddata/test-odbc.rkt"
>>temp35_0
>>run-module-instance!
>>perform-require!
>>namespace-require+
>>proc
>>call-in-empty-metacontinuation-frame
>>thunk_10
>>call-in-empty-metacontinuation-frame
>>call-with-empty-metacontinuation-frame-for-swap
>> 
>> I also confirmed using odbc-driver-connect directly that no connection is 
>> actually made. Do you have any other suggestions? Thanks again!
>> 
>> 
>> --
>> "Ad astra per alia porci"
>> 
>>> On Sep 19, 2020, at 8:12 AM, Ryan Culpepper  wrote:
>>> 
>>> The last time I tested connecting to MS SQL Server on Windows (several 
>>> years ago), I think I was able to connect using some drivers but not 
>>> others. I was simultaneously trying to figure out authentication and the 
>>> connection string format, so once I got a working configuration I stopped 
>>> investigating. Lately I've been testing using the Docker image on Linux.
>>> 
>>> I've attached a program you can run to find out where the connection 
>>> process hangs. If you can report the results of running the program that 
>>> should help narrow down the problem.
>>> 
>>> Ryan
>>> 
>>> 
 On Sat, Sep 19, 2020 at 12:25 AM Jin-Ho King  wrote:
 Does anyone have experience using Racket to query a MS SQL Server? I'm 
 attempting to use the db-lib package (https://docs.racket-lang.org/db/) 
 and odbc-driver-connect, but running the method just hangs, with no 
 feedback. By contrast, using the same connection string, I can 
 successfully connect using python and pyodbc. 
 
 Any suggestions or tips would be appreciated!
 
 -- 
 You received this message because you are subscribed to the Google Groups 
 "Racket Users" group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to racket-users+unsubscr...@googlegroups.com.
 To view this discussion on the web 

Re: [racket-users] UTF-8 encoding error when opening files in DrRacket on Windows 10

2020-09-21 Thread breanndan....@gmail.com
A student reports the error on versions 7.8, 7.7 and also 7.4 and says that 
he doesn't get any more debugging information.

On Thursday, 17 September 2020 at 17:10:42 UTC+2 Robby Findler wrote:

> I know only that we didn't get the report with earlier versions.
>
> BTW, if one click on the dialog that has the error message, there should 
> be a "copy" option that will let you get some potentially valuable 
> debugging information. If it is easy to get a student who is having the 
> problem to do that, it may be helpful to report it back.
>
> Robby
>
>
> On Thu, Sep 17, 2020 at 8:46 AM breanndan@gmail.com <
> breanndan@gmail.com> wrote:
>
>> Thanks Robby. We'll experiment with that. 
>>
>> Any  idea if it's just the current version fo DrRacket? We could have 
>> them try installing the previous version for the time being.
>>
>> On Thursday, 17 September 2020 at 14:45:06 UTC+2 Robby Findler wrote:
>>
>>> We have had one other report yes. It looks like something is going wrong 
>>> with the open file dialog. It may be possible to open files by double 
>>> clicking on them to sidestep the bug I am not sure. 
>>>
>>> Sorry about this. 
>>>
>>> Robby
>>>
>>> On Thu, Sep 17, 2020 at 6:29 AM breanndan@gmail.com <
>>> breanndan@gmail.com> wrote:
>>>
 I have two students who just installed DrRacket on Windows 10 and get 
 this error when they try to open files:

 bytes->string/locale: string is not a well-formed UTF-8 encoding 
 string: #"\340lU\1"

 Has anyone else encountered this?








 -- 


 You received this message because you are subscribed to the Google 
 Groups "Racket Users" group.


 To unsubscribe from this group and stop receiving emails from it, send 
 an email to racket-users...@googlegroups.com.


 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/racket-users/cef31834-11d8-4bc3-b03d-c63d2868f097n%40googlegroups.com
  
 
 .


 -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/9b1a259b-1aa0-4b7c-b902-78376ccc9253n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/348231eb-e88f-49fc-9af0-2887de4bd545n%40googlegroups.com.