Comments (5)
do they have the same filepath by chance, for some reason? I couldn't reproduce this problem yet.
from markor.
Create files Aa.md and BB.md in any folder, then long press Aa.md or BB.md.
These two files have the same hash value.
from markor.
References:
-
Can Java's hashCode() produce same value for different strings? - Stack Overflow
-
Why can hashCode() return the same value for different objects in Java? - Stack Overflow
from markor.
Quick idea without too much complex thinking: To just sum orignal hashcode value and the modification unix time (numeric).
At the end, collision still can happen...but that should make it at least way less common. It adds a certain user-controllable part to the quotation too.
from markor.
Very interesting.
I propose this:
@Override
public long getItemId(final int position) {
final File f = _adapterDataFiltered.get(position);
final Long key = _fileIdMap.get(f);
if (key == null) {
final long newId = _lastAssignedId++;
_fileIdMap.put(f, newId);
return newId;
} else {
return key;
}
}
Its kinda brute force, but no collisions
from markor.
Related Issues (20)
- v2.12.2 New file Template name corresponds to wrong content HOT 10
- unable to change Todo or quick note folder HOT 1
- Markor View Mode - download and upload file support. HOT 3
- Zim format detection does not work in 2.12.1 and 2.12.2 HOT 12
- Images don't render HOT 7
- Needed a bottom-bar action to insert HTML-tag-mark `<>` HOT 1
- ACTION_CREATE_NOTE intent filter? HOT 1
- Absolute links for external CSS/JS HOT 3
- Support for lrc text format HOT 1
- Include TOC in shared md HOT 2
- Auto filename uses month instead of minutes. HOT 3
- "Start new line above" action HOT 1
- Automatic backup, encryption of backup files and gui improvement HOT 1
- Swiping on "Move Text Up/Down" buttons triggers them HOT 2
- Support for e-ink devices - disable animation HOT 2
- Crash after creating files with certain extensions HOT 4
- Calendar support with Markwhen or Almanac HOT 5
- File creator no longer remembers the previous file extension HOT 5
- unable to attach/link camera pics HOT 4
- Markdown: Mermaid chart dark mode? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markor.