michaelklishin / propertied Goto Github PK
View Code? Open in Web Editor NEWTiny Clojure library for working with Java property lists (java.util.Properties)
Tiny Clojure library for working with Java property lists (java.util.Properties)
I have code like this:
(def db-props (p/load-from (io/resource "db.properties")))
(def db-props-keywords (into {}
(for [[k v] db-props] [(keyword k) v])))
...and I end up passing the map to Korma to connect to my database.
I'm not very good at clojure, but I get the impression that clojure maps tend to use keywords as keys. It would be nice if propertied allowed this.
If I get a pointer or two on how you'd like to see this implemented, I can submit a pull request.
I am using propertied for a project I am doing which reads a .properties
file and makes a write to it a LOT of times per second which is causing the following:
java.lang.Error: java.io.FileNotFoundException : Too many open files
I think the problem is that with-open must be used inside store-to and load-from in order to ensure that the file is closed and the file handle is destroyed.
The insane part is that I can only reproduce this on Ubuntu machine and not with Macos.
Also, I need to mention that I am using clojure.java.io/file
to pass as sink parameter to load-from
and store-to
.
Thank you for your time
Alex
Hello, in my project I am loading localized property files which are in UTF-8, and the default implementation of Properties.load()
does not support UTF-8. The workaround is to create a custom InputStreamReader
with the encoding enabled. As this misfeature renders the otherwise wonderful propertied library unusable for such cases, I suggest to think of some kind of a fix for it.
Here's my java pseudocode example for loading UTF-8 properties:
InputStream is = // get an input stream from file
Properties res = new Properties();
try {
res.load(new InputStreamReader(is, "UTF-8"));
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.