text:
#include <QWidget>

class PlatformStyle;
class WalletModel;
class ClientModel;
class ContractTableModel;
class ExecRPCCommand;
class ABIFunctionField;
class ContractABI;
class TabBarInfo;

namespace Ui {
class SendToContract;
}

class SendToContract : public QWidget
{
    Q_OBJECT

public:
    explicit SendToContract(const PlatformStyle *platformStyle, QWidget *parent = 0);
    ~SendToContract();

    void setClientModel(ClientModel *clientModel);
    void setModel(WalletModel *model);
    bool isValidContractAddress();
    bool isValidInterfaceABI();
    bool isDataValid();
    void setContractAddress(const QString &address);

Q_SIGNALS:
    // Fired when a message should be reported to the user
    void message(const QString &title, const QString &message, unsigned int style);

public Q_SLOTS:
    void on_clearAllClicked();
    void on_sendToContractClicked();
    void on_gasInfoChanged(quint64 blockGasLimit, quint64 minGasPrice, quint64 nGasPrice);
    void on_updateSendToContractButton();
    void on_newContractABI();
    void on_functionChanged();
    void on_saveInfoClicked();
    void on_loadInfoClicked();
    void on_pasteAddressClicked();
    void on_contractAddressChanged();

private Q_SLOTS:
    void updateDisplayUnit();

private:
    QString toDataHex(int func, QString& errorMessage);
    bool isFunctionPayable();

private:
    Ui::SendToContract *ui;
    WalletModel* m_model;
    ClientModel* m_clientModel;
    ContractTableModel* m_contractModel;
    ExecRPCCommand* m_execRPCCommand;
    ABIFunctionField* m_ABIFunctionField;
    ContractABI* m_contractABI;
    TabBarInfo* m_tabInfo;
    const PlatformStyle* m_platformStyle;
    int m_results;
    bool bCreateUnsigned = false;
};

#endif // SENDTOCONTRACT_H


text:
namespace controller
{

    typedef posixthread_factory platformthread_factory;

}

#endif

redpajama_set_name: RedPajamaGithub


text:
=============
Using Plugins
=============

Please read the earlier pages in the Getting Started Guide first, in
particular you need to understand :doc:`build.sbt <Basic-Def>` and
:doc:`library dependencies <Library-Dependencies>`,
before reading this page.

What is a plugin?
-----------------

A plugin extends the build definition, most commonly by adding new
settings. The new settings could be new tasks. For example, a plugin
could add a `codeCoverage` task which would generate a test coverage
report.

Declaring a plugin
------------------

If your project is in directory `hello`, edit `hello/project/plugins.sbt` and declare the plugin dependency by passing the plugin's Ivy module ID to `addSbtPlugin`: ::

    addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.7.0")

Not every plugin is located on one of the default repositories and a plugin's documentation may instruct you to also add the repository where it can be found: ::

    resolvers += ...

Plugins usually provide settings that get added to a project to enable the plugin's functionality.
This is described in the next section.

Adding settings for a plugin
----------------------------

A plugin can declare that its settings be automatically added, in which case you don't have to do anything to add them.

As of sbt 0.13.5, there is a new :doc:`auto-plugins <../DetailedTopics/AutoPlugins>` feature that enables plugins
to automatically, and safely, ensure their settings and dependencies are on a project.  Most plugins should have
their default settings automatically, however some may require explicit enablement.

If you're using a plugin that requires explicit enablement, then you you have to add the following to your
`build.sbt` ::

    lazy val util = project.setPlugins(ThePluginIWant)

Most plugins document whether they need to explicitly enabled.  If you're curious which plugins are enabled
for a given project, just run the `plugins` command on the sbt console.

For example ::

    > plugins
    In file:/home/jsuereth/projects/sbt/test-ivy-issues/
      sbt.plugins.IvyPlugin: enabled in test-ivy-issues
      sbt.plugins.JvmPlugin: enabled in test-ivy-issues
      sbt.plugins.CorePlugin: enabled in test-ivy-issues

Here, the plugins output is showing that the sbt default plugins are all enabled.  Sbt's default settings are provided via three plugins:

