Code Monkey home page Code Monkey logo

bibcal's People

Contributors

johanthoren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bibcal's Issues

Crash with 0.2.1

bibcal-bin 0.1.1 was working fine.

Manjaro GNOME (unstable branch)

Exception in thread "main" Syntax error compiling fn* at (doric/org.clj:1:1).
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:7119)
	at clojure.lang.Compiler.analyze(Compiler.java:6793)
	at clojure.lang.Compiler.eval(Compiler.java:7178)
	at clojure.lang.Compiler.eval(Compiler.java:7170)
	at clojure.lang.Compiler.load(Compiler.java:7640)
	at clojure.lang.RT.loadResourceScript(RT.java:381)
	at clojure.lang.RT.loadResourceScript(RT.java:372)
	at clojure.lang.RT.load(RT.java:459)
	at clojure.lang.RT.load(RT.java:424)
	at clojure.core$load$fn__6856.invoke(core.clj:6115)
	at clojure.core$load.invokeStatic(core.clj:6114)
	at clojure.core$load.doInvoke(core.clj:6098)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5897)
	at clojure.core$load_one.invoke(core.clj:5892)
	at clojure.core$load_lib$fn__6796.invoke(core.clj:5937)
	at clojure.core$load_lib.invokeStatic(core.clj:5936)
	at clojure.core$load_lib.doInvoke(core.clj:5917)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$load_libs.invokeStatic(core.clj:5974)
	at clojure.core$load_libs.doInvoke(core.clj:5958)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:669)
	at clojure.core$require.invokeStatic(core.clj:5996)
	at clojure.core$require.doInvoke(core.clj:5996)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at doric.core$table_STAR_.invokeStatic(core.clj:158)
	at doric.core$table_STAR_.doInvoke(core.clj:143)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$apply.invoke(core.clj:662)
	at doric.core$table.invokeStatic(core.clj:173)
	at doric.core$table.doInvoke(core.clj:167)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at xyz.thoren.bibcal$print_date.invokeStatic(bibcal.clj:122)
	at xyz.thoren.bibcal$print_date.invoke(bibcal.clj:116)
	at xyz.thoren.bibcal$_main.invokeStatic(bibcal.clj:243)
	at xyz.thoren.bibcal$_main.doInvoke(bibcal.clj:225)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at xyz.thoren.bibcal.main(Unknown Source)
Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: Defining a class from new bytecodes at run time is not supported. Class clojure.core$eval146 with hash d096b8b0e96c1c19d33456bb8e3a40b9ee6c3cf1be20a354c10538d775fd36c7 was not provided during the image build. Please see BuildConfiguration.md.
	at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:88)
	at com.oracle.svm.core.hub.PredefinedClassesSupport.loadClass(PredefinedClassesSupport.java:93)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:329)
	at clojure.lang.DynamicClassLoader.defineClass(DynamicClassLoader.java:46)
	at clojure.lang.Compiler$ObjExpr.getCompiledClass(Compiler.java:4990)
	at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4120)
	at clojure.

Using an incorrect option throws a NullPointerException

Example:

$ bibcal -e                                                                                      ✔
Unknown option: "-e"
Exception in thread "main" java.lang.NullPointerException
	at clojure.lang.RT.intCast(RT.java:1221)
	at xyz.thoren.bibcal$exit.invokeStatic(bibcal.clj:372)
	at xyz.thoren.bibcal$exit.invoke(bibcal.clj:368)
	at xyz.thoren.bibcal$_main.invokeStatic(bibcal.clj:381)
	at xyz.thoren.bibcal$_main.doInvoke(bibcal.clj:375)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at xyz.thoren.bibcal.main(Unknown Source)

An exception is thrown if bibcal is run in a directory that no longer exists

Steps to reproduce:

  1. Create new directory.
  2. Enter this new directory.
  3. Remove the directory from another terminal.
  4. Try running bibcal with either -t or -T, or with arguments to calculate a specific date.

Error message:

