text:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "ParseInf.h"
#include "EfiUtilityMsgs.h"
#include "CommonLib.h"
#include "Crc32.h"

#define UTILITY_NAME            "GenCrc32"
#define UTILITY_MAJOR_VERSION   0
#define UTILITY_MINOR_VERSION   1

#define CRC32_NULL              0
#define CRC32_ENCODE            1
#define CRC32_DECODE            2

VOID
Version (
  VOID
  )
/*++

Routine Description:

  Displays the standard utility information to SDTOUT

Arguments:

  None

Returns:

  None

--*/
{
  fprintf (stdout, "%s Version %d.%d Build %s \n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);
}

VOID
Usage (
  VOID
  )
/*++

Routine Description:

  Displays the utility usage syntax to STDOUT

Arguments:

  None

Returns:

  None

--*/
{
  //
  // Summary usage
  //
  fprintf (stdout, "Usage: GenCrc32 -e|-d [options] <input_file>\n\n");

  //
  // Copyright declaration
  //
  fprintf (stdout, "Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.\n\n");

  //
  // Details Option
  //
  fprintf (stdout, "optional arguments:\n");
  fprintf (stdout, "  -h, --help            Show this help message and exit\n");
  fprintf (stdout, "  --version             Show program's version number and exit\n");
  fprintf (stdout, "  --debug [DEBUG]       Output DEBUG statements, where DEBUG_LEVEL is 0 (min)\n\
                        - 9 (max)\n");
  fprintf (stdout, "  -v, --verbose         Print informational statements\n");
  fprintf (stdout, "  -q, --quiet           Returns the exit code, error messages will be\n\
                        displayed\n");
  fprintf (stdout, "  -s, --silent          Returns only the exit code; informational and error\n\
                        messages are not displayed\n");
  fprintf (stdout, "  -e, --encode          Calculate CRC32 value for the input file\n");
  fprintf (stdout, "  -d, --decode          Verify CRC32 value for the input file\n");
  fprintf (stdout, "  -o OUTPUT_FILENAME, --output OUTPUT_FILENAME\n\
                        Output file name\n");
  fprintf (stdout, "  --sfo                 Reserved for future use\n");

}

int
main (
  int   argc,
  CHAR8 *argv[]
  )
/*++

Routine Description:

  Main function.

Arguments:

  argc - Number of command line parameters.
  argv - Array of pointers to parameter strings.

Returns:
  STATUS_SUCCESS - Utility exits successfully.
  STATUS_ERROR   - Some error occurred during execution.

--*/
{
  EFI_STATUS              Status;
  CHAR8                   *OutputFileName;
  CHAR8                   *InputFileName;
  UINT8                   *FileBuffer;
  UINT32                  FileSize;
  UINT64                  LogLevel;
  UINT8                   FileAction;
  UINT32                  Crc32Value;
  FILE                    *InFile;
  FILE                    *OutFile;

  //
  // Init local variables
  //
  LogLevel       = 0;
  Status         = EFI_SUCCESS;
  InputFileName  = NULL;
  OutputFileName = NULL;
  FileAction     = CRC32_NULL;
  InFile         = NULL;
  OutFile        = NULL;
  Crc32Value     = 0;
  FileBuffer     = NULL;

  SetUtilityName (UTILITY_NAME);

  if (argc == 1) {
    Error (NULL, 0, 1001, "Missing options", "no options input");
    Usage ();
    return STATUS_ERROR;
  }

  //
  // Parse command line
  //
  argc --;
  argv ++;

  if ((stricmp (argv[0], "-h") == 0) || (stricmp (argv[0], "--help") == 0)) {
    Usage ();
    return STATUS_SUCCESS;
  }

  if (stricmp (argv[0], "--version") == 0) {
    Version ();
    return STATUS_SUCCESS;
  }

  while (argc > 0) {
    if ((stricmp (argv[0], "-o") == 0) || (stricmp (argv[0], "--output") == 0)) {
      if (argv[1] == NULL || argv[1][0] == '-') {
        Error (NULL, 0, 1003, "Invalid option value", "Output File name is missing for -o option");
        goto Finish;
      }
      OutputFileName = argv[1];
      argc -= 2;
      argv += 2;
      continue;
    }

    if ((stricmp (argv[0], "-e") == 0) || (stricmp (argv[0], "--encode") == 0)) {
      FileAction     = CRC32_ENCODE;
      argc --;
      argv ++;
      continue;
    }

    if ((stricmp (argv[0], "-d") == 0) || (stricmp (argv[0], "--decode") == 0)) {
      FileAction     = CRC32_DECODE;
      argc --;
      argv ++;
      continue;
    }

    if ((stricmp (argv[0], "-v") == 0) || (stricmp (argv[0], "--verbose") == 0)) {
      SetPrintLevel (VERBOSE_LOG_LEVEL);
      VerboseMsg ("Verbose output Mode Set!");
      argc --;
      argv ++;
      continue;
    }

    if ((stricmp (argv[0], "-q") == 0) || (stricmp (argv[0], "--quiet") == 0)) {
      SetPrintLevel (KEY_LOG_LEVEL);
      KeyMsg ("Quiet output Mode Set!");
      argc --;
      argv ++;
      continue;
    }

    if (stricmp (argv[0], "--debug") == 0) {
      Status = AsciiStringToUint64 (argv[1], FALSE, &LogLevel);
      if (EFI_ERROR (Status)) {
        Error (NULL, 0, 1003, "Invalid option value", "%s = %s", argv[0], argv[1]);
        goto Finish;
      }
      if (LogLevel > 9) {
        Error (NULL, 0, 1003, "Invalid option value", "Debug Level range is 0-9, current input level is %d", (int) LogLevel);
        goto Finish;
      }
      SetPrintLevel (LogLevel);
      DebugMsg (NULL, 0, 9, "Debug Mode Set", "Debug Output Mode Level %s is set!", argv[1]);
      argc -= 2;
      argv += 2;
      continue;
    }

    if (argv[0][0] == '-') {
      Error (NULL, 0, 1000, "Unknown option", argv[0]);
      goto Finish;
    }

    //
    // Get Input file file name.
    //
    InputFileName = argv[0];
    argc --;
    argv ++;
  }

  VerboseMsg ("%s tool start.", UTILITY_NAME);

  //
  // Check Input paramters
  //
  if (FileAction == CRC32_NULL) {
    Error (NULL, 0, 1001, "Missing option", "either the encode or the decode option must be specified!");
    return STATUS_ERROR;
  } else if (FileAction == CRC32_ENCODE) {
    VerboseMsg ("File will be encoded by Crc32");
  } else if (FileAction == CRC32_DECODE) {
    VerboseMsg ("File will be decoded by Crc32");
  }

  if (InputFileName == NULL) {
    Error (NULL, 0, 1001, "Missing option", "Input files are not specified");
    goto Finish;
  } else {
    VerboseMsg ("Input file name is %s", InputFileName);
  }

  if (OutputFileName == NULL) {
    Error (NULL, 0, 1001, "Missing option", "Output file are not specified");
    goto Finish;
  } else {
    VerboseMsg ("Output file name is %s", OutputFileName);
  }

  //
  // Open Input file and read file data.
  //
  InFile = fopen (InputFileName, "rb");
  if (InFile == NULL) {
    Error (NULL, 0, 0001, "Error opening file", InputFileName);
    return STATUS_ERROR;
  }

  fseek (InFile, 0, SEEK_END);
  FileSize = ftell (InFile);
  fseek (InFile, 0, SEEK_SET);

  FileBuffer = (UINT8 *) malloc (FileSize);
  if (FileBuffer == NULL) {
    Error (NULL, 0, 4001, "Resource", "memory cannot be allcoated!");
    goto Finish;
  }

  fread (FileBuffer, 1, FileSize, InFile);
  fclose (InFile);
  VerboseMsg ("the size of the input file is %u bytes", (unsigned) FileSize);

  //
  // Open output file
  //
  OutFile = fopen (OutputFileName, "wb");
  if (OutFile == NULL) {
    Error (NULL, 0, 0001, "Error opening file", OutputFileName);
    goto Finish;
  }

  //
  // Calculate Crc32 value
  //
  if (FileAction == CRC32_ENCODE) {
    Status = CalculateCrc32 (FileBuffer, FileSize, &Crc32Value);
    if (Status != EFI_SUCCESS) {
      Error (NULL, 0, 3000, "Invalid", "Calculate CRC32 value failed!");
      goto Finish;
    }
    //
    // Done, write output file.
    //
    fwrite (&Crc32Value, 1, sizeof (Crc32Value), OutFile);
    VerboseMsg ("The calculated CRC32 value is 0x%08x", (unsigned) Crc32Value);
    fwrite (FileBuffer, 1, FileSize, OutFile);
    VerboseMsg ("the size of the encoded file is %u bytes", (unsigned) FileSize + sizeof (UINT32));
  } else {
    //
    // Verify Crc32 Value
    //
    Status = CalculateCrc32 (FileBuffer + sizeof (UINT32), FileSize - sizeof (UINT32), &Crc32Value);
    if (Status != EFI_SUCCESS) {
      Error (NULL, 0, 3000, "Invalid", "Calculate CRC32 value failed!");
      goto Finish;
    }
    VerboseMsg ("The calculated CRC32 value is 0x%08x and File Crc32 value is 0x%08x", (unsigned) Crc32Value, (unsigned) (*(UINT32 *)FileBuffer));
    if (Crc32Value != *(UINT32 *)FileBuffer) {
      Error (NULL, 0, 3000, "Invalid", "CRC32 value of input file is not correct!");
      Status = STATUS_ERROR;
      goto Finish;
    }
    //
    // Done, write output file.
    //
    fwrite (FileBuffer + sizeof (UINT32), 1, FileSize - sizeof (UINT32), OutFile);
    VerboseMsg ("the size of the decoded file is %u bytes", (unsigned) FileSize - sizeof (UINT32));
  }

Finish:
  if (FileBuffer != NULL) {
    free (FileBuffer);
  }

  if (OutFile != NULL) {
    fclose (OutFile);
  }

  VerboseMsg ("%s tool done with return code is 0x%x.", UTILITY_NAME, GetUtilityStatus ());

  return GetUtilityStatus ();
}


text:
module Braid
  module Commands
    class Setup < Command
      def run(path = nil)
        path ? setup_one(path) : setup_all
      end

      protected
        def setup_all
          msg "Setting up all mirrors."
          config.mirrors.each do |path|
            setup_one(path)
          end
        end

        def setup_one(path)
          mirror = config.get!(path)

          if git.remote_url(mirror.remote)
            msg "Setup: Mirror '#{mirror.path}' already has a remote. Reusing it." if verbose?
            return
          end

          msg "Setup: Creating remote for '#{mirror.path}'."
          unless mirror.type == "svn"
            url = use_local_cache? ? git_cache.path(mirror.url) : mirror.url
            git.remote_add(mirror.remote, url, mirror.branch)
          else
            git_svn.init(mirror.remote, mirror.url)
          end
        end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
<!-- Start src/components/game/game_plan/index.js -->

## React

<!-- End src/components/game/game_plan/index.js -->


text:
class p1{
public static void main(String...args){
public +int a=20;
myfunc();
}

public void myfunc(){
//static int a=20;
System.out.println(a++);
}
}


text:
package org.asynchttpclient.providers.netty4.request;

import org.asynchttpclient.providers.netty4.request.body.NettyBody;

import io.netty.handler.codec.http.HttpRequest;

public final class NettyRequest {

    private final HttpRequest httpRequest;
    private final NettyBody body;

    public NettyRequest(HttpRequest httpRequest, NettyBody body) {
        this.httpRequest = httpRequest;
        this.body = body;
    }

    public HttpRequest getHttpRequest() {
        return httpRequest;
    }

    public NettyBody getBody() {
        return body;
    }
}


text:
var app = angular.module('starter', ['ionic', 'pouchdb']);
app.run(['$ionicPlatform', function($ionicPlatform) {
  $ionicPlatform.ready(function() {
    if(window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
    }

    if(window.StatusBar) {
      StatusBar.styleDefault();
    }
  });
}]);

// #####################################################
// Alterar as constantes abaixo para os devidos valores.
// #####################################################
app.constant('COUCHDB_URL', 'http://localhost:5984');
app.constant('COUCHDB_COLLECTION', 'todos');

app.factory('PouchDBProvider', ['pouchDB', 'COUCHDB_URL', 'COUCHDB_COLLECTION',
  function (pouchDB, COUCHDB_URL, COUCHDB_COLLECTION) {
    var db = null;
    var changeCallback = function() {};
    var initializeDB = function() {
      db = pouchDB(COUCHDB_COLLECTION);
      db.replicate.to(COUCHDB_URL, {live: true});
      db.replicate.from(COUCHDB_URL, {live: true});

      db.changes({
        since: 'now',
        live: true
      }).on('change', function() {
        changeCallback();
      });
    };

    var onChangeCallback = function(callback) {
      changeCallback = callback;
    }

    var save = function(doc, callback) {
      db.put(doc, callback);
    };

    var findAll = function(callback) {
      db.allDocs({include_docs: true, descending: true}, function(err, results) {
        callback(err, results.rows.map(function(row) {return row.doc}));
      });
    };

    initializeDB();
    return {
      onChangeCallback: onChangeCallback,
      save: save,
      findAll: findAll
    };
}])

app.controller('ExampleController', ['$scope', '$ionicPopup', 'PouchDBProvider',
  function ($scope, $ionicPopup, PouchDBProvider) {
    $scope.todos = [];

    $scope.create = function() {
      $ionicPopup.prompt({
        title: 'Enter a new TODO item',
        intputType: 'text'
      }).then(function(result) {
        if (!!result) {
          var todo = {_id: new Date().toISOString(), title: result, completed: false };
          PouchDBProvider.save(todo);
        }
      });
    };

    $scope.init = function() {
      PouchDBProvider.onChangeCallback(fullFillTodos);
      fullFillTodos();
    }

    var fullFillTodos = function() {
      PouchDBProvider.findAll(function(err, results) {
        $scope.todos = results;
        $scope.$apply();
      });
    };

  }]);


text:
.settings-fonts {
	margin-top: 10px;
}

.settings-fonts .fonts-row {
	vertical-align: middle;
	height: 45px;
	font-weight: bold;
	padding-right: 25px;
}


text:
#ifndef SkNoSaveLayerCanvas_DEFINED
#define SkNoSaveLayerCanvas_DEFINED

#include "SkCanvas.h"
#include "SkRRect.h"

// The NoSaveLayerCanvas is used to play back SkPictures when the saveLayer
// functionality isn't required (e.g., during analysis of the draw calls).
// It also simplifies the clipping calls to only use rectangles.
class SK_API SkNoSaveLayerCanvas : public SkCanvas {
public:
    SkNoSaveLayerCanvas(SkBaseDevice* device) : INHERITED(device) {}

protected:
    virtual SaveLayerStrategy willSaveLayer(const SkRect* bounds, const SkPaint* paint,
                                            SaveFlags flags) SK_OVERRIDE {
        this->INHERITED::willSaveLayer(bounds, paint, flags);
        return kNoLayer_SaveLayerStrategy;
    }

    // disable aa for speed
    virtual void onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle) SK_OVERRIDE {
        this->INHERITED::onClipRect(rect, op, kHard_ClipEdgeStyle);
    }

    // for speed, just respect the bounds, and disable AA. May give us a few
    // false positives and negatives.
    virtual void onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle) SK_OVERRIDE {
        this->updateClipConservativelyUsingBounds(path.getBounds(), op,
                                                  path.isInverseFillType());
    }
    virtual void onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle) SK_OVERRIDE {
        this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false);
    }

