Related Posts
Java: Have a JTable’s column preferred width adjusted perfectly to the size of the longest string in the model
Here’s a utility method I’ve coded for FrostWire’s partial download dialog. With it I’m able to adjust a JTable’s column by iterating over the table’s column model data and calculating the exact dimensions required to render the longest string found. You can specify a maximum width (to avoid some really long strings from screwing up […]
add ssh identities to your ssh agent when you start your bash session
Put this somewhere on your .bash_profile [bash] function addSSHIdentities() { pushd ~/.ssh #add all your keys here ssh-add some_private_key ssh-add some_private_key_2 ssh-add some_private_key_3 … ssh-add some_private_key_N popd } function startSSHAgent() { SSH_AGENT_PROCESSES=`ps aux | grep ssh-agent | grep -v grep | wc -l` if [ $SSH_AGENT_PROCESSES -gt 0 ] then echo "SSH Agent was running. […]
How to create a list that holds different object types using `void*` in C.
I remember being in school back around 1998 and not knowing enough about C to do this. After coding in other languages, then going back to C++ and understanding at a lower level how references and pointers work, this was pretty easy to figure out. In this exercise I store elements of different types in […]