Wednesday, October 31, 2012

4 Min

See if I can make it while downloading another Eclipse download...

Apparently, there is an Eclipse download with Maven built in. Name ends in "for Java".

That's good; I didn't know. Installing via the 'Software Update' always irritates me, with first adding a url to a download site, which you can't find via the GUI (I think?), and which is hard to google up anyway.

--

No, download still downloading. What can I add in 1:22, ..., 1:14, ..., never mind.

AWS Alarm Is Super Easy to Set

See this: http://impossible-is-development.blogspot.se/2012/11/aws-alarm-super-easy-to-set-warning.html

---

My blog posts are 2/3 whining, aren't they. But there's the occasional happiness, when some thing or other goes friction free. Here's an example: setting an alarm in AWS is really straightforward. For instance, "when CPU is above 60% for 15 minutes, send me email".

And the same status is shown clearly with a green check mark, so you don't need to rely on your inbox.

OTOH, it hasn't triggered yet...but why shouldn't it work; they send me email about new features every other day it seems...

Me's Features

...and why not make a Misfeature List for thine own self, good blogger? Long one, or weighty bullet points on it?

--

Aka "Number One Features", b-pssh.

Java Misfeatures Collection

The Misfeature Collection blogging pattern again, applied to Java, the language.  Things big and small.

1) There should be a 'Integer' super-type for all the integer types (Byte, Short, Integer, Long). The name's taken, unfortunately. That's another misfeature, but understandable, 'int' was inherited from C/C++, I suppose. They could've named Integer as Int; and had Integer as the super-type name.

1a) Same thing for floating-points, of course. 'float' is traditional. But float could've been 'Single', IIRC there are languages that use 'single' as the name of single-precision FP numbers.

2) Annotations should fit in better with interfaces. Lots of good reasons for this; and only the 'tools' excuse on the other side, right?

// THIS TOO, SHALL AMASS //

Monday, October 29, 2012

Eclipse-Java-Maven-Svn Issue Top-N List

Let's do the same for the Eclipse-Java-Maven-Svn accretion as I did in the Javascript-Sucks blog entry: collect list of the most irritating issues.

1) Svn/Subclipse client implementation crappiness. Stuff like:

"Problems reported while synchronizing SVNStatusSubscriber. 0 of 1 resources were synchronized.", "Error getting status for resource", "org.tigris.subversion.javahl.ClientException: Working copy not locked; this is probably a bug, please report",  "svn: Directory '...' containing working copy admin area is missing". 

2) Multi-module maven projects, complaint A: why do they all have to be their own project; or rather: why do they all have to be displayed in a top-level project list?


3) Multi-module maven projects, complaint B: enabling Workspace Resolution (which is a good thing, mostly): why can't I inspect the imported jar as for the jars in Maven Dependencies that are not W.R. enabled? (Solution: temporarily disable; so not a huge deal.)

4) No good svn 'clone' command. What I do now for discrete files is either: Procedure A: 1) usually make sure it's committed, 2) 'rename' and 3) then 'revert' only the old deleted file. Or Procedure B: 1) drag a file 2) revert old location. File contents usually need to then change also, e.g. type name in A, package name in B. There's also Procedure C: use the svn CLI in the terminal.

5) There seem to be no 'fix all package declarations' command. This would be useful after some of the above mentioned svn clone operations. 'Fix imports' does exist. Fixing package declarations would be trivial to implement, easier than 'Fix imports'.

--

6) Subclipse bugs. Sheesh. For instance: renaming a folder. First step is easy: rename the folder. Committing the 'new' folder usually works. But then, Subclipse, or SVN, decides that there is some sort of conflict and refuses to commit without a dance involving at some point the 'Mark as Resolved' command. (Maybe helps if you always to 'update' on the parent folder of the original folder before the rename? Will probably never remember this, so mileage may vary.)


--

I won't ever have to create new blog posts, just keep piling up.

7) The set SVN property dialog. "Another property has the same name". WT*? So why don't you fetch it so I can edit the value? Or at least let me save a new value without going back and removing the property, should I choose to do so?

--

8) You can't just get by with a pom.xml for maven projects, the '.classpath' has to be in sync too. See http://impossible-is-development.blogspot.com/2012/11/basic-maven-project-build-fix-tip.html.

9) The '.classpath' generated for maven projects will include the test path too. Fertile element for spawning build error fallout, unless you also run CLI builds to be sure you don't reference any of the classes or things in the test tree.

--

10) "Working copy not locked; this is probably a bug, please report
svn: Are all the targets part of the same working copy?"

Oh right:
11) The fantastic misdesign where all the svn checks are done _after_ we've filled in the commit dialog.  And the dialog is closed. And the settings are mostly _not_ remembered.

--

This is no longer a Top-N list; it's just a pile of 'dirt'.

12) Dialog "Launch Error": '[editor/selection] does not contain a main type', etc. WT*: I ran it three minutes ago. And I am looking at this: "public static void main(String...args) {". And I haven't changed it. Some internal cache bug? Eclipse exit-relaunch helped none. Clean? Let's try...no. ...stumped.

--

