Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (798)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (865)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Clippy: clipboard history tool  (Read 6899 times)
0 Members and 1 Guest are viewing this topic.
Offline Nate

« JGO Bitwise Duke »


Medals: 167
Projects: 4
Exp: 14 years


Esoteric Software


« Posted 2014-10-29 10:11:57 »

My clipboard history is one of my most valuable tools. I use it extensively while coding, writing emails, etc. I used it while writing this post! If you are a coder, I really think it can make a nice improvement to productivity.

I've been using ArsClip for a long time, something like 10 years. I even donated multiple times. After some frustration with the latest versions and wishing that search was easier, I finally decided to write my own minimalistic clipboard history tool. Thus, Clippy was born!

Clippy is a clipboard history tool for Windows. It uses Java of course, with JNA for the Windows specific parts and an H2 database to store any text items that are copied to the clipboard. The stored text items can be easily retrieved by browsing or searching.

Offline Riven
Administrator

« JGO Overlord »


Medals: 1369
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2014-10-29 13:26:58 »

https://github.com/EsotericSoftware/clippy/blob/master/src/com/esotericsoftware/clippy/util/DataStore.java

Bug (line 381) - swap if statements.
1  
2  
3  
4  
         else if (dataType.startsWith("TIME"))
            type = Types.TIME;
         else if (dataType.startsWith("TIMESTAMP"))
            type = Types.TIMESTAMP;

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline Nate

« JGO Bitwise Duke »


Medals: 167
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #2 - Posted 2014-10-29 13:41:01 »

Nice, good catch Riven! What do you think of DataStore? It doesn't hide that SQL is being used, but it makes it super easy to setup and use an H2 database in a thread safe way. A long time ago I had another layer on top of it that was basic ORM, but that gets nasty pretty quick.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass

« JGO Spiffy Duke »


Medals: 319
Projects: 25
Exp: 22 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2014-10-29 13:46:56 »

Can I have it for Mac please?

Kev

Offline Riven
Administrator

« JGO Overlord »


Medals: 1369
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #4 - Posted 2014-10-29 14:54:03 »

offtopic:

Nice, good catch Riven! What do you think of DataStore? It doesn't hide that SQL is being used, but it makes it super easy to setup and use an H2 database in a thread safe way. A long time ago I had another layer on top of it that was basic ORM, but that gets nasty pretty quick.
I have an abstraction layer that is actually pretty nifty, without forcing you into ORM. (there is an ORM layer I built on top of it, but it's optional)

It mostly revolves around named parameters:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
Set<Integer> bestFriendIds = new HashSet<>();
bestFriendIds.add(13);
bestFriendIds.add(14);
bestFriendIds.add(37);
// or: int[] bestFriendIds = new int[]{13,14,37};

Query q = new Query(); // builder pattern-ish
q.withSQL("SELECT [whatever:w], [sumfin:s]    ");
q.withSQL("  FROM whatever AS w               ");
q.withSQL(" INNER JOIN sumfin AS s            ");
q.withSQL("         ON w.id = s.fk            ");
q.withSQL(" WHERE w.id IN ( :ids )            ");
q.withSQL("   AND age < :age                  ");
q.withParam("ids", bestFriendIds);
q.withParam("age", 55);
resultset = q.execute();


Is expanded to:
1  
2  
3  
4  
5  
6  
7  
SELECT w.id, w.user, w.email, w.age,  <-- fixed column order, allowing for
       s.id, s.quirk, s.isDuke        <-- high performance: resultset.get(++columnIndex)
  FROM whatever AS w
 INNER JOIN sumfin AS s
         ON w.id = s.fk
 WHERE w.id IN (?, ?, ?)              <-- notice the variable amount of parameters, determined by Collection.size()
   AND age < ?
where the parameters are converted/transformed and shoved into the PreparedStatement.



Would I open-source it? Nevah! No time to give support to mere mortals! Emo

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 486
Exp: 7 years



« Reply #5 - Posted 2014-10-29 15:01:11 »

Would I open-source it? Nevah! No time to give support to mere mortals! Emo

Sounds like you need the DAMAIL: https://github.com/nslater/DAMAIL
Offline Nate

« JGO Bitwise Duke »


Medals: 167
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #6 - Posted 2014-10-29 17:50:00 »

I just ripped out the column definition parsing stuff completely, since it was only there for the ORM stuff.

For OS X the JNA would need to be figured out for system-wide keyboard hooks, a system tray icon, and clipboard monitoring and manipulation. That stuff shouldn't be terribly hard, but I find working on OS X pretty painful (extremely painful). Contributions are welcome! Cheesy For OS X try:
http://www.clipmenu.com/
https://itunes.apple.com/us/app/flycut-clipboard-manager/id442160987?mt=12

Also the best alternative to Clippy on Windows is Ditto:
http://ditto-cp.sourceforge.net/
Ditto seems a lot more configurable than ArsClip and does search better. Both have lots of features that I'm not interested in though. Clippy is Java and much simpler, which makes it easier to make it do (and look) exactly what I want. I think contributing to Ditto would relatively difficult, it being such a large C++ project.

Pages: [1]
  ignore  |  Print  
 
 

 
Riven (33 views)
2019-09-04 15:33:17

hadezbladez (3979 views)
2018-11-16 13:46:03

hadezbladez (1443 views)
2018-11-16 13:41:33

hadezbladez (3978 views)
2018-11-16 13:35:35

hadezbladez (768 views)
2018-11-16 13:32:03

EgonOlsen (4083 views)
2018-06-10 19:43:48

EgonOlsen (4655 views)
2018-06-10 19:43:44

EgonOlsen (2752 views)
2018-06-10 19:43:20

DesertCoockie (3646 views)
2018-05-13 18:23:11

nelsongames (3840 views)
2018-04-24 18:15:36
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!