private:
    typedef SkCanvas INHERITED;
};

#endif // SkNoSaveLayerCanvas_DEFINED


text:
package org.apache.shardingsphere.proxy.backend.text.distsql.ral.common.updatable;

import org.apache.shardingsphere.distsql.parser.segment.AlgorithmSegment;
import org.apache.shardingsphere.distsql.parser.segment.TrafficRuleSegment;
import org.apache.shardingsphere.distsql.parser.statement.ral.common.updatable.CreateTrafficRuleStatement;
import org.apache.shardingsphere.infra.config.RuleConfiguration;
import org.apache.shardingsphere.infra.config.algorithm.ShardingSphereAlgorithmConfiguration;
import org.apache.shardingsphere.infra.distsql.exception.rule.DuplicateRuleException;
import org.apache.shardingsphere.infra.distsql.exception.rule.InvalidAlgorithmConfigurationException;
import org.apache.shardingsphere.mode.manager.ContextManager;
import org.apache.shardingsphere.proxy.backend.context.ProxyContext;
import org.apache.shardingsphere.spi.ShardingSphereServiceLoader;
import org.apache.shardingsphere.traffic.api.config.TrafficRuleConfiguration;
import org.apache.shardingsphere.traffic.api.config.TrafficStrategyConfiguration;
import org.apache.shardingsphere.traffic.spi.TrafficAlgorithm;
import org.apache.shardingsphere.traffic.spi.TrafficLoadBalanceAlgorithm;
import org.junit.Test;