13) This is a classic one: Alt-Click on a project (usually) will unfold the whole tree. This can take...some...time. Usually ends up in killing Eclipse and restarting. Nowadays, with a SSD, it usually never takes that long. But sometimes, like right now; and I don't know what's makes now a bad time to unfold. -- A timeout here would be nice; or simply a limit on the number of unfoldings.


-- MORE TO COME... --

Sunday, October 28, 2012

Double Period Brings Completion


Context: Eclipse JS Editor. 

The "|" in below examples is the caret. Cmd-Space in this situation: 

list_elem.|

does not bring up any proposals. But in this situation: 

list_elem..|

...useful proposals are shown! Wt*?

JavaScript Development Sucks

I'll try to be constructive. First, I'll collect a list of things that are ...bothersome. Then, each problem can get its own blog post, at least the non-trivial problems, with discussion and hopefully some solutions or work-arounds.

This list is about developing using a browser, not about running Node.js or something like that.

Here we go...

JavaScript Development Issues

Tool Issue:

Issue: Fake read-only files in browsers. I often edit the source code in the browser by mistake; and then I can't save the edits.

Issue #2: Staying stopped at breakpoint uses two cores (in Chrome). Slows down the whole computer. Also makes fan noise, burns energy, creates heat.

Issue #3: Debugger not active on some reloads.


Issue #4: Chrome crashes when my Java server is terminated. (Solution: close affected tabs, so that the connections close. Without connections, Chrome seems to do fine.)

Issue #5: Sometimes getting stuck before anything at all is shown: no page, no debugger, nothing but whiteness.

Issue #6: Dependency management.

Issue #7: Editors/IDE.

Issue #8: Eclipse Java + JS == not true. a) When a JavaScript view is open, you can't do Open Type. Very annoying. b) 'Run' command on JS file gives me: 'Not on JS build path'. Damn annoying.


Issue #10: Too dynamic. No type system. No constants. No block scope.

...to be continued.

Chrome Debugger Multithreading


This is what multithreading means in the context of the Chrome Javascript debugger:

1023 Google Chrome Helper 81.9 5 111.9 MB  Intel 1025 Google Chrome Renderer 70.3 6 78.5 MB   Intel

So it makes use of multiple cores: 


This, when halted at a breakpoint. Well, winter's nearing, and it's probably going to be a cold one, so we may need the extra heating. And maybe Chrome 23 will fix this...right. 

I'd really like to know what it's doing with these cycles. 

Thursday, October 25, 2012

Maven Dependency Type 'jar' Not Added Automatically

After a half-hour or so of not understanding why some Java imports didn't work.

I noticed that the letters 'jar' was missing from the dependency listing.

I had tried using the Eclipse maven assist GUI to add a dependency.

And apparently the it's not enough to just search for the dependency and say OK when selected.

Which is Odd because I've done it a few times and it's worked fine.

All these little things.

All. These. Little. Things.

That.

Add.

Up.

To.

A.

Large Amount Of Wasted Life And Time And Money.

Yesterday Eclipse, Today Eclipse; Extra Character

Just had a weird error, where it looked like Eclipse thought that a Java file was at the source root level, aka default package, and Quick Fix wanted to remove the package declaration. "Oh god, not another one" would be a nice description of the sentiment.

Thought it was another Svn problem, so I opened the Properties dialog, to find out what could be found out. Today is a much better day than yesterday, so it had nothing to do with Svn. The end of the path looked like this:
api/pub/annot%C2%A8/ApiPath.java
So then I looked in the GUI, and sure enough, there is some trema-looking extra character there that I didn't see, that I must've added inadvertently.

But I don't know why it made Eclipse think wrong about the packages.

This might mean that package names aren't allowed to be any unicode? If so, that's an unfortunate irregularity: other Java identifiers can be in unicode. But it's probably just that diacriticals are not allowed as characters in their own, which is very sensible. The Character.isJavaIdentifierPart method tells which characters are allowed, which is what I learned from this incident.

--

Today's UTF-8 character is: http://en.wikipedia.org/wiki/Diaeresis_(diacritic).

And as you can see at  http://www.fileformat.info/info/unicode/char/a8/index.htm, this character cannot be part of a Java identifier; the Character.isJavaIdentifierPart is false.

Wednesday, October 24, 2012

SVN Delete-Revert For Cleanup

In Subclipse, instead of the 'cleanup' command, simply delete and revert instead. If you don't have any uncommitted changes, of course. Works much better.

Firefox: No "innerText"?

Wow, 'innerText' is not supported in Firefox?
And something called 'textContent' is more standard?
New stuff to learn every day. Good thing I decided to try Firefox for a while; it's been months.

Just wrap everything in jQuery, I guess. 

Firefox Debugger GUI

It appear to be the case that...

...the breakpoint markers cover the green instruction pointer completely?!

Oh, and how hard would it be to add the keyboard shortcut to the step button tooltips?

[...let's try installing Firebug and see if that's better...]

Ok, Firebug installed. Conflicting Dashboard F12 binding disabled (Dashboard -- what is it good for?).

