preferences

Creating form for rails-setting

不羁的心 提交于 2019-12-06 14:38:06
In my Rails app, I'm using the gem rails-settings to save a user's email notification settings. I'm trying to create a form to update a user's notification settings. It should consist of a set of checkboxes where the user selects what they want to receive email notifications about. In the rails-setting README, there are no examples of how to integrate it with a form. The closest tutorial I found was listed in the issues: https://github.com/ledermann/rails-settings/issues/46 But I'm not sure what the actual form element would look like in my view. For example, if I wanted to create an input

Algorithm for picking thumbed-up items

浪子不回头ぞ 提交于 2019-12-06 14:23:42
问题 I have a Pandora-like piece of software where the user can thumb up a song or thumb down a song. The software, called Chavah, is Silverlight + C#, but this is a language- and platform-neutral question. My software needs to choose a song based on the user's preferences. I need a good algorithm for this. I want my software to choose a song to play given the following requirements: Thumbed up songs should be favored, and played regularly. Unrated songs (neither thumbed up nor down) should still

Working with Windows registry using java.util.prefs.Preferences

走远了吗. 提交于 2019-12-06 12:46:09
问题 I have some questions about the registry. We have Preferences p = Preferences.userRoot(); If we execute p.nodeExists("/HKEY_CURRENT_USER/Software/Policies/Microsoft") it will return true. After it: p = p.node("/HKEY_CURRENT_USER/Software/Policies"); for(String s : p.childrenNames()){ System.out.println(">" + s); } We see that it has one child: "Windows". But p.nodeExists("/HKEY_CURRENT_USER/Software/Policies/Microsoft/Windows") returns false. Why? Thanks. UPDATE Ok. I have some mistakes. Let

Change browser preferences in runtime?

倖福魔咒の 提交于 2019-12-06 11:58:32
问题 Can we change browser preferences in runtime? Is there any possibility to changes the browser preferences set before launching the browser during execution programmatically? Example: I have set the following preferences before launching the driver firefoxProfile.setPreference("pdfjs.disabled", true); firefoxProfile.setPreference("plugin.scan.plid.all", false); firefoxProfile.setPreference("plugin.scan.Acrobat", "99.0"); I want to change the preference to : firefoxProfile.setPreference("pdfjs

Using SharedPreferences across multiple classes?

时光怂恿深爱的人放手 提交于 2019-12-06 11:52:30
I have a SharedPreferences that currently works in one class but doesn't work in a second class. I think I might be calling it wrong, because the error I get says: The method getSharedPreferences(String, int) is undefined for the type CheckPreferences The code that works correctly with the SharedPrefernces is this: public void loadApp() { setContentView(shc_BalloonSat.namespace.R.layout.main); alert = new AlertDialog.Builder(this).create(); //String returned = ""; lastpacketsPHP = ""; pref = getSharedPreferences("shared_prefs", 1); prefEditor = pref.edit(); //prefEditor.putString

Is this a known issue in firefox extensions on Mac OS?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 11:12:37
问题 I've developed a firefox extension which contains a small dialog defined by this XUL script: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <prefwindow id="firenowPreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Fire.Now" ondialogaccept='onSave();' onload="checkFields();"> <script type="application/x-javascript">function onSave(){ alert('blablabla');}</script> <prefpane id="pane1"> <grid> <rows>

Remove yellow class name popup (breadcrumb) from IntelliJ IDEA

♀尐吖头ヾ 提交于 2019-12-06 11:07:56
I just want to get rid of these yellow rects that keep popping up in IntelliJ IDEA. The "class name popups" are actually called breadcrumbs and can include other things such as method names. They're clickable and used to ease navigation. You can disable them in the IntelliJ Preferences by going to Editor -> General -> Appearance and unchecking Show breadcrumbs . See my image below. 来源: https://stackoverflow.com/questions/42616133/remove-yellow-class-name-popup-breadcrumb-from-intellij-idea

SwitchPreference Callback behaviour change in lollipop

我的梦境 提交于 2019-12-06 06:06:51
In our project we are using SwitchPreference similar to wifi settings.user can toggle value by clicking on toggle button and user can see more options by clicking on title. But this is not working in lollipop. I can see some behaviour change in lollipop. In kitkat: When user taps on toggle button, onPreferenceChanged callback is called and when user taps on title, onPreferenceClicked is called. In lollipop: you tap on toggle button or title onPreferenceClicked is called always and after that onPreferenceChanged is called. How can I get same behaviour in lollipop? This behaviour is breaking our

How to launch browser when a preference is selected

一个人想着一个人 提交于 2019-12-06 06:04:47
I am creating a preference menu and would like to launch a browser (with a specific url) when a particular preference is clicked on. I know this can be done, but I cant seem to get it to work right now. Any ideas? Thanks ######SOLUTION So after my brain fart disappeared, this is what i did: getPreferenceManager() .findPreference("my_preference_key") .setOnPreferenceClickListener( new Preferences.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse("http://some_url_here"));

Android Preferences - changing the order in which they appear

爷,独闯天下 提交于 2019-12-06 05:26:41
I'm trying to create a hierarchy of classes which start with a PreferenceActivity . The idea is the base class contains the 'About Me' button, then the next class implements the generic preferences for games/apps/wallpapers and then the next class adds the the specifics for each actual Game/App. The idea works well BUT because I'm 'adding' preferences from XML at each level, they appear with the most generic (lowest level) ones first (e.g. my 'About' button). Ideally I'd like them to be the other way up - so that specific preferences appear at the top of the list and generic ones at the bottom