import java.sql.SQLException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Properties;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class CreateTrafficRuleHandlerTest {

    static {
        ShardingSphereServiceLoader.register(TrafficAlgorithm.class);
        ShardingSphereServiceLoader.register(TrafficLoadBalanceAlgorithm.class);
    }

    @Test(expected = InvalidAlgorithmConfigurationException.class)
    public void assertCheckWithEmptyRuleAndInvalidAlgorithmType() throws SQLException {
        ContextManager contextManager = mock(ContextManager.class, RETURNS_DEEP_STUBS);
        when(contextManager.getMetaDataContexts().getGlobalRuleMetaData().findRuleConfiguration(any())).thenReturn(new LinkedList<>());
        ProxyContext.getInstance().init(contextManager);
        TrafficRuleSegment trafficRuleSegment = new TrafficRuleSegment("input_rule_name", Arrays.asList("olap", "order_by"),
                new AlgorithmSegment("invalid", new Properties()), new AlgorithmSegment("invalid", new Properties()));
        new CreateTrafficRuleHandler().initStatement(getSQLStatement(trafficRuleSegment)).execute();
    }

    @Test(expected = InvalidAlgorithmConfigurationException.class)
    public void assertCheckWithInvalidAlgorithmType() throws SQLException {
        ContextManager contextManager = mock(ContextManager.class, RETURNS_DEEP_STUBS);
        when(contextManager.getMetaDataContexts().getGlobalRuleMetaData().findRuleConfiguration(any())).thenReturn(createTrafficRule());
        ProxyContext.getInstance().init(contextManager);
        TrafficRuleSegment trafficRuleSegment = new TrafficRuleSegment("input_rule_name", Arrays.asList("olap", "order_by"),
                new AlgorithmSegment("invalid", new Properties()), new AlgorithmSegment("invalid", new Properties()));
        new CreateTrafficRuleHandler().initStatement(getSQLStatement(trafficRuleSegment)).execute();
    }

    @Test(expected = DuplicateRuleException.class)
    public void assertCheckWithDuplicatedRuleName() throws SQLException {
        ContextManager contextManager = mock(ContextManager.class, RETURNS_DEEP_STUBS);
        when(contextManager.getMetaDataContexts().getGlobalRuleMetaData().findRuleConfiguration(any())).thenReturn(createTrafficRule());
        ProxyContext.getInstance().init(contextManager);
        TrafficRuleSegment trafficRuleSegment = new TrafficRuleSegment("rule_name_1", Arrays.asList("olap", "order_by"),
                new AlgorithmSegment("TEST", new Properties()), new AlgorithmSegment("TEST", new Properties()));
        new CreateTrafficRuleHandler().initStatement(getSQLStatement(trafficRuleSegment)).execute();
    }

    @Test
    public void assertCheckSuccess() throws SQLException {
        ContextManager contextManager = mock(ContextManager.class, RETURNS_DEEP_STUBS);
        when(contextManager.getMetaDataContexts().getGlobalRuleMetaData().findRuleConfiguration(any())).thenReturn(createTrafficRule());
        ProxyContext.getInstance().init(contextManager);
        TrafficRuleSegment trafficRuleSegment1 = new TrafficRuleSegment("rule_name_3", Arrays.asList("olap", "order_by"),
                new AlgorithmSegment("TEST", new Properties()), new AlgorithmSegment("TEST", new Properties()));
        TrafficRuleSegment trafficRuleSegment2 = new TrafficRuleSegment("rule_name_4", Collections.emptyList(),
                new AlgorithmSegment("TEST", new Properties()), null);
        new CreateTrafficRuleHandler().initStatement(getSQLStatement(trafficRuleSegment1, trafficRuleSegment2)).execute();
    }

    private Collection<RuleConfiguration> createTrafficRule() {
        TrafficRuleConfiguration trafficRuleConfiguration = new TrafficRuleConfiguration();
        trafficRuleConfiguration.getTrafficStrategies().add(new TrafficStrategyConfiguration("rule_name_1", Arrays.asList("olap", "order_by"), "algorithm_1", "load_balancer_1"));
        trafficRuleConfiguration.getTrafficStrategies().add(new TrafficStrategyConfiguration("rule_name_2", Collections.singletonList("oltp"), "algorithm_2", "load_balancer_2"));
        Properties algorithmProperties = new Properties();
        algorithmProperties.put("sql", "select * from t_order");
        trafficRuleConfiguration.getTrafficAlgorithms().put("algorithm_1", new ShardingSphereAlgorithmConfiguration("SQL_MATCH", algorithmProperties));
        trafficRuleConfiguration.getTrafficAlgorithms().put("algorithm_2", new ShardingSphereAlgorithmConfiguration("SQL_HINT", new Properties()));
        trafficRuleConfiguration.getLoadBalancers().put("load_balancer_1", new ShardingSphereAlgorithmConfiguration("RANDOM", new Properties()));
        trafficRuleConfiguration.getLoadBalancers().put("load_balancer_2", new ShardingSphereAlgorithmConfiguration("ROBIN", new Properties()));
        return Collections.singletonList(trafficRuleConfiguration);
    }

    private CreateTrafficRuleStatement getSQLStatement(final TrafficRuleSegment...segments) {
        return new CreateTrafficRuleStatement(Arrays.asList(segments));
    }
}


text:
> Newsstand was deprecated in iOS 9.
> This project is no longer maintained.

Newsstand was introduced in iOS 5 to give publishers a common framework to syndicate content. `Rack::Newsstand` provides web service endpoints for issue data, as well as a Newsstand Atom feed.

## Requirements

- PostgreSQL 9.1

## Example Usage

Rack::Newsstand can be run as Rack middleware or as a single web application. All that is required is a connection to a Postgres database.

### Gemfile

```ruby
source "https://rubygems.org"

gem 'rack-newsstand'
gem 'pg'
```

### config.ru

```ruby
require 'bundler'
Bundler.require

run Rack::Newsstand
```

An example application can be found in the `/example` directory of this repository.

### `GET /issues` (`Accept: application/x-plist`)

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <array>
    <dict>
      <key>name</key>
      <string>magazine-1</string>
      <key>title</key>
      <string>Magazine Issue 1</string>
      <key>summary</key>
      <string>Lorem ipsum dolar sit amet</string>
      <key>date</key>
      <date>2013-04-19T12:00:00Z</date>
      <key>covers</key>
      <dict>
        <key>SOURCE</key>
        <string>http://example.com/assets/covers/magazine-1.png</string>
      </dict>
      <key>content</key>
      <array>
        <string>http://example.com/assets/content/magazine-1.pdf</string>
      </array>
    </dict>
  </array>
</plist>
```

### `GET /issues` (`Accept: application/application/atom+xml`)

```xml
<?xml version="1.1" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:news="http://itunes.apple.com/2011/Newsstand">
  <updated>
  </updated>
  <entry>
    <id>magazine-0</id>
    <summary/>
    <updated>2013-04-30 09:59:54 -0700</updated>
    <published>2013-04-30 09:59:54 -0700</published>
    <news:cover_art_icons>
      <news:cover_art_icon size="SOURCE" src="http://example.com/assets/covers/magazine-1.png"/>
    </news:cover_art_icons>
  </entry>
