martin-saurer / jkernel

Jupyter Notebook / J Integration
GNU General Public License v3.0
44 stars 15 forks source link

Kernel executing only first character #1

Closed tingtron closed 8 years ago

tingtron commented 8 years ago

Nice job with the J Kernel!

At least on Windows, 32-bit both Anaconda and j804, when entering J kernel entries, only the first character is passed to the J session.

In [1]: i.3 4
        |value error: i

As suspected, somehow the string type is mistaken for unicode, thus zeros are interspersed.

A simple fix, is to wrap the parameter in c_char_p as described in ctypes - Fundamental data types.

In qjide.py:

   def Exec(self,cmd):
      self.OLasAcc = time.strftime('%Y-%m-%d %H:%M:%S')
      cp_cmd = c_char_p(qjide_encode3(cmd))
      s = self.JDll.JDo(self.JSession, cp_cmd)
      return s
martin-saurer commented 8 years ago

Thanks for letting me know. I will try to provide a fix, as soon as my time permits.

martin-saurer commented 8 years ago

@tingtron I cannot reproduce this issue, neither on Windows, Mac, or Linux. Anyway your fix (c_char_p) is included in the latest version on GitHub. It has no positive and no negative effect. But I'm glad if it works for you.