preferences

Using java.util.prefs.Preferences in Jython

I seem to be having trouble storing Java preferences using a Jython script. If in Jython 2.5 beta I use: clazz = Class.forName('mypackage.myclass') prefs = Preferences.userNodeForPackage(clazz); # or Preferences.userRoot() prefs.put('propertyname', 'yes') The preferences are not stored. If I then add: prefs.flush() I get java.u...

best practice for user preferences in $HOME in Python

For some (small) programs I'm writing in Python, I'd like to be able to set, store and retrieve user preferences in a file in a portable (multi-platform) way. I'm obviously thinking about a very simple ConfigParser file like "~/.program" or "~/.program/program.cfg". Is os.path.expanduser() the best way for achieving this or there's som...

How do I get the "Measurement Units" setting from OS X?

I want my app to display measurements in US or Metric based on the chosen setting in OS X's International preference pane. How do I get this piece of information from the OS in my code? ...

Maintaining a common set of Eclipse preferences

Whenever I switch workspaces/Eclipse installs I need to copy/redo the preferences: compiler settings; font sizes/families; code formatter; java code templates; editor templates; code clean-ups; I would like to maintain these settings in an unitary way, preferrably under source control. How can I do that? I know about 'copy setting...

Best practices for handling user preferences in an iPhone MVC app?

I'm developing my first iPhone app, and while implementing user preferences, I have a few questions on how to best implement this. Assume the basic MVC pattern: MainView displaying data stored in a Model object; MainViewController handling the app logic. For the options, I have an OptionsView and an OptionsViewController. A RootView...

Saving an image to the users preferences

Has anyone had any experience in saving app preferences (within app, not in Settings app) which involve images taken with the camera? The prefs include NSStrings, UIImage, BOOLs etc. The UIImage is a pic taken with camera. Could I store these all in an NSMutableArray and then just do something like this: [array writeToFile:[self dataF...

How to stop Visual Studio from auto formatting certain parts of code?

This seems like it should be really simple to do but I just can't figure it out. I want to allow Visual Studio to keep auto formatting my code as it is, except for this part: public SomeClass : BaseClass { public SomeClass() : base() { } } Why can't I have it look like this instead: public SomeClass : BaseClass ...

Best approach to save user preferences?

I have seen two different approaches in saving user preferences. APPROACH 1: Serializing them and saving in one of the column of USERS table APPROACH 2: Creating a separate table PREFERENCES and make a has_many association from USERS to PREFERENCES. Which one of the above two approaches would you prefer and what are the pros and cons...

Why doesn't VS 2008 IDE remember my preferences?

This is a very petty question that I'm only asking while compiling... ;) For some reason my VS 2008 IDE doesn't remember my window preferences when I close & reopen - it resets the window widths, locations, appearances etc. Where's the secret switch so that my IDE stays looking the way I want it? ...

Cocoa - Notification on NSUserDefaults value change?

Let's say I have a key @"MyPreference", with a corresponding value stored through NSUserDefaults. Is there a way to be Notified when the value is modified? Or could it be done through bindings? (But this case, instead of binding the value to a UI element, I wish my object to be notified of the change, so that I can perform other tasks....

Declaring ID for ASP.NET Controls

If you don't provide an ID for your declared controls in ASPX files, I know that VS will automatically generate one for you. Should I always give the controls a descriptive ID even when I won't be accessing them from the code-behind? ...

UserDefaults in system preference pane installed for multiple users in OSX...

Hi I have a background-only app that is controlled via a preference pane in the system preferences. To communicate between pref pane and app I use distributed notifications. User defaults are shared via [NSUserDefaults addSuiteNamed:]. This all works out very well. The problem occurs when the user installs the pref pane "for all users"...

Preference Pane

How do I create a preference pane for my app on Mac. Also, how do I make a preferences section for my app in the iPhone? Thanks for reading. ...

Storing Very Granular User Preferences

I've seen a few questions on here about storing user preferences, but they seem to be referring mostly to a fairly minimal set of preferences. I'm currently working on a highly customizable web app, which will need to store a great number of preferences, and I'm struggling with how to store them. The kind of preferences I'll be storing ...

Cocoa: Binding to an array of NSStrings which are stored in the application's preferences

OK, I'm feeling really REALLY stupid for asking this question, but I've managed to stump myself so hard that I doubt I have the proper detachment to figure out the answer for myself any more. My apologies in advance... I have been playing around with bindings for a while now and LOVE them. That and the KVO/KVC conventions built into O...

Possible to remove my app from settings app?

Previous versions of my app have used the Settings.bundle method to have some user preferences managed in the (external) settings app. I've done away with that now, but I'd like to be able to de-register my application so that old users who upgrade don't have a useless entry in their settings app. Any idea if this is possible? Thanks. ...

Xcode: changing double clicking file behavior

One of my projects suddenly had its double-clicking behavior changed and I don't know how to change it back. The behavior I want: Double clicking a source code file opens up a new window. The behavior I have: Double clicking a source code file opens the file in the existing window. This results in only allowing one window open for th...

Implement a RadioButtonPreference in Android

How can you implement a RadioButtonPreference in android? Just like the CheckBoxPreference. Are there any workarounds? ...

Should we deprecate the "Remember Me" checkbox and start assuming?

I've been thinking about this quite a bit lately, and I would like some feedback from this wonderful community. Is it safe to assume that a user wants to be remembered when they login? And if they are using a public computer, is it safe to assume that they are smart enough to logout before leaving? ...

Explicit or implicit execution control statement use

I sometimes use if (this._currentToolForeColor.HasValue) return this._currentToolForeColor.Value; else throw new InvalidOperationException(); other times I use if (this._currentToolForeColor.HasValue) return this._currentToolForeColor.Value; throw new InvalidOperationException(); The two are equivalent, I know, but I am...