1. CorePlugin:    Provides the core parallelism controls for tasks
2. IvyPlugin:     Provides the mechanisms to publish/resolve modules.
3. JvmPlugin:     Provides the mechanisms to compile/test/run/package Java/Scala projects.

However, older plugins often required settings to be added explictly, so that :doc:`multi-project build <Multi-Project>` could have different types of projects.  The plugin documentation will indicate how to configure it, but typically for older plugins this involves adding the base settings for the plugin and customizing as necessary.

For example, for the sbt-site plugin, add ::

    site.settings

to a `build.sbt` to enable it for that project.

If the build defines multiple projects, instead add it directly to the project: ::

    // don't use the site plugin for the `util` project
    lazy val util = project

    // enable the site plugin for the `core` project
    lazy val core = project.settings( site.settings : _*)

Global plugins
--------------

Plugins can be installed for all your projects at once by dropping them in :sublit:`|globalPluginsBase|`.
:sublit:`|globalPluginsBase|` is an sbt project whose classpath is exported to all sbt build definition projects.
Roughly speaking, any `.sbt` or `.scala` files in :sublit:`|globalPluginsBase|` behave as if they were in the `project/` directory for all projects.

You can create :sublit:`|globalPluginsBase|\ build.sbt` and put `addSbtPlugin()`
expressions in there to add plugins to all your projects at once.
This feature should be used sparingly, however.
See :ref:`Best Practices <global-vs-local-plugins>`.

Available Plugins
-----------------

There's :doc:`a list of available plugins </Community/Community-Plugins>`.

Some especially popular plugins are:

-  those for IDEs (to import an sbt project into your IDE)
-  those supporting web frameworks, such as
   `xsbt-web-plugin <https://github.com/JamesEarlDouglas/xsbt-web-plugin>`_.

:doc:`Check out the list</Community/Community-Plugins>`.

Creating a Plugin
-----------------

A minimal plugin is a Scala library that is built against the version of Scala for sbt itself, which is currently |scalaVersion|.
Nothing special needs to be done for this type of plugin.
It can be published as a normal project and declared in `project/plugins.sbt` like a normal dependency (without `addSbtPlugin`).

A more typical plugin will provide sbt tasks, commands, or settings.
This kind of plugin may provide these settings automatically or make them available for the user to explicitly integrate.
To create an sbt plugin,

  1. Create a new project for the plugin.
  2. Set `sbtPlugin := true` for the project in `build.sbt`.  This adds a dependency on sbt and will detect and record Plugins that you define.
  3. Define another `object` that extends `AutoImport`. The contents of this object will be automatically imported in `.sbt` files, so ensure it only contains important API definitions and types.
  4. Define an `object` that extends `AutoPlugin`.
  5. Declare dependencies on other plugins by defining the `requires` method.
  5. Define any custom tasks or settings (see the next section :doc:`Custom-Settings`).
  6. Collect the default settings to apply to a project in a list for the user to add.  Optionally override one or more of `AutoPlugin`'s methods to have settings automatically added to user projects.
  8. Publish the project.  There is a  :doc:`community repository </Community/Community-Plugins>` available for open source plugins.

For more details, including ways of developing plugins, see :doc:`/Extending/Plugins`.
For best practices, see :doc:`/Extending/Plugins-Best-Practices`.

Next
----

Move on to create :doc:`custom settings <Custom-Settings>`.

.. |globalBase| replace:: ~/.sbt/|version|/
.. |globalPluginsBase| replace:: |globalBase|\ plugins/


text:
package com.elmakers.mine.bukkit.action.builtin;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.commons.lang.StringUtils;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.meta.BookMeta;

import com.elmakers.mine.bukkit.action.BaseSpellAction;
import com.elmakers.mine.bukkit.api.action.CastContext;
import com.elmakers.mine.bukkit.api.economy.Currency;
import com.elmakers.mine.bukkit.api.magic.Mage;
import com.elmakers.mine.bukkit.api.magic.MageController;
import com.elmakers.mine.bukkit.api.spell.SpellResult;
import com.elmakers.mine.bukkit.api.wand.Wand;
import com.elmakers.mine.bukkit.utility.ConfigurationUtils;

public class LedgerAction extends BaseSpellAction {
    private Set<String> ignoreTypes;
    private Set<String> showTypes;