</feed>
```

## Contact

[Mattt](https://twitter.com/mattt)

## License

Rack::Newsstand is available under the MIT license.
See the LICENSE file for more info.


text:
<?php

namespace Oro\Bundle\EntityExtendBundle\Migrations\Schema\v1_5;

use Doctrine\DBAL\Connection;
use Oro\Bundle\EntityConfigBundle\Tools\ConfigHelper;
use Oro\Bundle\EntityExtendBundle\EntityConfig\ExtendScope;
use Oro\Bundle\EntityExtendBundle\Extend\RelationType;
use Oro\Bundle\MigrationBundle\Migration\ArrayLogger;
use Oro\Bundle\MigrationBundle\Migration\ParametrizedMigrationQuery;
use Psr\Log\LoggerInterface;

class FixAssociationLabelsQuery extends ParametrizedMigrationQuery
{
    /**
     * {@inheritdoc}
     */
    public function getDescription()
    {
        $logger = new ArrayLogger();
        $this->doExecute($logger, true);

        return $logger->getMessages();
    }

    /**
     * {@inheritdoc}
     */
    public function execute(LoggerInterface $logger)
    {
        $this->doExecute($logger);
    }

    /**
     * @param LoggerInterface $logger
     * @param bool            $dryRun
     *
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     * @SuppressWarnings(PHPMD.NPathComplexity)
     */
    protected function doExecute(LoggerInterface $logger, $dryRun = false)
    {
        $entityConfigs = $this->loadEntityLabels($logger);
        // fix entity labels if needed
        $entityConfigs = $this->fixEntityLabels($entityConfigs, $logger, $dryRun);

        // fix field labels if needed
        $fieldConfigs = $this->loadAssociationFieldConfigs($logger);
        foreach ($fieldConfigs as $fieldConfig) {
            $data = $fieldConfig['data'];
            if (empty($data['extend']['target_entity'])) {
                continue;
            }

            $className               = $fieldConfig['class'];
            $fieldName               = $fieldConfig['field'];
            $fieldType               = $fieldConfig['type'];
            $label                   = $data['entity']['label'];
            $description             = $data['entity']['description'];
            $targetClassName         = $data['extend']['target_entity'];
            $targetEntityLabel       = isset($entityConfigs[$targetClassName])
                ? $entityConfigs[$targetClassName]['label']
                : null;
            $targetEntityPluralLabel = isset($entityConfigs[$targetClassName])
                ? $entityConfigs[$targetClassName]['plural_label']
                : null;

            $hasChanges = false;
            // fix field label if needed
            if ($fieldType === RelationType::MANY_TO_ONE) {
                if ($targetEntityLabel
                    && $label !== $targetEntityLabel
                    && (
                        $label === $this->getLabel('label', $targetClassName, $fieldName)
                        || false === strpos($label, '.')
                    )
                ) {
                    $data['entity']['label'] = $targetEntityLabel;
                    $hasChanges              = true;
                }
            } elseif ($fieldType === RelationType::MANY_TO_MANY) {
                if ($targetEntityLabel
                    && $targetEntityPluralLabel
                    && $label !== $targetEntityPluralLabel
                    && (
                        $label === $targetEntityLabel
                        || $label === $this->getLabel('label', $targetClassName, $fieldName)
                        || false === strpos($label, '.')
                    )
                ) {
                    $data['entity']['label'] = $targetEntityPluralLabel;
                    $hasChanges              = true;
                }
            }
            // fix field description if needed
            if ($description === $this->getLabel('description', $targetClassName, $fieldName)) {
                $data['entity']['description'] = $this->getLabel('description', $className, $fieldName);
                $hasChanges                    = true;
            }

            if ($hasChanges) {
                $query  = 'UPDATE oro_entity_config_field SET data = :data WHERE id = :id';
                $params = ['data' => $data, 'id' => $fieldConfig['id']];
                $types  = ['data' => 'array', 'id' => 'integer'];
                $this->logQuery($logger, $query, $params, $types);
                if (!$dryRun) {
                    $this->connection->executeUpdate($query, $params, $types);
                }
            }
        }
    }

    /**
     * @param array           $entityConfigs
     * @param LoggerInterface $logger
     * @param bool            $dryRun
     *
     * @return array
     *
     * @SuppressWarnings(PHPMD.NPathComplexity)
     */
    protected function fixEntityLabels(array $entityConfigs, LoggerInterface $logger, $dryRun = false)
    {
        foreach ($entityConfigs as $className => &$entityConfig) {
            $data = $entityConfig['data'];
            if (!isset($data['extend']['owner']) || $data['extend']['owner'] !== ExtendScope::OWNER_SYSTEM) {
                continue;
            }

            $hasChanges = false;
            if ($entityConfig['label'] !== $this->getLabel('label', $className)
                && false === strpos($entityConfig['label'], '.')
            ) {
                $entityConfig['label']   = $this->getLabel('label', $className);
                $data['entity']['label'] = $entityConfig['label'];
                $hasChanges              = true;
            }
            if ($entityConfig['plural_label'] !== $this->getLabel('plural_label', $className)
                && false === strpos($entityConfig['plural_label'], '.')
            ) {
                $entityConfig['plural_label']   = $this->getLabel('plural_label', $className);
                $data['entity']['plural_label'] = $entityConfig['plural_label'];
                $hasChanges                     = true;
            }
            if ($entityConfig['description'] !== $this->getLabel('description', $className)
                && false === strpos($entityConfig['description'], '.')
            ) {
                $entityConfig['description']   = $this->getLabel('description', $className);
                $data['entity']['description'] = $entityConfig['description'];
                $hasChanges                    = true;
            }
            if ($hasChanges) {
                $query  = 'UPDATE oro_entity_config SET data = :data WHERE id = :id';
                $params = ['data' => $data, 'id' => $entityConfig['id']];
                $types  = ['data' => 'array', 'id' => 'integer'];
                $this->logQuery($logger, $query, $params, $types);
                if (!$dryRun) {
                    $this->connection->executeUpdate($query, $params, $types);
                }
            }
        }

        return $entityConfigs;
    }

    /**
     * @param LoggerInterface $logger
     *
     * @return array
     *  [
     *      class_name => [
     *          'id'           => config_id,
     *          'label'        => label,
     *          'plural_label' => plural_label,
     *          'description'  => description,
     *          'data'         => data
     *      ]
     *      , ...
     *  ]
     */
    protected function loadEntityLabels(LoggerInterface $logger)
    {
        $sql = 'SELECT id, class_name, data FROM oro_entity_config';
        $this->logQuery($logger, $sql);

        $result = [];

        $rows = $this->connection->fetchAll($sql);
        foreach ($rows as $row) {
            $data = $this->connection->convertToPHPValue($row['data'], 'array');

            $result[$row['class_name']] = [
                'id'           => $row['id'],
                'label'        => isset($data['entity']['label']) ? $data['entity']['label'] : null,
                'plural_label' => isset($data['entity']['plural_label']) ? $data['entity']['plural_label'] : null,
                'description'  => isset($data['entity']['description']) ? $data['entity']['description'] : null,
                'data'         => $data
            ];
        }

        return $result;
    }

    /**
     * @param LoggerInterface $logger
     *
     * @return array
     *  [
     *      [
     *          'id'    => config_id,
     *          'class' => class_name,
     *          'field' => field_name,
     *          'type'  => field_type,
     *          'data'  => data
     *      ]
     *      , ...
     *  ]
     */
    protected function loadAssociationFieldConfigs(LoggerInterface $logger)
    {
        $sql    = 'SELECT fc.id, ec.class_name, fc.field_name, fc.type, fc.data'
            . ' FROM oro_entity_config ec'
            . ' INNER JOIN oro_entity_config_field fc ON fc.entity_id = ec.id'
            . ' WHERE fc.type IN (:types)';
        $params = ['types' => [RelationType::MANY_TO_ONE, RelationType::MANY_TO_MANY]];
        $types  = ['types' => Connection::PARAM_STR_ARRAY];
        $this->logQuery($logger, $sql, $params, $types);

        $result = [];

        $rows = $this->connection->fetchAll($sql, $params, $types);
        foreach ($rows as $row) {
            $result[] = [
                'id'    => $row['id'],
                'class' => $row['class_name'],
                'field' => $row['field_name'],
                'type'  => $row['type'],
                'data'  => $this->connection->convertToPHPValue($row['data'], 'array')
            ];
        }

        return $result;
    }

    /**
     * @param string      $labelKey
     * @param string      $className
     * @param string|null $fieldName
     *
     * @return string
     */
    protected function getLabel($labelKey, $className, $fieldName = null)
    {
        return ConfigHelper::getTranslationKey('entity', $labelKey, $className, $fieldName);
    }
}


text:
require 'fog/openstack/image'

module Fog
  module OpenStack
    class Image
      class V2 < Fog::Service
        SUPPORTED_VERSIONS = /v2(\.(0|1|2|3))*/

        requires :openstack_auth_url
        recognizes :openstack_auth_token, :openstack_management_url,
                   :persistent, :openstack_service_type, :openstack_service_name,
                   :openstack_tenant, :openstack_tenant_id,
                   :openstack_api_key, :openstack_username, :openstack_identity_endpoint,
                   :current_user, :current_tenant, :openstack_region,
                   :openstack_endpoint_type, :openstack_cache_ttl,
                   :openstack_project_name, :openstack_project_id,
                   :openstack_project_domain, :openstack_user_domain, :openstack_domain_name,
                   :openstack_project_domain_id, :openstack_user_domain_id, :openstack_domain_id,
                   :openstack_identity_api_version

        model_path 'fog/openstack/image/v2/models'

        model       :image
        collection  :images

        request_path 'fog/openstack/image/v2/requests'

        request :list_images
        request :get_image
        request :create_image
        request :update_image
        request :upload_image
        request :download_image
        request :reactivate_image
        request :deactivate_image
        request :add_tag_to_image
        request :remove_tag_from_image
        request :get_image_members
        request :get_member_details
        request :update_image_member
        request :get_shared_images
        request :add_member_to_image
        request :remove_member_from_image
        request :delete_image
        request :get_image_by_id
        request :set_tenant

        class Mock
          def self.data
            @data ||= Hash.new do |hash, key|
              hash[key] = {
                :images => {}
              }
            end
          end

          def self.reset
            @data = nil
          end

          def initialize(options = {})
            @openstack_username = options[:openstack_username]
            @openstack_tenant   = options[:openstack_tenant]
            @openstack_auth_uri = URI.parse(options[:openstack_auth_url])

            @auth_token = Fog::Mock.random_base64(64)
            @auth_token_expiration = (Time.now.utc + 86400).iso8601

            management_url = URI.parse(options[:openstack_auth_url])
            management_url.port = 9292
            management_url.path = '/v2'
            @openstack_management_url = management_url.to_s

            @data ||= {:users => {}}
            unless @data[:users].detect { |u| u['name'] == options[:openstack_username] }
              id = Fog::Mock.random_numbers(6).to_s
              @data[:users][id] = {
                'id'       => id,
                'name'     => options[:openstack_username],
                'email'    => "#{options[:openstack_username]}@mock.com",
                'tenantId' => Fog::Mock.random_numbers(6).to_s,
                'enabled'  => true
              }
            end
          end

          def data
            self.class.data[@openstack_username]
          end

          def reset_data
            self.class.data.delete(@openstack_username)
          end

          def credentials
            {:provider                 => 'openstack',
             :openstack_auth_url       => @openstack_auth_uri.to_s,
             :openstack_auth_token     => @auth_token,
             :openstack_region         => @openstack_region,
             :openstack_management_url => @openstack_management_url}
          end
        end
        class Upload # Exists for image_v2_upload_spec "describe"
        end

        class Real
          include Fog::OpenStack::Core

          def self.not_found_class
            Fog::OpenStack::Image::NotFound
          end

          def default_endpoint_type
            'admin'
          end

          def default_path_prefix
            'v2'
          end

          def default_service_type
            %w[image imagev2]
          end
        end
      end
    end
  end
end


text:
namespace Dapper.Contrib.Linq2Dapper.Helpers
{
    internal class QueryBuilderState
    {

    }

    internal class SelectPart
    {

    }

    internal class JoinPart
    {
        internal string Table;
        internal string OnField;
        internal string EqualsField;
        internal string Indentifier;
    }

    internal class WherePart
    {
        internal string Name;
        internal string Operator;
        internal string Value;
    }

    internal class OrderPart
    {

    }

}


text:
import os
import sys
import shutil
import fnmatch
import dicommanager

# add working directory to search path
sys.path.insert(0, os.path.realpath(__file__))

# instantiate dicom manager
M = dicommanager.DicomManager()

# get the path to the root directory containing the DICOMs
rootDir = raw_input("Enter path to root directory of DICOMs to manage: ").strip().replace('\\','')

# inquire about deleting original dicoms
deleteSrcDicoms = False
deleteSrcTree = False
ans = raw_input("Delete original dicoms? (y/n): ").strip()
if ans == "y":
    deleteSrcDicoms = True

    # inquire about deleting file tree under 'dcmRoot'
    ans = raw_input("Delete file tree under 'root directory'? (y/n): ").strip()
    if ans == "y":
        deleteSrcTree = True

# find DICOMs under given directory
print "Finding DICOMs to manage..."
dcmPaths = M.find(rootDir)
print "Found %d DICOMs." % len(dcmPaths)

# mange all found DICOMs
print "Reading, recording, and storing DICOMs..."
M.manage( dcmPaths, deleteSrcDicoms )
print "Done."

# delete file tree under 'dcmRoot' if requested
if deleteSrcDicoms and deleteSrcTree:

    # check for any residual dicoms in the file tree
    print "Checking for residual DICOMs..."
    dcmPaths = []
    for root, dirnames, filenames in os.walk( rootDir ):
        for filename in fnmatch.filter( filenames, '*.dcm' ):
            dcmPaths.append( os.path.join( root, filename ) )
    numPaths = len( dcmPaths )

    if numPaths != 0:
        # there are residual dicoms - don't delete file tree!
        print "Warning! Some DICOMs were not imported:"
        for dcmIdx, dcmPath in enumerate( dcmPaths ):
            print str(dcmIdx) + ".  " + dcmPath

    else:
        # delete the file tree
        print "None found, good. Deleting file tree under %s..." % rootDir
        for root, dirs, files in os.walk(rootDir):
            for f in files:
                os.unlink(os.path.join(root, f))
            for d in dirs:
                shutil.rmtree(os.path.join(root, d))

        print "Done.                     "


text:
"use strict";

/**
 * Global setup / teardown.
 */
var promiseDone = require("../../../../index").helpers.webdriverio.promiseDone;
var adapter = global.adapter;

// Global wait.
var ELEM_WAIT = 200;

adapter.before();
adapter.beforeEach();

beforeEach(function (done) {
  // **Note**: Could move to `before` if "per suite" (not test) client.
  adapter.client
    // Set timeout for waiting on elements.
    .timeoutsImplicitWait(ELEM_WAIT)

    // Nuke any existing local storage (manually with JS b/c PhantomJS errors
    // for native `.localStorage("DELETE")` call).
    .url("http://backbone-testing.com/notes/app/")
    .execute(function () {
      /*globals window:false*/
      if (window.localStorage) { window.localStorage.clear(); }
    })

    .finally(promiseDone(done));
});

adapter.afterEach();
adapter.after();


text:
define([
    'underscore',
    'contrail-view',
    'knockback'],
    function (_, ContrailView, Knockback) {
    var gridElId = '#' + ctwl.CFG_FLAVOR_GRID_ID;
    var prefixId = ctwl.CFG_FLAVOR_PREFIX_ID;
    var modalId = 'configure-' + prefixId;
    var flavorEditView = ContrailView.extend({
        renderAddFlavor: function (options) {
            var editTemplate = contrail.getTemplate4Id(cowc.TMPL_EDIT_FORM);
            var editLayout = editTemplate({prefixId: prefixId}),
                self = this;

            cowu.createModal({'modalId': modalId, 'className': 'modal-700',
                             'title': options['title'], 'body': editLayout,
                             'onSave': function () {
               self.model.addEditFlavor({
                    init: function () {
                        cowu.enableModalLoading(modalId);
                    },
                    success: function () {
                        options['callback']();
                        $("#" + modalId).modal('hide');
                    },
                    error: function (error) {
                        cowu.disableModalLoading(modalId, function () {
                            self.model.showErrorAttr(prefixId +
                                                    cowc.FORM_SUFFIX_ID,
                                                    error.responseText);
                        });
                    }
                }, 'POST');
            }, 'onCancel': function () {
                Knockback.release(self.model,
                                    document.getElementById(modalId));
                kbValidation.unbind(self);
                $("#" + modalId).modal('hide');
            }});
            self.renderView4Config($("#" + modalId).find("#" + prefixId + "-form"),
                                    self.model,
                                    getFlavorViewConfig(),
                                    "", null, null,
                                    function () {
                self.model.showErrorAttr(prefixId + cowc.FORM_SUFFIX_ID,
                                         false);
                Knockback.applyBindings(self.model,
                                        document.getElementById(modalId));
                                    }, null, false);
        },
        renderEditFlavor: function(options) {
            var editTemplate =
                contrail.getTemplate4Id(cowc.TMPL_EDIT_FORM);
            var editLayout = editTemplate({prefixId: prefixId}),
                self = this;
            cowu.createModal({'modalId': modalId, 'className': 'modal-700',
                             'title': options['title'], 'body': editLayout,
                             'onSave': function () {
                self.model.addEditFlavor({
                    init: function () {
                        cowu.enableModalLoading(modalId);
                    },
                    success: function () {
                        options['callback']();
                        $("#" + modalId).modal('hide');
                    },
                    error: function (error) {
                        cowu.disableModalLoading(modalId, function () {
                            self.model.showErrorAttr(prefixId +
                                                     cowc.FORM_SUFFIX_ID,
                                                     error.responseText);
                        });
                    }
                }, 'PUT');
            }, 'onCancel': function () {
                Knockback.release(self.model,
                                    document.getElementById(modalId));
                kbValidation.unbind(self);
                $("#" + modalId).modal('hide');
            }});

            self.renderView4Config($("#" + modalId).find("#" + prefixId + "-form"),
                                    self.model,
                                    getFlavorEditViewConfig(),
                                    "", null, null,
                                    function () {
                self.model.showErrorAttr(prefixId + cowc.FORM_SUFFIX_ID, false);
                Knockback.applyBindings(self.model,
                                        document.getElementById(modalId));
                }, null, false);
        },
        renderDeleteFlavor: function(options) {
            var delTemplate = contrail.getTemplate4Id('core-generic-delete-form-template');
            var self = this;
            var selectedGridData = options['selectedGridData'];
            var delLayout = delTemplate({prefixId: prefixId});
            cowu.createModal({'modalId': modalId, 'className': 'modal-480',
                             'title': options['title'], 'btnName': 'Confirm',
                             'body': delLayout,
               'onSave': function () {
                self.model.deleteFlavor(selectedGridData[0], {
                    init: function () {
                        cowu.enableModalLoading(modalId);
                    },
                    success: function () {
                        options['callback']();
                        $("#" + modalId).modal('hide');
                    },
                    error: function (error) {
                        cowu.disableModalLoading(modalId, function () {
                            self.model.showErrorAttr(prefixId +
                                                     cowc.FORM_SUFFIX_ID,
                                                     error.responseText);
                        });
                    }
                });
             }, 'onCancel': function () {
                Knockback.release(self.model,
                                    document.getElementById(modalId));
                kbValidation.unbind(self);
                $("#" + modalId).modal('hide');
            }});
            this.model.showErrorAttr(prefixId + cowc.FORM_SUFFIX_ID, false);
            Knockback.applyBindings(self.model,
                                        document.getElementById(modalId));
            kbValidation.bind(self);
        },
        renderLocationGridPopup: function(options){
            var editTemplate = contrail.getTemplate4Id(ctwl.TMPL_CORE_GENERIC_EDIT);
            var editLayout = editTemplate({modalId: modalId, prefixId: prefixId});
            self = this;
            var obj = {name: 'flavors', url: 'local_flavors', key: 'local_flavor'};
            cowu.createModal({'modalId': modalId,
                              'className': 'modal-980',
                              'title': options['title'],
                              'body': editLayout,
                              'onSave': function () {
                                  self.model.configureLocation(obj,{
                                              init: function () {
                                                  self.model.showErrorAttr(prefixId + cowc.FORM_SUFFIX_ID,
                                                                           false);
                                                  cowu.enableModalLoading(modalId);
                                              },
                                              success: function () {
                                                  options['callback']();
                                                  $("#" + modalId).modal('hide');
                                              },
                                              error: function (error) {
                                                  cowu.disableModalLoading(modalId, function () {
                                                      self.model.showErrorAttr(
                                                                 prefixId + cowc.FORM_SUFFIX_ID,
                                                                 error.responseText);
                                                  });
                                              }
                                          });
                              },
                              'onCancel': function () {
                                  Knockback.release(self.model, document.getElementById(modalId));
                                  kbValidation.unbind(self);
                                  $("#" + modalId).modal('hide');
                              }});

           this.fetchLocations(this ,
                function(allData) {
                   self.renderView4Config(
                        $("#" + modalId).find("#" + modalId + "-form"),
                        self.model, getLocationViewConfig(false, allData),
                        '', null, null, function(){
                            self.model.showErrorAttr(prefixId +
                                    cowc.FORM_SUFFIX_ID, false);
                    Knockback.applyBindings(self.model,
                                    document.getElementById(modalId));
                    kbValidation.bind(self,{collection:
                          self.model.model().attributes.LocationDetails});
                        }, null, false);
                   return;
               }
           );
        },
        fetchLocations : function(self, callback) {
            var getAjaxs = [];
            getAjaxs[0] = $.ajax({
                url: ctwc.GOHAN_LOCATION,
                type:"GET"
            });

            $.when.apply($, getAjaxs).then(
                function () {
                    var returnArr = []
                    var results = arguments;
                    var vns = results[0]["locations"];
                    var allVns = [];
                   if (null !== vns && typeof vns === "object" && vns.length > 0) {
                        for (var i = 0; i < vns.length; i++) {
                            allVns.push({text : vns[i].name,
                                     value : vns[i].id + cowc.DROPDOWN_VALUE_SEPARATOR + "location_value",
                                     id : vns[i].id + cowc.DROPDOWN_VALUE_SEPARATOR + "location_value",
                                     parent : "location_value" });
                        }
                    }
                    var addrFields = [];
                    addrFields.push({text : 'Locations', value : 'location_value',
                                   children : allVns});
                    returnArr["addrFields"] = addrFields;
                    callback(returnArr);
                }
            )
        }
    });

    function getFlavorViewConfig () {
        var prefixId = ctwl.CFG_FLAVOR_PREFIX_ID;
        var flavorViewConfig = {
            elementId: cowu.formatElementId([prefixId, ctwl.CFG_FLAVOR_TITLE_CREATE]),
            title: "Flavor",//permissions
            view: "SectionView",
            viewConfig: {
                rows: [
                    {
                        columns: [
                            {
                                elementId: 'name',
                                view: 'FormInputView',
                                viewConfig: {
                                    label: 'Name',
                                    placeholder: 'Name',
                                    path: 'name',
                                    class: 'col-xs-6',
                                    dataBindValue: 'name',
                                }
                            },
                            {
                                elementId: 'description',
                                view: 'FormInputView',
                                viewConfig: {
                                    label: 'Description',
                                    placeholder: 'Description',
                                    path: 'description',
                                    class: 'col-xs-6',
                                    dataBindValue: 'description',
                                }
                            }
                        ]
                    },
                    {
                        columns: [
                            {
                                elementId: 'ram',
                                view: 'FormInputView',
                                viewConfig: {
                                    label: 'RAM (MB)',
                                    placeholder: 'RAM (MB)',
                                    path: 'ram',
                                    class: 'col-xs-6',
                                    dataBindValue: 'ram',
                                }
                            },
                            {
                                elementId: 'vcpus',
                                view: 'FormInputView',
                                viewConfig: {
                                    label: 'VCPUs',
                                    placeholder: 'VCPUs',
                                    path: 'vcpus',
                                    class: 'col-xs-6',
                                    dataBindValue: 'vcpus',
                                }
                            }
                        ]
                    },
                    {
                        columns: [
                            {
                                elementId: 'disk',
                                view: 'FormInputView',
                                viewConfig: {
                                    label: 'Disk (GB)',
                                    placeholder: 'Disk (GB)',
                                    path: 'disk',
                                    class: 'col-xs-6',
                                    dataBindValue: 'disk',
                                }
                            },
                            {
                                elementId: 'swap',
                                view: 'FormInputView',
                                viewConfig: {
                                    label: 'Swap (GB)',
                                    placeholder: 'Swap (GB)',
                                    path: 'swap',
                                    class: 'col-xs-6',
                                    dataBindValue: 'swap',
                                }
                            }
                        ]
                    },
                    {
                        columns: [
                            {
                                elementId: 'ephemeral',
                                view: 'FormInputView',
                                viewConfig: {
                                    label: 'Ephemeral (GB)',
                                    placeholder: 'Ephemeral (GB)',
                                    path: 'ephemeral',
                                    class: 'col-xs-6',
                                    dataBindValue: 'ephemeral',
                                }
                            }
                        ]
                    }
                ]  // End Rows
            }
        }
        return flavorViewConfig;
    }
    function getFlavorEditViewConfig () {
        var prefixId = ctwl.CFG_FLAVOR_PREFIX_ID;
        var serverViewConfig = {
            elementId: cowu.formatElementId([prefixId, ctwl.CFG_FLAVOR_TITLE_CREATE]),
            title: "Flavor",
            view: "SectionView",
            viewConfig: {
                rows: [
                    {
                        columns: [
                            {
                                elementId: 'description',
                                view: 'FormInputView',
                                viewConfig: {
                                    label: 'Description',
                                    placeholder: 'Description',
                                    path: 'description',
                                    class: 'col-xs-12',
                                    dataBindValue: 'description',
                                }
                            }
                        ]
                    }
                ]

            }
        }
        return serverViewConfig;
    }
    var getLocationViewConfig = function(isDisable, allData) {
        return {
            elementId: cowu.formatElementId(
                            [prefixId, ctwl.TITLE_EDIT_POLICY]),
            view: "SectionView",
            viewConfig:{
            rows: [{
                    columns: [{
                        elementId: 'LocationDetails',
                        view: "FormCollectionView",
                        //view: "FormEditableGridView",
                        viewConfig: {
                            label:"",
                            path: "LocationDetails",
                            class: 'col-xs-12',
                            //validation: 'ruleValidation',
                            templateId: cowc.TMPL_COLLECTION_HEADING_VIEW,
                            collection: "LocationDetails",
                            rows:[{
                               rowActions: [
                                  {onClick: "function() { $root.addRule(); }",
                                        iconClass: 'fa fa-plus'},
                                  {onClick:
                                   "function() { $root.deleteRules($data, this); }",
                                    iconClass: 'fa fa-minus'}
                               ],
                            columns: [
                                    {
                                      elementId: 'locationName',
                                      view:
                                          "FormHierarchicalDropdownView",
                                      name: 'Location ID',
                                      width: 220,
                                      class: "",
                                       viewConfig: {
                                          disabled: 'showLocation()',
                                          templateId: cowc.TMPL_EDITABLE_GRID_DROPDOWN_VIEW,
                                          path: 'locationName',
                                          dataBindValue: 'locationName()',
                                          elementConfig: {
                                              minimumResultsForSearch : 1,
                                              dataTextField: "text",
                                              dataValueField: "value",
                                              data: allData.addrFields,
                                              queryMap: [
                                              {
                                                  name : 'Locations',
                                                  value : 'location_value'
                                              }]
                                          }
                                      }
                                  },
                                  {
                                      elementId: 'name',
                                      name: 'Name',
                                      view: "FormInputView",
                                      class: "",
                                      width: 220,
                                      viewConfig: {
                                         disabled: 'showLocation()',
                                         templateId: cowc.TMPL_EDITABLE_GRID_INPUT_VIEW,
                                         path: 'name',
                                         dataBindValue: 'name()'
                                      }
                                   },
                                  {
                                       elementId: 'description',
                                       name: 'Description',
                                       view: "FormInputView",
                                       class: "",
                                       width: 300,
                                       viewConfig: {
                                          disabled: false,
                                          placeholder: 'Description',
                                          templateId: cowc.TMPL_EDITABLE_GRID_INPUT_VIEW,
                                          path: 'description',
                                          dataBindValue: 'description()'
                                       }
                                    },
                                    {
                                        elementId: 'status',
                                        name: 'Status',
                                        view: "FormInputView",
                                        class: "",
                                        width: 240,
                                        viewConfig: {
                                           disabled: true,
                                           templateId: cowc.TMPL_EDITABLE_GRID_INPUT_VIEW,
                                           path: 'status',
                                           dataBindValue: 'status()'
                                           }
                                    },
                                    {
                                        elementId: 'taskStatus',
                                        name: 'Task Status',
                                        view: "FormInputView",
                                        class: "",
                                        width: 240,
                                        viewConfig: {
                                           disabled: true,
                                           templateId: cowc.TMPL_EDITABLE_GRID_INPUT_VIEW,
                                           path: 'taskStatus',
                                           dataBindValue: 'taskStatus()'
                                        }
                                     }
                              ]
                            }],
                            gridActions: [
                                {onClick: "function() { addRule(); }",
                                 buttonTitle: ""}
                            ]
                    }
                  }]
                }]
            }
        }
    }
    return flavorEditView;
});


text:
import os
from django.utils import unittest

def suite():
    suite = unittest.TestLoader()
    tests = suite.discover(os.path.dirname(__file__))
    return tests


text:
#include <modules/opengl/clockgl.h>

#include <inviwo/core/util/logcentral.h>

namespace inviwo {

ClockGL::ClockGL() { start(); }

ClockGL::~ClockGL() {
    for (auto& query : queries_) {
        glDeleteQueries(2, query.ids.data());
    }
}

bool ClockGL::isRunning() const {
    return !queries_.empty() && queries_.back().state == State::Started;
}

void ClockGL::start() {
    collectTiming();

    if (!queries_.empty() && queries_.back().state == State::Started) {
        glQueryCounter(queries_.back().startId(), GL_TIMESTAMP);
    } else if (!queries_.empty() && queries_.front().state == State::Unused) {
        std::rotate(queries_.begin(), queries_.begin() + 1, queries_.end());
        glQueryCounter(queries_.back().startId(), GL_TIMESTAMP);
        queries_.back().state = State::Started;
    } else {
        queries_.push_back({{0, 0}, State::Started});
        glGenQueries(2, queries_.back().ids.data());
        glQueryCounter(queries_.back().startId(), GL_TIMESTAMP);
    }
}

void ClockGL::stop() {
    if (isRunning()) {
        glQueryCounter(queries_.back().stopId(), GL_TIMESTAMP);
        queries_.back().state = State::Stopped;
    }
}

void ClockGL::reset() {
    for (auto& query : queries_) {
        query.state = State::Unused;
    }
    accumulatedTime_ = static_cast<duration>(0);
}

auto ClockGL::getElapsedTime(std::chrono::seconds timeout) -> duration {
    auto startWaitingTime = std::chrono::high_resolution_clock::now();

    if (isRunning()) {
        // add query end marker to get time elapsed since start without affecting ongoing
        // measurement
        glQueryCounter(queries_.back().stopId(), GL_TIMESTAMP);
    }

    // ensure that query results are available. Abort after timeOut, which might be caused by
    // using the same ClockGL in different contexts or a GL computation taking too long.
    int done = 0;
    while (!done && std::chrono::high_resolution_clock::now() - startWaitingTime < timeout) {
        glGetQueryObjectiv(queries_.back().stopId(), GL_QUERY_RESULT_AVAILABLE, &done);
    }

    collectTiming();
    if (done) {
        if (isRunning()) {
            // special case if last query is still ongoing, i.e. this query is
            // not considered by collectTiming()
            GLuint64 start;
            GLuint64 stop;
            glGetQueryObjectui64v(queries_.back().startId(), GL_QUERY_RESULT, &start);
            glGetQueryObjectui64v(queries_.back().stopId(), GL_QUERY_RESULT, &stop);
            return accumulatedTime_ + std::chrono::nanoseconds{stop - start};
        } else {
            return accumulatedTime_;
        }
    } else {  // timeout
        std::string msg =
            "ClockGL timeout: ClockGL waited " +
            std::to_string(std::chrono::duration_cast<std::chrono::seconds>(timeout).count()) +
            "s for OpenGL to finish. Elapsed time will be incorrect.\n"
            "This can be caused by compute-intensive operations or using "
            "ClockGL in different GL contexts.";
        LogCentral::getPtr()->log("ClockGL", LogLevel::Error, LogAudience::User, __FILE__,
                                  __FUNCTION__, __LINE__, msg);
        return accumulatedTime_;
    }
}

void ClockGL::collectTiming() {
    for (auto& query : queries_) {
        if (query.state == State::Stopped) {
            int done = 0;
            glGetQueryObjectiv(query.stopId(), GL_QUERY_RESULT_AVAILABLE, &done);
            if (done) {
                GLuint64 start;
                GLuint64 stop;
                glGetQueryObjectui64v(query.startId(), GL_QUERY_RESULT, &start);
                glGetQueryObjectui64v(query.stopId(), GL_QUERY_RESULT, &stop);
                accumulatedTime_ += std::chrono::nanoseconds{stop - start};
                query.state = State::Unused;
            }
        }
    }
    std::stable_partition(queries_.begin(), queries_.end(),
                          [](auto& query) { return query.state == State::Unused; });
}

double ClockGL::getElapsedMilliseconds(std::chrono::seconds timeout) {
    using duration_double = std::chrono::duration<double, std::chrono::milliseconds::period>;
    return std::chrono::duration_cast<duration_double>(getElapsedTime(timeout)).count();
}

double ClockGL::getElapsedSeconds(std::chrono::seconds timeout) {
    using duration_double = std::chrono::duration<double, std::chrono::seconds::period>;
    return std::chrono::duration_cast<duration_double>(getElapsedTime(timeout)).count();
}

}  // namespace inviwo


text:
import sade from 'sade'
import action from './action'

const program = sade('github-version-checker', true)

program
    .version('dev')
    .option('-o, --owner', 'The repository owner. May be a username or organization name.')
    .option('-r, --repository', 'The repository name.')
    .option('-c, --current-version', 'The current application version.')
    .option('-t, --tags', 'Fetches tags instead of releases.')
    .option('--no-pre-releases', 'Excludes pre-releases.', false)
    .option('--token', 'A PAT to use.')
    .option('--json', 'Outputs the raw result data as JSON.', false)
    .action(action)

program.parse(process.argv)


text:
<?php

declare(strict_types=1);

namespace Bazinga\GeocoderBundle\Tests\Functional;

use Bazinga\GeocoderBundle\BazingaGeocoderBundle;
use Bazinga\GeocoderBundle\Tests\PublicServicePass;
use Geocoder\Provider\AlgoliaPlaces\AlgoliaPlaces;
use Geocoder\Provider\ArcGISOnline\ArcGISOnline;
use Geocoder\Provider\BingMaps\BingMaps;
use Geocoder\Provider\Chain\Chain;
use Geocoder\Provider\FreeGeoIp\FreeGeoIp;
use Geocoder\Provider\Geoip\Geoip;
use Geocoder\Provider\GeoIP2\GeoIP2;
use Geocoder\Provider\GeoIPs\GeoIPs;
use Geocoder\Provider\Geonames\Geonames;
use Geocoder\Provider\GeoPlugin\GeoPlugin;
use Geocoder\Provider\GoogleMaps\GoogleMaps;
use Geocoder\Provider\GoogleMapsPlaces\GoogleMapsPlaces;
use Geocoder\Provider\Here\Here;
use Geocoder\Provider\HostIp\HostIp;
use Geocoder\Provider\IpInfo\IpInfo;
use Geocoder\Provider\IpInfoDb\IpInfoDb;
use Geocoder\Provider\Ipstack\Ipstack;
use Geocoder\Provider\LocationIQ\LocationIQ;
use Geocoder\Provider\Mapbox\Mapbox;
use Geocoder\Provider\MapQuest\MapQuest;
use Geocoder\Provider\Mapzen\Mapzen;
use Geocoder\Provider\MaxMind\MaxMind;
use Geocoder\Provider\MaxMindBinary\MaxMindBinary;
use Geocoder\Provider\Nominatim\Nominatim;
use Geocoder\Provider\OpenCage\OpenCage;
use Geocoder\Provider\PickPoint\PickPoint;
use Geocoder\Provider\TomTom\TomTom;
use Geocoder\Provider\Yandex\Yandex;
use Nyholm\BundleTest\TestKernel;
use Nyholm\NSA;
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\HttpKernel\KernelInterface;

final class ProviderFactoryTest extends KernelTestCase
{
    use ExpectDeprecationTrait;

    protected static function getKernelClass(): string
    {
        return TestKernel::class;
    }

    protected static function createKernel(array $options = []): KernelInterface
    {
        /**
         * @var TestKernel $kernel
         */
        $kernel = parent::createKernel($options);
        $kernel->addTestBundle(BazingaGeocoderBundle::class);
        $kernel->addTestCompilerPass(new PublicServicePass('|[Bb]azinga:*|'));
        $kernel->addTestCompilerPass(new PublicServicePass('|[gG]eocoder:*|'));
        $kernel->handleOptions($options);

        return $kernel;
    }

    /**
     * @param class-string           $class
     * @param list<non-empty-string> $serviceNames
     *
     * @dataProvider getProviders
     */
    public function testProviderConfiguration(string $class, array $serviceNames): void
    {
        $kernel = self::bootKernel(['config' => static function (TestKernel $kernel) use ($class) {
            $kernel->addTestConfig(__DIR__.'/config/framework.yml');
            $kernel->addTestConfig(__DIR__.'/config/provider/'.strtolower(substr($class, strrpos($class, '\\') + 1)).'.yml');
        }]);

        $container = method_exists(__CLASS__, 'getContainer') ? self::getContainer() : $kernel->getContainer();

        foreach ($serviceNames as $name) {
            self::assertTrue($container->has('bazinga_geocoder.provider.'.$name));
            $service = $container->get('bazinga_geocoder.provider.'.$name);
            self::assertInstanceOf($class, NSA::getProperty($service, 'provider'));
        }
    }

    /**
     * @return iterable<array{0: class-string, 1: list<non-empty-string>}>
     */
    public function getProviders(): iterable
    {
        yield [AlgoliaPlaces::class, ['empty', 'acme']];
        yield [ArcGISOnline::class, ['empty', 'acme']];
        yield [BingMaps::class, ['acme']];
        yield [Chain::class, ['acme']];
        yield [FreeGeoIp::class, ['empty', 'acme']];
        // yield [Geoip::class, ['empty']];
        yield [GeoIP2::class, ['acme']];
        if (class_exists(GeoIPs::class)) {
            yield [GeoIPs::class, ['acme']];
        }
        yield [Geonames::class, ['acme']];
        yield [GeoPlugin::class, ['empty']];
        yield [GoogleMaps::class, ['empty']];
        yield [GoogleMapsPlaces::class, ['acme']];
        yield [Here::class, ['acme']];
        yield [HostIp::class, ['empty']];
        yield [IpInfo::class, ['acme']];
        yield [IpInfoDb::class, ['empty', 'acme']];
        yield [Ipstack::class, ['acme']];
        yield [LocationIQ::class, ['acme']];
        yield [Mapbox::class, ['acme']];
        yield [MapQuest::class, ['acme']];
        if (class_exists(Mapzen::class)) {
            yield [Mapzen::class, ['acme']];
        }
        yield [MaxMind::class, ['acme']];
        yield [MaxMindBinary::class, ['acme']];
        yield [Nominatim::class, ['empty', 'acme']];
        yield [OpenCage::class, ['acme']];
        yield [PickPoint::class, ['acme']];
        yield [TomTom::class, ['acme']];
        yield [Yandex::class, ['empty', 'acme']];
    }

    /**
     * @group legacy
     */
    public function testProviderConfigurationWithDeprecatedHttplugClientOption(): void
    {
        $kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
            $kernel->addTestConfig(__DIR__.'/config/framework.yml');
            $kernel->addTestConfig(__DIR__.'/config/deprecated_httplug_client_option.yml');
        }]);

        $container = method_exists(__CLASS__, 'getContainer') ? self::getContainer() : $kernel->getContainer();

        $this->expectDeprecation('Since willdurand/geocoder-bundle 5.19: The option "httplug_client" is deprecated, use "http_client" instead.');

        self::assertTrue($container->has('bazinga_geocoder.provider.acme'));
        $container->get('bazinga_geocoder.provider.acme');
    }
}


text:
/* Floatbox v3.54.1 */
/* November 10, 2009 */

div#fbPathChecker {
	background-image: url(graphics/blank.gif);  /* required for detection of graphics folder path */
}

div#fbOverlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border-width: 0;
	margin: 0;
	padding: 0;
}

div#fbBox {
	position: absolute;
	border-style: solid;
	border-width: 0;
	margin: 0;
	padding: 0;
}

#fbBox div.fb, #fbBox a.fb, #fbBox img.fb, #fbBox iframe.fb, #fbBox #fbIndexLinks a, div#fbZoomDiv img#fbZoomImg {
	border-width: 0;
	margin: 0;
	padding: 0;
	outline: none;
	-moz-outline: none;  /* for older Netscape, doesn't validate, remove if you like */
	box-sizing: content-box;  /* in case * box-sizing:border-box is set */
}
#fbBox a.fb {
	background-image: url(graphics/blank.gif);
	background-color: transparent;
/* 	white-space: nowrap; */
	_zoom: 1;  /* gives layout for ie6 */
}
#fbBox div.fb {
	background-color: transparent;
}

div#fbZoomDiv, a.fbPopup img, a.fbPopdown img, a.fbPopleft img, a.fbPopright img, #fbBox #fbIndexLinks img {
	position: absolute;
	left: 0;
	top: -9999px;
	border-style: solid;
	border-color: black;
	/* border-width is set in js code */
	margin: 0;
	padding: 0;
}

#fbBox #fbBoxLoader, #fbZoomDiv #fbZoomLoader, #fbMainDiv #fbMainLoader {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	min-width: 100%;
	min-height: 100%;
	overflow: hidden;
	background-position: center;
	background-repeat: no-repeat;
}

#fbZoomDiv #fbZoomLoader, #fbMainDiv #fbMainLoader { background-image: url(graphics/loader_black.gif); }

div.fbCycler a, div.fbCycler div {
	position: absolute;
	text-decoration: none;
}
div.fbCycler span {  /* wrap text under the thumbnail/image */
	display: block;
	text-align: center;
}
div.fbCycler a span {
	text-decoration: underline;
}

#fbBox #fbShadows, #fbBox #fbShadowTop, #fbBox #fbShadowRight, #fbBox #fbShadowBottom, #fbBox #fbShadowLeft, #fbBox #fbShadowCorner,
#fbBox #fbCorners, #fbBox #fbCornerTop, #fbBox #fbCornerRight, #fbBox #fbCornerBottom, #fbBox #fbCornerLeft {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-repeat: no-repeat;
	overflow: hidden;
}
#fbBox #fbShadows, #fbBox #fbCorners {
	overflow: visible;
}

#fbBox #fbShadowTop, #fbBox #fbShadowLeft, #fbBox #fbCornerTop { background-position: top left; }
#fbBox #fbShadowRight, #fbBox #fbCornerRight { background-position: top right; }
#fbBox #fbShadowCorner, #fbBox #fbCornerBottom { background-position: bottom right; }
#fbBox #fbShadowBottom, #fbBox #fbCornerLeft { background-position: bottom left; }

#fbBox #fbCanvas {
	position: relative;  /* images won't fade in/out in ie6 if absolute */
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
}

#fbBox #fbContent {
	height: 100%;
}

#fbBox #fbMainDiv, #fbBox #fbtlPanel, #fbBox #fbtrPanel, #fbBox #fbblPanel, #fbBox #fbbrPanel {
	position: absolute;
	border-style: solid;
	overflow: hidden;
}
#fbBox #fbMainDiv, div#fbZoomDiv {
	background-color: #fff;
}

#fbBox #fbInfoLink, #fbBox #fbPrintLink {  /* "Info...", "Print..." */
	font-weight: bold;
}

#fbBox #fbResizer {
	position: absolute;
	left: 0;
	top: 0;
	width: 25px;  /* dimensions of the resize button */
	height: 25px;
}

#fbBox #fbDragger {
	position: absolute;
	width: 12px;
	height: 12px;
	cursor: nw-resize;
	background-position: bottom right;  /* 'cause ie6 makes it taller than 12px */
	background-repeat: no-repeat;
}

#fbBox #fbLeftNav, #fbBox #fbRightNav {
	position: absolute;
	height: 100%;
}
#fbBox #fbLeftNav, #fbBox #fbOverlayPrev {
	left: 0;
}
#fbBox #fbRightNav, #fbBox #fbOverlayNext {
	right: 0;
}

#fbBox #fbOverlayPrev, #fbBox #fbOverlayNext {
	position: absolute;
	width: 49px;  /* dimensions of the upper prev and next graphics */
	height: 23px;
	background-repeat: no-repeat;
}

#fbBox #fbtlPanel, #fbBox #fbtrPanel, #fbBox #fbblPanel, #fbBox #fbbrPanel {
	line-height: 1.25em;
	/* caption etc. text */
  	font-family: Verdana, Helvetica, sans-serif;
	font-size: 12px;
}

#fbBox #fbCaption, #fbBox #fbCaption2 {
	cursor: default;
}

#fbBox #fbItemNumber {
	font-size: 10px;  /* 'image x of y' text */
	white-space: nowrap;
	cursor: default;
}

#fbBox #fbControls {
	height: 14px;  /* height of control widget graphics - they should all be the same */
	font-size: 1px;
}

#fbBox #fbNavControls {
	width: 88px;  /* sum of lowerprev and lowernext widths */
	height: 14px;  /* height of 1 sprite panel in lowerprev and lowernext graphics */
}

#fbBox #fbPrev {
	float: left;
	width: 44px;  /* dimensions of the lower nav 'prev' graphic */
	height: 14px;
	background-repeat: no-repeat;
}

#fbBox #fbNext {
	float: right;
	width: 44px;  /* dimensions of the lower nav 'next' graphic */
	height: 14px;
	background-repeat: no-repeat;
}

#fbBox #fbPlay, #fbBox #fbPause {
	position: absolute;
	background-repeat: no-repeat;
}

#fbBox #fbPlayPause, #fbBox #fbPlay, #fbBox #fbPause {
	width: 46px;  /* dimensions of the 'play' and 'pause' graphics (they need to be the same size) */
	height: 14px;
	text-align: justify;
}

#fbBox #fbClose {
	width: 46px;  /* dimensions of the 'close' graphic */
	height: 14px;
	background-repeat: no-repeat;
}

#fbBox #fbIndexLinks, #fbBox #fbNewWindowLink {
	clear: both;
	font-size: 12px;
}
#fbBox #fbNewWindowLink a {
	font-size: 12px;
	padding-left: 19px;  /* for the bg image */
	background-repeat: no-repeat;
	background-position: top left;
}
#fbBox #fbNewWindowLink a:hover {
	background-position: bottom left;
}

/* posLeft, posCenter & posRight are dynamically assigned classes that allow layout of the panels depending on which side they're on */
#fbBox #fbtlPanel.posCenter, #fbBox #fbtrPanel.posCenter,
#fbBox #fbblPanel.posCenter, #fbBox #fbbrPanel.posCenter,
#fbBox #fbtlWidgetDiv.posCenter, #fbBox #fbtrWidgetDiv.posCenter,
#fbBox #fbblWidgetDiv.posCenter, #fbBox #fbbrWidgetDiv.posCenter,
#fbBox #fbIndexLinks.posCenter, #fbBox #fbNewWindowLink.posCenter {
	margin: 0 auto;
}
#fbBox #fbtlPanel.posRight, #fbBox #fbtrPanel.posRight,
#fbBox #fbblPanel.posRight, #fbBox #fbbrPanel.posRight,
#fbBox #fbtlWidgetDiv.posRight, #fbBox #fbtrWidgetDiv.posRight,
#fbBox #fbblWidgetDiv.posRight, #fbBox #fbbrWidgetDiv.posRight,
#fbBox #fbIndexLinks.posRight, #fbBox #fbNewWindowLink.posRight,
#fbBox #fbControls.posRight, #fbBox #fbClose.posRight,
#fbBox #fbSubControls.posRight, #fbBox #fbNavControls.posLeft,
#fbBox #fbPlayPause.posLeft {
	float: right;
}
#fbBox #fbtlPanel.posLeft, #fbBox #fbtrPanel.posLeft,
#fbBox #fbblPanel.posLeft, #fbBox #fbbrPanel.posLeft,
#fbBox #fbtlWidgetDiv.posLeft, #fbBox #fbtrWidgetDiv.posLeft,
#fbBox #fbblWidgetDiv.posLeft, #fbBox #fbbrWidgetDiv.posLeft,
#fbBox #fbIndexLinks.posLeft, #fbBox #fbNewWindowLink.posLeft,
#fbBox #fbControls.posLeft, #fbBox #fbClose.posLeft,
#fbBox #fbSubControls.posLeft, #fbBox #fbNavControls.posRight,
#fbBox #fbPlayPause.posRight {
	float: left;
}
/* IE6 wants these, maybe for layout? */
#fbSubControls, #fbClose, #fbIndexLinks, #fbNewWindowLink, #fbPlayPause, #fbNavControls {
	float: left;
}


text:
package com.alibaba.json.bvt.path.extract;

import com.alibaba.fastjson.JSONPath;
import junit.framework.TestCase;

import java.net.InetSocketAddress;

public class JSONPath_extract_1 extends TestCase {
    public void test_0() throws Exception {
        String json = "[{\"id\":1001},{\"id\":1002},{\"id\":1003},[1],123,-4,\"a\\\"bc\"]";

        assertEquals("{\"id\":1001}"
                , JSONPath.extract(json, "$.0")
                    .toString());

        assertEquals("{\"id\":1002}"
                , JSONPath.extract(json, "$.1")
                        .toString());

        assertEquals("{\"id\":1003}"
                , JSONPath.extract(json, "$.2")
                        .toString());

        assertEquals("[1]"
                , JSONPath.extract(json, "$.3")
                        .toString());

        assertEquals("123"
                , JSONPath.extract(json, "$.4")
                        .toString());

        assertEquals("-4"
                , JSONPath.extract(json, "$.5")
                        .toString());

        assertEquals("a\"bc"
                , JSONPath.extract(json, "$.6")
                        .toString());
    }

    public void test_1() throws Exception {
        String json = "[\"a\\\"bc\",123]";

        assertEquals("a\"bc"
                , JSONPath.extract(json, "$.0")
                        .toString());

        assertEquals("123"
                , JSONPath.extract(json, "$.1")
                        .toString());
    }

    public void test_2() throws Exception {
        String json = "[\"a\\\\bc\",123]";

        assertEquals("a\\bc"
                , JSONPath.extract(json, "$.0")
                        .toString());

        assertEquals("123"
                , JSONPath.extract(json, "$.1")
                        .toString());
    }

    public void test_3() throws Exception {
        String json = "[\"a\\\"b\\\\c\\\"d\\\"e\",123]";

        assertEquals("a\"b\\c\"d\"e"
                , JSONPath.extract(json, "$.0")
                        .toString());

        assertEquals("123"
                , JSONPath.extract(json, "$.1")
                        .toString());

        assertNull(JSONPath.extract(json, "$.2"));
    }
}


text:
{% extends "micro/base.html" %}
{% block content %}
<form action="/micro/post/" method="post">
  {% csrf_token %}
  {{ form }}
  <input type="submit" value="Submit" />
</form>
{% endblock %}