Oh, 'Debugger not activated'....how do you turn it on...

Oh, the other debugging session with the built-in debugger caused it to not work.

Ah, finally. And praise the firebug developers or whatever: the Firebug 'instruction pointer' is on top of the ...breakpointers.

...and, more goodness: the step buttons have shortcuts in their tooltips!

Tuesday, October 23, 2012

Curl Is Great

Trying some HTTP code I've written. A redirect works in Chrome, but not in Safari, and not in Firefox.

What gives?

The developer tools in Safari and Firefox are not up to the job. I have some potential posts on the webkit developer tools queued up, so let's leave it at that for now.

So, after a while, my thoughts turn to telnet. But before I get to try it, I get a better idea, as it would turn out: trying the 'curl' command. (The headline should perhaps read cURL, for the capitalization pedants.)

And this message is written to the terminal:
* no chunk, no close, no size. Assume close to signal end
Aha! Yes of course. This is what the words 'good feedback' can mean.

You just need to give curl the '-v' option.

IntelliJ And Eclipse (Mis)Feature

Trying IntelliJ 11 CE (Community Edition, Free or something).

Partial word search is just as wrong as in Eclipse: no reordered matching, no initial wildcard by default.

Amazing. Does such a vast majority of all developers remember what their names start with? And the ordering of the words of their RatherLongMultiWordCamelCaseIdentifiers?


Ipad Mini Pixel Reservations

Here's a "Not programming." post. Might draw some readers, perhaps...

I have an idea, which at least sounds plausible inside my head; and publishing it here would allow me to say 'you read it here first'  tomorrow. Or next year, or whenever the idea gets hardwared.

It's about a simple way to be able to keep the size of the iPad screen in the iPad Mini, but be able to cut off upwards of an inch on the physical size of the device, and still solve the holding problem. What you do is simple: cover the whole area in pixels. Then, using the touch sensors that come with those pixels on a touch screen, it's trivial to detect where the device is being held, and move the displayed image to the non-obstructed area.

The drawback is the cost of those extra pixels. But the cost of screens go down with time, so the price might be the same as the original size screen, one year later.

And, you get some extra pixels. For Apple, those pixels might not be very useful, since part of their success is finding the Right Size, and then standardize on that screen size. So most apps may not be able to make use of the extra pixels.

There is of course the possibility of scaling. But scaling at these ratios may produce ugly artifacts, and even the high pixel density of a Retina screen may not be enough to counter these effects. Worth trying, though. Maybe scaling up to the extra pixels might work. But not keeping the same pixel count and scaling down to move the display area to a non-occluded area. I think it depends heavily on the specific graphics displayed by different applications; it could work for many apps, but not so well for some other.

Without scaling, what might these extra pixels be used for? Well, screen-size-aware applications could of course make good use of them. Or they could be used for notifications that don't intrude on the pixel area of the running application.

And how about this: I'm too lazy right now to calculate it, but the 16:9 ratio might be achievable. Then there is at least a use for the wide extra pixels. But to get there, maybe too much area has to be added in the tallness direction. On the other hand (no pun intended), when showing movies, you usually don't need to hold it, but you can prop it up in a stand or something. Or you can hold in at the lower long edge side. So you can use the extra pixels on both sides.

So that could make for a slighty odd-looking alternative: a less wide iPad, but same tallness. But the world would get used to it pretty quickly. And copy it.

Well, there you have it: pixel reservations. Would be fun to see it realized.

Sunday, October 7, 2012

Friday, October 5, 2012

Eclipse vs VisualVM, JProfiler, YourKit

If you're in doubt as to which running Eclipse process you attached one of these profilers to, you only have to tab through the apps in the app selector, and the one that doesn't respond, is it. Or on OSX, open Activity Monittor. The one at 100% CPU, that's it.

What is the design target for these profilers? "Hello World"?

(Ok, I know I am being unreasonable, as usual.)

13K Methods Is a Bit Much

Profiling Eclipse 'Quick Type Hierarchy' popup using VisualVM:


...and VisualVM and the target both grind to a halt, or at least something indistinguishable from a total stand-still. And this is after giving VisualVM 1400MB max mem. I forgive it for locking up when it had filled up a measly 256MB, the 'factory' setting in the visualvm.conf file. And this time, the modal dialogs are responsive -- compare last blog post.

The mystery is, why does Eclipse have to call 13K methods to index?

I suspect that it actually does not. Instead, I think that it loads all those classes that it indexes. And I suspect instead that VisualVM overrides the class loading code to instrument everything that gets loaded.

There could not be a much worse match of profiler algorithm and profilee activity...


VisualVM Irony? (Picture)


(EDIT: Well, I guess it's not entirely apparent from the picture, but the VisualVM is X-Tremely unresponsive here.)

(EDIT2: ...if only GUI implementation people would realize (both meanings!) the usefulness of threads...)

(Just one more clarification: The buttons of the dialog/s are totally unresponsive.)

(See next post. Editing visualvm.conf to offer more memory to VisualVM fixed the dialog responsiveness. And some of the GUI responsiveness, generally, at least when the instrumentation was reported as finished.)