Android configuration
545358
protected function addAndroid()
    {
        $this->root->
            children()->
                arrayNode("android")->
                    canBeUnset()->
                    children()->

                        scalarNode("timeout")->defaultValue(5)->end()->

                        // WARNING: These 3 fields as they are, outside of the c2dm array
                        // are deprecrated in favour of using the c2dm array configuration
                        // At present these will be overriden by anything supplied
                        // in the c2dm array
                        scalarNode("username")->defaultValue("")->end()->
                        scalarNode("password")->defaultValue("")->end()->
                        scalarNode("source")->defaultValue("")->end()->

                        arrayNode("c2dm")->
                            canBeUnset()->
                            children()->
                                scalarNode("username")->isRequired()->end()->
                                scalarNode("password")->isRequired()->end()->
                                scalarNode("source")->defaultValue("")->end()->
                            end()->
                        end()->
                        arrayNode("gcm")->
                            canBeUnset()->
                            children()->
                                scalarNode("api_key")->isRequired()->cannotBeEmpty()->end()->
                                booleanNode("use_multi_curl")->defaultValue(true)->end()->
                                booleanNode("dry_run")->defaultFalse()->end()->
                            end()->
                        end()->
                    end()->
                end()->
            end()
        ;
    }
1336541
public void configure() {
	  if (configurator != null && !underConfiguration.get() &&
			  underConfiguration.compareAndSet(false, true)) {
		 try {
			  configurator.configure(this);
		 } finally {
			 underConfiguration.set(false);
		 }
	  }
  }
792390
def config(name='DATABASE_URL', default='sqlite://:memory:'):
    """"""
    config = {}
    s = env(name, default)
    if s:
        config = parse_database_url(s)
    return config
564061
public void configure(Configuration configuration){
		setConfiguration(Objects.requireNonNull(configuration));

		setValueFactory(null);

		resetInputFields();
		resetResultFields();
	}
724168
private function setupDefaultConfigs()
    {
        $this->setLayout();
        $this->setSummary();

        if (!$this->isEmpty()) {
            $this->setActionBar();
        }

        $this->showOnEmpty = false;
    }
251612
function askAndroidPrompt() {
    prompt.get({
        name: 'using_android',
        description: 'Are you using Android (y/n)',
        default: 'y'
    }, function(err, result) {
        if (err) {
            return console.log(err);
        }
        mergeConfig(result);
        askAndroidPromptResult(result);
        if (usingiOS || usingAndroid) {
            promptQuestions();
        } else {
            askSaveConfigPrompt();
        }
    });
}
70269
public final void setConfiguration(final URI newConfigFile, final byte[] configFileData)
            throws IOException {
        this.configFile = new File(newConfigFile);
        this.configuration = this.configurationFactory
                .getConfig(this.configFile, new ByteArrayInputStream(configFileData));
    }
616365
private void configureBounds() {
    Drawable underlyingDrawable = getCurrent();
    Rect bounds = getBounds();
    int underlyingWidth = mUnderlyingWidth = underlyingDrawable.getIntrinsicWidth();
    int underlyingHeight = mUnderlyingHeight = underlyingDrawable.getIntrinsicHeight();

    // In case underlying drawable doesn't have intrinsic dimensions, we cannot set its bounds to
    // -1 so we use our bounds and discard specified matrix. In normal case we use drawable's
    // intrinsic dimensions for its bounds and apply specified matrix to it.
    if (underlyingWidth <= 0 || underlyingHeight <= 0) {
      underlyingDrawable.setBounds(bounds);
      mDrawMatrix = null;
    } else {
      underlyingDrawable.setBounds(0, 0, underlyingWidth, underlyingHeight);
      mDrawMatrix = mMatrix;
    }
  }
1175048
@Override
  protected void configure() {
    try {
      InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());
      File appRoot = new File(System.getProperty(CadmiumListener.BASE_PATH_ENV), "maven");
      FileUtils.forceMkdir(appRoot);
      String remoteMavenRepo = System.getProperty(MAVEN_REPOSITORY);
      ArtifactResolver resolver = new ArtifactResolver(remoteMavenRepo, appRoot.getAbsolutePath());
      bind(ArtifactResolver.class).toInstance(resolver);
      bind(JBossAdminApi.class);
      Multibinder<ConfigurationListener> listenerBinder = Multibinder.newSetBinder(binder(), ConfigurationListener.class);
      listenerBinder.addBinding().to(JBossAdminApi.class);
      bind(IJBossUtil.class).to(JBossDelegator.class);
    } catch(Exception e) {
      logger.error("Failed to initialize maven artifact resolver.", e);
    }
  }
1097668
@Override
    protected void configure() {
        // ***** Properties *****
        URL resource = getClass().getResource("/URIMapper.txt");
        if (resource == null) {
            log.debug("No /URIMapper.txt resource exists.");
        } else {
            bind(File.class).annotatedWith(Names.named("uri-mappings")).toInstance(
                    new File(resource.getFile()));            
        }
    }
1285487
public static void config(JSONObject jsonObject) {
        config(jsonObject.getString("host"), jsonObject.getString("personal"), jsonObject.getString("from"),
                jsonObject.getString("key"), jsonObject.getInteger("port"));
        setSslEnable(jsonObject.getBoolean("ssl"));
    }
