While writing my thesis, I have a few individual pages that needs to be landscape (while the other pages are portrait). To do this in Word 2007:
- Go to the page that needs to be on a different Orientation
- Go to Page Layout tab -> Margins -> Custom Margins
- Select the orientation, use Apply to This Point Forward
- Go to the next page, repeat steps 2-3, but change the orientation back
Posted in Information.
Tagged with 2007, ms word, page orientation.
I don’t like having warnings in the code, and recently I’ve been getting a lot of these, these seem to popup after you accidentally press the Validate button in Eclipse…
No grammar constraints (DTD or XML schema) detected for the document.
Anyway, it is a easy fix, set the Validator to ignore (See screenshot below). Once you have changed the setting, you may have to Validate the files again (right click file -> Validate)

Posted in Android, Java.
Tagged with android, dtd, grammar constraints, java, xml schema.
Upon reading the documentation on SharedPreferences edit() carefully, it actually says that the method returns a new editor instance. This means that the following doesnt actually do anything:
prefs.editor().putString("name1","val");
prefs.editor().putString("name2","val");
prefs.editor().commit();
Instead, this must be done:
SharedPreferences.Editor ed = prefs.edit();
ed.putString("name1","val");
ed.putString("name2","val");
ed.commit();
Or, for single values we can do:
prefs.editor().putString("name2","val").commit();
Posted in Android, Java.
Tagged with android, commit, java, SharedPreferences.
This is for QtJambi
Ran into a funny problem with the itemAt() function of QGraphicsScene. I had a custom QGraphicsItem which is a circle with text in it (a node for a graph basically). The boundingRect, sceneBoundingRect, contains and all the other positional methods checks out correct with the custom item, but the itemAt function only works if I click on the bottom half of the shape.
Can’t really override the itemAt() method either since its final. But to write a custom itemAt, try the following:
private QGraphicsItemInterface itemAt(QGraphicsSceneMouseEvent e) {
for (QGraphicsItemInterface item : this.items())
if (item.sceneBoundingRect.contains(e.scenePos()))
return item;
return null;
}
Posted in Java, Qt.
Tagged with itemAt, java, QGraphicsItem, QGraphicsScene, qt, QtJambi.
Just saw an article that had a list of companies that needs to be contacted when moving, thought it would be a good idea to compile one for myself:
- DMV
- USPS (www.usps.com/umove)
- Insurance
- School (For UCLA this is in URSA)
- Bank
- Department (if with GSR)
- Phone company
- Cable/ISP
- Professional Organizations (IEEE, ACM etc)
Anything missing?
Posted in Living, Personal.
Tagged with address change, moving.
In short, you can’t create generic arrays (i.e. new GenericType<T>[1] is not allowed) as doing so would give you a “Cannot create a generic array of …” error.
A quick work around is to create a generic list instead of the generic array. So the example above can be instanced as new List<GenericType<T>>
Posted in Java.
Tagged with generic array, generic list, generics, java.
Upon trying to submit a final manuscript to ACM I found out that I needed to add a General Terms section and a Categories and Subject Descriptor Section. Seemed rather confusing to use the first time, and their guide is rather long. Here is a quicker guide:
For General Terms:
For Categories and Subject Descriptor:
- Goto http://www.acm.org/about/class/ccs98-html
- Find words related, select from the bottom most level (e.g. I.5.4 -> Signal Processing)
- In the paperm Categories and Subject Descriptor under Abstract, insert: Descriptor# [2nd Level Title] Third Level Title — Keyword
- Separate by ;
For example, I have I.5.4, Signal Processing and D.2.11, Domain-specific architecture. I would have:
Categories and Subject Descriptors
I.5.4 [Pattern Recognition]: Applications – Signal Processing; D.2.11 [Software Engineering]: Software Architecture – Domain-specific architectures
Notice that I.5 is Pattern Recognition, I.5.4 is Applications, and my paper’s area is Signal Processing
Posted in Information.
Tagged with acm, ACM classification system.
So for a while now, I noticed that the AirPort Extreme would have this blinking yellow light. Everything is working, but the light keeps blinking.
To solve this, start up the Airport Utility, select the device on the left, and at the bottom left corner of the main panel there would be a text along the lines of “Press Continue to solve detected problem”. In my case it was just a new firmware update available.
Posted in Technology.
Tagged with airport extreme, apple.