text:
app.controller('ProfileCtrl', function ($scope, $http, $location,$rootScope) {
  console.log("Profile Controller");
  //$scope.currentUser = $rootScope.currentUser;
  //$scope.friends = $scope.currentUser.friends;
  $scope.phones = $scope.currentUser.phones;
  $scope.items = $scope.currentUser.items;
  $scope.locations = $scope.currentUser.locations;
  $scope.friendRequests = $scope.currentUser.friendRequests;
  //$scope.friends = parseFriendList($scope.currentUser.friends);
  $scope.sentFriendRequests = $scope.currentUser.sentFriendRequests;
  console.log($scope.friendRequests);
  //console.log($scope.friends);

  // USER OPERATIONS ************************************************
  // Get all users from DB
  $http.get("/rest/user")
    .success(function (users) {
      $scope.users = users;
      $scope.friends = parseFriendList($scope.currentUser.friends);
      //console.log($scope.friends);
    });

  // Delete a user from the DB
  $scope.delUser = function (user) {
    var index = $scope.users.indexOf(user);
    $scope.users.splice(index, 1);
    $http.post("/rest/delUser", user)
      .success(function (deleteduser) {
        //console.log("deleterdUser =", user);
        $location.url("/profile");
      });
  };

  function getUserById(id) {
    //console.log(id);
    for (i = 0; i < $scope.users.length; i++) {
      if ($scope.users[i]._id == id) {
        //console.log("Success Find User");
        return $scope.users[i];
      }
    }
    return -1;
  }

  function updateUserDB(updatedUser) {
    $http.post("/api/updateUser", updatedUser)
       .success(function (resource) {
         console.log("RESOURCE ==");
         console.log(resource);
         $scope.currentUser = updatedUser;
       });
  };

  // MODALS **********************************************************

  // Opens the Update User Modal
  $scope.openUpdateUserModal = function (user) {
    $scope.updateUser = user;
    $("#openUpdateUserModal").modal('show');
  };

  //Updates the user
  $scope.updateUserInDb = function (updatedUser) {
    $("#openUpdateUserModal").modal('hide');
    updateUserDB(updatedUser);
    $location.url("/profile");
  };

  // Opens the Add New Item Modal
  $scope.openAddNewItemModal = function () {
    $("#openAddNewItemModal").modal('show');
  };

  // Adds a new item to the currentUser and the scope.items arrays
  $scope.addNewItem = function (item) {
    console.log(item);
    if ($scope.currentUser.items.indexOf(item) == -1) {
      $scope.currentUser.items.push(item);
      $scope.items = $scope.currentUser.items;

      var updatedUser = $scope.currentUser;
      $("#openAddNewItemModal").modal('hide');
      updateUserDB(updatedUser);
      $location.url("/profile");
    }
  };

  // Opens the Update Item Modal
  $scope.openUpdateItemModal = function (item) {
    $scope.updatedItem = item;
    console.log($scope.updatedItem);
    $("#openUpdateItemModal").modal('show');
  };

  // Update an Item from Current Users Item List
  $scope.updateItem = function (updatedItem) {
    console.log("UPDATE ITEM");
    console.log($scope.updatedItem);
    var index = $scope.currentUser.items.indexOf($scope.updatedItem);
    console.log(index);
    if (index > -1) {
      $scope.currentUser.items[index] = updatedItem;
      $scope.items = $scope.currentUser.items;
      var updatedUser = $scope.currentUser;
      $("#openUpdateItemModal").modal('hide');
      updateUserDB(updatedUser);
      $location.url("/profile");
    }
  };

  // Delete an Item from Current Users Item List
  $scope.deleteItem = function (item) {
    var index = $scope.currentUser.items.indexOf(item);
    if (index > -1) {
      $scope.currentUser.items.splice(index, 1);
      $scope.items = $scope.currentUser.items;

      var updatedUser = $scope.currentUser;
      updateUserDB(updatedUser);
      $location.url("/profile");
    }
  };

  // FRIEND FUNCTIONS *********************************************

  // gets the index of a request in an array, returns array index
  function getRequestId(array, sourceId, recipientId) {
    console.log(array);
    for (i = 0; i < array.length; i++) {
      if (array[i].sourceUserId == sourceId && array[i].recipient == recipientId) {
        return i;
      }
      return -1;
    }
  };

  // Delete a friend
  $scope.unfriend = function (friend) {
    // Remove the current user from the friends list
    var indexFriend = friend.friends.indexOf($scope.currentUser._id);
    console.log(friend);
    friend.friends.splice(indexFriend, 1);
    updateUserDB(friend);
    var index = $scope.currentUser.friends.indexOf(friend._id);
    console.log(index);
    //Remove the friend from the current users friends list
    $scope.currentUser.friends.splice(index, 1);
    //update friends in scope
    $scope.friends = parseFriendList($scope.currentUser.friends);
    updateUserDB($scope.currentUser);

    $location.url("/profile");
  };

  // Send a Friend Request
  $scope.sendRequest = function (newFriend) {
    if ($scope.friends.indexOf(newFriend) > -1) {
      console.log("Already Friends");
      return -1;
    }
    var request = {
      sourceUserId: $scope.currentUser._id,
      sourceFirstName: $scope.currentUser.firstName,
      sourceLastName: $scope.currentUser.lastName,
      recipient: newFriend._id,
      recFirstName: newFriend.firstName,
      recLastName: newFriend.lastName,
      dateSent: Date.now()
    };
    // If the recipients request list doesn't contain the request, add it
    if (newFriend.friendRequests.indexOf(request) == -1) {
      newFriend.friendRequests.push(request);
      updateUserDB(newFriend);
    }
    if ($scope.currentUser.sentFriendRequests.indexOf(request) == -1) {
      $scope.currentUser.sentFriendRequests.push(request);
      updateUserDB($scope.currentUser);
    }
    $location.url("/profile");

    /*$http.post('/api/sendFriendRequest', request)
     .success(function (user) {
       if (user) alert("Request Sent");
       //console.log(user);
       $location.url("/friends");
     });
     */
  };

  // Deny a friend request
  $scope.denyRequest = function (request) {
    console.log("DENY REQUEST");
    var senderId = request.sourceUserId;
    var recipientId = request.recipient;
    var sender = getUserById(senderId);
    var recipient = getUserById(recipientId);

    // Remove from respective lists
    var indexSender = getRequestId(sender.sentFriendRequests, request.sourceUserId, request.recipient);
    console.log(sender.sentFriendRequests[indexSender]);
    console.log(indexSender);
    if (indexSender > -1) {
      sender.sentFriendRequests.splice(indexSender, 1);
      console.log("DB UPDATE SENDER");
      updateUserDB(sender);
    }
    var indexRecipient = getRequestId(recipient.friendRequests, request.sourceUserId, request.recipient);
    console.log(recipient.friendRequests[0]);
    console.log(indexRecipient);
    if (indexSender > -1) {
      recipient.friendRequests.splice(indexRecipient, 1);
      $scope.currentUser = recipient;
      $scope.friendRequests = $scope.currentUser.friendRequests;
      console.log("DB UPDATE RECIPIENT");
      updateUserDB(recipient);
    }
    $location.url("/profile");
  };

  // Approve a friend request
  $scope.approveRequest = function (request) {
    console.log("APPROVE REQUEST");
    var senderId = request.sourceUserId;
    var recipientId = request.recipient;
    var sender = getUserById(senderId);
    //console.log(sender);
    var recipient = getUserById(recipientId);
    //console.log(recipient);

    // Remove from respective request lists and add to friends list
    var indexSender = getRequestId(sender.sentFriendRequests, request.sourceUserId, request.recipient);
    console.log(indexSender);
    if (indexSender > -1) {
      //remove from requests
      sender.sentFriendRequests.splice(indexSender, 1);
      //add to friendlist
      sender.friends.push(recipient._id);
      console.log("DB UPDATE SENDER");
      console.log(sender);
      updateUserDB(sender);
    }
    var indexRecipient = getRequestId(recipient.friendRequests, request.sourceUserId, request.recipient);
    console.log(indexRecipient);
    if (indexRecipient > -1) {
      // remove frome requests list
      recipient.friendRequests.splice(indexRecipient, 1);
      // add user to friends list
      recipient.friends.push(sender._id);
      // update current user in scope
      $scope.currentUser = recipient;
      // update friends list in scope
      $scope.friendRequests = $scope.currentUser.friendRequests;
      $scope.friends = parseFriendList($scope.currentUser.friends);
      console.log("DB UPDATE RECIPIENT");
      console.log(recipient);
      updateUserDB(recipient);
    }
    $location.url("/profile");
  };

  // Parse the friends list from a list of id's to a list of users data
  function parseFriendList(idList) {
    var index;
    var friendList = new Array();
    for (i = 0; i < $scope.users.length; i++) {
      index = idList.indexOf($scope.users[i]._id);
      //console.log(index);
      if (index > -1) {
        friendList.push($scope.users[i]);
      }
    }
    //console.log(friendList);
    return friendList;
  };

});