617719
@Override
    public void onConfigurationChanged(Configuration newConfig) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
            super.onConfigurationChanged(newConfig);
        } else if (mMenuView != null) {
            mMenuView.onConfigurationChanged(newConfig);
        }

        // Action bar can change size on configuration changes.
        // Reread the desired height from the theme-specified style.
        TypedArray a = getContext().obtainStyledAttributes(null, R.styleable.SherlockActionBar,
                R.attr.actionBarStyle, 0);
        setContentHeight(a.getLayoutDimension(R.styleable.SherlockActionBar_height, 0));
        a.recycle();
        if (mSplitWhenNarrow) {
            setSplitActionBar(getResources_getBoolean(getContext(),
                    R.bool.abs__split_action_bar_is_narrow));
        }
        if (mActionMenuPresenter != null) {
            mActionMenuPresenter.onConfigurationChanged(newConfig);
        }
    }
536374
protected void addAppConfigToCategory(I_CmsWorkplaceAppConfiguration appConfig) {

        CmsAppCategoryNode node = m_nodes.get(appConfig.getAppCategory());
        if (node == null) {
            LOG.info(
                "Missing parent ["
                    + appConfig.getAppCategory()
                    + "] for "
                    + appConfig.getId()
                    + " / "
                    + appConfig.getClass().getName());
        } else {
            node.addAppConfiguration(appConfig);
        }
    }
200178
protected function setupConfig()
    {
        $source = realpath(__DIR__.'/../config') . "/nem.php";
        if (! $this->isLumen())
            // console laravel, use config_path helper
            $this->publishes([$source => config_path('nem.php')]);
        else
            // lumen configure app
            $this->app->configure('nem.config');

        $this->mergeConfigFrom($source, 'nem.config');
    }
1147166
@Override
    protected void configure() {
        // ***** Properties *****
        java.util.Properties properties = new java.util.Properties();
        URL resource = getClass().getResource("/rsimulator.properties");
        if (resource == null) {
            properties.setProperty("simulatorCache", "false");
        } else {
            try (BufferedInputStream bis = new BufferedInputStream(resource.openStream())) {
                properties.load(bis);
            } catch (Exception e) {
                log.error("Error reading properties from: {}", resource.getPath(), e);
            }
        }
        bind(java.util.Properties.class).annotatedWith(Names.named("rsimulator-core-properties")).toInstance(properties);

        // ***** Handlers *****
        Map<String, Handler> map = new HashMap<String, Handler>();
        JsonHandler jsonHandler = new JsonHandler();
        requestInjection(jsonHandler);
        TxtHandler txtHandler = new TxtHandler();
        requestInjection(txtHandler);
        XmlHandler xmlHandler = new XmlHandler();
        requestInjection(xmlHandler);
        map.put("json", jsonHandler);
        map.put("txt", txtHandler);
        map.put("xml", xmlHandler);

        bind(new TypeLiteral<Map<String, Handler>>() {
        }).annotatedWith(Names.named("handlers")).toInstance(map);

        // ***** Interceptors for cache and script *****
        CacheManager.create();

        bind(net.sf.ehcache.Cache.class).annotatedWith(Names.named("SimulatorCache")).toInstance(
                CacheManager.create().getCache("SimulatorCache"));
        bind(net.sf.ehcache.Cache.class).annotatedWith(Names.named("FileUtilsCache")).toInstance(
                CacheManager.create().getCache("FileUtilsCache"));
        bind(net.sf.ehcache.Cache.class).annotatedWith(Names.named("PropsCache")).toInstance(
                CacheManager.create().getCache("PropsCache"));

        SimulatorPropertiesInterceptor simulatorPropertiesInterceptor = new SimulatorPropertiesInterceptor();
        SimulatorCacheInterceptor simulatorCacheInterceptor = new SimulatorCacheInterceptor();
        SimulatorScriptInterceptor simulatorScriptInterceptor = new SimulatorScriptInterceptor();
        FileUtilsCacheInterceptor fileUtilsCacheInterceptor = new FileUtilsCacheInterceptor();
        PropsCacheInterceptor propsCacheInterceptor = new PropsCacheInterceptor();

        requestInjection(simulatorPropertiesInterceptor);
        requestInjection(simulatorCacheInterceptor);
        requestInjection(simulatorScriptInterceptor);
        requestInjection(fileUtilsCacheInterceptor);
        requestInjection(propsCacheInterceptor);

        // Order is significant
        bindInterceptor(Matchers.subclassesOf(Simulator.class), Matchers.annotatedWith(Properties.class),
                simulatorPropertiesInterceptor);
        bindInterceptor(Matchers.subclassesOf(Simulator.class), Matchers.annotatedWith(Cache.class),
                simulatorCacheInterceptor);
        bindInterceptor(Matchers.subclassesOf(Simulator.class), Matchers.annotatedWith(Script.class),
                simulatorScriptInterceptor);
        bindInterceptor(Matchers.subclassesOf(FileUtils.class), Matchers.annotatedWith(Cache.class),
                fileUtilsCacheInterceptor);
        bindInterceptor(Matchers.subclassesOf(Props.class), Matchers.annotatedWith(Cache.class),
                propsCacheInterceptor);
    }
134298
public void openSettingsScreen() {
        Intent intent = new Intent();
        intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
        Uri uri = Uri.parse("package:" + context.getContext().getPackageName());
        intent.setData(uri);
        context.startActivity(intent);
    }
791794
function parseAndroidPreferences(preferences, configData){
        var type = 'preference';

        _.each(preferences, function (preference) {
            // Extract pre-defined preferences (deprecated)
            var target,
                prefData;

            if(preference.attrib.name.match(/^android-manifest\//)){
                // Extract manifest Xpath preferences
                var parts = preference.attrib.name.split("/"),
                    destination = parts.pop();
                parts.shift();

                prefData = {
                    parent: parts.join("/") || "./",
                    type: type,
                    destination: destination,
                    data: preference
                };
                target = "AndroidManifest.xml";
            }

            if(prefData){
                if(!configData[target]) {
                    configData[target] = [];
                }
                configData[target].push(prefData);
            }
        });
    }