text:
namespace {

// The CDM manifest includes several custom values, all beginning with "x-cdm-".
// They are:
//   x-cdm-module-versions
//   x-cdm-interface-versions
//   x-cdm-host-versions
//   x-cdm-codecs
//   x-cdm-persistent-license-support
//   x-cdm-supported-encryption-schemes
// What they represent is listed below. They should never have non-backwards
// compatible changes. All values are strings. All values that are lists are
// delimited by commas. No trailing commas. For example, "1,2,4".
const char kCdmValueDelimiter[] = ",";

// The following entries are required.
//  Interface versions are lists of integers (e.g. "1" or "1,2,4").
//  All match the interface versions from content_decryption_module.h that the
//  CDM supports.
//    Matches CDM_MODULE_VERSION.
const char kCdmModuleVersionsName[] = "x-cdm-module-versions";
//    Matches supported ContentDecryptionModule_* version(s).
const char kCdmInterfaceVersionsName[] = "x-cdm-interface-versions";
//    Matches supported Host_* version(s).
const char kCdmHostVersionsName[] = "x-cdm-host-versions";
//  The codecs list is a list of simple codec names (e.g. "vp8,vorbis").
const char kCdmCodecsListName[] = "x-cdm-codecs";
//  Whether persistent license is supported by the CDM: "true" or "false".
const char kCdmPersistentLicenseSupportName[] =
    "x-cdm-persistent-license-support";
//  The list of supported encryption schemes (e.g. ["cenc","cbcs"]).
const char kCdmSupportedEncryptionSchemesName[] =
    "x-cdm-supported-encryption-schemes";

// The following strings are used to specify supported codecs in the
// parameter |kCdmCodecsListName|.
const char kCdmSupportedCodecVp8[] = "vp8";
// Legacy VP9, which is equivalent to VP9 profile 0.
// TODO(xhwang): Newer CDMs should support "vp09" below. Remove this after older
// CDMs are obsolete.
const char kCdmSupportedCodecLegacyVp9[] = "vp9.0";
// Supports at least VP9 profile 0 and profile 2.
const char kCdmSupportedCodecVp9[] = "vp09";
const char kCdmSupportedCodecAv1[] = "av01";
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
const char kCdmSupportedCodecAvc1[] = "avc1";
#endif

// The following strings are used to specify supported encryption schemes in
// the parameter |kCdmSupportedEncryptionSchemesName|.
const char kCdmSupportedEncryptionSchemeCenc[] = "cenc";
const char kCdmSupportedEncryptionSchemeCbcs[] = "cbcs";

typedef bool (*VersionCheckFunc)(int version);

// Returns whether the CDM's API version, as specified in the manifest by
// |version_name|, is supported in this Chrome binary and not disabled at run
// time by calling |version_check_func|. If the manifest entry contains multiple
// values, each one is checked sequentially, and if any one is supported, this
// function returns true. If all values in the manifest entry are not supported,
// then return false.
bool CheckForCompatibleVersion(const base::Value& manifest,
                               const std::string version_name,
                               VersionCheckFunc version_check_func) {
  DCHECK(manifest.is_dict());

  auto* version_string = manifest.FindStringKey(version_name);
  if (!version_string) {
    DVLOG(1) << "CDM manifest missing " << version_name;
    return false;
  }

  DVLOG_IF(1, version_string->empty())
      << "CDM manifest has empty " << version_name;

  for (const base::StringPiece& ver_str :
       base::SplitStringPiece(*version_string, kCdmValueDelimiter,
                              base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
    int version = 0;
    if (base::StringToInt(ver_str, &version) && version_check_func(version))
      return true;
  }

  DVLOG(1) << "CDM manifest has no supported " << version_name << " in '"
           << *version_string << "'";
  return false;
}

// Returns true and updates |video_codecs| if the appropriate manifest entry is
// valid. When VP9 is supported, sets |supports_vp9_profile2| if profile 2 is
// supported. Older CDMs may only support profile 0. Returns false and does not
// modify |video_codecs| if the manifest entry is incorrectly formatted.
bool GetCodecs(const base::Value& manifest,
               std::vector<media::VideoCodec>* video_codecs,
               bool* supports_vp9_profile2) {
  DCHECK(manifest.is_dict());
  DCHECK(video_codecs);

  const base::Value* value = manifest.FindKey(kCdmCodecsListName);
  if (!value) {
    DLOG(WARNING) << "CDM manifest is missing codecs.";
    return true;
  }

  if (!value->is_string()) {
    DLOG(ERROR) << "CDM manifest entry " << kCdmCodecsListName
                << " is not a string.";
    return false;
  }

  const std::string& codecs = value->GetString();
  if (codecs.empty()) {
    DLOG(WARNING) << "CDM manifest has empty codecs list.";
    return true;
  }

  std::vector<media::VideoCodec> result;
  const std::vector<base::StringPiece> supported_codecs =
      base::SplitStringPiece(codecs, kCdmValueDelimiter, base::TRIM_WHITESPACE,
                             base::SPLIT_WANT_NONEMPTY);

  // Assuming VP9 profile 2 is not supported by default. Will only be set when
  // kCdmSupportedCodecVp9 is available below.
  *supports_vp9_profile2 = false;

  for (const auto& codec : supported_codecs) {
    if (codec == kCdmSupportedCodecVp8) {
      result.push_back(media::VideoCodec::kCodecVP8);
    } else if (codec == kCdmSupportedCodecLegacyVp9) {
      result.push_back(media::VideoCodec::kCodecVP9);
    } else if (codec == kCdmSupportedCodecVp9) {
      result.push_back(media::VideoCodec::kCodecVP9);
      *supports_vp9_profile2 = true;
    } else if (codec == kCdmSupportedCodecAv1) {
      result.push_back(media::VideoCodec::kCodecAV1);
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
    } else if (codec == kCdmSupportedCodecAvc1) {
      result.push_back(media::VideoCodec::kCodecH264);
#endif
    }
  }

  video_codecs->swap(result);
  return true;
}

// Returns true and updates |session_types| if the appropriate manifest entry is
// valid. Returns false if the manifest entry is incorrectly formatted.
bool GetSessionTypes(const base::Value& manifest,
                     base::flat_set<media::CdmSessionType>* session_types) {
  DCHECK(manifest.is_dict());
  DCHECK(session_types);

  bool is_persistent_license_supported = false;
  const base::Value* value = manifest.FindKey(kCdmPersistentLicenseSupportName);
  if (value) {
    if (!value->is_bool())
      return false;
    is_persistent_license_supported = value->GetBool();
  }

  // Temporary session is always supported.
  session_types->insert(media::CdmSessionType::kTemporary);

  if (is_persistent_license_supported)
    session_types->insert(media::CdmSessionType::kPersistentLicense);

  return true;
}

// Returns true and updates |encryption_schemes| if the appropriate manifest
// entry is valid. Returns false and does not modify |encryption_schemes| if the
// manifest entry is incorrectly formatted. It is assumed that all CDMs support
// 'cenc', so if the manifest entry is missing, the result will indicate support
// for 'cenc' only. Incorrect types in the manifest entry will log the error and
// fail. Unrecognized values will be reported but otherwise ignored.
bool GetEncryptionSchemes(
    const base::Value& manifest,
    base::flat_set<media::EncryptionScheme>* encryption_schemes) {
  DCHECK(manifest.is_dict());
  DCHECK(encryption_schemes);

  const base::Value* value =
      manifest.FindKey(kCdmSupportedEncryptionSchemesName);
  if (!value) {
    // No manifest entry found, so assume only 'cenc' supported for backwards
    // compatibility.
    encryption_schemes->insert(media::EncryptionScheme::kCenc);
    return true;
  }

  if (!value->is_list()) {
    DLOG(ERROR) << "CDM manifest entry " << kCdmSupportedEncryptionSchemesName
                << " is not a list.";
    return false;
  }

  base::flat_set<media::EncryptionScheme> result;
  for (const auto& item : value->GetList()) {
    if (!item.is_string()) {
      DLOG(ERROR) << "Unrecognized item type in CDM manifest entry "
                  << kCdmSupportedEncryptionSchemesName;
      return false;
    }

    const std::string& scheme = item.GetString();
    if (scheme == kCdmSupportedEncryptionSchemeCenc) {
      result.insert(media::EncryptionScheme::kCenc);
    } else if (scheme == kCdmSupportedEncryptionSchemeCbcs) {
      result.insert(media::EncryptionScheme::kCbcs);
    } else {
      DLOG(WARNING) << "Unrecognized encryption scheme '" << scheme
                    << "' in CDM manifest entry "
                    << kCdmSupportedEncryptionSchemesName;
    }
  }

  // As the manifest entry exists, it must specify at least one valid value.
  if (result.empty())
    return false;

  encryption_schemes->swap(result);
  return true;
}

bool GetVersion(const base::Value& manifest, base::Version* version) {
  DCHECK(manifest.is_dict());
  auto* version_string =
      manifest.FindStringKey(extensions::manifest_keys::kVersion);
  if (!version_string) {
    DLOG(ERROR) << "CDM manifest missing "
                << extensions::manifest_keys::kVersion;
    return false;
  }

  *version = base::Version(*version_string);
  if (!version->IsValid()) {
    DLOG(ERROR) << "CDM manifest version " << version_string << " is invalid.";
    return false;
  }

  return true;
}

}  // namespace

bool IsCdmManifestCompatibleWithChrome(const base::Value& manifest) {
  DCHECK(manifest.is_dict());

  return CheckForCompatibleVersion(manifest, kCdmModuleVersionsName,
                                   media::IsSupportedCdmModuleVersion) &&
         CheckForCompatibleVersion(
             manifest, kCdmInterfaceVersionsName,
             media::IsSupportedAndEnabledCdmInterfaceVersion) &&
         CheckForCompatibleVersion(manifest, kCdmHostVersionsName,
                                   media::IsSupportedCdmHostVersion);
}

bool ParseCdmManifest(const base::Value& manifest,
                      content::CdmCapability* capability) {
  DCHECK(manifest.is_dict());

  return GetCodecs(manifest, &capability->video_codecs,
                   &capability->supports_vp9_profile2) &&
         GetEncryptionSchemes(manifest, &capability->encryption_schemes) &&
         GetSessionTypes(manifest, &capability->session_types);
}

bool ParseCdmManifestFromPath(const base::FilePath& manifest_path,
                              base::Version* version,
                              content::CdmCapability* capability) {
  JSONFileValueDeserializer deserializer(manifest_path);
  int error_code;
  std::string error_message;
  std::unique_ptr<base::Value> manifest =
      deserializer.Deserialize(&error_code, &error_message);
  if (!manifest || !manifest->is_dict()) {
    DLOG(ERROR) << "Could not deserialize CDM manifest from " << manifest_path
                << ". Error: " << error_code << " / " << error_message;
    return false;
  }

  return IsCdmManifestCompatibleWithChrome(*manifest) &&
         GetVersion(*manifest, version) &&
         ParseCdmManifest(*manifest, capability);
}

redpajama_set_name: RedPajamaGithub


Interstate's philosophy is to put people first – not only our clients, but also the people who work here.
The people at Interstate are diverse in both work and life, but we have a common thread: a drive to succeed in whatever we do. You'll find team members flying planes, traveling, and fixing up old houses. You'll also meet people who once played for the NBA or worked for a famous rock band. We know our people make a difference and that's why we offer a diverse benefits package to take care of our people, who work and play hard.


As a former athlete, Alex Rodriguez knows that practice is key in getting things just right. So, of course, he had that mentality when it came to proposing to Jennifer Lopez.
The pair revealed they were engaged on March 9 when they both took to Instagram to share a photo of the moment. "She said yes," A-Rod captioned the moment. The Second Act star included numerous heart emojis for her caption. While it's been more than a month since the proposal, the actress recently said she and her man haven't started planning anything yet.
But will Alex need his assistant's help? That's the important question!


Muscular studs, cute miles, oily bodies si what is it all about in the "Spartacus" TV series. Dustin Clare is enjoying his privileges as a gladiator and how wouldn't he? Take a look at his gorgeous body and shredded muscles and his long hair. He is every guys dream to be pounded by a stud like him. From behind, in missionary, on top, this guy will do anything with you.


A few months ago my old Creative Director announced that she was leaving the agency we both worked for at the time, selling everything and going off to explore the wide world with her super talented boyfriend Stevo. I've blogged about Stevo before, he's the most amazing illustrator, you can check out his work here. When Chanel and Stevo left they started a blog and an Instagram account called How Far From Home, when I saw their accounts I was in serious awe of just how amazing the concept was/is!
As I mentioned the pair both led pretty stressful lives working for Johannesburg based agencies, when they could they would take breaks and explore South Africa, always taking the most beautiful photos of course. While we are at the 2014 Design Indaba, a first time for all of us we were lucky enough to hear a talk by Stefan's Sagmeister, who believes in "creative sabbaticals," you can watch him chat about his theory of time off below. Just as an aside is anyone else really attracted to Sagmeister?
So they took the a risk, sold everything, including a beautiful yellow chest that I bought and set out to explore the world. It still amazes me that they had the guts to do such an amazing thing, I think we could all take a few pages out of their very brave book.
The concept behind How Far from Home started with the need to tie everything together in one neat bow to make the whole trip feel like one story. How Far From Home literally tracks how far they have travelled, pushing them to go further to see more. It was also symbolic of why they decided to take the trip in the first place – to get out of the comfortable life they had set-up, and challenge themselves to push our creativity further.
Their next step was to find a visual device that would be the constant. They thought of the distance marking poles they place in popular sites, and decided on a chalkboard as it was simple to execute.
The last step was designing their logo – which as you can see they had quite a lot of fun with. The paper airplanes symbolise liberty, creativity, travel and craft – all themes that resonated with their creative journey. Match made in How Far From Home heaven!
Chanel and Stevo have, in my opinion mastered the art of travelling light, which can be pretty hard for any type of photographer. Here are their top tips for travelling photographers.
We're trying to keep it light, traveling with only 5 lenses between us — 2 x 10-20mm, 1 x 40mm, 1 x 50mm and 1 x 70-200mm. We feel that keeps us covered for urban street photography, portraiture, dog photography, as well as landscape photography.
We have two tripods — a big one we keep for night shoots, and a small one that fits in the side pocket of our backpack (for impulse couple photos that don't look like long-armed selfies).
We carry our lens cleaning kit with us everywhere — you simply never know when a Husky puppy might lick your camera, forcing you to clean the lens before the landscape shot you originally intended on shooting appears in front of you.
All our lenses are covered in UV filters — we're not too concerned with the UV Rays, but rather treat the filters as lens insurance. It's easy to replace the R300 filter; not so simple replacing the R7000 lens.
It's very important to have a balance of photographing a place, and actually sitting down to enjoy it. We had one or two cases where we took tons of snaps, got back to our Airbnb and couldn't even recall being there. We've learned now to enjoy first, photograph later. Your photographs will tell better stories when you get a sense for the place first.
Thanks for being such an inspiration guys, just as an added extra here are some illustrations by Chanel from their trip and some travel pics. All images used in this post were hand picked by Chanel and Stevo, please take care to credit them when sharing!


text:
module CapDL.STCC(
                  somefn
                 ,transitiveClosure
                 ,leakMatrix
                 ) where

import CapDL.Matrix
import CapDL.Model

import Control.Monad

import System.IO

import Data.Map ( Map )
import qualified Data.Map as Map

import Data.Set ( Set )
import qualified Data.Set as Set

import Data.List ( foldl' )

import Data.Word ( Word )

type ObjDictionary = Map ObjID Int

projectTCB capset =
  Set.fromList [capObj | (TCBCap capObj) <- Set.toList capset]
projectCNode capset =
  Set.fromList [capObj | (CNodeCap capObj _ _) <- Set.toList capset]
projectEndpoint capset =
  Set.fromList $ concat [[(r, capObj) | r <- Set.toList rights] | (EndpointCap capObj _ rights) <- Set.toList capset]
projectAsync capset =
  Set.fromList $ concat [[(r, capObj) | r <- Set.toList rights] | (AsyncEndpointCap capObj _ rights) <- Set.toList capset]
projectPD capset =
 Set.fromList [capObj | (PDCap capObj Nothing) <- Set.toList capset]
projectPT capset =
  Set.fromList [capObj | (PTCap capObj Nothing) <- Set.toList capset]
projectFrame capset =
  Set.fromList $ concat [[(r, capObj) | r <- Set.toList rights] | (FrameCap capObj rights Nothing True) <- Set.toList capset]

somefn :: Model Word -> IO ()
somefn m@(Model arch objects _ cdt _) =
  do matrix <- newEmptyMatrix $ length tcbIDs
     leaksTos matrix objDict tcbDirectCaps
     warshall matrix
     newcspaces <- saturateCSpaces matrix objDict cspaces
     --printDotMatrix matrix objDict'
     --printCSpaces cspaces
     --printCSpaces newcspaces
     return ()
  where
    tcbIDs = [objID | (objID, (TCB {})) <- Map.toList objects]
    cspaces = zip tcbIDs $ map (getCSpace objects) tcbIDs
    vspaces = zip tcbIDs $ map (getVSpace objects) tcbIDs
    tcbDirectCaps = directTCBConnections cspaces
    objDict = Map.fromList (zip tcbIDs [0..])
    objDict' = Map.fromList (zip [0..] tcbIDs)
    f (objID, cspace) (objID', cspace') = (objID, cspace' `Set.difference` cspace)

transitiveClosure :: Model Word -> IO (Model Word)
transitiveClosure model@(Model arch objects _ cdt _) =
  do matrix <- newEmptyMatrix $ length tcbIDs
     leaksTos matrix objDict tcbDirectCaps
     warshall matrix
     newcspaces <- saturateCSpaces matrix objDict cspaces
     let cspaceUpdates = zipWith f newcspaces cspaces
         newModel = updateModel model cspaceUpdates
     return newModel
  where
    tcbIDs = [objID | (objID, (TCB {})) <- Map.toList objects]
    cspaces = zip tcbIDs $ map (getCSpace objects) tcbIDs
    vspaces = zip tcbIDs $ map (getVSpace objects) tcbIDs
    tcbDirectCaps = directTCBConnections cspaces
    objDict = Map.fromList (zip tcbIDs [0..])
    objDict' = Map.fromList (zip [0..] tcbIDs)
    f (objID, cspace) (objID', cspace') = (objID, cspace' `Set.difference` cspace)

leakMatrix :: Model Word -> IO (String, String, Model Word)
leakMatrix model@(Model arch objects _ cdt _) =
  do authMatrix <- newEmptyMatrix $ mSize
     leaksTos authMatrix objDict tcbDirectCaps
     warshall authMatrix

     newcspaces <- saturateCSpaces authMatrix objDict cspaces
     let cspaceUpdates = zipWith f newcspaces cspaces
         newModel = updateModel model cspaceUpdates

     infoMatrix <- newEmptyMatrix $ mSize
     authSharingFlows authMatrix infoMatrix
     flowsTos infoMatrix objDict tcbDirectFlows
     warshall infoMatrix

     removeReflexive infoMatrix
     leakDot <- showDotMatrix authMatrix objDict'
     flowDot <- showDotMatrix infoMatrix objDict'
     return (leakDot, flowDot, newModel)
  where
    f (objID, cspace) (objID', cspace') = (objID, cspace' `Set.difference` cspace)
    sndUnion (tcbID, set) (tcbID', set') = (tcbID, Set.union set set')
    tcbIDs = [objID | (objID, (TCB {})) <- Map.toList objects]
    mSize = length tcbIDs
    cspaces = [(tcbID, Set.fromList $ getCaps objects tcbID) | tcbID <- tcbIDs]
    vspaces = [(tcbID, Set.fromList $ getFrames objects tcbID) | tcbID <- tcbIDs]
    tcbDirectCaps = directTCBConnections cspaces
    tcbDirectFlows = directTCBFlows (zipWith sndUnion vspaces cspaces)
    objDict = Map.fromList (zip tcbIDs [0..])
    objDict' = Map.fromList (zip [0..] tcbIDs)

updateModel :: Model Word -> [(ObjID, Set Cap)] -> Model Word
updateModel (Model arch objects irqNode cdt untypedCovers) tcbs =
    Model arch (foldr f objects tcbs) irqNode cdt untypedCovers
  where
    f (tcb, cspace) objects =
      let rootCNodeID = rootCNodeOf objects tcb
          e = error "cannot find root CNode in updateModel"
          (CNode slots x) = Map.findWithDefault e rootCNodeID objects
          maxKey = maximum $ Map.keys $ slots
          newKeys = map (maxKey +) [1..]
          newSlots = foldr (\(k,a) -> Map.insert k a) slots (zip newKeys $ Set.toList cspace)
      in Map.insert rootCNodeID (CNode newSlots x) objects
    rootCNodeOf objects tcb =
      let e = error "cannot find tcbID in updateModel" in
      case (Map.findWithDefault e tcb objects) of
        (TCB slots _ _ _) -> head [capObj | (CNodeCap capObj _ _) <- (map snd (Map.toList slots))]
        _ -> error "non-tcb ID in updateModel"

saturateCSpaces :: Matrix -> ObjDictionary -> [(ObjID, Set Cap)] -> IO [(ObjID, Set Cap)]
saturateCSpaces _ _ [] = return []
saturateCSpaces matrix objDict (tcb : tcbs) =
  do head <- foldM f tcb tcbs
     newtail <- mapM ((flip f) tcb) tcbs
     rest <- saturateCSpaces matrix objDict newtail
     return $ head : rest
  where
    f (tcbID, cspace) (tcbID', cspace') =
      do
        b <- isLeak matrix objDict tcbID' tcbID
        if b
          then
            let acc = cspace `Set.union` cspace' in acc `seq` return (tcbID, acc)
          else
            return (tcbID, cspace)

directTCBConnections :: [(ObjID, Set Cap)] -> [(ObjID, ObjID)]
directTCBConnections [] = []
directTCBConnections ((tcbID, cspace) : tcbs) =
  foldr f [] tcbs ++ directTCBConnections tcbs
    where
      f (tcbID', cspace') acc =
        acc
        ++ let cnodeSet = projectCNode cspace
               cnodeSet' = projectCNode cspace'
               tcbSet = projectTCB cspace
               tcbSet' = projectTCB cspace'
               endpointSet = projectEndpoint cspace
               endpointSet' = projectEndpoint cspace'
               shareCSpace = sharesCSpace (projectCNode cspace) (projectCNode cspace')
               haveTCB = tcbID' `Set.member` projectTCB cspace
               hadByTCB = tcbID `Set.member` projectTCB cspace'
               outEndpointCon = grantReadOverlap endpointSet endpointSet'
               inEndpointCon = grantReadOverlap endpointSet' endpointSet
               outCon = shareCSpace || haveTCB || outEndpointCon
               inCon = shareCSpace || hadByTCB || inEndpointCon
           in case (inCon,outCon) of
             (False, False) -> []
             (False, True)  -> [(tcbID, tcbID')]
             (True, False)  -> [(tcbID', tcbID)]
             (True, True)   -> [(tcbID, tcbID'), (tcbID', tcbID)]

directTCBFlows :: [(ObjID, Set Cap)] -> [(ObjID, ObjID)]
directTCBFlows [] = []
directTCBFlows ((tcbID,  capSet) : tcbs) =
  foldr f [] tcbs  ++ directTCBFlows tcbs
    where
      f (tcbID', capSet') acc =
        acc
        ++ let endpointSet = projectEndpoint capSet
               endpointSet' = projectEndpoint capSet'
               frameSet = projectFrame capSet
               frameSet' = projectFrame capSet'
               asyncSet = projectAsync capSet
               asyncSet' = projectAsync capSet'

               endpointFlow = writeReadOverlap endpointSet endpointSet'
                              || writeReadOverlap endpointSet' endpointSet
               frameFlowOut = writeReadOverlap frameSet frameSet'
               frameFlowIn = writeReadOverlap frameSet' frameSet
               asyncFlowOut = writeReadOverlap asyncSet asyncSet'
               asyncFlowIn = writeReadOverlap asyncSet' asyncSet

               outCon = endpointFlow || frameFlowOut || asyncFlowOut
               inCon = endpointFlow || frameFlowIn || asyncFlowIn
           in case (inCon,outCon) of
             (False, False) -> []
             (False, True)  -> [(tcbID, tcbID')]
             (True, False)  -> [(tcbID', tcbID)]
             (True, True)   -> [(tcbID, tcbID'), (tcbID', tcbID)]

{- True if the first set of rights contains a grant to an object
and the second set of rights contains a read to that object -}
grantReadOverlap :: Set (Rights, ObjID) -> Set (Rights, ObjID) -> Bool
grantReadOverlap cSet cSet' =
  let grants = Set.fromList [objID | (Grant, objID) <- Set.toList cSet]
      reads = Set.fromList [objID | (Read, objID) <- Set.toList cSet']
  in not $ Set.null $ grants `Set.intersection` reads

{- True if the first set of rights contains a write to an object
and the second set of rights contains a read to that object -}
writeReadOverlap :: Set (Rights, ObjID) -> Set (Rights, ObjID) -> Bool
writeReadOverlap cSet cSet' =
  let writes = Set.fromList [objID | (Write, objID) <- Set.toList cSet]
      reads = Set.fromList [objID | (Read, objID) <- Set.toList cSet']
  in not $ Set.null $ writes `Set.intersection` reads

{- True if two sets of CNode objIDs intersect -}
sharesCSpace :: Set ObjID -> Set ObjID -> Bool
sharesCSpace cspace1 cspace2 = not $ Set.null $ cspace1 `Set.intersection` cspace2

warshall :: Matrix -> IO ()
warshall matrix =
  do ((min, _), (max, _)) <- getSize matrix
     forM_ [min..max] $ \k ->
       forM_ [min..max] $ \i ->
         forM_ [min..max] $ \j ->
         do mij <- isConnected matrix i j
            mik <- isConnected matrix i k
            mkj <- isConnected matrix k j
            when (mij || (mik && mkj)) $ connect matrix i j

authSharingFlows :: Matrix -> Matrix -> IO ()
authSharingFlows fromMatrix toMatrix =
  do ((min, _), (max, _)) <- getSize fromMatrix
     forM_ [min..max] $ \i ->
       forM_ [min..max] $ \j ->
       do x <- isConnected fromMatrix i j
          when x $ connect toMatrix i j >> connect toMatrix j i

removeReflexive :: Matrix -> IO ()
removeReflexive matrix =
  do ((min, _), (max, _)) <- getSize matrix
     forM_ [min..max] $ \i ->
       disconnect matrix i i

flowsTos = leaksTos

leaksTos matrix objDict leaks =
  forM_ leaks $ \(objID, objID') ->
    leaksTo matrix objDict objID objID'

{- Write to matrix that objID leaks to objID' -}
leaksTo matrix objDict objID objID' = connect matrix (indexOf objID) (indexOf objID')
  where
       indexOf x =
         Map.findWithDefault
           (error $ "died in leaksTo trying to find key " ++ show x)
           x objDict

isLeak matrix objDict objID objID' = isConnected matrix (indexOf objID) (indexOf objID')
  where
    indexOf x = Map.findWithDefault
           (error $ "died in isLeak trying to find key " ++ show x)
           x objDict

getCSpace :: ObjMap Word -> ObjID -> Set Cap
getCSpace objects tcbID = Set.fromList $ getCaps objects tcbID

{- Returns all the caps in a TCB's CSpace -}
getCaps :: ObjMap Word -> ObjID -> [Cap]
getCaps objects tcbID =
  case Map.findWithDefault e1 tcbID objects of
    TCB slots _ _ _ ->
      let cNodeCaps = [cap | (_, cap@(CNodeCap {})) <- Map.toList slots]
      in concat $ map (getCaps' objects Set.empty) cNodeCaps
    _ -> e2
  where
    e1 = error "cannot find tcbID in cnodesFrom"
    e2 = error "objID given in cnodesFrom is not TCB"

getCaps' :: ObjMap Word -> Set ObjID -> Cap -> [Cap]
getCaps' objects visited cap =
  case cap of
    CNodeCap {}
      | capObj cap `Set.member` visited -> []
      | otherwise -> cap : getCaps'' objects visited (capObj cap)
    _ -> [cap]

getCaps'' :: ObjMap Word -> Set ObjID -> ObjID -> [Cap]
getCaps'' objects visited cnodeID
  | cnodeID `Set.member` visited = []
  | otherwise =
         case Map.findWithDefault e cnodeID objects of
           CNode slots _ ->
             let caps = map snd $ Map.toList slots
                 newVisited = cnodeID `Set.insert` visited
             in concat $ map (getCaps' objects newVisited) caps
           kObj@(_) -> error ("non-CNode objID passed into getCaps'': " ++ show kObj)
    where
      e = error "could not find rootID in objects map in cSpaceFrom'"

getVSpace :: ObjMap Word -> ObjID -> Set Cap
getVSpace objects tcbID = Set.fromList $ getFrames objects tcbID

getFrames :: ObjMap Word -> ObjID -> [Cap]
getFrames objects tcbID =
  case Map.findWithDefault e1 tcbID objects of
    TCB slots _ _ _ ->
      let pdCaps = [cap | (_, cap@(PDCap _ _)) <- Map.toList slots]
      in concat $ map (getFrames' objects Set.empty) pdCaps
    _ -> e2
  where
    e1 = error "cannot find tcbID in getFrames"
    e2 = error "object ID given in getFrames is not TCB"

getFrames' :: ObjMap Word -> Set ObjID -> Cap -> [Cap]
getFrames' objects visited cap =
  case cap of
    PDCap capObj _
      | capObj `Set.member` visited -> []
      | otherwise -> cap : getFrames'' objects visited capObj
    PTCap capObj _
      | capObj `Set.member` visited -> []
      | otherwise -> cap : getFrames'' objects visited capObj
    FrameCap capObj _ _ _ ->
      [cap]
    _ -> []

getFrames'' :: ObjMap Word -> Set ObjID -> ObjID -> [Cap]
getFrames'' objects visited objID
  | objID `Set.member` visited = []
  | otherwise =
    case Map.findWithDefault e objID objects of
      PD slots ->
        let caps = map snd $ Map.toList slots
            newVisited = objID `Set.insert` visited
        in concat $ map (getFrames' objects newVisited) caps
      PT slots ->
        let caps = map snd $ Map.toList slots
            newVisited = objID `Set.insert` visited
        in concat $ map (getFrames' objects newVisited) caps
      _ -> []
  where
    e = error "could not find objID in objects map in getFrames''"


Still Strugglin': Going through the storm.
Weblog of a Brazilian medical doctor and professional translator who has been suffering for months from Atopic dermatitis.
Best sites for Bird Flu information including CDC, WHO, NIH, NPR, governmental and major news organizations.
Links to sites with the most reliable information about Mad Cow Disease: CDC, FDA, major universities, etc.


text:
Russia's Transport Minister For Rehabilitating Labour Protection System, Ravaged By Years Of Economic Decline
The system of labour protection, ravaged over years of economic decline, must be restored, said Russian Transport Minister Sergei Frank on Monday at a collegium of his ministry. The RIA Novosti correspondent quotes him as saying that in labour protection on transport a system approach is required, as well as a structured system ensuring the meeting of financial, economic and other goals. Its formation must be completed in the first half of 2002. Igor Voloshko, deputy chief of the department for social development and cadre at the Transport Ministry, reported that in 2000 the ministry operated a range of earlier prepared programmes for improving labour protection. Now work is under way to prepare such programmes for the 2002-2005 period. The traumatic-injury rate on transport is still high, he said. In automobile transport in 2000 as many as 5,869 people got injuries, or 53.5 percent of the cases of industrial accidents on transport. In road building and maintenance 1,114 accidents happened. Here, the level of industrial injuries increased by 20 percent.

redpajama_set_name: RedPajamaCommonCrawl


text:
Top 16 Google Play Alternatives for Android Apps
January 13, 2022 by Adam Smith
When it comes to downloading applications, we all know that the Google Play Store and App Store are the most well-known app stores in the world, with the majority of programs available. This isn't the only choice, however.
There are several other options, such as Google Play and Software Store, that you may try to discover the ideal app or game for your needs. The problem is that the Google Play Store and App Store each have millions of applications, making locating the correct one difficult; furthermore, many app shops offer curated lists of apps based on various filters and sorting.
Top 16 Alternatives to Google Play & App Store for Android & iOS
1 Top 16 Alternatives to Google Play & App Store for Android & iOS
2 1:APKPure
3 2:Amazon App Store
4 3:Aptoide
5 4:F-Droid
6 5:Aurora's Store
7 6:Galaxy Store by Samsung
8 7:GetApps
9 8:APKMirror
10 9:Huawei App Gallery
11 10:App Store (Apple)
12 11:GetJar
13 12:SlideME
14 13:Uptodown
15 14:Mobile9
16 15:Mobango
17 16:Bemobi Mobile Store
18 Confused about which app store you should choose to release your app/game?
19 As a user, why should you select a Google Play Store & App Store Alternative?
20 As a developer, why should you choose an alternative to the Google Play Store and Apple App Store?
1:APKPure
APKPure is a free, open-source service that lets users download APK files (Android applications that can be installed once the file is downloaded). Users may also download applications that are region-specific and not accessible on the Apple App Store or Google Play Store using the APKPure app.
On the APKPure app store, you may find popular applications like TikTok, PUBG Mobile, and others. The version history of the software is also accessible.
2:Amazon App Store
All Amazon Fire devices, including the Kindle, Fire Phone, and Fire Tablet, use the Amazon app store as their main app store. The Amazon App Store, on the other hand, is not restricted to Amazon devices and can be used on any Android smartphone.
The most compelling incentive to download the Amazon App Store is that it provides a premium app for free every day. Yes, the Amazon Program Store allows you to download a purchased app for free.
The app also provides a tailored experience depending on what you've seen, searched for, and downloaded.
3:Aptoide
Aptoide is well-known for having applications not available on the Google Play Store. Users may control their stores since the app is not centralized like Google App Store.
Apps that aren't accessible on the Google Play Store may be downloaded for free via the Aptoide app store. Aptoide also allows you to download NSFW games and applications. Even some app updates have previously been available on Aptoide.
Developers may employ sponsored acquisition campaigns to have their software or game shown as advertisements to consumers, and they just have to pay for the number of downloads.
4:F-Droid
F-Droid is an open-source app store, and all of the applications and games offered there are as well. The app shop is entirely funded by contributions and is managed entirely by volunteers. It exclusively accepts free applications and has a policy of not promoting apps with paid add-ons or advertisements.
The program includes some basic applications, such as Simple Gallery, as well as several games. If you want to locate and download anything that isn't available on Google Play Store, you may use the app. The app store is reliable and secure.
See also Top 7 JavaScript Frameworks to Try for Building Performant Apps
The shop has a large client base and is free; therefore, the greatest benefit is that trying the F-Droid App Store will not cost you.
5:Aurora's Store
AuroraOSS is an open-source program that contains thousands of popular mobile applications and games that are available for free download. The app store's distinct visual design is a significant feature that contributes to a clean experience thanks to its modern UI.
Anonymous login, Google Login, Light/Dark mode, Device Spoofing, Filter F-droid applications, Blacklist apps, and other features are among the highlights of the Aurora store. All of these elements add to a fantastic user experience.
6:Galaxy Store by Samsung
Samsung Galaxy Store is a mobile app store that comes pre-installed on Samsung Galaxy and Gear smartphones. A Galaxy and Gear device user's go-to destination for unique benefits and discounts is an app store.
The app store offers a plethora of themes and fonts that may be used to personalize one's smartphone. Users do not need to register or log in to explore and download applications. The software supports nearly all local languages, making it very simple to use and navigate.
It provides players with special gaming deals, and gamers may find premium offers and one-of-a-kind perks.
7:GetApps
GetApps is a specialized app store by Xiaomi for all Xiaomi smartphones such as Redmi, Poco, Mi, and others, similar to how Samsung Galaxy Shop is a dedicated app store for Galaxy and Gear devices. On GetApps, users can simply explore, manage, and install millions of applications.
There are also several unique applications accessible, such as Mi Credit and Mi Pay. All of the popular applications, such as TikTok, Facebook, and Whatsapp, are available in the app store. The GetApps app store does not need registration.
GetApps offers a wide range of free applications, and the site claims to never charge customers. All of the applications go through a thorough quality assurance process, ensuring that all of the apps on the store are safe to download. There is a lot of content accessible, which makes it easier for consumers to choose the appropriate applications.
8:APKMirror
APKMirror is an app repository rather than an app store. A repository is a file storage place where different versions of the program are stored.
As a result, it's advantageous if you want to utilize an older version of an app or game. Another advantage of utilizing APKMirror is that it does not need the use of a geolocation app. As a result, you get access to all of the applications that aren't accessible on the Google App Store owing to geo-location restrictions.
You do not need to create an account to explore and download applications; you may do so without registering. You may also receive early access to alpha and beta versions of the applications.
9:Huawei App Gallery
The Huawei App Gallery used to be a specialized app store for Huawei and Honor smartphones, however, after the US sanctions and consequent Google ban, the Huawei App Gallery is now available for download and use on all Android devices.
App Gallery offers over 1.3 million applications from a variety of prominent developers and publishers. More than 400 million people have downloaded apps from the app store. The app shops, in addition to parental control, provide excellent security.
Various charts and curated lists assist the user in choosing the ideal software or game for their needs. Gift centers, exciting promotions, local events with prizes, and other local exclusives are available to App Gallery members.
See also Increment your free followers and likes on Instagram with the GetInsta Quick Response application
10:App Store (Apple)
The Apple Software Store is a specialized app store for iOS devices such as iPhones, iPads, Macbooks, and the iWatch. Apple Inc. created and maintains the Apple App Store. Users may browse and download applications created using Apple's iOS software development kit using this app.
This app shop rivals the Google Play Store in size. Because Apple devices run on iOS, this is the only app store where consumers can explore and download applications for their devices.
The Apple Software Store is one of the safest, if not the safest, app stores available. The iOS app clearance procedure is the most difficult.
11:GetJar
GetJar is a free application catalog that can be used to find and download free apps for mobile phones and tablets. For Android, apk files are available, while for Symbian, Jar (Java) files are available (mostly found in Nokia Devices).
The applications are organized into several categories, making it simple to find what you're looking for. Additionally, the categories are split into subcategories, making it easier to locate the required software.
The primary benefit of utilizing GetJar is that it provides users with virtual currency when they download applications. GetJar Gold Coins may be redeemed for free premium applications in the Google Play Store or Amazon.
12:SlideME
SlideME is an app shop that predates the Google Play Store for many years. It is the most often discovered app store as a Google Play Store alternative. After being evaluated, all of the applications featured on the app are curated.
Paid applications may be purchased using PayPal or Amazon Pay. SlideME provides free features like SlideLock for program security and in-app payment to app developers. The applications featured on SlideME are safe to use since they utilize normal application protection.
13:Uptodown
The Uptodown app is a specifically built app store for Android applications. You may download applications directly in APK format, securely and fast, using the Uptodown app.
You may even revert to an earlier version of the program. Because the app provides automatic updates, all of your applications will always be up to date. On Uptodown, there are no geographical limitations. There is no need to register or sign up; you can just explore and download all of the applications without any hassle.
Thousands of Android applications are available on Uptodown. All of the applications include extensive editorial material as well as in-house screenshots that assist you to understand the app's capabilities.
14:Mobile9
Mobile9 is an all-in-one application that includes everything an Android phone or tablet needs. It provides Android apps that are available on Google Play Store as well as apps that are not available on Google Play Store. There are also wallpapers, ringtones, videos, music, and many other things to choose from. As a bonus, everything on Mobile9 is free.
It also includes a section where you may freely download YouTube videos. It also sells literature, such as ebooks, comics, and audiobooks. It also has dynamic wallpapers and mobile themes.
15:Mobango
Mobango is a popular Android app store with millions of users and over 1000 daily downloads. The Google Play Store comes in second place. The fact that there are fewer applications on this store is a positive for developers since it makes it easier to get your app rated. Furthermore, uploading the software is free, and you are not required to split any revenue.
See also How To Change Font In Android Without Root | Complete Guide
Thanks to the numerous categories and sub-categories, users can quickly browse through and select the appropriate software. It is also possible to share an app through message or e-mail, making it simple to transfer a program from one device to another.
16:Bemobi Mobile Store
Bemobi Mobile Store is a popular app store and digital distribution platform for both developers and consumers. You may pick from tens of thousands of applications and games. The categories and subcategories are so useful that it's easy to discover the ideal software for oneself. Because the app store is overflowing with games, it's the best location for gamers to discover titles that aren't accessible on Google Play.
Confused about which app store you should choose to release your app/game?
You may contact Capermint Technologies, one of the top app development firms in the United States and Canada, for advice and to get your app/game published on whatever app store you choose. Our app and game developers have published applications and games on a variety of app stores, so they can advise you on the best app store for your app/game based on their expertise.
As a user, why should you select a Google Play Store & App Store Alternative?
As soon as the government instructs them to, the Google Play Store and App Store will delete an app (perhaps your favorite).
More categories and curated lists are available.
Get access to beta versions of applications that aren't available on the Apple App Store or Google Play Store.
If you upgraded your app from the Play Store or Program Store, you may download the old version of the app from other app stores if you don't like the new update or if it includes problems.
Here you can get a lot of premium applications for free.
As a developer, why should you choose an alternative to the Google Play Store and Apple App Store?
Because many people use other app stores, releasing your program on only the App Store will restrict the number of downloads. You should attempt to distribute your app on as many app shops as possible.
You may advertise your app in a variety of app shops.Other app stores may include your software in a variety of categories or curated listings.
There are fewer possibilities of your app being featured in the top 10 charts of the Google Play Store & Play Store since competition is lower on other app shops. However, your app may still be listed in the top charts of other app stores
Choosing the best Google Play Store and Apple App Store alternatives may be difficult. Each app store has advantages and disadvantages. There is no full substitute for the Play Store and App Store. They may still locate a third-party app store to assist them to get applications that aren't accessible on Google Play Store or Apple App Store at all or are banned owing to government policies or geographic limitations.
However, all of the aforementioned app shops are free to download, so you may give them a go without fear.
This was all there was to it! Thank you so much for reading!
Categories Android, Apk Post navigation
Why hiring a professional Truck Accident Lawyer is important?
11 Instagram Accounts to Follow for Self-Care


I have already installed the shock from an F4 (remote reservoir style, May have been F3). The issue I have is I am a big boy, real big. 6'1" 300+lbs big. I love the control the new rear shock gave, but the spring is not up to the task. I thought I had seen somewhere that a 954 rear shock would bolt right up with a substantial increase in spring rate. I am NOT looking at a Fox or Penske, I already have a newer VFR and a new CBR1000rr is in the works. I just want to spring the rear like the front, already has 94 forks with gold valves and stiffest springs RT makes for them.
If your advise is Fox or Penske, go post somewhere else. I am looking for a cheap upgrade for a cheap bike. This is no longer my primary summer transport as it once was, but I enjoy it too much to simply give up and move on.
Thanks to those who share what they know will work.
1. You did mention you had Race Tech Springs with gold valve front forks. But have you called them for a beefier rear spring for your needs???
2. I have a CL450 Street-Tracker and a mono-shock DT250 that Race Tech made beefier custom springs for me. Not because I am heavy, just didn't want the tire to touch the fender when I hit the bumps thrashing off road. They can do it if you explain what you want and why.
3. Please I ask you not to come to this public forum with an attitude that you don't want people commenting on a thread that may help you out at a supposed cheap reply how to fix something that you are looking for help at no cost to you.
4. Yes, Fox are expensive and not at all cheap to come by. But most of us here will say it will fix your problem. But you don't want to hear that now do you?!
Car spring. Figure out what spring rate you need with a calculator on one of those suspension sites, then buy that spring rate with a spring in your spring's dimensions (thats on the bike now). You can find them used on eBay and really get it done on the cheap. If the actual coil is too thick, you may need to get a thicker base plate, but thats very cheap in and of itself as well.
Last edited by Conrice; 03-02-2015 at 04:30 PM.
1) I have looked, price prohibitive. The current setup was done when this was my one and only, no longer the case.
3)I come only with the attitude of a full grown man who has an Aircraft Maintenance degree, and a 1,000hp Supra that is home built and home tuned. I am not your average 16 year old idiot needing to be told what to do. I have a simple question knowing full well the race tech is better, but I will not spend that kind of $$$ on this bike. So I asked that if that is the advise you give, to kindly keep it to yourself.
4) This bike will never see a track day. It will never have a set of slicks shod upon its glorious white wheels. It will never have a set of racing rearsets installed to increase lean angle. What I would like is a fun cruiser to blast away some back roads. This does not call for race tech. Even if i did get a race shock, it would be sprung for one Marc Marquez, not my three. So then we would be right back in this same boat of needing a new spring. Once it was re-sprung, it would need to be re-valved to accommodate for the increased spring rate and now we have gone over my budget tenfold.
Race Tech actually has the stock shock spring rates. So, if you wanted to try a different stock shock you could find the spring rate on the Race Tech site.
No matter what the positive help we try to give, it will be thrown back in our face.
Admins, please lock this thread.
You don't "need" re-valving. What you need is the mechanical side of the suspension (the spring) set up ideally for your weight. So a spring swap would accomplish all of that. Track guys do this when they're on the cheap. Its not bling, but it gets the job done. And I wouldn't think twice about doing it since you're only going to be blasting around on the back roads.
You could also look for a shock from a bike thats 150lbs heavier than yours as well, swap to the shock from that bike and be done. You just need to look for the leng,ths and mounts to make sure it'll work. Forewarning, your options will be limited as far as getting a shock that has anything other than adjustable preload, as you'll be looking at a lot of sport-tourers. You have the viffer in your garage, take some measurements of that. I'm not sure what the weight comparison is, but it might be close.
Fighter sites have lists that compile a lot of this information, google is your friend. There really isn't any other way to accomplish what you want in your budget other than those 2 options.
Last edited by Conrice; 03-03-2015 at 09:35 AM.
Thank you for the info on not needing revalved due to change in spring rates for proper function. With my Megan Racing coil overs we originally ordered the race dampers with street spring rates, then we found that was no good. We then called Megan Racing and they had us send in the dampers to be revalved due to the increase in spring rates with race springs (currently running 1,000lb/in fronts). They implied that any change in spring rate other than what can be accomplished with preload justified a re-valve so the dampers are properly tuned to spring rate.
And as far as a different oem shock assembly, I thought I heard the 954 shock specifically was a direct swap part. I have been to the racetech site to check on spring rates, and the 954 stock would still be undersprung; however it would be more than 50% the difference from current to correct. That seems like a good cheap fix. Problem is, I can't remember if it was a 954 or a 929 or even a 1000rr shock I was reading about and was hoping someone here could tell me it they are the same free length / compressed length, or any other interference issues. Or point me to a premade list of shock dimentions so I could check one to the other.
Underground-mpyre: people like you with your one sided attitude and negative postings are the reason I stopped using this forum over a year ago, and are the reason for my asking that nobody suggest Fox or Penske on MY thread.
You come to a public forum asking for help with the automatic attitude rather than being gracious. I provided it with the few others and you threw our helpful suggestions back at us. If you want to play, you gotta pay for the right parts. There are no cheap safe answers that may or not kill you when it comes to motorcycles. BUT you have all the answers, and the only one asking the question. So we tried to help. I do have a serious answer to help you with your "rear shock" problem, but it would hurt your fragile feelings to tell you the truth.


For more information on this Pokémon's species, see Zigzagoon.
Zigzagoon (Japanese: ジグザグマ Jiguzaguma) is a Colorless-type Basic Pokémon card. It is part of the Great Encounters expansion.
This page was last edited on 18 May 2018, at 10:31.