settings

Visual Studio Settings file - how does it work?

戏子无情 提交于 2019-11-30 09:47:48
I do not understand the following things: What is the difference between app.config (applicationname.exe.config) and settings file ? I am unable to locate the *.settings file in Windows7 AppData directory under the specific account (I heard that it should be located somewhere over there) ? Let's assume that *.settings file is somewhere on the hard drive. Why on the development time the data from settings file are copied to application config file? Kind Regards PK blak3r So the default settings are stored in the <exename>.config file located in the same directory as the executable. The reason

Store simple user settings in Python

两盒软妹~` 提交于 2019-11-30 09:46:48
I am programming a website in which users will have a number of settings, such as their choice of colour scheme, etc. I'm happy to store these as plain text files, and security is not an issue. The way I currently see it is: there is a dictionary, where all the keys are users and the values are dictionaries with the users' settings in them. For example, userdb["bob"]["colour_scheme"] would have the value "blue". What is the best way to store it on file? Pickling the dictionary? Are there better ways of doing what I am trying to do? Using cPickle on the dictionary would be my choice.

How to turn on VPN from iOS app? (Private APIs OK)

亡梦爱人 提交于 2019-11-30 09:41:00
When an iOS Device goes into "sleep mode", even a configured VPN is, unfortunately, turned off. A customer that wants an app for his iPad has to use VPN for security, so anything must be done through VPN. The app has to synchronize a lot, but the iOS device might turn off the VPN by itself. That's why I just need to trigger it again every time i need an internet connection (or keep it alive ). Do any of you guys have anything in mind? Even using Private API is ok (the app will only be distributed to a customer, not through App Store). Or using any app like Cisco AnyConnect would do the job.

how to activate the ios notification settings programmatically?

人走茶凉 提交于 2019-11-30 09:38:46
问题 My app registers for the notifications like this : [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert]; but if I manually go to the notifications settings, disable everything (notification center, alert, sound, badge) then uninstall and reinstall the app (or just reinstall without uninstalling first), my iPhone keeps the old settings. How can I force to reactivate these settings

keep settings in database

烈酒焚心 提交于 2019-11-30 09:24:38
In a reusable application (in which i don't want to change any code) i would like to change a SETTING var that the application uses (in its forms and maybe other parts) to be dynamic (update its contents from a db table). What would be the best approach to do that (a middleware maybe?) ? Look into the django-dbsettings project. Django-settings is another alternative. It was created about a year after this question was originally asked. Here is a grid of multiple such projects . 来源: https://stackoverflow.com/questions/1394126/keep-settings-in-database

Specify Django Test Database names in settings.py

前提是你 提交于 2019-11-30 07:46:42
问题 I'm specifying the databases using a python object: DATABASES = { 'default':{ 'ENGINE':'mysql', 'NAME':'testsqldb', 'USER':'<username>', 'PASSWORD':'<password>', }, 'dynamic_data':{ 'ENGINE': 'sqlite3', 'NAME':'', 'USER':'', 'PASSWORD':'' }, } How can I specify the name of my test database? I've been trying to use TEST_NAME = 'auto_tests' in the settings.py file. However, when I run python manage.py tests <app_name> I get the following message: Creating test database 'default'... Got an error

How do you refresh PreferenceActivity to show changes in the settings?

六月ゝ 毕业季﹏ 提交于 2019-11-30 06:52:42
问题 Based on the following code, can you tell me how to refresh the PreferenceActivity window to show changes in the settings immediately? For example: the user taps the master chime toggle checkbox to true (ticked), I would like the user to immediately see the other settings such as the ChimeOn15Past checkbox also be be true (ticked) SharedPreferences.Editor prefEditor = clockSettings.edit(); // Allow the settings to be changed. if (booleanMasterChimeToggle == true) { prefEditor.putBoolean(

Programmatically find whether installing from unknown sources is allowed

安稳与你 提交于 2019-11-30 06:49:53
I need to find whether the current Android device allows to install apps from sources other than the market. This option appears in the settings UI under Applications named "Unknown sources". The setting basically allows you to download and install APKs that did not originate from the Google app market. How do I check whether this flag is on or off using code? Here is the code that uses the mentioned setting: boolean isNonPlayAppAllowed = Settings.Secure.getInt(getContentResolver(), Settings.Secure.INSTALL_NON_MARKET_APPS) == 1; Also showing the setting to user might me useful: if (

iPhone - how to put Settings bundle seen through System Settings App into your own App?

折月煮酒 提交于 2019-11-30 06:33:48
问题 I want to create a settings page from within my app that looks exactly like the one that I would create in the System Settings Application using a Settings.bundle and Root.plist. Is there an easy way to access the controls like PSMultiValueSpecifier etc. and add them to an actual View? Thanks! 回答1: Yet another options: MySettings 回答2: Here's another solution: http://www.inappsettingskit.com/ InAppSettingsKit is an open source solution to to easily add in-app settings to your iPhone apps. It

Can I access web.config from my Azure web role entry point?

久未见 提交于 2019-11-30 05:47:51
问题 I have an Azure web role and I want to store some settings in web.config under <appSettings> tag. Yes, I'm aware of service configuration files, yet I have reasons to prefer web.config. When I execute (from here): System.Configuration.Configuration rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(null); if (rootWebConfig1.AppSettings.Settings.Count > 0) { } settings count is always zero although I've added a key-value pair under <appSettings> . What am I