Thursday, May 31, 2007 12:25 PM | rahel luethy | 0 comment(s)
eclipse can be configured to issue all kind of compiler warnings: warnings about unused code, unparameterized generic types (e.g. List instead of List<String>), assignments with no effect (e.g. x = x), switch case fall-throughs, or exceptions that are declared but never thrown — just to name a few.
in the editor, such warnings are indicated with little yellow marks, and the files are flagged yellow as soon as they contain any warnings. at work, we have a "no-yellow" check-in policy, i.e. we have all of the warnings enabled and make sure we don't break any of the rules before we check in code.
these warnings help a lot with respect to having confidence in your code. in some cases however, you want to break the rules by intention. sometimes there's just no way around an ugly cast, in other cases eclipse is just not smart enough to see that what it thinks is a warning, is actually not a problem at all.
for instance, eclipse is not smart enough to see that in the code below, AbstractCar must declare an exception, even if it does not throw one (if you were to remove the declaration, the compiler would prevent BrokenCar from throwing one in the overridden method):
consequently, eclipse would flag line #9 with a warning (i bet idea is clever enough to get this one right?).
fortunately, warnings can be suppressed by the SuppressWarnings annotation. the annotation can be associated with different targets, i.e. you can tag complete types or just single methods/fields/parameters. moreover, you can be specific about what warnings should be suppressed. in the case at hand, we could use the unused token to suppress the warning:
the complete list of all tokens supported by eclipse 3.2 can be found at the very end of this document.
Thursday, May 24, 2007 9:01 PM | rahel luethy | 0 comment(s)
simply because i keep forgetting it: a minimal /etc/smb.conf to share a linux directory with your windows friends:
[global]
workgroup = WORKGROUP
netbios name = hostname
security = share
[music]
path = /local/music
read only = yes
guest ok = yes
browseable = yes
don't forget to (re)start the server via /etc/init.d/smb (re)start after any changes to the configuration file. on windows, the share can then be accessed via \\hostname\music.
like ben, i prefer IM to jetpacks. however, i am not a very enthusiastic instant messaging user. simply, because i try to keep all distractions to a minimum when coding. moreover, my IM client, psi, doesn't really cope with my virtual desktops. popping up notifications on hidden desktops obviously stretches the concept of instant messaging.
i've tried various other clients, but they all have different flaws: kopete (doesn't support proxies), gaim (kept crashing), pidgin (gaim's successor; no SuSE compatible binaries for lazy bumbs like me). anyway, last week i finally installed gajim. from their web site:
The goal of Gajim is to provide a full featured and easy to use Jabber client. Gajim works nicely with GNOME, but does not require it to run. It is released under the GNU General Public License.
bottomline: easy installation (linux & windows), google talk support, no obvious flaws.
Wednesday, May 16, 2007 11:01 PM | rahel luethy | 3 comment(s)
in the meantime, i had the opportunity to spend our scrum team's gold card on getting to know flex a bit better, and i must say that i like it quite a lot. flash stuff just looks very beautiful, and flex seems to be a framework with a well defined responsibility (the presentation layer), a nice set of widgets with excellent default behavior, and an easy to use API. consequently, with just a few lines of code you get quite impressive results.
unfortunately, this is not really the case for java. as much as i like java, the overhead of user interface development always turns out to be bigger than you would hope for, and this is already true for very basic functionality (let alone turning your grey frames into eye candy). the same is probably true for java based web-apps (we recently had to task out a struts-based web application: the numbers turned out impressively high and i am pretty sure that we haven't planned for any css-wizzardy).
i am thus very excited that sun's hopping onto the ria bandwagon as well: i've just watched their Java FX announcement webcast, and i wish i had another gold card to spend soon.
Wednesday, May 02, 2007 4:10 PM | rahel luethy | 1 comment(s)
first life is a 3D analog world where server lag does not exist.
get yourself a first life.