How to open Visual Studio Code’s ‘settings.json’ file?

To open the User settings: Open the command palette (either with F1 or Ctrl+Shift+P) Type “open settings” You are presented with a few options¹, choose Open User Settings (JSON) This image was taken in the VS Code online editor Which, from the manual and depending on platform, is one of: Windows %APPDATA%\Code\User\settings.json² macOS $HOME/Library/Application\ Support/Code/User/settings.json … Read more

Maintaining a common set of Eclipse preferences

You could of course export/import those settings. The other approach is to enable project specific settings for some settings. We have a very small Git repository with those kind of files: .settings/org.eclipse.jdt.core.prefs (compiler problem settings and formatter rules) .settings/org.eclipse.jdt.ui.pref (cleanup rules, common code templates) The common settings are just copied/merged in each projects .settings directory, … Read more

How to configure “Shorten command line” method for whole project in IntelliJ

Inside your .idea folder, change workspace.xml file Add <property name=”dynamic.classpath” value=”true” /> to <component name=”PropertiesComponent”> . . . </component> Example <component name=”PropertiesComponent”> <property name=”project.structure.last.edited” value=”Project” /> <property name=”project.structure.proportion” value=”0.0″ /> <property name=”project.structure.side.proportion” value=”0.0″ /> <property name=”settings.editor.selected.configurable” value=”preferences.pluginManager” /> <property name=”dynamic.classpath” value=”true” /> </component> If you don’t see one, feel free to add it yourself <component … Read more

Maven command to determine which settings.xml file Maven is using

Start maven with -X option (debug) and examine the beginning of the output. There should be something like this: … [INFO] Error stacktraces are turned on. [DEBUG] Reading global settings from c:\….\apache-maven-3.0.3\conf\settings.xml [DEBUG] Reading user settings from c:\….\.m2\settings.xml [DEBUG] Using local repository at C:\….\repository … (Original directory names are removed by me)

Reading dll.config (not app.config!) from a plugin module

You will need to load the x.dll.config (with the Configuration API) yourself. All the automatic file handling (including the .Settings) is all about machine.config/y.exe.config/user-settings. To open a named config file: Reference System.Configuration.dll assembly. Using System.Configuration Create code like: Configuration GetDllConfiguration(Assembly targetAsm) { var configFile = targetAsm.Location + “.config”; var map = new ExeConfigurationFileMap { ExeConfigFilename … Read more

Get font scaling factor to calculate the fontsize

I just found in the source code of Settings.System this function: /** @hide */ public static void getConfigurationForUser(ContentResolver cr, Configuration outConfig, int userHandle) { outConfig.fontScale = Settings.System.getFloatForUser( cr, FONT_SCALE, outConfig.fontScale, userHandle); if (outConfig.fontScale < 0) { outConfig.fontScale = 1; } } There is however the FONT_SCALE in usage so I checked for that Configuration class … Read more

Android: Changing NFC settings (on/off) programmatically

It’s not possible programatically without rooting device. But you can start NFC Settings Activity by intent action Settings.ACTION_NFC_SETTINGS for api level 16 and above. For api < 16 use Settings.ACTION_WIRELESS_SETTINGS Previous selected answer suggests to use WIFI_SETTINGS but we can directly move to NFC_SETTINGS Here’s the example : android.nfc.NfcAdapter mNfcAdapter= android.nfc.NfcAdapter.getDefaultAdapter(v.getContext()); if (!mNfcAdapter.isEnabled()) { AlertDialog.Builder … Read more

git whitespace woes

Git1.6.0.4 seems a bit old, especially if you consider that: in 1.6.3.4, “git apply –whitespace=fix” did not fix trailing whitespace on an incomplete line in 1.6.3.2, “whitespace” attribute that is set was meant to detect all errors known to git, but it told git to ignore trailing carriage-returns. Could you try with Git1.6.4.1, and rather … Read more

Store Dictionary in application settings

You can use this class derived from StringDictionary. To be useful for application settings it implements IXmlSerializable. Or you can use similar approach to implement your own XmlSerializable class. public class SerializableStringDictionary : System.Collections.Specialized.StringDictionary, System.Xml.Serialization.IXmlSerializable { public System.Xml.Schema.XmlSchema GetSchema() { return null; } public void ReadXml(System.Xml.XmlReader reader) { while (reader.Read() && !(reader.NodeType == System.Xml.XmlNodeType.EndElement && … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)