text:
using System;
using System.Collections.Generic;
using System.IO;
using BrightstarDB.Client;
using BrightstarDB.Server;
using BrightstarDB.Storage;
using BrightstarDB.Storage.BTreeStore;
using NUnit.Framework;
using ITransactionInfo = BrightstarDB.Storage.ITransactionInfo;

namespace BrightstarDB.InternalTests
{
    /*
     * KA 08/11/2011
     * This was a test to introspect backwards through a broken store.
     * I've left it in the source tree as an outline of how to do this with the current APIs
     * Note that it relies heavily on internals.
     */

    [TestFixture]
    [Ignore]
    public class BrokenStoreTests
    {
        private const string TestQuery =
    "SELECT ?x003Cgeneratedx003Ex005Fx0030 WHERE {?x003Cgeneratedx003Ex005Fx0030 a <http://brightstardb.com/namespaces/default/User> .}";

        [Test]
        public void FindWorkingTransaction()
        {
           Store store = new Store("c:\\brightstar\\twitteringtest\\", false);
            FileStoreManager fsm = new FileStoreManager(StoreConfiguration.DefaultStoreConfiguration);
            int txnCount = 0;
            foreach (var cp in store.GetCommitPoints())
            {
                var oldStore = fsm.OpenStore("c:\\brightstar\\twitteringtest\\", cp.LocationOffset);
                try
                {
                    oldStore.ExecuteSparqlQuery(TestQuery, SparqlResultsFormat.Xml);
                    Console.WriteLine("Query worked for commit point : {0} @ {1}", cp.LocationOffset, cp.CommitTime);
                    break;
                }
                catch (Exception)
                {
                    Console.WriteLine("Query failed for commit point : {0} @ {1}", cp.LocationOffset, cp.CommitTime);
                    txnCount++;
                }
            }
            var txnLog = fsm.GetTransactionLog("c:\\brightstar\\twitteringtest");
            var txnList = txnLog.GetTransactionList();
            for(int i = 0 ; i<= txnCount;i++)
            {
                txnList.MoveNext();
                var txnInfo = txnList.Current;
                Console.WriteLine("Transaction #{0}: Start: {1}, Status: {2}, JobId: {3}", i, txnInfo.TransactionStartTime, txnInfo.TransactionStatus, txnInfo.JobId);
            }

            // Going back to last known good
            store.RevertToCommitPoint(new CommitPoint(242472899 , 0, DateTime.UtcNow, Guid.Empty));

            var toReplay = new List<ITransactionInfo>();
            txnList = txnLog.GetTransactionList();
            for(int i = 0; i < 10 ; i++)
            {
                txnList.MoveNext();
                toReplay.Add(txnList.Current);
            }

            var storeWorker = new StoreWorker("c:\\brightstar","twitteringtest");
            for(int i = 9; i >= 0; i--)
            {
                Console.WriteLine("Applying transaction : {0}", toReplay[i].JobId);
                txnLog.GetTransactionData(toReplay[i].DataStartPosition);

                var jobId = Guid.NewGuid();
                var updateJob = new UpdateTransaction(jobId, null, storeWorker);
                updateJob.ReadTransactionDataFromStream(txnLog.GetTransactionData(toReplay[i].DataStartPosition));
                updateJob.Run();

                var readStore = storeWorker.ReadStore as Store;
                var resource = readStore.Resolve(1518601251);
                Assert.IsNotNull(resource);
                try
                {
                    var query = StoreExtensions.ParseSparql(TestQuery);
                    using (var resultStream = new MemoryStream())
                    {
                        storeWorker.Query(query, SparqlResultsFormat.Xml, resultStream,
                                          new[] {Constants.DefaultGraphUri});
                    }
                    Console.WriteLine("Query succeeded");
                }
                catch(Exception ex)
                {
                    Console.WriteLine("Query failed: " + ex.Message);
                    Assert.Fail();
                }
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
namespace PointsLibInterop { interface class ISolver; }

namespace PointsLibInterop
{

public ref class TspSolverFactory abstract sealed
{
public:
    static ISolver^ Create(int numThreads);
};

}


text:
<?php
namespace CodeOrange\Jot\Docs;

/**
 * Represents a return value, can be a JSON string
 */
class ReturnValue {
	public static $OTHER = 0;
	public static $JSON = 1;

	private $type;
	private $value;

	public function __construct($type, $value) {
		$this->type = $type;

		switch ($type) {
			case self::$JSON:
				$this->value = json_encode(json_decode($value), JSON_PRETTY_PRINT);
				break;
			case self::$OTHER:
			default:
				$this->value = $value;
		}
	}

	public function getType() {
		return $this->type;
	}
	public function getValue() {
		return $this->value;
	}
}


text:
<?php
/**
 * This file is part of a marmalade GmbH project
 *
 * It is Open Source and may be redistributed.
 * For contact information please visit http://www.marmalade.de
 *
 * Version:    1.0
 * Author URI: http://www.marmalade.de
 */

$sLangName = 'English';

$aLang = array(
    'charset'                         => 'utf-8',
    // Module List
    'MANUALLY_ACTIVATED'              => 'Activated manually',
    'YAMM_ACTIVATED'                  => 'Activated by YAMM',
    'YAMM_DISABLED'                   => 'Disabled by YAMM',
    'YAMM_EXTENDED_CLASSES'           => 'extended classes',
    'YAMM_FILES'                      => 'PHP files',
    'YAMM_TEMPLATES'                  => 'templates',
    'YAMM_BLOCKS'                     => 'blocks',
    // Export
    'YAMM_EXPORT'                     => 'Export',
    'YAMM_EXPORT_DESC'                => 'Export as YAMM configuration',
    'YAMM_EXPORT_ERRORS'              => 'Errors',
    'YAMM_EXPORT_SETTINGS'            => 'Export Settings',
    'YAMM_EXPORT_INHERIT_FROM_PARENT' => 'Inherit config from parent shop',
    'YAMM_EXPORT_OVERWRITE_PARENT'    => 'Use this shop as parent',
    'YAMM_EXPORT_DISABLED_MODULES'    => 'Disable activation of inactive modules',
    'YAMM_EXPORT_CLASS_ORDER'         => 'Export order in which extended classes are loaded',
    'YAMM_EXPORT_OUTPUT_CONFIG'       => 'Output config in this window',
    'YAMM_EXPORT_DOWNLOAD_CONFIG'     => 'Offer config as download (.zip)',
    'YAMM_EXPORT_SHOP_SELECTION'      => 'Create config for the following shops (leave empty for current shop)',
    'YAMM_EXPORT_OVERWRITE_CONFIG'    => 'Overwrite config in file system',
	// Netadata tab
	'yamm_module_metadata'    => 'Metadata',
);