Giter Site home page Giter Site logo

Comments (12)

epsil avatar epsil commented on July 26, 2024 1

It's a problem with line endings. index.js has DOS-style line endings (CRLF), which confuses the interpreter.

from spotgen.

epsil avatar epsil commented on July 26, 2024 1

Try:

sudo vi index.js

Then, in vi:

:set ff=unix
:wq!

from spotgen.

epsil avatar epsil commented on July 26, 2024 1

On a related note, I will also commit a fix to make the output parameter optional, so that

spotgen hardcore_softpop.txt

works just as well as

spotgen hardcore_softpop.txt output.txt

As of currently, the latter works, the former does not.

from spotgen.

epsil avatar epsil commented on July 26, 2024

Hi edo9k.

I am not able to reproduce the problem. Could you please tell me how you installed spotgen?

from spotgen.

edo9k avatar edo9k commented on July 26, 2024

Thanks for replying. I installed it via npm install, as instructed on the github page.

Image of spotgen's weird behavior

from spotgen.

epsil avatar epsil commented on July 26, 2024

Thanks for the clarification. And from the screenshot I gather that you are running some version of Linux (Ubuntu?), correct?

Let me run some tests on a Linux laptop I have lying around, and then I'll get back to you.

from spotgen.

edo9k avatar edo9k commented on July 26, 2024

It's how persistent some problems can be. I'll try to grep/replace the line endings in this file tomorrow and I'll let you know how it goes in this thread. Thank you!

from spotgen.

epsil avatar epsil commented on July 26, 2024

I would have pushed a fix already, but Git does some magic where the line endings are automatically translated between different conventions on different systems:

  • Windows (DOS): CRLF (\r\n)
  • Linux (Unix): LF (\n)
  • OS X (pre-Unix): CR (\r)

This "helpful behavior" actually makes it rather difficult to reproduce the problem. Specifically:

  • When I check out the code with Git, I get Unix line endings -- whether I'm on Windows, Linux or OS X.
  • When I run npm install on Linux, then I get DOS-style line endings.
  • But when I run npm install on Windows, then I get Unix line endings again.

I'm not exactly sure what is happening here. I'll try recommitting the file and see if that makes any difference.


In the meantime, as a workaround, you can fix index.js yourself, or use the web demo for the time being.

from spotgen.

edo9k avatar edo9k commented on July 26, 2024

On the line ending problem, I tried using sed to correct the problem, and got into some file ownership problem.
But I have been using the web demo, and it's working perfectly.
Thanks again.

from spotgen.

edo9k avatar edo9k commented on July 26, 2024

Worked! Thanks a lot!

from spotgen.

epsil avatar epsil commented on July 26, 2024

Hi!

Would you please update spotgen to the latest version and check if it works?

sudo npm uninstall -g spotgen
sudo npm install -g spotgen

from spotgen.

edo9k avatar edo9k commented on July 26, 2024

Working like a charm! Thanks a lot, man 👍

from spotgen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.