    @Override
    public void prepare(CastContext context, ConfigurationSection parameters)
    {
        super.prepare(context, parameters);
        List<String> ignoreList = ConfigurationUtils.getStringList(parameters, "ignore_currencies");
        if (ignoreList != null) {
            ignoreTypes = new HashSet<>(ignoreList);
        }
        List<String> showList = ConfigurationUtils.getStringList(parameters, "show_currencies");
        if (showList != null) {
            showTypes = new HashSet<>(showList);
        }
    }

    @Override
    public SpellResult perform(CastContext context) {
        Wand wand = context.getWand();
        if (wand == null || wand.getItem().getType() != Material.WRITTEN_BOOK) {
            return SpellResult.NO_TARGET;
        }

        Mage mage = context.getMage();
        BookMeta book = (BookMeta)wand.getItem().getItemMeta();
        book.setTitle(context.getMessage("title"));
        book.setAuthor(context.getMage().getName());

        MageController controller = context.getController();
        Collection<String> currencyKeys = controller.getCurrencyKeys();
        String header = context.getMessage("header");
        String currencyPrefix = context.getMessage("currency_prefix");
        String valuePrefix = context.getMessage("value_prefix");
        List<String> pages = new ArrayList<>();
        List<String> lines = new ArrayList<>();
        for (String key : currencyKeys) {
            Currency currency = controller.getCurrency(key);
            if (currency == null) {
                continue;
            }
            double amount = currency.getBalance(mage, wand);
            if (showTypes != null && !showTypes.contains(key)) {
                continue;
            }
            if (amount > 0 && (ignoreTypes == null || !ignoreTypes.contains(key))) {
                if (lines.size() >= 12) {
                    pages.add(header + "\n" + StringUtils.join(lines, "\n"));
                    lines.clear();
                }
                lines.add(currencyPrefix + currency.getName(controller.getMessages()));
                lines.add(valuePrefix + currency.formatAmount(amount, controller.getMessages()));
            }
        }
        if (!lines.isEmpty()) {
            pages.add(header + "\n" + StringUtils.join(lines, "\n"));
        }
        book.setPages(pages);
        wand.getItem().setItemMeta(book);
        if (wand == mage.getActiveWand()) {
            mage.getPlayer().getInventory().setItemInMainHand(wand.getItem());
        } else if (wand == mage.getOffhandWand()) {
            mage.getPlayer().getInventory().setItemInOffHand(wand.getItem());
        }

        return SpellResult.CAST;
    }
}


text:
`BMACollectionBatchUpdates` is a set of classes to generate updates and extensions to `UICollectionView` and `UITableView` to perform them safely in a batch manner.

## How to use

In order to generate the mentioned updates it has to make collection item and section conform the `BMAUpdatableCollectionItem` and`BMAUpdatableCollectionItem` protocols respectively:

```objectivec
@interface BMAExampleItemsSection : NSObject <BMAUpdatableCollectionSection>
@end

@interface BMAExampleItem : NSObject <BMAUpdatableCollectionItem>
@end
```

Once both old and new data models are available, it has to calculate changes and apply them:

```objectivec
@implementation BMAExampleCollectionViewController

- (void)setSections:(NSArray *)sections {
	[BMACollectionUpdate calculateUpdatesForOldModel:self.sections
                                            newModel:sections
                               sectionsPriorityOrder:nil
                                eliminatesDuplicates:YES
                                          completion:^(NSArray *sections, NSArray *updates) {
                                          		[self.collectionView bma_performBatchUpdates:updates applyChangesToModelBlock:^{
											        _sections = sections;
											    } reloadCellBlock:^(UICollectionViewCell *cell, NSIndexPath *indexPath) {
											        [self reloadCell:cell atIndexPath:indexPath];
											    } completionBlock:nil];
                                          }];
}

@end
```

```objectivec
@implementation BMAExampleTableViewController

- (void)setSections:(NSArray *)sections {
	[BMACollectionUpdate calculateUpdatesForOldModel:self.sections
                                            newModel:sections
                               sectionsPriorityOrder:nil
                                eliminatesDuplicates:YES
                                          completion:^(NSArray *sections, NSArray *updates) {
                                          		[self.collectionView bma_performBatchUpdates:updates applyChangesToModelBlock:^{
											        _sections = sections;
											    } reloadCellBlock:^(UITableViewCell *cell, NSIndexPath *indexPath) {
											        [self reloadCell:cell atIndexPath:indexPath];
											    } completionBlock:nil];
                                          }];
}

@end
```