Exception in thread "main" java.lang.Error: Properties init: Could not determine current working directory.
        at com.oracle.svm.core.posix.PosixSystemPropertiesSupport.userDirValue(PosixSystemPropertiesSupport.java:63)
        at com.oracle.svm.core.jdk.SystemPropertiesSupport.userDir(SystemPropertiesSupport.java:249)
        at com.oracle.svm.core.jdk.SystemPropertiesSupport.initializeLazyValue(SystemPropertiesSupport.java:216)
        at com.oracle.svm.core.jdk.SystemPropertiesSupport.ensureFullyInitialized(SystemPropertiesSupport.java:148)
        at com.oracle.svm.core.jdk.SystemPropertiesSupport.getProperties(SystemPropertiesSupport.java:164)
        at java.lang.System.getProperties(System.java:273)
        at sun.security.action.GetPropertyAction.privilegedGetProperties(GetPropertyAction.java:148)
        at java.util.TimeZone.setDefaultZone(TimeZone.java:663)
        at java.util.TimeZone.getDefaultRef(TimeZone.java:653)
        at java.util.TimeZone.getDefault(TimeZone.java:642)
        at java.time.ZoneId.systemDefault(ZoneId.java:272)
        at java.time.Clock.systemDefaultZone(Clock.java:184)
        at java.time.ZonedDateTime.now(ZonedDateTime.java:199)
        at org.shredzone.commons.suncalc.util.BaseBuilder.<init>(BaseBuilder.java:47)
        at org.shredzone.commons.suncalc.MoonPhase$MoonPhaseBuilder.<init>(MoonPhase.java:210)
        at org.shredzone.commons.suncalc.MoonPhase$MoonPhaseBuilder.<init>(MoonPhase.java:210)
        at org.shredzone.commons.suncalc.MoonPhase.compute(MoonPhase.java:54)
        at xyz.thoren.luminary$new_moon.invokeStatic(luminary.clj:220)
        at xyz.thoren.luminary$new_moon.invoke(luminary.clj:211)
        at xyz.thoren.luminary$next_new_moon.invokeStatic(luminary.clj:234)
        at xyz.thoren.luminary$next_new_moon.invoke(luminary.clj:225)
        at xyz.thoren.luminary$previous_new_moon.invokeStatic(luminary.clj:238)
        at xyz.thoren.luminary$previous_new_moon.invoke(luminary.clj:236)
        at xyz.thoren.luminary$next_start_of_month_in_israel.invokeStatic(luminary.clj:247)
        at xyz.thoren.luminary$next_start_of_month_in_israel.invoke(luminary.clj:242)
        at xyz.thoren.luminary$previous_start_of_month_in_israel.invokeStatic(luminary.clj:256)
        at xyz.thoren.luminary$previous_start_of_month_in_israel.invoke(luminary.clj:254)
        at xyz.thoren.luminary$next_start_of_year_in_israel.invokeStatic(luminary.clj:317)
        at xyz.thoren.luminary$next_start_of_year_in_israel.invoke(luminary.clj:313)
        at xyz.thoren.luminary$previous_start_of_year_in_israel.invokeStatic(luminary.clj:338)
        at xyz.thoren.luminary$previous_start_of_year_in_israel.invoke(luminary.clj:332)
        at xyz.thoren.luminary$next_start_of_year.invokeStatic(luminary.clj:346)
        at xyz.thoren.luminary$next_start_of_year.invoke(luminary.clj:344)
        at xyz.thoren.luminary$previous_start_of_year.invokeStatic(luminary.clj:361)
        at xyz.thoren.luminary$previous_start_of_year.invoke(luminary.clj:356)
        at xyz.thoren.luminary$boundaries_of_year.invokeStatic(luminary.clj:369)
        at xyz.thoren.luminary$boundaries_of_year.invoke(luminary.clj:367)
        at xyz.thoren.luminary$date.invokeStatic(luminary.clj:760)
        at xyz.thoren.luminary$date.invoke(luminary.clj:725)
        at xyz.thoren.bibcal$print_date.invokeStatic(bibcal.clj:195)
        at xyz.thoren.bibcal$print_date.invoke(bibcal.clj:191)
        at xyz.thoren.bibcal$_main.invokeStatic(bibcal.clj:408)
        at xyz.thoren.bibcal$_main.doInvoke(bibcal.clj:365)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at xyz.thoren.bibcal.main(Unknown Source)

Consider changing "Current local time" to "Local time"

When running a query on a past or future date it can seem a bit odd to have the key Current local time. Perhaps it would be better to use Local time.

Another option is to print Current local time when displaying the data for right now, and Local time when displaying data for past or future dates. However, this might throw a curve ball at anyone trying to parse the output for scripting purposes.

I would like some feedback on this before making a change, feel free to leave comments on this issue.

The example link to the configuration file in error message 66 is hardcoded at compile time

Example:

$ bibcal -d
ERROR:   The options --lat and --lon are both needed, and --zone
         is highly recommended. You can provide them either as
         options to the command or saved in the config file:

         /root/.config/bibcal/config.edn

         Use them with the option -c to save them to the
         config file.

EXAMPLE: bibcal -c --lat 31.7781161 --lon 35.233804 --zone Asia/Jerusalem

Instead of /root/.config/bibcal/config.edn, it should refer to the current user's home directory, $HOME, or ~/.

Some dates throw a NumberFormatException when using a 0 prefix

Example:

$ bibcal 2023 04 08 12                                                                                                                                                                                                                                                      1 ✘
Exception in thread "main" java.lang.NumberFormatException: Invalid number: 08
	at clojure.lang.LispReader.readNumber(LispReader.java:352)
	at clojure.lang.LispReader.read(LispReader.java:278)
	at clojure.lang.LispReader.read(LispReader.java:216)
	at clojure.lang.LispReader.read(LispReader.java:205)
	at clojure.lang.RT.readString(RT.java:1879)
	at clojure.lang.RT.readString(RT.java:1874)
	at clojure.core$read_string.invokeStatic(core.clj:3803)
	at clojure.core$read_string.invoke(core.clj:3793)
	at clojure.core$map$fn__5884.invoke(core.clj:2757)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:51)
	at clojure.lang.RT.seq(RT.java:535)
	at clojure.core$seq__5419.invokeStatic(core.clj:139)
	at clojure.core$filter$fn__5911.invoke(core.clj:2813)
	at clojure.lang.LazySeq.sval(LazySeq.java:42)
	at clojure.lang.LazySeq.seq(LazySeq.java:51)
	at clojure.lang.RT.seq(RT.java:535)
	at clojure.core$seq__5419.invokeStatic(core.clj:139)
	at clojure.core$seq__5419.invoke(core.clj:139)
	at xyz.thoren.bibcal$validate_args.invokeStatic(bibcal.clj:325)
	at xyz.thoren.bibcal$validate_args.invoke(bibcal.clj:290)
	at xyz.thoren.bibcal$_main.invokeStatic(bibcal.clj:379)
	at xyz.thoren.bibcal$_main.doInvoke(bibcal.clj:375)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at xyz.thoren.bibcal.main(Unknown Source)

But this works:

$ bibcal 2023 04 8 12                                                                                                                                                                                                                                                       1 ✘
Date                    17th day of the 1st month
ISO date                6023-01-17
Traditional date        17th of Nisan
Traditional ISO date    5783-01-17
Day of week             7
Sabbath                 true
Major feast day         3rd day of the Feast of Unleavened Bread
Current local time      2023-04-08 12:00:00
Start of next day       2023-04-08 20:06:00

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.