## How to install

### Using CocoaPods

1. Include the following line in your `Podfile`:
    ```
    pod 'BMACollectionBatchUpdates', '~> 1.0.0'
    ```

If you like to live on the bleeding edge, you can use the `master` branch with:
    ```
    pod 'BMACollectionBatchUpdates', :git => 'https://github.com/badoo/ios-collection-batch-updates'
    ```

2. Run `pod install`

### Manually

1. Clone, add as a submodule or [download.](https://github.com/badoo/ios-collection-batch-updates/archive/master.zip)
2. Add all the files under `BMACollectionBatchUpdates` to your project.
3. Make sure your project is configured to use ARC.

## License

Source code is distributed under MIT license.

## Blog

Read more at [techblog.badoo.com](http://techblog.badoo.com).


text:
function AnnotateFigures (figures, annotationStrings, growBy)
	%@@@ Not working yet.
	if nargin < 3
		growBy = 0.2;		% Adjust to fit typical annotations.
	end

	for f = 1:length(figures)
		fig = figures(f);

		paperPosition = get (fig, 'PaperPosition');
		paperPosition(2) = paperPosition(2) - growBy*paperPosition(4);
		paperPosition(4) = paperPosition(4) + growBy*paperPosition(4);
		set (fig, 'PaperPosition', paperPosition);

		children = get(fig, 'children');
		positions = cell2mat(get(children, 'Position'));
		positions(2) = growBy + positions(2)/(1+growBy);
		positions(4) = positions(4) / (1+growBy);

		for s = 1:length(children)
			set (children(s), 'Position', positions(s,:))
		end

		annotation (fig, 'textbox', [0, 0, growBy, growBy], 'String', annotationStrings, ...
						'HorizontalAlignment', 'left', ...
						'VerticalAlignment', 'bottom');
	end
end


text:
<?php

// configurazione locale
define('DB_HOST', 'localhost');
define('DB_NAME', 'db_ebtt');
define('DB_USER','sapEBTT');
define('DB_PASSWORD','pR9vLLXybhcXWjEu');

// configurazione demo
// define('DB_HOST', 'localhost');
// define('DB_NAME', 'd1cvo_db01');
// define('DB_USER','d1cvo_uw01');
// define('DB_PASSWORD','6Hx2hgC8Zp');

define('Italia','118');

/*
$con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error());
$db=mysql_select_db(DB_NAME,$con) or die("Failed to connect to MySQL: " . mysql_error());
*/
?>


text:
import httplib2
import json
from webob import Response
import logging
import pprint
import os.path

log = logging.getLogger(__name__)
pp = pprint.PrettyPrinter()

class RequestLoader(object):
    """ComboLoader Object

    Creates a combo loader object
    """
    def __call__(self, *args, **kwargs):
        return self.combine()

    def combine(self):
        return ""

class HttpRequest(RequestLoader):
    pass

class FileRequest(RequestLoader):
    """FileRequest loads files with a base and path

    Concatenates the files given in a list

    """
    def __init__(self, request, config, files):
        self.files = files
        self.config = config
        self.request = request

    def combine(self):
        content = ""

        for file_type, file_paths in self.files.iteritems():
          base_path = self._get_file_path(file_type)
          for path in file_paths:
                # TODO: Path resolving could benefit memoization
                # problem with above; not ALL files are in the same
                # subdirectories. We can have a base_path though.
                path = os.path.join(base_path, path)
                path = os.path.abspath(path)
                log.debug("File Type: %s :::: File Path: %s" % (file_type, path))
                try:
                    f = open(path, 'r')
                    content += f.read()
                    f.close()
                except IOError as e:
                    log.error("File not found: %s ::: Continuing..." % e)

        return content

    def _get_file_path(self, file_type):
        if file_type.lower() == 'js':
            return self.config['js_path']
        elif file_type.lower() == 'css':
            return self.config['css_path']