code_text
stringlengths
604
999k
repo_name
stringlengths
4
100
file_path
stringlengths
4
873
language
stringclasses
23 values
license
stringclasses
15 values
size
int32
1.02k
999k
// Copyright (c) 2013-2016 The btcsuite developers // Copyright (c) 2015-2021 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package main import ( "context" "fmt" "os" "path/filepath" "github.com/decred/dcrd/blockchain/v4" "github.com/decred/dcrd/chaincfg/chainhash" "github.com/decred/dcrd/chaincfg/v3" "github.com/decred/dcrd/database/v3" ) const blockDbNamePrefix = "blocks" var ( cfg *config ) // loadBlockDB opens the block database and returns a handle to it. func loadBlockDB() (database.DB, error) { // The database name is based on the database type. dbName := blockDbNamePrefix + "_" + cfg.DbType dbPath := filepath.Join(cfg.DataDir, dbName) fmt.Printf("Loading block database from '%s'\n", dbPath) db, err := database.Open(cfg.DbType, dbPath, activeNetParams.Net) if err != nil { return nil, err } return db, nil } // findCandidates searches the chain backwards for checkpoint candidates and // returns a slice of found candidates, if any. It also stops searching for // candidates at the last checkpoint that is already hard coded into chain // since there is no point in finding candidates before already existing // checkpoints. func findCandidates(chain *blockchain.BlockChain, latestHash *chainhash.Hash) ([]*chaincfg.Checkpoint, error) { // Start with the latest block of the main chain. block, err := chain.BlockByHash(latestHash) if err != nil { return nil, err } // Get the latest known checkpoint. latestCheckpoint := chain.LatestCheckpoint() if latestCheckpoint == nil { // Set the latest checkpoint to the genesis block if there isn't // already one. latestCheckpoint = &chaincfg.Checkpoint{ Hash: &activeNetParams.GenesisHash, Height: 0, } } // The latest known block must be at least the last known checkpoint // plus required checkpoint confirmations. checkpointConfirmations := int64(blockchain.CheckpointConfirmations) requiredHeight := latestCheckpoint.Height + checkpointConfirmations if block.Height() < requiredHeight { return nil, fmt.Errorf("the block database is only at height "+ "%d which is less than the latest checkpoint height "+ "of %d plus required confirmations of %d", block.Height(), latestCheckpoint.Height, checkpointConfirmations) } // For the first checkpoint, the required height is any block after the // genesis block, so long as the chain has at least the required number // of confirmations (which is enforced above). if len(activeNetParams.Checkpoints) == 0 { requiredHeight = 1 } // Indeterminate progress setup. numBlocksToTest := block.Height() - requiredHeight progressInterval := (numBlocksToTest / 100) + 1 // min 1 fmt.Print("Searching for candidates") defer fmt.Println() // Loop backwards through the chain to find checkpoint candidates. candidates := make([]*chaincfg.Checkpoint, 0, cfg.NumCandidates) numTested := int64(0) for len(candidates) < cfg.NumCandidates && block.Height() > requiredHeight { // Display progress. if numTested%progressInterval == 0 { fmt.Print(".") } // Determine if this block is a checkpoint candidate. isCandidate, err := chain.IsCheckpointCandidate(block) if err != nil { return nil, err } // All checks passed, so this node seems like a reasonable // checkpoint candidate. if isCandidate { checkpoint := chaincfg.Checkpoint{ Height: block.Height(), Hash: block.Hash(), } candidates = append(candidates, &checkpoint) } prevHash := &block.MsgBlock().Header.PrevBlock block, err = chain.BlockByHash(prevHash) if err != nil { return nil, err } numTested++ } return candidates, nil } // showCandidate display a checkpoint candidate using and output format // determined by the configuration parameters. The Go syntax output // uses the format the chain code expects for checkpoints added to the list. func showCandidate(candidateNum int, checkpoint *chaincfg.Checkpoint) { if cfg.UseGoOutput { fmt.Printf("Candidate %d -- {%d, newHashFromStr(\"%v\")},\n", candidateNum, checkpoint.Height, checkpoint.Hash) return } fmt.Printf("Candidate %d -- Height: %d, Hash: %v\n", candidateNum, checkpoint.Height, checkpoint.Hash) } func main() { // Load configuration and parse command line. tcfg, _, err := loadConfig() if err != nil { return } cfg = tcfg // Load the block database. db, err := loadBlockDB() if err != nil { fmt.Fprintln(os.Stderr, "failed to load database:", err) return } defer db.Close() // Load the UTXO database. utxoDb, err := blockchain.LoadUtxoDB(context.Background(), activeNetParams, cfg.DataDir) if err != nil { fmt.Fprintln(os.Stderr, "failed to load UTXO database:", err) return } defer utxoDb.Close() // Instantiate a UTXO backend and UTXO cache. utxoBackend := blockchain.NewLevelDbUtxoBackend(utxoDb) utxoCache := blockchain.NewUtxoCache(&blockchain.UtxoCacheConfig{ Backend: utxoBackend, FlushBlockDB: db.Flush, MaxSize: 100 * 1024 * 1024, // 100 MiB }) // Setup chain. Ignore notifications since they aren't needed for this // util. chain, err := blockchain.New(context.Background(), &blockchain.Config{ DB: db, ChainParams: activeNetParams, UtxoBackend: blockchain.NewLevelDbUtxoBackend(utxoDb), UtxoCache: utxoCache, }) if err != nil { fmt.Fprintf(os.Stderr, "failed to initialize chain: %v\n", err) return } // Get the latest block hash and height from the database and report // status. best := chain.BestSnapshot() fmt.Printf("Block database loaded with block height %d\n", best.Height) // Find checkpoint candidates. candidates, err := findCandidates(chain, &best.Hash) if err != nil { fmt.Fprintln(os.Stderr, "Unable to identify candidates:", err) return } // No candidates. if len(candidates) == 0 { fmt.Println("No candidates found.") return } // Show the candidates. for i, checkpoint := range candidates { showCandidate(i+1, checkpoint) } }
decred/dcrd
cmd/findcheckpoint/findcheckpoint.go
GO
isc
6,032
/** * Copyright (c) 2009-2011,2014 AllSeen Alliance. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package org.alljoyn.bus; import org.alljoyn.bus.BusAttachment; import org.alljoyn.bus.BusException; import org.alljoyn.bus.BusObject; import org.alljoyn.bus.Status; import org.alljoyn.bus.ifaces.DBusProxyObj; import static junit.framework.Assert.*; import java.lang.ref.WeakReference; import java.util.Map; import java.util.TreeMap; import junit.framework.TestCase; public class MarshalStressTest extends TestCase { public MarshalStressTest(String name) { super(name); } static { System.loadLibrary("alljoyn_java"); } public class Service implements MarshalStressInterface, BusObject { public byte getPropy() throws BusException { return (byte)1; } public void Methody(byte m) throws BusException {} public Structy MethodStructy() throws BusException { Structy s = new Structy(); s.m = (byte)1; return s; } public boolean getPropb() throws BusException { return true; } public void Methodb(boolean m) throws BusException {} public Structb MethodStructb() throws BusException { Structb s = new Structb(); s.m = true; return s; } public short getPropn() throws BusException { return (short)2; } public void Methodn(short m) throws BusException {} public Structn MethodStructn() throws BusException { Structn s = new Structn(); s.m = (short)2; return s; } public short getPropq() throws BusException { return (short)3; } public void Methodq(short m) throws BusException {} public Structq MethodStructq() throws BusException { Structq s = new Structq(); s.m = (short)3; return s; } public int getPropi() throws BusException { return 4; } public void Methodi(int m) throws BusException {} public Structi MethodStructi() throws BusException { Structi s = new Structi(); s.m = 4; return s; } public int getPropu() throws BusException { return 5; } public void Methodu(int m) throws BusException {} public Structu MethodStructu() throws BusException { Structu s = new Structu(); s.m = 5; return s; } public long getPropx() throws BusException { return (long)6; } public void Methodx(long m) throws BusException {} public Structx MethodStructx() throws BusException { Structx s = new Structx(); s.m = (long)6; return s; } public long getPropt() throws BusException { return (long)7; } public void Methodt(long m) throws BusException {} public Structt MethodStructt() throws BusException { Structt s = new Structt(); s.m = (long)7; return s; } public double getPropd() throws BusException { return 8.1; } public void Methodd(double m) throws BusException {} public Structd MethodStructd() throws BusException { Structd s = new Structd(); s.m = 8.1; return s; } public String getProps() throws BusException { return "nine"; } public void Methods(String m) throws BusException {} public Structs MethodStructs() throws BusException { Structs s = new Structs(); s.m = "nine"; return s; } public String getPropo() throws BusException { return "/ten"; } public void Methodo(String m) throws BusException {} public Structo MethodStructo() throws BusException { Structo s = new Structo(); s.m = "/ten"; return s; } public String getPropg() throws BusException { return "y"; } public void Methodg(String m) throws BusException {} public Structg MethodStructg() throws BusException { Structg s = new Structg(); s.m = "y"; return s; } public byte[] getPropay() throws BusException { return new byte[] { (byte)1 }; } public void Methoday(byte[] m) throws BusException {} public Structay MethodStructay() throws BusException { Structay s = new Structay(); s.m = new byte[] { (byte)1 }; return s; } public boolean[] getPropab() throws BusException { return new boolean[] { true }; } public void Methodab(boolean[] m) throws BusException {} public Structab MethodStructab() throws BusException { Structab s = new Structab(); s.m = new boolean[] { true }; return s; } public short[] getPropan() throws BusException { return new short[] { (short)2 }; } public void Methodan(short[] m) throws BusException {} public Structan MethodStructan() throws BusException { Structan s = new Structan(); s.m = new short[] { (short)2 }; return s; } public short[] getPropaq() throws BusException { return new short[] { (short)3 }; } public void Methodaq(short[] m) throws BusException {} public Structaq MethodStructaq() throws BusException { Structaq s = new Structaq(); s.m = new short[] { (short)3 }; return s; } public int[] getPropai() throws BusException { return new int[] { 4 }; } public void Methodai(int[] m) throws BusException {} public Structai MethodStructai() throws BusException { Structai s = new Structai(); s.m = new int[] { 4 }; return s; } public int[] getPropau() throws BusException { return new int[] { 5 }; } public void Methodau(int[] m) throws BusException {} public Structau MethodStructau() throws BusException { Structau s = new Structau(); s.m = new int[] { 5 }; return s; } public long[] getPropax() throws BusException { return new long[] { (long)6 }; } public void Methodax(long[] m) throws BusException {} public Structax MethodStructax() throws BusException { Structax s = new Structax(); s.m = new long[] { (long)6 }; return s; } public long[] getPropat() throws BusException { return new long[] { (long)7 }; } public void Methodat(long[] m) throws BusException {} public Structat MethodStructat() throws BusException { Structat s = new Structat(); s.m = new long[] { (long)7 }; return s; } public double[] getPropad() throws BusException { return new double[] { 8.1 }; } public void Methodad(double[] m) throws BusException {} public Structad MethodStructad() throws BusException { Structad s = new Structad(); s.m = new double[] { 8.1 }; return s; } public String[] getPropas() throws BusException { return new String[] { "nine" }; } public void Methodas(String[] m) throws BusException {} public Structas MethodStructas() throws BusException { Structas s = new Structas(); s.m = new String[] { "nine" }; return s; } public String[] getPropao() throws BusException { return new String[] { "/ten" }; } public void Methodao(String[] m) throws BusException {} public Structao MethodStructao() throws BusException { Structao s = new Structao(); s.m = new String[] { "/ten" }; return s; } public String[] getPropag() throws BusException { return new String[] { "y" }; } public void Methodag(String[] m) throws BusException {} public Structag MethodStructag() throws BusException { Structag s = new Structag(); s.m = new String[] { "y" }; return s; } public void Methoda(byte[] m) throws BusException {} public void Methodaei(Map<Integer, String> m) throws BusException {} public void Methodaers(Map<Struct, String> m) throws BusException {} public void IncompleteMethodaers(Map<Struct, String> m) throws BusException {} public void Methodry(Struct m) throws BusException {} public void Methodray(Struct m) throws BusException {} public void Methodvy(Variant m) throws BusException {} public void Methodvay(Variant m) throws BusException {} public Map<String, String> getPropaessy() throws BusException { return new TreeMap<String, String>(); } public Map<String, String> getPropaesss() throws BusException { return new TreeMap<String, String>(); } public void Methodaessy(Map<String, String> m) throws BusException {} public void Methodaessay(Map<String, String> m) throws BusException {} public Struct[] getPropar() throws BusException { return new Struct[] { new Struct() }; } public Struct getPropr() throws BusException { return new Struct(); } public Variant Methodv() throws BusException { return new Variant(new String("vs")); } public Structr MethodStructr() throws BusException { Structr s = new Structr(); s.m = new Struct(); return s; } public Structv MethodStructv() throws BusException { Structv s = new Structv(); s.m = new Variant(new String("hello")); return s; } public Structaess MethodStructaess() throws BusException { Structaess s = new Structaess(); s.m = new TreeMap<String, String>(); return s; } } private BusAttachment bus; private BusAttachment serviceBus; private Service service; private MarshalStressInterfaceInvalid proxy; public void setUp() throws Exception { serviceBus = new BusAttachment(getClass().getName() + "Service"); service = new Service(); Status status = serviceBus.registerBusObject(service, "/service"); assertEquals(Status.OK, status); status = serviceBus.connect(); assertEquals(Status.OK, status); DBusProxyObj control = serviceBus.getDBusProxyObj(); DBusProxyObj.RequestNameResult res = control.RequestName("org.alljoyn.bus.MarshalStressTest", DBusProxyObj.REQUEST_NAME_NO_FLAGS); assertEquals(DBusProxyObj.RequestNameResult.PrimaryOwner, res); bus = new BusAttachment(getClass().getName()); status = bus.connect(); assertEquals(Status.OK, status); ProxyBusObject remoteObj = bus.getProxyBusObject("org.alljoyn.bus.MarshalStressTest", "/service", BusAttachment.SESSION_ID_ANY, new Class<?>[] { MarshalStressInterfaceInvalid.class }); proxy = remoteObj.getInterface(MarshalStressInterfaceInvalid.class); } public void tearDown() throws Exception { proxy = null; DBusProxyObj control = serviceBus.getDBusProxyObj(); DBusProxyObj.ReleaseNameResult res = control.ReleaseName("org.alljoyn.bus.MarshalStressTest"); assertEquals(DBusProxyObj.ReleaseNameResult.Released, res); serviceBus.unregisterBusObject(service); service = null; serviceBus.disconnect(); serviceBus.release(); serviceBus = null; bus.disconnect(); bus.release(); bus = null; } public void testInvalidPropy() throws Exception { boolean thrown = false; try { proxy.getPropy(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethody() throws Exception { boolean thrown = false; try { proxy.Methody(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructy() throws Exception { boolean thrown = false; try { proxy.MethodStructy(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropb() throws Exception { boolean thrown = false; try { proxy.getPropb(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodb() throws Exception { boolean thrown = false; try { proxy.Methodb(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructb() throws Exception { boolean thrown = false; try { proxy.MethodStructb(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropn() throws Exception { boolean thrown = false; try { proxy.getPropn(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodn() throws Exception { boolean thrown = false; try { proxy.Methodn(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructn() throws Exception { boolean thrown = false; try { proxy.MethodStructn(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropq() throws Exception { boolean thrown = false; try { proxy.getPropq(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodq() throws Exception { boolean thrown = false; try { proxy.Methodq(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructq() throws Exception { boolean thrown = false; try { proxy.MethodStructq(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropi() throws Exception { boolean thrown = false; try { proxy.getPropi(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodi() throws Exception { boolean thrown = false; try { proxy.Methodi(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructi() throws Exception { boolean thrown = false; try { proxy.MethodStructi(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropu() throws Exception { boolean thrown = false; try { proxy.getPropu(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodu() throws Exception { boolean thrown = false; try { proxy.Methodu(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructu() throws Exception { boolean thrown = false; try { proxy.MethodStructu(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropx() throws Exception { boolean thrown = false; try { proxy.getPropx(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodx() throws Exception { boolean thrown = false; try { proxy.Methodx(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructx() throws Exception { boolean thrown = false; try { proxy.MethodStructx(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropt() throws Exception { boolean thrown = false; try { proxy.getPropt(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodt() throws Exception { boolean thrown = false; try { proxy.Methodt(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructt() throws Exception { boolean thrown = false; try { proxy.MethodStructt(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropd() throws Exception { boolean thrown = false; try { proxy.getPropd(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodd() throws Exception { boolean thrown = false; try { proxy.Methodd(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructd() throws Exception { boolean thrown = false; try { proxy.MethodStructd(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidProps() throws Exception { boolean thrown = false; try { proxy.getProps(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethods() throws Exception { boolean thrown = false; try { proxy.Methods(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructs() throws Exception { boolean thrown = false; try { proxy.MethodStructs(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropo() throws Exception { boolean thrown = false; try { proxy.getPropo(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodo() throws Exception { boolean thrown = false; try { proxy.Methodo(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructo() throws Exception { boolean thrown = false; try { proxy.MethodStructo(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropg() throws Exception { boolean thrown = false; try { proxy.getPropg(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodg() throws Exception { boolean thrown = false; try { proxy.Methodg(this.getClass()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructg() throws Exception { boolean thrown = false; try { proxy.MethodStructg(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropay() throws Exception { boolean thrown = false; try { proxy.getPropay(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethoday() throws Exception { boolean thrown = false; try { proxy.Methoday(new Class<?>[] { this.getClass() }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructay() throws Exception { boolean thrown = false; try { proxy.MethodStructay(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropab() throws Exception { boolean thrown = false; try { proxy.getPropab(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodab() throws Exception { boolean thrown = false; try { proxy.Methodab(new Class<?>[] { this.getClass() }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructab() throws Exception { boolean thrown = false; try { proxy.MethodStructab(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropan() throws Exception { boolean thrown = false; try { proxy.getPropan(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodan() throws Exception { boolean thrown = false; try { proxy.Methodan(new Class<?>[] { this.getClass() }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructan() throws Exception { boolean thrown = false; try { proxy.MethodStructan(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropaq() throws Exception { boolean thrown = false; try { proxy.getPropaq(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodaq() throws Exception { boolean thrown = false; try { proxy.Methodaq(new Class<?>[] { this.getClass() }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructaq() throws Exception { boolean thrown = false; try { proxy.MethodStructaq(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropai() throws Exception { boolean thrown = false; try { proxy.getPropai(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodai() throws Exception { boolean thrown = false; try { proxy.Methodai(new Class<?>[] { this.getClass() }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructai() throws Exception { boolean thrown = false; try { proxy.MethodStructai(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropau() throws Exception { boolean thrown = false; try { proxy.getPropau(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodau() throws Exception { boolean thrown = false; try { proxy.Methodau(new Class<?>[] { this.getClass() }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructau() throws Exception { boolean thrown = false; try { proxy.MethodStructau(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropax() throws Exception { boolean thrown = false; try { proxy.getPropax(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodax() throws Exception { boolean thrown = false; try { proxy.Methodax(new Class<?>[] { this.getClass() }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructax() throws Exception { boolean thrown = false; try { proxy.MethodStructax(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropat() throws Exception { boolean thrown = false; try { proxy.getPropat(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodat() throws Exception { boolean thrown = false; try { proxy.Methodat(new Class<?>[] { this.getClass() }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructat() throws Exception { boolean thrown = false; try { proxy.MethodStructat(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropad() throws Exception { boolean thrown = false; try { proxy.getPropad(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodad() throws Exception { boolean thrown = false; try { proxy.Methodad(new Class<?>[] { this.getClass() }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructad() throws Exception { boolean thrown = false; try { proxy.MethodStructad(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropas() throws Exception { boolean thrown = false; try { proxy.getPropas(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodas() throws Exception { boolean thrown = false; try { proxy.Methodas(new int[] { 0 }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructas() throws Exception { boolean thrown = false; try { proxy.MethodStructas(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropao() throws Exception { boolean thrown = false; try { proxy.getPropao(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodao() throws Exception { boolean thrown = false; try { proxy.Methodao(new int[] { 0 }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructao() throws Exception { boolean thrown = false; try { proxy.MethodStructao(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropag() throws Exception { boolean thrown = false; try { proxy.getPropag(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodag() throws Exception { boolean thrown = false; try { proxy.Methodag(new int[] { 0 }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructag() throws Exception { boolean thrown = false; try { proxy.MethodStructag(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethoda() throws Exception { proxy.Methoda(new byte[] { (byte)0 }); } public void testInvalidMethodaei() throws Exception { proxy.Methodaei(new TreeMap<Integer, String>()); } public void testInvalidMethodaers() throws Exception { boolean thrown = false; try { proxy.Methodaers(new TreeMap<MarshalStressInterfaceInvalid.Struct, String>()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidIncompleteMethodaers() throws Exception { boolean thrown = false; try { proxy.IncompleteMethodaers(new TreeMap<MarshalStressInterfaceInvalid.Struct, String>()); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodry() throws Exception { boolean thrown = false; try { proxy.Methodry((byte)0); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodray() throws Exception { boolean thrown = false; try { proxy.Methodray(new byte[] { (byte)0 }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodvy() throws Exception { boolean thrown = false; try { proxy.Methodvy((byte)0); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodvay() throws Exception { boolean thrown = false; try { proxy.Methodvay(new byte[] { (byte)0 }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropaessy() throws Exception { boolean thrown = false; try { proxy.getPropaessy(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropaesss() throws Exception { boolean thrown = false; try { proxy.getPropaesss(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodaessy() throws Exception { boolean thrown = false; try { proxy.Methodaessy((byte)0); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodaessay() throws Exception { boolean thrown = false; try { proxy.Methodaessay(new byte[] { (byte)0 }); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropar() throws Exception { boolean thrown = false; try { proxy.getPropar(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidPropr() throws Exception { boolean thrown = false; try { proxy.getPropr(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodv() throws Exception { boolean thrown = false; try { proxy.Methodv(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructr() throws Exception { boolean thrown = false; try { proxy.MethodStructr(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructv() throws Exception { boolean thrown = false; try { proxy.MethodStructv(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } public void testInvalidMethodStructaess() throws Exception { boolean thrown = false; try { proxy.MethodStructaess(); } catch (BusException ex) { thrown = true; } catch (Throwable ex) { ex.printStackTrace(); } finally { assertTrue(thrown); } } }
hybridgroup/alljoyn
alljoyn/alljoyn_java/test/org/alljoyn/bus/MarshalStressTest.java
Java
isc
41,826
"""SCons.Tool.rpcgen Tool-specific initialization for RPCGEN tools. Three normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # __revision__ = "src/engine/SCons/Tool/rpcgen.py 4369 2009/09/19 15:58:29 scons" from SCons.Builder import Builder import SCons.Util cmd = "cd ${SOURCE.dir} && $RPCGEN -%s $RPCGENFLAGS %s -o ${TARGET.abspath} ${SOURCE.file}" rpcgen_client = cmd % ('l', '$RPCGENCLIENTFLAGS') rpcgen_header = cmd % ('h', '$RPCGENHEADERFLAGS') rpcgen_service = cmd % ('m', '$RPCGENSERVICEFLAGS') rpcgen_xdr = cmd % ('c', '$RPCGENXDRFLAGS') def generate(env): "Add RPCGEN Builders and construction variables for an Environment." client = Builder(action=rpcgen_client, suffix='_clnt.c', src_suffix='.x') header = Builder(action=rpcgen_header, suffix='.h', src_suffix='.x') service = Builder(action=rpcgen_service, suffix='_svc.c', src_suffix='.x') xdr = Builder(action=rpcgen_xdr, suffix='_xdr.c', src_suffix='.x') env.Append(BUILDERS={'RPCGenClient' : client, 'RPCGenHeader' : header, 'RPCGenService' : service, 'RPCGenXDR' : xdr}) env['RPCGEN'] = 'rpcgen' env['RPCGENFLAGS'] = SCons.Util.CLVar('') env['RPCGENCLIENTFLAGS'] = SCons.Util.CLVar('') env['RPCGENHEADERFLAGS'] = SCons.Util.CLVar('') env['RPCGENSERVICEFLAGS'] = SCons.Util.CLVar('') env['RPCGENXDRFLAGS'] = SCons.Util.CLVar('') def exists(env): return env.Detect('rpcgen') # Local Variables: # tab-width:4 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=4 shiftwidth=4:
looooo/pivy
scons/scons-local-1.2.0.d20090919/SCons/Tool/rpcgen.py
Python
isc
2,876
--- layout: api title: "v2.2.0 JavaScript Library: L.Control.zoom" categories: api version: v2.2.0 permalink: /api/v2.2.0/l-control-zoom --- <h2 id="control-zoom">Control.zoom</h2> <p>A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its <code>zoomControl</code> option to <code><span class="literal">false</span></code>. Extends <a href="/mapbox.js/api/v2.2.0/l-control">Control</a>.</p> <h3>Creation</h3> <table data-id='control-zoom'> <tr> <th>Factory</th> <th class="width200">Description</th> </tr> <tr> <td><code><b>L.control.zoom</b>( <nobr>&lt;<a href="/mapbox.js/api/v2.2.0/l-control">Control.Zoom options</a>&gt; <i>options?</i> )</nobr> </code></td> <td>Creates a zoom control.</td> </tr> </table> <h3 id="control-zoom-options">Options</h3> <table data-id='control-zoom'> <tr> <th>Option</th> <th>Type</th> <th>Default</th> <th>Description</th> </tr> <tr> <td><code><b>position</b></code></td> <td><code>String</code></td> <td><code><span class="string">'topleft'</span></td> <td>The position of the control (one of the map corners). See <a href="/mapbox.js/api/v2.2.0/l-control">control positions</a>.</td> </tr> <tr> <td><code><b>zoomInText</b></code></td> <td><code>String</code></td> <td><code><span class="string">'+'</span></td> <td>The text set on the zoom in button.</td> </tr> <tr> <td><code><b>zoomOutText</b></code></td> <td><code>String</code></td> <td><code><span class="string">'-'</span></td> <td>The text set on the zoom out button.</td> </tr> <tr> <td><code><b>zoomInTitle</b></code></td> <td><code>String</code></td> <td><code><span class="string">'Zoom in'</span></td> <td>The title set on the zoom in button.</td> </tr> <tr> <td><code><b>zoomOutTitle</b></code></td> <td><code>String</code></td> <td><code><span class="string">'Zoom out'</span></td> <td>The title set on the zoom out button.</td> </tr> </table>
dakotabenjamin/geojson.io
node_modules/mapbox.js/docs/_posts/api/v2.2.0/0200-01-01-l-control-zoom.html
HTML
isc
1,989
package org.ripple.bouncycastle.jce.spec; import java.security.PrivateKey; import java.security.PublicKey; import java.security.spec.KeySpec; import org.ripple.bouncycastle.jce.interfaces.IESKey; /** * key pair for use with an integrated encryptor - together * they provide what's required to generate the message. */ public class IEKeySpec implements KeySpec, IESKey { private PublicKey pubKey; private PrivateKey privKey; /** * @param privKey our private key. * @param pubKey the public key of the sender/recipient. */ public IEKeySpec( PrivateKey privKey, PublicKey pubKey) { this.privKey = privKey; this.pubKey = pubKey; } /** * return the intended recipient's/sender's public key. */ public PublicKey getPublic() { return pubKey; } /** * return the local private key. */ public PrivateKey getPrivate() { return privKey; } /** * return "IES" */ public String getAlgorithm() { return "IES"; } /** * return null */ public String getFormat() { return null; } /** * returns null */ public byte[] getEncoded() { return null; } }
mileschet/ripple-lib-java
ripple-bouncycastle/src/main/java/org/ripple/bouncycastle/jce/spec/IEKeySpec.java
Java
isc
1,291
<html> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <head> <title> Login page for the calendar. </title> </head> <body bgcolor="white"> <center> <font size=7 color="red"> Please Enter the following information: </font> <br> <form method=GET action=cal1.jsp> <font size=5> Name <input type=text name="name" size=20> </font> <br> <font size=5> Email <input type=text name="email" size=20> </font> <br> <input type=submit name=action value="Submit"> </form> <hr> <font size=3 color="red"> Note: This application does not implement the complete functionality of a typical calendar application. It demostartes a way JSP can be used with html tables and forms.</font> </center> </body> </html>
HackWars/hackwars-classic
HWTomcatServer/webapps/examples/jsp/cal/login.html
HTML
isc
1,457
/** * socket.io * Copyright(c) 2011 LearnBoost <dev@learnboost.com> * MIT Licensed */ (function (exports, io, global) { /** * There is a way to hide the loading indicator in Firefox. If you create and * remove a iframe it will stop showing the current loading indicator. * Unfortunately we can't feature detect that and UA sniffing is evil. * * @api private */ var indicator = global.document && "MozAppearance" in global.document.documentElement.style; /** * Expose constructor. */ exports['jsonp-polling'] = JSONPPolling; /** * The JSONP transport creates an persistent connection by dynamically * inserting a script tag in the page. This script tag will receive the * information of the Socket.IO server. When new information is received * it creates a new script tag for the new data stream. * * @constructor * @extends {io.Transport.xhr-polling} * @api public */ function JSONPPolling (socket) { io.Transport['xhr-polling'].apply(this, arguments); this.index = io.j.length; var self = this; io.j.push(function (msg) { self._(msg); }); }; /** * Inherits from XHR polling transport. */ io.util.inherit(JSONPPolling, io.Transport['xhr-polling']); /** * Transport name * * @api public */ JSONPPolling.prototype.name = 'jsonp-polling'; /** * Posts a encoded message to the Socket.IO server using an iframe. * The iframe is used because script tags can create POST based requests. * The iframe is positioned outside of the view so the user does not * notice it's existence. * * @param {String} data A encoded message. * @api private */ JSONPPolling.prototype.post = function (data) { var self = this , query = io.util.query( this.socket.options.query , 't='+ (+new Date) + '&i=' + this.index ); if (!this.form) { var form = document.createElement('form') , area = document.createElement('textarea') , id = this.iframeId = 'socketio_iframe_' + this.index , iframe; form.className = 'socketio'; form.style.position = 'absolute'; form.style.top = '0px'; form.style.left = '0px'; form.style.display = 'none'; form.target = id; form.method = 'POST'; form.setAttribute('accept-charset', 'utf-8'); area.name = 'd'; form.appendChild(area); document.body.appendChild(form); this.form = form; this.area = area; } this.form.action = this.prepareUrl() + query; function complete () { initIframe(); self.socket.setBuffer(false); }; function initIframe () { if (self.iframe) { self.form.removeChild(self.iframe); } try { // ie6 dynamic iframes with target="" support (thanks Chris Lambacher) iframe = document.createElement('<iframe name="'+ self.iframeId +'">'); } catch (e) { iframe = document.createElement('iframe'); iframe.name = self.iframeId; } iframe.id = self.iframeId; self.form.appendChild(iframe); self.iframe = iframe; }; initIframe(); // we temporarily stringify until we figure out how to prevent // browsers from turning `\n` into `\r\n` in form inputs this.area.value = io.JSON.stringify(data); try { this.form.submit(); } catch(e) {} if (this.iframe.attachEvent) { iframe.onreadystatechange = function () { if (self.iframe.readyState == 'complete') { complete(); } }; } else { this.iframe.onload = complete; } this.socket.setBuffer(true); }; /** * Creates a new JSONP poll that can be used to listen * for messages from the Socket.IO server. * * @api private */ JSONPPolling.prototype.get = function () { var self = this , script = document.createElement('script') , query = io.util.query( this.socket.options.query , 't='+ (+new Date) + '&i=' + this.index ); if (this.script) { this.script.parentNode.removeChild(this.script); this.script = null; } script.async = true; script.src = this.prepareUrl() + query; script.onerror = function () { self.onClose(); }; var insertAt = document.getElementsByTagName('script')[0]; insertAt.parentNode.insertBefore(script, insertAt); this.script = script; if (indicator) { setTimeout(function () { var iframe = document.createElement('iframe'); document.body.appendChild(iframe); document.body.removeChild(iframe); }, 100); } }; /** * Callback function for the incoming message stream from the Socket.IO server. * * @param {String} data The message * @api private */ JSONPPolling.prototype._ = function (msg) { this.onData(msg); if (this.isOpen) { this.get(); } return this; }; /** * The indicator hack only works after onload * * @param {Socket} socket The socket instance that needs a transport * @param {Function} fn The callback * @api private */ JSONPPolling.prototype.ready = function (socket, fn) { var self = this; if (!indicator) return fn.call(this); io.util.load(function () { fn.call(self); }); }; /** * Checks if browser supports this transport. * * @return {Boolean} * @api public */ JSONPPolling.check = function () { return 'document' in global; }; /** * Check if cross domain requests are supported * * @returns {Boolean} * @api public */ JSONPPolling.xdomainCheck = function () { return true; }; /** * Add the transport to your public io.transports array. * * @api private */ io.transports.push('jsonp-polling'); })( 'undefined' != typeof io ? io.Transport : module.exports , 'undefined' != typeof io ? io : module.parent.exports , this );
voidlock/contacts
node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/lib/transports/jsonp-polling.js
JavaScript
isc
5,998
/* automatically generated by JSCoverage - do not edit */ if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; if (! _$jscoverage['middleware/session/store.js']) { _$jscoverage['middleware/session/store.js'] = []; _$jscoverage['middleware/session/store.js'][13] = 0; _$jscoverage['middleware/session/store.js'][23] = 0; _$jscoverage['middleware/session/store.js'][29] = 0; _$jscoverage['middleware/session/store.js'][39] = 0; _$jscoverage['middleware/session/store.js'][40] = 0; _$jscoverage['middleware/session/store.js'][41] = 0; _$jscoverage['middleware/session/store.js'][42] = 0; _$jscoverage['middleware/session/store.js'][43] = 0; _$jscoverage['middleware/session/store.js'][56] = 0; _$jscoverage['middleware/session/store.js'][57] = 0; _$jscoverage['middleware/session/store.js'][58] = 0; _$jscoverage['middleware/session/store.js'][59] = 0; _$jscoverage['middleware/session/store.js'][60] = 0; _$jscoverage['middleware/session/store.js'][61] = 0; _$jscoverage['middleware/session/store.js'][62] = 0; _$jscoverage['middleware/session/store.js'][63] = 0; _$jscoverage['middleware/session/store.js'][76] = 0; _$jscoverage['middleware/session/store.js'][77] = 0; _$jscoverage['middleware/session/store.js'][79] = 0; _$jscoverage['middleware/session/store.js'][80] = 0; _$jscoverage['middleware/session/store.js'][81] = 0; _$jscoverage['middleware/session/store.js'][82] = 0; _$jscoverage['middleware/session/store.js'][83] = 0; } _$jscoverage['middleware/session/store.js'][13]++; var EventEmitter = require("events").EventEmitter, Session = require("./session"), Cookie = require("./cookie"); _$jscoverage['middleware/session/store.js'][23]++; var Store = module.exports = (function Store(options) { }); _$jscoverage['middleware/session/store.js'][29]++; Store.prototype.__proto__ = EventEmitter.prototype; _$jscoverage['middleware/session/store.js'][39]++; Store.prototype.regenerate = (function (req, fn) { _$jscoverage['middleware/session/store.js'][40]++; var self = this; _$jscoverage['middleware/session/store.js'][41]++; this.destroy(req.sessionID, (function (err) { _$jscoverage['middleware/session/store.js'][42]++; self.generate(req); _$jscoverage['middleware/session/store.js'][43]++; fn(err); })); }); _$jscoverage['middleware/session/store.js'][56]++; Store.prototype.load = (function (sid, fn) { _$jscoverage['middleware/session/store.js'][57]++; var self = this; _$jscoverage['middleware/session/store.js'][58]++; this.get(sid, (function (err, sess) { _$jscoverage['middleware/session/store.js'][59]++; if (err) { _$jscoverage['middleware/session/store.js'][59]++; return fn(err); } _$jscoverage['middleware/session/store.js'][60]++; if (! sess) { _$jscoverage['middleware/session/store.js'][60]++; return fn(); } _$jscoverage['middleware/session/store.js'][61]++; var req = {sessionID: sid, sessionStore: self}; _$jscoverage['middleware/session/store.js'][62]++; sess = self.createSession(req, sess); _$jscoverage['middleware/session/store.js'][63]++; fn(null, sess); })); }); _$jscoverage['middleware/session/store.js'][76]++; Store.prototype.createSession = (function (req, sess) { _$jscoverage['middleware/session/store.js'][77]++; var expires = sess.cookie.expires, orig = sess.cookie.originalMaxAge; _$jscoverage['middleware/session/store.js'][79]++; sess.cookie = new Cookie(sess.cookie); _$jscoverage['middleware/session/store.js'][80]++; if ("string" == typeof expires) { _$jscoverage['middleware/session/store.js'][80]++; sess.cookie.expires = new Date(expires); } _$jscoverage['middleware/session/store.js'][81]++; sess.cookie.originalMaxAge = orig; _$jscoverage['middleware/session/store.js'][82]++; req.session = new Session(req, sess); _$jscoverage['middleware/session/store.js'][83]++; return req.session; }); _$jscoverage['middleware/session/store.js'].source = ["","/*!"," * Connect - session - Store"," * Copyright(c) 2010 Sencha Inc."," * Copyright(c) 2011 TJ Holowaychuk"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var EventEmitter = require('events').EventEmitter"," , Session = require('./session')"," , Cookie = require('./cookie');","","/**"," * Initialize abstract `Store`."," *"," * @api private"," */","","var Store = module.exports = function Store(options){};","","/**"," * Inherit from `EventEmitter.prototype`."," */","","Store.prototype.__proto__ = EventEmitter.prototype;","","/**"," * Re-generate the given requests's session."," *"," * @param {IncomingRequest} req"," * @return {Function} fn"," * @api public"," */","","Store.prototype.regenerate = function(req, fn){"," var self = this;"," this.destroy(req.sessionID, function(err){"," self.generate(req);"," fn(err);"," });","};","","/**"," * Load a `Session` instance via the given `sid`"," * and invoke the callback `fn(err, sess)`."," *"," * @param {String} sid"," * @param {Function} fn"," * @api public"," */","","Store.prototype.load = function(sid, fn){"," var self = this;"," this.get(sid, function(err, sess){"," if (err) return fn(err);"," if (!sess) return fn();"," var req = { sessionID: sid, sessionStore: self };"," sess = self.createSession(req, sess);"," fn(null, sess);"," });","};","","/**"," * Create session from JSON `sess` data."," *"," * @param {IncomingRequest} req"," * @param {Object} sess"," * @return {Session}"," * @api private"," */","","Store.prototype.createSession = function(req, sess){"," var expires = sess.cookie.expires"," , orig = sess.cookie.originalMaxAge;"," sess.cookie = new Cookie(sess.cookie);"," if ('string' == typeof expires) sess.cookie.expires = new Date(expires);"," sess.cookie.originalMaxAge = orig;"," req.session = new Session(req, sess);"," return req.session;","};"];
vignesh9136/node-google-calendar-sample
node_modules/connect/lib-cov/middleware/session/store.js
JavaScript
isc
5,851
var parse = require('../'); var test = require('tape'); test('boolean and alias is not unknown', function (t) { var unknown = []; function unknownFn(arg) { unknown.push(arg); return false; } var aliased = [ '-h', 'true', '--derp', 'true' ]; var regular = [ '--herp', 'true', '-d', 'true' ]; var opts = { alias: { h: 'herp' }, boolean: 'h', unknown: unknownFn }; var aliasedArgv = parse(aliased, opts); var propertyArgv = parse(regular, opts); t.same(unknown, ['--derp', '-d']); t.end(); }); test('flag boolean true any double hyphen argument is not unknown', function (t) { var unknown = []; function unknownFn(arg) { unknown.push(arg); return false; } var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], { boolean: true, unknown: unknownFn }); t.same(unknown, ['--tacos=good', 'cow', '-p']); t.same(argv, { honk: true, _: [] }); t.end(); }); test('string and alias is not unknown', function (t) { var unknown = []; function unknownFn(arg) { unknown.push(arg); return false; } var aliased = [ '-h', 'hello', '--derp', 'goodbye' ]; var regular = [ '--herp', 'hello', '-d', 'moon' ]; var opts = { alias: { h: 'herp' }, string: 'h', unknown: unknownFn }; var aliasedArgv = parse(aliased, opts); var propertyArgv = parse(regular, opts); t.same(unknown, ['--derp', '-d']); t.end(); }); test('default and alias is not unknown', function (t) { var unknown = []; function unknownFn(arg) { unknown.push(arg); return false; } var aliased = [ '-h', 'hello' ]; var regular = [ '--herp', 'hello' ]; var opts = { default: { 'h': 'bar' }, alias: { 'h': 'herp' }, unknown: unknownFn }; var aliasedArgv = parse(aliased, opts); var propertyArgv = parse(regular, opts); t.same(unknown, []); t.end(); unknownFn(); // exercise fn for 100% coverage }); test('value following -- is not unknown', function (t) { var unknown = []; function unknownFn(arg) { unknown.push(arg); return false; } var aliased = [ '--bad', '--', 'good', 'arg' ]; var opts = { '--': true, unknown: unknownFn }; var argv = parse(aliased, opts); t.same(unknown, ['--bad']); t.same(argv, { '--': ['good', 'arg'], '_': [] }) t.end(); });
gregsqueeb/khoilajsdfkjsakldfj
node_modules/backstopjs/node_modules/gulp-open/node_modules/gulp-util/node_modules/minimist/test/unknown.js
JavaScript
isc
2,541
/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * */ var tizen = require('cordova/platform'); var cordova = require('cordova'); module.exports = { getDeviceInfo: function(success, error) { setTimeout(function () { success({ cordova: tizen.cordovaVersion, platform: 'tizen', model: null, version: null, uuid: null }); }, 0); } }; require("cordova/tizen/commandProxy").add("Device", module.exports);
jphuangjr/ficklePiglet
mobile/plugins/cordova-plugin-device/src/tizen/DeviceProxy.js
JavaScript
isc
1,289
/*! Video.js Default Styles (http://videojs.com) Version 4.3.0 Create your own skin at http://designer.videojs.com */.vjs-default-skin{color:#ccc}@font-face{font-family:VideoJS;src:url(font/vjs.eot);src:url(font/vjs.eot?#iefix) format('embedded-opentype'),url(font/vjs.woff) format('woff'),url(font/vjs.ttf) format('truetype');font-weight:400;font-style:normal}.vjs-default-skin .vjs-slider{outline:0;position:relative;cursor:pointer;padding:0;background-color:#333;background-color:rgba(51,51,51,.9)}.vjs-default-skin .vjs-slider:focus{-webkit-box-shadow:0 0 2em #fff;-moz-box-shadow:0 0 2em #fff;box-shadow:0 0 2em #fff}.vjs-default-skin .vjs-slider-handle{position:absolute;left:0;top:0}.vjs-default-skin .vjs-slider-handle:before{content:"\e009";font-family:VideoJS;font-size:1em;line-height:1;text-align:center;text-shadow:0 0 1em #fff;position:absolute;top:0;left:0;-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.vjs-default-skin .vjs-control-bar{display:none;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#07141e;background-color:rgba(7,20,30,.7)}.vjs-default-skin.vjs-has-started .vjs-control-bar{display:block;visibility:visible;opacity:1;-webkit-transition:visibility .1s,opacity .1s;-moz-transition:visibility .1s,opacity .1s;-o-transition:visibility .1s,opacity .1s;transition:visibility .1s,opacity .1s}.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{display:block;visibility:hidden;opacity:0;-webkit-transition:visibility 1s,opacity 1s;-moz-transition:visibility 1s,opacity 1s;-o-transition:visibility 1s,opacity 1s;transition:visibility 1s,opacity 1s}.vjs-default-skin.vjs-controls-disabled .vjs-control-bar{display:none}.vjs-default-skin.vjs-using-native-controls .vjs-control-bar{display:none}@media \0screen{.vjs-default-skin.vjs-user-inactive.vjs-playing .vjs-control-bar :before{content:""}}.vjs-default-skin .vjs-control{outline:0;position:relative;float:left;text-align:center;margin:0;padding:0;height:3em;width:4em}.vjs-default-skin .vjs-control:before{font-family:VideoJS;font-size:1.5em;line-height:2;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;text-shadow:1px 1px 1px rgba(0,0,0,.5)}.vjs-default-skin .vjs-control:focus:before,.vjs-default-skin .vjs-control:hover:before{text-shadow:0 0 1em #fff}.vjs-default-skin .vjs-control:focus{}.vjs-default-skin .vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.vjs-default-skin .vjs-play-control{width:5em;cursor:pointer}.vjs-default-skin .vjs-play-control:before{content:"\e001"}.vjs-default-skin.vjs-playing .vjs-play-control:before{content:"\e002"}.vjs-default-skin .vjs-mute-control,.vjs-default-skin .vjs-volume-menu-button{cursor:pointer;float:right}.vjs-default-skin .vjs-mute-control:before,.vjs-default-skin .vjs-volume-menu-button:before{content:"\e006"}.vjs-default-skin .vjs-mute-control.vjs-vol-0:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-0:before{content:"\e003"}.vjs-default-skin .vjs-mute-control.vjs-vol-1:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-1:before{content:"\e004"}.vjs-default-skin .vjs-mute-control.vjs-vol-2:before,.vjs-default-skin .vjs-volume-menu-button.vjs-vol-2:before{content:"\e005"}.vjs-default-skin .vjs-volume-control{width:5em;float:right}.vjs-default-skin .vjs-volume-bar{width:5em;height:.6em;margin:1.1em auto 0}.vjs-default-skin .vjs-volume-menu-button .vjs-menu-content{height:2.9em}.vjs-default-skin .vjs-volume-level{position:absolute;top:0;left:0;height:.5em;background:#66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat}.vjs-default-skin .vjs-volume-bar .vjs-volume-handle{width:.5em;height:.5em}.vjs-default-skin .vjs-volume-handle:before{font-size:.9em;top:-.2em;left:-.2em;width:1em;height:1em}.vjs-default-skin .vjs-volume-menu-button .vjs-menu .vjs-menu-content{width:6em;left:-4em}.vjs-default-skin .vjs-progress-control{position:absolute;left:0;right:0;width:auto;font-size:.3em;height:1em;top:-1em;-webkit-transition:all .4s;-moz-transition:all .4s;-o-transition:all .4s;transition:all .4s}.vjs-default-skin:hover .vjs-progress-control{font-size:.9em;-webkit-transition:all .2s;-moz-transition:all .2s;-o-transition:all .2s;transition:all .2s}.vjs-default-skin .vjs-progress-holder{height:100%}.vjs-default-skin .vjs-progress-holder .vjs-play-progress,.vjs-default-skin .vjs-progress-holder .vjs-load-progress{position:absolute;display:block;height:100%;margin:0;padding:0;left:0;top:0}.vjs-default-skin .vjs-play-progress{background:#66a8cc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat}.vjs-default-skin .vjs-load-progress{background:#646464;background:rgba(255,255,255,.4)}.vjs-default-skin .vjs-seek-handle{width:1.5em;height:100%}.vjs-default-skin .vjs-seek-handle:before{padding-top:.1em}.vjs-default-skin .vjs-time-controls{font-size:1em;line-height:3em}.vjs-default-skin .vjs-current-time{float:left}.vjs-default-skin .vjs-duration{float:left}.vjs-default-skin .vjs-remaining-time{display:none;float:left}.vjs-time-divider{float:left;line-height:3em}.vjs-default-skin .vjs-fullscreen-control{width:3.8em;cursor:pointer;float:right}.vjs-default-skin .vjs-fullscreen-control:before{content:"\e000"}.vjs-default-skin.vjs-fullscreen .vjs-fullscreen-control:before{content:"\e00b"}.vjs-default-skin .vjs-big-play-button{left:.5em;top:.5em;font-size:3em;display:block;z-index:2;position:absolute;width:4em;height:2.6em;text-align:center;vertical-align:middle;cursor:pointer;opacity:1;background-color:#07141e;background-color:rgba(7,20,30,.7);border:.1em solid #3b4249;-webkit-border-radius:.8em;-moz-border-radius:.8em;border-radius:.8em;-webkit-box-shadow:0 0 1em rgba(255,255,255,.25);-moz-box-shadow:0 0 1em rgba(255,255,255,.25);box-shadow:0 0 1em rgba(255,255,255,.25);-webkit-transition:all .4s;-moz-transition:all .4s;-o-transition:all .4s;transition:all .4s}.vjs-default-skin.vjs-big-play-centered .vjs-big-play-button{left:50%;margin-left:-2.1em;top:50%;margin-top:-1.4000000000000001em}.vjs-default-skin.vjs-controls-disabled .vjs-big-play-button{display:none}.vjs-default-skin.vjs-has-started .vjs-big-play-button{display:none}.vjs-default-skin.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-default-skin:hover .vjs-big-play-button,.vjs-default-skin .vjs-big-play-button:focus{outline:0;border-color:#fff;background-color:#505050;background-color:rgba(50,50,50,.75);-webkit-box-shadow:0 0 3em #fff;-moz-box-shadow:0 0 3em #fff;box-shadow:0 0 3em #fff;-webkit-transition:all 0s;-moz-transition:all 0s;-o-transition:all 0s;transition:all 0s}.vjs-default-skin .vjs-big-play-button:before{content:"\e001";font-family:VideoJS;line-height:2.6em;text-shadow:.05em .05em .1em #000;text-align:center;position:absolute;left:0;width:100%;height:100%}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;font-size:4em;line-height:1;width:1em;height:1em;margin-left:-.5em;margin-top:-.5em;opacity:.75;-webkit-animation:spin 1.5s infinite linear;-moz-animation:spin 1.5s infinite linear;-o-animation:spin 1.5s infinite linear;animation:spin 1.5s infinite linear}.vjs-default-skin .vjs-loading-spinner:before{content:"\e01e";font-family:VideoJS;position:absolute;top:0;left:0;width:1em;height:1em;text-align:center;text-shadow:0 0 .1em #000}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}.vjs-default-skin .vjs-menu-button{float:right;cursor:pointer}.vjs-default-skin .vjs-menu{display:none;position:absolute;bottom:0;left:0;width:0;height:0;margin-bottom:3em;border-left:2em solid transparent;border-right:2em solid transparent;border-top:1.55em solid #000;border-top-color:rgba(7,40,50,.5)}.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;position:absolute;width:10em;bottom:1.5em;max-height:15em;overflow:auto;left:-5em;background-color:#07141e;background-color:rgba(7,20,30,.7);-webkit-box-shadow:-.2em -.2em .3em rgba(255,255,255,.2);-moz-box-shadow:-.2em -.2em .3em rgba(255,255,255,.2);box-shadow:-.2em -.2em .3em rgba(255,255,255,.2)}.vjs-default-skin .vjs-menu-button:hover .vjs-menu{display:block}.vjs-default-skin .vjs-menu-button ul li{list-style:none;margin:0;padding:.3em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.vjs-default-skin .vjs-menu-button ul li.vjs-selected{background-color:#000}.vjs-default-skin .vjs-menu-button ul li:focus,.vjs-default-skin .vjs-menu-button ul li:hover,.vjs-default-skin .vjs-menu-button ul li.vjs-selected:focus,.vjs-default-skin .vjs-menu-button ul li.vjs-selected:hover{outline:0;color:#111;background-color:#fff;background-color:rgba(255,255,255,.75);-webkit-box-shadow:0 0 1em #fff;-moz-box-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.vjs-default-skin .vjs-menu-button ul li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-default-skin .vjs-subtitles-button:before{content:"\e00c"}.vjs-default-skin .vjs-captions-button:before{content:"\e008"}.vjs-default-skin .vjs-captions-button:focus .vjs-control-content:before,.vjs-default-skin .vjs-captions-button:hover .vjs-control-content:before{-webkit-box-shadow:0 0 1em #fff;-moz-box-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js{background-color:#000;position:relative;padding:0;font-size:10px;vertical-align:middle;font-weight:400;font-style:normal;font-family:Arial,sans-serif;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js:-moz-full-screen{position:absolute}body.vjs-full-window{padding:0;margin:0;height:100%;overflow-y:auto}.video-js.vjs-fullscreen{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0;width:100%!important;height:100%!important;_position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-poster{background-repeat:no-repeat;background-position:50% 50%;background-size:contain;cursor:pointer;height:100%;margin:0;padding:0;position:relative;width:100%}.vjs-poster img{display:block;margin:0 auto;max-height:100%;padding:0;width:100%}.video-js.vjs-using-native-controls .vjs-poster{display:none}.video-js .vjs-text-track-display{text-align:center;position:absolute;bottom:4em;left:1em;right:1em}.video-js .vjs-text-track{display:none;font-size:1.4em;text-align:center;margin-bottom:.1em;background-color:#000;background-color:rgba(0,0,0,.5)}.video-js .vjs-subtitles{color:#fff}.video-js .vjs-captions{color:#fc6}.vjs-tt-cue{display:block}.vjs-default-skin .vjs-hidden{display:none}.vjs-lock-showing{display:block!important;opacity:1;visibility:visible}
JavieChan/nanshaCity
gdnx/static/js/lib/ueditor/third-party/video-js/video-js.min.css
CSS
isc
11,451
/** * Module dependencies. */ var Base = require('./base'); /** * Expose `JSONCov`. */ exports = module.exports = JSONCov; /** * Initialize a new `JsCoverage` reporter. * * @param {Runner} runner * @param {Boolean} output * @api public */ function JSONCov(runner, output) { var self = this , output = 1 == arguments.length ? true : output; Base.call(this, runner); var tests = [] , failures = [] , passes = []; runner.on('test end', function(test){ tests.push(test); }); runner.on('pass', function(test){ passes.push(test); }); runner.on('fail', function(test){ failures.push(test); }); runner.on('end', function(){ var cov = global._$jscoverage || {}; var result = self.cov = map(cov); result.stats = self.stats; result.tests = tests.map(clean); result.failures = failures.map(clean); result.passes = passes.map(clean); if (!output) return; process.stdout.write(JSON.stringify(result, null, 2 )); }); } /** * Map jscoverage data to a JSON structure * suitable for reporting. * * @param {Object} cov * @return {Object} * @api private */ function map(cov) { var ret = { instrumentation: 'node-jscoverage' , sloc: 0 , hits: 0 , misses: 0 , coverage: 0 , files: [] }; for (var filename in cov) { var data = coverage(filename, cov[filename]); ret.files.push(data); ret.hits += data.hits; ret.misses += data.misses; ret.sloc += data.sloc; } ret.files.sort(function(a, b) { return a.filename.localeCompare(b.filename); }); if (ret.sloc > 0) { ret.coverage = (ret.hits / ret.sloc) * 100; } return ret; } /** * Map jscoverage data for a single source file * to a JSON structure suitable for reporting. * * @param {String} filename name of the source file * @param {Object} data jscoverage coverage data * @return {Object} * @api private */ function coverage(filename, data) { var ret = { filename: filename, coverage: 0, hits: 0, misses: 0, sloc: 0, source: {} }; data.source.forEach(function(line, num){ num++; if (data[num] === 0) { ret.misses++; ret.sloc++; } else if (data[num] !== undefined) { ret.hits++; ret.sloc++; } ret.source[num] = { source: line , coverage: data[num] === undefined ? '' : data[num] }; }); ret.coverage = ret.hits / ret.sloc * 100; return ret; } /** * Return a plain-object representation of `test` * free of cyclic properties etc. * * @param {Object} test * @return {Object} * @api private */ function clean(test) { return { title: test.title , fullTitle: test.fullTitle() , duration: test.duration } }
Foxoon/Todooze
todoapp/node_modules/mocha/lib/reporters/json-cov.js
JavaScript
isc
2,764
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package html import ( "strings" ) func adjustAttributeNames(aa []Attribute, nameMap map[string]string) { for i := range aa { if newName, ok := nameMap[aa[i].Key]; ok { aa[i].Key = newName } } } func adjustForeignAttributes(aa []Attribute) { for i, a := range aa { if a.Key == "" || a.Key[0] != 'x' { continue } switch a.Key { case "xlink:actuate", "xlink:arcrole", "xlink:href", "xlink:role", "xlink:show", "xlink:title", "xlink:type", "xml:base", "xml:lang", "xml:space", "xmlns:xlink": j := strings.Index(a.Key, ":") aa[i].Namespace = a.Key[:j] aa[i].Key = a.Key[j+1:] } } } func htmlIntegrationPoint(n *Node) bool { if n.Type != ElementNode { return false } switch n.Namespace { case "math": if n.Data == "annotation-xml" { for _, a := range n.Attr { if a.Key == "encoding" { val := strings.ToLower(a.Val) if val == "text/html" || val == "application/xhtml+xml" { return true } } } } case "svg": switch n.Data { case "desc", "foreignObject", "title": return true } } return false } func mathMLTextIntegrationPoint(n *Node) bool { if n.Namespace != "math" { return false } switch n.Data { case "mi", "mo", "mn", "ms", "mtext": return true } return false } // Section 12.2.5.5. var breakout = map[string]bool{ "b": true, "big": true, "blockquote": true, "body": true, "br": true, "center": true, "code": true, "dd": true, "div": true, "dl": true, "dt": true, "em": true, "embed": true, "h1": true, "h2": true, "h3": true, "h4": true, "h5": true, "h6": true, "head": true, "hr": true, "i": true, "img": true, "li": true, "listing": true, "menu": true, "meta": true, "nobr": true, "ol": true, "p": true, "pre": true, "ruby": true, "s": true, "small": true, "span": true, "strong": true, "strike": true, "sub": true, "sup": true, "table": true, "tt": true, "u": true, "ul": true, "var": true, } // Section 12.2.5.5. var svgTagNameAdjustments = map[string]string{ "altglyph": "altGlyph", "altglyphdef": "altGlyphDef", "altglyphitem": "altGlyphItem", "animatecolor": "animateColor", "animatemotion": "animateMotion", "animatetransform": "animateTransform", "clippath": "clipPath", "feblend": "feBlend", "fecolormatrix": "feColorMatrix", "fecomponenttransfer": "feComponentTransfer", "fecomposite": "feComposite", "feconvolvematrix": "feConvolveMatrix", "fediffuselighting": "feDiffuseLighting", "fedisplacementmap": "feDisplacementMap", "fedistantlight": "feDistantLight", "feflood": "feFlood", "fefunca": "feFuncA", "fefuncb": "feFuncB", "fefuncg": "feFuncG", "fefuncr": "feFuncR", "fegaussianblur": "feGaussianBlur", "feimage": "feImage", "femerge": "feMerge", "femergenode": "feMergeNode", "femorphology": "feMorphology", "feoffset": "feOffset", "fepointlight": "fePointLight", "fespecularlighting": "feSpecularLighting", "fespotlight": "feSpotLight", "fetile": "feTile", "feturbulence": "feTurbulence", "foreignobject": "foreignObject", "glyphref": "glyphRef", "lineargradient": "linearGradient", "radialgradient": "radialGradient", "textpath": "textPath", } // Section 12.2.5.1 var mathMLAttributeAdjustments = map[string]string{ "definitionurl": "definitionURL", } var svgAttributeAdjustments = map[string]string{ "attributename": "attributeName", "attributetype": "attributeType", "basefrequency": "baseFrequency", "baseprofile": "baseProfile", "calcmode": "calcMode", "clippathunits": "clipPathUnits", "contentscripttype": "contentScriptType", "contentstyletype": "contentStyleType", "diffuseconstant": "diffuseConstant", "edgemode": "edgeMode", "externalresourcesrequired": "externalResourcesRequired", "filterres": "filterRes", "filterunits": "filterUnits", "glyphref": "glyphRef", "gradienttransform": "gradientTransform", "gradientunits": "gradientUnits", "kernelmatrix": "kernelMatrix", "kernelunitlength": "kernelUnitLength", "keypoints": "keyPoints", "keysplines": "keySplines", "keytimes": "keyTimes", "lengthadjust": "lengthAdjust", "limitingconeangle": "limitingConeAngle", "markerheight": "markerHeight", "markerunits": "markerUnits", "markerwidth": "markerWidth", "maskcontentunits": "maskContentUnits", "maskunits": "maskUnits", "numoctaves": "numOctaves", "pathlength": "pathLength", "patterncontentunits": "patternContentUnits", "patterntransform": "patternTransform", "patternunits": "patternUnits", "pointsatx": "pointsAtX", "pointsaty": "pointsAtY", "pointsatz": "pointsAtZ", "preservealpha": "preserveAlpha", "preserveaspectratio": "preserveAspectRatio", "primitiveunits": "primitiveUnits", "refx": "refX", "refy": "refY", "repeatcount": "repeatCount", "repeatdur": "repeatDur", "requiredextensions": "requiredExtensions", "requiredfeatures": "requiredFeatures", "specularconstant": "specularConstant", "specularexponent": "specularExponent", "spreadmethod": "spreadMethod", "startoffset": "startOffset", "stddeviation": "stdDeviation", "stitchtiles": "stitchTiles", "surfacescale": "surfaceScale", "systemlanguage": "systemLanguage", "tablevalues": "tableValues", "targetx": "targetX", "targety": "targetY", "textlength": "textLength", "viewbox": "viewBox", "viewtarget": "viewTarget", "xchannelselector": "xChannelSelector", "ychannelselector": "yChannelSelector", "zoomandpan": "zoomAndPan", }
P7h/goread
_third_party/golang.org/x/net/html/foreign.go
GO
isc
6,913
var baseCastPath = require('./_baseCastPath'), get = require('./get'), isFunction = require('./isFunction'), isKey = require('./_isKey'), parent = require('./_parent'); /** * This method is like `_.get` except that if the resolved value is a function * it's invoked with the `this` binding of its parent object and its result * is returned. * * @static * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. * @param {*} [defaultValue] The value returned if the resolved value is `undefined`. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * * _.result(object, 'a[0].b.c1'); * // => 3 * * _.result(object, 'a[0].b.c2'); * // => 4 * * _.result(object, 'a[0].b.c3', 'default'); * // => 'default' * * _.result(object, 'a[0].b.c3', _.constant('default')); * // => 'default' */ function result(object, path, defaultValue) { if (!isKey(path, object)) { path = baseCastPath(path); var result = get(object, path); object = parent(object, path); } else { result = object == null ? undefined : object[path]; } if (result === undefined) { result = defaultValue; } return isFunction(result) ? result.call(object) : result; } module.exports = result;
hbzhang/me
me/node_modules/sequelize/node_modules/lodash/result.js
JavaScript
mit
1,383
/* AngularJS v1.4.4 (c) 2010-2015 Google, Inc. http://angularjs.org License: MIT */ (function(p,c,C){'use strict';function v(r,h,g){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,f,b,d,y){function z(){k&&(g.cancel(k),k=null);l&&(l.$destroy(),l=null);m&&(k=g.leave(m),k.then(function(){k=null}),m=null)}function x(){var b=r.current&&r.current.locals;if(c.isDefined(b&&b.$template)){var b=a.$new(),d=r.current;m=y(b,function(b){g.enter(b,null,m||f).then(function(){!c.isDefined(t)||t&&!a.$eval(t)||h()});z()});l=d.scope=b;l.$emit("$viewContentLoaded"); l.$eval(w)}else z()}var l,m,k,t=b.autoscroll,w=b.onload||"";a.$on("$routeChangeSuccess",x);x()}}}function A(c,h,g){return{restrict:"ECA",priority:-400,link:function(a,f){var b=g.current,d=b.locals;f.html(d.$template);var y=c(f.contents());b.controller&&(d.$scope=a,d=h(b.controller,d),b.controllerAs&&(a[b.controllerAs]=d),f.data("$ngControllerController",d),f.children().data("$ngControllerController",d));y(a)}}}p=c.module("ngRoute",["ng"]).provider("$route",function(){function r(a,f){return c.extend(Object.create(a), f)}function h(a,c){var b=c.caseInsensitiveMatch,d={originalPath:a,regexp:a},g=d.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(a,c,b,d){a="?"===d?d:null;d="*"===d?d:null;g.push({name:b,optional:!!a});c=c||"";return""+(a?"":c)+"(?:"+(a?c:"")+(d&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");d.regexp=new RegExp("^"+a+"$",b?"i":"");return d}var g={};this.when=function(a,f){var b=c.copy(f);c.isUndefined(b.reloadOnSearch)&&(b.reloadOnSearch=!0); c.isUndefined(b.caseInsensitiveMatch)&&(b.caseInsensitiveMatch=this.caseInsensitiveMatch);g[a]=c.extend(b,a&&h(a,b));if(a){var d="/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";g[d]=c.extend({redirectTo:a},h(d,b))}return this};this.caseInsensitiveMatch=!1;this.otherwise=function(a){"string"===typeof a&&(a={redirectTo:a});this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function(a,f,b,d,h,p,x){function l(b){var e=s.current; (v=(n=k())&&e&&n.$$route===e.$$route&&c.equals(n.pathParams,e.pathParams)&&!n.reloadOnSearch&&!w)||!e&&!n||a.$broadcast("$routeChangeStart",n,e).defaultPrevented&&b&&b.preventDefault()}function m(){var u=s.current,e=n;if(v)u.params=e.params,c.copy(u.params,b),a.$broadcast("$routeUpdate",u);else if(e||u)w=!1,(s.current=e)&&e.redirectTo&&(c.isString(e.redirectTo)?f.path(t(e.redirectTo,e.params)).search(e.params).replace():f.url(e.redirectTo(e.pathParams,f.path(),f.search())).replace()),d.when(e).then(function(){if(e){var a= c.extend({},e.resolve),b,f;c.forEach(a,function(b,e){a[e]=c.isString(b)?h.get(b):h.invoke(b,null,null,e)});c.isDefined(b=e.template)?c.isFunction(b)&&(b=b(e.params)):c.isDefined(f=e.templateUrl)&&(c.isFunction(f)&&(f=f(e.params)),c.isDefined(f)&&(e.loadedTemplateUrl=x.valueOf(f),b=p(f)));c.isDefined(b)&&(a.$template=b);return d.all(a)}}).then(function(f){e==s.current&&(e&&(e.locals=f,c.copy(e.params,b)),a.$broadcast("$routeChangeSuccess",e,u))},function(b){e==s.current&&a.$broadcast("$routeChangeError", e,u,b)})}function k(){var a,b;c.forEach(g,function(d,g){var q;if(q=!b){var h=f.path();q=d.keys;var l={};if(d.regexp)if(h=d.regexp.exec(h)){for(var k=1,m=h.length;k<m;++k){var n=q[k-1],p=h[k];n&&p&&(l[n.name]=p)}q=l}else q=null;else q=null;q=a=q}q&&(b=r(d,{params:c.extend({},f.search(),a),pathParams:a}),b.$$route=d)});return b||g[null]&&r(g[null],{params:{},pathParams:{}})}function t(a,b){var d=[];c.forEach((a||"").split(":"),function(a,c){if(0===c)d.push(a);else{var f=a.match(/(\w+)(?:[?*])?(.*)/), g=f[1];d.push(b[g]);d.push(f[2]||"");delete b[g]}});return d.join("")}var w=!1,n,v,s={routes:g,reload:function(){w=!0;a.$evalAsync(function(){l();m()})},updateParams:function(a){if(this.current&&this.current.$$route)a=c.extend({},this.current.params,a),f.path(t(this.current.$$route.originalPath,a)),f.search(a);else throw B("norout");}};a.$on("$locationChangeStart",l);a.$on("$locationChangeSuccess",m);return s}]});var B=c.$$minErr("ngRoute");p.provider("$routeParams",function(){this.$get=function(){return{}}}); p.directive("ngView",v);p.directive("ngView",A);v.$inject=["$route","$anchorScroll","$animate"];A.$inject=["$compile","$controller","$route"]})(window,window.angular); //# sourceMappingURL=angular-route.min.js.map
CyrusSUEN/cdnjs
ajax/libs/angular.js/1.4.4/angular-route.min.js
JavaScript
mit
4,390
/* * /MathJax/localization/pt-br/MathMenu.js * * Copyright (c) 2009-2015 The MathJax Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ MathJax.Localization.addTranslation("pt-br","MathMenu",{version:"2.6.0",isLoaded:true,strings:{Show:"Mostrar F\u00F3rmulas Como",MathMLcode:"C\u00F3digo MathML",OriginalMathML:"MathML original",TeXCommands:"Comandos TeX",AsciiMathInput:"Entrada AsciiMathML",Original:"Formato original",ErrorMessage:"Mensagem de erro",Annotation:"Anota\u00E7\u00E3o",TeX:"TeX",StarMath:"StarMath",Maple:"Maple",ContentMathML:"MathML do conte\u00FAdo",OpenMath:"OpenMath",texHints:"Mostrar dicas de TeX em MathML",Settings:"Configura\u00E7\u00F5es das f\u00F3rmulas",ZoomTrigger:"Disparador do zoom",Hover:"Passar o mouse",Click:"Clique",DoubleClick:"Clique duplo",NoZoom:"Sem zoom",TriggerRequires:"O Disparador Requer:",Option:"Op\u00E7\u00E3o",Alt:"Alt",Command:"Comando",Control:"Control",Shift:"Shift",ZoomFactor:"Fator de zoom",Renderer:"Renderizador das F\u00F3rmulas",MPHandles:"Deixe que o MathPlayer resolva:",MenuEvents:"Eventos de Menu",MouseEvents:"Eventos de Mouse",MenuAndMouse:"Eventos de Mouse e de Menu",FontPrefs:"Prefer\u00EAncias de Fontes",ForHTMLCSS:"Para HTML-CSS:",Auto:"Autom\u00E1tico",TeXLocal:"TeX (local)",TeXWeb:"TeX (web)",TeXImage:"TeX (imagem)",STIXLocal:"STIX (local)",STIXWeb:"STIX (Web)",AsanaMathWeb:"Asana Math (Web)",GyrePagellaWeb:"Gyre Pagella (Web)",GyreTermesWeb:"Gyre Termes (Web)",LatinModernWeb:"Latim Moderno (Web)",NeoEulerWeb:"Neo Euler (web)",ContextMenu:"Menu de Contexto",Browser:"Navegador",Scale:"Redimensionar Todas as F\u00F3rmulas ...",Discoverable:"Destacar ao Passar o Mouse",Locale:"Idioma",LoadLocale:"Carregar a partir de URL ...",About:"Sobre o MathJax",Help:"Ajuda do MathJax",localTeXfonts:"usando fontes TeX locais",webTeXfonts:"usando fontes TeX da web",imagefonts:"usando fontes feitas com imagens",localSTIXfonts:"usando fontes STIX",webSVGfonts:"usando fontes SVG da web",genericfonts:"usando fontes unicode gen\u00E9ricas",wofforotffonts:"fontes woff ou otf",eotffonts:"fontes eot",svgfonts:"fontes svg",WebkitNativeMMLWarning:"N\u00E3o parece haver suporte nativo ao MathML em seu navegador, ent\u00E3o a mudan\u00E7a para MathML pode tornar ileg\u00EDveis as f\u00F3rmulas matem\u00E1ticas da p\u00E1gina.",MSIENativeMMLWarning:"O Internet Explorer requer o plugin MathPlayer para processar MathML.",OperaNativeMMLWarning:"O suporte ao MathML no Opera \u00E9 limitado, ent\u00E3o a mudan\u00E7a para MathML pode piorar a renderiza\u00E7\u00E3o de algumas express\u00F5es.",SafariNativeMMLWarning:"O suporte ao MathML nativo do seu navegador n\u00E3o implementa todos os recursos usados pelo MathJax, ent\u00E3o algumas express\u00F5es podem n\u00E3o ser exibidas adequadamente.",FirefoxNativeMMLWarning:"O suporte ao MathML nativo do seu navegador n\u00E3o implementa todos os recursos usados pelo MathJax, ent\u00E3o algumas express\u00F5es podem n\u00E3o ser exibidas adequadamente.",MSIESVGWarning:"N\u00E3o h\u00E1 uma implementa\u00E7\u00E3o de SVG nas vers\u00F5es do Internet Explorer anteriores ao IE9 ou quando ele est\u00E1 emulando o IE8 ou as vers\u00F5es anteriores. A mudan\u00E7a para SVG far\u00E1 com que as f\u00F3rmulas n\u00E3o sejam exibidas adequadamente.",LoadURL:"Carregar os dados de tradu\u00E7\u00E3o a partir desta URL:",BadURL:"A URL deve ser para um um arquivo de javascript que defina os dados de tradu\u00E7\u00E3o do MathJax. Os nomes dos arquivos de Javascript devem terminar com '.js'",BadData:"Falha ao carregar os dados de tradu\u00E7\u00E3o de %1",SwitchAnyway:"Mudar para este renderizador mesmo assim?\n\n(Pressione OK para mudar, CANCELAR para continuar com o renderizador atual)",ScaleMath:"Redimensionar todas as f\u00F3rmulas matem\u00E1ticas (em rela\u00E7\u00E3o ao texto \u00E0 sua volta) em",NonZeroScale:"A escala n\u00E3o deve ser zero",PercentScale:"A escala deve ser uma porcentagem (por exemplo, 120%%)",IE8warning:"Isto desabilitar\u00E1 o menu MathJax e os recursos de zoom, mas voc\u00EA poder\u00E1 usar Alt-Clique em uma express\u00E3o para obter o menu MathJax em vez disso.\n\nRealmente alterar as configura\u00E7\u00F5es do MathPlayer?",IE9warning:"O menu de contexto do MathJax ser\u00E1 desabilitado, mas voc\u00EA pode usar Alt-Clique em uma express\u00E3o para obter o menu MathJax em vez disso.",NoOriginalForm:"Sem uma forma original dispon\u00EDvel",Close:"Fechar",EqSource:"Fonte da Equa\u00E7\u00E3o do MathJax"}});MathJax.Ajax.loadComplete("[MathJax]/localization/pt-br/MathMenu.js");
mattocci27/mattocci27.github.io
assets/NJC-stat/assets/mathjax-local/localization/pt-br/MathMenu.js
JavaScript
mit
5,085
"use strict";angular.module("ngLocale",[],["$provide",function(e){var E={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};e.value("$locale",{DATETIME_FORMATS:{AMPMS:["์˜ค์ „","์˜คํ›„"],DAY:["์ผ์š”์ผ","์›”์š”์ผ","ํ™”์š”์ผ","์ˆ˜์š”์ผ","๋ชฉ์š”์ผ","๊ธˆ์š”์ผ","ํ† ์š”์ผ"],ERANAMES:["๊ธฐ์›์ „","์„œ๊ธฐ"],ERAS:["๊ธฐ์›์ „","์„œ๊ธฐ"],FIRSTDAYOFWEEK:6,MONTH:["1์›”","2์›”","3์›”","4์›”","5์›”","6์›”","7์›”","8์›”","9์›”","10์›”","11์›”","12์›”"],SHORTDAY:["์ผ","์›”","ํ™”","์ˆ˜","๋ชฉ","๊ธˆ","ํ† "],SHORTMONTH:["1์›”","2์›”","3์›”","4์›”","5์›”","6์›”","7์›”","8์›”","9์›”","10์›”","11์›”","12์›”"],STANDALONEMONTH:["1์›”","2์›”","3์›”","4์›”","5์›”","6์›”","7์›”","8์›”","9์›”","10์›”","11์›”","12์›”"],WEEKENDRANGE:[5,6],fullDate:"y๋…„ M์›” d์ผ EEEE",longDate:"y๋…„ M์›” d์ผ",medium:"y. M. d. a h:mm:ss",mediumDate:"y. M. d.",mediumTime:"a h:mm:ss",short:"yy. M. d. a h:mm",shortDate:"yy. M. d.",shortTime:"a h:mm"},NUMBER_FORMATS:{CURRENCY_SYM:"โ‚ฉ",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-ยค",negSuf:"",posPre:"ยค",posSuf:""}]},id:"ko-kr",localeID:"ko_KR",pluralCat:function(e,a){return E.OTHER}})}]); //# sourceMappingURL=angular-locale_ko-kr.min.js.map
sajochiu/cdnjs
ajax/libs/angular.js/1.4.14/i18n/angular-locale_ko-kr.min.js
JavaScript
mit
1,326
"use strict";angular.module("ngLocale",[],["$provide",function(e){function r(e){e+="";var r=e.indexOf(".");return r==-1?0:e.length-r-1}function a(e,a){var n=a;void 0===n&&(n=Math.min(r(e),3));var M=Math.pow(10,n),u=(e*M|0)%M;return{v:n,f:u}}var n={ZERO:"zero",ONE:"one",TWO:"two",FEW:"few",MANY:"many",OTHER:"other"};e.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORTDAY:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],SHORTMONTH:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],STANDALONEMONTH:["January","February","March","April","May","June","July","August","September","October","November","December"],WEEKENDRANGE:[5,6],fullDate:"EEEE, d MMMM y",longDate:"d MMMM y",medium:"d MMM y h:mm:ss a",mediumDate:"d MMM y",mediumTime:"h:mm:ss a",short:"dd/MM/y h:mm a",shortDate:"dd/MM/y",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"Ksh",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-ยค",negSuf:"",posPre:"ยค",posSuf:""}]},id:"en-ke",localeID:"en_KE",pluralCat:function(e,r){var M=0|e,u=a(e,r);return 1==M&&0==u.v?n.ONE:n.OTHER}})}]); //# sourceMappingURL=angular-locale_en-ke.min.js.map
honestree/cdnjs
ajax/libs/angular-i18n/1.5.9/angular-locale_en-ke.min.js
JavaScript
mit
1,530
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Console\Tester; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; /** * Eases the testing of console commands. * * @author Fabien Potencier <fabien@symfony.com> */ class CommandTester { private $command; private $input; private $output; private $statusCode; /** * Constructor. * * @param Command $command A Command instance to test. */ public function __construct(Command $command) { $this->command = $command; } /** * Executes the command. * * Available options: * * * interactive: Sets the input interactive flag * * decorated: Sets the output decorated flag * * verbosity: Sets the output verbosity flag * * @param array $input An array of arguments and options * @param array $options An array of options * * @return integer The command exit code */ public function execute(array $input, array $options = array()) { // set the command name automatically if the application requires // this argument and no command name was passed if (!isset($input['command']) && (null !== $application = $this->command->getApplication()) && $application->getDefinition()->hasArgument('command') ) { $input['command'] = $this->command->getName(); } $this->input = new ArrayInput($input); if (isset($options['interactive'])) { $this->input->setInteractive($options['interactive']); } $this->output = new StreamOutput(fopen('php://memory', 'w', false)); if (isset($options['decorated'])) { $this->output->setDecorated($options['decorated']); } if (isset($options['verbosity'])) { $this->output->setVerbosity($options['verbosity']); } return $this->statusCode = $this->command->run($this->input, $this->output); } /** * Gets the display returned by the last execution of the command. * * @param Boolean $normalize Whether to normalize end of lines to \n or not * * @return string The display */ public function getDisplay($normalize = false) { rewind($this->output->getStream()); $display = stream_get_contents($this->output->getStream()); if ($normalize) { $display = str_replace(PHP_EOL, "\n", $display); } return $display; } /** * Gets the input instance used by the last execution of the command. * * @return InputInterface The current input instance */ public function getInput() { return $this->input; } /** * Gets the output instance used by the last execution of the command. * * @return OutputInterface The current output instance */ public function getOutput() { return $this->output; } /** * Gets the status code returned by the last execution of the application. * * @return integer The status code */ public function getStatusCode() { return $this->statusCode; } }
johnny1991/MHAM
vendor/symfony/symfony/src/Symfony/Component/Console/Tester/CommandTester.php
PHP
mit
3,612
/*! jQuery UI - v1.11.4 - 2015-03-13 * http://jqueryui.com * Copyright jQuery Foundation and other contributors; Licensed MIT */ (function(t){"function"==typeof define&&define.amd?define(["../datepicker"],t):t(jQuery.datepicker)})(function(t){return t.regional["ar-DZ"]={closeText:"ุฅุบู„ุงู‚",prevText:"&#x3C;ุงู„ุณุงุจู‚",nextText:"ุงู„ุชุงู„ูŠ&#x3E;",currentText:"ุงู„ูŠูˆู…",monthNames:["ุฌุงู†ููŠ","ููŠูุฑูŠ","ู…ุงุฑุณ","ุฃูุฑูŠู„","ู…ุงูŠ","ุฌูˆุงู†","ุฌูˆูŠู„ูŠุฉ","ุฃูˆุช","ุณุจุชู…ุจุฑ","ุฃูƒุชูˆุจุฑ","ู†ูˆูู…ุจุฑ","ุฏูŠุณู…ุจุฑ"],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"],dayNames:["ุงู„ุฃุญุฏ","ุงู„ุงุซู†ูŠู†","ุงู„ุซู„ุงุซุงุก","ุงู„ุฃุฑุจุนุงุก","ุงู„ุฎู…ูŠุณ","ุงู„ุฌู…ุนุฉ","ุงู„ุณุจุช"],dayNamesShort:["ุงู„ุฃุญุฏ","ุงู„ุงุซู†ูŠู†","ุงู„ุซู„ุงุซุงุก","ุงู„ุฃุฑุจุนุงุก","ุงู„ุฎู…ูŠุณ","ุงู„ุฌู…ุนุฉ","ุงู„ุณุจุช"],dayNamesMin:["ุงู„ุฃุญุฏ","ุงู„ุงุซู†ูŠู†","ุงู„ุซู„ุงุซุงุก","ุงู„ุฃุฑุจุนุงุก","ุงู„ุฎู…ูŠุณ","ุงู„ุฌู…ุนุฉ","ุงู„ุณุจุช"],weekHeader:"ุฃุณุจูˆุน",dateFormat:"dd/mm/yy",firstDay:6,isRTL:!0,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional["ar-DZ"]),t.regional["ar-DZ"]});
HerrR/mobutv-projekt
bower_components/jquery-ui/ui/minified/i18n/datepicker-ar-DZ.min.js
JavaScript
mit
1,149
/*! jQuery UI - v1.11.4 - 2015-03-13 * http://jqueryui.com * Copyright jQuery Foundation and other contributors; Licensed MIT */ (function(e){"function"==typeof define&&define.amd?define(["../datepicker"],e):e(jQuery.datepicker)})(function(e){return e.regional.sr={closeText:"ะ—ะฐั‚ะฒะพั€ะธ",prevText:"&#x3C;",nextText:"&#x3E;",currentText:"ะ”ะฐะฝะฐั",monthNames:["ะˆะฐะฝัƒะฐั€","ะคะตะฑั€ัƒะฐั€","ะœะฐั€ั‚","ะะฟั€ะธะป","ะœะฐั˜","ะˆัƒะฝ","ะˆัƒะป","ะะฒะณัƒัั‚","ะกะตะฟั‚ะตะผะฑะฐั€","ะžะบั‚ะพะฑะฐั€","ะะพะฒะตะผะฑะฐั€","ะ”ะตั†ะตะผะฑะฐั€"],monthNamesShort:["ะˆะฐะฝ","ะคะตะฑ","ะœะฐั€","ะะฟั€","ะœะฐั˜","ะˆัƒะฝ","ะˆัƒะป","ะะฒะณ","ะกะตะฟ","ะžะบั‚","ะะพะฒ","ะ”ะตั†"],dayNames:["ะะตะดะตั™ะฐ","ะŸะพะฝะตะดะตั™ะฐะบ","ะฃั‚ะพั€ะฐะบ","ะกั€ะตะดะฐ","ะงะตั‚ะฒั€ั‚ะฐะบ","ะŸะตั‚ะฐะบ","ะกัƒะฑะพั‚ะฐ"],dayNamesShort:["ะะตะด","ะŸะพะฝ","ะฃั‚ะพ","ะกั€ะต","ะงะตั‚","ะŸะตั‚","ะกัƒะฑ"],dayNamesMin:["ะะต","ะŸะพ","ะฃั‚","ะกั€","ะงะต","ะŸะต","ะกัƒ"],weekHeader:"ะกะตะด",dateFormat:"dd.mm.yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},e.setDefaults(e.regional.sr),e.regional.sr});
aoliverio/builder
webroot/bower_components/jquery-ui/ui/minified/i18n/datepicker-sr.min.js
JavaScript
mit
1,074
webshims.register("mediaelement-jaris",function(a,b,c,d,e,f){"use strict";var g=b.mediaelement,h=c.swfmini,i=Modernizr.audio&&Modernizr.video,j=h.hasFlashPlayerVersion("9.0.115"),k=0,l="ActiveXObject"in c&&i,m={paused:!0,ended:!1,currentSrc:"",duration:c.NaN,readyState:0,networkState:0,videoHeight:0,videoWidth:0,seeking:!1,error:null,buffered:{start:function(a){return a?(b.error("buffered index size error"),void 0):0},end:function(a){return a?(b.error("buffered index size error"),void 0):0},length:0}},n=Object.keys(m),o={currentTime:0,volume:1,muted:!1},p=(Object.keys(o),a.extend({isActive:"html5",activating:"html5",wasSwfReady:!1,_bufferedEnd:0,_bufferedStart:0,currentTime:0,_ppFlag:e,_calledMeta:!1,lastDuration:0},m,o)),q=function(a){try{a.nodeName}catch(c){return null}var d=b.data(a,"mediaelement");return d&&"third"==d.isActive?d:null},r=function(b,c){c=a.Event(c),c.preventDefault(),a.event.trigger(c,e,b)},s=f.playerPath||b.cfg.basePath+"swf/"+(f.playerName||"JarisFLVPlayer.swf");b.extendUNDEFProp(f.params,{allowscriptaccess:"always",allowfullscreen:"true",wmode:"transparent",allowNetworking:"all"}),b.extendUNDEFProp(f.vars,{controltype:"1",jsapi:"1"}),b.extendUNDEFProp(f.attrs,{bgcolor:"#000000"});var t=function(a,b){3>a&&clearTimeout(b._canplaythroughTimer),a>=3&&b.readyState<3&&(b.readyState=a,r(b._elem,"canplay"),b.paused||r(b._elem,"playing"),clearTimeout(b._canplaythroughTimer),b._canplaythroughTimer=setTimeout(function(){t(4,b)},4e3)),a>=4&&b.readyState<4&&(b.readyState=a,r(b._elem,"canplaythrough")),b.readyState=a},u=function(b){b.seeking&&Math.abs(b.currentTime-b._lastSeektime)<2&&(b.seeking=!1,a(b._elem).triggerHandler("seeked"))};g.jarisEvent={};var v,w={onPlayPause:function(a,b,c){var d,e;if(null==c)try{d=b.api.api_get("isPlaying")}catch(f){}else d=c;d==b.paused&&(b.paused=!d,e=b.paused?"pause":"play",b._ppFlag=!0,r(b._elem,e),b.readyState<3&&t(3,b),b.paused||r(b._elem,"playing"))},onSeek:function(b,c){c._lastSeektime=b.seekTime,c.seeking=!0,a(c._elem).triggerHandler("seeking"),clearTimeout(c._seekedTimer),c._seekedTimer=setTimeout(function(){u(c),c.seeking=!1},300)},onConnectionFailed:function(){b.error("media error")},onNotBuffering:function(a,b){t(3,b)},onDataInitialized:function(a,b){var c,d=b.duration;b.duration=a.duration,d==b.duration||isNaN(b.duration)||b._calledMeta&&(c=Math.abs(b.lastDuration-b.duration))<2||(b.videoHeight=a.height,b.videoWidth=a.width,b.networkState||(b.networkState=2),b.readyState<1&&t(1,b),clearTimeout(b._durationChangeTimer),b._calledMeta&&b.duration?b._durationChangeTimer=setTimeout(function(){b.lastDuration=b.duration,r(b._elem,"durationchange")},c>50?0:c>9?9:99):(b.lastDuration=b.duration,b.duration&&r(b._elem,"durationchange"),b._calledMeta||r(b._elem,"loadedmetadata")),b._calledMeta=!0)},onBuffering:function(a,b){b.ended&&(b.ended=!1),t(1,b),r(b._elem,"waiting")},onTimeUpdate:function(a,b){b.ended&&(b.ended=!1),b.readyState<3&&(t(3,b),r(b._elem,"playing")),b.seeking&&u(b),r(b._elem,"timeupdate")},onProgress:function(b,c){if(c.ended&&(c.ended=!1),c.duration&&!isNaN(c.duration)){var d=b.loaded/b.total;d>.02&&.2>d?t(3,c):d>.2&&(d>.99&&(c.networkState=1),t(4,c)),c._bufferedEnd&&c._bufferedEnd>d&&(c._bufferedStart=c.currentTime||0),c._bufferedEnd=d,c.buffered.length=1,a.event.trigger("progress",e,c._elem,!0)}},onPlaybackFinished:function(a,b){b.readyState<4&&t(4,b),b.ended=!0,r(b._elem,"ended")},onVolumeChange:function(a,b){(b.volume!=a.volume||b.muted!=a.mute)&&(b.volume=a.volume,b.muted=a.mute,r(b._elem,"volumechange"))},ready:function(){var c=function(a){var b=!0;try{a.api.api_get("volume")}catch(c){b=!1}return b};return function(d,e){var f=0,g=function(){return f>9?(e.tryedReframeing=0,void 0):(f++,e.tryedReframeing++,c(e)?(e.wasSwfReady=!0,e.tryedReframeing=0,y(e),x(e)):e.tryedReframeing<6?e.tryedReframeing<3?(e.reframeTimer=setTimeout(g,9),e.shadowElem.css({overflow:"visible"}),setTimeout(function(){e.shadowElem.css({overflow:"hidden"})},1)):(e.shadowElem.css({overflow:"hidden"}),a(e._elem).mediaLoad()):(clearTimeout(e.reframeTimer),b.error("reframing error")),void 0)};e&&e.api&&(e.tryedReframeing||(e.tryedReframeing=0),clearTimeout(v),clearTimeout(e.reframeTimer),e.shadowElem.removeClass("flashblocker-assumed"),f?e.reframeTimer=setTimeout(g,9):g())}}()};w.onMute=w.onVolumeChange;var x=function(a){var c,d=a.actionQueue.length,e=0;if(d&&"third"==a.isActive)for(;a.actionQueue.length&&d>e;){e++,c=a.actionQueue.shift();try{a.api[c.fn].apply(a.api,c.args)}catch(f){b.warn(f)}}a.actionQueue.length&&(a.actionQueue=[])},y=function(b){b&&((b._ppFlag===e&&a.prop(b._elem,"autoplay")||!b.paused)&&setTimeout(function(){if("third"==b.isActive&&(b._ppFlag===e||!b.paused))try{a(b._elem).play(),b._ppFlag=!0}catch(c){}},1),b.muted&&a.prop(b._elem,"muted",!0),1!=b.volume&&a.prop(b._elem,"volume",b.volume))},z=a.noop;if(i){var A={play:1,playing:1},B=["play","pause","playing","canplay","progress","waiting","ended","loadedmetadata","durationchange","emptied"],C=B.map(function(a){return a+".webshimspolyfill"}).join(" "),D=function(c){var d=b.data(c.target,"mediaelement");if(d){var e=c.originalEvent&&c.originalEvent.type===c.type;e==("third"==d.activating)&&(c.stopImmediatePropagation(),A[c.type]&&(d.isActive!=d.activating?a(c.target).pause():e&&(a.prop(c.target,"pause")._supvalue||a.noop).apply(c.target)))}};z=function(c){a(c).off(C).on(C,D),B.forEach(function(a){b.moveToFirstEvent(c,a)})},z(d)}g.setActive=function(c,d,e){if(e||(e=b.data(c,"mediaelement")),e&&e.isActive!=d){"html5"!=d&&"third"!=d&&b.warn("wrong type for mediaelement activating: "+d);var f=b.data(c,"shadowData");e.activating=d,a(c).pause(),e.isActive=d,"third"==d?(f.shadowElement=f.shadowFocusElement=e.shadowElem[0],a(c).addClass("swf-api-active nonnative-api-active").hide().getShadowElement().show()):(a(c).removeClass("swf-api-active nonnative-api-active").show().getShadowElement().hide(),f.shadowElement=f.shadowFocusElement=!1),a(c).trigger("mediaelementapichange")}};var E=function(){var a=["_calledMeta","lastDuration","_bufferedEnd","_bufferedStart","_ppFlag","currentSrc","currentTime","duration","ended","networkState","paused","seeking","videoHeight","videoWidth"],b=a.length;return function(c){if(c){clearTimeout(c._seekedTimer);var d=b,e=c.networkState;for(t(0,c),clearTimeout(c._durationChangeTimer);--d>-1;)delete c[a[d]];c.actionQueue=[],c.buffered.length=0,e&&r(c._elem,"emptied")}}}(),F=function(){var b={},e=function(c){var e,f,g;return b[c.currentSrc]?e=b[c.currentSrc]:c.videoHeight&&c.videoWidth?(b[c.currentSrc]={width:c.videoWidth,height:c.videoHeight},e=b[c.currentSrc]):(f=a.attr(c._elem,"poster"))&&(e=b[f],e||(g=d.createElement("img"),g.onload=function(){b[f]={width:this.width,height:this.height},b[f].height&&b[f].width?G(c,a.prop(c._elem,"controls")):delete b[f],g.onload=null},g.src=f,g.complete&&g.onload&&g.onload())),e||{width:300,height:"video"==c._elemNodeName?150:50}},f=function(a,b){return a.style[b]||a.currentStyle&&a.currentStyle[b]||c.getComputedStyle&&(c.getComputedStyle(a,null)||{})[b]||""},g=["minWidth","maxWidth","minHeight","maxHeight"],h=function(a,b){var c,d,e=!1;for(c=0;4>c;c++)d=f(a,g[c]),parseFloat(d,10)&&(e=!0,b[g[c]]=d);return e},i=function(b){var c,d,g=b._elem,i={width:"auto"==f(g,"width"),height:"auto"==f(g,"height")},j={width:!i.width&&a(g).width(),height:!i.height&&a(g).height()};return(i.width||i.height)&&(c=e(b),d=c.width/c.height,i.width&&i.height?(j.width=c.width,j.height=c.height):i.width?j.width=j.height*d:i.height&&(j.height=j.width/d),h(g,j)&&(b.shadowElem.css(j),i.width&&(j.width=b.shadowElem.height()*d),i.height&&(j.height=(i.width?j.width:b.shadowElem.width())/d),i.width&&i.height&&(b.shadowElem.css(j),j.height=b.shadowElem.width()/d,j.width=j.height*d,b.shadowElem.css(j),j.width=b.shadowElem.height()*d,j.height=j.width/d),Modernizr.video||(j.width=b.shadowElem.width(),j.height=b.shadowElem.height()))),j};return i}(),G=function(b,c){var d,e=b.shadowElem;a(b._elem)[c?"addClass":"removeClass"]("webshims-controls"),("third"==b.isActive||"third"==b.activating)&&("audio"!=b._elemNodeName||c?(b._elem.style.display="",d=F(b),b._elem.style.display="none",e.css(d)):e.css({width:0,height:0}))},H=function(){var b={"":1,auto:1};return function(c){var d=a.attr(c,"preload");return null==d||"none"==d||a.prop(c,"autoplay")?!1:(d=a.prop(c,"preload"),!!(b[d]||"metadata"==d&&a(c).is(".preload-in-doubt, video:not([poster])")))}}(),I={A:/&amp;/g,a:/&/g,e:/\=/g,q:/\?/g},J=function(a){return a.replace?a.replace(I.A,"%26").replace(I.a,"%26").replace(I.e,"%3D").replace(I.q,"%3F"):a};if("matchMedia"in c){var K=!1;try{K=c.matchMedia("only all").matches}catch(L){}K&&(g.sortMedia=function(a,b){try{a=!a.media||matchMedia(a.media).matches,b=!b.media||matchMedia(b.media).matches}catch(c){return 0}return a==b?0:a?-1:1})}g.createSWF=function(c,e,l){if(!j)return setTimeout(function(){a(c).mediaLoad()},1),void 0;var m={};1>k?k=1:k++,l||(l=b.data(c,"mediaelement")),((m.height=a.attr(c,"height")||"")||(m.width=a.attr(c,"width")||""))&&(a(c).css(m),b.warn("width or height content attributes used. Webshims prefers the usage of CSS (computed styles or inline styles) to detect size of a video/audio. It's really more powerfull."));var n,o="audio/rtmp"==e.type||"video/rtmp"==e.type,q=a.extend({},f.vars,{poster:J(a.attr(c,"poster")&&a.prop(c,"poster")||""),source:J(e.streamId||e.srcProp),server:J(e.server||"")}),r=a(c).data("vars")||{},t=a.prop(c,"controls"),u="jarisplayer-"+b.getID(c),x=a.extend({},f.params,a(c).data("params")),y=c.nodeName.toLowerCase(),A=a.extend({},f.attrs,{name:u,id:u},a(c).data("attrs")),B=function(){"third"==l.isActive&&G(l,a.prop(c,"controls"))};return l&&l.swfCreated?(g.setActive(c,"third",l),l.currentSrc=e.srcProp,l.shadowElem.html('<div id="'+u+'">'),l.api=!1,l.actionQueue=[],n=l.shadowElem,E(l)):(a(d.getElementById("wrapper-"+u)).remove(),n=a('<div class="polyfill-'+y+' polyfill-mediaelement" id="wrapper-'+u+'"><div id="'+u+'"></div>').css({position:"relative",overflow:"hidden"}),l=b.data(c,"mediaelement",b.objectCreate(p,{actionQueue:{value:[]},shadowElem:{value:n},_elemNodeName:{value:y},_elem:{value:c},currentSrc:{value:e.srcProp},swfCreated:{value:!0},id:{value:u.replace(/-/g,"")},buffered:{value:{start:function(a){return a>=l.buffered.length?(b.error("buffered index size error"),void 0):0},end:function(a){return a>=l.buffered.length?(b.error("buffered index size error"),void 0):(l.duration-l._bufferedStart)*l._bufferedEnd+l._bufferedStart},length:0}}})),n.insertBefore(c),i&&a.extend(l,{volume:a.prop(c,"volume"),muted:a.prop(c,"muted")}),b.addShadowDom(c,n),b.data(c,"mediaelement")||b.data(c,"mediaelement",l),z(c),g.setActive(c,"third",l),G(l,t),a(c).on({"updatemediaelementdimensions loadedmetadata emptied":B,remove:function(a){!a.originalEvent&&g.jarisEvent[l.id]&&g.jarisEvent[l.id].elem==c&&(delete g.jarisEvent[l.id],clearTimeout(v),clearTimeout(l.flashBlock))}}).onWSOff("updateshadowdom",B)),g.jarisEvent[l.id]&&g.jarisEvent[l.id].elem!=c?(b.error("something went wrong"),void 0):(g.jarisEvent[l.id]||(g.jarisEvent[l.id]=function(a){if("ready"==a.type){var b=function(){l.api&&(H(c)&&l.api.api_preload(),w.ready(a,l))};l.api?b():setTimeout(b,9)}else l.currentTime=a.position,l.api&&(!l._calledMeta&&isNaN(a.duration)&&l.duration!=a.duration&&isNaN(l.duration)&&w.onDataInitialized(a,l),l._ppFlag||"onPlayPause"==a.type||w.onPlayPause(a,l),w[a.type]&&w[a.type](a,l)),l.duration=a.duration},g.jarisEvent[l.id].elem=c),a.extend(q,{id:u,evtId:l.id,controls:""+t,autostart:"false",nodename:y},r),o?q.streamtype="rtmp":"audio/mpeg"==e.type||"audio/mp3"==e.type?(q.type="audio",q.streamtype="file"):"video/youtube"==e.type&&(q.streamtype="youtube"),f.changeSWF(q,c,e,l,"embed"),clearTimeout(l.flashBlock),h.embedSWF(s,u,"100%","100%","9.0.115",!1,q,x,A,function(d){if(d.success){var e=function(){(!d.ref.parentNode&&n[0].parentNode||"none"==d.ref.style.display)&&(n.addClass("flashblocker-assumed"),a(c).trigger("flashblocker"),b.warn("flashblocker assumed")),a(d.ref).css({minHeight:"2px",minWidth:"2px",display:"block"})};l.api=d.ref,t||a(d.ref).attr("tabindex","-1").css("outline","none"),l.flashBlock=setTimeout(e,99),v||(clearTimeout(v),v=setTimeout(function(){e();var c=a(d.ref);c[0].offsetWidth>1&&c[0].offsetHeight>1&&0===location.protocol.indexOf("file:")?b.error("Add your local development-directory to the local-trusted security sandbox: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html"):(c[0].offsetWidth<2||c[0].offsetHeight<2)&&b.warn("JS-SWF connection can't be established on hidden or unconnected flash objects"),c=null},8e3))}}),void 0)};var M=function(a,b,c,d){return d=d||q(a),d?(d.api&&d.api[b]?d.api[b].apply(d.api,c||[]):(d.actionQueue.push({fn:b,args:c}),d.actionQueue.length>10&&setTimeout(function(){d.actionQueue.length>5&&d.actionQueue.shift()},99)),d):!1};if(["audio","video"].forEach(function(c){var d,e={},f=function(a){("audio"!=c||"videoHeight"!=a&&"videoWidth"!=a)&&(e[a]={get:function(){var b=q(this);return b?b[a]:i&&d[a].prop._supget?d[a].prop._supget.apply(this):p[a]},writeable:!1})},g=function(a,b){f(a),delete e[a].writeable,e[a].set=b};g("seeking"),g("volume",function(a){var c=q(this);if(c)a*=1,isNaN(a)||((0>a||a>1)&&b.error("volume greater or less than allowed "+a/100),M(this,"api_volume",[a],c),c.volume!=a&&(c.volume=a,r(c._elem,"volumechange")),c=null);else if(d.volume.prop._supset)return d.volume.prop._supset.apply(this,arguments)}),g("muted",function(a){var b=q(this);if(b)a=!!a,M(this,"api_muted",[a],b),b.muted!=a&&(b.muted=a,r(b._elem,"volumechange")),b=null;else if(d.muted.prop._supset)return d.muted.prop._supset.apply(this,arguments)}),g("currentTime",function(a){var b=q(this);if(b)a*=1,isNaN(a)||M(this,"api_seek",[a],b);else if(d.currentTime.prop._supset)return d.currentTime.prop._supset.apply(this,arguments)}),["play","pause"].forEach(function(a){e[a]={value:function(){var b=q(this);if(b)b.stopPlayPause&&clearTimeout(b.stopPlayPause),M(this,"play"==a?"api_play":"api_pause",[],b),b._ppFlag=!0,b.paused!=("play"!=a)&&(b.paused="play"!=a,r(b._elem,a));else if(d[a].prop._supvalue)return d[a].prop._supvalue.apply(this,arguments)}}}),n.forEach(f),b.onNodeNamesPropertyModify(c,"controls",function(b,d){var e=q(this);a(this)[d?"addClass":"removeClass"]("webshims-controls"),e&&("audio"==c&&G(e,d),M(this,"api_controls",[d],e))}),b.onNodeNamesPropertyModify(c,"preload",function(){var c,d,e;H(this)&&(c=q(this),c?M(this,"api_preload",[],c):!l||!this.paused||this.error||a.data(this,"mediaerror")||this.readyState||this.networkState||this.autoplay||!a(this).is(":not(.nonnative-api-active)")||(e=this,d=b.data(e,"mediaelementBase")||b.data(e,"mediaelementBase",{}),clearTimeout(d.loadTimer),d.loadTimer=setTimeout(function(){a(e).mediaLoad()},9)))}),d=b.defineNodeNameProperties(c,e,"prop"),Modernizr.mediaDefaultMuted||b.defineNodeNameProperties(c,{defaultMuted:{get:function(){return null!=a.attr(this,"muted")},set:function(b){b?a.attr(this,"muted",""):a(this).removeAttr("muted")}}},"prop")}),j&&a.cleanData){var N=a.cleanData,O={object:1,OBJECT:1};a.cleanData=function(a){var b,c;if(a&&(c=a.length)&&k)for(b=0;c>b;b++)if(O[a[b].nodeName]&&"api_pause"in a[b]){k--;try{a[b].api_pause()}catch(d){}}return N.apply(this,arguments)}}i?"media"in d.createElement("source")||b.reflectProperties("source",["media"]):(["poster","src"].forEach(function(a){b.defineNodeNamesProperty("src"==a?["audio","video","source"]:["video"],a,{reflect:!0,propType:"src"})}),b.defineNodeNamesProperty(["audio","video"],"preload",{reflect:!0,propType:"enumarated",defaultValue:"",limitedTo:["","auto","metadata","none"]}),b.reflectProperties("source",["type","media"]),["autoplay","controls"].forEach(function(a){b.defineNodeNamesBooleanProperty(["audio","video"],a)}),b.defineNodeNamesProperties(["audio","video"],{HAVE_CURRENT_DATA:{value:2},HAVE_ENOUGH_DATA:{value:4},HAVE_FUTURE_DATA:{value:3},HAVE_METADATA:{value:1},HAVE_NOTHING:{value:0},NETWORK_EMPTY:{value:0},NETWORK_IDLE:{value:1},NETWORK_LOADING:{value:2},NETWORK_NO_SOURCE:{value:3}},"prop")),f.experimentallyMimetypeCheck&&!function(){var b=a.fn.addBack?"addBack":"andSelf",c=function(){var c,d="media/unknown please provide mime type",e=a(this),f=[];e.not(".ws-after-check").find("source")[b]().filter("[data-wsrecheckmimetype]:not([type])").each(function(){var b=a(this).removeAttr("data-wsrecheckmimetype"),e=function(){b.attr("data-type",d)};try{f.push(a.ajax({type:"head",url:a.attr(this,"src"),success:function(a,e,f){var g=f.getResponseHeader("Content-Type");g&&(c=!0),b.attr("data-type",g||d)},error:e}))}catch(g){e()}}),f.length&&(e.addClass("ws-after-check"),a.when.apply(a,f).always(function(){e.mediaLoad(),setTimeout(function(){e.removeClass("ws-after-check")},9)}))};a("audio.media-error, video.media-error").each(c),a(d).on("mediaerror",function(a){c.call(a.target)})}()});
nolsherry/cdnjs
ajax/libs/webshim/1.12.0/minified/shims/mediaelement-jaris.js
JavaScript
mit
16,872
<!doctype html> <html lang="en-gb"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="robots" content="noindex, nofollow"> <!--[if lt IE 9]> <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script> <![endif]--> <title>Ipswich Mobile Library Route 10 &#8211; Suffolk Libraries</title> <link rel="stylesheet" href="/css/style.css"> <link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-regular.woff2"> <link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-italic.woff2"> <link rel="preload" as="font" type="font/woff2" href="/fonts/source-sans-pro-v11-latin-700.woff2"> </head> <body class="custom-sans-serif lh-copy dark-gray bg-moon-gray"> <ul class="clip"> <li><a href="#content">Skip to content</a></li> <li><a href="#footer-nav">Skip to navigation menu</a></li> </ul> <div class="bg-black white pa2 ph3-ns"> <div class="custom-max-width"> <p class="f6 ma0 custom-lh-title"><span role='image' aria-label='Debit card' class='pr1'>๐Ÿ’ณ</span> You can now pay online. <a href=" https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/MSGTRN/OPAC/LOGINB?RDT=/SpydusCitizenPay/default.aspx " class="underline lightest-blue"> Pay charges now &rarr; </a></p> </div> </div> <header id="site-header" class="custom-lh-title"> <div class="bg-white dark-gray ph2 ph3-ns pt2 pt3-ns"> <div class="custom-max-width flex"> <div class="w-30"> <a href="/"><img src="/images/logos/sl.svg" class="v-btm w3 w4-ns" alt="Suffolk Libraries"></a> </div> <div class="w-70 flex justify-end items-center"> <div><a href="/support-us/" class="dib blue pv1 pv2-ns f7 f6-ns pr2">Donate</a></div> <div><a href="/help/joining-the-library/" class="dib custom-icon custom-icon-card blue pv1 pv2-ns f7 f6-ns">Join</a></div> <div><a href="https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/MSGTRN/OPAC/LOGINB" class="dib custom-icon custom-icon-lock blue pv1 pv2-ns ml2 f7 f6-ns">Login</a></div> <div><a href="/search-form/" class="dib custom-icon custom-icon-search blue ml2 pv1 pv2-ns f7 f6-ns">Search</a></div> </div> </div> </div> <div class="custom-bg-corporate white ph2 ph3-ns bb b--white"> <div class="custom-max-width"> <ul class="ma0 pa0 list f6"> <li class="dib mr2 mr3-l"><a href="/" class="white underline db pv2">Home</a></li> <li class="dib mr2 mr3-l"><a href="/elibrary/" class="white underline db pv2">eLibrary</a></li> <li class="dib mr2 mr3-l"><a href="/events-activities/online-and-streamed-events/" class="white underline db pv2">Online events</a></li> <li class="dib mr2 mr3-l"><a href="/help/" class="white underline db pv2">Help</a></li> <li class="dib mr2 mr3-l"><a href="/contact/" class="white underline db pv2">Contact</a></li> <!-- <li class="dib mr2 mr3-l"><a href="/about/" class="white underline db pv2">About</a></li> <li class="dib"><a class="white underline db pv2" href="/support-us/">Donate</a></li> --> </ul> </div> </div> </header> <div class="pv2 pv3-ns cf custom-max-width "> <main id="content" class="bg-white pa2 pa5-ns pv4-ns cf mb2 border-box b--light-gray " role="main"> <div class="pa2 ph3-ns bg-white ba b--light-gray custom-underline f6"> <a class="blue underline" href="/">Home</a> โ†’ <a class="blue underline" href="/mobiles-home/">Mobiles home</a> โ†’ Ipswich Mobile Library Route 10 </div> <div class="custom-narrow-width"> <header class="mt3"> <h1 class="custom-lh-title f2 pa0 ma0 mb3 ">Ipswich Mobile Library Route 10</h1> </header> <div class="lh-copy custom-hyphens custom-prose custom-visited custom-underline"> <h2 id="contact-us">Contact us:</h2> <p>Managers:ย Andrew Little and David Cook</p> <p>Email:ย <a href="mailto:help@suffolklibraries.co.uk?subject=Mobile%20library%20enquiry">help@suffolklibraries.co.uk</a></p> <p>Telephone:ย 01473 351249</p> <h2 id="route-timetable">Route timetable</h2> <table class="pure-table"> <tr> <td valign="bottom" width="74"> <strong>Route 10</strong> </td> <td valign="bottom" width="161"> <strong>Town/village</strong> </td> <td valign="bottom" width="169"> <strong>Location</strong> </td> <td valign="bottom" width="103"> <strong>Time</strong> </td> </tr> <tr> <td valign="bottom" width="74"> 10A </td> <td valign="bottom" width="161"> Rushmere St Andrew </td> <td valign="bottom" width="169"> Claverton Way </td> <td valign="bottom" width="103"> 0925 &#8211; 0940 </td> </tr> <tr> <td valign="bottom" width="74"> 10B </td> <td valign="bottom" width="161"> Rushmere St Andrew </td> <td valign="bottom" width="169"> Bixley Drive </td> <td valign="bottom" width="103"> 0945 &#8211; 1000 </td> </tr> <tr> <td valign="bottom" width="74"> 10C </td> <td valign="bottom" width="161"> Rushmere St Andrew </td> <td valign="bottom" width="169"> Broadlands Way </td> <td valign="bottom" width="103"> 1005 &#8211; 1030 </td> </tr> <tr> <td valign="bottom" width="74"> 10D </td> <td valign="bottom" width="161"> Rushmere St Andrew </td> <td valign="bottom" width="169"> Foxhall Road, Heathlands Park </td> <td valign="bottom" width="103"> 1035 &#8211; 1055 </td> </tr> <tr> <td valign="bottom" width="74"> 10E </td> <td valign="bottom" width="161"> Ipswich </td> <td valign="bottom" width="169"> Penshurst Road </td> <td valign="bottom" width="103"> 1100 &#8211; 1200 </td> </tr> <tr> <td valign="bottom" width="74"> 10F </td> <td valign="bottom" width="161"> Rushmere St Andrew </td> <td valign="bottom" width="169"> Bucklesham Road </td> <td valign="bottom" width="103"> 1210 &#8211; 1220 </td> </tr> <tr> <td valign="bottom" width="74"> 10G </td> <td valign="bottom" width="161"> Martlesham </td> <td valign="bottom" width="169"> Angela Close </td> <td valign="bottom" width="103"> 1330 &#8211; 1345 </td> </tr> <tr> <td valign="bottom" width="74"> 10H </td> <td valign="bottom" width="161"> Martlesham </td> <td valign="bottom" width="169"> Bridge Farm Day Nursery </td> <td valign="bottom" width="103"> 1350 &#8211; 1420 </td> </tr> <tr> <td valign="bottom" width="74"> 10I </td> <td valign="bottom" width="161"> Martlesham </td> <td valign="bottom" width="169"> Falcon Mobile Home Park </td> <td valign="bottom" width="103"> 1430 &#8211; 1455 </td> </tr> <tr> <td valign="bottom" width="74"> 10J </td> <td valign="bottom" width="161"> Martlesham Heath </td> <td valign="bottom" width="169"> Douglas Bader </td> <td valign="bottom" width="103"> 1500 &#8211; 1630 </td> </tr> </table> <p><strong>Calling every 4 weeks on Tuesdays:</strong></p> <p><strong>2020:</strong> 21 January, 18 February, 17 March, 14 April, 12 May, 9 June, 7 July, 4 August, 1 September, 29 September, 27 October, 24 November, 22 December</p> <p><strong>2021:</strong> 19 January</p> </div> </div> </main> </div> <footer id="footer" class="pa2 pt3 pa3-ns pt4-ns bg-near-black white custom-underline"> <div class="custom-max-width"> <div class="flex-l justify-between-l"> <div class="w-30-l mb4 f6"> <section class="pb4"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Do it online</h2> <ul class="list pa0 ma0"> <li class="mb2 mb1-ns"><a href="https://suffolk.spydus.co.uk" class="link light-gray hover-white">Search &amp; reserve</a></li> <li class="mb2 mb1-ns"><a href="https://suffolk.spydus.co.uk/cgi-bin/spydus.exe/MSGTRN/OPAC/LOGINB" class="link light-gray hover-white">Login &amp; renew</a></li> <li class="mb2 mb1-ns"><a class="link light-gray hover-white" href="/elibrary">eLibrary</a></li> <li class="mb2 mb1-ns"><a href="/help/joining-the-library/" class="link light-gray hover-white">Get a library card</a></li> </ul> </section> <section class="pb4"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Support your library</h2> <p>We're a charity that makes life in Suffolk better for thousands of people.</p> <p class="ma0"><a class="b pa1 br2 custom-bg-corporate-green hover-bg-green white custom-no-underline" href="/support-us">Donate</a></p> </section> </div> <div class="w-30-l mb4 f6"> <section class="pb4"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Contact us</h2> <ul class="list pa0 ma0"> <li class="mb2 mb1-ns"><a href="tel:01473351249" class="link light-gray hover-white">01473 351249</a></li> <li class="mb2 mb1-ns"><a href="mailto:help@suffolklibraries.co.uk" class="link light-gray hover-white">help@suffolklibraries.co.uk</a></li> </ul> </section> <section class="pb4"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Social media</h2> <ul class="list pa0 ma0"> <li class="mb2 mb1-ns"><a href="http://facebook.com/suffolklibraries" class="link light-gray hover-white">Facebook</a></li> <li class="mb2 mb1-ns"><a href="https://www.youtube.com/user/SuffolkLibraries/" class="link light-gray hover-white">YouTube</a></li> <li class="mb2 mb1-ns"><a href="http://twitter.com/suffolklibrary" class="link light-gray hover-white">Twitter</a></li> <li class="mb2 mb1-ns"><a href="https://instagram.com/suffolklibraries" class="link light-gray hover-white">Instagram</a></li> <li class="mb2 mb1-ns"><a href="https://www.linkedin.com/company/suffolk-libraries/" class="link light-gray hover-white">LinkedIn</a></li> <li class="mb2 mb1-ns"><a href="/newsletter" class="link light-gray hover-white">Email newsletter</a></li> </ul> </section> </div> <div class="w-30-l mb4 f6"> <nav class="pb4" id="footer-nav"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Sections</h2> <ul class="list pa0 ma0"> <li class="mb2 mb1-ns"><a href="/elibrary/" class="link light-gray hover-white">eLibrary</a></li> <li class="mb2 mb1-ns"><a href="/libraries/" class="link light-gray hover-white">Libraries</a></li> <li class="mb2 mb1-ns"><a href="/mobiles-home/" class="link light-gray hover-white">Mobile &amp; home service</a></li> <li class="mb2 mb1-ns"><a href="/help/" class="link light-gray hover-white">Help using the service</a></li> <li class="mb2 mb1-ns"><a href="/new-suggestions/" class="link light-gray hover-white">Recommendations &amp; reviews</a></li> <li class="mb2 mb1-ns"><a href="/events-activities/" class="link light-gray hover-white">Events &amp; activities</a></li> <li class="mb2 mb1-ns"><a href="/research-and-reference/" class="link light-gray hover-white">Research &amp; reference</a></li> <li class="mb2 mb1-ns"><a href="/parents-carers-and-children/" class="link light-gray hover-white">Parents, carers &amp; children</a></li> <li class="mb2 mb1-ns"><a href="/teachers-and-home-educators/" class="link light-gray hover-white">Teachers &amp; home educators</a></li> <li class="mb2 mb1-ns"><a href="/health/" class="link light-gray hover-white">Health &amp; wellbeing</a></li> <li class="mb2 mb1-ns"><a href="/help-with-reading-and-literacy/" class="link light-gray hover-white">Help with reading &amp; literacy</a></li> <li class="mb2 mb1-ns"><a href="/work-and-benefits/" class="link light-gray hover-white">Work &amp; benefits</a></li> <li class="mb2 mb1-ns"><a href="/business-and-room-hire/" class="link light-gray hover-white">Business &amp; room hire</a></li> <li class="mb2 mb1-ns"><a href="/bloc/" class="link light-gray hover-white">BLOC</a></li> <li class="mb2 mb1-ns"><a href="/music-and-drama/" class="link light-gray hover-white">Music &amp; Drama Library</a></li> <li class="mb2 mb1-ns"><a href="/news/" class="link light-gray hover-white">News</a></li> <li class="mb2 mb1-ns"><a href="/about/jobs/" class="link light-gray hover-white">Jobs</a></li> <li class="mb2 mb1-ns"><a href="/volunteer/" class="link light-gray hover-white">Volunteering</a></li> <li class="mb2 mb1-ns"><a href="/about/" class="link light-gray hover-white">About us</a></li> </ul> </nav> </div> </div> <section class="pb4 f6"> <h2 class="f6 f5-ns pa0 ma0 mb2 tracked ttu normal ">Privacy &amp; cookies</h2> <ul class="list pa0 ma0"> <li class="mb2 mb1-ns">Find out what cookies we use and how we use your data: <a href="/help/privacy-and-cookies/" class="light-gray underline hover-white">our privacy policies</a>.</li> <li class="mb2 mb1-ns"><a href="/about/jobs/privacy-notice-for-job-applicants/" class="light-gray underline hover-white">Privacy notice for job applicants</a></li> </ul> </section> <div class="pb4 f6"> <p class="ma0 light-gray">Suffolk Libraries HMRC charity number XT34476. Registered company number IP031542.</p> </div> </div> </footer> </body> </html>
suffolklibraries/sljekyll
_site/mobiles-home/ipswich-mobile-library-route-10/index.html
HTML
mit
15,429
/*! * jQuery Smooth Scroll - v1.7.2 - 2016-01-23 * https://github.com/kswedberg/jquery-smooth-scroll * Copyright (c) 2016 Karl Swedberg * Licensed MIT */ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS factory(require('jquery')); } else { // Browser globals factory(jQuery); } }(function($) { var version = '1.7.2'; var optionOverrides = {}; var defaults = { exclude: [], excludeWithin: [], offset: 0, // one of 'top' or 'left' direction: 'top', // if set, bind click events through delegation // supported since jQuery 1.4.2 delegateSelector: null, // jQuery set of elements you wish to scroll (for $.smoothScroll). // if null (default), $('html, body').firstScrollable() is used. scrollElement: null, // only use if you want to override default behavior scrollTarget: null, // fn(opts) function to be called before scrolling occurs. // `this` is the element(s) being scrolled beforeScroll: function() {}, // fn(opts) function to be called after scrolling occurs. // `this` is the triggering element afterScroll: function() {}, easing: 'swing', speed: 400, // coefficient for "auto" speed autoCoefficient: 2, // $.fn.smoothScroll only: whether to prevent the default click action preventDefault: true }; var getScrollable = function(opts) { var scrollable = []; var scrolled = false; var dir = opts.dir && opts.dir === 'left' ? 'scrollLeft' : 'scrollTop'; this.each(function() { var el = $(this); if (this === document || this === window) { return; } if (document.scrollingElement && (this === document.documentElement || this === document.body)) { scrollable.push(document.scrollingElement); return false; } if (el[dir]() > 0) { scrollable.push(this); } else { // if scroll(Top|Left) === 0, nudge the element 1px and see if it moves el[dir](1); scrolled = el[dir]() > 0; if (scrolled) { scrollable.push(this); } // then put it back, of course el[dir](0); } }); if (!scrollable.length) { this.each(function() { // If no scrollable elements and <html> has scroll-behavior:smooth because // "When this property is specified on the root element, it applies to the viewport instead." // and "The scroll-behavior property of the โ€ฆ body element is *not* propagated to the viewport." // โ†’ https://drafts.csswg.org/cssom-view/#propdef-scroll-behavior if (this === document.documentElement && $(this).css('scrollBehavior') === 'smooth') { scrollable = [this]; } // If still no scrollable elements, fall back to <body>, // if it's in the jQuery collection // (doing this because Safari sets scrollTop async, // so can't set it to 1 and immediately get the value.) if (!scrollable.length && this.nodeName === 'BODY') { scrollable = [this]; } }); } // Use the first scrollable element if we're calling firstScrollable() if (opts.el === 'first' && scrollable.length > 1) { scrollable = [scrollable[0]]; } return scrollable; }; $.fn.extend({ scrollable: function(dir) { var scrl = getScrollable.call(this, {dir: dir}); return this.pushStack(scrl); }, firstScrollable: function(dir) { var scrl = getScrollable.call(this, {el: 'first', dir: dir}); return this.pushStack(scrl); }, smoothScroll: function(options, extra) { options = options || {}; if (options === 'options') { if (!extra) { return this.first().data('ssOpts'); } return this.each(function() { var $this = $(this); var opts = $.extend($this.data('ssOpts') || {}, extra); $(this).data('ssOpts', opts); }); } var opts = $.extend({}, $.fn.smoothScroll.defaults, options); var clickHandler = function(event) { var escapeSelector = function(str) { return str.replace(/(:|\.|\/)/g, '\\$1'); }; var link = this; var $link = $(this); var thisOpts = $.extend({}, opts, $link.data('ssOpts') || {}); var exclude = opts.exclude; var excludeWithin = thisOpts.excludeWithin; var elCounter = 0; var ewlCounter = 0; var include = true; var clickOpts = {}; var locationPath = $.smoothScroll.filterPath(location.pathname); var linkPath = $.smoothScroll.filterPath(link.pathname); var hostMatch = location.hostname === link.hostname || !link.hostname; var pathMatch = thisOpts.scrollTarget || (linkPath === locationPath); var thisHash = escapeSelector(link.hash); if (thisHash && !$(thisHash).length) { include = false; } if (!thisOpts.scrollTarget && (!hostMatch || !pathMatch || !thisHash)) { include = false; } else { while (include && elCounter < exclude.length) { if ($link.is(escapeSelector(exclude[elCounter++]))) { include = false; } } while (include && ewlCounter < excludeWithin.length) { if ($link.closest(excludeWithin[ewlCounter++]).length) { include = false; } } } if (include) { if (thisOpts.preventDefault) { event.preventDefault(); } $.extend(clickOpts, thisOpts, { scrollTarget: thisOpts.scrollTarget || thisHash, link: link }); $.smoothScroll(clickOpts); } }; if (options.delegateSelector !== null) { this .undelegate(options.delegateSelector, 'click.smoothscroll') .delegate(options.delegateSelector, 'click.smoothscroll', clickHandler); } else { this .unbind('click.smoothscroll') .bind('click.smoothscroll', clickHandler); } return this; } }); $.smoothScroll = function(options, px) { if (options === 'options' && typeof px === 'object') { return $.extend(optionOverrides, px); } var opts, $scroller, scrollTargetOffset, speed, delta; var scrollerOffset = 0; var offPos = 'offset'; var scrollDir = 'scrollTop'; var aniProps = {}; var aniOpts = {}; if (typeof options === 'number') { opts = $.extend({link: null}, $.fn.smoothScroll.defaults, optionOverrides); scrollTargetOffset = options; } else { opts = $.extend({link: null}, $.fn.smoothScroll.defaults, options || {}, optionOverrides); if (opts.scrollElement) { offPos = 'position'; if (opts.scrollElement.css('position') === 'static') { opts.scrollElement.css('position', 'relative'); } } } scrollDir = opts.direction === 'left' ? 'scrollLeft' : scrollDir; if (opts.scrollElement) { $scroller = opts.scrollElement; if (!(/^(?:HTML|BODY)$/).test($scroller[0].nodeName)) { scrollerOffset = $scroller[scrollDir](); } } else { $scroller = $('html, body').firstScrollable(opts.direction); } // beforeScroll callback function must fire before calculating offset opts.beforeScroll.call($scroller, opts); scrollTargetOffset = (typeof options === 'number') ? options : px || ($(opts.scrollTarget)[offPos]() && $(opts.scrollTarget)[offPos]()[opts.direction]) || 0; aniProps[scrollDir] = scrollTargetOffset + scrollerOffset + opts.offset; speed = opts.speed; // automatically calculate the speed of the scroll based on distance / coefficient if (speed === 'auto') { // $scroller[scrollDir]() is position before scroll, aniProps[scrollDir] is position after // When delta is greater, speed will be greater. delta = Math.abs(aniProps[scrollDir] - $scroller[scrollDir]()); // Divide the delta by the coefficient speed = delta / opts.autoCoefficient; } aniOpts = { duration: speed, easing: opts.easing, complete: function() { opts.afterScroll.call(opts.link, opts); } }; if (opts.step) { aniOpts.step = opts.step; } if ($scroller.length) { $scroller.stop().animate(aniProps, aniOpts); } else { opts.afterScroll.call(opts.link, opts); } }; $.smoothScroll.version = version; $.smoothScroll.filterPath = function(string) { string = string || ''; return string .replace(/^\//, '') .replace(/(?:index|default).[a-zA-Z]{3,4}$/, '') .replace(/\/$/, ''); }; // default options $.fn.smoothScroll.defaults = defaults; }));
hackedison/hackedison.github.io
js/smooth-scroll.js
JavaScript
mit
9,098
/** * gulp-include-helper * https://github.com/Claud/gulp-include-helper * * Copyright (c) 2014 Shiryaev Andrey <grabzila@gmail.com> * The MIT license. */ 'use strict'; var through = require('through2'), glob = require('glob'), path = require('path'), replaceExt = require('replace-ext'), gutil = require('gulp-util'), fs = require('fs'), crypto = require('crypto'), mkdirp = require('mkdirp'), PluginError = gutil.PluginError; var PLUGIN_NAME = 'gulp-include-helper'; var PLACEHOLDERS = { 'js': '<script type="text/javascript" src="%filePath%"></script>', 'css': '<link rel="stylesheet" href="%filePath%">' }; var Concat = { defaultPathTemplates: '%basePath%/include-files/%type%/%groupName%.%type%', createFile: function(filePath, content, group) { filePath = filePath.replace(/%basePath%/ig, group.options.basePath); filePath = filePath.replace(/%type%/ig, group.type); filePath = filePath.replace(/%groupName%/ig, group.groupName); filePath = path.normalize(filePath); filePath = filePath.replace(/\\/g, '/'); console.log(filePath); var tmp = path.dirname(filePath); if (!fs.existsSync(tmp)) { mkdirp.sync(tmp, '0775'); } fs.writeFileSync(filePath, new Buffer(content)); return filePath; }, concat: function(files, group) { var buffer = []; files.forEach(function(filePath) { buffer.push(fs.readFileSync(filePath).toString()); }); var pathTemplates = group.options.concat.saveTo ? group.options.concat.saveTo : this.defaultPathTemplates; var separator = group.options.concat.separator !== undefined ? group.options.concat.separator : ''; return this.createFile(pathTemplates, buffer.join(separator), group); } }; var Parser = { baseRegexpStr: '<!--\\s+include-(css|js):([a-z-0-9\\-_]+)\\(([^)]+)\\)\\s+-->', endRegex: '<!-- \\/include-\\2:\\3 -->', parsingGroups: function(contents) { var regexStr = this.baseRegexpStr; var regex = new RegExp(regexStr, 'ig'); var matches = contents.match(regex); regex = new RegExp(regexStr, 'i'); var data = []; for (var i = 0; i < matches.length; i++) { var match = matches[i].match(regex); data.push({ type: match[1], groupName: match[2], options: JSON.parse(match[3]) }); } return data; }, include: function(contents, includeData, replace) { // Remove old include data. var regexStr = '(' + this.baseRegexpStr + ')[\\s\\S]*?' + this.endRegex + '\\n*'; var regex = new RegExp(regexStr, 'i'); //var matches = contents.match(regex); contents = contents.replace(regex, "$1"); //console.log(includeData); // Include new data. regexStr = this.baseRegexpStr; regex = new RegExp(regexStr, 'i'); if (replace) { contents = contents.replace(regex, includeData); } else { contents = contents.replace(regex, "$&\n" + includeData + "\n<!-- \\/include-$1:$2 -->\n\n"); } return contents; } }; function getIncludeFiles(source) { return glob.sync(source); } /** * Add md5 string (.v-{hash:9}) to file name, or query string (?_v={hash:9}). * * @param {string} filePath * @param {bool} addQueryString Default false. * @param {string} type Date or md5 (get md5 form file). Default: date. * @return {string} */ function resetCache(filePath, addQueryString, type) { try { var line = ''; var data = fs.readFileSync(filePath); var hash = ''; if (type == 'md5') { hash = crypto.createHash('md5'); hash.update(data.toString(), 'utf8'); hash = hash.digest('hex'); } else { hash = new Date().getTime(); } if (addQueryString) { line = filePath.replace(/(.+?)\.(min\.|)(css|js)$/i, '$1.$2$3?_v=' + hash.toString().substr(0, 9)); } else { line = filePath.replace(/(.+?)\.(min\.|)(css|js)$/i, '$1.v-' + hash.toString().substr(0, 9) + '.$2$3'); } } catch(err) { this.emit('error', new gutil.PluginError(PLUGIN_NAME, err)); } return line; } function injectFiles(file, options) { var contents = file.contents.toString(); var groups = Parser.parsingGroups(contents); //console.log(groups); groups.forEach(function(group) { var type = group.type; var options = group.options; var placeholder = options.template ? options.template : PLACEHOLDERS[type]; //options.basePath = path.resolve(options.basePath); options.basePath = options.basePath.replace(/\\/g, '/'); var filePath = options.basePath ? path.join(options.basePath, options.src) : options.src; var files = getIncludeFiles(filePath); var includesData = ''; if (placeholder && files && files.length > 0) { if (options.concat && options.concat.active) { var tmp = Concat.concat(files, group); files = tmp ? [tmp] : files; } includesData = files.map(function(filePath) { // Reset cache. if (options.cache && options.cache.active) { filePath = resetCache(filePath, options.cache.addQueryString, options.cache.type); } // Reset basePath to baseUri. if (options.baseUri && options.baseUri != options.basePath) { filePath = filePath.replace(options.basePath, options.baseUri); } return placeholder.replace('%filePath%', filePath); }).join('\n'); } contents = Parser.include(contents, includesData, options.removeThisComment); }); return contents; } module.exports = function(options) { options = options || {}; var stream = through.obj(function (file, enc, callback) { if (file.isNull()) { this.push(file); // Do nothing if no contents return callback(); } if (file.isStream()) { this.emit('error', new PluginError(PLUGIN_NAME, 'Streaming not supported!')); return callback(); } if (file.isBuffer()) { try { file.contents = new Buffer(injectFiles(file, options)); } catch (err) { this.emit('error', new gutil.PluginError(PLUGIN_NAME, err)); } } this.push(file); return callback(); }); return stream; };
Claud/gulp-include-helper
index.js
JavaScript
mit
6,735
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>mathcomp-solvable: Not compatible ๐Ÿ‘ผ</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.5.2~camlp4 / mathcomp-solvable - 1.11.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">ยซ Up</a> <h1> mathcomp-solvable <small> 1.11.0 <span class="label label-info">Not compatible ๐Ÿ‘ผ</span> </small> </h1> <p>๐Ÿ“… <em><script>document.write(moment("2021-11-14 07:15:20 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-11-14 07:15:20 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp4 4.03+1 Camlp4 is a system for writing extensible parsers for programming languages conf-findutils 1 Virtual package relying on findutils conf-which 1 Virtual package relying on which coq 8.5.2~camlp4 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.03.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.03.0 Official 4.03.0 release ocaml-config 1 OCaml Switch Configuration ocamlbuild 0.14.0 OCamlbuild is a build system with builtin rules to easily build most OCaml projects. # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Mathematical Components &lt;mathcomp-dev@sympa.inria.fr&gt;&quot; homepage: &quot;https://math-comp.github.io/&quot; bug-reports: &quot;https://github.com/math-comp/math-comp/issues&quot; dev-repo: &quot;git+https://github.com/math-comp/math-comp.git&quot; license: &quot;CECILL-B&quot; build: [ make &quot;-C&quot; &quot;mathcomp/solvable&quot; &quot;-j&quot; &quot;%{jobs}%&quot; ] install: [ make &quot;-C&quot; &quot;mathcomp/solvable&quot; &quot;install&quot; ] depends: [ &quot;coq-mathcomp-algebra&quot; { = version } ] tags: [ &quot;keyword:finite groups&quot; &quot;keyword:Feit Thompson theorem&quot; &quot;keyword:small scale reflection&quot; &quot;keyword:mathematical components&quot; &quot;keyword:odd order theorem&quot; &quot;logpath:mathcomp.solvable&quot; ] authors: [ &quot;Jeremy Avigad &lt;&gt;&quot; &quot;Andrea Asperti &lt;&gt;&quot; &quot;Stephane Le Roux &lt;&gt;&quot; &quot;Yves Bertot &lt;&gt;&quot; &quot;Laurence Rideau &lt;&gt;&quot; &quot;Enrico Tassi &lt;&gt;&quot; &quot;Ioana Pasca &lt;&gt;&quot; &quot;Georges Gonthier &lt;&gt;&quot; &quot;Sidi Ould Biha &lt;&gt;&quot; &quot;Cyril Cohen &lt;&gt;&quot; &quot;Francois Garillot &lt;&gt;&quot; &quot;Alexey Solovyev &lt;&gt;&quot; &quot;Russell O&#39;Connor &lt;&gt;&quot; &quot;Laurent Thรฉry &lt;&gt;&quot; &quot;Assia Mahboubi &lt;&gt;&quot; ] synopsis: &quot;Mathematical Components Library on finite groups (II)&quot; description:&quot;&quot;&quot; This library contains more definitions and theorems about finite groups. &quot;&quot;&quot; url { src: &quot;https://github.com/math-comp/math-comp/archive/mathcomp-1.11.0.tar.gz&quot; checksum: &quot;sha256=b16108320f77d15dd19ecc5aad90775b576edfa50c971682a1a439f6d364fef6&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install ๐Ÿœ๏ธ</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-mathcomp-solvable.1.11.0 coq.8.5.2~camlp4</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.5.2~camlp4). The following dependencies couldn&#39;t be met: - coq-mathcomp-solvable -&gt; coq-mathcomp-algebra = 1.11.0 -&gt; coq-mathcomp-fingroup = 1.11.0 -&gt; coq-mathcomp-ssreflect = 1.11.0 -&gt; coq &gt;= 8.7 -&gt; ocaml &gt;= 4.05.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-mathcomp-solvable.1.11.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install ๐Ÿš€</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall ๐Ÿงน</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> ยฉ Guillaume Claret ๐Ÿฃ </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.03.0-2.0.5/released/8.5.2~camlp4/mathcomp-solvable/1.11.0.html
HTML
mit
7,921
using System; using System.Text; namespace FileHelpers.Dynamic { /// <summary> /// Helper classes for strings /// </summary> internal static class StringHelper { /// <summary> /// replace the one string with another, and keep doing it /// </summary> /// <param name="original">Original string</param> /// <param name="oldValue">Value to replace</param> /// <param name="newValue">value to replace with</param> /// <returns>String with all multiple occurrences replaced</returns> private static string ReplaceRecursive(string original, string oldValue, string newValue) { const int maxTries = 1000; string ante, res; res = original.Replace(oldValue, newValue); var i = 0; do { i++; ante = res; res = ante.Replace(oldValue, newValue); } while (ante != res || i > maxTries); return res; } /// <summary> /// convert a string into a valid identifier /// </summary> /// <param name="original">Original string</param> /// <returns>valid identifier Original_string</returns> internal static string ToValidIdentifier(string original) { if (original.Length == 0) return string.Empty; var res = new StringBuilder(original.Length + 1); if (!char.IsLetter(original[0]) && original[0] != '_') res.Append('_'); for (int i = 0; i < original.Length; i++) { char c = original[i]; if (char.IsLetterOrDigit(c) || c == '_') res.Append(c); else res.Append('_'); } var identifier = ReplaceRecursive(res.ToString(), "__", "_").Trim('_'); if (identifier.Length == 0) return "_"; else if (char.IsDigit(identifier[0])) identifier = "_" + identifier; return identifier; } } }
MarcosMeli/FileHelpers
FileHelpers/Dynamic/StringHelper.cs
C#
mit
2,199
(defun test-input (&rest commands) "Feed in some commands to the game" (mapc (ฮป (s) (enter-input s :print nil)) commands)) (defun assert-location (location) (assert (= (resolve location) (monitor-peek-addr (resolve :current-location))) nil "Was not in location ~a" location)) (defun assert-msg (message) "Assert that the last message was as the parameter." (let ((message (justify-response message nil))) (assert (equal message (first *print-transcript*)) nil "Expected '~a' but was '~a'" message (first *print-transcript*)))) (defun assert-set (&rest bits) (assert-bits bits t)) (defun assert-clr (&rest bits) (assert-bits bits nil)) (defun assert-object-in (object location) (let ((expected-place (place-id location)) (actual-place (monitor-peek (object-place-address object)))) (assert expected-place nil "Expected place ~a was not defined" location) (assert (eq expected-place actual-place) nil "Expected the ~a in ~a (~a) was in place ~a" object location expected-place actual-place)))
djangojames/exploratory
testing.lisp
Lisp
mit
1,065
<!DOCTYPE html> <html lang=sl> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Tipkovnica</title> <link rel="stylesheet" type="text/css" href="../vodnik_1404.css"> <script type="text/javascript" src="jquery.js"></script><script type="text/javascript" src="jquery.syntax.js"></script><script type="text/javascript" src="yelp.js"></script> </head> <body id="home"><div id="wrapper" class="hfeed"> <div id="header"> <div id="branding"> <div id="blog-title"><span><a rel="home" title="Ubuntu Slovenija | Uradna spletna stran slovenske skupnosti Linux distribucije Ubuntu" href="https://www.ubuntu.si">Ubuntu Slovenija | Uradna spletna stran slovenske skupnosti Linux distribucije Ubuntu</a></span></div> <h1 id="blog-description"></h1> </div> <div id="access"><div id="loco-header-menu"><ul id="primary-header-menu"><li class="widget-container widget_nav_menu" id="nav_menu-3"><div class="menu-glavni-meni-container"><ul class="menu" id="menu-glavni-meni"> <li id="menu-item-15" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-15"><a href="https://www.ubuntu.si">Novice</a></li> <li id="menu-item-16" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-16"><a href="https://www.ubuntu.si/punbb/">Forum</a></li> <li id="menu-item-19" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-19"><a href="https://www.ubuntu.si/kaj-je-ubuntu/">Kaj je Ubuntu?</a></li> <li id="menu-item-20" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20"><a href="https://www.ubuntu.si/pogosta_vprasanja/">Pogosta vpraลกanja</a></li> <li id="menu-item-17" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-17"><a href="https://www.ubuntu.si/skupnost/">Skupnost</a></li> <li id="menu-item-18" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-18"><a href="https://www.ubuntu.si/povezave/">Povezave</a></li> </ul></div></li></ul></div></div> </div> <div id="main"><div id="cwt-content" class="clearfix content-area"><div id="page"> <div class="trails"> <div class="trail">ย ยป <a class="trail" href="index.html" title="Namizni vodnik Ubuntu"><span class="media media-image"><img src="figures/ubuntu-logo.png" height="16" width="16" alt="Pomoฤ"></span> Namizni vodnik Ubuntu</a>ย ยป <a class="trail" href="prefs.html" title="Uporabniลกke in sistemske nastavitve">Nastavitve</a>ย ยป </div> <div class="trail">ย ยป <a class="trail" href="index.html" title="Namizni vodnik Ubuntu"><span class="media media-image"><img src="figures/ubuntu-logo.png" height="16" width="16" alt="Pomoฤ"></span> Namizni vodnik Ubuntu</a>ย ยป <a class="trail" href="hardware.html" title="Strojna oprema in gonilniki">Strojna oprema</a>ย ยป </div> </div> <div id="content"> <!-- Piwik Image Tracker --><img src="https://piwik-ubuntusi.rhcloud.com/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" /><!-- End Piwik --> <div class="hgroup"><h1 class="title"><span class="title">Tipkovnica</span></h1></div> <div class="region"> <div class="contents"> <div class="links topiclinks"><div class="inner"> <div class="title title-links"><h2><span class="title">Jezik in podroฤje</span></h2></div> <div class="region"><ul><li class="links "> <a href="keyboard-layouts.html" title="Uporaba nadomestnih razporeditev tipk">Uporaba nadomestnih razporeditev tipk</a><span class="desc"> โ€” Nastavitev tipkovnice, da se bo obnaลกala kot tipkovnica za drug jezik.</span> </li></ul></div> </div></div> <div class="links topiclinks"><div class="inner"> <div class="title title-links"><h2><span class="title">Sploลกni dostop</span></h2></div> <div class="region"><ul> <li class="links "> <a href="keyboard-nav.html" title="Krmarjenje s tipkami">Krmarjenje s tipkami</a><span class="desc"> โ€” Uporaba programov in namizja brez miลกke.</span> </li> <li class="links "> <a href="keyboard-osk.html" title="Uporaba zaslonske tipkovnice">Uporaba zaslonske tipkovnice</a><span class="desc"> โ€” Uporaba zaslonske tipkovnice za vnos besedila s klikom na gumbe z miลกko.</span> </li> <li class="links "> <a href="a11y-stickykeys.html" title="Vklop lepljivih tipk">Vklop lepljivih tipk</a><span class="desc"> โ€” Vtipkajte tipkovne bliลพnjice po eno tipko na enkrat namesto pritiska vseh tipk hkrati.</span> </li> <li class="links "> <a href="a11y-bouncekeys.html" title="Vklop odskoฤnih tipk">Vklop odskoฤnih tipk</a><span class="desc"> โ€” Prezri hitro ponavljajoฤe se pritiske na isto tipko.</span> </li> <li class="links "> <a href="a11y-slowkeys.html" title="Vklop poฤasnih tipk">Vklop poฤasnih tipk</a><span class="desc"> โ€” Zakasnitev med pritiskom tipke in njeno pojavitvijo na zaslonu.</span> </li> </ul></div> </div></div> <div class="links topiclinks"><div class="inner"> <div class="title title-links"><h2><span class="title">Druge teme</span></h2></div> <div class="region"><ul> <li class="links "> <a href="keyboard-cursor-blink.html" title="Ali naj vrivnik tipkovnice utripa">Ali naj vrivnik tipkovnice utripa</a><span class="desc"> โ€” Nastavitev utripanja vstavitvene toฤke in nadzor hitrosti utripanja.</span> </li> <li class="links "> <a href="keyboard-repeat-keys.html" title="Izklop ponavljajoฤih se pritiskov tipk">Izklop ponavljajoฤih se pritiskov tipk</a><span class="desc"> โ€” Nastavite tipkovnico tako, da ne ponavlja ฤrk medtem ko drลพite tipko ali spremenite zakasnitev in hitrost ponavljanja tipk.</span> </li> <li class="links "> <a href="keyboard-shortcuts-set.html" title="Nastavitev tipkovnih bliลพnjic">Nastavitev tipkovnih bliลพnjic</a><span class="desc"> โ€” Tipkovne bliลพnjice lahko doloฤite ali spremenite v nastavitvah <span class=" gui">Tipkovnica</span>.</span> </li> <li class="links "> <a href="shell-keyboard-shortcuts.html" title="Uporabne tipkovne bliลพnjice">Uporabne tipkovne bliลพnjice</a><span class="desc"> โ€” Uporaba namizja s tipkovnico.</span> </li> </ul></div> </div></div> </div> <div class="sect sect-links"> <div class="hgroup"></div> <div class="contents"><div class="links seealsolinks"><div class="inner"> <div class="title"><h2><span class="title">Veฤ podrobnosti</span></h2></div> <div class="region"><ul> <li class="links "> <a href="hardware.html" title="Strojna oprema in gonilniki">Strojna oprema in gonilniki</a><span class="desc"> โ€” <span class=" link"><a href="hardware.html#problems" title="Pogoste teลพave">Teลพave s strojno opremo</a></span>, <span class=" link"><a href="printing.html" title="Tiskanje">tiskalniki</a></span>, <span class=" link"><a href="power.html" title="Napajanje in baterija">nastavitve porabe</a></span>, <span class=" link"><a href="color.html" title="Upravljanje barv">upravljanje barv</a></span>, <span class=" link"><a href="bluetooth.html" title="Bluetooth">Bluetooth</a></span>, <span class=" link"><a href="disk.html" title="Diski in shramba">diski</a></span> โ€ฆ</span> </li> <li class="links "> <a href="prefs.html" title="Uporabniลกke in sistemske nastavitve">Uporabniลกke in sistemske nastavitve</a><span class="desc"> โ€” <span class=" link"><a href="keyboard.html" title="Tipkovnica">Tipkovnica</a></span>, <span class=" link"><a href="mouse.html" title="Miลกka">miลกka</a></span>, <span class=" link"><a href="prefs-display.html" title="Zaslon">zaslon</a></span>, <span class=" link"><a href="prefs-language.html" title="Jezik in podroฤje">jeziki</a></span>, <span class=" link"><a href="user-accounts.html" title="Uporabniลกki raฤuni">uporabniลกki raฤuni</a></span> โ€ฆ</span> </li> </ul></div> </div></div></div> </div> </div> <div class="clear"></div> </div> </div></div></div> <div id="footer"><img src="https://piwik-ubuntusi.rhcloud.com/piwik.php?idsite=1amp;rec=1" style="border:0"><div id="siteinfo"><p>Material v tem dokumentu je na voljo pod prosto licenco. To je prevod dokumentacije Ubuntu, ki jo je sestavila <a href="https://wiki.ubuntu.com/DocumentationTeam">Ubuntu dokumentacijska ekpa za Ubuntu</a>. V slovenลกฤino jo je prevedla skupina <a href="https://wiki.lugos.si/slovenjenje:ubuntu">Ubuntu prevajalcev</a>. Za poroฤanje napak v prevodih v tej dokumentaciji ali Ubuntuju poลกljite sporoฤilo na <a href="mailto:ubuntu-l10n-slv@lists.ubuntu.com?subject=Prijava%20napak%20v%20prevodih">dopisni seznam</a>.</p></div></div> </div></body> </html>
ubuntu-si/ubuntu.si
vodnik/13.04/keyboard.html
HTML
mit
8,298
var tests = []; for (var file in window.__karma__.files) { if (window.__karma__.files.hasOwnProperty(file)) { // Removed "Spec" naming from files if (/Spec\.js$/.test(file)) { tests.push(file); } } } requirejs.config({ // Karma serves files from '/base' baseUrl: '/base/app/scripts', paths: { 'angular' : '../../bower_components/angular/angular', 'angular-cookies' : '../../bower_components/angular-cookies/angular-cookies', 'angular-ui-router' : '../../bower_components/angular-ui-router/release/angular-ui-router', 'angular-sanitize' : '../../bower_components/angular-sanitize/angular-sanitize', 'angular-resource' : '../../bower_components/angular-resource/angular-resource', 'angular-animate' : '../../bower_components/angular-animate/angular-animate', 'angular-touch' : '../../bower_components/angular-touch/angular-touch', 'angular-mocks' : '../../bower_components/angular-mocks/angular-mocks', 'angular-messages' : '../../bower_components/angular-messages/angular-messages', 'angular-google-maps' : '../../bower_components/angular-google-maps/dist/angular-google-maps', 'lodash' : '../../bower_components/lodash/dist/lodash', 'bootstrap' : '../../bower_components/bootstrap/dist/js/bootstrap', 'jquery' : '../../bower_components/jquery/dist/jquery', 'domReady' : '../../bower_components/domReady/domReady', 'text' : '../../bower_components/text/text', 'ionRangeSlider' : '../../bower_components/ion.rangeSlider/js/ion.rangeSlider.min', 'angular-ui-select': '../../bower_components/ui-select/dist/select.min' }, shim: { 'angular' : {'exports' : 'angular', deps: ['jquery']}, 'angular-ui-router' : ['angular'], 'angular-cookies': ['angular'], 'angular-sanitize': ['angular'], 'angular-resource': ['angular'], 'angular-animate': ['angular'], 'angular-touch': ['angular'], 'angular-messages' : ['angular'], 'bootstrap' : ['jquery'], 'ionRangeSlider' : ['jquery'], 'angular-google-maps' : ['angular','lodash'], 'angular-ui-select' : ['angular'], 'angular-mocks': { deps:['angular'], 'exports':'angular.mock' } }, priority: [ 'jquery', 'bootstrap', 'angular' ], // ask Require.js to load these files (all our tests) deps: tests, // start test run, once Require.js is done callback: window.__karma__.start });
xcafebabe/huskytime
test/test-main.js
JavaScript
mit
2,468
// // SecondViewController.m // NXContainerControllerDemo // // Created by ่’‹็žฟ้ฃŽ on 16/3/11. // Copyright ยฉ 2016ๅนด nightx. All rights reserved. // #import "SecondViewController.h" #import "AppDelegate.h" @interface SecondViewController () @end @implementation SecondViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } - (IBAction)showVC:(UIButton *)sender{ if ([sender.titleLabel.text isEqualToString: @"Present"]) { [[AppDelegate sharedDelegate].containerController showViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"FirstViewController"] withAnimationType:AnimationTransitionPresent duration:0.5 completion:^(UIViewController * _Nonnull controller) { }]; return; } if ([sender.titleLabel.text isEqualToString:@"Dismiss"]) { [[AppDelegate sharedDelegate].containerController showViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"FirstViewController"] withAnimationType:AnimationTransitionDismiss duration:0.5 completion:^(UIViewController * _Nonnull controller) { }]; return; } } @end
qufeng33/NXContainerController
NXContainerControllerDemo/NXContainerControllerDemo/SecondViewController.m
Matlab
mit
1,345
--- --- <!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>TargetStateDef | @uirouter/react</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> <link rel="stylesheet" href="../assets/css/uirouter.css"> <script src="../assets/js/modernizr.js"></script> <script src="../assets/js/reset.js"></script> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">@uirouter/react</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <!-- <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> --> <input type="checkbox" id="tsd-filter-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Internal UI-Router API</label> <!-- <input type="checkbox" id="tsd-filter-only-exported" /> <label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label> --> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../index.html">@uirouter/react</a> </li> <li> <a href="../modules/state.html">state</a> </li> <li> <a href="state.targetstatedef.html">TargetStateDef</a> </li> </ul> <h1>Interface TargetStateDef</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">TargetStateDef</span> </li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="state.targetstatedef.html#options" class="tsd-kind-icon">options</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="state.targetstatedef.html#params" class="tsd-kind-icon">params</a></li> <li class="tsd-kind-property tsd-parent-kind-interface"><a href="state.targetstatedef.html#state" class="tsd-kind-icon">state</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="options" class="tsd-anchor"></a> <!-- <h3><span class="tsd-flag ts-flagOptional">Optional</span> options</h3> --> <div class="tsd-signature tsd-kind-icon">options<span class="tsd-signature-symbol">:</span> <a href="transition.transitionoptions.html" class="tsd-signature-type">TransitionOptions</a></div> <div class="tsd-declaration"> </div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/ui-router/core/blob/d461776/src/state/interface.ts#L25">ui-router-core/src/state/interface.ts:25</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="params" class="tsd-anchor"></a> <!-- <h3><span class="tsd-flag ts-flagOptional">Optional</span> params</h3> --> <div class="tsd-signature tsd-kind-icon">params<span class="tsd-signature-symbol">:</span> <a href="params.rawparams.html" class="tsd-signature-type">RawParams</a></div> <div class="tsd-declaration"> </div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/ui-router/core/blob/d461776/src/state/interface.ts#L24">ui-router-core/src/state/interface.ts:24</a></li> </ul> </aside> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface"> <a name="state" class="tsd-anchor"></a> <!-- <h3>state</h3> --> <div class="tsd-signature tsd-kind-icon">state<span class="tsd-signature-symbol">:</span> <a href="../modules/state.html#stateorname" class="tsd-signature-type">StateOrName</a></div> <div class="tsd-declaration"> </div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/ui-router/core/blob/d461776/src/state/interface.ts#L23">ui-router-core/src/state/interface.ts:23</a></li> </ul> </aside> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="../index.html"><em>@uirouter/react</em></a> </li> <li class="label tsd-is-external"> <span>Public API</span> </li> <li class=" tsd-kind-external-module"> <a href="../modules/components.html">components</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/core.html">core</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/params.html">params</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/react.html">react</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/resolve.html">resolve</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/transition.html">transition</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/url.html">url</a> </li> <li class=" tsd-kind-external-module"> <a href="../modules/view.html">view</a> </li> <li class="label tsd-is-external"> <span>Internal UI-<wbr><wbr>Router API</span> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="../modules/common.html">common</a> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="../modules/common_hof.html">common_<wbr>hof</a> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="../modules/common_predicates.html">common_<wbr>predicates</a> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="../modules/common_strings.html">common_<wbr>strings</a> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="../modules/hooks.html">hooks</a> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="../modules/path.html">path</a> </li> <li class="current tsd-kind-external-module tsd-is-external"> <a href="../modules/state.html">state</a> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="../modules/trace.html">trace</a> </li> <li class=" tsd-kind-external-module tsd-is-external"> <a href="../modules/vanilla.html">vanilla</a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> <li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/state.statebuilder.html" class="tsd-kind-icon">State<wbr>Builder</a> </li> <li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/state.statematcher.html" class="tsd-kind-icon">State<wbr>Matcher</a> </li> <li class=" tsd-kind-class tsd-parent-kind-external-module"> <a href="../classes/state.stateobject.html" class="tsd-kind-icon">State<wbr>Object</a> </li> <li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/state.statequeuemanager.html" class="tsd-kind-icon">State<wbr>Queue<wbr>Manager</a> </li> <li class=" tsd-kind-class tsd-parent-kind-external-module"> <a href="../classes/state.stateregistry.html" class="tsd-kind-icon">State<wbr>Registry</a> </li> <li class=" tsd-kind-class tsd-parent-kind-external-module"> <a href="../classes/state.stateservice.html" class="tsd-kind-icon">State<wbr>Service</a> </li> <li class=" tsd-kind-class tsd-parent-kind-external-module"> <a href="../classes/state.targetstate.html" class="tsd-kind-icon">Target<wbr>State</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external tsd-is-not-exported"> <a href="state.builders.html" class="tsd-kind-icon">Builders</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-external-module"> <a href="state.hrefoptions.html" class="tsd-kind-icon">Href<wbr>Options</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-external-module"> <a href="state.lazyloadresult.html" class="tsd-kind-icon">Lazy<wbr>Load<wbr>Result</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-external-module"> <a href="state.statedeclaration.html" class="tsd-kind-icon">State<wbr>Declaration</a> </li> </ul> <ul class="current"> <li class="current tsd-kind-interface tsd-parent-kind-external-module"> <a href="state.targetstatedef.html" class="tsd-kind-icon">Target<wbr>State<wbr>Def</a> <ul> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="state.targetstatedef.html#options" class="tsd-kind-icon">options</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="state.targetstatedef.html#params" class="tsd-kind-icon">params</a> </li> <li class=" tsd-kind-property tsd-parent-kind-interface"> <a href="state.targetstatedef.html#state" class="tsd-kind-icon">state</a> </li> </ul> </li> </ul> <ul class="after-current"> <li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external"> <a href="state.transitionpromise.html" class="tsd-kind-icon">Transition<wbr>Promise</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external"> <a href="state._viewdeclaration.html" class="tsd-kind-icon">_<wbr>View<wbr>Declaration</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-external-module tsd-is-external"> <a href="../modules/state.html#builderfunction" class="tsd-kind-icon">Builder<wbr>Function</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-external-module"> <a href="../modules/state.html#oninvalidcallback" class="tsd-kind-icon">On<wbr>Invalid<wbr>Callback</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-external-module"> <a href="../modules/state.html#redirecttoresult" class="tsd-kind-icon">Redirect<wbr>ToResult</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-external-module"> <a href="../modules/state.html#resolvetypes" class="tsd-kind-icon">Resolve<wbr>Types</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-external-module"> <a href="../modules/state.html#stateorname" class="tsd-kind-icon">State<wbr>OrName</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-external-module"> <a href="../modules/state.html#stateregistrylistener" class="tsd-kind-icon">State<wbr>Registry<wbr>Listener</a> </li> <li class=" tsd-kind-type-alias tsd-parent-kind-external-module"> <a href="../modules/state.html#_statedeclaration" class="tsd-kind-icon">_<wbr>State<wbr>Declaration</a> </li> <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-external tsd-is-not-exported"> <a href="../modules/state.html#databuilder" class="tsd-kind-icon">data<wbr>Builder</a> </li> <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-external tsd-is-not-exported"> <a href="../modules/state.html#getnavigablebuilder" class="tsd-kind-icon">get<wbr>Navigable<wbr>Builder</a> </li> <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-external tsd-is-not-exported"> <a href="../modules/state.html#getparamsbuilder" class="tsd-kind-icon">get<wbr>Params<wbr>Builder</a> </li> <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-external tsd-is-not-exported"> <a href="../modules/state.html#geturlbuilder" class="tsd-kind-icon">get<wbr>Url<wbr>Builder</a> </li> <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-external tsd-is-not-exported"> <a href="../modules/state.html#includesbuilder" class="tsd-kind-icon">includes<wbr>Builder</a> </li> <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-external tsd-is-not-exported"> <a href="../modules/state.html#namebuilder" class="tsd-kind-icon">name<wbr>Builder</a> </li> <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-external tsd-is-not-exported"> <a href="../modules/state.html#parseurl" class="tsd-kind-icon">parse<wbr>Url</a> </li> <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-external tsd-is-not-exported"> <a href="../modules/state.html#pathbuilder" class="tsd-kind-icon">path<wbr>Builder</a> </li> <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-external"> <a href="../modules/state.html#resolvablesbuilder" class="tsd-kind-icon">resolvables<wbr>Builder</a> </li> <li class=" tsd-kind-function tsd-parent-kind-external-module tsd-is-external tsd-is-not-exported"> <a href="../modules/state.html#selfbuilder" class="tsd-kind-icon">self<wbr>Builder</a> </li> </ul> </nav> </div> </div> </div> <footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li> <li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li> <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li> <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li> <li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li> <li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li> <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li> <li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li> <li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li> <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li> <li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li> <li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li> </ul> </div> </div> </footer> <div class="container tsd-generator"> <p>Generated using <a href="http://typedoc.io" target="_blank">TypeDoc</a></p> </div> <div class="overlay"></div> <script src="../assets/js/main.js"></script> <script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script> </body> </html>
ui-router/ui-router.github.io
_react_docs/0.8.3/interfaces/state.targetstatedef.html
HTML
mit
20,083
/* ** Copyright (C) 1996, 1997 Microsoft Corporation. All Rights Reserved. ** ** File: trekigc.cpp ** ** Author: ** ** Description: ** This file contains most of the IGC calls from wintrek. ** ** History: */ #include "pch.h" #include <stddef.h> #include "training.h" #include "regkey.h" #include <zreg.h> #include "badwords.h" class ClusterSiteImpl : public ClusterSite { public: ClusterSiteImpl(Modeler* pmodeler, Number* ptime, Viewport* pviewport, IclusterIGC* pcluster) : m_pcluster(pcluster) { m_pGroupScene = GroupGeo::Create(); m_pposterImage = CreatePosterImage(pviewport); m_pParticleGeo = CreateParticleGeo(pmodeler, ptime); m_pGroupScene->AddGeo(m_pParticleGeo); m_pbitsGeo = CreateBitsGeo(pmodeler, ptime); m_pGroupScene->AddGeo(m_pbitsGeo); m_pexplosionGeo = CreateExplosionGeo(GetWindow()->GetTime()); m_pGroupScene->AddGeo(m_pexplosionGeo); m_pPulseGeo = CreatePulseGeo (pmodeler, ptime); m_pGroupScene->AddGeo(m_pPulseGeo); m_assetmask = 0; m_assetmaskLastWarning = 0; } void Terminate(void) { //Clear out anything left in the scanners array //(it wasn't cleared because the player's side was set to NULL //before all objects were removed from the array). { ScannerLinkIGC* l; while (l = m_scanners.first()) //intentional assignment { l->data()->Release(); delete l; } } m_pGroupScene = NULL; m_pposterImage = NULL; m_pexplosionGeo = NULL; } ////////////////////////////////////////////////////////////////////////////// // // Explosions // ////////////////////////////////////////////////////////////////////////////// void AddExplosion( const Vector& vecPosition, const Vector& vecForward, const Vector& vecRight, const Vector& vecVelocity, float scale, int type ) { // // Play a sound if the player can hear it // IclusterIGC* pcluster = trekClient.GetCluster(); if (pcluster && (pcluster->GetClusterSite() == this)) { GenericSoundSource* psource = new GenericSoundSource(vecPosition, vecVelocity); if (scale > 100.0f) trekClient.StartSound(largeExplosionSound, psource); else if (scale > 10.0f) trekClient.StartSound(mediumExplosionSound, psource); else trekClient.StartSound(smallExplosionSound, psource); } // // Create an explosion geo // TRef<Image> pimageShockWave; Color color(Color::White()); float radiusWave = 0; float radiusExplosion = scale; int count = 0; switch(type) { case 1: count = 4; radiusWave = 50; radiusExplosion = 25; pimageShockWave = trekClient.m_pimageShockWave; color = Color(154.0f / 255.0f, 130.0f / 255.0f, 190.0f / 255.0f); break; case 2: count = 6; radiusExplosion = 1; //Hack: ignore the scale passed in break; case 3: count = 12; radiusWave = 70; radiusExplosion = 35; pimageShockWave = trekClient.m_pimageShockWave; color = Color(200.0f / 255.0f, 130.0f / 255.0f, 50.0f / 255.0f); break; case 4: count = 16; radiusWave = 250; radiusExplosion = 165; pimageShockWave = trekClient.m_pimageShockWave; color = Color(200.0f / 255.0f, 130.0f / 255.0f, 50.0f / 255.0f); break; case 5: count = 16; radiusWave = 800; radiusExplosion = 100; pimageShockWave = trekClient.m_pimageShockWave; color = Color(220.0f / 255.0f, 130.0f / 255.0f, 50.0f / 255.0f); break; case 6: count = 5; radiusExplosion = 150; break; case 7: count = 24; radiusWave = 1000; radiusExplosion = 350; pimageShockWave = trekClient.m_pimageShockWave; color = Color(200.0f / 255.0f, 130.0f / 255.0f, 50.0f / 255.0f); break; } m_pexplosionGeo->AddExplosion( vecPosition, vecForward, vecRight, vecVelocity, radiusExplosion, radiusWave, color, count, trekClient.m_vpimageExplosion[type], pimageShockWave ); } void AddExplosion(ImodelIGC* pmodel, int type) { const Orientation& orient = pmodel->GetOrientation(); float scale = 2 * pmodel->GetThingSite()->GetRadius(); AddExplosion( pmodel->GetPosition(), orient.GetForward(), orient.GetRight(), pmodel->GetVelocity(), scale, type ); } void AddExplosion( const Vector& vecPosition, float scale, int type ) { AddExplosion( vecPosition, Vector(0, 1, 0), Vector(1, 0, 0), Vector(0, 0, 0), scale, type ); } void AddPulse (float fExplodeTime, const Vector& vecPosition, float fRadius, const Color& color) { // add a pulse geo to something or other //m_pPulseGeo->AddPulse (fExplodeTime, fRadius, vecPosition, color); } void AddThingSite(ThingSite* pThingSite) { TRef<ThingGeo> pthing = pThingSite->GetThingGeo(); if (pthing) { assert (pthing->IsValid()); pthing->SetParticleGeo(m_pParticleGeo); pthing->SetBitsGeo(m_pbitsGeo); } Geo* pgeo = pThingSite->GetGeo(); if (pgeo) { assert (pgeo->IsValid()); m_pGroupScene->AddGeo(pgeo); } } void DeleteThingSite(ThingSite* pThingSite) { Geo* pgeo = pThingSite->GetGeo(); if (pgeo) m_pGroupScene->RemoveGeo(pgeo); } HRESULT AddPoster(const char* textureName, const Vector& vec, float radius) { TRef<Image> pimage = GetWindow()->GetModeler()->LoadImage(textureName, true); if (pimage) { m_pposterImage->AddPoster(pimage, vec, radius); return S_OK; } return E_FAIL; } void SetEnvironmentGeo(const char* pszName) { TRef<INameSpace> pns = GetModeler()->GetNameSpace(pszName); if (pns) { m_pgeoEnvironment = Geo::Cast(pns->FindMember("object")); } } Geo* GetEnvironmentGeo() { if (m_pgeoEnvironment == NULL) { return Geo::GetEmpty(); } else { return m_pgeoEnvironment; } } GroupGeo* GetGroupScene() { return m_pGroupScene; } PosterImage* GetPosterImage() { return m_pposterImage; } virtual void AddScanner(SideID sid, IscannerIGC* scannerNew) { assert (sid >= 0); assert (sid < c_cSidesMax); assert (scannerNew); if (sid == trekClient.GetSideID() || trekClient.GetSide()->AlliedSides(trekClient.GetCore()->GetSide(sid),trekClient.GetSide())) //ALLY SCAN 7/13/09 imago AddIbaseIGC((BaseListIGC*)&(m_scanners), scannerNew); } virtual void DeleteScanner(SideID sid, IscannerIGC* scannerOld) { assert (sid >= 0); assert (sid < c_cSidesMax); assert (scannerOld); if (sid == trekClient.GetSideID() || trekClient.GetSide()->AlliedSides(trekClient.GetCore()->GetSide(sid),trekClient.GetSide())) //ALLY SCAN 7/13/09 imago DeleteIbaseIGC((BaseListIGC*)&(m_scanners), scannerOld); } virtual const ScannerListIGC* GetScanners(SideID sid) const { assert (sid >= 0); assert (sid < c_cSidesMax); return &(m_scanners); } virtual AssetMask GetClusterAssetMask(void) { return m_assetmask; } virtual void SetClusterAssetMask(AssetMask am) { m_assetmask=am; // if the game hasn't started yet, don't warn them about events if (!trekClient.IsInGame()) m_assetmaskLastWarning = m_assetmask; }; void UpdateClusterWarnings() { if (m_assetmaskLastWarning == m_assetmask) return; // nothing to do bool bInvulnerableStations = trekClient.MyMission()->GetMissionParams().bInvulnerableStations; ClusterWarning cwOld = GetClusterWarning(m_assetmaskLastWarning, bInvulnerableStations); ClusterWarning cwNew = GetClusterWarning(m_assetmask, bInvulnerableStations); if ((cwNew != cwOld) && (cwNew > c_cwNoThreat)) { static const SoundID c_vAlertSounds[c_cwMax] = { NA, NA, NA, NA, NA, minerThreatenedSound, constructorThreatenedSound, carrierThreatenedSound, bomberDetectedSound, carrierDetectedSound, capitalDetectedSound, teleportDetectedSound, transportDetectedSound, stationThreatenedSound, stationThreatenedSound, stationThreatenedSound }; if ((cwNew >= c_cwMinerThreatened) || (trekClient.GetShip()->GetWingID() == 0)) trekClient.PostText(cwNew > cwOld, "%s in %s", GetClusterWarningText(cwNew), m_pcluster->GetName()); if (c_vAlertSounds[cwNew] != NA) trekClient.PlaySoundEffect(c_vAlertSounds[cwNew]); } if (trekClient.IsInGame()) { bool bNewSectorSecured = (m_assetmask & c_amStation) && !(m_assetmask & c_amEnemyStation); bool bOldSectorSecured = (m_assetmaskLastWarning & c_amStation) && !(m_assetmaskLastWarning & c_amEnemyStation); if (bNewSectorSecured && !bOldSectorSecured) { trekClient.PostText(false, "%s secured.", m_pcluster->GetName()); trekClient.PlaySoundEffect(sectorSecuredSound); } else if (!(m_assetmask & c_amStation) && (m_assetmaskLastWarning & c_amStation)) { trekClient.PostText(false, "%s lost.", m_pcluster->GetName()); trekClient.PlaySoundEffect(sectorLostSound); } } m_assetmaskLastWarning = m_assetmask; } virtual void MoveShip(void) { SectorID sid = m_pcluster->GetObjectID(); IsideIGC* pside = trekClient.GetSide(); AssetMask am = m_assetmask; am &= (c_amStation | c_amEnemyStation | c_amEnemyTeleport | c_amEnemyProbe); //#354 added EnemyProbe for (ShipLinkIGC* psl = trekClient.m_pCoreIGC->GetShips()->first(); (psl != NULL); psl = psl->next()) { IshipIGC* pship = psl->data(); PlayerInfo* ppi = (PlayerInfo*)(pship->GetPrivateData()); if (ppi) { const ShipStatus& ss = ppi->GetShipStatus(); if ((!ss.GetUnknown()) && (ss.GetSectorID() == sid) && (ss.GetState() == c_ssFlying)) { IhullTypeIGC* pht = trekClient.m_pCoreIGC->GetHullType(ss.GetHullID()); assert (pht); am |= GetAssetMask(pship, pht, ( (pside == pship->GetSide()) || IsideIGC::AlliedSides(pside, pship->GetSide()) )); // #ALLY -was: pside == pship->GetSide() IMAGO FIXED 7/8/09 } } } SetClusterAssetMask(am); } virtual void MoveStation(void) { IsideIGC* pside = trekClient.GetSide(); AssetMask am = m_assetmask; am &= ~(c_amStation | c_amEnemyStation); for (StationLinkIGC* psl = m_pcluster->GetStations()->first(); (psl != NULL); psl = psl->next()) { am |= ((psl->data()->GetSide() == pside) || IsideIGC::AlliedSides(psl->data()->GetSide(), pside)) // #ALLY -was: psl->data()->GetSide() == pside ? c_amStation : c_amEnemyStation; } SetClusterAssetMask(am); } private: TRef<GroupGeo> m_pGroupScene; TRef<PosterImage> m_pposterImage; TRef<ParticleGeo> m_pParticleGeo; TRef<BitsGeo> m_pbitsGeo; TRef<ExplosionGeo> m_pexplosionGeo; TRef<PulseGeo> m_pPulseGeo; ScannerListIGC m_scanners; TRef<Geo> m_pgeoEnvironment; AssetMask m_assetmask; AssetMask m_assetmaskLastWarning; IclusterIGC* m_pcluster; }; // a sound source attached to model class ModelPointSoundSource : public ISoundPositionSource { private: // the model to which this is attached. ImodelIGC* m_pmodel; // the position of the sound source on the model Vector m_vectPosition; // the orientation of the source on the model Vector m_vectOrientation; bool IsRelative() { return m_pmodel == trekClient.GetShip() && GetWindow()->GetCameraMode() == TrekWindow::cmCockpit; } public: // constructs a sound source with the given position and orientation in // model space. ModelPointSoundSource(ImodelIGC* pmodel, const Vector& vectPosition = Vector(0,0,0), const Vector& vectOrientation = Vector(0,0,-1)) : m_pmodel(pmodel), m_vectPosition(vectPosition), m_vectOrientation(vectOrientation) { } // Any playing sounds attached to this source, used when a model is // destroyed or leaves the cluster void Destroy() { m_pmodel = NULL; } // // ISoundPositionSource // // Gets the position of the sound in space virtual HRESULT GetPosition(Vector& vectPosition) { ZAssert(m_pmodel != NULL); if (m_pmodel == NULL) return E_FAIL; if (IsRelative()) { vectPosition = m_vectPosition; } else { // get the position of the source based on the position and orientation // of the model. vectPosition = m_pmodel->GetPosition() + m_vectPosition * m_pmodel->GetOrientation(); } return S_OK; }; // Gets the velocity of the sound in space virtual HRESULT GetVelocity(Vector& vectVelocity) { ZAssert(m_pmodel != NULL); if (m_pmodel == NULL) return E_FAIL; if (IsRelative()) vectVelocity = Vector(0,0,0); else vectVelocity = m_pmodel->GetVelocity(); return S_OK; }; // Gets the orientation of the sound in space, used for sound cones. virtual HRESULT GetOrientation(Vector& vectOrientation) { ZAssert(m_pmodel != NULL); if (m_pmodel == NULL) return E_FAIL; if (IsRelative()) vectOrientation = m_vectOrientation; else vectOrientation = m_vectOrientation * m_pmodel->GetOrientation(); return S_OK; }; // Returns S_OK if the position, velocity and orientation reported are // relative to the listener, S_FALSE otherwise. virtual HRESULT IsListenerRelative() { return IsRelative() ? S_OK : S_FALSE; } // Returns S_OK if this source is still playing the sound, S_FALSE // otherwise. This might be false if a sound emitter is destroyed, for // example, in which case the sound might fade out. Once it returns // S_FALSE once, it should never return S_OK again. virtual HRESULT IsPlaying() { return (m_pmodel != NULL) ? S_OK : S_FALSE; }; }; // an interface for models which emit sounds class SoundSite { private: ImodelIGC* m_pmodel; TRef<ModelPointSoundSource> m_psourceCenter; class RegisteredModelPointSoundSource : public ModelPointSoundSource { // the site with which this is registered SoundSite* m_pSite; public: // constructor RegisteredModelPointSoundSource(ImodelIGC* pmodel, SoundSite* site, const Vector& vectPosition = Vector(0,0,0), const Vector& vectOrientation = Vector(0,0,-1)) : ModelPointSoundSource(pmodel, vectPosition, vectOrientation), m_pSite(site) { }; // destructor ~RegisteredModelPointSoundSource() { if (m_pSite) m_pSite->UnregisterSource(this); }; // destroy this sound source, usually due to a model being destroyed // or moved out of the sector. void Destroy() { ModelPointSoundSource::Destroy(); m_pSite = NULL; }; }; TList<RegisteredModelPointSoundSource*> m_listRegisteredSources; TList<TRef<ISoundInstance> > m_listHitSounds; public: SoundSite(ImodelIGC* pmodel) : m_pmodel(pmodel) { } virtual ~SoundSite() { StopSounds(); }; // updates the current sounds for this object acording to its state. virtual void UpdateSounds(DWORD dwElapsedTime) {}; // adds a hit sound (only keeps the most recent few sounds) virtual void AddHitSound(TRef<ISoundInstance> psound) { const int nMaxHitSounds = 3; m_listHitSounds.PushFront(psound); if (m_listHitSounds.GetCount() > nMaxHitSounds) { TRef<ISoundTweakable> ptweak = m_listHitSounds.PopEnd()->GetISoundTweakable(); if (ptweak) ptweak->SetPriority(-10); } } // stops all sounds on this object - usually used when changing clusters. virtual void StopSounds() { // stop the hit sounds while (!m_listHitSounds.IsEmpty()) { m_listHitSounds.PopEnd()->Stop(); } // destroy the center source if (m_psourceCenter) { m_psourceCenter->Destroy(); m_psourceCenter = NULL; } // destroy any registered sources if (!m_listRegisteredSources.IsEmpty()) { TList<RegisteredModelPointSoundSource*>::Iterator iter(m_listRegisteredSources); while (!iter.End()) { iter.Value()->Destroy(); iter.Next(); } m_listRegisteredSources.SetEmpty(); } } // Gets a sounds source that can be used for this object TRef<ISoundPositionSource> GetSoundSource() { if (!m_psourceCenter) m_psourceCenter = new ModelPointSoundSource(m_pmodel); return m_psourceCenter; } // Gets a sounds source that can be used for this object with the given // offset from center. TRef<ISoundPositionSource> GetSoundSource(const Vector& vectOffset, const Vector& vectOrientation = Vector(0, 0, -1)) { TRef<RegisteredModelPointSoundSource> psource = new RegisteredModelPointSoundSource(m_pmodel, this, vectOffset); m_listRegisteredSources.PushFront(psource); return psource; } // allows a registered source to unregister itself. virtual void UnregisterSource(RegisteredModelPointSoundSource* psource) { ZVerify(m_listRegisteredSources.Remove(psource)); } }; // A sound site for a model with one continuous ambient sound class AmbientSoundSite : public SoundSite { private: TRef<ISoundInstance> m_pAmbientSound; SoundID m_idAmbientSound; public: AmbientSoundSite(ImodelIGC* pmodel, SoundID idAmbientSound) : m_idAmbientSound(idAmbientSound), SoundSite(pmodel) { } // updates the current sounds for this object acording to its state. void UpdateSounds(DWORD dwElapsedTime) { if (!m_pAmbientSound) { m_pAmbientSound = trekClient.StartSound(m_idAmbientSound, GetSoundSource()); } }; // stops all sounds on this object - usually used when changing clusters. void StopSounds() { SoundSite::StopSounds(); m_pAmbientSound = NULL; }; }; // A site for a ship, possibly the player's ship class ShipSoundSite : public SoundSite { private: IshipIGC* m_pship; Mount m_mountLastTurret; float m_fHullFraction; float m_fAmmoFraction; float m_fFuelFraction; float m_fEnergyFraction; bool m_bTryingToFireWeaponWithoutAmmo; bool m_bTryingToUseAfterburnersWithoutFuel; int m_nRipcordCountdown; TRef<ISoundPositionSource> m_psourceEngine; TRef<ISoundPositionSource> m_psounceWeaponMount[c_maxMountedWeapons]; // sounds used for the player's ship only TRef<ISoundInstance> m_pOutOfBoundsSound; TRef<ISoundInstance> m_pRipcordingSound; TRef<ISoundInstance> m_pMissileToneSound; // sounds used inside of a ship TRef<ISoundInstance> m_pPilotInteriorSound; TRef<ISoundInstance> m_pGunnerInteriorSound; TRef<ISoundInstance> m_pMainThrusterInteriorSound; TRef<ISoundInstance> m_pTurnThrusterInteriorSound; TRef<ISoundInstance> m_pAfterburnerInteriorSound; // sounds used outside of a ship TRef<ISoundInstance> m_pExteriorSound; TRef<ISoundInstance> m_pMainThrusterExteriorSound; TRef<ISoundInstance> m_pTurnThrusterExteriorSound; TRef<ISoundInstance> m_pAfterburnerExteriorSound; TRef<ISoundInstance> m_pMiningSound; // weapon sounds for each mount IpartTypeIGC* m_vpCurrentWeaponType[c_maxMountedWeapons]; TRef<ISoundInstance> m_vpBurstSound[c_maxMountedWeapons]; TRef<ISoundInstance> m_vpActiveSound[c_maxMountedWeapons]; TRef<ISoundInstance> m_vpTurretSound[c_maxMountedWeapons]; // the last state of this sound enum { wasSilent, wasPlaying } m_stateLast; float m_fThrustSoundLevel; float m_fTurnSoundLevel; // calculate the current fraction of the potential amount of forward thrust float ForwardThrustFraction() { //float fForwardThrust = -1 * m_pship->GetEngineVector() // * m_pship->GetOrientation().GetBackward(); //float fForwardThrustFraction = fForwardThrust / m_pship->GetHullType()->GetThrust(); // return fForwardThrustFraction; // realistic as this may be, it does not reflect the player's // expectations. Thus, use the throttle instead. const ControlData& controls = m_pship->GetControls(); return max(controls.jsValues[c_axisThrottle] * 0.5f + 0.5f, (m_pship->GetStateM() & afterburnerButtonIGC) ? 1.0f : 0.0f); } // calculate the current fraction of the potential amount of sideways thrust float SidewaysThrustFraction() { const IhullTypeIGC* pht = m_pship->GetHullType(); float fThrust = m_pship->GetHullType()->GetThrust() / m_pship->GetHullType()->GetSideMultiplier(); float fForwardThrust = max(0, -1 * m_pship->GetEngineVector() * m_pship->GetOrientation().GetBackward()); Vector vectSideThrust = m_pship->GetEngineVector() + fForwardThrust * m_pship->GetOrientation().GetBackward(); return vectSideThrust.LengthSquared() / (fThrust * fThrust); } // calculate a rough and dirty aproximation of the amount of current turning float TurnRate(IshipIGC* pship) { const ControlData& controls = pship->GetControls(); return (controls.jsValues[c_axisYaw] * controls.jsValues[c_axisYaw] + controls.jsValues[c_axisPitch] * controls.jsValues[c_axisPitch] + controls.jsValues[c_axisRoll] * controls.jsValues[c_axisRoll]); } float TurnRate() { return TurnRate(m_pship); } // calculate the current afterburner power float AfterburnerPower() { IafterburnerIGC* pafterburner = (IafterburnerIGC*)(m_pship->GetMountedPart(ET_Afterburner, 0)); return pafterburner ? pafterburner->GetPower() : 0.0f; } // true if the player is trying to fire an ammo weapon without enough // ammunition, or observing someone doing the same. bool TryingToFireWeaponWithoutAmmo() { // we should only be called for the player's ship ZAssert(m_pship == trekClient.GetShip()->GetSourceShip()); Mount mount = trekClient.GetShip()->GetTurretID(); // if the player is a turret gunner... if (mount != NA) { // just check that gun const IweaponIGC* pweapon; CastTo(pweapon, m_pship->GetMountedPart(ET_Weapon, mount)); return (pweapon && pweapon->fActive() && pweapon->GetMountedFraction() >= 1.0f && pweapon->GetAmmoPerShot() > m_pship->GetAmmo()); } else { // check all of the fixed weapon mounts Mount maxFixedWeapons = m_pship->GetHullType()->GetMaxFixedWeapons(); for (mount = 0; mount < maxFixedWeapons; mount++) { const IweaponIGC* pweapon; CastTo(pweapon, m_pship->GetMountedPart(ET_Weapon, mount)); if (pweapon && pweapon->fActive() && pweapon->GetMountedFraction() >= 1.0f && pweapon->GetAmmoPerShot() > m_pship->GetAmmo()) { return true; } } return false; } } bool TryingToFireAfterburnersWithoutFuel() { IafterburnerIGC* pafterburner = (IafterburnerIGC*)(m_pship->GetMountedPart(ET_Afterburner, 0)); return pafterburner && (m_pship->GetStateM() & afterburnerButtonIGC) && m_pship->GetFuel() <= 0.0f && pafterburner->GetMountedFraction() >= 1.0 && pafterburner->GetFuelConsumption() > 0.0f; } bool HasMissileLock() { // we should only be called for the player's ship ZAssert(m_pship == trekClient.GetShip()->GetSourceShip()); ImagazineIGC* pmagazine = (ImagazineIGC*)trekClient.GetShip()->GetSourceShip()->GetMountedPart(ET_Magazine, 0); return (pmagazine && pmagazine->GetLock() == 1.0f); } // set the volume of all playing internal sounds void SetInternalVolume(float fGain) { if (m_pPilotInteriorSound) m_pPilotInteriorSound->GetISoundTweakable()->SetGain(fGain); if (m_pGunnerInteriorSound) m_pGunnerInteriorSound->GetISoundTweakable()->SetGain(fGain); float fThrustVolumeFactor = (1 - m_fThrustSoundLevel); fThrustVolumeFactor *= fThrustVolumeFactor; fThrustVolumeFactor *= fThrustVolumeFactor; fThrustVolumeFactor *= fThrustVolumeFactor; fThrustVolumeFactor *= fThrustVolumeFactor; fThrustVolumeFactor *= fThrustVolumeFactor; fThrustVolumeFactor *= fThrustVolumeFactor; if (m_pMainThrusterInteriorSound) m_pMainThrusterInteriorSound->GetISoundTweakable()->SetGain(fGain + fThrustVolumeFactor * -60); float fTurnThrustVolumeFactor = (1 - m_fTurnSoundLevel); fTurnThrustVolumeFactor *= fTurnThrustVolumeFactor; if (m_pTurnThrusterInteriorSound) m_pTurnThrusterInteriorSound->GetISoundTweakable()->SetGain(fGain + fTurnThrustVolumeFactor * -60); if (m_pAfterburnerInteriorSound) m_pAfterburnerInteriorSound->GetISoundTweakable()->SetGain(fGain); } // set the volume of all playing external noise void SetExternalVolume(float fGain) { if (m_pExteriorSound) m_pExteriorSound->GetISoundTweakable()->SetGain(fGain); if (m_pMainThrusterExteriorSound) m_pMainThrusterExteriorSound->GetISoundTweakable()->SetGain(fGain + (1 - m_fThrustSoundLevel) * -40); if (m_pTurnThrusterExteriorSound) m_pTurnThrusterExteriorSound->GetISoundTweakable()->SetGain(fGain + (1 - m_fTurnSoundLevel) * -40); if (m_pAfterburnerExteriorSound) m_pAfterburnerExteriorSound->GetISoundTweakable()->SetGain(fGain); } void PlaySoundIf(TRef<ISoundInstance>& pSound, SoundID id, ISoundPositionSource* psource, bool bPlay) { if (bPlay) { // start the sound in question, if it's not already playing if (!pSound) { pSound = trekClient.StartSound(id, psource); } } else { // stop the sound in questions if (pSound) { pSound->Stop(); pSound= NULL; } } }; void PlayWeaponSounds() { // check all of the fixed weapon mounts Mount maxWeapons = m_pship->GetHullType()->GetMaxWeapons(); for (Mount mount = 0; mount < maxWeapons; mount++) { const IweaponIGC* pweapon; CastTo(pweapon, m_pship->GetMountedPart(ET_Weapon, mount)); // if the weapon has been changed... if (pweapon && pweapon->GetPartType() != m_vpCurrentWeaponType[mount]) { // silence the old weapon, since the sounds may be different // for the new one. if (m_vpBurstSound[mount]) m_vpBurstSound[mount]->Stop(); if (m_vpActiveSound[mount]) m_vpActiveSound[mount]->Stop(); m_vpBurstSound[mount] = NULL; m_vpActiveSound[mount] = NULL; m_vpCurrentWeaponType[mount] = pweapon->GetPartType(); } // if the weapon is just being activated, play the relevant sound PlaySoundIf(m_vpActiveSound[mount], pweapon ? pweapon->GetActivateSound() : NA, m_psounceWeaponMount[mount], pweapon && pweapon->fActive()); // if the turret is manned and moving, play the turret sound // REVIEW: it looks like we only get turrent move info for other // players if the turret is firing! PlaySoundIf(m_vpTurretSound[mount], m_pship->GetHullType()->GetHardpointData(mount).turnSound, m_psounceWeaponMount[mount], pweapon && pweapon->GetGunner() && (pweapon->fActive() || pweapon->GetGunner() == trekClient.GetShip()) && TurnRate(pweapon->GetGunner()) > 0.01); // if the weapon is burst-firing, play that sound bool bWasBurstFiring = m_vpBurstSound[mount] != NULL; SoundID idBurstSound = pweapon ? pweapon->GetBurstSound() : NA; PlaySoundIf(m_vpBurstSound[mount], idBurstSound, m_psounceWeaponMount[mount], pweapon && pweapon->fFiringBurst() && (idBurstSound != NA)); // if we shot this frame and we are not playing a burst-fire sound, // play a single shot sound. if (pweapon && pweapon->fFiringShot() && m_vpBurstSound[mount] == NULL && !bWasBurstFiring) { trekClient.StartSound(pweapon->GetSingleShotSound(), m_psounceWeaponMount[mount]); } } } void UpdateRipcordCountdown() { if (!trekClient.GetShip()->GetSourceShip()->fRipcordActive()) { m_nRipcordCountdown = 11; } else { int nRipcordCountdown = 1 + (int)trekClient.GetShip()->GetSourceShip()->GetRipcordTimeLeft(); if (nRipcordCountdown != m_nRipcordCountdown) { switch (nRipcordCountdown) { case 10: trekClient.StartSound(ripcord10Sound, GetSoundSource()); break; case 9: trekClient.StartSound(ripcord9Sound, GetSoundSource()); break; case 8: trekClient.StartSound(ripcord8Sound, GetSoundSource()); break; case 7: trekClient.StartSound(ripcord7Sound, GetSoundSource()); break; case 6: trekClient.StartSound(ripcord6Sound, GetSoundSource()); break; case 5: trekClient.StartSound(ripcord5Sound, GetSoundSource()); break; case 4: trekClient.StartSound(ripcord4Sound, GetSoundSource()); break; case 3: trekClient.StartSound(ripcord3Sound, GetSoundSource()); break; case 2: trekClient.StartSound(ripcord2Sound, GetSoundSource()); break; case 1: trekClient.StartSound(ripcord1Sound, GetSoundSource()); break; } m_nRipcordCountdown = nRipcordCountdown; } } } // creates the various sound sources for sounds on the ship void CreateSoundSources() { m_psourceEngine = GetSoundSource( m_pship->GetThingSite()->GetChildModelOffset("trail"), Vector(0,0,1)); // create sound sources for each of the weapon mounts const IhullTypeIGC* pht = m_pship->GetHullType(); Mount maxWeapons = pht->GetMaxWeapons(); for (Mount mount = 0; mount < maxWeapons; mount++) { // review: does not handle turret orientation m_psounceWeaponMount[mount] = GetSoundSource( pht->GetWeaponPosition(mount), pht->GetWeaponOrientation(mount).GetForward() ); } } SoundID GetGunnerInteriorSoundID() { if (trekClient.GetShip()->GetParentShip()) { const IhullTypeIGC* pht = m_pship->GetHullType(); ZAssert(pht); Mount mount = trekClient.GetShip()->GetTurretID(); if (mount != NA) { return pht->GetHardpointData(mount).interiorSound; } } return NA; } SoundID GetAfterburnerSoundID(bool fInterior) { IafterburnerIGC* pafterburner = (IafterburnerIGC*)(m_pship->GetMountedPart(ET_Afterburner, 0)); if (pafterburner) { if (fInterior) return pafterburner->GetInteriorSound(); else return pafterburner->GetExteriorSound(); } else { return NA; } } void UpdateEngineSoundLevels(DWORD dwElapsedTime) { float fNewThrustSoundLevel = ForwardThrustFraction(); float fNewTurnSoundLevel = min(1.0f, max(TurnRate() * 20, SidewaysThrustFraction())); // if we were playing this sound a moment ago... if (wasSilent != m_stateLast) { const float cfMaxThrustRateOfChange = 0.0005f; const float cfMaxTurnRateOfChange = 0.002f; // clip the new sound level according to the max rate of change // allowed. fNewThrustSoundLevel = max( m_fThrustSoundLevel - cfMaxThrustRateOfChange * dwElapsedTime, min( m_fThrustSoundLevel + cfMaxThrustRateOfChange * dwElapsedTime, fNewThrustSoundLevel )); fNewTurnSoundLevel = max( m_fTurnSoundLevel - cfMaxTurnRateOfChange * dwElapsedTime, min( m_fTurnSoundLevel + cfMaxTurnRateOfChange * dwElapsedTime, fNewTurnSoundLevel )); } m_fThrustSoundLevel = fNewThrustSoundLevel; m_fTurnSoundLevel = fNewTurnSoundLevel; // adjust the pitch of the engines if (m_pMainThrusterInteriorSound) m_pMainThrusterInteriorSound->GetISoundTweakable()->SetPitch( 0.5f + m_fThrustSoundLevel/2); if (m_pTurnThrusterInteriorSound) m_pTurnThrusterInteriorSound->GetISoundTweakable()->SetPitch( 0.50f + m_fTurnSoundLevel/3); if (m_pMainThrusterExteriorSound) m_pMainThrusterExteriorSound->GetISoundTweakable()->SetPitch( 0.5f + m_fThrustSoundLevel/2); if (m_pTurnThrusterExteriorSound) m_pTurnThrusterExteriorSound->GetISoundTweakable()->SetPitch( 0.50f + m_fTurnSoundLevel/2); } public: ShipSoundSite(IshipIGC* pship) : m_pship(pship), SoundSite(pship), m_mountLastTurret(NA), m_stateLast(wasSilent), m_fHullFraction(1.0f), m_fAmmoFraction(1.0f), m_fFuelFraction(1.0f), m_fEnergyFraction(1.0f), m_bTryingToFireWeaponWithoutAmmo(false), m_bTryingToUseAfterburnersWithoutFuel(false), m_nRipcordCountdown(11) { for (Mount mount = 0; mount < c_maxMountedWeapons; mount++) { m_vpBurstSound[mount] = NULL; }; } // updates the current sounds for this object acording to its state. void UpdateSounds(DWORD dwElapsedTime) { // if this is not a turret or an observer // REVIEW: Assumes that we can never go from in flight to observer/turret // (but the reverse works properly, and is needed for eject pods) if (!m_pship->GetParentShip()) { // make sure we have the sound sources that we need. if (!m_psourceEngine) { CreateSoundSources(); }; const IhullTypeIGC* pht = m_pship->GetHullType(); ZAssert(pht); // if this is the player's current ship at the moment bool bIsPlayersShip = trekClient.GetShip()->GetSourceShip() == m_pship; // are we on the inside of this ship? bool bIsInterior = bIsPlayersShip && TrekWindow::InternalCamera(GetWindow()->GetCameraMode()); // make sure we reset the turret interior sound when switching turrets if (bIsPlayersShip && m_mountLastTurret != trekClient.GetShip()->GetTurretID()) { if (m_pGunnerInteriorSound) { m_pGunnerInteriorSound->Stop(); m_pGunnerInteriorSound = NULL; }; m_mountLastTurret = trekClient.GetShip()->GetTurretID(); } bool bIsGunner = bIsPlayersShip && m_mountLastTurret != NA; float fNewHullFraction = 1.0f; float fNewAmmoFraction = 1.0f; float fNewFuelFraction = 1.0f; float fNewEnergyFraction = 1.0f; bool fNewFiringWithoutAmmo = false; bool fNewThrustingWithoutFuel = false; if (bIsPlayersShip) { fNewHullFraction = m_pship->GetFraction(); fNewAmmoFraction = m_pship->GetAmmo() / (float)m_pship->GetHullType()->GetMaxAmmo(); if (m_pship->GetHullType()->GetMaxFuel() > 0) { fNewFuelFraction = m_pship->GetFuel() / m_pship->GetHullType()->GetMaxFuel(); } if (m_pship->GetHullType()->GetMaxEnergy() > 0) { fNewEnergyFraction = m_pship->GetEnergy() / m_pship->GetHullType()->GetMaxEnergy(); } fNewFiringWithoutAmmo = TryingToFireWeaponWithoutAmmo(); fNewThrustingWithoutFuel = TryingToFireAfterburnersWithoutFuel(); } if (bIsPlayersShip && fNewHullFraction < 0.15f && m_fHullFraction >= 0.15f) trekClient.StartSound(hullLowSound, GetSoundSource()); if (bIsPlayersShip && fNewAmmoFraction < 0.15f && m_fAmmoFraction >= 0.15f) trekClient.StartSound(ammoLowSound, GetSoundSource()); if (bIsPlayersShip && fNewFuelFraction < 0.15f && m_fFuelFraction >= 0.15f) trekClient.StartSound(fuelLowSound, GetSoundSource()); if (bIsPlayersShip && fNewEnergyFraction < 0.05f && m_fEnergyFraction >= 0.05f) trekClient.StartSound(energyLowSound, GetSoundSource()); if (!m_bTryingToFireWeaponWithoutAmmo && fNewFiringWithoutAmmo) trekClient.StartSound(salNoAmmoSound, GetSoundSource()); if (!m_bTryingToUseAfterburnersWithoutFuel && fNewThrustingWithoutFuel) trekClient.StartSound(salNoFuelSound, GetSoundSource()); UpdateRipcordCountdown(); m_fHullFraction = fNewHullFraction; m_fAmmoFraction = fNewAmmoFraction; m_fFuelFraction = fNewFuelFraction; m_fEnergyFraction = fNewEnergyFraction; m_bTryingToFireWeaponWithoutAmmo = fNewFiringWithoutAmmo; m_bTryingToUseAfterburnersWithoutFuel = fNewThrustingWithoutFuel; PlaySoundIf(m_pOutOfBoundsSound, outOfBoundsLoopSound, GetSoundSource(), (trekClient.GetShip()->GetWarningMask() & (c_wmOutOfBounds | c_wmCrowdedSector)) != 0); PlaySoundIf(m_pRipcordingSound, ripcordOnLoopSound, GetSoundSource(), bIsPlayersShip && m_pship->fRipcordActive()); PlaySoundIf(m_pMissileToneSound, missileToneSound, GetSoundSource(), bIsPlayersShip && HasMissileLock()); // play the mining sound if this ship is actively mining PlaySoundIf(m_pMiningSound, miningSound, GetSoundSource(), ((m_pship->GetStateM() & miningMaskIGC) != 0) && trekClient.GetShip()->CanSee(m_pship)); // mdvalley: Uneyed miners silent. // play the sounds for each weapon PlayWeaponSounds(); // play the interior sounds (perhaps silently) even if we are // in an exterior view, because we may need to switch back in // the middle of a sound. if (bIsPlayersShip) { // // play the appropriate interior sounds // SoundID gunnerInteriorSoundID = GetGunnerInteriorSoundID(); PlaySoundIf(m_pGunnerInteriorSound, gunnerInteriorSoundID, GetSoundSource(), bIsGunner); PlaySoundIf(m_pPilotInteriorSound, pht->GetInteriorSound(), GetSoundSource(), !bIsGunner); PlaySoundIf(m_pMainThrusterInteriorSound, pht->GetMainThrusterInteriorSound(), m_psourceEngine, m_fThrustSoundLevel > 0.01f); PlaySoundIf(m_pTurnThrusterInteriorSound, pht->GetManuveringThrusterInteriorSound(), GetSoundSource(), m_fTurnSoundLevel > 0.01f); PlaySoundIf(m_pAfterburnerInteriorSound, GetAfterburnerSoundID(true), m_psourceEngine, AfterburnerPower() > 0.0f); } // // play the appropriate exterior sounds // PlaySoundIf(m_pExteriorSound, pht->GetExteriorSound(), GetSoundSource(), true); PlaySoundIf(m_pMainThrusterExteriorSound, pht->GetMainThrusterExteriorSound(), m_psourceEngine, m_fThrustSoundLevel > 0.01f); PlaySoundIf(m_pTurnThrusterExteriorSound, pht->GetManuveringThrusterExteriorSound(), GetSoundSource(), m_fTurnSoundLevel > 0.01f); PlaySoundIf(m_pAfterburnerExteriorSound, GetAfterburnerSoundID(false), m_psourceEngine, AfterburnerPower() > 0.0f); UpdateEngineSoundLevels(dwElapsedTime); // if we are inside of the ship... if (bIsInterior) { // switch from external noise to internal noise SetExternalVolume(-100); SetInternalVolume(0); } else { // we are outside of the ship // switch from internal noise to external noise SetExternalVolume(0); SetInternalVolume(-100); } m_stateLast = wasPlaying; } }; // stops all sounds on this object - usually used when changing clusters. void StopSounds() { SoundSite::StopSounds(); if (m_psourceEngine) { m_psourceEngine = NULL; m_pOutOfBoundsSound = NULL; m_pRipcordingSound = NULL; m_pPilotInteriorSound = NULL; m_pGunnerInteriorSound = NULL; m_pMainThrusterInteriorSound = NULL; m_pTurnThrusterInteriorSound = NULL; m_pAfterburnerInteriorSound = NULL; m_pExteriorSound = NULL; m_pMainThrusterExteriorSound = NULL; m_pTurnThrusterExteriorSound = NULL; m_pAfterburnerExteriorSound = NULL; Mount maxWeapons = m_pship->GetHullType()->GetMaxWeapons(); for (Mount mount = 0; mount < maxWeapons; mount++) { m_psounceWeaponMount[mount] = NULL; m_vpBurstSound[mount] = NULL; m_vpActiveSound[mount] = NULL; m_vpTurretSound[mount] = NULL; } m_stateLast = wasSilent; } }; }; class ThingSiteImpl : public ThingSitePrivate { public: ThingSiteImpl(ImodelIGC* pmodel) : m_bSideVisibility(false), m_pmodel(pmodel), m_mask(0), m_bPlayedHitSoundThisFrame(false) { assert (pmodel); //Don't bother to AddRef pmodel -- it lifespan always exceeds that of the thingsite. // create the appropriate sound site for this switch (pmodel->GetObjectType()) { case OT_asteroid: m_pSoundSite = new AmbientSoundSite(pmodel, asteroidSound); break; case OT_warp: m_pSoundSite = new AmbientSoundSite(pmodel, alephSound); break; case OT_buildingEffect: m_pSoundSite = new AmbientSoundSite(pmodel, buildSound); break; case OT_probe: m_pSoundSite = new AmbientSoundSite(pmodel, ((IprobeIGC*)pmodel)->GetAmbientSound()); break; case OT_missile: m_pSoundSite = new AmbientSoundSite(pmodel, ((ImissileIGC*)pmodel)->GetMissileType()->GetAmbientSound()); break; case OT_projectile: { SoundID sound = ((IprojectileIGC*)pmodel) ->GetProjectileType()->GetAmbientSound(); if (sound = NA) m_pSoundSite = NULL; else m_pSoundSite = new AmbientSoundSite(pmodel, sound); } break; case OT_station: m_pSoundSite = new AmbientSoundSite(pmodel, ((IstationIGC*)pmodel)->GetExteriorSound()); break; case OT_ship: m_pSoundSite = new ShipSoundSite((IshipIGC*)pmodel); break; default: m_pSoundSite = NULL; break; } } ~ThingSiteImpl(void) { if (m_pSoundSite) delete m_pSoundSite; } void Purge(void) { if (m_pthing) { assert (!m_pdecal); m_pthingGeo->SetEmpty(); m_pthingGeo = NULL; m_pthing = NULL; } else if (m_pdecal) { m_pdecal->SetEmpty(); m_pdecal = NULL; } } void Terminate(void) { if (m_pdecal) { m_pdecal->SetEmpty(); m_pdecal = NULL; assert(m_pvisibleGeoBolt == NULL); } else { if (m_pthing) { assert (!m_pdecal); m_pthingGeo->SetEmpty(); m_pthingGeo = NULL; m_pthing = NULL; if (m_pvisibleGeoBolt) { m_pvisibleGeoBolt->SetEmpty(); m_pvisibleGeoBolt = NULL; } } else if (m_pbuildeffect) { m_pbuildeffect->SetEmpty(); m_pbuildeffect = NULL; } } } Vector GetChildModelOffset(const ZString& strFrame) { //m_pthing->Update(); Vector vec(0, 0, 0); if (!m_pthing->GetChildModelOffset(strFrame, vec)) return Vector(0,0,0); return vec; } Vector GetChildOffset(const ZString& strFrame) { //m_pthing->Update(); Vector vec(0, 0, 0); ZVerify(m_pthing->GetChildOffset(strFrame, vec)); return vec; } void SetAfterburnerSmokeSize (float size) { m_pthing->SetAfterburnerSmokeSize (size); } void SetAfterburnerFireDuration (float duration) { m_pthing->SetAfterburnerFireDuration (duration); } void SetAfterburnerSmokeDuration (float duration) { m_pthing->SetAfterburnerSmokeDuration (duration); } void AddDamage (const Vector& vecDamagePosition, float fDamageFraction) { m_pthing->AddDamage (vecDamagePosition, fDamageFraction); } void RemoveDamage (float fDamageFraction) { m_pthing->RemoveDamage (fDamageFraction); } void SetTimeUntilRipcord (float fTimeUntilTeleport) { m_pthing->SetTimeUntilRipcord (fTimeUntilTeleport); } void SetTimeUntilAleph (float fTimeUntilTeleport) { m_pthing->SetTimeUntilAleph (fTimeUntilTeleport); } void AddExplosion(const Vector& vecPosition, float scale, int type) { IclusterIGC* pcluster = m_pmodel->GetCluster(); pcluster->GetClusterSite()->AddExplosion( m_pmodel->GetPosition() + vecPosition * m_pmodel->GetOrientation(), scale, type); } void AddPulse (float fExplodeTime, const Vector& vecPosition, float fRadius, const Color& color) { if ((m_pmodel->GetObjectType()) == OT_warp) { // tell the alephgeo about the impending bomb m_peventSourceAleph->Trigger(fExplodeTime); } } void AddHullHit(const Vector& vecPosition, const Vector& vecNormal) { if (m_pthing) m_pthing->AddHullHit(vecPosition, vecNormal); } void SetAfterburnerThrust(const Vector& thrust, float power) { if (m_pthing) { m_pthing->SetAfterburnerThrust(thrust, power); } else { assert (m_pdecal); } } void AddMuzzleFlare(const Vector& vecEmissionPoint, float duration) { if (this == trekClient.GetShip()->GetThingSite()) GetWindow()->AddMuzzleFlare(vecEmissionPoint, duration); } void AddFlare(Time timeArg, const Vector& vecPosition, int id, const Vector* ellipseEquation) { if (m_pthing->GetFlareCount() < 4.0f) { TRef<Number> ptimeArg = GetWindow()->GetTime(); TRef<Number> ptime = Subtract(ptimeArg, ptimeArg->MakeConstant()); m_pthing->AddFlare( new TextureGeo( trekClient.m_pgeoFlares[id], new AnimatedImage( ptime, trekClient.m_pimageFlare ) ), ptime, -vecPosition, //NYI we can avoid the - by changing the Geo ellipseEquation ); } } void SetVisible(unsigned char render) { if (m_pthing) { bool vship = render == c_ucRenderAll; m_pthing->SetVisible(render >= c_ucRenderTrail); m_pthing->SetVisibleShip(vship); if (m_pvisibleGeoBolt) { m_pvisibleGeoBolt->SetVisible(vship); } } } ThingGeo* GetThingGeo() { return m_pthing; } Geo* GetGeo() { if (m_pthingGeo) { return m_pthingGeo; } else { if (m_pdecal) { return m_pdecal; } else { return m_pbuildeffect; } } } void SetPosition(const Vector& position) { if (m_pthing) { m_pthing->SetPosition(position); } else if (m_pdecal) { m_pdecal->SetPosition(position); } else if (m_pbuildeffect) m_pbuildeffect->SetPosition(position); } float GetRadius(void) { if (m_pthing) { return m_pthing->GetRadius(); } else if (m_pdecal) { return sqrt2; } else if (m_pbuildeffect) return m_pbuildeffect->GetRadius(); else return 0.0f; } void SetRadius(float r) { m_radius = r; if (m_pdecal) { if (m_pdecal->GetForward().IsZero()) m_pdecal->SetScale(r / sqrt2); else m_pdecal->SetForward(m_pdecal->GetForward().Normalize() * m_radius); } else if (m_pthing) { assert (m_pthing); //m_pthing->Update(); m_pthing->SetRadius(r); } else if (m_pbuildeffect) { m_pbuildeffect->SetRadius(r); } } void SetColors(float aInner, float fInner, float fOuter) { assert (m_pbuildeffect); m_pbuildeffect->SetColors(aInner, fInner, fOuter); } void SetOrientation(const Orientation& orientation) { if (m_pthing) m_pthing->SetOrientation(orientation); else if (m_pdecal) { if (!m_pdecal->GetForward().IsZero()) m_pdecal->SetForward(orientation.GetBackward() * -m_radius); } } void Spin(float r) { if (m_pdecal) { assert (!m_pthing); m_pdecal->SetAngle(m_pdecal->GetAngle() + r); } } void SetTexture(const char* pszTextureName) { assert (m_pthing); m_pthing->SetTexture(GetWindow()->GetModeler()->LoadImage(pszTextureName, false)); } HRESULT LoadEffect(const Color& color) { m_pbuildeffect = CreateBuildEffectGeo(GetWindow()->GetModeler(), GetWindow()->GetTime(), color); return S_OK; } HRESULT LoadDecal(const char* textureName, bool bDirectional, float width) { ZAssert(m_pthing == NULL && m_pdecal == NULL); // BUILD_DX9 GetEngine()->SetEnableMipMapGeneration( true ); // BUILD_DX9 Number* ptime = GetWindow()->GetTime(); TRef<AnimatedImage> pimage = GetWindow()->LoadAnimatedImage( Divide( Subtract(ptime, ptime->MakeConstant()), new Number(2) // number of seconds to animate through images ), ZString(textureName) + "bmp" ); if (pimage) { m_pdecal = new DecalGeo( pimage, Color::White(), Vector::GetZero(), Vector::GetZero(), Vector::GetZero(), width, 0 ); if (bDirectional) { m_pdecal->SetForward(Vector(0, 0, -1)); } // BUILD_DX9 GetEngine()->SetEnableMipMapGeneration( false ); // BUILD_DX9 return S_OK; } // BUILD_DX9 GetEngine()->SetEnableMipMapGeneration( false ); // BUILD_DX9 return E_FAIL; } HRESULT LoadModel( int options, const char* modelName, const char* textureName ) { HRESULT rc = S_OK; ZAssert(m_pthing == NULL && m_pdecal == NULL); if (modelName) { // BUILD_DX9 bool bOldColorKeyValue = GetModeler()->SetColorKeyHint( false ); GetEngine()->SetEnableMipMapGeneration( true ); // BUILD_DX9 m_pthing = ThingGeo::Create( GetWindow()->GetModeler(), GetWindow()->GetTime() ); m_pthingGeo = m_pthing->GetGeo(); if (textureName && ((!isalpha(textureName[0])) || (strcmp(modelName, textureName) == 0))) { textureName = NULL; } TRef<Image> pimageTexture; if (textureName) { pimageTexture = GetModeler()->LoadImage(textureName, false); } TRef<INameSpace> pns = GetModeler()->GetNameSpace(modelName); if (pns != NULL) { rc = m_pthing->LoadMDL(options, pns, pimageTexture); } else { // BUILD_DX9 GetModeler()->SetColorKeyHint( bOldColorKeyValue ); GetEngine()->SetEnableMipMapGeneration( false ); // BUILD_DX9 return E_FAIL; } #ifdef _DEBUG { bool bAnimation; ZString str = ZString(modelName) + "_m.x"; TRef<Number> pnumber = new Number(0.0f); TRef<Geo> pgeo = GetModeler()->LoadXFile(str, pnumber, bAnimation, false); if (pgeo) { m_pthing->SetBoundsGeo( pgeo /* new TransformGeo( Geo::GetIcosahedron(), new ScaleTransform(2.0f) ) */ ); } } #endif // BUILD_DX9 GetModeler()->SetColorKeyHint( bOldColorKeyValue ); GetEngine()->SetEnableMipMapGeneration( false ); // BUILD_DX9 } return rc; } void SetTrailColor(const Color& color) { if (m_pthing) m_pthing->SetTrailColor(color); else { assert (m_pdecal); } } HRESULT LoadAleph(const char* textureName) { ZAssert(m_pthing == NULL && m_pdecal == NULL); m_pthing = ThingGeo::Create( GetWindow()->GetModeler(), GetWindow()->GetTime() ); m_pthingGeo = m_pthing->GetGeo(); TRef<Image> pimageAleph = GetWindow()->GetModeler()->LoadImage(ZString(textureName) + "bmp", false); if (pimageAleph) { m_peventSourceAleph = new TEvent<float>::SourceImpl; HRESULT hr = m_pthing->Load( 0, CreateAlephGeo( GetWindow()->GetModeler(), m_peventSourceAleph, GetWindow()->GetTime() ), pimageAleph ); return hr; } return E_FAIL; } HRESULT LoadMine(const char* textureName, float strength, float radius) { ZAssert(m_pthing == NULL && m_pdecal == NULL); m_pthing = ThingGeo::Create( GetWindow()->GetModeler(), GetWindow()->GetTime() ); m_pthingGeo = m_pthing->GetGeo(); TRef<Surface> psurface = GetWindow()->GetModeler()->LoadSurface(ZString(textureName) + "bmp", true); if (psurface) { m_pmineFieldGeo = CreateMineFieldGeo(psurface, strength, radius); HRESULT hr = m_pthing->Load(0, m_pmineFieldGeo, NULL); return hr; } return E_FAIL; } void SetMineStrength(float strength) { m_pmineFieldGeo->SetStrength(strength); } void UpdateScreenPosition( const Point& pointScreenPosition, float fScreenRadius, float distanceToEdge, unsigned char ucRadarState ) { m_pointScreenPosition = pointScreenPosition; m_fScreenRadius = fScreenRadius; m_distanceToEdge = distanceToEdge; m_ucRadarState = ucRadarState; } const Point& GetScreenPosition(void) const { return m_pointScreenPosition; } float GetDistanceToEdge() { return m_distanceToEdge; } float GetScreenRadius() { return m_fScreenRadius; } unsigned char GetRadarState() { return m_ucRadarState; } void SetCluster(ImodelIGC* pmodel, IclusterIGC* pcluster) { ModelAttributes ma = pmodel->GetAttributes(); m_bSideVisibility = (ma & c_mtSeenBySide) != 0; m_bIsShip = (pmodel->GetObjectType() == OT_ship); if (pcluster) { if (((ma & c_mtPredictable) && trekClient.m_fm.IsConnected()) || !m_bSideVisibility) { m_sideVisibility.fVisible(true); m_sideVisibility.CurrentEyed(true); //Xynth #100 7/2010 switch (pmodel->GetObjectType()) { case OT_asteroid: trekClient.GetClientEventSource()-> OnDiscoveredAsteroid((IasteroidIGC*)pmodel); break; case OT_station: trekClient.GetClientEventSource()-> OnDiscoveredStation((IstationIGC*)pmodel); break; case OT_probe: { IprobeTypeIGC* ppt = ((IprobeIGC*)pmodel)->GetProbeType(); //Turkey #354 3/13 treat ripcord probes and warn probes differently if ( ppt->HasCapability(c_eabmWarn) || ppt->GetRipcordDelay() >= 0.0f) { IsideIGC* pside = pmodel->GetSide(); AssetMask am = (ppt->GetRipcordDelay() >= 0.0f)? c_amEnemyTeleport : c_amEnemyProbe; if ( (pside != trekClient.GetSide()) && (!pside->AlliedSides(pside,trekClient.GetSide())) ) //ALLY - imago 7/3/09 { assert (pside); ClusterSite* pcs = pcluster->GetClusterSite(); pcs->SetClusterAssetMask(pcs->GetClusterAssetMask() | am); trekClient.PostText(true, START_COLOR_STRING "%s %s" END_COLOR_STRING " spotted in %s", (PCC) ConvertColorToString (pside->GetColor ()), pside->GetName(), GetModelName(pmodel), pcluster->GetName()); } else if (ppt->GetRipcordDelay() >= 0.0f) { trekClient.PostText(true, "%s deployed in %s", GetModelName(pmodel), pcluster->GetName()); } } } } } else UpdateSideVisibility(pmodel, pcluster); } else { if (m_pSoundSite) m_pSoundSite->StopSounds(); } } void UpdateSideVisibility(ImodelIGC* pmodel, IclusterIGC* pcluster) { //Xynth #100 7/2010 bool currentEye = false; //We can only update it if we have one & if the client is actually on a side. if (m_bSideVisibility && trekClient.GetSide()) { //Update the visibility of hidden or non-static objects //(visibile static objects stay visible) //if (!(m_sideVisibility.fVisible() && (pmodel->GetAttributes() & c_mtPredictable))) Xynth #100 we need to run test for static objects //{ //We, trivially, see anything on our side. beyond that ... Imago ALLY VISIBILITY 7/11/09 //does the ship that saw the object last still see it //(if such a ship exists) if ( (trekClient.GetSide() == pmodel->GetSide()) || (trekClient.GetSide()->AlliedSides(pmodel->GetSide(),trekClient.GetSide()) && trekClient.MyMission()->GetMissionParams().bAllowAlliedViz) || (m_sideVisibility.pLastSpotter() && m_sideVisibility.pLastSpotter()->InScannerRange(pmodel) && trekClient.GetSide() == m_sideVisibility.pLastSpotter()->GetSide()) || (m_sideVisibility.pLastSpotter() && (trekClient.GetSide()->AlliedSides(m_sideVisibility.pLastSpotter()->GetSide(),trekClient.GetSide()) && trekClient.GetSide() != m_sideVisibility.pLastSpotter()->GetSide()) && m_sideVisibility.pLastSpotter()->InScannerRange(pmodel) && trekClient.MyMission()->GetMissionParams().bAllowAlliedViz) ) { //yes currentEye = true; //Xynth #100 7/2010 if (!m_sideVisibility.fVisible()) { if (m_bIsShip) { //Spunky #275 static Time lastVisSndPlayed = 0; Time now = Time::Now(); IsideIGC* pside = pmodel->GetSide(); if (now - lastVisSndPlayed > 5.0f) //Spunky #275 { if ((pside != trekClient.GetSide()) && (!pside->AlliedSides(pside,trekClient.GetSide()))) //ALLY Imago 7/3/09 { trekClient.PlaySoundEffect(newShipSound, pmodel); } else { trekClient.PlaySoundEffect(newEnemySound, pmodel); } lastVisSndPlayed = now; } } //Xynth #100 7/2010 m_sideVisibility.fVisible(true); } } else { //do it the hard way currentEye = false; //Xynth #100 7/2010 m_sideVisibility.fVisible(false); for (ScannerLinkIGC* l = pcluster->GetClusterSite()->GetScanners(0)->first(); (l != NULL); l = l->next()) { IscannerIGC* s = l->data(); assert (s->GetCluster() == pcluster); if (s->InScannerRange(pmodel)) { //Ship s's side does not see the ship but this ship does if (m_bIsShip) trekClient.PlaySoundEffect(newShipSound, pmodel); currentEye = true; //Xynth #100 7/2010 m_sideVisibility.fVisible(true); m_sideVisibility.pLastSpotter(s); if (trekClient.MyMission()->GetMissionParams().bAllowAlliedViz) //ALLY should be SCAN Imago 7/13/09 { //lets get a list of allied sideIDs for (SideLinkIGC* psidelink = trekClient.GetCore()->GetSides()->first(); (psidelink != NULL); psidelink = psidelink->next()) { IsideIGC* otherside = psidelink->data(); //this spotter's side is ally...and not ours...and we dont already see it if (s->GetSide()->AlliedSides(s->GetSide(),otherside) && s->GetSide() != otherside && !pmodel->SeenBySide(otherside)) pmodel->SetSideVisibility(otherside,true); } } } } } //} m_sideVisibility.CurrentEyed(currentEye); currentEye = currentEye || (m_sideVisibility.fVisible() && (pmodel->GetAttributes() & c_mtPredictable)); m_sideVisibility.fVisible(currentEye); } } bool GetSideVisibility(IsideIGC* side) { assert (side); if (Training::IsTraining ()) { if ((trekClient.GetShip ()->GetSide () != side) && (Training::GetTrainingMissionID () != Training::c_TM_6_Practice_Arena)) return false; } return m_sideVisibility.fVisible(); } bool GetCurrentEye(IsideIGC* side) { assert (side); return m_sideVisibility.CurrentEyed(); } void SetSideVisibility(IsideIGC* side, bool fVisible) { if (m_bSideVisibility && (side == trekClient.GetSide()))// || (side->AlliedSides(side,trekClient.GetSide()) && trekClient.MyMission()->GetMissionParams().bAllowAlliedViz) ) ) //imago viz ALLY VISIBILITY 7/11/09 { m_sideVisibility.fVisible(fVisible); m_sideVisibility.CurrentEyed(fVisible); } if (fVisible) { switch (m_pmodel->GetObjectType()) { case OT_asteroid: trekClient.GetClientEventSource()-> OnDiscoveredAsteroid((IasteroidIGC*)m_pmodel); break; case OT_station: trekClient.GetClientEventSource()-> OnDiscoveredStation((IstationIGC*)m_pmodel); break; } } } virtual void ActivateBolt(void) { if (m_pmodel->GetVisibleF()) { float r = 0.5f * m_pmodel->GetRadius(); Vector f = m_pmodel->GetOrientation().GetBackward(); Vector p1 = m_pmodel->GetPosition() - f * r; //Hack till we get an emit point Vector p2 = p1 - (100.0f + r) * f; if (m_pvisibleGeoBolt) { m_pvvBoltP1->SetValue(p1); m_pvvBoltP2->SetValue(p2); } else { m_pvvBoltP1 = new ModifiableVectorValue(p1); m_pvvBoltP2 = new ModifiableVectorValue(p2); m_pvisibleGeoBolt = new VisibleGeo( CreateBoltGeo( m_pvvBoltP1, m_pvvBoltP2, 0.125f, GetModeler()->LoadSurface("lightningbmp", true) ) ); m_pmodel->GetCluster()->GetClusterSite()->GetGroupScene()->AddGeo(m_pvisibleGeoBolt); } } } virtual void DeactivateBolt(void) { if (m_pvisibleGeoBolt) { m_pvisibleGeoBolt->SetEmpty(); m_pvisibleGeoBolt = NULL; } } virtual int GetMask(void) const { return m_mask; } virtual void SetMask(int mask) { m_mask = mask; } virtual void OrMask(int mask) { m_mask |= mask; } virtual void AndMask(int mask) { m_mask &= mask; } virtual void XorMask(int mask) { m_mask ^= mask; } // updates the current sounds for this object acording to its state. void UpdateSounds(DWORD dwElapsedTime) { if (m_pSoundSite) m_pSoundSite->UpdateSounds(dwElapsedTime); m_bPlayedHitSoundThisFrame = false; }; // stops all sounds on this object - usually used when changing clusters. void StopSounds() { if (m_pSoundSite) m_pSoundSite->StopSounds(); }; TRef<ISoundPositionSource> GetSoundSource() { if (!m_pSoundSite) m_pSoundSite = new SoundSite(m_pmodel); return m_pSoundSite->GetSoundSource(); }; TRef<ISoundPositionSource> GetSoundSource(const Vector& vectOffset) { if (!m_pSoundSite) m_pSoundSite = new SoundSite(m_pmodel); return m_pSoundSite->GetSoundSource(vectOffset); }; void RegisterHit(float fAmount, const Vector& vectOffset, bool bAbsorbedByShield = false) { // REVIEW: at the moment, this should only be called for ships assert(m_bIsShip); if (!m_bPlayedHitSoundThisFrame) { m_bPlayedHitSoundThisFrame = true; // figure out which sound to play SoundID soundId; if (m_pmodel == trekClient.GetShip()->GetSourceShip()) { if (bAbsorbedByShield) soundId = myShieldHitSound; else soundId = myHullHitSound; } else { if (bAbsorbedByShield) soundId = otherShieldHitSound; else soundId = otherHullHitSound; } // play the appropriate sound TRef<ISoundPositionSource> psource = GetSoundSource(vectOffset); m_pSoundSite->AddHitSound(trekClient.StartSound(soundId, psource)); } } TRef<ClusterSite> GetClusterSite() { return m_pmodel->GetCluster()->GetClusterSite(); } ////////////////////////////////////////////////////////////////////////////// // // Members // ////////////////////////////////////////////////////////////////////////////// private: TRef<BuildEffectGeo> m_pbuildEffectGeo; TRef<TEvent<float>::SourceImpl> m_peventSourceAleph; SideVisibility m_sideVisibility; TRef<VisibleGeo> m_pvisibleGeoBolt; TRef<ThingGeo> m_pthing; TRef<Geo> m_pthingGeo; TRef<DecalGeo> m_pdecal; TRef<BuildEffectGeo> m_pbuildeffect; TRef<MineFieldGeo> m_pmineFieldGeo; ImodelIGC* m_pmodel; Point m_pointScreenPosition; TRef<ModifiableVectorValue> m_pvvBoltP1; TRef<ModifiableVectorValue> m_pvvBoltP2; float m_fScreenRadius; float m_radius; float m_distanceToEdge; int m_mask; bool m_bSideVisibility; unsigned char m_ucRadarState; bool m_bIsShip; bool m_bPlayedHitSoundThisFrame; SoundSite* m_pSoundSite; }; const float c_fGrooveLevelDuration = 10.0f; WinTrekClient::WinTrekClient(void) : mountSelected(-1), fGroupFire(true), wmOld(0), bInitTrekThrottle (true), joyThrottle(true), trekThrottle(-1.0f), fOldJoyThrottle (-1.0f), m_sideidLastWinner(NA), m_bWonLastGame(false), m_bLostLastGame(false), m_nNumEndgamePlayers(0), m_nNumEndgameSides(0), m_vplayerEndgameInfo(NULL), m_nGrooveLevel(0), m_bDisconnected(false), m_strDisconnectReason(""), m_bFilterChatsToAll(false), m_bFilterQuickComms(false), m_bFilterUnknownChats(true), //TheBored 30-JUL-07: Filter Unknown Chat patch m_dwFilterLobbyChats(3) //TheBored 25-JUN-07: Changed value to 3 (Don't Filter Lobby) { // restore the CD Key from the registry HKEY hKey; if (ERROR_SUCCESS == ::RegCreateKeyEx(HKEY_LOCAL_MACHINE, ALLEGIANCE_REGISTRY_KEY_ROOT, 0, L"", REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hKey, NULL)) { DWORD dwSize = c_cbCDKey; DWORD dwType; char szCDKey[c_cbCDKey]; if (::RegQueryValueExA(hKey, "CDKey", NULL, &dwType, (unsigned char*)szCDKey, &dwSize) == ERROR_SUCCESS && dwType == REG_SZ && dwSize != 0) { BaseClient::SetCDKey(szCDKey, 0); } ::RegCloseKey(hKey); } } WinTrekClient::~WinTrekClient(void) { if (m_vplayerEndgameInfo) delete m_vplayerEndgameInfo; } void WinTrekClient::Initialize(Time timeNow) { BaseClient::Initialize(timeNow); GetShip()->CreateDamageTrack(); m_pwindow = GetWindow(); m_pengine = m_pwindow->GetEngine(); m_pmodeler = m_pwindow->GetModeler(); { TRef<Surface> psurfaceFlare = m_pmodeler->LoadSurface(AWF_SHIELD_FLARE_TEXTURE, true); ZAssert(psurfaceFlare); m_pimageFlare = new AnimatedImage(m_pwindow->GetTime(), psurfaceFlare); } { TRef<INameSpace> pns = m_pmodeler->GetNameSpace(AWF_SHIELD_FLARE); if (pns) { CastTo(m_pgeoFlares[0], pns->FindMember("lens30")); CastTo(m_pgeoFlares[1], pns->FindMember("lens60")); CastTo(m_pgeoFlares[2], pns->FindMember("lens90")); } } // // Explosion images // m_pimageShockWave = GetModeler()->LoadImage(AWF_SHOCKWAVE, true); m_vpimageExplosion[0].SetCount(5); m_vpimageExplosion[0].Set(0, LoadExplosionImage(AWF_EXPLOSION_00)); m_vpimageExplosion[0].Set(1, LoadExplosionImage(AWF_EXPLOSION_01)); m_vpimageExplosion[0].Set(2, LoadExplosionImage(AWF_EXPLOSION_02)); m_vpimageExplosion[0].Set(3, LoadExplosionImage(AWF_EXPLOSION_03)); m_vpimageExplosion[0].Set(4, LoadExplosionImage(AWF_EXPLOSION_04)); m_vpimageExplosion[1].SetCount(1); m_vpimageExplosion[1].Set(0, m_vpimageExplosion[0][3]); m_vpimageExplosion[2].SetCount(1); m_vpimageExplosion[2].Set(0, m_vpimageExplosion[0][0]); m_vpimageExplosion[3].SetCount(2); m_vpimageExplosion[3].Set(0, m_vpimageExplosion[0][4]); m_vpimageExplosion[3].Set(1, m_vpimageExplosion[0][1]); m_vpimageExplosion[4].SetCount(2); m_vpimageExplosion[4].Set(0, m_vpimageExplosion[0][4]); m_vpimageExplosion[4].Set(1, m_vpimageExplosion[0][1]); m_vpimageExplosion[5].SetCount(2); m_vpimageExplosion[5].Set(0, m_vpimageExplosion[0][4]); m_vpimageExplosion[5].Set(1, m_vpimageExplosion[0][2]); m_vpimageExplosion[6].SetCount(1); m_vpimageExplosion[6].Set(0, m_vpimageExplosion[0][3]); m_vpimageExplosion[7].SetCount(2); m_vpimageExplosion[7].Set(0, m_vpimageExplosion[0][4]); m_vpimageExplosion[7].Set(1, m_vpimageExplosion[0][2]); } TRef<AnimatedImage> WinTrekClient::LoadExplosionImage(const ZString& str) { // BUILD_DX9 // Load source AnimatedImage into system memory rather than VRAM. return new AnimatedImage(new Number(0.0f), GetModeler()->LoadSurface(str, true, true, true)); //#else // return new AnimatedImage(new Number(0.0f), GetModeler()->LoadSurface(str, true)); // BUILD_DX9 } void WinTrekClient::Terminate(void) { m_pgeoFlares[2] = NULL; m_pgeoFlares[1] = NULL; m_pgeoFlares[0] = NULL; m_pimageFlare = NULL; m_pmodeler = NULL; m_pengine = NULL; m_pwindow = NULL; m_psoundAmbient = NULL; m_psoundMissileWarning = NULL; BaseClient::Terminate(); } ImissionIGC* WinTrekClient::ResetStaticData (void) { Time now = m_pCoreIGC->GetLastUpdate (); FlushGameState(); m_pCoreIGC = CreateMission(); Initialize(now); m_pMissionInfo = new MissionInfo(static_cast<DWORD> (m_pCoreIGC->GetMissionID ())); return m_pCoreIGC; } IpartIGC* WinTrekClient::GetCargoPart(void) { assert (mountSelected < 0 && mountSelected >= -c_maxCargo); IpartIGC* ppart = GetShip()->GetMountedPart(NA, mountSelected); // make sure it's the first item of a grouped set of items. if (mountSelected < -1) // first item in the list is always the first item of its type { mountSelected++; NextCargoPart(); ppart = GetShip()->GetSourceShip()->GetMountedPart(NA, mountSelected); } return ppart; } void WinTrekClient::NextCargoPart(void) { // select a real part or the first empty cargo slot bool bFoundPart = false; do { --mountSelected; if (mountSelected < -c_maxCargo) mountSelected = -1; IpartIGC *ppart = GetShip()->GetSourceShip()->GetMountedPart(NA, mountSelected); IpartTypeIGC *ppartType = ppart ? ppart->GetPartType() : NULL; bFoundPart = true; // If this is ammo/missiles/etc, is this the first instance of this part? ObjectType ot = ppart ? ppart->GetObjectType() : NA; if (ppart == NULL || ot == OT_pack || ot == OT_magazine || ot == OT_dispenser) { for (Mount mountPrev = mountSelected + 1; mountPrev < 0; ++mountPrev) { IpartIGC *ppartPrev = GetShip()->GetSourceShip()->GetMountedPart(NA, mountPrev); IpartTypeIGC *ppartTypePrev = ppartPrev ? ppartPrev->GetPartType() : NULL; if (ppartType == ppartTypePrev) { bFoundPart = false; break; } } } } while (!bFoundPart); } Mount WinTrekClient::GetSelectedCargoMount() { assert (mountSelected < 0 && mountSelected >= -c_maxCargo); IpartIGC* ppart = GetShip()->GetSourceShip()->GetMountedPart(NA, mountSelected); // make sure it's the first empty slot if it's a slot. if (mountSelected < -1 && !ppart) { mountSelected++; NextCargoPart(); } return mountSelected; } void WinTrekClient::OnReload(IpartIGC* ppart, bool bConsumed) { if (bConsumed && ppart == GetCargoPart()) { NextCargoPart(); GetCore()->GetIgcSite()->LoadoutChangeEvent(GetShip(), ppart, c_lcCargoSelectionChanged); } } bool WinTrekClient::SelectCargoPartOfType(EquipmentType et, PartMask maxPartMask, IpartTypeIGC* pptNotThis) { IpartIGC* ppartStart = GetCargoPart(); if (ppartStart && ( (ppartStart->GetEquipmentType() != et) || ((ppartStart->GetPartType()->GetPartMask() & ~maxPartMask) != 0) || (ppartStart->GetPartType() == pptNotThis)) || (!ppartStart && !pptNotThis)) { IpartIGC* ppart; do { NextCargoPart(); ppart = GetCargoPart(); } while (ppart != ppartStart && ( ppart && ( ppart->GetEquipmentType() != et || ((ppart->GetPartType()->GetPartMask() & ~maxPartMask) != 0) || ppart->GetPartType() == pptNotThis) || (!ppart && !pptNotThis) ) ); if (ppart == ppartStart) { // no part in cargo found return false; } return true; } else { return true; } } void WinTrekClient::LoadoutChangeEvent(IshipIGC* pship, IpartIGC* ppart, LoadoutChange lc) { if (pship == trekClient.GetShip()) { if (lc == c_lcHullChange) { GetWindow()->ResetCameraFOV(); } } BaseClient::LoadoutChangeEvent(pship, ppart, lc); } IObject* WinTrekClient::LoadRadarIcon(const char* szName) { Surface* psurface; if (szName && (szName[0] != '\0')) { psurface = GetModeler()->LoadSurface(ZString(szName) + "bmp", true); assert (psurface); //psurface->SetColorKey(Color(0, 0, 0)); } else psurface = NULL; return psurface; } void WinTrekClient::ChangeCluster(IshipIGC* pship, IclusterIGC* pclusterOld, IclusterIGC* pclusterNew) { if (pship == GetShip()) { if (pclusterOld && m_fm.IsConnected()) pclusterOld->SetActive(false); BaseClient::ChangeCluster(pship, pclusterOld, pclusterNew); if (pclusterNew && m_fm.IsConnected()) pclusterNew->SetActive(true); // if there was an old cluster, stop any sound sources in the old cluster if (pclusterOld && (pclusterOld != GetViewCluster())) { // stop the sounds on every object in the sector for (ModelLinkIGC* pml = pclusterOld->GetModels()->first(); (pml != NULL); pml = pml->next()) { ImodelIGC* pmodel = pml->data(); ThingSite* pts = pmodel->GetThingSite(); if (pts) { ((ThingSiteImpl*)pts)->StopSounds(); } } } // if we have a command to go to this cluster, clear the command. for (Command i = 0; i < c_cmdMax; i++) { ImodelIGC* ptarget = pship->GetCommandTarget(i); // if this command has a cluster buoy in this cluster... if (ptarget && ptarget->GetObjectType() == OT_buoy && ((IbuoyIGC*)ptarget)->GetBuoyType() == c_buoyCluster && ((IbuoyIGC*)ptarget)->GetCluster() == pclusterNew) { // clear the command pship->SetCommand(i, NULL, c_cidNone); } } // notify the UI of the change GetWindow()->SetCluster(pclusterNew); GetWindow()->PositionCommandView(NULL, 0.0f); trekClient.GetClientEventSource()->OnClusterChanged(pclusterNew); // pkk - fix for #9 - disable the afterburner on sector change trekClient.GetShip()->SetStateBits(afterburnerButtonIGC, 0); } } void WinTrekClient::ChangeStation(IshipIGC* pship, IstationIGC* pstationOld, IstationIGC* pstationNew) { if (pship == GetShip() && trekClient.MyMission()->GetStage() == STAGE_STARTED) { if (pstationNew) { if (pstationOld == NULL) { ConsoleImage* pconsole = GetWindow()->GetConsoleImage(); if (pconsole) { pconsole->SetDisplayMDL(pstationNew->GetSide()->GetCivilization()->GetHUDName()); if ((trekClient.GetShip()->GetParentShip() == NULL) && !trekClient.GetShip()->IsGhost()) { trekClient.RestoreLoadout(pstationNew); } } if (GetWindow()->screen() == ScreenIDCombat) { trekClient.wmOld = 0; //imago 8/10/09 turreted ship rearms @ allied base fix ALLY if ((pstationNew->GetSide() != trekClient.GetSide()) && (trekClient.GetShip()->GetParentShip() == NULL) && (trekClient.GetShip()->GetChildShips()->n() != 0) && (pstationNew->GetSide()->AlliedSides(pstationNew->GetSide(),trekClient.GetSide()))) { if (IsLockedDown()) EndLockDown(lockdownDonating | lockdownLoadout | lockdownTeleporting); trekClient.BuyLoadout(trekClient.GetShip(), true); return; } if (GetWindow()->GetCameraMode() != TrekWindow::cmExternalOverride && (pstationNew->GetSide() == trekClient.GetSide())) { if ((!Training::IsTraining ()) || (Training::GetTrainingMissionID () != Training::c_TM_5_Command_View)) { GetWindow()->SetViewMode(trekClient.GetShip()->IsGhost() ? TrekWindow::vmCommand : TrekWindow::vmHangar); PlaySoundEffect(dockedSound); PlaySoundEffect(salWelcomeHomeSound); } } } } else { //NYI do anything appropriate for switching stations } } else { assert (pstationOld); //Save the loadout except for the launch in underwear case (which should be very rare) assert (pstationOld); IshipIGC* pshipSource = trekClient.GetShip()->GetSourceShip(); assert (pshipSource); IhullTypeIGC* pht = pshipSource->GetBaseHullType(); assert (pht); pstationOld->RepairAndRefuel(pshipSource); /* const char* pszDisplayMDL; if (pshipSource == trekClient.GetShip()) { //If no weapon is selected, try to select a weapon { Mount nHardpoints = pht->GetMaxFixedWeapons(); if ((trekClient.m_selectedWeapon >= nHardpoints) || (trekClient.GetShip()->GetMountedPart(ET_Weapon, trekClient.m_selectedWeapon) == NULL)) { trekClient.NextWeapon(); } } pszDisplayMDL = pht->GetPilotHUDName(); } else { Mount turretID = trekClient.GetShip()->GetTurretID(); if (turretID == NA) { pszDisplayMDL = pht->GetObserverHUDName(); } else { pszDisplayMDL = pht->GetHardpointData(turretID).hudName; } } GetWindow()->GetConsoleImage()->SetDisplayMDL(pszDisplayMDL); */ RequestViewCluster(NULL); GetWindow()->OverrideCamera(trekClient.m_now, pstationOld, false); //joyThrottle = true; //trekThrottle = -1.0f; OverrideThrottle (1.0f); trekClient.GetShip()->SetStateBits(coastButtonIGC, 0); } } } void WinTrekClient::OverrideCamera(ImodelIGC* pmodel) { GetWindow()->OverrideCamera(trekClient.m_now, pmodel, false); } void WinTrekClient::TargetKilled(ImodelIGC* pmodel) { ImodelIGC* pmodelCurrent = trekClient.GetShip()->GetCommandTarget(c_cmdCurrent); if (pmodel == pmodelCurrent) { IshipIGC* pshipSource = trekClient.GetShip()->GetSourceShip(); if (pshipSource->GetCluster()) { extern int GetSimilarTargetMask(ImodelIGC* pmodel); int mask = GetSimilarTargetMask(pmodel) | c_ttNearest; int abm; if (mask == (c_ttShip | c_ttEnemy | c_ttNearest)) abm = c_habmRescue; else abm = 0; ImodelIGC* pmodelTarget = FindTarget(pshipSource, mask, pmodel, NULL, NULL, NULL, abm); if ((pmodelTarget == NULL) && abm) { pmodelTarget = FindTarget(pshipSource, mask, pmodel, NULL, NULL, NULL, c_habmMiner | c_habmBuilder); if (pmodelTarget == NULL) pmodelTarget = FindTarget(pshipSource, mask, pmodel); } if (pmodelTarget == pmodel) pmodelTarget = NULL; GetWindow()->SetTarget(pmodelTarget, c_cidDefault); if (trekClient.autoPilot() && (trekClient.GetShip()->GetCommandTarget(c_cmdPlan) == pmodel)) trekClient.SetAutoPilot(true); } } } void WinTrekClient::ShipWarped(IshipIGC* pship, SectorID sidOld, SectorID sidNew) { /* if ((GetWindow()->GetViewMode() == TrekWindow::vmCommand) && trekClient.GetShip()->GetStation()) { IclusterIGC* pcluster = trekClient.GetViewCluster(); if (pcluster && (pcluster->GetObjectID() == sidOld)) { const ShipListIGC* pships = GetWindow()->GetConsoleImage()->GetSubjects(); if (pships && pships->find(pship)) RequestViewCluster(trekClient.m_pCoreIGC->GetCluster(sidNew)); } } */ } void WinTrekClient::PostNotificationText(ImodelIGC* pmodel, bool bCritical, const char* pszText, ...) { if (GetWindow()->GetConsoleImage() && pmodel == trekClient.GetShip()) { assert (pszText); const size_t size = 256; char bfr[size]; va_list vl; va_start(vl, pszText); _vsnprintf(bfr, size, pszText, vl); va_end(vl); if (bCritical) { PlaySoundEffect(newCriticalMsgSound); GetWindow()->GetConsoleImage()->GetConsoleData()->SetCriticalTipText(bfr); } else { PlaySoundEffect(newNonCriticalMsgSound); GetWindow()->GetConsoleImage()->GetConsoleData()->SetTipText(bfr); } } } void WinTrekClient::ActivateTeleportProbe(IprobeIGC* pprobe) { IsideIGC* pside = pprobe->GetSide(); IclusterIGC* pcluster = pprobe->GetCluster(); if ( (pside != trekClient.GetSide()) && !pside->AlliedSides(pside,trekClient.GetSide()) ) //ALLY - imago 7/3/09 { assert (pside); PostText(true, START_COLOR_STRING "%s %s" END_COLOR_STRING " active in %s", (PCC) ConvertColorToString (pside->GetColor ()), pside->GetName(), GetModelName(pprobe), pcluster->GetName()); } else { PostText(true, "%s active in %s", GetModelName(pprobe), pcluster->GetName()); } } //also called when a warn probe is destroyed #354 void WinTrekClient::DestroyTeleportProbe(IprobeIGC* pprobe) { IsideIGC* pside = pprobe->GetSide(); IsideIGC* psideMe = trekClient.GetSide(); IclusterIGC* pcluster = pprobe->GetCluster(); if (pprobe->GetProbeType()->GetRipcordDelay() >= 0.0f) { if ( (pside != psideMe) && !pside->AlliedSides(pside,psideMe) ) //ALLY - imago 7/3/09 { assert (pside); ClusterSite* pcs = pcluster->GetClusterSite(); AssetMask am = pcs->GetClusterAssetMask() & ~c_amEnemyTeleport; { for (ProbeLinkIGC* ppl = pcluster->GetProbes()->first(); (ppl != NULL); ppl = ppl->next()) { IprobeIGC* pp = ppl->data(); if ((pp != pprobe) && (pp->GetSide() != psideMe) && (pp->GetProbeType()->GetRipcordDelay() >= 0.0f)) am |= c_amEnemyTeleport; } } pcs->SetClusterAssetMask(am); PostText(false, START_COLOR_STRING "%s %s" END_COLOR_STRING " in %s was destroyed", (PCC) ConvertColorToString (pside->GetColor ()), pside->GetName(), GetModelName(pprobe), pcluster->GetName()); } else { PostText(true, "%s in %s was destroyed", GetModelName(pprobe), pcluster->GetName()); } } else //is a warn probe { if ( (pside != psideMe) && !pside->AlliedSides(pside,psideMe) ) //ALLY - imago 7/3/09 { assert (pside); ClusterSite* pcs = pcluster->GetClusterSite(); AssetMask am = pcs->GetClusterAssetMask() & ~c_amEnemyProbe; { for (ProbeLinkIGC* ppl = pcluster->GetProbes()->first(); (ppl != NULL); ppl = ppl->next()) { IprobeIGC* pp = ppl->data(); if ((pp != pprobe) && (pp->GetSide() != psideMe) && pp->GetProbeType()->HasCapability(c_eabmWarn)) am |= c_amEnemyProbe; } } pcs->SetClusterAssetMask(am); } } } void WinTrekClient::PostText(bool bCritical, const char* pszText, ...) { if (GetWindow()->GetConsoleImage()) { assert (pszText); const size_t size = 256; char bfr[size]; va_list vl; va_start(vl, pszText); _vsnprintf(bfr, size, pszText, vl); va_end(vl); if (bCritical) { PlaySoundEffect(newCriticalMsgSound); GetWindow()->GetConsoleImage()->GetConsoleData()->SetCriticalTipText(bfr); } else { PlaySoundEffect(newNonCriticalMsgSound); GetWindow()->GetConsoleImage()->GetConsoleData()->SetTipText(bfr); } } } void WinTrekClient::EjectPlayer(ImodelIGC* pcredit) { GetWindow()->OverrideCamera(trekClient.m_now, pcredit, true); GetWindow()->TriggerMusic(deathMusicSound); } int WinTrekClient::GetSavePassword(){ // imago 9/14 HKEY hKey; DWORD dwType = REG_DWORD; DWORD dSave = 1; DWORD dwSize = sizeof(DWORD); if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, ALLEGIANCE_REGISTRY_KEY_ROOT, 0, KEY_READ, &hKey)) { RegQueryValueExA(hKey, "SavePW", NULL, &dwType, (PBYTE)&dSave, &dwSize); RegCloseKey(hKey); } return (int)dSave; } //Imago 9/14 ZString WinTrekClient::GetSavedPassword() { HKEY hKey; DWORD dwType; DWORD cbName = c_cbCDKey; char szPWz[c_cbCDKey]; szPWz[0] = '\0'; if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, ALLEGIANCE_REGISTRY_KEY_ROOT, 0, KEY_READ, &hKey)) { RegQueryValueExA(hKey, "PW", NULL, &dwType, (unsigned char*)&szPWz, &cbName); RegCloseKey(hKey); } ZVersionInfo vi; ZString zInfo = (LPCSTR)vi.GetCompanyName(); zInfo += (LPCSTR)vi.GetLegalCopyright(); ZString szPWt = ZString(szPWz); ZString szPWu = szPWt.Unscramble(zInfo); char * szRes = (char*)_alloca(c_cbCDKey); Strcpy(szRes,(PCC)szPWu); char * szToken; szToken = strtok(szRes,"\t"); szToken = strtok(NULL,"\t"); return szToken; } void WinTrekClient::SavePassword(ZString strPW, BOOL fSave) { DWORD dSave = (DWORD)fSave; HKEY hKey; DWORD dwSize = sizeof(DWORD); ZVersionInfo vi; ZString zInfo = (LPCSTR)vi.GetCompanyName(); zInfo += (LPCSTR)vi.GetLegalCopyright(); strPW = zInfo + "\t" + strPW; ZString strPWz = strPW.Scramble(zInfo); if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, ALLEGIANCE_REGISTRY_KEY_ROOT, 0, KEY_WRITE, &hKey)) { RegSetValueExA(hKey, "PW", NULL, REG_SZ, (const BYTE*)(const char*)strPWz, strPWz.GetLength() + 1); RegSetValueExA(hKey, "SavePW", NULL, REG_DWORD, (PBYTE)&dSave, dwSize); RegCloseKey(hKey); } } ZString WinTrekClient::GetSavedCharacterName() { HKEY hKey; DWORD dwType; DWORD cbName = c_cbName; char szName[c_cbName]; szName[0] = '\0'; if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, ALLEGIANCE_REGISTRY_KEY_ROOT, 0, KEY_READ, &hKey)) { RegQueryValueExA(hKey, "CharacterName", NULL, &dwType, (unsigned char*)&szName, &cbName); RegCloseKey(hKey); } return szName; } // void WinTrekClient::SaveCharacterName(ZString strName) { HKEY hKey; if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, ALLEGIANCE_REGISTRY_KEY_ROOT, 0, KEY_WRITE, &hKey)) { RegSetValueExA(hKey, "CharacterName", NULL, REG_SZ, (const BYTE*)(const char*)strName, strName.GetLength() + 1); RegCloseKey(hKey); } } int WinTrekClient::GetSavedWingAssignment(){ // kolie 6/10 HKEY hKey; DWORD dwType = REG_DWORD; DWORD dwWing = NA; // Imago 7/10 #149 DWORD dwSize = sizeof(DWORD); if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, ALLEGIANCE_REGISTRY_KEY_ROOT, 0, KEY_READ, &hKey)) { RegQueryValueExA(hKey, "WingAssignment", NULL, &dwType, (PBYTE)&dwWing, &dwSize); RegCloseKey(hKey); } return (int)dwWing; } void WinTrekClient::SaveWingAssignment(int index){ // kolie 6/10 HKEY hKey; DWORD dwWing; dwWing = (DWORD)index; if ( ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, ALLEGIANCE_REGISTRY_KEY_ROOT, 0, KEY_WRITE, &hKey)) { RegSetValueExA(hKey, "WingAssignment", NULL, REG_DWORD, (PBYTE)&dwWing, sizeof(DWORD) ); RegCloseKey(hKey); } } // KGJV : added utility functions for cores & server names // find the user friendly name of a core - return param if not found ZString WinTrekClient::CfgGetCoreName(const char *s) { char temp[c_cbName]; DWORD l = GetCfgInfo().GetCfgProfileString("Cores",s,s,temp,c_cbName); return ZString(temp,(int)l); } bool WinTrekClient::CfgIsOfficialCore(const char *s) { char temp[c_cbName]; DWORD l = GetCfgInfo().GetCfgProfileString("OfficialCores",s,"false",temp,c_cbName); return (_stricmp(temp,"true") == 0); } bool WinTrekClient::CfgIsOfficialServer(const char *name, const char *addr) { char temp[c_cbName]; DWORD l = GetCfgInfo().GetCfgProfileString("OfficialServers",name,"",temp,c_cbName); return (_stricmp(temp,addr) == 0); } // KGJV end class AutoDownloadProgressDialogPopup : public IPopup, public EventTargetContainer<AutoDownloadProgressDialogPopup>, public IIntegerEventSink, public IAutoUpdateSink { private: TRef<Pane> m_ppane; TRef<ButtonPane> m_pbuttonAbort; TRef<StringPane> m_pstrpaneCurrentFile; TRef<StringPane> m_pstrpaneApproxMinutes; TRef<ModifiableNumber> m_pModifiableNumberFileListPercent; TRef<ModifiableNumber> m_pModifiableNumberVerifyPercent; TRef<ModifiableNumber> m_pModifiableNumberDownloadPercent; TRef<IMessageBox> m_pmsgBox; unsigned long m_cGrandTotalBytes; // total bytes of transfer int m_cFilesCompleted; unsigned long m_cTotalFiles; const char* m_szPrevCurrentFile; // last file transfered bool m_bAborted; IAutoUpdateSink * m_pSink; bool m_bConnectToLobby; // connect to lobby once completed public: AutoDownloadProgressDialogPopup(IAutoUpdateSink * pSink, bool bConnectToLobby) : m_cFilesCompleted(0), m_bAborted(false), m_pmsgBox(NULL), m_szPrevCurrentFile(NULL), m_bConnectToLobby(bConnectToLobby), m_pSink(pSink) { // // exports // TRef<INameSpace> pnsData = GetModeler()->CreateNameSpace("autodownloaddialogdata"); pnsData->AddMember("FileListPercentDone", m_pModifiableNumberFileListPercent = new ModifiableNumber(0.0f)); pnsData->AddMember("VerifyPercentDone", m_pModifiableNumberVerifyPercent = new ModifiableNumber(0.0f)); pnsData->AddMember("DownloadPercentDone", m_pModifiableNumberDownloadPercent = new ModifiableNumber(0.0f)); // // Imports // Modeler* pmodeler = GetModeler(); TRef<INameSpace> pns = pmodeler->GetNameSpace("autodownloaddialog"); CastTo(m_ppane, pns->FindMember("AutoDownloadDialog" )); CastTo(m_pbuttonAbort, pns->FindMember("AutoDownloadAbortButton" )); CastTo(m_pstrpaneCurrentFile, pns->FindMember("AutoDownloadCurrentFileStringPane" )); CastTo(m_pstrpaneApproxMinutes, pns->FindMember("AutoDownloadApproxMinutes" )); // mdvalley: '05 needs a pointer and class name for arg1. Should still work in '03 AddEventTarget(&AutoDownloadProgressDialogPopup::OnButtonAbort, m_pbuttonAbort->GetEventSource()); pmodeler->UnloadNameSpace(pns); } virtual ~AutoDownloadProgressDialogPopup() { } //////////////////////////////////////////////////////////////////// // // IPopup methods // //////////////////////////////////////////////////////////////////// Pane* GetPane() { return m_ppane; } bool OnButtonAbort() { if(trekClient.m_pAutoDownload) trekClient.m_pAutoDownload->Abort(); return true; } //////////////////////////////////////////////////////////////////// // // Events associated with IAutoUpdateSink // //////////////////////////////////////////////////////////////////// void OnBeginDownloadProgressBar(unsigned cTotalBytes, int cFiles) { m_cGrandTotalBytes = cTotalBytes; m_cTotalFiles = cFiles; }; //////////////////////////////////////////////////////////////////// virtual void OnAutoUpdateSystemTermination(bool bErrorOccurred, bool bRestarting) { if(m_pSink) m_pSink->OnAutoUpdateSystemTermination(bErrorOccurred, bRestarting); trekClient.m_pAutoDownload = NULL; if (!bErrorOccurred) { // // Make all bars full, if not already // m_pModifiableNumberFileListPercent->SetValue(1.0f); m_pModifiableNumberFileListPercent->Update(); m_pModifiableNumberVerifyPercent->SetValue(1.0f); m_pModifiableNumberVerifyPercent->Update(); m_pModifiableNumberDownloadPercent->SetValue(1.0f); m_pModifiableNumberDownloadPercent->Update(); if (bRestarting) { GetWindow()->SetWaitCursor(); m_pmsgBox = CreateMessageBox("Restarting to complete update...", NULL, false); GetWindow()->GetPopupContainer()->OpenPopup(m_pmsgBox, false); } else { // reconnect with same settings if(m_bConnectToLobby) trekClient.ConnectToLobby(NULL); // this causes this class to be deleted GetWindow()->GetPopupContainer()->ClosePopup(m_pmsgBox); GetWindow()->RestoreCursor(); } } } //////////////////////////////////////////////////////////////////// virtual void OnUserAbort() { m_bAborted = true; // trap multiple presses of Abort if(m_pmsgBox != NULL) return; m_pmsgBox = CreateMessageBox("AutoUpdate Aborted. "); m_pmsgBox->GetEventSource()->AddSink(IIntegerEventSink::CreateDelegate(this)); // GetWindow()->screen(ScreenIDIntroScreen); Point point(c_PopupX, c_PopupY); Rect rect(point, point); GetWindow()->GetPopupContainer()->OpenPopup(m_pmsgBox, rect, false); }; //////////////////////////////////////////////////////////////////// virtual void OnRetrievingFileListProgress(unsigned long nFileSize, unsigned long cCurrentBytes) { debugf("FileList.txt %d out of %d \n", cCurrentBytes, nFileSize); m_pModifiableNumberFileListPercent->SetValue(float(cCurrentBytes)/float(nFileSize)); m_pModifiableNumberFileListPercent->Update(); } //////////////////////////////////////////////////////////////////// virtual void OnAnalysisProgress(float fPercentDone) { debugf("Verify %3.3f%% \n", 100.0f*fPercentDone); m_pModifiableNumberVerifyPercent->SetValue(float(fPercentDone)); m_pModifiableNumberVerifyPercent->Update(); } /*------------------------------------------------------------------------- * ShouldFilterFile() *------------------------------------------------------------------------- * Parameters: * szFileName: file in question * * Returns: * true iff file is not to be downloaded based on it's name. */ bool ShouldFilterFile(const char * szFileName) { // // Skip special files // #ifdef DEBUG if (_stricmp(szFileName, "AllegianceRetail.exe") == 0 || _stricmp(szFileName, "AllegianceRetail.pdb") == 0 || _stricmp(szFileName, "AllegianceRetail.map") == 0 || _stricmp(szFileName, "AllegianceRetail.sym") == 0) return true; #endif #ifdef OPTIMIZED if (_stricmp(szFileName, "AllegianceDebug.exe") == 0 || _stricmp(szFileName, "AllegianceDebug.pdb") == 0 || _stricmp(szFileName, "AllegianceDebug.map") == 0 || _stricmp(szFileName, "AllegianceDebug.sym") == 0) return true; #endif #if !defined(OPTIMIZED) || !defined(DEBUG) if (_stricmp(szFileName, "AllegianceTest.exe") == 0 || _stricmp(szFileName, "AllegianceTest.pdb") == 0 || _stricmp(szFileName, "AllegianceTest.map") == 0 || _stricmp(szFileName, "AllegianceTest.sym") == 0) return true; #endif return false; } //////////////////////////////////////////////////////////////////// virtual void OnProgress(unsigned long cTotalBytes, const char* szCurrentFile, unsigned long cCurrentFileBytes, unsigned nEstimatedSecondsLeft) { if (g_outputdebugstring) { //Imago - was DEBUG ifdef 8/16/09 char sz[80]; sprintf(sz, "%2.2f%% %i %s %i\n", 100.0f*float(cTotalBytes)/float(m_cGrandTotalBytes), cTotalBytes, szCurrentFile, cCurrentFileBytes); ZDebugOutput(sz); } // // Detect current file change // if (szCurrentFile != NULL && szCurrentFile != m_szPrevCurrentFile) { m_cFilesCompleted++; char szBuffer[15]; sprintf(szBuffer, " (%i/%i)", m_cFilesCompleted, m_cTotalFiles); m_pstrpaneCurrentFile->SetString(ZString(szCurrentFile) + ZString(szBuffer)); m_szPrevCurrentFile = szCurrentFile; } if (nEstimatedSecondsLeft != -1 && m_pstrpaneApproxMinutes) // if they have an up-to-date art file m_pstrpaneApproxMinutes->SetString(ZString("Min Left ") + ZString((((int)nEstimatedSecondsLeft-1)/60)+1)); m_pModifiableNumberDownloadPercent->SetValue(float(cTotalBytes)/float(m_cGrandTotalBytes)); m_pModifiableNumberDownloadPercent->Update(); } //////////////////////////////////////////////////////////////////// // // Events associated with IFTPSessionUpdateSink // //////////////////////////////////////////////////////////////////// virtual void OnError(char * szErrorMessage) { char * szBuffer = new char[strlen(szErrorMessage) + 100]; sprintf(szBuffer, "AutoUpdate Error \n%s ", szErrorMessage); assert(m_pmsgBox == NULL); m_pmsgBox = CreateMessageBox(szBuffer); m_pmsgBox->GetEventSource()->AddSink(IIntegerEventSink::CreateDelegate(this)); // GetWindow()->screen(ScreenIDIntroScreen); Point point(150, 8); // match this with point in OnBeginAutoUpdate() Rect rect(point, point); GetWindow()->GetPopupContainer()->OpenPopup(m_pmsgBox, rect, false); delete[] szBuffer; } //////////////////////////////////////////////////////////////////// // // Events associated with IIntegerEventSink // //////////////////////////////////////////////////////////////////// bool OnEvent(IIntegerEventSource* pevent, int value) { // // User must have pressed Okay button after error or abort // assert(m_pmsgBox); GetWindow()->GetPopupContainer()->ClosePopup(m_pmsgBox); return false; } }; IAutoUpdateSink * WinTrekClient::OnBeginAutoUpdate(IAutoUpdateSink * pSink, bool bConnectToLobby) { // destroy any open popups if (!GetWindow()->GetPopupContainer()->IsEmpty()) GetWindow()->GetPopupContainer()->ClosePopup(NULL); GetWindow()->RestoreCursor(); m_pAutoDownloadProgressDialogPopup = new AutoDownloadProgressDialogPopup(pSink, bConnectToLobby); Point point(150, 8); // match this with point in OnError() Rect rect(point, point); GetWindow()->GetPopupContainer()->OpenPopup(m_pAutoDownloadProgressDialogPopup, rect, false); return m_pAutoDownloadProgressDialogPopup; } bool WinTrekClient::ShouldCheckFiles() { extern bool g_bCheckFiles; bool bTemp = g_bCheckFiles; g_bCheckFiles = false; // only check files once return bTemp; } void WinTrekClient::CreateMissionReq() { GetWindow()->SetWaitCursor(); TRef<IMessageBox> pmsgBox = CreateMessageBox("Creating a game...", NULL, false); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); BaseClient::CreateMissionReq(); } // KGJV #114 void WinTrekClient::ServerListReq() { //if (!g_bQuickstart) { GetWindow()->SetWaitCursor(); TRef<IMessageBox> pmsgBox = CreateMessageBox("Asking about servers and cores...", NULL, false); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); //} BaseClient::ServerListReq(); } void WinTrekClient::CreateMissionReq(const char *szServer,const char *szAddr, const char *szIGCStaticFile, const char *szGameName) { GetWindow()->SetWaitCursor(); TRef<IMessageBox> pmsgBox = CreateMessageBox("Creating a game...", NULL, false); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); BaseClient::CreateMissionReq(szServer,szAddr,szIGCStaticFile,szGameName); } void WinTrekClient::JoinMission(MissionInfo * pMission, const char* szMissionPassword) { GetWindow()->SetWaitCursor(); TRef<IMessageBox> pmsgBox = CreateMessageBox("Joining the game...", NULL, false); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); BaseClient::JoinMission(pMission, szMissionPassword); } void WinTrekClient::OnLogonAck(bool fValidated, bool bRetry, LPCSTR szFailureReason) { // close the "logging in" popup if (GetWindow()->GetPopupContainer() && !GetWindow()->GetPopupContainer()->IsEmpty()) GetWindow()->GetPopupContainer()->ClosePopup(NULL); GetWindow()->RestoreCursor(); if (fValidated) { GetClientEventSource()->OnLogonGameServer(); /* pkk May 6th: Disabled bandwidth patch // w0dk4 June 2007: Bandwith Patch trekClient.SetMessageType(BaseClient::c_mtGuaranteed); BEGIN_PFM_CREATE(this->m_fm, pfmBandwidth, C, BANDWIDTH) END_PFM_CREATE pfmBandwidth->value = this->m_nBandwidth;*/ } else { Disconnect(); GetClientEventSource()->OnLogonGameServerFailed(bRetry, szFailureReason); g_bQuickstart = false; } } void WinTrekClient::OnLogonLobbyAck(bool fValidated, bool bRetry, LPCSTR szFailureReason) { // // We've just logged onto lobby server. // // close the "logging in" popup if (GetWindow()->GetPopupContainer() && !GetWindow()->GetPopupContainer()->IsEmpty()) GetWindow()->GetPopupContainer()->ClosePopup(NULL); GetWindow()->RestoreCursor(); if (!fValidated) { DisconnectLobby(); GetClientEventSource()->OnLogonLobbyFailed(bRetry, szFailureReason); g_bQuickstart = false; } else { GetClientEventSource()->OnLogonLobby(); } } void WinTrekClient::OnLogonClubAck(bool fValidated, bool bRetry, LPCSTR szFailureReason) { // // We've just logged onto Zone Club server. // // close the "logging in" popup if (GetWindow()->GetPopupContainer() && !GetWindow()->GetPopupContainer()->IsEmpty()) GetWindow()->GetPopupContainer()->ClosePopup(NULL); GetWindow()->RestoreCursor(); if (!fValidated) { DisconnectClub(); GetClientEventSource()->OnLogonClubFailed(bRetry, szFailureReason); g_bQuickstart = false; } else { GetClientEventSource()->OnLogonClub(); } } void WinTrekClient::Disconnect(void) { BaseClient::Disconnect(); m_bDisconnected = true; } HRESULT WinTrekClient::OnSessionLost(char* szReason, FedMessaging * pthis) { m_strDisconnectReason = ""; BaseClient::OnSessionLost(szReason, pthis); if (MyMission()) { if (GetSide() && GetSideID() != SIDE_TEAMLOBBY) RemovePlayerFromSide(MyPlayerInfo(), QSR_LinkDead); } if (pthis == &m_fm) { ZString strMsg = "Your connection to the game server was lost.\n" "Reason: " + ZString(szReason) + ".\n"; if (trekClient.GetIsLobbied()) { if (!m_fmLobby.IsConnected()) { GetWindow()->screen(ScreenIDGameScreen); m_strDisconnectReason = strMsg; } else { assert(GetWindow()->screen() == ScreenIDGameScreen); // close the "connecting..." popup if (GetWindow()->GetPopupContainer() && !GetWindow()->GetPopupContainer()->IsEmpty()) GetWindow()->GetPopupContainer()->ClosePopup(NULL); GetWindow()->RestoreCursor(); TRef<IMessageBox> pmsgBox = CreateMessageBox( "Your connection to the game server was lost.\n" "Reason: " + ZString(szReason) + ".\n" ); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); } } else { // close any existing popup if (GetWindow()->GetPopupContainer() && !GetWindow()->GetPopupContainer()->IsEmpty()) GetWindow()->GetPopupContainer()->ClosePopup(NULL); GetWindow()->RestoreCursor(); if (Training::GetTrainingMissionID () == Training::c_TM_7_Live) GetWindow()->screen(ScreenIDTrainScreen); else GetWindow()->screen(ScreenIDIntroScreen); TRef<IMessageBox> pmsgBox = CreateMessageBox(strMsg); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); } } else if (pthis == &m_fmClub) { // close the "connecting..." popup if (GetWindow()->GetPopupContainer() && !GetWindow()->GetPopupContainer()->IsEmpty()) GetWindow()->GetPopupContainer()->ClosePopup(NULL); GetWindow()->RestoreCursor(); GetWindow()->screen(ScreenIDZoneClubScreen); TRef<IMessageBox> pmsgBox = CreateMessageBox( "Your connection to the Club server was lost.\n" "Reason: " + ZString(szReason) + ".\n" ); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); } else if (pthis == &m_fmLobby) { // close the "connecting..." popup if (GetWindow()->GetPopupContainer() && !GetWindow()->GetPopupContainer()->IsEmpty()) GetWindow()->GetPopupContainer()->ClosePopup(NULL); GetWindow()->RestoreCursor(); GetWindow()->screen(ScreenIDZoneClubScreen); TRef<IMessageBox> pmsgBox = CreateMessageBox( "Your connection to the lobby server was lost.\n" "Reason: " + ZString(szReason) + ".\n" ); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); // if we lost the lobby while we were connecting to a server, we // need to kill the server connection too. Disconnect(); } else assert(false); if (MyMission()) { RemovePlayerFromMission(MyPlayerInfo(), QSR_LinkDead); } return S_OK; } void WinTrekClient::FlushSessionLostMessage() { if (!m_strDisconnectReason.IsEmpty()) { TRef<IMessageBox> pmsgBox = CreateMessageBox(m_strDisconnectReason); m_strDisconnectReason = ""; GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); } } bool WinTrekClient::OnEvent(IIntegerEventSource* pevent, int value) { Win32App::Exit(value); return true; } #ifndef NO_MSG_CRC void WinTrekClient::OnBadCRC(FedMessaging * pthis, CFMConnection & cnxn, BYTE * pMsg, DWORD cbMsg) { // uh, bad crc from the server? Let's just assert for now debugf("ACK! Bad crc *from* the %s!!\n", pthis == &m_fmLobby ? "Lobby" : "Server"); assert(0); } #endif HRESULT WinTrekClient::OnAppMessage(FedMessaging * pthis, CFMConnection & cnxnFrom, FEDMESSAGE * pfm) { HRESULT hr = E_FAIL; FEDMSGID fmid = pfm->fmid; ZAssert(0 != fmid); //if (fmid != FM_CS_PING && // fmid != FM_S_LIGHT_SHIPS_UPDATE && // fmid != FM_S_HEAVY_SHIPS_UPDATE && // fmid != FM_CS_CHATMESSAGE && // fmid != FM_S_STATIONS_UPDATE && // fmid != FM_S_PROBES_UPDATE) // debugf("Received %s at time %u\n", g_rgszMsgNames[fmid], m_now.clock()); mmf took this out, too much debug output if (m_bDisconnected && pthis == &m_fm) { debugf("Client is disconnected - message ignored.\n"); hr = S_FALSE; } else { // KGJV: fill in server ip for FM_S_MISSIONDEF // this is a bit hacky: we cant do this in HandleMsg where FM_S_MISSIONDEF is handled // because pthis and cnxnFrom are not available // and we cant do this server side either because of NAT/Firewall if (pfm->fmid == FM_S_MISSIONDEF) { CASTPFM(pfmMissionDef, S, MISSIONDEF, pfm); //char szAddr[16]; pthis->GetIPAddress(cnxnFrom, pfmMissionDef->szServerAddr); // get the real addr //Strncpy(pfmMissionDef->szServerAddr,szAddr,16); //strcpy_s(pfmMissionDef->szServerAddr,16,szAddr); // IMAGO REVIEW CRASH 7/24/09 //OutputDebugString("Connection from "+ZString(pfmMissionDef->szServerAddr)+"\n"); } // KGJV: end hr = HandleMsg(pfm, m_lastUpdate, m_now); bool bWasHandled = hr == S_OK; // review: - we check m_fm.IsConnected() here because HandleMissionMessage might blow // away the connection as a side effect of retrying a logon... should review if (SUCCEEDED(hr) && m_fm.IsConnected()) { hr = GetWindow()->HandleMsg(pfm, m_lastUpdate, m_now); // someone had better handle the message (otherwise, why are we sending it?) // If you want to leave the message as NYI for the moment, add it to the NYI // section of HandleMsg in WinTrek.cpp so we can track it. assert(bWasHandled || hr == S_OK); } } return(hr); } void WinTrekClient::OverrideThrottle (float fDesiredThrottle) { bInitTrekThrottle = true; trekThrottle = fDesiredThrottle; } // // IgcSite implementation // void WinTrekClient::DevelopmentCompleted(IbucketIGC* b, IdevelopmentIGC* d, Time now) { assert (b); IsideIGC* pside = b->GetSide(); assert (pside); if (!m_fm.IsConnected()) { pside->ApplyDevelopmentTechs(d->GetEffectTechs()); pside->ApplyGlobalAttributeSet(d->GetGlobalAttributeSet()); } else if ((!d->GetTechOnly()) && d->GetEffectTechs().GetAllZero()) { trekClient.SideDevelopmentTechChange(pside); } } void WinTrekClient::StationTypeCompleted(IbucketIGC * pbucket, IstationIGC* pstation, IstationTypeIGC * pstationtype, Time now) { if (!m_fm.IsConnected()) { //NYI decide on the correct hack for the placement of space stations IsideIGC * pside = pbucket->GetSide(); assert (pside); //Hack alert { IdroneTypeIGC* dt = pstationtype->GetConstructionDroneType(); IshipIGC* pship = CreateDrone(m_pCoreIGC, trekClient.GetCore()->GenerateNewShipID(), dt->GetPilotType(), dt->GetName(), dt->GetHullTypeID(), pstation->GetSide(), 0, dt->GetShootSkill(), dt->GetMoveSkill(), dt->GetBravery()); if (pship) { pship->SetBaseData(pstationtype); pship->SetStation(pstation); pstation->Launch(pship); } } } } void WinTrekClient::BuildStation(IasteroidIGC* pasteroid, IsideIGC* pside, IstationTypeIGC* pstationtype, Time now, bool pbseensides[]) { DataStationIGC ds; strcpy(ds.name, pstationtype->GetName()); ds.clusterID = pasteroid->GetCluster()->GetObjectID(); ds.position = pasteroid->GetPosition(); ds.forward = pasteroid->GetOrientation ().GetForward (); ds.up = pasteroid->GetOrientation ().GetUp (); ds.rotation.axis(ds.forward); ds.rotation.angle(0.0f); ds.sideID = pside->GetObjectID(); ds.stationID = m_pCoreIGC->GenerateNewStationID(); ds.stationTypeID = pstationtype->GetObjectID(); ds.bpHull = pasteroid->GetFraction(); ds.bpShield = 0.0f; pasteroid->Terminate(); IstationIGC * pstationNew = (IstationIGC *) (m_pCoreIGC->CreateObject(now, OT_station, &ds, sizeof(ds))); assert (pstationNew); pstationNew->Release(); } void WinTrekClient::LayExpendable(Time now, IexpendableTypeIGC* pet, IshipIGC* pshipLayer) { assert (pet); assert (pshipLayer); ObjectType type = pet->GetObjectType(); const Vector& position = pshipLayer->GetPosition(); IclusterIGC* pcluster = pshipLayer->GetCluster(); IsideIGC* pside = pshipLayer->GetSide(); if (type == OT_mineType) { DataMineIGC dm; dm.pshipLauncher = pshipLayer; dm.psideLauncher = pside; dm.mineID = m_pCoreIGC->GenerateNewMineID(); dm.time0 = now; dm.p0 = position; dm.pminetype = (ImineTypeIGC*)pet; assert (dm.pminetype); dm.pcluster = pcluster; dm.exportF = false; ImineIGC * m = (ImineIGC*)(m_pCoreIGC->CreateObject(now, OT_mine, &dm, sizeof(dm))); assert (m); m->Release(); } else { assert (type == OT_probeType); DataProbeIGC dp; dp.pside = pside; dp.pship = NULL; dp.pmodelTarget = NULL; dp.probeID = m_pCoreIGC->GenerateNewProbeID(); dp.time0 = now; dp.p0 = position; dp.pprobetype = (IprobeTypeIGC*)pet; assert (dp.pprobetype); dp.pcluster = pcluster; dp.exportF = false; IprobeIGC * p = (IprobeIGC*)(m_pCoreIGC->CreateObject(now, OT_probe, &dp, sizeof(dp))); assert (p); p->Release(); } //Quietly kill the ship (after nuking its parts to prevent treasure from being created) { const PartListIGC* parts = pshipLayer->GetParts(); PartLinkIGC* plink; while (plink = parts->first()) //Not == plink->data()->Terminate(); } pshipLayer->SetAmmo(0); pshipLayer->SetFuel(0.0f); KillShipEvent(now, pshipLayer, NULL, 0.0f, position, Vector::GetZero()); } void WinTrekClient::DroneTypeCompleted(IbucketIGC* b, IstationIGC* pstation, IdroneTypeIGC* dt, Time now) { if (!m_fm.IsConnected()) { IshipIGC* pship = CreateDrone(m_pCoreIGC, trekClient.GetCore()->GenerateNewShipID(), dt->GetPilotType(), dt->GetName(), dt->GetHullTypeID(), pstation->GetSide(), c_aabmMineHe3, //Assume any purchased drone is an He3 miner dt->GetShootSkill(), dt->GetMoveSkill(), dt->GetBravery()); if (pship) { pship->SetStation(pstation); pstation->Launch(pship); } } } bool WinTrekClient::ContinueRipcord(IshipIGC* pship, ImodelIGC* pmodel) { return true; } bool WinTrekClient::UseRipcord(IshipIGC* pship, ImodelIGC* pmodel) { assert (pmodel); if (!m_fm.IsConnected()) { if (pmodel->GetObjectType() == OT_station) ((IstationIGC*)pmodel)->Launch(pship); else { float r = pmodel->GetRadius() + pship->GetRadius() + 25.0f; Vector v = Vector::RandomDirection(); Orientation o(v); IclusterIGC* pcluster = pmodel->GetCluster(); Time lastUpdate = pcluster->GetLastUpdate(); pship->SetPosition(pmodel->GetPosition() + v * r); pship->SetVelocity(v * trekClient.m_pCoreIGC->GetFloatConstant(c_fcidExitStationSpeed)); pship->SetOrientation(o); pship->SetCurrentTurnRate(c_axisYaw, 0.0f); pship->SetCurrentTurnRate(c_axisPitch, 0.0f); pship->SetCurrentTurnRate(c_axisRoll, 0.0f); pship->SetLastUpdate(lastUpdate); pship->SetBB(lastUpdate, lastUpdate, 0.0f); pship->SetCluster(pcluster); } return true; } return false; } void WinTrekClient::SetViewCluster(IclusterIGC* pcluster, const Vector* pposition) { //Pretend the server sends a ship delete message for everything the player could see IclusterIGC* pclusterOld = trekClient.GetViewCluster(); if (pclusterOld != pcluster) { if (pclusterOld) { const ShipListIGC* ships = m_pCoreIGC->GetShips(); assert (ships); if (m_fm.IsConnected ()) { for (ShipLinkIGC* l = ships->first(); (l != NULL); l = l->next()) { ImodelIGC* m = l->data(); m->SetCluster(NULL); } } // stop the sounds on every object in the sector for (ModelLinkIGC* pml = pclusterOld->GetModels()->first(); (pml != NULL); pml = pml->next()) { ImodelIGC* pmodel = pml->data(); ThingSite* pts = pmodel->GetThingSite(); if (pts) { ((ThingSiteImpl*)pts)->StopSounds(); } } if (m_fm.IsConnected()) pclusterOld->SetActive(false); } //Xynth #225 Inhibit updates for all asteroids in the new cluster for a few seconds if (pcluster) { for (AsteroidLinkIGC* pal = pcluster->GetAsteroids()->first(); (pal != NULL); pal = pal->next()) { IasteroidIGC* pAsteroid = pal->data(); if ((pAsteroid->GetCapabilities() & c_aabmMineHe3) != 0) pAsteroid->SetInhibitUpdate(true); } } BaseClient::SetViewCluster(pcluster); GetWindow()->SetCluster(pcluster); GetWindow()->PositionCommandView(pposition, 0.0f); trekClient.GetClientEventSource()->OnClusterChanged(pcluster); if (m_fm.IsConnected() && pcluster) pcluster->SetActive(true); } else { GetWindow()->PositionCommandView(pposition, 0.0f); } } void WinTrekClient::RequestViewCluster(IclusterIGC* pcluster, ImodelIGC* pmodelTarget) { if (m_fm.IsConnected() && (trekClient.GetCluster() != pcluster)) { if (pcluster == NULL) SetViewCluster(pcluster); trekClient.SetMessageType(BaseClient::c_mtGuaranteed); BEGIN_PFM_CREATE(trekClient.m_fm, pfmViewCluster, C, VIEW_CLUSTER) END_PFM_CREATE pfmViewCluster->clusterID = pcluster ? pcluster->GetObjectID() : NA; if (pmodelTarget) { pfmViewCluster->otTarget = pmodelTarget->GetObjectType(); pfmViewCluster->oidTarget = pmodelTarget->GetObjectID(); } else { pfmViewCluster->otTarget = NA; pfmViewCluster->oidTarget = NA; } } else { SetViewCluster(pcluster, pmodelTarget && pmodelTarget->SeenBySide(trekClient.GetSide()) ? &(pmodelTarget->GetPosition()) : NULL); } } void WinTrekClient::TerminateModelEvent(ImodelIGC* pmodel) { TargetKilled(pmodel); BaseClient::TerminateModelEvent(pmodel); } bool WinTrekClient::DockWithStationEvent(IshipIGC* pShip, IstationIGC* pStation) { if (!m_fm.IsConnected()) { // full fuel and ammo pStation->RepairAndRefuel (pShip); pShip->SetStateBits(keyMaskIGC, 0); //Xynth #210 8/2010 if ((pShip != GetShip ()) || Training::ShipLanded ()) { // how to make the miners empty out and reset their mission IstationIGC* pOldStation = pShip->GetStation (); pShip->SetStation (pStation); pShip->SetStation (pOldStation); // now send the ship back out the other side pStation->Launch (pShip); } } return true; } void WinTrekClient::KillShipEvent(Time now, IshipIGC* pShip, ImodelIGC* pLauncher, float flAmount, const Vector& p1, const Vector& p2) { if (Training::IsTraining ()) { if (pShip->GetPilotType () != c_ptLayer) pShip->GetCluster()->GetClusterSite()->AddExplosion(pShip, c_etSmallShip); if (pShip == GetShip()) Training::ShipDied (pLauncher); else BaseClient::KillShipEvent (now, pShip, pLauncher, flAmount, p1, p2); } } void WinTrekClient::DamageShipEvent(Time now, IshipIGC * pShip, ImodelIGC * pcredit, DamageTypeID type, float flAmount, float flLeakage, const Vector& p1, const Vector& p2) { if (pcredit) { if (pShip == trekClient.GetShip()->GetSourceShip() && flAmount > 0.0f) { GetWindow()->SetTimeDamaged(now); if (flAmount > 0.0f) { if (pcredit->GetSide() && pcredit->GetSide() != GetSide()) { // damaged by an enemy - adjust the groove level m_nGrooveLevel = max(m_nGrooveLevel, 2); m_vtimeGrooveDrops[2] = Time::Now() + c_fGrooveLevelDuration; } } const Vector& vRight = pShip->GetOrientation().GetRight(); const Vector& vBackward = pShip->GetOrientation().GetBackward(); Vector vDeltaP = p2 - p1; float dotBackward = vBackward*vDeltaP; float dotRight = vRight*vDeltaP; long direction = ((long)DegreesFromRadians(atan2(dotBackward, dotRight)) + 90); // debugf("Impact @ %d degrees.", direction); GetWindow()->PlayFFEffect(effectBounce, direction); } // if we might hear it, queue up the sound effect if (pShip->GetCluster() == trekClient.GetCluster()) { ThingSiteImpl* pts = ((ThingSiteImpl*)pShip->GetThingSite()); if (pts) { pts->RegisterHit( flAmount, pShip->GetOrientation().TimesInverse(p2 - p1), flLeakage == 0.0f ); } } } } void WinTrekClient::HitWarpEvent(IshipIGC* ship, IwarpIGC* warp) { // // This code is offline only. Any future online code should be // added to the base client. // if (!m_fm.IsConnected()) { IwarpIGC* destination = warp->GetDestination(); if (destination) { IclusterIGC* cluster = destination->GetCluster(); assert (cluster); ship->SetCluster(cluster); { Orientation alephOrientation = destination->GetOrientation(); const Vector& v = ship->GetVelocity(); float speed2 = v.LengthSquared(); float speed = float(sqrt(speed2)); float error; { //How close is the ship coming to the center of the warp? Vector dp = warp->GetPosition() - ship->GetPosition(); float t = (dp * v) / v.LengthSquared(); float d = (dp - t * v).LengthSquared(); float r = warp->GetRadius(); error = d / (r*r) + 0.125f; //Error ranges from 0.125 to 1.125 } alephOrientation.Pitch(random(-error, error)); alephOrientation.Yaw(random(-error, error)); ship->SetCurrentTurnRate(c_axisRoll, ship->GetCurrentTurnRate(c_axisRoll) + random(pi * 0.5f * error, pi * 2.0f * error)); const Vector& backward = alephOrientation.GetBackward(); ship->SetOrientation(alephOrientation); speed = -(speed + trekClient.m_pCoreIGC->GetFloatConstant(c_fcidExitWarpSpeed)); ship->SetVelocity(backward * speed); ship->SetPosition(destination->GetPosition() + (alephOrientation.GetUp() * random(2.0f, 5.0f)) + (alephOrientation.GetRight() * random(2.0f, 5.0f)) - (ship->GetRadius() + 5.0f) * backward); { Time t = ship->GetLastUpdate(); ship->SetBB(t, t, 0.0f); } } } } } bool WinTrekClient::HitTreasureEvent(Time now, IshipIGC* ship, ItreasureIGC* treasure) { // // This code is offline only. Any future online code should be // added to the base client. // if (!m_fm.IsConnected()) { ship->HitTreasure(treasure->GetTreasureCode(), treasure->GetBuyable()->GetObjectID(), treasure->GetAmount()); return true; } else return false; } void WinTrekClient::PaydayEvent(IsideIGC* pside, float money) { } void WinTrekClient::GetMoneyRequest(IshipIGC* pshipSender, Money amount, HullID hidFor) { GetWindow()->SetQueuedCommand(pshipSender, amount, hidFor); } void WinTrekClient::ReceiveChat(IshipIGC* pshipSender, ChatTarget ctRecipient, ObjectID oidRecipient, SoundID idSonicChat, const char* pszText, CommandID cid, ObjectType otTarget, ObjectID oidTarget, ImodelIGC* pmodelTarget, bool bObjectModel) { assert (ctRecipient != CHAT_GROUP_NOECHO); bool bIsLeader = false; if (pshipSender) { //TheBored 25-JUN-07: Checking to see if admin is PMing the user. If so, bypass the filter. bool bPrivilegedUserPM = false; PlayerInfo* ppi = (PlayerInfo*)(pshipSender->GetPrivateData()); if((ctRecipient == CHAT_INDIVIDUAL) && (UTL::PrivilegedUser(ppi->CharacterName(),trekClient.m_pMissionInfo->GetCookie()))) //Imago 6/10 #2 { bPrivilegedUserPM = true; } if (ppi->GetMute() || (m_bFilterChatsToAll && ctRecipient == CHAT_EVERYONE && trekClient.IsInGame()) // || (m_bFilterQuickComms && ppi->IsHuman() && idSonicChat != NA && ctRecipient != CHAT_INDIVIDUAL) // mdvalley: commented out || ((((m_dwFilterLobbyChats == 1) && (ctRecipient != CHAT_INDIVIDUAL)) || (m_dwFilterLobbyChats == 2)) && (ppi->SideID() == SIDE_TEAMLOBBY) && (trekClient.IsInGame()) && (!bPrivilegedUserPM)) //TheBored 25-JUN-07: Changed conditions for the lobby mute options. || (m_bFilterUnknownChats && (ppi->IsHuman()) && (pszText == NULL) && (idSonicChat != NA) && (GetWindow()->GetSonicChatText(idSonicChat, 0) == "Unknown chat"))) //TheBored 20-JUL-07: Don't display unknown VCs. return; bIsLeader = ppi->IsTeamLeader(); } else if (ctRecipient == CHAT_ADMIN) bIsLeader = true; if ((cid != c_cidNone) && ((trekClient.m_pCoreIGC->GetMissionStage() != STAGE_STARTED) || (trekClient.GetSideID() < 0))) return; bool bIsSonicChat = false; if (idSonicChat != NA) { if (pszText == NULL) { // make sure the string sticks around through the entire function pszText = GetWindow()->GetSonicChatText(idSonicChat, 0); bIsSonicChat = true; // if quick coms are being filtered, at least don't play the sound if (m_bFilterQuickComms && pshipSender && ((PlayerInfo*)(pshipSender->GetPrivateData()))->IsHuman()) idSonicChat = NA; } } // only play a sound if the chat would be visible in the curret chat window if (ctRecipient == CHAT_INDIVIDUAL || GetWindow()->screen() == ScreenIDCombat || GetWindow()->GetLobbyChatTarget() == ctRecipient) { if (bIsSonicChat && idSonicChat != NA) { GetWindow()->PlaySonicChat(idSonicChat, 0); } else if (idSonicChat != NA) { PlaySoundEffect(idSonicChat); } else if ((cid != c_cidNone) && (ctRecipient != CHAT_INDIVIDUAL_ECHO)) { PlaySoundEffect(newCommandMsgSound); } else if (CHAT_INDIVIDUAL == ctRecipient && ((NA == oidRecipient) || (trekClient.GetShipID() == oidRecipient))) { PlaySoundEffect(newPersonalMsgSound); } else { if (m_fm.IsConnected()) { if (bIsLeader && (pshipSender != trekClient.GetShip())) PlaySoundEffect(newChatMsgFromCommanderSound); else PlaySoundEffect(newChatMsgSound); } else PlaySoundEffect(newOfflineChatMsgSound); } } if (pmodelTarget == NULL) pmodelTarget = trekClient.m_pCoreIGC->GetModel(otTarget, oidTarget); if (Training::IsTraining ()) { // prevent players from giving commands to themselves if (pshipSender && (oidRecipient == pshipSender->GetObjectID ())) pmodelTarget = NULL; // send out the chat we are getting to see if we are waiting for it... Training::RecordChat (ctRecipient); } bool bForMe; ZString strSender; ZString strRecipient; ZString strOrder; { Color color; switch (ctRecipient) { case CHAT_NOSELECTION: { static const ZString c_strNone = "none"; strRecipient = c_strNone; bForMe = false; } break; case CHAT_EVERYONE: { static const ZString c_strEveryone = "all"; strRecipient = c_strEveryone; bForMe = true; } break; case CHAT_ALLIES: //ALLY imago 7/4/09 { static const ZString c_strAllies = "allies"; strRecipient = c_strAllies; bForMe = true; } break; case CHAT_LEADERS: { static const ZString c_strLeaders = "leaders"; strRecipient = c_strLeaders; bForMe = false; //NYI } break; case CHAT_GROUP: { static const ZString c_strGroup = "group"; strRecipient = c_strGroup; bForMe = oidRecipient == trekClient.GetShipID(); } break; case CHAT_SHIP: { static const ZString c_strShip = "ship"; strRecipient = c_strShip; bForMe = true; } break; case CHAT_TEAM: { IsideIGC* pside = trekClient.GetShip()->GetSide(); if ((oidRecipient == NA) || (oidRecipient == pside->GetObjectID())) { strRecipient = pside->GetName(); bForMe = true; } else { strRecipient = trekClient.m_pCoreIGC->GetSide(oidRecipient)->GetName(); bForMe = false; } } break; case CHAT_ALL_SECTOR: { //NYI need to distinguish between all and friendly } case CHAT_FRIENDLY_SECTOR: { IclusterIGC* pcluster = trekClient.GetChatCluster(); if (!pcluster) { strRecipient = "<unknown>"; bForMe = false; } else if ((oidRecipient == NA) || (oidRecipient == pcluster->GetObjectID())) { assert (pcluster); strRecipient = pcluster->GetName(); bForMe = true; } else { strRecipient = trekClient.m_pCoreIGC->GetCluster(oidRecipient)->GetName(); bForMe = false; } } break; case CHAT_ADMIN: { static const ZString c_strAdmin = "admin"; strRecipient = c_strAdmin; bForMe = false; } break; case CHAT_WING: { WingID wid = trekClient.GetShip()->GetWingID(); if ((oidRecipient == NA) || (oidRecipient == wid)) { bForMe = true; } else { wid = oidRecipient; bForMe = false; } strRecipient = c_pszWingName[wid]; } break; case CHAT_INDIVIDUAL_ECHO: case CHAT_INDIVIDUAL: { ShipID sid = trekClient.GetShipID(); IshipIGC* pshipRecipient; if ((oidRecipient == NA) || (oidRecipient == sid)) { strRecipient = trekClient.GetShip()->GetName(); bForMe = true; if ((cid == c_cidDefault) && pmodelTarget) cid = trekClient.GetShip()->GetDefaultOrder(pmodelTarget); } else { pshipRecipient = trekClient.m_pCoreIGC->GetShip(oidRecipient); strRecipient = pshipRecipient->GetName(); bForMe = false; if ((cid == c_cidDefault) && pmodelTarget) cid = pshipRecipient->GetDefaultOrder(pmodelTarget); } } break; } if (pshipSender) { strSender = pshipSender->GetName(); color = pshipSender->GetSide()->GetColor(); if ((pshipSender == trekClient.GetShip()) && !bForMe) color = color * 0.75f; else if (cid == c_cidNone) color = color * 0.85f; } else { color = trekClient.GetSide()->GetColor(); static const ZString c_strHQ = "HQ"; strSender = c_strHQ; bForMe = true; } if (pszText) { strOrder = pszText; } else { assert (cid >= 0); strOrder += c_cdAllCommands[cid].szVerb; if (pmodelTarget) { const char* modelname = GetModelName (pmodelTarget); strOrder += " "; strOrder += modelname; ObjectType type = pmodelTarget->GetObjectType(); if ((type != OT_buoy) || (((IbuoyIGC*)pmodelTarget)->GetBuoyType() != c_buoyCluster)) { IclusterIGC* pcluster = trekClient.GetCluster(trekClient.GetShip(), pmodelTarget); if (pcluster) { strOrder += " in "; strOrder += pcluster->GetName(); } } } if (ctRecipient == CHAT_INDIVIDUAL_ECHO) { assert (!bForMe); cid = c_cidNone; pmodelTarget = NULL; } } if ((cid == c_cidNone) || (ctRecipient == CHAT_INDIVIDUAL_ECHO) || ((bForMe && (ctRecipient == CHAT_INDIVIDUAL)) == (pshipSender != trekClient.GetShip()))) { // make sure we limit the number of chats int nMaxChats = 600; while (trekClient.GetChatList()->n() >= nMaxChats) { assert(trekClient.GetChatList()->n() == nMaxChats); ChatLink* lOldestChat = trekClient.GetChatList()->first(); trekClient.GetClientEventSource()->OnDeleteChatMessage(&lOldestChat->data()); delete lOldestChat; } bool bFromPlayer = pshipSender && (!pshipSender->GetPrivateData() || ((PlayerInfo*)pshipSender->GetPrivateData())->IsHuman()); ChatLink* l = new ChatLink; assert (l); static const ZString c_str1(" ("); static const ZString c_str2("): "); l->data().SetChat(ctRecipient, strSender + c_str1 + strRecipient + c_str2 + strOrder, c_cidNone, pmodelTarget, color, bFromPlayer, bObjectModel, bIsLeader); trekClient.GetChatList()->last(l); BaseClient::ReceiveChat(pshipSender, ctRecipient, oidRecipient, idSonicChat, pszText, cid, otTarget, oidTarget, pmodelTarget); } } if (bForMe) { // TE: Removed cheat-board ////NYI hack to piggify a pilot // if ((cid == c_cidNone) && pszText && (strncmp(pszText, "cheat-", 6) == 0)) // { // pszText += 6; // if (strncmp(pszText, "board ", 6) == 0) // { // //Find a matching player // pszText += 6; // IshipIGC* pship = NULL; // for (ShipLinkIGC* psl = trekClient.GetSide()->GetShips()->first(); // (psl != NULL); // psl = psl->next()) // { // if (strcmp(pszText, psl->data()->GetName()) == 0) // { // pship = psl->data(); // break; // } // } // if (pship) // { // trekClient.SetMessageType(BaseClient::c_mtGuaranteed); // BEGIN_PFM_CREATE(trekClient.m_fm, pfmBoardShip, C, BOARD_SHIP) // END_PFM_CREATE // pfmBoardShip->sidParent = pship->GetObjectID(); // } // } // else if (strncmp(pszText, "log ", 4) == 0) // { // pszText += 4; // GetWindow()->SetShowFPS(*pszText == '1', // *(pszText + 1) == '\0' ? NULL : pszText + 1); // } // } if ((pmodelTarget || cid == c_cidStop) && trekClient.GetShip()->LegalCommand(cid, pmodelTarget))//#321 included c_cidStop { Command cmd = (ctRecipient == CHAT_INDIVIDUAL) && (pshipSender == trekClient.GetShip()) ? c_cmdAccepted : c_cmdQueued; if (cmd == c_cmdAccepted) { GetWindow()->SetAccepted(pmodelTarget, cid); GetWindow()->SetTarget(pmodelTarget, cid); if (trekClient.GetShip()->GetCluster() && (trekClient.GetShip()->GetParentShip() == NULL) && (cid == c_cidStop || trekClient.GetCluster(trekClient.GetShip(), pmodelTarget)))//#321 included c_cidStop { trekClient.SetAutoPilot(true); trekClient.bInitTrekJoyStick = true; PlaySoundEffect(salAutopilotEngageSound); } } else { GetWindow()->SetQueuedCommand(pshipSender, cid, pmodelTarget); if (pshipSender != trekClient.GetShip()) { //Xynth #14 7/2010 PlayerInfo* ppi = (PlayerInfo*)(pshipSender->GetPrivateData()); ZString str = GetKeyName(TK_AcceptCommand); if ((cid == c_cidPickup) && (pmodelTarget == pshipSender) && pshipSender-> GetBaseHullType()->HasCapability(c_habmRescue)) { trekClient.PostText(true, "New orders from %s: prepare for recovery. Press ["+str+"] to accept.", (const char*)strSender); } else if (ppi->IsTeamLeader()) //Xynth #14 7/2010 change color if from comm trekClient.PostText(true, "\x81 " + ConvertColorToString(Color::Orange()) + "New orders from %s to %s: %s. Press ["+str+"] to accept." + END_COLOR_STRING, (const char*)strSender, (const char*)strRecipient, (const char*)strOrder); else trekClient.PostText(true, "New orders from %s to %s: %s. Press ["+str+"] to accept.", (const char*)strSender, (const char*)strRecipient, (const char*)strOrder); } } } } } void WinTrekClient::Preload(const char* pszModelName, const char* pszTextureName) { // BUILD_DX9 bool bOldColorKeyValue = GetModeler()->SetColorKeyHint( false ); GetEngine()->SetEnableMipMapGeneration( true ); // BUILD_DX9 if (pszModelName) GetModeler()->GetNameSpace(pszModelName); if (pszTextureName) { char bfr[c_cbFileName + 4]; strcpy(bfr, pszTextureName); strcat(bfr, "bmp"); GetModeler()->GetNameSpace(bfr); } // BUILD_DX9 GetModeler()->SetColorKeyHint( bOldColorKeyValue ); GetEngine()->SetEnableMipMapGeneration( false ); // BUILD_DX9 } void WinTrekClient::SetCDKey(const ZString& strCDKey, int processID) { // BT - 5/21/2012 - ACSS - Debugging for the CDKey. //debugf("SetCDKey() strCDKey = %s\r\n", (const unsigned char*)(PCC) strCDKey); HKEY hKey; // wlp 2006 - Cdkey is the ASGS Ticket Now - we don't want to save it // // // save the new key for future use. // // if (ERROR_SUCCESS == ::RegCreateKeyEx(HKEY_LOCAL_MACHINE, // ALLEGIANCE_REGISTRY_KEY_ROOT, // 0, "", REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL)) // { // ::RegSetValueEx(hKey, "CDKey", NULL, REG_SZ, // wlp - (const unsigned char*)(PCC)strCDKey, strCDKey.GetLength()); // // ::RegCloseKey(hKey); // } BaseClient::SetCDKey(strCDKey, processID); } TRef<ThingSite> WinTrekClient::CreateThingSite(ImodelIGC* pModel) { return new ThingSiteImpl(pModel); } TRef<ClusterSite> WinTrekClient::CreateClusterSite(IclusterIGC* pCluster) { return new ClusterSiteImpl( GetWindow()->GetModeler(), GetWindow()->GetTime(), GetWindow()->GetPosterViewport(), pCluster ); } void WinTrekClient::PlaySoundEffect(SoundID soundID, ImodelIGC* model) { if (!model || (model->GetCluster() && model->GetCluster() == GetCluster())) { TRef<ISoundPositionSource> psource = model ? ((ThingSiteImpl*)model->GetThingSite())->GetSoundSource() : NULL; StartSound(soundID, psource); } } void WinTrekClient::PlaySoundEffect(SoundID soundID, ImodelIGC* model, const Vector& vectOffset) { if (!model || (model->GetCluster() && model->GetCluster() == GetCluster())) { TRef<ISoundPositionSource> psource = model ? ((ThingSiteImpl*)model->GetThingSite())->GetSoundSource(vectOffset) : NULL; StartSound(soundID, psource); } } void WinTrekClient::PlayNotificationSound(SoundID soundID, ImodelIGC* model) { if (model == GetShip() || model == GetShip()->GetSourceShip()) { TRef<ISoundPositionSource> psource = model ? ((ThingSiteImpl*)model->GetThingSite())->GetSoundSource() : NULL; StartSound(soundID, psource); } } void WinTrekClient::PlayFFEffect(ForceEffectID effectID, ImodelIGC* model, LONG lDirection) { if ((model == NULL) || (model == GetShip())) { GetWindow()->PlayFFEffect(effectID, lDirection); } } void WinTrekClient::PlayVisualEffect(VisualEffectID effectID, ImodelIGC* model, float fIntensity) { if ((model == NULL) || (model == GetShip())) { switch (effectID) { case effectJiggle: GetWindow()->SetJiggle(fIntensity); break; } } } void WinTrekClient::UpdateAmbientSounds(DWORD dwElapsedTime) { // update the sector warnings for (ClusterLinkIGC* cLink = GetCore()->GetClusters()->first(); cLink != NULL; cLink = cLink->next()) { IclusterIGC* pCluster = cLink->data(); ((ClusterSiteImpl*)pCluster->GetClusterSite())->UpdateClusterWarnings(); } // if we are currently in a cluster if (GetCluster()) { // kill any station sounds if (m_psoundAmbient) { m_psoundAmbient->Stop(); m_psoundAmbient = NULL; } bool bPlayMissileWarning = false; float fBestLock = 0.0f; IclusterIGC* pcluster = GetCluster(); // let every object in the sector update its sounds for (ModelLinkIGC* pml = pcluster->GetModels()->first(); (pml != NULL); pml = pml->next()) { ImodelIGC* pmodel = pml->data(); ThingSite* pts = pmodel->GetThingSite(); if (pts) { ((ThingSiteImpl*)pts)->UpdateSounds(dwElapsedTime); if (pmodel->GetObjectType() == OT_missile) { ImissileIGC* pmissile = (ImissileIGC*)(pmodel); if (pmissile->GetTarget() == trekClient.GetShip()->GetSourceShip()) { bPlayMissileWarning = true; if (pmissile->GetLock() > fBestLock) fBestLock = pmissile->GetLock(); } } } } if (bPlayMissileWarning && trekClient.GetShip()->GetCluster()) { if (!m_psoundMissileWarning) { ThingSite* pts = trekClient.GetShip()->GetThingSite(); if (pts) { m_psoundMissileWarning = StartSound(missileLockSound, ((ThingSiteImpl*)pts)->GetSoundSource()); } } m_psoundMissileWarning->GetISoundTweakable()->SetPitch(0.75 + fBestLock/2); } else if (m_psoundMissileWarning) { m_psoundMissileWarning->Stop(); m_psoundMissileWarning = NULL; } } else if (trekClient.GetShip()->GetStation() && GetWindow()->screen() == ScreenIDCombat) { SoundID newAmbientSound = trekClient.GetShip()->GetStation()->GetInteriorSound(); if (!m_psoundAmbient || m_idAmbient != newAmbientSound) { m_idAmbient = newAmbientSound; if (m_psoundAmbient) m_psoundAmbient->Stop(); m_psoundAmbient = StartSound(m_idAmbient, NULL); } // kill the missile warning if (m_psoundMissileWarning) { m_psoundMissileWarning->Stop(); m_psoundMissileWarning = NULL; } } else { // kill any station sounds if (m_psoundAmbient) { m_psoundAmbient->Stop(); m_psoundAmbient = NULL; } // kill the missile warning if (m_psoundMissileWarning) { m_psoundMissileWarning->Stop(); m_psoundMissileWarning = NULL; } } } void WinTrekClient::ResetSound() { // kill any station sounds if (m_psoundAmbient) { m_psoundAmbient->Stop(); m_psoundAmbient = NULL; } // if we are currently in a cluster if (GetCluster()) { IclusterIGC* pcluster = GetCluster(); // stop the sounds from every object in the sector for (ModelLinkIGC* pml = pcluster->GetModels()->first(); (pml != NULL); pml = pml->next()) { ImodelIGC* pmodel = pml->data(); ThingSite* pts = pmodel->GetThingSite(); if (pts) { ((ThingSiteImpl*)pts)->StopSounds(); } } } // the sounds will be restarted on the next call to UpdateAmbientSounds } HRESULT WinTrekClient::ConnectToServer(BaseClient::ConnectInfo & ci, DWORD dwCookie, Time now, const char* szPassword, bool bStandalonePrivate) { // The actual connect happens in BaseClient HRESULT hr = BaseClient::ConnectToServer(ci, dwCookie, now, szPassword, bStandalonePrivate); // close the "connecting" popup if (!GetWindow()->GetPopupContainer()->IsEmpty()) GetWindow()->GetPopupContainer()->ClosePopup(NULL); GetWindow()->RestoreCursor(); if (!m_fm.IsConnected()) { TRef<IMessageBox> pmsgBox = CreateMessageBox("Failed to connect to the server."); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); g_bQuickstart = false; } else { GetWindow()->SetWaitCursor(); TRef<IMessageBox> pmsgBox = CreateMessageBox("Logging in...", NULL, false); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); m_bDisconnected = false; } return hr; } HRESULT WinTrekClient::ConnectToLobby(BaseClient::ConnectInfo * pci) { HRESULT hr = E_FAIL; if (m_fmLobby.IsConnected()) return S_OK; // maybe specify return code indicating already connected? // if we get a NULL pci, that means we're gonna let BaseClient take care of it (relogin using cached credentials // The actual connect happens in BaseClient hr = BaseClient::ConnectToLobby(pci); // close the "connecting" popup if (!GetWindow()->GetPopupContainer()->IsEmpty()) GetWindow()->GetPopupContainer()->ClosePopup(NULL); GetWindow()->RestoreCursor(); if (!m_fmLobby.IsConnected()) { bool bPos = true; if (g_bQuickstart) { g_bQuickstart = false; bPos = false; GetWindow()->screen(ScreenIDIntroScreen); //imago 7/4/09 this will make users able // to retry and see the MOTD for outage info } TRef<IMessageBox> pmsgBox = CreateMessageBox("Failed to connect to the lobby."); Point point(c_PopupX, c_PopupY); Rect rect(point, point); (bPos) ? GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, rect, false) : GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); } else { GetWindow()->SetWaitCursor(); TRef<IMessageBox> pmsgBox = CreateMessageBox("Logging into lobby...", NULL, false); Point point(c_PopupX, c_PopupY); Rect rect(point, point); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, rect, false); // waiting for logonack from lobby } return hr; } HRESULT WinTrekClient::ConnectToClub(BaseClient::ConnectInfo * pci) { HRESULT hr = E_FAIL; if (m_fmClub.IsConnected()) return S_OK; // maybe specify return code indicating already connected? // if we get a NULL pci, that means we're gonna let BaseClient take care of it (relogin using cached credentials if (pci) pci->strServer = GetCfgInfo().strClub; // The actual connect happens in BaseClient hr = BaseClient::ConnectToClub(pci); // close the "connecting" popup if (!GetWindow()->GetPopupContainer()->IsEmpty()) GetWindow()->GetPopupContainer()->ClosePopup(NULL); GetWindow()->RestoreCursor(); if (!m_fmClub.IsConnected()) { TRef<IMessageBox> pmsgBox = CreateMessageBox("Failed to connect to the Allegiance Zone."); Point point(c_PopupX, c_PopupY); Rect rect(point, point); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, rect, false); g_bQuickstart = false; } else { GetWindow()->SetWaitCursor(); TRef<IMessageBox> pmsgBox = CreateMessageBox("Logging into the Allegiance Zone...", NULL, false); Point point(c_PopupX, c_PopupY); Rect rect(point, point); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, rect, false); // waiting for logonack from lobby } return hr; } void WinTrekClient::OnQuitMission(QuitSideReason reason, const char* szMessageParam) { m_sideidLastWinner = NA; m_bWonLastGame = false; m_bLostLastGame = false; m_nNumEndgamePlayers = 0; m_nNumEndgameSides = 0; if (m_fm.IsConnected ()) { if (Training::GetTrainingMissionID () == Training::c_TM_7_Live) { Training::EndMission (); GetWindow()->screen(ScreenIDTrainScreen); } else GetWindow()->screen(trekClient.GetIsLobbied() ? ScreenIDGameScreen : ScreenIDIntroScreen); ZString strMessage; switch (reason) { case QSR_LeaderBooted: strMessage = "You have been booted by your commander! You can rejoin the game by logging in with a different ASGS callsign."; // TurkeyXIII - #239 break; case QSR_OwnerBooted: strMessage = "You have been lobby booted by the mission owner! You can rejoin the game by logging in with a different ASGS callsign."; // pkk - #239 - conform with wiki information break; case QSR_AdminBooted: strMessage = "You have been booted by a server administrator!"; break; case QSR_ServerShutdown: strMessage = "The game has been shut down by an administrator."; break; case QSR_SquadChange: case QSR_SideDestroyed: case QSR_TeamSizeLimits: assert(false); // shouldn't get booted off the mission for these break; case QSR_Quit: break; case QSR_LinkDead: // message box created by OnSessionLost break; case QSR_DuplicateRemoteLogon: strMessage = "Someone used your zone account to log into another game."; break; case QSR_DuplicateLocalLogon: strMessage = "Someone used your zone account to log into the game you were playing."; break; case QSR_DuplicateCDKey: assert(szMessageParam); strMessage = ZString(szMessageParam ? szMessageParam : "someone") + " used your CD Key to log into a game!"; break; case QSR_SwitchingSides: case QSR_RandomizeSides: assert(false); // shouldn't get booted off the mission for this break; } if (!strMessage.IsEmpty()) { if (trekClient.GetIsLobbied()) { m_strDisconnectReason = strMessage; } else { TRef<IMessageBox> pmsgBox = CreateMessageBox(strMessage); GetWindow()->GetPopupContainer()->OpenPopup(pmsgBox, false); } } } BaseClient::OnQuitMission(reason, szMessageParam); } void WinTrekClient::SetGameoverInfo(FMD_S_GAME_OVER* pfmGameOver) { m_sideidLastWinner = pfmGameOver->iSideWinner; m_bWonLastGame = (pfmGameOver->iSideWinner == GetSideID() || GetSide()->AlliedSides(GetCore()->GetSide(pfmGameOver->iSideWinner),GetSide())); //#ALLY (Imago) 7/8/09 m_bLostLastGame = (!m_bWonLastGame && (GetSideID() != SIDE_TEAMLOBBY) && pfmGameOver->iSideWinner != NA) || (pfmGameOver->iSideWinner != NA && GetSide()->GetAllies() != NA && !GetSide()->AlliedSides(GetCore()->GetSide(pfmGameOver->iSideWinner),GetSide())); m_strGameOverMessage = FM_VAR_REF(pfmGameOver, szGameoverMessage); m_nNumEndgamePlayers = 0; m_nNumEndgameSides = pfmGameOver->nNumSides; if (m_vplayerEndgameInfo) delete []m_vplayerEndgameInfo; m_vplayerEndgameInfo = NULL; memcpy(m_vsideEndgameInfo, pfmGameOver->rgSides, sizeof(SideEndgameInfo) * c_cSidesMax); m_bEndgameEjectPods = pfmGameOver->bEjectPods; m_bGameCounted = true; // assume the game counted until we are told otherwise m_bScoresCounted = MyMission()->GetMissionParams().bScoresCount; trekClient.GetClientEventSource()->OnGameoverStats(); trekClient.GetClientEventSource()->OnGameoverPlayers(); } void WinTrekClient::AddGameoverPlayers(PlayerEndgameInfo* vEndgamePlayerInfo, int nCount) { PlayerEndgameInfo* vnewInfo = new PlayerEndgameInfo[m_nNumEndgamePlayers + nCount]; if (m_nNumEndgamePlayers > 0) memcpy(vnewInfo, m_vplayerEndgameInfo, sizeof(PlayerEndgameInfo) * m_nNumEndgamePlayers); memcpy(vnewInfo + m_nNumEndgamePlayers, vEndgamePlayerInfo, sizeof(PlayerEndgameInfo) * nCount); if (m_vplayerEndgameInfo) delete []m_vplayerEndgameInfo; m_nNumEndgamePlayers += nCount; m_vplayerEndgameInfo = vnewInfo; // see if we're in the endgame stats... for (int iPlayerIndex = m_nNumEndgamePlayers - nCount; iPlayerIndex < nCount; iPlayerIndex++) { // if these are our stats... if (strcmp(m_vplayerEndgameInfo[iPlayerIndex].characterName, GetShip()->GetName()) == 0) { // check to see if the game counted. m_bGameCounted = m_vplayerEndgameInfo[iPlayerIndex].scoring.GetGameCounted(); break; } } trekClient.GetClientEventSource()->OnGameoverPlayers(); } ZString WinTrekClient::GetGameoverMessage() { return m_strGameOverMessage; }; PlayerEndgameInfo* WinTrekClient::GetEndgamePlayerInfo(int nIndex) { assert(nIndex < m_nNumEndgamePlayers); return &(m_vplayerEndgameInfo[nIndex]); }; int WinTrekClient::GetNumEndgamePlayers() { return m_nNumEndgamePlayers; }; SideEndgameInfo* WinTrekClient::GetSideEndgameInfo(SideID sideId) { assert(sideId >= 0 && sideId < m_nNumEndgameSides); return &(m_vsideEndgameInfo[sideId]); } int WinTrekClient::GetNumEndgameSides() { return m_nNumEndgameSides; } Color WinTrekClient::GetEndgameSideColor(SideID sideId) { if (sideId < 0) return 0.75 * Color::White(); assert(sideId >= 0 && sideId < m_nNumEndgameSides); return m_vsideEndgameInfo[sideId].color; }; void WinTrekClient::SaveSquadMemberships(const char* szCharacterName) { DWORD dwMembershipSize = m_squadmemberships.GetCount() * sizeof(SquadID); SquadID* vsquadIDs = (SquadID*)_alloca(dwMembershipSize); // only store the IDs (since we don't need anything else yet) int iSquad = 0; for (TList<SquadMembership>::Iterator iterSquad(m_squadmemberships); !iterSquad.End(); iterSquad.Next()) { vsquadIDs[iSquad] = iterSquad.Value().GetID(); ++iSquad; } HKEY hKey; if (ERROR_SUCCESS == ::RegCreateKeyEx(HKEY_LOCAL_MACHINE, ALLEGIANCE_REGISTRY_KEY_ROOT L"\\SquadMemberships", 0, L"", REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL)) { ::RegSetValueExA(hKey, szCharacterName, NULL, REG_BINARY, (const unsigned char*)vsquadIDs, dwMembershipSize); ::RegCloseKey(hKey); } } void WinTrekClient::RestoreSquadMemberships(const char* szCharacterName) { m_squadmemberships.SetEmpty(); HKEY hKey; if (ERROR_SUCCESS == ::RegCreateKeyEx(HKEY_LOCAL_MACHINE, ALLEGIANCE_REGISTRY_KEY_ROOT L"\\SquadMemberships", 0, L"", REG_OPTION_NON_VOLATILE, KEY_READ, NULL, &hKey, NULL)) { DWORD dwSize = 0; DWORD dwType; if (::RegQueryValueExA(hKey, szCharacterName, NULL, &dwType, NULL, &dwSize) == ERROR_SUCCESS && dwType == REG_BINARY && dwSize != 0) { SquadID* vsquadIDs = (SquadID*)_alloca(dwSize); int numSquads = dwSize / sizeof(SquadID); ::RegQueryValueExA(hKey, szCharacterName, NULL, NULL, (unsigned char*)vsquadIDs, &dwSize); for (int iSquad = 0; iSquad < numSquads; iSquad++) { m_squadmemberships.PushEnd(SquadMembership(vsquadIDs[iSquad], "<bug>", false, false)); } } ::RegCloseKey(hKey); } } CivID WinTrekClient::GetEndgameSideCiv(SideID sideId) { if (sideId == SIDE_TEAMLOBBY) return NA; assert(sideId >= 0 && sideId < m_nNumEndgameSides); return m_vsideEndgameInfo[sideId].civID; }; int WinTrekClient::GetGrooveLevel() { int nCurrentGrooveLevel = 0; bool bEnemiesSighted = false; bool bEnemiesInRange = false; bool bEnemiesInRangeShootingAtMe = false; float fMaximumRange = 0; bool bFiring = false; IhullTypeIGC* pht = GetShip()->GetSourceShip()->GetBaseHullType(); if (pht) { // figure out whether we are firing and what our maximum range is Mount maxFixedWeapons = pht->GetMaxWeapons(); for (Mount mount = 0; mount < maxFixedWeapons; mount++) { const IweaponIGC* pweapon; CastTo(pweapon, GetShip()->GetMountedPart(ET_Weapon, mount)); if (pweapon) { if (pweapon->fActive()) bFiring = true; IprojectileTypeIGC* ppt = pweapon->GetProjectileType(); fMaximumRange = max(fMaximumRange, ppt->GetSpeed() * pweapon->GetLifespan()); } } // check for missiles (for firing and maximum range) const ImagazineIGC* pmagazine; CastTo(pmagazine, GetShip()->GetSourceShip()->GetMountedPart(ET_Magazine, 0)); if (pmagazine) { if (pmagazine->fActive() && (GetShip()->GetSourceShip()->GetStateM() & missileFireIGC)) bFiring = true; ImissileTypeIGC* pmt = pmagazine->GetMissileType(); fMaximumRange = max(fMaximumRange, pmt->GetLifespan()*(pmt->GetInitialSpeed()+0.5f*pmt->GetLifespan()*pmt->GetAcceleration())); } } // look for all visible enemies in the player's sector if (GetCluster()) { for (ShipLinkIGC* psl = GetCluster()->GetShips()->first(); (psl != NULL); psl = psl->next()) { IshipIGC* pship = psl->data(); if ( ( (pship->GetSide() != GetSide()) && !pship->GetSide()->AlliedSides(pship->GetSide(),GetSide()) ) //#ALLY - imago 7/3/09 7/8/09 && pship->SeenBySide(GetSide()) ) { bEnemiesSighted = true; if (GetShip()->GetSourceShip()->GetCluster()) { float c_fFudgeFactor = 2.0f; // extend the ranges a little bEnemiesInRange = (GetShip()->GetSourceShip()->GetPosition() - pship->GetSourceShip()->GetPosition()).LengthSquared() < fMaximumRange * fMaximumRange * c_fFudgeFactor; bEnemiesInRangeShootingAtMe = bEnemiesInRange && (pship->GetCommandTarget(c_cmdCurrent) == GetShip()->GetSourceShip()) && (pship->GetStateM() & (missileFireIGC | chaffFireIGC | weaponsMaskIGC)); } } } } // // Groove level 1 polling triggers: // // if we see enemies or enemies see us, be afraid if (bEnemiesSighted || MyPlayerInfo()->GetShipStatus().GetDetected()) { m_nGrooveLevel = max(m_nGrooveLevel, 1); m_vtimeGrooveDrops[1] = Time::Now() + c_fGrooveLevelDuration; } // look for a cluster with a threatened builder, or station for (ClusterLinkIGC* cLink = GetCore()->GetClusters()->first(); cLink != NULL; cLink = cLink->next()) { IclusterIGC* pCluster = cLink->data(); ClusterWarning warn = GetClusterWarning(pCluster->GetClusterSite()->GetClusterAssetMask(), trekClient.MyMission()->GetMissionParams().bInvulnerableStations); switch (warn) { case c_cwMinerThreatened: case c_cwBuilderThreatened: case c_cwStationThreatened: m_nGrooveLevel = max(m_nGrooveLevel, 1); m_vtimeGrooveDrops[1] = Time::Now() + c_fGrooveLevelDuration; break; } } // // Groove level 2 polling triggers: // // if the client tries to fire while an enemy is within range or if an // enemy is firing on the client, raise the grove level. if (bEnemiesInRange && bFiring || bEnemiesInRangeShootingAtMe) { m_nGrooveLevel = max(m_nGrooveLevel, 2); m_vtimeGrooveDrops[2] = Time::Now() + c_fGrooveLevelDuration; } // drop the current groove level until we find one that matches while (Time::Now() > m_vtimeGrooveDrops[m_nGrooveLevel] && m_nGrooveLevel > 0) { --m_nGrooveLevel; } return m_nGrooveLevel; } void WinTrekClient::StartLockDown(const ZString& strReason, LockdownCriteria criteria) { GetWindow()->StartLockDown(strReason); BaseClient::StartLockDown(strReason, criteria); } void WinTrekClient::EndLockDown(LockdownCriteria criteria) { BaseClient::EndLockDown(criteria); GetWindow()->EndLockDown(); } WinTrekClient trekClient;
AllegianceZone/Allegiance
src/WinTrek/trekigc.cpp
C++
mit
182,130
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="ApiGen 2.8.0" /> <meta name="robots" content="noindex" /> <title>File vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Tests/Util/UserManipulatorTest.php | seip</title> <script type="text/javascript" src="resources/combined.js?784181472"></script> <script type="text/javascript" src="elementlist.js?3927760630"></script> <link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360" /> </head> <body> <div id="left"> <div id="menu"> <a href="index.html" title="Overview"><span>Overview</span></a> <div id="groups"> <h3>Namespaces</h3> <ul> <li><a href="namespace-Acme.html">Acme<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.html">DemoBundle<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Command.html">Command</a> </li> <li><a href="namespace-Acme.DemoBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Acme.DemoBundle.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Acme.DemoBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Acme.DemoBundle.Form.html">Form</a> </li> <li><a href="namespace-Acme.DemoBundle.Proxy.html">Proxy<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Proxy.__CG__.html">__CG__<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Proxy.__CG__.Symfony.html">Symfony<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Proxy.__CG__.Symfony.Component.html">Component<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Proxy.__CG__.Symfony.Component.Security.html">Security<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Proxy.__CG__.Symfony.Component.Security.Acl.html">Acl<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Proxy.__CG__.Symfony.Component.Security.Acl.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Proxy.__CG__.Symfony.Component.Security.Acl.Tests.Domain.html">Domain</a> </li> </ul></li></ul></li> <li><a href="namespace-Acme.DemoBundle.Proxy.__CG__.Symfony.Component.Security.Core.html">Core<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Proxy.__CG__.Symfony.Component.Security.Core.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Proxy.__CG__.Symfony.Component.Security.Core.Tests.Util.html">Util</a> </li> </ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li> <li><a href="namespace-Acme.DemoBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Tests.Controller.html">Controller</a> </li> </ul></li> <li><a href="namespace-Acme.DemoBundle.Twig.html">Twig<span></span></a> <ul> <li><a href="namespace-Acme.DemoBundle.Twig.Extension.html">Extension</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Alpha.html">Alpha</a> </li> <li><a href="namespace-Apc.html">Apc<span></span></a> <ul> <li><a href="namespace-Apc.NamespaceCollision.html">NamespaceCollision<span></span></a> <ul> <li><a href="namespace-Apc.NamespaceCollision.A.html">A<span></span></a> <ul> <li><a href="namespace-Apc.NamespaceCollision.A.B.html">B</a> </li> </ul></li></ul></li> <li><a href="namespace-Apc.Namespaced.html">Namespaced</a> </li> </ul></li> <li><a href="namespace-Assetic.html">Assetic<span></span></a> <ul> <li><a href="namespace-Assetic.Asset.html">Asset<span></span></a> <ul> <li><a href="namespace-Assetic.Asset.Iterator.html">Iterator</a> </li> </ul></li> <li><a href="namespace-Assetic.Cache.html">Cache</a> </li> <li><a href="namespace-Assetic.Exception.html">Exception</a> </li> <li><a href="namespace-Assetic.Extension.html">Extension<span></span></a> <ul> <li><a href="namespace-Assetic.Extension.Twig.html">Twig</a> </li> </ul></li> <li><a href="namespace-Assetic.Factory.html">Factory<span></span></a> <ul> <li><a href="namespace-Assetic.Factory.Loader.html">Loader</a> </li> <li><a href="namespace-Assetic.Factory.Resource.html">Resource</a> </li> <li><a href="namespace-Assetic.Factory.Worker.html">Worker</a> </li> </ul></li> <li><a href="namespace-Assetic.Filter.html">Filter<span></span></a> <ul> <li><a href="namespace-Assetic.Filter.GoogleClosure.html">GoogleClosure</a> </li> <li><a href="namespace-Assetic.Filter.Sass.html">Sass</a> </li> <li><a href="namespace-Assetic.Filter.Yui.html">Yui</a> </li> </ul></li> <li><a href="namespace-Assetic.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-Bazinga.html">Bazinga<span></span></a> <ul> <li><a href="namespace-Bazinga.Bundle.html">Bundle<span></span></a> <ul> <li><a href="namespace-Bazinga.Bundle.JsTranslationBundle.html">JsTranslationBundle<span></span></a> <ul> <li><a href="namespace-Bazinga.Bundle.JsTranslationBundle.Command.html">Command</a> </li> <li><a href="namespace-Bazinga.Bundle.JsTranslationBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Bazinga.Bundle.JsTranslationBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Bazinga.Bundle.JsTranslationBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Bazinga.Bundle.JsTranslationBundle.Dumper.html">Dumper</a> </li> <li><a href="namespace-Bazinga.Bundle.JsTranslationBundle.Finder.html">Finder</a> </li> <li><a href="namespace-Bazinga.Bundle.JsTranslationBundle.Tests.html">Tests</a> </li> </ul></li></ul></li> <li><a href="namespace-Bazinga.JsTranslationBundle.html">JsTranslationBundle<span></span></a> <ul> <li><a href="namespace-Bazinga.JsTranslationBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Bazinga.JsTranslationBundle.Tests.Controller.html">Controller</a> </li> <li><a href="namespace-Bazinga.JsTranslationBundle.Tests.Finder.html">Finder</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Beta.html">Beta</a> </li> <li><a href="namespace-Blameable.html">Blameable<span></span></a> <ul> <li><a href="namespace-Blameable.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Blameable.Fixture.Document.html">Document</a> </li> <li><a href="namespace-Blameable.Fixture.Entity.html">Entity</a> </li> </ul></li></ul></li> <li><a href="namespace-ClassesWithParents.html">ClassesWithParents</a> </li> <li><a href="namespace-ClassLoaderTest.html">ClassLoaderTest</a> </li> <li><a href="namespace-ClassMap.html">ClassMap</a> </li> <li><a href="namespace-Composer.html">Composer<span></span></a> <ul> <li><a href="namespace-Composer.Autoload.html">Autoload</a> </li> </ul></li> <li><a href="namespace-Container14.html">Container14</a> </li> <li><a href="namespace-Doctrine.html">Doctrine<span></span></a> <ul> <li><a href="namespace-Doctrine.Bundle.html">Bundle<span></span></a> <ul> <li><a href="namespace-Doctrine.Bundle.DoctrineBundle.html">DoctrineBundle<span></span></a> <ul> <li><a href="namespace-Doctrine.Bundle.DoctrineBundle.Command.html">Command<span></span></a> <ul> <li><a href="namespace-Doctrine.Bundle.DoctrineBundle.Command.Proxy.html">Proxy</a> </li> </ul></li> <li><a href="namespace-Doctrine.Bundle.DoctrineBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Doctrine.Bundle.DoctrineBundle.DataCollector.html">DataCollector</a> </li> <li><a href="namespace-Doctrine.Bundle.DoctrineBundle.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Doctrine.Bundle.DoctrineBundle.Mapping.html">Mapping</a> </li> <li><a href="namespace-Doctrine.Bundle.DoctrineBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Doctrine.Bundle.DoctrineBundle.Tests.DependencyInjection.html">DependencyInjection</a> </li> </ul></li> <li><a href="namespace-Doctrine.Bundle.DoctrineBundle.Twig.html">Twig</a> </li> </ul></li> <li><a href="namespace-Doctrine.Bundle.FixturesBundle.html">FixturesBundle<span></span></a> <ul> <li><a href="namespace-Doctrine.Bundle.FixturesBundle.Command.html">Command</a> </li> </ul></li></ul></li> <li><a href="namespace-Doctrine.Common.html">Common<span></span></a> <ul> <li><a href="namespace-Doctrine.Common.Annotations.html">Annotations<span></span></a> <ul> <li><a href="namespace-Doctrine.Common.Annotations.Annotation.html">Annotation</a> </li> </ul></li> <li><a href="namespace-Doctrine.Common.Cache.html">Cache</a> </li> <li><a href="namespace-Doctrine.Common.Collections.html">Collections<span></span></a> <ul> <li><a href="namespace-Doctrine.Common.Collections.Expr.html">Expr</a> </li> </ul></li> <li><a href="namespace-Doctrine.Common.DataFixtures.html">DataFixtures<span></span></a> <ul> <li><a href="namespace-Doctrine.Common.DataFixtures.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Doctrine.Common.DataFixtures.Event.Listener.html">Listener</a> </li> </ul></li> <li><a href="namespace-Doctrine.Common.DataFixtures.Exception.html">Exception</a> </li> <li><a href="namespace-Doctrine.Common.DataFixtures.Executor.html">Executor</a> </li> <li><a href="namespace-Doctrine.Common.DataFixtures.Purger.html">Purger</a> </li> </ul></li> <li><a href="namespace-Doctrine.Common.Inflector.html">Inflector</a> </li> <li><a href="namespace-Doctrine.Common.Lexer.html">Lexer</a> </li> <li><a href="namespace-Doctrine.Common.Persistence.html">Persistence<span></span></a> <ul> <li><a href="namespace-Doctrine.Common.Persistence.Event.html">Event</a> </li> <li><a href="namespace-Doctrine.Common.Persistence.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Doctrine.Common.Persistence.Mapping.Driver.html">Driver</a> </li> </ul></li></ul></li> <li><a href="namespace-Doctrine.Common.Proxy.html">Proxy<span></span></a> <ul> <li><a href="namespace-Doctrine.Common.Proxy.Exception.html">Exception</a> </li> </ul></li> <li><a href="namespace-Doctrine.Common.Reflection.html">Reflection</a> </li> <li><a href="namespace-Doctrine.Common.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-Doctrine.DBAL.html">DBAL<span></span></a> <ul> <li><a href="namespace-Doctrine.DBAL.Cache.html">Cache</a> </li> <li><a href="namespace-Doctrine.DBAL.Connections.html">Connections</a> </li> <li><a href="namespace-Doctrine.DBAL.Driver.html">Driver<span></span></a> <ul> <li><a href="namespace-Doctrine.DBAL.Driver.DrizzlePDOMySql.html">DrizzlePDOMySql</a> </li> <li><a href="namespace-Doctrine.DBAL.Driver.IBMDB2.html">IBMDB2</a> </li> <li><a href="namespace-Doctrine.DBAL.Driver.Mysqli.html">Mysqli</a> </li> <li><a href="namespace-Doctrine.DBAL.Driver.OCI8.html">OCI8</a> </li> <li><a href="namespace-Doctrine.DBAL.Driver.PDOIbm.html">PDOIbm</a> </li> <li><a href="namespace-Doctrine.DBAL.Driver.PDOMySql.html">PDOMySql</a> </li> <li><a href="namespace-Doctrine.DBAL.Driver.PDOOracle.html">PDOOracle</a> </li> <li><a href="namespace-Doctrine.DBAL.Driver.PDOPgSql.html">PDOPgSql</a> </li> <li><a href="namespace-Doctrine.DBAL.Driver.PDOSqlite.html">PDOSqlite</a> </li> <li><a href="namespace-Doctrine.DBAL.Driver.PDOSqlsrv.html">PDOSqlsrv</a> </li> <li><a href="namespace-Doctrine.DBAL.Driver.SQLSrv.html">SQLSrv</a> </li> </ul></li> <li><a href="namespace-Doctrine.DBAL.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Doctrine.DBAL.Event.Listeners.html">Listeners</a> </li> </ul></li> <li><a href="namespace-Doctrine.DBAL.Id.html">Id</a> </li> <li><a href="namespace-Doctrine.DBAL.Logging.html">Logging</a> </li> <li><a href="namespace-Doctrine.DBAL.Platforms.html">Platforms<span></span></a> <ul> <li><a href="namespace-Doctrine.DBAL.Platforms.Keywords.html">Keywords</a> </li> </ul></li> <li><a href="namespace-Doctrine.DBAL.Portability.html">Portability</a> </li> <li><a href="namespace-Doctrine.DBAL.Query.html">Query<span></span></a> <ul> <li><a href="namespace-Doctrine.DBAL.Query.Expression.html">Expression</a> </li> </ul></li> <li><a href="namespace-Doctrine.DBAL.Schema.html">Schema<span></span></a> <ul> <li><a href="namespace-Doctrine.DBAL.Schema.Synchronizer.html">Synchronizer</a> </li> <li><a href="namespace-Doctrine.DBAL.Schema.Visitor.html">Visitor</a> </li> </ul></li> <li><a href="namespace-Doctrine.DBAL.Sharding.html">Sharding<span></span></a> <ul> <li><a href="namespace-Doctrine.DBAL.Sharding.ShardChoser.html">ShardChoser</a> </li> <li><a href="namespace-Doctrine.DBAL.Sharding.SQLAzure.html">SQLAzure<span></span></a> <ul> <li><a href="namespace-Doctrine.DBAL.Sharding.SQLAzure.Schema.html">Schema</a> </li> </ul></li></ul></li> <li><a href="namespace-Doctrine.DBAL.Tools.html">Tools<span></span></a> <ul> <li><a href="namespace-Doctrine.DBAL.Tools.Console.html">Console<span></span></a> <ul> <li><a href="namespace-Doctrine.DBAL.Tools.Console.Command.html">Command</a> </li> <li><a href="namespace-Doctrine.DBAL.Tools.Console.Helper.html">Helper</a> </li> </ul></li></ul></li> <li><a href="namespace-Doctrine.DBAL.Types.html">Types</a> </li> </ul></li> <li><a href="namespace-Doctrine.ORM.html">ORM<span></span></a> <ul> <li><a href="namespace-Doctrine.ORM.Decorator.html">Decorator</a> </li> <li><a href="namespace-Doctrine.ORM.Event.html">Event</a> </li> <li><a href="namespace-Doctrine.ORM.Id.html">Id</a> </li> <li><a href="namespace-Doctrine.ORM.Internal.html">Internal<span></span></a> <ul> <li><a href="namespace-Doctrine.ORM.Internal.Hydration.html">Hydration</a> </li> </ul></li> <li><a href="namespace-Doctrine.ORM.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Doctrine.ORM.Mapping.Builder.html">Builder</a> </li> <li><a href="namespace-Doctrine.ORM.Mapping.Driver.html">Driver</a> </li> </ul></li> <li><a href="namespace-Doctrine.ORM.Persisters.html">Persisters</a> </li> <li><a href="namespace-Doctrine.ORM.Proxy.html">Proxy</a> </li> <li><a href="namespace-Doctrine.ORM.Query.html">Query<span></span></a> <ul> <li><a href="namespace-Doctrine.ORM.Query.AST.html">AST<span></span></a> <ul> <li><a href="namespace-Doctrine.ORM.Query.AST.Functions.html">Functions</a> </li> </ul></li> <li><a href="namespace-Doctrine.ORM.Query.Exec.html">Exec</a> </li> <li><a href="namespace-Doctrine.ORM.Query.Expr.html">Expr</a> </li> <li><a href="namespace-Doctrine.ORM.Query.Filter.html">Filter</a> </li> </ul></li> <li><a href="namespace-Doctrine.ORM.Repository.html">Repository</a> </li> <li><a href="namespace-Doctrine.ORM.Tools.html">Tools<span></span></a> <ul> <li><a href="namespace-Doctrine.ORM.Tools.Console.html">Console<span></span></a> <ul> <li><a href="namespace-Doctrine.ORM.Tools.Console.Command.html">Command<span></span></a> <ul> <li><a href="namespace-Doctrine.ORM.Tools.Console.Command.ClearCache.html">ClearCache</a> </li> <li><a href="namespace-Doctrine.ORM.Tools.Console.Command.SchemaTool.html">SchemaTool</a> </li> </ul></li> <li><a href="namespace-Doctrine.ORM.Tools.Console.Helper.html">Helper</a> </li> </ul></li> <li><a href="namespace-Doctrine.ORM.Tools.Event.html">Event</a> </li> <li><a href="namespace-Doctrine.ORM.Tools.Export.html">Export<span></span></a> <ul> <li><a href="namespace-Doctrine.ORM.Tools.Export.Driver.html">Driver</a> </li> </ul></li> <li><a href="namespace-Doctrine.ORM.Tools.Pagination.html">Pagination</a> </li> </ul></li></ul></li> <li><a href="namespace-Doctrine.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Doctrine.Tests.Common.html">Common<span></span></a> <ul> <li><a href="namespace-Doctrine.Tests.Common.Annotations.html">Annotations<span></span></a> <ul> <li><a href="namespace-Doctrine.Tests.Common.Annotations.Bar.html">Bar</a> </li> <li><a href="namespace-Doctrine.Tests.Common.Annotations.Fixtures.html">Fixtures<span></span></a> <ul> <li><a href="namespace-Doctrine.Tests.Common.Annotations.Fixtures.Annotation.html">Annotation</a> </li> </ul></li> <li><a href="namespace-Doctrine.Tests.Common.Annotations.Foo.html">Foo</a> </li> <li><a href="namespace-Doctrine.Tests.Common.Annotations.FooBar.html">FooBar</a> </li> <li><a href="namespace-Doctrine.Tests.Common.Annotations.Ticket.html">Ticket<span></span></a> <ul> <li><a href="namespace-Doctrine.Tests.Common.Annotations.Ticket.Doctrine.html">Doctrine<span></span></a> <ul> <li><a href="namespace-Doctrine.Tests.Common.Annotations.Ticket.Doctrine.ORM.html">ORM<span></span></a> <ul> <li><a href="namespace-Doctrine.Tests.Common.Annotations.Ticket.Doctrine.ORM.Mapping.html">Mapping</a> </li> </ul></li></ul></li></ul></li></ul></li> <li><a href="namespace-Doctrine.Tests.Common.Cache.html">Cache</a> </li> <li><a href="namespace-Doctrine.Tests.Common.Collections.html">Collections</a> </li> <li><a href="namespace-Doctrine.Tests.Common.DataFixtures.html">DataFixtures<span></span></a> <ul> <li><a href="namespace-Doctrine.Tests.Common.DataFixtures.Executor.html">Executor</a> </li> <li><a href="namespace-Doctrine.Tests.Common.DataFixtures.TestEntity.html">TestEntity</a> </li> <li><a href="namespace-Doctrine.Tests.Common.DataFixtures.TestFixtures.html">TestFixtures</a> </li> </ul></li> <li><a href="namespace-Doctrine.Tests.Common.Inflector.html">Inflector</a> </li> <li><a href="namespace-Doctrine.Tests.Common.Persistence.html">Persistence<span></span></a> <ul> <li><a href="namespace-Doctrine.Tests.Common.Persistence.Mapping.html">Mapping</a> </li> </ul></li> <li><a href="namespace-Doctrine.Tests.Common.Proxy.html">Proxy</a> </li> <li><a href="namespace-Doctrine.Tests.Common.Reflection.html">Reflection<span></span></a> <ul> <li><a href="namespace-Doctrine.Tests.Common.Reflection.Dummies.html">Dummies</a> </li> </ul></li> <li><a href="namespace-Doctrine.Tests.Common.Util.html">Util</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Entity.html">Entity<span></span></a> <ul> <li><a href="namespace-Entity.Repository.html">Repository</a> </li> </ul></li> <li><a href="namespace-Fixtures.html">Fixtures<span></span></a> <ul> <li><a href="namespace-Fixtures.Bundles.html">Bundles<span></span></a> <ul> <li><a href="namespace-Fixtures.Bundles.AnnotationsBundle.html">AnnotationsBundle<span></span></a> <ul> <li><a href="namespace-Fixtures.Bundles.AnnotationsBundle.Entity.html">Entity</a> </li> </ul></li> <li><a href="namespace-Fixtures.Bundles.Vendor.html">Vendor<span></span></a> <ul> <li><a href="namespace-Fixtures.Bundles.Vendor.AnnotationsBundle.html">AnnotationsBundle<span></span></a> <ul> <li><a href="namespace-Fixtures.Bundles.Vendor.AnnotationsBundle.Entity.html">Entity</a> </li> </ul></li></ul></li> <li><a href="namespace-Fixtures.Bundles.XmlBundle.html">XmlBundle<span></span></a> <ul> <li><a href="namespace-Fixtures.Bundles.XmlBundle.Entity.html">Entity</a> </li> </ul></li> <li><a href="namespace-Fixtures.Bundles.YamlBundle.html">YamlBundle<span></span></a> <ul> <li><a href="namespace-Fixtures.Bundles.YamlBundle.Entity.html">Entity</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Foo.html">Foo<span></span></a> <ul> <li><a href="namespace-Foo.Bar.html">Bar</a> </li> </ul></li> <li class="active"><a href="namespace-FOS.html">FOS<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.html">RestBundle<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Controller.html">Controller<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Controller.Annotations.html">Annotations</a> </li> </ul></li> <li><a href="namespace-FOS.RestBundle.Decoder.html">Decoder</a> </li> <li><a href="namespace-FOS.RestBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-FOS.RestBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-FOS.RestBundle.Examples.html">Examples</a> </li> <li><a href="namespace-FOS.RestBundle.Form.html">Form<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Form.Extension.html">Extension</a> </li> </ul></li> <li><a href="namespace-FOS.RestBundle.Normalizer.html">Normalizer<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Normalizer.Exception.html">Exception</a> </li> </ul></li> <li><a href="namespace-FOS.RestBundle.Request.html">Request</a> </li> <li><a href="namespace-FOS.RestBundle.Response.html">Response<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Response.AllowedMethodsLoader.html">AllowedMethodsLoader</a> </li> </ul></li> <li><a href="namespace-FOS.RestBundle.Routing.html">Routing<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Routing.Loader.html">Loader<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Routing.Loader.Reader.html">Reader</a> </li> </ul></li></ul></li> <li><a href="namespace-FOS.RestBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Tests.Controller.html">Controller<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Tests.Controller.Annotations.html">Annotations</a> </li> </ul></li> <li><a href="namespace-FOS.RestBundle.Tests.Decoder.html">Decoder</a> </li> <li><a href="namespace-FOS.RestBundle.Tests.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Tests.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-FOS.RestBundle.Tests.EventListener.html">EventListener</a> </li> <li><a href="namespace-FOS.RestBundle.Tests.Fixtures.html">Fixtures<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Tests.Fixtures.Controller.html">Controller</a> </li> </ul></li> <li><a href="namespace-FOS.RestBundle.Tests.Normalizer.html">Normalizer</a> </li> <li><a href="namespace-FOS.RestBundle.Tests.Request.html">Request</a> </li> <li><a href="namespace-FOS.RestBundle.Tests.Routing.html">Routing<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Tests.Routing.Loader.html">Loader</a> </li> </ul></li> <li><a href="namespace-FOS.RestBundle.Tests.Util.html">Util</a> </li> <li><a href="namespace-FOS.RestBundle.Tests.View.html">View</a> </li> </ul></li> <li><a href="namespace-FOS.RestBundle.Util.html">Util<span></span></a> <ul> <li><a href="namespace-FOS.RestBundle.Util.Inflector.html">Inflector</a> </li> </ul></li> <li><a href="namespace-FOS.RestBundle.View.html">View</a> </li> </ul></li> <li class="active"><a href="namespace-FOS.UserBundle.html">UserBundle<span></span></a> <ul> <li><a href="namespace-FOS.UserBundle.Command.html">Command</a> </li> <li><a href="namespace-FOS.UserBundle.Controller.html">Controller</a> </li> <li><a href="namespace-FOS.UserBundle.CouchDocument.html">CouchDocument</a> </li> <li><a href="namespace-FOS.UserBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-FOS.UserBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-FOS.UserBundle.Doctrine.html">Doctrine</a> </li> <li><a href="namespace-FOS.UserBundle.Document.html">Document</a> </li> <li><a href="namespace-FOS.UserBundle.Entity.html">Entity</a> </li> <li><a href="namespace-FOS.UserBundle.Form.html">Form<span></span></a> <ul> <li><a href="namespace-FOS.UserBundle.Form.DataTransformer.html">DataTransformer</a> </li> <li><a href="namespace-FOS.UserBundle.Form.Handler.html">Handler</a> </li> <li><a href="namespace-FOS.UserBundle.Form.Model.html">Model</a> </li> <li><a href="namespace-FOS.UserBundle.Form.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-FOS.UserBundle.Mailer.html">Mailer</a> </li> <li><a href="namespace-FOS.UserBundle.Model.html">Model</a> </li> <li><a href="namespace-FOS.UserBundle.Propel.html">Propel</a> </li> <li><a href="namespace-FOS.UserBundle.Security.html">Security</a> </li> <li class="active"><a href="namespace-FOS.UserBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-FOS.UserBundle.Tests.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-FOS.UserBundle.Tests.Doctrine.html">Doctrine</a> </li> <li><a href="namespace-FOS.UserBundle.Tests.Model.html">Model</a> </li> <li><a href="namespace-FOS.UserBundle.Tests.Security.html">Security</a> </li> <li class="active"><a href="namespace-FOS.UserBundle.Tests.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-FOS.UserBundle.Util.html">Util</a> </li> <li><a href="namespace-FOS.UserBundle.Validator.html">Validator</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.html">Gedmo<span></span></a> <ul> <li><a href="namespace-Gedmo.Blameable.html">Blameable<span></span></a> <ul> <li><a href="namespace-Gedmo.Blameable.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.Blameable.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.Blameable.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.Blameable.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.Blameable.Traits.html">Traits</a> </li> </ul></li> <li><a href="namespace-Gedmo.Exception.html">Exception</a> </li> <li><a href="namespace-Gedmo.IpTraceable.html">IpTraceable<span></span></a> <ul> <li><a href="namespace-Gedmo.IpTraceable.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.IpTraceable.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.IpTraceable.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.IpTraceable.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.IpTraceable.Traits.html">Traits</a> </li> </ul></li> <li><a href="namespace-Gedmo.Loggable.html">Loggable<span></span></a> <ul> <li><a href="namespace-Gedmo.Loggable.Document.html">Document<span></span></a> <ul> <li><a href="namespace-Gedmo.Loggable.Document.MappedSuperclass.html">MappedSuperclass</a> </li> <li><a href="namespace-Gedmo.Loggable.Document.Repository.html">Repository</a> </li> </ul></li> <li><a href="namespace-Gedmo.Loggable.Entity.html">Entity<span></span></a> <ul> <li><a href="namespace-Gedmo.Loggable.Entity.MappedSuperclass.html">MappedSuperclass</a> </li> <li><a href="namespace-Gedmo.Loggable.Entity.Repository.html">Repository</a> </li> </ul></li> <li><a href="namespace-Gedmo.Loggable.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.Loggable.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.Loggable.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.Loggable.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Gedmo.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.Mapping.Annotation.html">Annotation</a> </li> <li><a href="namespace-Gedmo.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li> <li><a href="namespace-Gedmo.Mapping.Mock.html">Mock<span></span></a> <ul> <li><a href="namespace-Gedmo.Mapping.Mock.Extension.html">Extension<span></span></a> <ul> <li><a href="namespace-Gedmo.Mapping.Mock.Extension.Encoder.html">Encoder<span></span></a> <ul> <li><a href="namespace-Gedmo.Mapping.Mock.Extension.Encoder.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.Mapping.Mock.Extension.Encoder.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.Mapping.Mock.Extension.Encoder.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.Mapping.Mock.Extension.Encoder.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li></ul></li></ul></li> <li><a href="namespace-Gedmo.Mapping.Mock.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.Mapping.Mock.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.Mapping.Mock.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Gedmo.Mapping.Xml.html">Xml</a> </li> </ul></li> <li><a href="namespace-Gedmo.ReferenceIntegrity.html">ReferenceIntegrity<span></span></a> <ul> <li><a href="namespace-Gedmo.ReferenceIntegrity.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.ReferenceIntegrity.Mapping.Driver.html">Driver</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.References.html">References<span></span></a> <ul> <li><a href="namespace-Gedmo.References.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.References.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.References.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.References.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Gedmo.Sluggable.html">Sluggable<span></span></a> <ul> <li><a href="namespace-Gedmo.Sluggable.Handler.html">Handler</a> </li> <li><a href="namespace-Gedmo.Sluggable.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.Sluggable.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.Sluggable.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.Sluggable.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.Sluggable.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-Gedmo.SoftDeleteable.html">SoftDeleteable<span></span></a> <ul> <li><a href="namespace-Gedmo.SoftDeleteable.Filter.html">Filter<span></span></a> <ul> <li><a href="namespace-Gedmo.SoftDeleteable.Filter.ODM.html">ODM</a> </li> </ul></li> <li><a href="namespace-Gedmo.SoftDeleteable.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.SoftDeleteable.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.SoftDeleteable.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.SoftDeleteable.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.SoftDeleteable.Query.html">Query<span></span></a> <ul> <li><a href="namespace-Gedmo.SoftDeleteable.Query.TreeWalker.html">TreeWalker<span></span></a> <ul> <li><a href="namespace-Gedmo.SoftDeleteable.Query.TreeWalker.Exec.html">Exec</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.SoftDeleteable.Traits.html">Traits</a> </li> </ul></li> <li><a href="namespace-Gedmo.Sortable.html">Sortable<span></span></a> <ul> <li><a href="namespace-Gedmo.Sortable.Entity.html">Entity<span></span></a> <ul> <li><a href="namespace-Gedmo.Sortable.Entity.Repository.html">Repository</a> </li> </ul></li> <li><a href="namespace-Gedmo.Sortable.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.Sortable.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.Sortable.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.Sortable.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Gedmo.Timestampable.html">Timestampable<span></span></a> <ul> <li><a href="namespace-Gedmo.Timestampable.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.Timestampable.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.Timestampable.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.Timestampable.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.Timestampable.Traits.html">Traits</a> </li> </ul></li> <li><a href="namespace-Gedmo.Tool.html">Tool<span></span></a> <ul> <li><a href="namespace-Gedmo.Tool.Logging.html">Logging<span></span></a> <ul> <li><a href="namespace-Gedmo.Tool.Logging.DBAL.html">DBAL</a> </li> </ul></li> <li><a href="namespace-Gedmo.Tool.Wrapper.html">Wrapper</a> </li> </ul></li> <li><a href="namespace-Gedmo.Translatable.html">Translatable<span></span></a> <ul> <li><a href="namespace-Gedmo.Translatable.Document.html">Document<span></span></a> <ul> <li><a href="namespace-Gedmo.Translatable.Document.MappedSuperclass.html">MappedSuperclass</a> </li> <li><a href="namespace-Gedmo.Translatable.Document.Repository.html">Repository</a> </li> </ul></li> <li><a href="namespace-Gedmo.Translatable.Entity.html">Entity<span></span></a> <ul> <li><a href="namespace-Gedmo.Translatable.Entity.MappedSuperclass.html">MappedSuperclass</a> </li> <li><a href="namespace-Gedmo.Translatable.Entity.Repository.html">Repository</a> </li> </ul></li> <li><a href="namespace-Gedmo.Translatable.Hydrator.html">Hydrator<span></span></a> <ul> <li><a href="namespace-Gedmo.Translatable.Hydrator.ORM.html">ORM</a> </li> </ul></li> <li><a href="namespace-Gedmo.Translatable.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.Translatable.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.Translatable.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.Translatable.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.Translatable.Query.html">Query<span></span></a> <ul> <li><a href="namespace-Gedmo.Translatable.Query.TreeWalker.html">TreeWalker</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.Translator.html">Translator<span></span></a> <ul> <li><a href="namespace-Gedmo.Translator.Document.html">Document</a> </li> <li><a href="namespace-Gedmo.Translator.Entity.html">Entity</a> </li> </ul></li> <li><a href="namespace-Gedmo.Tree.html">Tree<span></span></a> <ul> <li><a href="namespace-Gedmo.Tree.Document.html">Document<span></span></a> <ul> <li><a href="namespace-Gedmo.Tree.Document.MongoDB.html">MongoDB<span></span></a> <ul> <li><a href="namespace-Gedmo.Tree.Document.MongoDB.Repository.html">Repository</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.Tree.Entity.html">Entity<span></span></a> <ul> <li><a href="namespace-Gedmo.Tree.Entity.MappedSuperclass.html">MappedSuperclass</a> </li> <li><a href="namespace-Gedmo.Tree.Entity.Repository.html">Repository</a> </li> </ul></li> <li><a href="namespace-Gedmo.Tree.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.Tree.Mapping.Driver.html">Driver</a> </li> <li><a href="namespace-Gedmo.Tree.Mapping.Event.html">Event<span></span></a> <ul> <li><a href="namespace-Gedmo.Tree.Mapping.Event.Adapter.html">Adapter</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.Tree.Strategy.html">Strategy<span></span></a> <ul> <li><a href="namespace-Gedmo.Tree.Strategy.ODM.html">ODM<span></span></a> <ul> <li><a href="namespace-Gedmo.Tree.Strategy.ODM.MongoDB.html">MongoDB</a> </li> </ul></li> <li><a href="namespace-Gedmo.Tree.Strategy.ORM.html">ORM</a> </li> </ul></li></ul></li> <li><a href="namespace-Gedmo.Uploadable.html">Uploadable<span></span></a> <ul> <li><a href="namespace-Gedmo.Uploadable.Event.html">Event</a> </li> <li><a href="namespace-Gedmo.Uploadable.FileInfo.html">FileInfo</a> </li> <li><a href="namespace-Gedmo.Uploadable.FilenameGenerator.html">FilenameGenerator</a> </li> <li><a href="namespace-Gedmo.Uploadable.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Gedmo.Uploadable.Mapping.Driver.html">Driver</a> </li> </ul></li> <li><a href="namespace-Gedmo.Uploadable.MimeType.html">MimeType</a> </li> <li><a href="namespace-Gedmo.Uploadable.Stub.html">Stub</a> </li> </ul></li></ul></li> <li><a href="namespace-Incenteev.html">Incenteev<span></span></a> <ul> <li><a href="namespace-Incenteev.ParameterHandler.html">ParameterHandler<span></span></a> <ul> <li><a href="namespace-Incenteev.ParameterHandler.Tests.html">Tests</a> </li> </ul></li></ul></li> <li><a href="namespace-IpTraceable.html">IpTraceable<span></span></a> <ul> <li><a href="namespace-IpTraceable.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-IpTraceable.Fixture.Document.html">Document</a> </li> </ul></li></ul></li> <li><a href="namespace-JMS.html">JMS<span></span></a> <ul> <li><a href="namespace-JMS.Parser.html">Parser<span></span></a> <ul> <li><a href="namespace-JMS.Parser.Tests.html">Tests</a> </li> </ul></li> <li><a href="namespace-JMS.Serializer.html">Serializer<span></span></a> <ul> <li><a href="namespace-JMS.Serializer.Annotation.html">Annotation</a> </li> <li><a href="namespace-JMS.Serializer.Builder.html">Builder</a> </li> <li><a href="namespace-JMS.Serializer.Construction.html">Construction</a> </li> <li><a href="namespace-JMS.Serializer.EventDispatcher.html">EventDispatcher<span></span></a> <ul> <li><a href="namespace-JMS.Serializer.EventDispatcher.Subscriber.html">Subscriber</a> </li> </ul></li> <li><a href="namespace-JMS.Serializer.Exception.html">Exception</a> </li> <li><a href="namespace-JMS.Serializer.Exclusion.html">Exclusion</a> </li> <li><a href="namespace-JMS.Serializer.Handler.html">Handler</a> </li> <li><a href="namespace-JMS.Serializer.Metadata.html">Metadata<span></span></a> <ul> <li><a href="namespace-JMS.Serializer.Metadata.Driver.html">Driver</a> </li> </ul></li> <li><a href="namespace-JMS.Serializer.Naming.html">Naming</a> </li> <li><a href="namespace-JMS.Serializer.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-JMS.Serializer.Tests.Exclusion.html">Exclusion</a> </li> <li><a href="namespace-JMS.Serializer.Tests.Fixtures.html">Fixtures<span></span></a> <ul> <li><a href="namespace-JMS.Serializer.Tests.Fixtures.Discriminator.html">Discriminator</a> </li> <li><a href="namespace-JMS.Serializer.Tests.Fixtures.Doctrine.html">Doctrine</a> </li> <li><a href="namespace-JMS.Serializer.Tests.Fixtures.DoctrinePHPCR.html">DoctrinePHPCR</a> </li> </ul></li> <li><a href="namespace-JMS.Serializer.Tests.Handler.html">Handler</a> </li> <li><a href="namespace-JMS.Serializer.Tests.Metadata.html">Metadata<span></span></a> <ul> <li><a href="namespace-JMS.Serializer.Tests.Metadata.Driver.html">Driver</a> </li> </ul></li> <li><a href="namespace-JMS.Serializer.Tests.Serializer.html">Serializer<span></span></a> <ul> <li><a href="namespace-JMS.Serializer.Tests.Serializer.EventDispatcher.html">EventDispatcher<span></span></a> <ul> <li><a href="namespace-JMS.Serializer.Tests.Serializer.EventDispatcher.Subscriber.html">Subscriber</a> </li> </ul></li> <li><a href="namespace-JMS.Serializer.Tests.Serializer.Naming.html">Naming</a> </li> </ul></li> <li><a href="namespace-JMS.Serializer.Tests.Twig.html">Twig</a> </li> </ul></li> <li><a href="namespace-JMS.Serializer.Twig.html">Twig</a> </li> <li><a href="namespace-JMS.Serializer.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-JMS.SerializerBundle.html">SerializerBundle<span></span></a> <ul> <li><a href="namespace-JMS.SerializerBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-JMS.SerializerBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-JMS.SerializerBundle.Serializer.html">Serializer</a> </li> <li><a href="namespace-JMS.SerializerBundle.Templating.html">Templating</a> </li> <li><a href="namespace-JMS.SerializerBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-JMS.SerializerBundle.Tests.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-JMS.SerializerBundle.Tests.DependencyInjection.Fixture.html">Fixture</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-JMS.TranslationBundle.html">TranslationBundle<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Annotation.html">Annotation</a> </li> <li><a href="namespace-JMS.TranslationBundle.Command.html">Command</a> </li> <li><a href="namespace-JMS.TranslationBundle.Controller.html">Controller</a> </li> <li><a href="namespace-JMS.TranslationBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-JMS.TranslationBundle.Exception.html">Exception</a> </li> <li><a href="namespace-JMS.TranslationBundle.Logger.html">Logger</a> </li> <li><a href="namespace-JMS.TranslationBundle.Model.html">Model</a> </li> <li><a href="namespace-JMS.TranslationBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Tests.Functional.html">Functional<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Tests.Functional.TestBundle.html">TestBundle<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Tests.Functional.TestBundle.Controller.html">Controller</a> </li> </ul></li></ul></li> <li><a href="namespace-JMS.TranslationBundle.Tests.Model.html">Model</a> </li> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.html">Translation<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.Comparison.html">Comparison</a> </li> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.Dumper.html">Dumper</a> </li> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.Extractor.html">Extractor<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.Extractor.File.html">File<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.Extractor.File.Fixture.html">Fixture</a> </li> </ul></li> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.Extractor.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.Extractor.Fixture.SimpleTest.html">SimpleTest<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.Extractor.Fixture.SimpleTest.Controller.html">Controller</a> </li> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.Extractor.Fixture.SimpleTest.Form.html">Form</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.Loader.html">Loader<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Tests.Translation.Loader.Symfony.html">Symfony</a> </li> </ul></li></ul></li> <li><a href="namespace-JMS.TranslationBundle.Tests.Twig.html">Twig</a> </li> </ul></li> <li><a href="namespace-JMS.TranslationBundle.Translation.html">Translation<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Translation.Comparison.html">Comparison</a> </li> <li><a href="namespace-JMS.TranslationBundle.Translation.Dumper.html">Dumper</a> </li> <li><a href="namespace-JMS.TranslationBundle.Translation.Extractor.html">Extractor<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Translation.Extractor.File.html">File</a> </li> </ul></li> <li><a href="namespace-JMS.TranslationBundle.Translation.Loader.html">Loader<span></span></a> <ul> <li><a href="namespace-JMS.TranslationBundle.Translation.Loader.Symfony.html">Symfony</a> </li> </ul></li></ul></li> <li><a href="namespace-JMS.TranslationBundle.Twig.html">Twig</a> </li> <li><a href="namespace-JMS.TranslationBundle.Util.html">Util</a> </li> </ul></li></ul></li> <li><a href="namespace-Knp.html">Knp<span></span></a> <ul> <li><a href="namespace-Knp.Bundle.html">Bundle<span></span></a> <ul> <li><a href="namespace-Knp.Bundle.MenuBundle.html">MenuBundle<span></span></a> <ul> <li><a href="namespace-Knp.Bundle.MenuBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Knp.Bundle.MenuBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Knp.Bundle.MenuBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Knp.Bundle.MenuBundle.Provider.html">Provider</a> </li> <li><a href="namespace-Knp.Bundle.MenuBundle.Renderer.html">Renderer</a> </li> <li><a href="namespace-Knp.Bundle.MenuBundle.Templating.html">Templating<span></span></a> <ul> <li><a href="namespace-Knp.Bundle.MenuBundle.Templating.Helper.html">Helper</a> </li> </ul></li> <li><a href="namespace-Knp.Bundle.MenuBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Knp.Bundle.MenuBundle.Tests.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Knp.Bundle.MenuBundle.Tests.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Knp.Bundle.MenuBundle.Tests.EventListener.html">EventListener</a> </li> <li><a href="namespace-Knp.Bundle.MenuBundle.Tests.Provider.html">Provider</a> </li> <li><a href="namespace-Knp.Bundle.MenuBundle.Tests.Renderer.html">Renderer</a> </li> <li><a href="namespace-Knp.Bundle.MenuBundle.Tests.Stubs.html">Stubs<span></span></a> <ul> <li><a href="namespace-Knp.Bundle.MenuBundle.Tests.Stubs.Child.html">Child<span></span></a> <ul> <li><a href="namespace-Knp.Bundle.MenuBundle.Tests.Stubs.Child.Menu.html">Menu</a> </li> </ul></li> <li><a href="namespace-Knp.Bundle.MenuBundle.Tests.Stubs.Menu.html">Menu</a> </li> </ul></li> <li><a href="namespace-Knp.Bundle.MenuBundle.Tests.Templating.html">Templating</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Knp.Menu.html">Menu<span></span></a> <ul> <li><a href="namespace-Knp.Menu.Factory.html">Factory</a> </li> <li><a href="namespace-Knp.Menu.Integration.html">Integration<span></span></a> <ul> <li><a href="namespace-Knp.Menu.Integration.Silex.html">Silex</a> </li> <li><a href="namespace-Knp.Menu.Integration.Symfony.html">Symfony</a> </li> </ul></li> <li><a href="namespace-Knp.Menu.Iterator.html">Iterator</a> </li> <li><a href="namespace-Knp.Menu.Loader.html">Loader</a> </li> <li><a href="namespace-Knp.Menu.Matcher.html">Matcher<span></span></a> <ul> <li><a href="namespace-Knp.Menu.Matcher.Voter.html">Voter</a> </li> </ul></li> <li><a href="namespace-Knp.Menu.Provider.html">Provider</a> </li> <li><a href="namespace-Knp.Menu.Renderer.html">Renderer</a> </li> <li><a href="namespace-Knp.Menu.Silex.html">Silex<span></span></a> <ul> <li><a href="namespace-Knp.Menu.Silex.Voter.html">Voter</a> </li> </ul></li> <li><a href="namespace-Knp.Menu.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Knp.Menu.Tests.Factory.html">Factory</a> </li> <li><a href="namespace-Knp.Menu.Tests.Integration.html">Integration<span></span></a> <ul> <li><a href="namespace-Knp.Menu.Tests.Integration.Silex.html">Silex</a> </li> </ul></li> <li><a href="namespace-Knp.Menu.Tests.Iterator.html">Iterator</a> </li> <li><a href="namespace-Knp.Menu.Tests.Loader.html">Loader</a> </li> <li><a href="namespace-Knp.Menu.Tests.Matcher.html">Matcher<span></span></a> <ul> <li><a href="namespace-Knp.Menu.Tests.Matcher.Voter.html">Voter</a> </li> </ul></li> <li><a href="namespace-Knp.Menu.Tests.Provider.html">Provider</a> </li> <li><a href="namespace-Knp.Menu.Tests.Renderer.html">Renderer</a> </li> <li><a href="namespace-Knp.Menu.Tests.Silex.html">Silex</a> </li> <li><a href="namespace-Knp.Menu.Tests.Twig.html">Twig</a> </li> <li><a href="namespace-Knp.Menu.Tests.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-Knp.Menu.Twig.html">Twig</a> </li> <li><a href="namespace-Knp.Menu.Util.html">Util</a> </li> </ul></li></ul></li> <li><a href="namespace-Loggable.html">Loggable<span></span></a> <ul> <li><a href="namespace-Loggable.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Loggable.Fixture.Document.html">Document<span></span></a> <ul> <li><a href="namespace-Loggable.Fixture.Document.Log.html">Log</a> </li> </ul></li> <li><a href="namespace-Loggable.Fixture.Entity.html">Entity<span></span></a> <ul> <li><a href="namespace-Loggable.Fixture.Entity.Log.html">Log</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Lunetics.html">Lunetics<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.html">LocaleBundle<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Cookie.html">Cookie</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Lunetics.LocaleBundle.Event.html">Event</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Form.html">Form<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.Form.Extension.html">Extension<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.Form.Extension.ChoiceList.html">ChoiceList</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Form.Extension.Type.html">Type</a> </li> </ul></li></ul></li> <li><a href="namespace-Lunetics.LocaleBundle.LocaleGuesser.html">LocaleGuesser</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.LocaleInformation.html">LocaleInformation</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Matcher.html">Matcher</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Session.html">Session</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Switcher.html">Switcher</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Templating.html">Templating<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.Templating.Helper.html">Helper</a> </li> </ul></li> <li><a href="namespace-Lunetics.LocaleBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.Tests.Controller.html">Controller</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Tests.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.Tests.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Lunetics.LocaleBundle.Tests.Event.html">Event</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Tests.EventListener.html">EventListener</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Tests.Form.html">Form<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.Tests.Form.Extension.html">Extension<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.Tests.Form.Extension.ChoiceList.html">ChoiceList</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Tests.Form.Extension.Type.html">Type</a> </li> </ul></li></ul></li> <li><a href="namespace-Lunetics.LocaleBundle.Tests.LocaleGuesser.html">LocaleGuesser</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Tests.LocaleInformation.html">LocaleInformation</a> </li> <li><a href="namespace-Lunetics.LocaleBundle.Tests.Templating.html">Templating<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.Tests.Templating.Helper.html">Helper</a> </li> </ul></li> <li><a href="namespace-Lunetics.LocaleBundle.Tests.Twig.html">Twig<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.Tests.Twig.Extension.html">Extension</a> </li> </ul></li> <li><a href="namespace-Lunetics.LocaleBundle.Tests.Validator.html">Validator</a> </li> </ul></li> <li><a href="namespace-Lunetics.LocaleBundle.Twig.html">Twig<span></span></a> <ul> <li><a href="namespace-Lunetics.LocaleBundle.Twig.Extension.html">Extension</a> </li> </ul></li> <li><a href="namespace-Lunetics.LocaleBundle.Validator.html">Validator</a> </li> </ul></li></ul></li> <li><a href="namespace-Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Mapping.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Mapping.Fixture.Compatibility.html">Compatibility</a> </li> <li><a href="namespace-Mapping.Fixture.Document.html">Document</a> </li> <li><a href="namespace-Mapping.Fixture.Unmapped.html">Unmapped</a> </li> <li><a href="namespace-Mapping.Fixture.Xml.html">Xml</a> </li> <li><a href="namespace-Mapping.Fixture.Yaml.html">Yaml</a> </li> </ul></li></ul></li> <li><a href="namespace-Metadata.html">Metadata<span></span></a> <ul> <li><a href="namespace-Metadata.Cache.html">Cache</a> </li> <li><a href="namespace-Metadata.Driver.html">Driver</a> </li> <li><a href="namespace-Metadata.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Metadata.Tests.Cache.html">Cache</a> </li> <li><a href="namespace-Metadata.Tests.Driver.html">Driver<span></span></a> <ul> <li><a href="namespace-Metadata.Tests.Driver.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Metadata.Tests.Driver.Fixture.A.html">A</a> </li> <li><a href="namespace-Metadata.Tests.Driver.Fixture.B.html">B</a> </li> <li><a href="namespace-Metadata.Tests.Driver.Fixture.C.html">C<span></span></a> <ul> <li><a href="namespace-Metadata.Tests.Driver.Fixture.C.SubDir.html">SubDir</a> </li> </ul></li> <li><a href="namespace-Metadata.Tests.Driver.Fixture.T.html">T</a> </li> </ul></li></ul></li> <li><a href="namespace-Metadata.Tests.Fixtures.html">Fixtures<span></span></a> <ul> <li><a href="namespace-Metadata.Tests.Fixtures.ComplexHierarchy.html">ComplexHierarchy</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Monolog.html">Monolog<span></span></a> <ul> <li><a href="namespace-Monolog.Formatter.html">Formatter</a> </li> <li><a href="namespace-Monolog.Handler.html">Handler<span></span></a> <ul> <li><a href="namespace-Monolog.Handler.FingersCrossed.html">FingersCrossed</a> </li> <li><a href="namespace-Monolog.Handler.SyslogUdp.html">SyslogUdp</a> </li> </ul></li> <li><a href="namespace-Monolog.Processor.html">Processor</a> </li> </ul></li> <li><a href="namespace-MyProject.html">MyProject<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.html">Proxies<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.__CG__.html">__CG__<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.__CG__.Doctrine.html">Doctrine<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.__CG__.Doctrine.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.__CG__.Doctrine.Tests.Common.html">Common<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.__CG__.Doctrine.Tests.Common.Util.html">Util</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-MyProject.Proxies.__CG__.OtherProject.html">OtherProject<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.__CG__.OtherProject.Proxies.html">Proxies<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.__CG__.OtherProject.Proxies.__CG__.html">__CG__<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.__CG__.OtherProject.Proxies.__CG__.Doctrine.html">Doctrine<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.__CG__.OtherProject.Proxies.__CG__.Doctrine.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.__CG__.OtherProject.Proxies.__CG__.Doctrine.Tests.Common.html">Common<span></span></a> <ul> <li><a href="namespace-MyProject.Proxies.__CG__.OtherProject.Proxies.__CG__.Doctrine.Tests.Common.Util.html">Util</a> </li> </ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li></ul></li> <li><a href="namespace-NamespaceCollision.html">NamespaceCollision<span></span></a> <ul> <li><a href="namespace-NamespaceCollision.A.html">A<span></span></a> <ul> <li><a href="namespace-NamespaceCollision.A.B.html">B</a> </li> </ul></li> <li><a href="namespace-NamespaceCollision.C.html">C<span></span></a> <ul> <li><a href="namespace-NamespaceCollision.C.B.html">B</a> </li> </ul></li></ul></li> <li><a href="namespace-Namespaced.html">Namespaced</a> </li> <li><a href="namespace-Namespaced2.html">Namespaced2</a> </li> <li><a href="namespace-Negotiation.html">Negotiation<span></span></a> <ul> <li><a href="namespace-Negotiation.Tests.html">Tests</a> </li> </ul></li> <li><a href="namespace-None.html">None</a> </li> <li><a href="namespace-Pequiven.html">Pequiven<span></span></a> <ul> <li><a href="namespace-Pequiven.SEIPBundle.html">SEIPBundle<span></span></a> <ul> <li><a href="namespace-Pequiven.SEIPBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Pequiven.SEIPBundle.DataFixtures.html">DataFixtures</a> </li> <li><a href="namespace-Pequiven.SEIPBundle.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Pequiven.SEIPBundle.Entity.html">Entity</a> </li> <li><a href="namespace-Pequiven.SEIPBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Pequiven.SEIPBundle.Form.html">Form<span></span></a> <ul> <li><a href="namespace-Pequiven.SEIPBundle.Form.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-Pequiven.SEIPBundle.Menu.html">Menu<span></span></a> <ul> <li><a href="namespace-Pequiven.SEIPBundle.Menu.Template.html">Template<span></span></a> <ul> <li><a href="namespace-Pequiven.SEIPBundle.Menu.Template.Developer.html">Developer</a> </li> </ul></li></ul></li> <li><a href="namespace-Pequiven.SEIPBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Pequiven.SEIPBundle.Tests.Controller.html">Controller</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-PHP.html">PHP</a> </li> <li><a href="namespace-PhpCollection.html">PhpCollection<span></span></a> <ul> <li><a href="namespace-PhpCollection.Tests.html">Tests</a> </li> </ul></li> <li><a href="namespace-PhpOption.html">PhpOption<span></span></a> <ul> <li><a href="namespace-PhpOption.Tests.html">Tests</a> </li> </ul></li> <li><a href="namespace-Proxies.html">Proxies<span></span></a> <ul> <li><a href="namespace-Proxies.__CG__.html">__CG__<span></span></a> <ul> <li><a href="namespace-Proxies.__CG__.Pequiven.html">Pequiven<span></span></a> <ul> <li><a href="namespace-Proxies.__CG__.Pequiven.SEIPBundle.html">SEIPBundle<span></span></a> <ul> <li><a href="namespace-Proxies.__CG__.Pequiven.SEIPBundle.Entity.html">Entity</a> </li> </ul></li></ul></li></ul></li></ul></li> <li><a href="namespace-Psr.html">Psr<span></span></a> <ul> <li><a href="namespace-Psr.Log.html">Log<span></span></a> <ul> <li><a href="namespace-Psr.Log.Test.html">Test</a> </li> </ul></li></ul></li> <li><a href="namespace-ReferenceIntegrity.html">ReferenceIntegrity<span></span></a> <ul> <li><a href="namespace-ReferenceIntegrity.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-ReferenceIntegrity.Fixture.Document.html">Document<span></span></a> <ul> <li><a href="namespace-ReferenceIntegrity.Fixture.Document.ManyNullify.html">ManyNullify</a> </li> <li><a href="namespace-ReferenceIntegrity.Fixture.Document.ManyRestrict.html">ManyRestrict</a> </li> <li><a href="namespace-ReferenceIntegrity.Fixture.Document.OneNullify.html">OneNullify</a> </li> <li><a href="namespace-ReferenceIntegrity.Fixture.Document.OneRestrict.html">OneRestrict</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-References.html">References<span></span></a> <ul> <li><a href="namespace-References.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-References.Fixture.ODM.html">ODM<span></span></a> <ul> <li><a href="namespace-References.Fixture.ODM.MongoDB.html">MongoDB</a> </li> </ul></li> <li><a href="namespace-References.Fixture.ORM.html">ORM</a> </li> </ul></li></ul></li> <li><a href="namespace-Sensio.html">Sensio<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.html">Bundle<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.DistributionBundle.html">DistributionBundle<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.DistributionBundle.Composer.html">Composer</a> </li> <li><a href="namespace-Sensio.Bundle.DistributionBundle.Configurator.html">Configurator<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.DistributionBundle.Configurator.Form.html">Form</a> </li> <li><a href="namespace-Sensio.Bundle.DistributionBundle.Configurator.Step.html">Step</a> </li> </ul></li> <li><a href="namespace-Sensio.Bundle.DistributionBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Sensio.Bundle.DistributionBundle.DependencyInjection.html">DependencyInjection</a> </li> </ul></li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.html">FrameworkExtraBundle<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Configuration.html">Configuration</a> </li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Request.html">Request<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Request.ParamConverter.html">ParamConverter</a> </li> </ul></li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Routing.html">Routing</a> </li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Security.html">Security</a> </li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Templating.html">Templating</a> </li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Configuration.html">Configuration</a> </li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.EventListener.html">EventListener<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.EventListener.Fixture.html">Fixture</a> </li> </ul></li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Request.html">Request<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Request.ParamConverter.html">ParamConverter</a> </li> </ul></li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Routing.html">Routing</a> </li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Templating.html">Templating<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Templating.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Templating.Fixture.BarBundle.html">BarBundle<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Templating.Fixture.BarBundle.Controller.html">Controller</a> </li> </ul></li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Templating.Fixture.FooBarBundle.html">FooBarBundle<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Templating.Fixture.FooBarBundle.Controller.html">Controller</a> </li> </ul></li> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Templating.Fixture.FooBundle.html">FooBundle<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.FrameworkExtraBundle.Tests.Templating.Fixture.FooBundle.Controller.html">Controller</a> </li> </ul></li></ul></li></ul></li></ul></li></ul></li> <li><a href="namespace-Sensio.Bundle.GeneratorBundle.html">GeneratorBundle<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.GeneratorBundle.Command.html">Command<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.GeneratorBundle.Command.Helper.html">Helper</a> </li> </ul></li> <li><a href="namespace-Sensio.Bundle.GeneratorBundle.Generator.html">Generator</a> </li> <li><a href="namespace-Sensio.Bundle.GeneratorBundle.Manipulator.html">Manipulator</a> </li> <li><a href="namespace-Sensio.Bundle.GeneratorBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Sensio.Bundle.GeneratorBundle.Tests.Command.html">Command</a> </li> <li><a href="namespace-Sensio.Bundle.GeneratorBundle.Tests.Generator.html">Generator</a> </li> </ul></li></ul></li></ul></li></ul></li> <li><a href="namespace-Sluggable.html">Sluggable<span></span></a> <ul> <li><a href="namespace-Sluggable.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Sluggable.Fixture.Doctrine.html">Doctrine</a> </li> <li><a href="namespace-Sluggable.Fixture.Document.html">Document<span></span></a> <ul> <li><a href="namespace-Sluggable.Fixture.Document.Handler.html">Handler</a> </li> </ul></li> <li><a href="namespace-Sluggable.Fixture.Handler.html">Handler<span></span></a> <ul> <li><a href="namespace-Sluggable.Fixture.Handler.People.html">People</a> </li> </ul></li> <li><a href="namespace-Sluggable.Fixture.Inheritance.html">Inheritance</a> </li> <li><a href="namespace-Sluggable.Fixture.Inheritance2.html">Inheritance2</a> </li> <li><a href="namespace-Sluggable.Fixture.Issue104.html">Issue104</a> </li> <li><a href="namespace-Sluggable.Fixture.Issue116.html">Issue116</a> </li> <li><a href="namespace-Sluggable.Fixture.Issue131.html">Issue131</a> </li> <li><a href="namespace-Sluggable.Fixture.Issue449.html">Issue449</a> </li> <li><a href="namespace-Sluggable.Fixture.Issue633.html">Issue633</a> </li> <li><a href="namespace-Sluggable.Fixture.Issue827.html">Issue827</a> </li> <li><a href="namespace-Sluggable.Fixture.Issue939.html">Issue939</a> </li> <li><a href="namespace-Sluggable.Fixture.MappedSuperclass.html">MappedSuperclass</a> </li> </ul></li></ul></li> <li><a href="namespace-SoftDeleteable.html">SoftDeleteable<span></span></a> <ul> <li><a href="namespace-SoftDeleteable.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-SoftDeleteable.Fixture.Document.html">Document</a> </li> <li><a href="namespace-SoftDeleteable.Fixture.Entity.html">Entity</a> </li> </ul></li></ul></li> <li><a href="namespace-Sortable.html">Sortable<span></span></a> <ul> <li><a href="namespace-Sortable.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Sortable.Fixture.Transport.html">Transport</a> </li> </ul></li></ul></li> <li><a href="namespace-Stof.html">Stof<span></span></a> <ul> <li><a href="namespace-Stof.DoctrineExtensionsBundle.html">DoctrineExtensionsBundle<span></span></a> <ul> <li><a href="namespace-Stof.DoctrineExtensionsBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Stof.DoctrineExtensionsBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Stof.DoctrineExtensionsBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Stof.DoctrineExtensionsBundle.Uploadable.html">Uploadable</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.html">Symfony<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.html">Bridge<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.html">Doctrine<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.CacheWarmer.html">CacheWarmer</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.DataCollector.html">DataCollector</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.DataFixtures.html">DataFixtures</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.DependencyInjection.CompilerPass.html">CompilerPass</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.DependencyInjection.Security.html">Security<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.DependencyInjection.Security.UserProvider.html">UserProvider</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Bridge.Doctrine.ExpressionLanguage.html">ExpressionLanguage</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Form.html">Form<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.Form.ChoiceList.html">ChoiceList</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Form.DataTransformer.html">DataTransformer</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Form.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Form.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-Symfony.Bridge.Doctrine.HttpFoundation.html">HttpFoundation</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Logger.html">Logger</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Security.html">Security<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.Security.RememberMe.html">RememberMe</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Security.User.html">User</a> </li> </ul></li> <li><a href="namespace-Symfony.Bridge.Doctrine.Test.html">Test</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.DataCollector.html">DataCollector</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.DataFixtures.html">DataFixtures</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.DependencyInjection.CompilerPass.html">CompilerPass</a> </li> </ul></li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.ExpressionLanguage.html">ExpressionLanguage</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.Fixtures.html">Fixtures</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.Form.html">Form<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.Form.ChoiceList.html">ChoiceList</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.Form.DataTransformer.html">DataTransformer</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.Form.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.HttpFoundation.html">HttpFoundation</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.Logger.html">Logger</a> </li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.Security.html">Security<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.Security.User.html">User</a> </li> </ul></li> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.Validator.html">Validator<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.Tests.Validator.Constraints.html">Constraints</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Bridge.Doctrine.Validator.html">Validator<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Doctrine.Validator.Constraints.html">Constraints</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Bridge.Monolog.html">Monolog<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Monolog.Formatter.html">Formatter</a> </li> <li><a href="namespace-Symfony.Bridge.Monolog.Handler.html">Handler</a> </li> <li><a href="namespace-Symfony.Bridge.Monolog.Processor.html">Processor</a> </li> <li><a href="namespace-Symfony.Bridge.Monolog.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Monolog.Tests.Handler.html">Handler</a> </li> <li><a href="namespace-Symfony.Bridge.Monolog.Tests.Processor.html">Processor</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Bridge.Propel1.html">Propel1<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Propel1.DataCollector.html">DataCollector</a> </li> <li><a href="namespace-Symfony.Bridge.Propel1.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Propel1.DependencyInjection.Security.html">Security<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Propel1.DependencyInjection.Security.UserProvider.html">UserProvider</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Bridge.Propel1.Form.html">Form<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Propel1.Form.ChoiceList.html">ChoiceList</a> </li> <li><a href="namespace-Symfony.Bridge.Propel1.Form.DataTransformer.html">DataTransformer</a> </li> <li><a href="namespace-Symfony.Bridge.Propel1.Form.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Bridge.Propel1.Form.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-Symfony.Bridge.Propel1.Logger.html">Logger</a> </li> <li><a href="namespace-Symfony.Bridge.Propel1.Security.html">Security<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Propel1.Security.User.html">User</a> </li> </ul></li> <li><a href="namespace-Symfony.Bridge.Propel1.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Propel1.Tests.DataCollector.html">DataCollector</a> </li> <li><a href="namespace-Symfony.Bridge.Propel1.Tests.Fixtures.html">Fixtures</a> </li> <li><a href="namespace-Symfony.Bridge.Propel1.Tests.Form.html">Form<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Propel1.Tests.Form.ChoiceList.html">ChoiceList</a> </li> <li><a href="namespace-Symfony.Bridge.Propel1.Tests.Form.DataTransformer.html">DataTransformer</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Symfony.Bridge.ProxyManager.html">ProxyManager<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.ProxyManager.LazyProxy.html">LazyProxy<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.ProxyManager.LazyProxy.Instantiator.html">Instantiator</a> </li> <li><a href="namespace-Symfony.Bridge.ProxyManager.LazyProxy.PhpDumper.html">PhpDumper</a> </li> </ul></li> <li><a href="namespace-Symfony.Bridge.ProxyManager.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.ProxyManager.Tests.LazyProxy.html">LazyProxy<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.ProxyManager.Tests.LazyProxy.Dumper.html">Dumper</a> </li> <li><a href="namespace-Symfony.Bridge.ProxyManager.Tests.LazyProxy.Instantiator.html">Instantiator</a> </li> <li><a href="namespace-Symfony.Bridge.ProxyManager.Tests.LazyProxy.PhpDumper.html">PhpDumper</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Symfony.Bridge.Twig.html">Twig<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Twig.Extension.html">Extension</a> </li> <li><a href="namespace-Symfony.Bridge.Twig.Form.html">Form</a> </li> <li><a href="namespace-Symfony.Bridge.Twig.Node.html">Node</a> </li> <li><a href="namespace-Symfony.Bridge.Twig.NodeVisitor.html">NodeVisitor</a> </li> <li><a href="namespace-Symfony.Bridge.Twig.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Twig.Tests.Extension.html">Extension<span></span></a> <ul> <li><a href="namespace-Symfony.Bridge.Twig.Tests.Extension.Fixtures.html">Fixtures</a> </li> </ul></li> <li><a href="namespace-Symfony.Bridge.Twig.Tests.Node.html">Node</a> </li> <li><a href="namespace-Symfony.Bridge.Twig.Tests.NodeVisitor.html">NodeVisitor</a> </li> <li><a href="namespace-Symfony.Bridge.Twig.Tests.TokenParser.html">TokenParser</a> </li> <li><a href="namespace-Symfony.Bridge.Twig.Tests.Translation.html">Translation</a> </li> </ul></li> <li><a href="namespace-Symfony.Bridge.Twig.TokenParser.html">TokenParser</a> </li> <li><a href="namespace-Symfony.Bridge.Twig.Translation.html">Translation</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Bundle.html">Bundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.AsseticBundle.html">AsseticBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.AsseticBundle.CacheWarmer.html">CacheWarmer</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Command.html">Command</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Config.html">Config</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.AsseticBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Factory.html">Factory<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Factory.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Factory.Resource.html">Resource</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Factory.Worker.html">Worker</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Routing.html">Routing</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Templating.html">Templating</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Tests.CacheWarmer.html">CacheWarmer</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Tests.Command.html">Command</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Tests.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Tests.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Tests.Factory.html">Factory<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Tests.Factory.Resource.html">Resource</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Tests.Templating.html">Templating</a> </li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Tests.TestBundle.html">TestBundle</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.AsseticBundle.Twig.html">Twig</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.html">FrameworkBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.CacheWarmer.html">CacheWarmer</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Command.html">Command</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Console.html">Console<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Console.Descriptor.html">Descriptor</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Console.Helper.html">Helper</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.DataCollector.html">DataCollector</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Fragment.html">Fragment</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.HttpCache.html">HttpCache</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Routing.html">Routing</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Templating.html">Templating<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Templating.Asset.html">Asset</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Templating.Helper.html">Helper</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Templating.Loader.html">Loader</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Test.html">Test</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.CacheWarmer.html">CacheWarmer</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Console.html">Console<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Console.Descriptor.html">Descriptor</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Fixtures.html">Fixtures<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Fixtures.BaseBundle.html">BaseBundle</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Fragment.html">Fragment</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Functional.html">Functional<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Functional.app.html">app</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Functional.Bundle.html">Bundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Functional.Bundle.TestBundle.html">TestBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Functional.Bundle.TestBundle.Controller.html">Controller</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Routing.html">Routing</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Templating.html">Templating<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Templating.Helper.html">Helper<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Templating.Helper.Fixtures.html">Fixtures</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Templating.Loader.html">Loader</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Translation.html">Translation</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Tests.Validator.html">Validator</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Translation.html">Translation</a> </li> <li><a href="namespace-Symfony.Bundle.FrameworkBundle.Validator.html">Validator</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.MonologBundle.html">MonologBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.MonologBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.MonologBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.MonologBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.MonologBundle.Tests.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.MonologBundle.Tests.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.html">SecurityBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Command.html">Command</a> </li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.DataCollector.html">DataCollector</a> </li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.DependencyInjection.Compiler.html">Compiler</a> </li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.DependencyInjection.Security.html">Security<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.DependencyInjection.Security.Factory.html">Factory</a> </li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.DependencyInjection.Security.UserProvider.html">UserProvider</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Security.html">Security</a> </li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Templating.html">Templating<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Templating.Helper.html">Helper</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.DependencyInjection.Security.html">Security<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.DependencyInjection.Security.Factory.html">Factory</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.Functional.html">Functional<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.Functional.app.html">app</a> </li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.Functional.Bundle.html">Bundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.Functional.Bundle.CsrfFormLoginBundle.html">CsrfFormLoginBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.Functional.Bundle.CsrfFormLoginBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.Functional.Bundle.CsrfFormLoginBundle.Form.html">Form</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.Functional.Bundle.FormLoginBundle.html">FormLoginBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.Functional.Bundle.FormLoginBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.Functional.Bundle.FormLoginBundle.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Tests.Functional.Bundle.FormLoginBundle.Security.html">Security</a> </li> </ul></li></ul></li></ul></li></ul></li> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Twig.html">Twig<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SecurityBundle.Twig.Extension.html">Extension</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Bundle.SwiftmailerBundle.html">SwiftmailerBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SwiftmailerBundle.Command.html">Command</a> </li> <li><a href="namespace-Symfony.Bundle.SwiftmailerBundle.DataCollector.html">DataCollector</a> </li> <li><a href="namespace-Symfony.Bundle.SwiftmailerBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SwiftmailerBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.SwiftmailerBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Bundle.SwiftmailerBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.SwiftmailerBundle.Tests.DependencyInjection.html">DependencyInjection</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Bundle.TwigBundle.html">TwigBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.TwigBundle.CacheWarmer.html">CacheWarmer</a> </li> <li><a href="namespace-Symfony.Bundle.TwigBundle.Command.html">Command</a> </li> <li><a href="namespace-Symfony.Bundle.TwigBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Bundle.TwigBundle.Debug.html">Debug</a> </li> <li><a href="namespace-Symfony.Bundle.TwigBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.TwigBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.TwigBundle.Extension.html">Extension</a> </li> <li><a href="namespace-Symfony.Bundle.TwigBundle.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Bundle.TwigBundle.Node.html">Node</a> </li> <li><a href="namespace-Symfony.Bundle.TwigBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.TwigBundle.Tests.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Bundle.TwigBundle.Tests.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.TwigBundle.Tests.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.TwigBundle.Tests.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Bundle.TwigBundle.Tests.TokenParser.html">TokenParser</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.TwigBundle.TokenParser.html">TokenParser</a> </li> </ul></li> <li><a href="namespace-Symfony.Bundle.WebProfilerBundle.html">WebProfilerBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.WebProfilerBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Bundle.WebProfilerBundle.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Symfony.Bundle.WebProfilerBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Bundle.WebProfilerBundle.Profiler.html">Profiler</a> </li> <li><a href="namespace-Symfony.Bundle.WebProfilerBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Bundle.WebProfilerBundle.Tests.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Bundle.WebProfilerBundle.Tests.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Symfony.Bundle.WebProfilerBundle.Tests.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Bundle.WebProfilerBundle.Tests.Profiler.html">Profiler</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Symfony.Component.html">Component<span></span></a> <ul> <li><a href="namespace-Symfony.Component.BrowserKit.html">BrowserKit<span></span></a> <ul> <li><a href="namespace-Symfony.Component.BrowserKit.Tests.html">Tests</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.ClassLoader.html">ClassLoader<span></span></a> <ul> <li><a href="namespace-Symfony.Component.ClassLoader.Tests.html">Tests</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Config.html">Config<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Config.Definition.html">Definition<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Config.Definition.Builder.html">Builder</a> </li> <li><a href="namespace-Symfony.Component.Config.Definition.Dumper.html">Dumper</a> </li> <li><a href="namespace-Symfony.Component.Config.Definition.Exception.html">Exception</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Config.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Config.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Component.Config.Resource.html">Resource</a> </li> <li><a href="namespace-Symfony.Component.Config.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Config.Tests.Definition.html">Definition<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Config.Tests.Definition.Builder.html">Builder</a> </li> <li><a href="namespace-Symfony.Component.Config.Tests.Definition.Dumper.html">Dumper</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Config.Tests.Fixtures.html">Fixtures<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Config.Tests.Fixtures.Configuration.html">Configuration</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Config.Tests.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Component.Config.Tests.Resource.html">Resource</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Config.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Console.html">Console<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Console.Command.html">Command</a> </li> <li><a href="namespace-Symfony.Component.Console.Descriptor.html">Descriptor</a> </li> <li><a href="namespace-Symfony.Component.Console.Event.html">Event</a> </li> <li><a href="namespace-Symfony.Component.Console.Formatter.html">Formatter</a> </li> <li><a href="namespace-Symfony.Component.Console.Helper.html">Helper</a> </li> <li><a href="namespace-Symfony.Component.Console.Input.html">Input</a> </li> <li><a href="namespace-Symfony.Component.Console.Output.html">Output</a> </li> <li><a href="namespace-Symfony.Component.Console.Tester.html">Tester</a> </li> <li><a href="namespace-Symfony.Component.Console.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Console.Tests.Command.html">Command</a> </li> <li><a href="namespace-Symfony.Component.Console.Tests.Descriptor.html">Descriptor</a> </li> <li><a href="namespace-Symfony.Component.Console.Tests.Fixtures.html">Fixtures</a> </li> <li><a href="namespace-Symfony.Component.Console.Tests.Formatter.html">Formatter</a> </li> <li><a href="namespace-Symfony.Component.Console.Tests.Helper.html">Helper</a> </li> <li><a href="namespace-Symfony.Component.Console.Tests.Input.html">Input</a> </li> <li><a href="namespace-Symfony.Component.Console.Tests.Output.html">Output</a> </li> <li><a href="namespace-Symfony.Component.Console.Tests.Tester.html">Tester</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.CssSelector.html">CssSelector<span></span></a> <ul> <li><a href="namespace-Symfony.Component.CssSelector.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.CssSelector.Node.html">Node</a> </li> <li><a href="namespace-Symfony.Component.CssSelector.Parser.html">Parser<span></span></a> <ul> <li><a href="namespace-Symfony.Component.CssSelector.Parser.Handler.html">Handler</a> </li> <li><a href="namespace-Symfony.Component.CssSelector.Parser.Shortcut.html">Shortcut</a> </li> <li><a href="namespace-Symfony.Component.CssSelector.Parser.Tokenizer.html">Tokenizer</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.CssSelector.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.CssSelector.Tests.Node.html">Node</a> </li> <li><a href="namespace-Symfony.Component.CssSelector.Tests.Parser.html">Parser<span></span></a> <ul> <li><a href="namespace-Symfony.Component.CssSelector.Tests.Parser.Handler.html">Handler</a> </li> <li><a href="namespace-Symfony.Component.CssSelector.Tests.Parser.Shortcut.html">Shortcut</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.CssSelector.Tests.XPath.html">XPath</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.CssSelector.XPath.html">XPath<span></span></a> <ul> <li><a href="namespace-Symfony.Component.CssSelector.XPath.Extension.html">Extension</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.Debug.html">Debug<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Debug.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Debug.FatalErrorHandler.html">FatalErrorHandler</a> </li> <li><a href="namespace-Symfony.Component.Debug.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Debug.Tests.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Debug.Tests.FatalErrorHandler.html">FatalErrorHandler</a> </li> <li><a href="namespace-Symfony.Component.Debug.Tests.Fixtures.html">Fixtures</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Symfony.Component.DependencyInjection.Compiler.html">Compiler</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.Dump.html">Dump</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.Dumper.html">Dumper</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.Extension.html">Extension</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.LazyProxy.html">LazyProxy<span></span></a> <ul> <li><a href="namespace-Symfony.Component.DependencyInjection.LazyProxy.Instantiator.html">Instantiator</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.LazyProxy.PhpDumper.html">PhpDumper</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.DependencyInjection.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.ParameterBag.html">ParameterBag</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.DependencyInjection.Tests.Compiler.html">Compiler</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.Tests.Dumper.html">Dumper</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.Tests.Extension.html">Extension</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.Tests.LazyProxy.html">LazyProxy<span></span></a> <ul> <li><a href="namespace-Symfony.Component.DependencyInjection.Tests.LazyProxy.Instantiator.html">Instantiator</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.Tests.LazyProxy.PhpDumper.html">PhpDumper</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.DependencyInjection.Tests.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Component.DependencyInjection.Tests.ParameterBag.html">ParameterBag</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.DomCrawler.html">DomCrawler<span></span></a> <ul> <li><a href="namespace-Symfony.Component.DomCrawler.Field.html">Field</a> </li> <li><a href="namespace-Symfony.Component.DomCrawler.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.DomCrawler.Tests.Field.html">Field</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.EventDispatcher.html">EventDispatcher<span></span></a> <ul> <li><a href="namespace-Symfony.Component.EventDispatcher.Debug.html">Debug</a> </li> <li><a href="namespace-Symfony.Component.EventDispatcher.Tests.html">Tests</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.ExpressionLanguage.html">ExpressionLanguage<span></span></a> <ul> <li><a href="namespace-Symfony.Component.ExpressionLanguage.Node.html">Node</a> </li> <li><a href="namespace-Symfony.Component.ExpressionLanguage.ParserCache.html">ParserCache</a> </li> <li><a href="namespace-Symfony.Component.ExpressionLanguage.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.ExpressionLanguage.Tests.Node.html">Node</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.Filesystem.html">Filesystem<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Filesystem.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Filesystem.Tests.html">Tests</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Finder.html">Finder<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Finder.Adapter.html">Adapter</a> </li> <li><a href="namespace-Symfony.Component.Finder.Comparator.html">Comparator</a> </li> <li><a href="namespace-Symfony.Component.Finder.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Finder.Expression.html">Expression</a> </li> <li><a href="namespace-Symfony.Component.Finder.Iterator.html">Iterator</a> </li> <li><a href="namespace-Symfony.Component.Finder.Shell.html">Shell</a> </li> <li><a href="namespace-Symfony.Component.Finder.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Finder.Tests.Comparator.html">Comparator</a> </li> <li><a href="namespace-Symfony.Component.Finder.Tests.Expression.html">Expression</a> </li> <li><a href="namespace-Symfony.Component.Finder.Tests.FakeAdapter.html">FakeAdapter</a> </li> <li><a href="namespace-Symfony.Component.Finder.Tests.Iterator.html">Iterator</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.Form.html">Form<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.html">Extension<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Extension.Core.html">Core<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Extension.Core.ChoiceList.html">ChoiceList</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.Core.DataMapper.html">DataMapper</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.Core.DataTransformer.html">DataTransformer</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.Core.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.Core.Type.html">Type</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.Core.View.html">View</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Form.Extension.Csrf.html">Csrf<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Extension.Csrf.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.Csrf.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Form.Extension.DataCollector.html">DataCollector<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Extension.DataCollector.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.DataCollector.Proxy.html">Proxy</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.DataCollector.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Form.Extension.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.HttpFoundation.html">HttpFoundation<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Extension.HttpFoundation.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Form.Extension.Templating.html">Templating</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.Validator.html">Validator<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Extension.Validator.Constraints.html">Constraints</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.Validator.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.Validator.Type.html">Type</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.Validator.Util.html">Util</a> </li> <li><a href="namespace-Symfony.Component.Form.Extension.Validator.ViolationMapper.html">ViolationMapper</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.Form.Guess.html">Guess</a> </li> <li><a href="namespace-Symfony.Component.Form.Test.html">Test</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.html">Extension<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Core.html">Core<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Core.ChoiceList.html">ChoiceList</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Core.DataMapper.html">DataMapper</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Core.DataTransformer.html">DataTransformer</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Core.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Core.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Csrf.html">Csrf<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Csrf.CsrfProvider.html">CsrfProvider</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Csrf.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Csrf.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.DataCollector.html">DataCollector<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.DataCollector.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.HttpFoundation.html">HttpFoundation<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.HttpFoundation.EventListener.html">EventListener</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Validator.html">Validator<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Validator.Constraints.html">Constraints</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Validator.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Validator.Type.html">Type</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Validator.Util.html">Util</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Extension.Validator.ViolationMapper.html">ViolationMapper</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.Form.Tests.Fixtures.html">Fixtures</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Guess.html">Guess</a> </li> <li><a href="namespace-Symfony.Component.Form.Tests.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Form.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.HttpFoundation.html">HttpFoundation<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpFoundation.File.html">File<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpFoundation.File.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.HttpFoundation.File.MimeType.html">MimeType</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.HttpFoundation.Session.html">Session<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpFoundation.Session.Attribute.html">Attribute</a> </li> <li><a href="namespace-Symfony.Component.HttpFoundation.Session.Flash.html">Flash</a> </li> <li><a href="namespace-Symfony.Component.HttpFoundation.Session.Storage.html">Storage<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpFoundation.Session.Storage.Handler.html">Handler</a> </li> <li><a href="namespace-Symfony.Component.HttpFoundation.Session.Storage.Proxy.html">Proxy</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.HttpFoundation.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpFoundation.Tests.File.html">File<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpFoundation.Tests.File.MimeType.html">MimeType</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.HttpFoundation.Tests.Session.html">Session<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpFoundation.Tests.Session.Attribute.html">Attribute</a> </li> <li><a href="namespace-Symfony.Component.HttpFoundation.Tests.Session.Flash.html">Flash</a> </li> <li><a href="namespace-Symfony.Component.HttpFoundation.Tests.Session.Storage.html">Storage<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpFoundation.Tests.Session.Storage.Handler.html">Handler</a> </li> <li><a href="namespace-Symfony.Component.HttpFoundation.Tests.Session.Storage.Proxy.html">Proxy</a> </li> </ul></li></ul></li></ul></li></ul></li> <li><a href="namespace-Symfony.Component.HttpKernel.html">HttpKernel<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpKernel.Bundle.html">Bundle</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.CacheClearer.html">CacheClearer</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.CacheWarmer.html">CacheWarmer</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Config.html">Config</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.DataCollector.html">DataCollector<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpKernel.DataCollector.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.HttpKernel.Debug.html">Debug</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Event.html">Event</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Fragment.html">Fragment</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.HttpCache.html">HttpCache</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Log.html">Log</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Profiler.html">Profiler</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Bundle.html">Bundle</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.CacheClearer.html">CacheClearer</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.CacheWarmer.html">CacheWarmer</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Config.html">Config</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Controller.html">Controller</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.DataCollector.html">DataCollector</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Debug.html">Debug</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.EventListener.html">EventListener</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Fixtures.html">Fixtures<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Fixtures.ExtensionAbsentBundle.html">ExtensionAbsentBundle</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Fixtures.ExtensionLoadedBundle.html">ExtensionLoadedBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Fixtures.ExtensionLoadedBundle.DependencyInjection.html">DependencyInjection</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Fixtures.ExtensionPresentBundle.html">ExtensionPresentBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Fixtures.ExtensionPresentBundle.Command.html">Command</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Fixtures.ExtensionPresentBundle.DependencyInjection.html">DependencyInjection</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Fragment.html">Fragment</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.HttpCache.html">HttpCache</a> </li> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Profiler.html">Profiler<span></span></a> <ul> <li><a href="namespace-Symfony.Component.HttpKernel.Tests.Profiler.Mock.html">Mock</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Symfony.Component.Icu.html">Icu<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Icu.Tests.html">Tests</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Intl.html">Intl<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Intl.Collator.html">Collator</a> </li> <li><a href="namespace-Symfony.Component.Intl.DateFormatter.html">DateFormatter<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Intl.DateFormatter.DateFormat.html">DateFormat</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Intl.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Intl.Globals.html">Globals</a> </li> <li><a href="namespace-Symfony.Component.Intl.Locale.html">Locale</a> </li> <li><a href="namespace-Symfony.Component.Intl.NumberFormatter.html">NumberFormatter</a> </li> <li><a href="namespace-Symfony.Component.Intl.ResourceBundle.html">ResourceBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Intl.ResourceBundle.Compiler.html">Compiler</a> </li> <li><a href="namespace-Symfony.Component.Intl.ResourceBundle.Reader.html">Reader</a> </li> <li><a href="namespace-Symfony.Component.Intl.ResourceBundle.Transformer.html">Transformer<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Intl.ResourceBundle.Transformer.Rule.html">Rule</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Intl.ResourceBundle.Util.html">Util</a> </li> <li><a href="namespace-Symfony.Component.Intl.ResourceBundle.Writer.html">Writer</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Intl.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Intl.Tests.Collator.html">Collator<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Intl.Tests.Collator.Verification.html">Verification</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Intl.Tests.DateFormatter.html">DateFormatter<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Intl.Tests.DateFormatter.Verification.html">Verification</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Intl.Tests.Globals.html">Globals<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Intl.Tests.Globals.Verification.html">Verification</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Intl.Tests.Locale.html">Locale<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Intl.Tests.Locale.Verification.html">Verification</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Intl.Tests.NumberFormatter.html">NumberFormatter<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Intl.Tests.NumberFormatter.Verification.html">Verification</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Intl.Tests.ResourceBundle.html">ResourceBundle<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Intl.Tests.ResourceBundle.Reader.html">Reader</a> </li> <li><a href="namespace-Symfony.Component.Intl.Tests.ResourceBundle.Util.html">Util</a> </li> <li><a href="namespace-Symfony.Component.Intl.Tests.ResourceBundle.Writer.html">Writer</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Intl.Tests.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Intl.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Locale.html">Locale<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Locale.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Locale.Tests.Stub.html">Stub</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.OptionsResolver.html">OptionsResolver<span></span></a> <ul> <li><a href="namespace-Symfony.Component.OptionsResolver.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.OptionsResolver.Tests.html">Tests</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Process.html">Process<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Process.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Process.Tests.html">Tests</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.PropertyAccess.html">PropertyAccess<span></span></a> <ul> <li><a href="namespace-Symfony.Component.PropertyAccess.Exception.html">Exception</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Routing.html">Routing<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Routing.Annotation.html">Annotation</a> </li> <li><a href="namespace-Symfony.Component.Routing.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Routing.Generator.html">Generator<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Routing.Generator.Dumper.html">Dumper</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Routing.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Component.Routing.Matcher.html">Matcher<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Routing.Matcher.Dumper.html">Dumper</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Routing.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Routing.Tests.Annotation.html">Annotation</a> </li> <li><a href="namespace-Symfony.Component.Routing.Tests.Fixtures.html">Fixtures<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Routing.Tests.Fixtures.AnnotatedClasses.html">AnnotatedClasses</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Routing.Tests.Generator.html">Generator<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Routing.Tests.Generator.Dumper.html">Dumper</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Routing.Tests.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Component.Routing.Tests.Matcher.html">Matcher<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Routing.Tests.Matcher.Dumper.html">Dumper</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Symfony.Component.Security.html">Security<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Acl.html">Acl<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Acl.Dbal.html">Dbal</a> </li> <li><a href="namespace-Symfony.Component.Security.Acl.Domain.html">Domain</a> </li> <li><a href="namespace-Symfony.Component.Security.Acl.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Security.Acl.Model.html">Model</a> </li> <li><a href="namespace-Symfony.Component.Security.Acl.Permission.html">Permission</a> </li> <li><a href="namespace-Symfony.Component.Security.Acl.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Acl.Tests.Dbal.html">Dbal</a> </li> <li><a href="namespace-Symfony.Component.Security.Acl.Tests.Domain.html">Domain</a> </li> <li><a href="namespace-Symfony.Component.Security.Acl.Tests.Permission.html">Permission</a> </li> <li><a href="namespace-Symfony.Component.Security.Acl.Tests.Voter.html">Voter</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Security.Acl.Voter.html">Voter</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Security.Core.html">Core<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Core.Authentication.html">Authentication<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Core.Authentication.Provider.html">Provider</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Authentication.RememberMe.html">RememberMe</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Authentication.Token.html">Token</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Security.Core.Authorization.html">Authorization<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Core.Authorization.Voter.html">Voter</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Security.Core.Encoder.html">Encoder</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Event.html">Event</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Role.html">Role</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Core.Tests.Authentication.html">Authentication<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Core.Tests.Authentication.Provider.html">Provider</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Tests.Authentication.RememberMe.html">RememberMe</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Tests.Authentication.Token.html">Token</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Security.Core.Tests.Authorization.html">Authorization<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Core.Tests.Authorization.Voter.html">Voter</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Security.Core.Tests.Encoder.html">Encoder</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Tests.Role.html">Role</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Tests.User.html">User</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Tests.Util.html">Util</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Tests.Validator.html">Validator<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Core.Tests.Validator.Constraints.html">Constraints</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.Security.Core.User.html">User</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Util.html">Util</a> </li> <li><a href="namespace-Symfony.Component.Security.Core.Validator.html">Validator<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Core.Validator.Constraints.html">Constraints</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.Security.Csrf.html">Csrf<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Csrf.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Security.Csrf.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Csrf.Tests.TokenGenerator.html">TokenGenerator</a> </li> <li><a href="namespace-Symfony.Component.Security.Csrf.Tests.TokenStorage.html">TokenStorage</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Security.Csrf.TokenGenerator.html">TokenGenerator</a> </li> <li><a href="namespace-Symfony.Component.Security.Csrf.TokenStorage.html">TokenStorage</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Security.Http.html">Http<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Http.Authentication.html">Authentication</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.Authorization.html">Authorization</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.EntryPoint.html">EntryPoint</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.Event.html">Event</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.Firewall.html">Firewall</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.Logout.html">Logout</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.RememberMe.html">RememberMe</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.Session.html">Session</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Http.Tests.Authentication.html">Authentication</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.Tests.EntryPoint.html">EntryPoint</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.Tests.Firewall.html">Firewall</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.Tests.Logout.html">Logout</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.Tests.RememberMe.html">RememberMe</a> </li> <li><a href="namespace-Symfony.Component.Security.Http.Tests.Session.html">Session</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.Security.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Tests.Core.html">Core<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Tests.Core.Authentication.html">Authentication<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Tests.Core.Authentication.Token.html">Token</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Security.Tests.Core.User.html">User</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Security.Tests.Http.html">Http<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Security.Tests.Http.Firewall.html">Firewall</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Symfony.Component.Serializer.html">Serializer<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Serializer.Encoder.html">Encoder</a> </li> <li><a href="namespace-Symfony.Component.Serializer.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Serializer.Normalizer.html">Normalizer</a> </li> <li><a href="namespace-Symfony.Component.Serializer.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Serializer.Tests.Encoder.html">Encoder</a> </li> <li><a href="namespace-Symfony.Component.Serializer.Tests.Fixtures.html">Fixtures</a> </li> <li><a href="namespace-Symfony.Component.Serializer.Tests.Normalizer.html">Normalizer</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.Stopwatch.html">Stopwatch</a> </li> <li><a href="namespace-Symfony.Component.Templating.html">Templating<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Templating.Asset.html">Asset</a> </li> <li><a href="namespace-Symfony.Component.Templating.Helper.html">Helper</a> </li> <li><a href="namespace-Symfony.Component.Templating.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Component.Templating.Storage.html">Storage</a> </li> <li><a href="namespace-Symfony.Component.Templating.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Templating.Tests.Fixtures.html">Fixtures</a> </li> <li><a href="namespace-Symfony.Component.Templating.Tests.Helper.html">Helper</a> </li> <li><a href="namespace-Symfony.Component.Templating.Tests.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Component.Templating.Tests.Storage.html">Storage</a> </li> </ul></li></ul></li> <li><a href="namespace-Symfony.Component.Translation.html">Translation<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Translation.Catalogue.html">Catalogue</a> </li> <li><a href="namespace-Symfony.Component.Translation.Dumper.html">Dumper</a> </li> <li><a href="namespace-Symfony.Component.Translation.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Translation.Extractor.html">Extractor</a> </li> <li><a href="namespace-Symfony.Component.Translation.Loader.html">Loader</a> </li> <li><a href="namespace-Symfony.Component.Translation.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Translation.Tests.Catalogue.html">Catalogue</a> </li> <li><a href="namespace-Symfony.Component.Translation.Tests.Dumper.html">Dumper</a> </li> <li><a href="namespace-Symfony.Component.Translation.Tests.Loader.html">Loader</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Translation.Writer.html">Writer</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Validator.html">Validator<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Validator.Constraints.html">Constraints</a> </li> <li><a href="namespace-Symfony.Component.Validator.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Validator.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Validator.Mapping.Cache.html">Cache</a> </li> <li><a href="namespace-Symfony.Component.Validator.Mapping.Loader.html">Loader</a> </li> </ul></li> <li><a href="namespace-Symfony.Component.Validator.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Validator.Tests.Constraints.html">Constraints</a> </li> <li><a href="namespace-Symfony.Component.Validator.Tests.Fixtures.html">Fixtures</a> </li> <li><a href="namespace-Symfony.Component.Validator.Tests.Mapping.html">Mapping<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Validator.Tests.Mapping.Cache.html">Cache</a> </li> <li><a href="namespace-Symfony.Component.Validator.Tests.Mapping.Loader.html">Loader</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Symfony.Component.Yaml.html">Yaml<span></span></a> <ul> <li><a href="namespace-Symfony.Component.Yaml.Exception.html">Exception</a> </li> <li><a href="namespace-Symfony.Component.Yaml.Tests.html">Tests</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Tecnocreaciones.html">Tecnocreaciones<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Bundle.html">Bundle<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Bundle.AjaxFOSUserBundle.html">AjaxFOSUserBundle<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Bundle.AjaxFOSUserBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Tecnocreaciones.Bundle.AjaxFOSUserBundle.DependencyInjection.html">DependencyInjection<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Bundle.AjaxFOSUserBundle.DependencyInjection.Compiler.html">Compiler</a> </li> </ul></li> <li><a href="namespace-Tecnocreaciones.Bundle.AjaxFOSUserBundle.Event.html">Event</a> </li> <li><a href="namespace-Tecnocreaciones.Bundle.AjaxFOSUserBundle.EventListener.html">EventListener</a> </li> <li><a href="namespace-Tecnocreaciones.Bundle.AjaxFOSUserBundle.Handler.html">Handler</a> </li> <li><a href="namespace-Tecnocreaciones.Bundle.AjaxFOSUserBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Bundle.AjaxFOSUserBundle.Tests.Controller.html">Controller</a> </li> </ul></li></ul></li> <li><a href="namespace-Tecnocreaciones.Bundle.InstallBundle.html">InstallBundle<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Bundle.InstallBundle.Command.html">Command</a> </li> <li><a href="namespace-Tecnocreaciones.Bundle.InstallBundle.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Tecnocreaciones.Bundle.InstallBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Bundle.InstallBundle.Tests.Controller.html">Controller</a> </li> </ul></li></ul></li> <li><a href="namespace-Tecnocreaciones.Bundle.TemplateBundle.html">TemplateBundle<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Bundle.TemplateBundle.Controller.html">Controller</a> </li> <li><a href="namespace-Tecnocreaciones.Bundle.TemplateBundle.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Tecnocreaciones.Bundle.TemplateBundle.Menu.html">Menu<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Bundle.TemplateBundle.Menu.Template.html">Template<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Bundle.TemplateBundle.Menu.Template.Developer.html">Developer</a> </li> </ul></li></ul></li> <li><a href="namespace-Tecnocreaciones.Bundle.TemplateBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Bundle.TemplateBundle.Tests.Controller.html">Controller</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-Tecnocreaciones.Vzla.html">Vzla<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.html">GovernmentBundle<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.DependencyInjection.html">DependencyInjection</a> </li> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.Form.html">Form<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.Form.Type.html">Type</a> </li> </ul></li> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.Menu.html">Menu<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.Menu.Template.html">Template<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.Menu.Template.Developer.html">Developer</a> </li> </ul></li></ul></li> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.Model.html">Model</a> </li> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.Tests.html">Tests<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.Tests.Controller.html">Controller</a> </li> </ul></li> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.Twig.html">Twig<span></span></a> <ul> <li><a href="namespace-Tecnocreaciones.Vzla.GovernmentBundle.Twig.Extension.html">Extension</a> </li> </ul></li></ul></li></ul></li></ul></li> <li><a href="namespace-TestBundle.html">TestBundle<span></span></a> <ul> <li><a href="namespace-TestBundle.Fabpot.html">Fabpot<span></span></a> <ul> <li><a href="namespace-TestBundle.Fabpot.FooBundle.html">FooBundle<span></span></a> <ul> <li><a href="namespace-TestBundle.Fabpot.FooBundle.Controller.html">Controller</a> </li> </ul></li></ul></li> <li><a href="namespace-TestBundle.FooBundle.html">FooBundle<span></span></a> <ul> <li><a href="namespace-TestBundle.FooBundle.Controller.html">Controller<span></span></a> <ul> <li><a href="namespace-TestBundle.FooBundle.Controller.Sub.html">Sub</a> </li> <li><a href="namespace-TestBundle.FooBundle.Controller.Test.html">Test</a> </li> </ul></li></ul></li> <li><a href="namespace-TestBundle.Sensio.html">Sensio<span></span></a> <ul> <li><a href="namespace-TestBundle.Sensio.Cms.html">Cms<span></span></a> <ul> <li><a href="namespace-TestBundle.Sensio.Cms.FooBundle.html">FooBundle<span></span></a> <ul> <li><a href="namespace-TestBundle.Sensio.Cms.FooBundle.Controller.html">Controller</a> </li> </ul></li></ul></li> <li><a href="namespace-TestBundle.Sensio.FooBundle.html">FooBundle<span></span></a> <ul> <li><a href="namespace-TestBundle.Sensio.FooBundle.Controller.html">Controller</a> </li> </ul></li></ul></li></ul></li> <li><a href="namespace-TestFixtures.html">TestFixtures</a> </li> <li><a href="namespace-Timestampable.html">Timestampable<span></span></a> <ul> <li><a href="namespace-Timestampable.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Timestampable.Fixture.Document.html">Document</a> </li> </ul></li></ul></li> <li><a href="namespace-Tool.html">Tool</a> </li> <li><a href="namespace-Translatable.html">Translatable<span></span></a> <ul> <li><a href="namespace-Translatable.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Translatable.Fixture.Document.html">Document<span></span></a> <ul> <li><a href="namespace-Translatable.Fixture.Document.Personal.html">Personal</a> </li> </ul></li> <li><a href="namespace-Translatable.Fixture.Issue114.html">Issue114</a> </li> <li><a href="namespace-Translatable.Fixture.Issue138.html">Issue138</a> </li> <li><a href="namespace-Translatable.Fixture.Issue165.html">Issue165</a> </li> <li><a href="namespace-Translatable.Fixture.Issue173.html">Issue173</a> </li> <li><a href="namespace-Translatable.Fixture.Issue75.html">Issue75</a> </li> <li><a href="namespace-Translatable.Fixture.Issue922.html">Issue922</a> </li> <li><a href="namespace-Translatable.Fixture.Personal.html">Personal</a> </li> <li><a href="namespace-Translatable.Fixture.Template.html">Template</a> </li> <li><a href="namespace-Translatable.Fixture.Type.html">Type</a> </li> </ul></li></ul></li> <li><a href="namespace-Translator.html">Translator<span></span></a> <ul> <li><a href="namespace-Translator.Fixture.html">Fixture</a> </li> </ul></li> <li><a href="namespace-Tree.html">Tree<span></span></a> <ul> <li><a href="namespace-Tree.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Tree.Fixture.Closure.html">Closure</a> </li> <li><a href="namespace-Tree.Fixture.Document.html">Document</a> </li> <li><a href="namespace-Tree.Fixture.Genealogy.html">Genealogy</a> </li> <li><a href="namespace-Tree.Fixture.Mock.html">Mock</a> </li> <li><a href="namespace-Tree.Fixture.Repository.html">Repository</a> </li> <li><a href="namespace-Tree.Fixture.Transport.html">Transport</a> </li> </ul></li></ul></li> <li><a href="namespace-Uploadable.html">Uploadable<span></span></a> <ul> <li><a href="namespace-Uploadable.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Uploadable.Fixture.Entity.html">Entity</a> </li> </ul></li></ul></li> <li><a href="namespace-Wrapper.html">Wrapper<span></span></a> <ul> <li><a href="namespace-Wrapper.Fixture.html">Fixture<span></span></a> <ul> <li><a href="namespace-Wrapper.Fixture.Document.html">Document</a> </li> <li><a href="namespace-Wrapper.Fixture.Entity.html">Entity</a> </li> </ul></li></ul></li> </ul> </div> <hr /> <div id="elements"> <h3>Classes</h3> <ul> <li class="active"><a href="class-FOS.UserBundle.Tests.Util.UserManipulatorTest.html">UserManipulatorTest</a></li> </ul> </div> </div> </div> <div id="splitter"></div> <div id="right"> <div id="rightInner"> <form id="search"> <input type="hidden" name="cx" value="" /> <input type="hidden" name="ie" value="UTF-8" /> <input type="text" name="q" class="text" /> <input type="submit" value="Search" /> </form> <div id="navigation"> <ul> <li> <a href="index.html" title="Overview"><span>Overview</span></a> </li> <li> <a href="namespace-FOS.UserBundle.Tests.Util.html" title="Summary of FOS\UserBundle\Tests\Util"><span>Namespace</span></a> </li> <li> <a href="class-FOS.UserBundle.Tests.Util.UserManipulatorTest.html" title="Summary of FOS\UserBundle\Tests\Util\UserManipulatorTest"><span>Class</span></a> </li> </ul> <ul> <li> <a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a> </li> </ul> <ul> </ul> </div> <pre><code><span id="1" class="l"><a class="l" href="#1"> 1: </a><span class="xlang">&lt;?php</span> </span><span id="2" class="l"><a class="l" href="#2"> 2: </a> </span><span id="3" class="l"><a class="l" href="#3"> 3: </a><span class="php-comment">/* </span></span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-comment"> * This file is part of the FOSUserBundle package. </span></span><span id="5" class="l"><a class="l" href="#5"> 5: </a><span class="php-comment"> * </span></span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment"> * (c) FriendsOfSymfony &lt;http://friendsofsymfony.github.com/&gt; </span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * </span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * For the full copyright and license information, please view the LICENSE </span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * file that was distributed with this source code. </span></span><span id="10" class="l"><a class="l" href="#10"> 10: </a><span class="php-comment"> */</span> </span><span id="11" class="l"><a class="l" href="#11"> 11: </a> </span><span id="12" class="l"><a class="l" href="#12"> 12: </a><span class="php-keyword1">namespace</span> FOS\UserBundle\Tests\Util; </span><span id="13" class="l"><a class="l" href="#13"> 13: </a> </span><span id="14" class="l"><a class="l" href="#14"> 14: </a><span class="php-keyword1">use</span> FOS\UserBundle\Util\UserManipulator; </span><span id="15" class="l"><a class="l" href="#15"> 15: </a><span class="php-keyword1">use</span> FOS\UserBundle\Tests\TestUser; </span><span id="16" class="l"><a class="l" href="#16"> 16: </a> </span><span id="17" class="l"><a class="l" href="#17"> 17: </a><span class="php-keyword1">class</span> <a id="UserManipulatorTest" href="#UserManipulatorTest">UserManipulatorTest</a> <span class="php-keyword1">extends</span> \PHPUnit_Framework_TestCase </span><span id="18" class="l"><a class="l" href="#18"> 18: </a>{ </span><span id="19" class="l"><a class="l" href="#19"> 19: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_testCreate" href="#_testCreate">testCreate</a>() </span><span id="20" class="l"><a class="l" href="#20"> 20: </a> { </span><span id="21" class="l"><a class="l" href="#21"> 21: </a> <span class="php-var">$userManagerMock</span> = <span class="php-var">$this</span>-&gt;getMock(<span class="php-quote">'FOS\UserBundle\Model\UserManagerInterface'</span>); </span><span id="22" class="l"><a class="l" href="#22"> 22: </a> <span class="php-var">$user</span> = <span class="php-keyword1">new</span> TestUser(); </span><span id="23" class="l"><a class="l" href="#23"> 23: </a> </span><span id="24" class="l"><a class="l" href="#24"> 24: </a> <span class="php-var">$username</span> = <span class="php-quote">'test_username'</span>; </span><span id="25" class="l"><a class="l" href="#25"> 25: </a> <span class="php-var">$password</span> = <span class="php-quote">'test_password'</span>; </span><span id="26" class="l"><a class="l" href="#26"> 26: </a> <span class="php-var">$email</span> = <span class="php-quote">'test@email.org'</span>; </span><span id="27" class="l"><a class="l" href="#27"> 27: </a> <span class="php-var">$active</span> = <span class="php-keyword1">true</span>; <span class="php-comment">// it is enabled</span> </span><span id="28" class="l"><a class="l" href="#28"> 28: </a> <span class="php-var">$superadmin</span> = <span class="php-keyword1">false</span>; </span><span id="29" class="l"><a class="l" href="#29"> 29: </a> </span><span id="30" class="l"><a class="l" href="#30"> 30: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="31" class="l"><a class="l" href="#31"> 31: </a> -&gt;method(<span class="php-quote">'createUser'</span>) </span><span id="32" class="l"><a class="l" href="#32"> 32: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)); </span><span id="33" class="l"><a class="l" href="#33"> 33: </a> </span><span id="34" class="l"><a class="l" href="#34"> 34: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="35" class="l"><a class="l" href="#35"> 35: </a> -&gt;method(<span class="php-quote">'updateUser'</span>) </span><span id="36" class="l"><a class="l" href="#36"> 36: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)) </span><span id="37" class="l"><a class="l" href="#37"> 37: </a> -&gt;with(<span class="php-var">$this</span>-&gt;isInstanceOf(<span class="php-quote">'FOS\UserBundle\Tests\TestUser'</span>)); </span><span id="38" class="l"><a class="l" href="#38"> 38: </a> </span><span id="39" class="l"><a class="l" href="#39"> 39: </a> <span class="php-var">$manipulator</span> = <span class="php-keyword1">new</span> UserManipulator(<span class="php-var">$userManagerMock</span>); </span><span id="40" class="l"><a class="l" href="#40"> 40: </a> <span class="php-var">$manipulator</span>-&gt;create(<span class="php-var">$username</span>, <span class="php-var">$password</span>, <span class="php-var">$email</span>, <span class="php-var">$active</span>, <span class="php-var">$superadmin</span>); </span><span id="41" class="l"><a class="l" href="#41"> 41: </a> </span><span id="42" class="l"><a class="l" href="#42"> 42: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-var">$username</span>, <span class="php-var">$user</span>-&gt;getUsername()); </span><span id="43" class="l"><a class="l" href="#43"> 43: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-var">$password</span>, <span class="php-var">$user</span>-&gt;getPlainPassword()); </span><span id="44" class="l"><a class="l" href="#44"> 44: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-var">$email</span>, <span class="php-var">$user</span>-&gt;getEmail()); </span><span id="45" class="l"><a class="l" href="#45"> 45: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-var">$active</span>, <span class="php-var">$user</span>-&gt;isEnabled()); </span><span id="46" class="l"><a class="l" href="#46"> 46: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-var">$superadmin</span>, <span class="php-var">$user</span>-&gt;isSuperAdmin()); </span><span id="47" class="l"><a class="l" href="#47"> 47: </a> } </span><span id="48" class="l"><a class="l" href="#48"> 48: </a> </span><span id="49" class="l"><a class="l" href="#49"> 49: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_testActivateWithValidUsername" href="#_testActivateWithValidUsername">testActivateWithValidUsername</a>() </span><span id="50" class="l"><a class="l" href="#50"> 50: </a> { </span><span id="51" class="l"><a class="l" href="#51"> 51: </a> <span class="php-var">$userManagerMock</span> = <span class="php-var">$this</span>-&gt;getMock(<span class="php-quote">'FOS\UserBundle\Model\UserManagerInterface'</span>); </span><span id="52" class="l"><a class="l" href="#52"> 52: </a> <span class="php-var">$username</span> = <span class="php-quote">'test_username'</span>; </span><span id="53" class="l"><a class="l" href="#53"> 53: </a> </span><span id="54" class="l"><a class="l" href="#54"> 54: </a> <span class="php-var">$user</span> = <span class="php-keyword1">new</span> TestUser(); </span><span id="55" class="l"><a class="l" href="#55"> 55: </a> <span class="php-var">$user</span>-&gt;setUsername(<span class="php-var">$username</span>); </span><span id="56" class="l"><a class="l" href="#56"> 56: </a> <span class="php-var">$user</span>-&gt;setEnabled(<span class="php-keyword1">false</span>); </span><span id="57" class="l"><a class="l" href="#57"> 57: </a> </span><span id="58" class="l"><a class="l" href="#58"> 58: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="59" class="l"><a class="l" href="#59"> 59: </a> -&gt;method(<span class="php-quote">'findUserByUsername'</span>) </span><span id="60" class="l"><a class="l" href="#60"> 60: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)) </span><span id="61" class="l"><a class="l" href="#61"> 61: </a> -&gt;with(<span class="php-var">$this</span>-&gt;equalTo(<span class="php-var">$username</span>)); </span><span id="62" class="l"><a class="l" href="#62"> 62: </a> </span><span id="63" class="l"><a class="l" href="#63"> 63: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="64" class="l"><a class="l" href="#64"> 64: </a> -&gt;method(<span class="php-quote">'updateUser'</span>) </span><span id="65" class="l"><a class="l" href="#65"> 65: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)) </span><span id="66" class="l"><a class="l" href="#66"> 66: </a> -&gt;with(<span class="php-var">$this</span>-&gt;isInstanceOf(<span class="php-quote">'FOS\UserBundle\Tests\TestUser'</span>)); </span><span id="67" class="l"><a class="l" href="#67"> 67: </a> </span><span id="68" class="l"><a class="l" href="#68"> 68: </a> <span class="php-var">$manipulator</span> = <span class="php-keyword1">new</span> UserManipulator(<span class="php-var">$userManagerMock</span>); </span><span id="69" class="l"><a class="l" href="#69"> 69: </a> <span class="php-var">$manipulator</span>-&gt;activate(<span class="php-var">$username</span>); </span><span id="70" class="l"><a class="l" href="#70"> 70: </a> </span><span id="71" class="l"><a class="l" href="#71"> 71: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-var">$username</span>, <span class="php-var">$user</span>-&gt;getUsername()); </span><span id="72" class="l"><a class="l" href="#72"> 72: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-keyword1">true</span>, <span class="php-var">$user</span>-&gt;isEnabled()); </span><span id="73" class="l"><a class="l" href="#73"> 73: </a> } </span><span id="74" class="l"><a class="l" href="#74"> 74: </a> </span><span id="75" class="l"><a class="l" href="#75"> 75: </a> <span class="php-comment">/** </span></span><span id="76" class="l"><a class="l" href="#76"> 76: </a><span class="php-comment"> * @expectedException \InvalidArgumentException </span></span><span id="77" class="l"><a class="l" href="#77"> 77: </a><span class="php-comment"> */</span> </span><span id="78" class="l"><a class="l" href="#78"> 78: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_testActivateWithInvalidUsername" href="#_testActivateWithInvalidUsername">testActivateWithInvalidUsername</a>() </span><span id="79" class="l"><a class="l" href="#79"> 79: </a> { </span><span id="80" class="l"><a class="l" href="#80"> 80: </a> <span class="php-var">$userManagerMock</span> = <span class="php-var">$this</span>-&gt;getMock(<span class="php-quote">'FOS\UserBundle\Model\UserManagerInterface'</span>); </span><span id="81" class="l"><a class="l" href="#81"> 81: </a> <span class="php-var">$invalidusername</span> = <span class="php-quote">'invalid_username'</span>; </span><span id="82" class="l"><a class="l" href="#82"> 82: </a> </span><span id="83" class="l"><a class="l" href="#83"> 83: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="84" class="l"><a class="l" href="#84"> 84: </a> -&gt;method(<span class="php-quote">'findUserByUsername'</span>) </span><span id="85" class="l"><a class="l" href="#85"> 85: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-keyword1">null</span>)) </span><span id="86" class="l"><a class="l" href="#86"> 86: </a> -&gt;with(<span class="php-var">$this</span>-&gt;equalTo(<span class="php-var">$invalidusername</span>)); </span><span id="87" class="l"><a class="l" href="#87"> 87: </a> </span><span id="88" class="l"><a class="l" href="#88"> 88: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;never()) </span><span id="89" class="l"><a class="l" href="#89"> 89: </a> -&gt;method(<span class="php-quote">'updateUser'</span>); </span><span id="90" class="l"><a class="l" href="#90"> 90: </a> </span><span id="91" class="l"><a class="l" href="#91"> 91: </a> <span class="php-var">$manipulator</span> = <span class="php-keyword1">new</span> UserManipulator(<span class="php-var">$userManagerMock</span>); </span><span id="92" class="l"><a class="l" href="#92"> 92: </a> <span class="php-var">$manipulator</span>-&gt;activate(<span class="php-var">$invalidusername</span>); </span><span id="93" class="l"><a class="l" href="#93"> 93: </a> } </span><span id="94" class="l"><a class="l" href="#94"> 94: </a> </span><span id="95" class="l"><a class="l" href="#95"> 95: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_testDeactivateWithValidUsername" href="#_testDeactivateWithValidUsername">testDeactivateWithValidUsername</a>() </span><span id="96" class="l"><a class="l" href="#96"> 96: </a> { </span><span id="97" class="l"><a class="l" href="#97"> 97: </a> <span class="php-var">$userManagerMock</span> = <span class="php-var">$this</span>-&gt;getMock(<span class="php-quote">'FOS\UserBundle\Model\UserManagerInterface'</span>); </span><span id="98" class="l"><a class="l" href="#98"> 98: </a> <span class="php-var">$username</span> = <span class="php-quote">'test_username'</span>; </span><span id="99" class="l"><a class="l" href="#99"> 99: </a> </span><span id="100" class="l"><a class="l" href="#100">100: </a> <span class="php-var">$user</span> = <span class="php-keyword1">new</span> TestUser(); </span><span id="101" class="l"><a class="l" href="#101">101: </a> <span class="php-var">$user</span>-&gt;setUsername(<span class="php-var">$username</span>); </span><span id="102" class="l"><a class="l" href="#102">102: </a> <span class="php-var">$user</span>-&gt;setEnabled(<span class="php-keyword1">true</span>); </span><span id="103" class="l"><a class="l" href="#103">103: </a> </span><span id="104" class="l"><a class="l" href="#104">104: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="105" class="l"><a class="l" href="#105">105: </a> -&gt;method(<span class="php-quote">'findUserByUsername'</span>) </span><span id="106" class="l"><a class="l" href="#106">106: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)) </span><span id="107" class="l"><a class="l" href="#107">107: </a> -&gt;with(<span class="php-var">$this</span>-&gt;equalTo(<span class="php-var">$username</span>)); </span><span id="108" class="l"><a class="l" href="#108">108: </a> </span><span id="109" class="l"><a class="l" href="#109">109: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="110" class="l"><a class="l" href="#110">110: </a> -&gt;method(<span class="php-quote">'updateUser'</span>) </span><span id="111" class="l"><a class="l" href="#111">111: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)) </span><span id="112" class="l"><a class="l" href="#112">112: </a> -&gt;with(<span class="php-var">$this</span>-&gt;isInstanceOf(<span class="php-quote">'FOS\UserBundle\Tests\TestUser'</span>)); </span><span id="113" class="l"><a class="l" href="#113">113: </a> </span><span id="114" class="l"><a class="l" href="#114">114: </a> <span class="php-var">$manipulator</span> = <span class="php-keyword1">new</span> UserManipulator(<span class="php-var">$userManagerMock</span>); </span><span id="115" class="l"><a class="l" href="#115">115: </a> <span class="php-var">$manipulator</span>-&gt;deactivate(<span class="php-var">$username</span>); </span><span id="116" class="l"><a class="l" href="#116">116: </a> </span><span id="117" class="l"><a class="l" href="#117">117: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-var">$username</span>, <span class="php-var">$user</span>-&gt;getUsername()); </span><span id="118" class="l"><a class="l" href="#118">118: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-keyword1">false</span>, <span class="php-var">$user</span>-&gt;isEnabled()); </span><span id="119" class="l"><a class="l" href="#119">119: </a> } </span><span id="120" class="l"><a class="l" href="#120">120: </a> </span><span id="121" class="l"><a class="l" href="#121">121: </a> <span class="php-comment">/** </span></span><span id="122" class="l"><a class="l" href="#122">122: </a><span class="php-comment"> * @expectedException \InvalidArgumentException </span></span><span id="123" class="l"><a class="l" href="#123">123: </a><span class="php-comment"> */</span> </span><span id="124" class="l"><a class="l" href="#124">124: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_testDeactivateWithInvalidUsername" href="#_testDeactivateWithInvalidUsername">testDeactivateWithInvalidUsername</a>() </span><span id="125" class="l"><a class="l" href="#125">125: </a> { </span><span id="126" class="l"><a class="l" href="#126">126: </a> <span class="php-var">$userManagerMock</span> = <span class="php-var">$this</span>-&gt;getMock(<span class="php-quote">'FOS\UserBundle\Model\UserManagerInterface'</span>); </span><span id="127" class="l"><a class="l" href="#127">127: </a> <span class="php-var">$invalidusername</span> = <span class="php-quote">'invalid_username'</span>; </span><span id="128" class="l"><a class="l" href="#128">128: </a> </span><span id="129" class="l"><a class="l" href="#129">129: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="130" class="l"><a class="l" href="#130">130: </a> -&gt;method(<span class="php-quote">'findUserByUsername'</span>) </span><span id="131" class="l"><a class="l" href="#131">131: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-keyword1">null</span>)) </span><span id="132" class="l"><a class="l" href="#132">132: </a> -&gt;with(<span class="php-var">$this</span>-&gt;equalTo(<span class="php-var">$invalidusername</span>)); </span><span id="133" class="l"><a class="l" href="#133">133: </a> </span><span id="134" class="l"><a class="l" href="#134">134: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;never()) </span><span id="135" class="l"><a class="l" href="#135">135: </a> -&gt;method(<span class="php-quote">'updateUser'</span>); </span><span id="136" class="l"><a class="l" href="#136">136: </a> </span><span id="137" class="l"><a class="l" href="#137">137: </a> <span class="php-var">$manipulator</span> = <span class="php-keyword1">new</span> UserManipulator(<span class="php-var">$userManagerMock</span>); </span><span id="138" class="l"><a class="l" href="#138">138: </a> <span class="php-var">$manipulator</span>-&gt;deactivate(<span class="php-var">$invalidusername</span>); </span><span id="139" class="l"><a class="l" href="#139">139: </a> } </span><span id="140" class="l"><a class="l" href="#140">140: </a> </span><span id="141" class="l"><a class="l" href="#141">141: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_testPromoteWithValidUsername" href="#_testPromoteWithValidUsername">testPromoteWithValidUsername</a>() </span><span id="142" class="l"><a class="l" href="#142">142: </a> { </span><span id="143" class="l"><a class="l" href="#143">143: </a> <span class="php-var">$userManagerMock</span> = <span class="php-var">$this</span>-&gt;getMock(<span class="php-quote">'FOS\UserBundle\Model\UserManagerInterface'</span>); </span><span id="144" class="l"><a class="l" href="#144">144: </a> <span class="php-var">$username</span> = <span class="php-quote">'test_username'</span>; </span><span id="145" class="l"><a class="l" href="#145">145: </a> </span><span id="146" class="l"><a class="l" href="#146">146: </a> <span class="php-var">$user</span> = <span class="php-keyword1">new</span> TestUser(); </span><span id="147" class="l"><a class="l" href="#147">147: </a> <span class="php-var">$user</span>-&gt;setUsername(<span class="php-var">$username</span>); </span><span id="148" class="l"><a class="l" href="#148">148: </a> <span class="php-var">$user</span>-&gt;setSuperAdmin(<span class="php-keyword1">false</span>); </span><span id="149" class="l"><a class="l" href="#149">149: </a> </span><span id="150" class="l"><a class="l" href="#150">150: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="151" class="l"><a class="l" href="#151">151: </a> -&gt;method(<span class="php-quote">'findUserByUsername'</span>) </span><span id="152" class="l"><a class="l" href="#152">152: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)) </span><span id="153" class="l"><a class="l" href="#153">153: </a> -&gt;with(<span class="php-var">$this</span>-&gt;equalTo(<span class="php-var">$username</span>)); </span><span id="154" class="l"><a class="l" href="#154">154: </a> </span><span id="155" class="l"><a class="l" href="#155">155: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="156" class="l"><a class="l" href="#156">156: </a> -&gt;method(<span class="php-quote">'updateUser'</span>) </span><span id="157" class="l"><a class="l" href="#157">157: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)) </span><span id="158" class="l"><a class="l" href="#158">158: </a> -&gt;with(<span class="php-var">$this</span>-&gt;isInstanceOf(<span class="php-quote">'FOS\UserBundle\Tests\TestUser'</span>)); </span><span id="159" class="l"><a class="l" href="#159">159: </a> </span><span id="160" class="l"><a class="l" href="#160">160: </a> <span class="php-var">$manipulator</span> = <span class="php-keyword1">new</span> UserManipulator(<span class="php-var">$userManagerMock</span>); </span><span id="161" class="l"><a class="l" href="#161">161: </a> <span class="php-var">$manipulator</span>-&gt;promote(<span class="php-var">$username</span>); </span><span id="162" class="l"><a class="l" href="#162">162: </a> </span><span id="163" class="l"><a class="l" href="#163">163: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-var">$username</span>, <span class="php-var">$user</span>-&gt;getUsername()); </span><span id="164" class="l"><a class="l" href="#164">164: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-keyword1">true</span>, <span class="php-var">$user</span>-&gt;isSuperAdmin()); </span><span id="165" class="l"><a class="l" href="#165">165: </a> } </span><span id="166" class="l"><a class="l" href="#166">166: </a> </span><span id="167" class="l"><a class="l" href="#167">167: </a> <span class="php-comment">/** </span></span><span id="168" class="l"><a class="l" href="#168">168: </a><span class="php-comment"> * @expectedException \InvalidArgumentException </span></span><span id="169" class="l"><a class="l" href="#169">169: </a><span class="php-comment"> */</span> </span><span id="170" class="l"><a class="l" href="#170">170: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_testPromoteWithInvalidUsername" href="#_testPromoteWithInvalidUsername">testPromoteWithInvalidUsername</a>() </span><span id="171" class="l"><a class="l" href="#171">171: </a> { </span><span id="172" class="l"><a class="l" href="#172">172: </a> <span class="php-var">$userManagerMock</span> = <span class="php-var">$this</span>-&gt;getMock(<span class="php-quote">'FOS\UserBundle\Model\UserManagerInterface'</span>); </span><span id="173" class="l"><a class="l" href="#173">173: </a> <span class="php-var">$invalidusername</span> = <span class="php-quote">'invalid_username'</span>; </span><span id="174" class="l"><a class="l" href="#174">174: </a> </span><span id="175" class="l"><a class="l" href="#175">175: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="176" class="l"><a class="l" href="#176">176: </a> -&gt;method(<span class="php-quote">'findUserByUsername'</span>) </span><span id="177" class="l"><a class="l" href="#177">177: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-keyword1">null</span>)) </span><span id="178" class="l"><a class="l" href="#178">178: </a> -&gt;with(<span class="php-var">$this</span>-&gt;equalTo(<span class="php-var">$invalidusername</span>)); </span><span id="179" class="l"><a class="l" href="#179">179: </a> </span><span id="180" class="l"><a class="l" href="#180">180: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;never()) </span><span id="181" class="l"><a class="l" href="#181">181: </a> -&gt;method(<span class="php-quote">'updateUser'</span>); </span><span id="182" class="l"><a class="l" href="#182">182: </a> </span><span id="183" class="l"><a class="l" href="#183">183: </a> <span class="php-var">$manipulator</span> = <span class="php-keyword1">new</span> UserManipulator(<span class="php-var">$userManagerMock</span>); </span><span id="184" class="l"><a class="l" href="#184">184: </a> <span class="php-var">$manipulator</span>-&gt;promote(<span class="php-var">$invalidusername</span>); </span><span id="185" class="l"><a class="l" href="#185">185: </a> } </span><span id="186" class="l"><a class="l" href="#186">186: </a> </span><span id="187" class="l"><a class="l" href="#187">187: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_testDemoteWithValidUsername" href="#_testDemoteWithValidUsername">testDemoteWithValidUsername</a>() </span><span id="188" class="l"><a class="l" href="#188">188: </a> { </span><span id="189" class="l"><a class="l" href="#189">189: </a> <span class="php-var">$userManagerMock</span> = <span class="php-var">$this</span>-&gt;getMock(<span class="php-quote">'FOS\UserBundle\Model\UserManagerInterface'</span>); </span><span id="190" class="l"><a class="l" href="#190">190: </a> <span class="php-var">$username</span> = <span class="php-quote">'test_username'</span>; </span><span id="191" class="l"><a class="l" href="#191">191: </a> </span><span id="192" class="l"><a class="l" href="#192">192: </a> <span class="php-var">$user</span> = <span class="php-keyword1">new</span> TestUser(); </span><span id="193" class="l"><a class="l" href="#193">193: </a> <span class="php-var">$user</span>-&gt;setUsername(<span class="php-var">$username</span>); </span><span id="194" class="l"><a class="l" href="#194">194: </a> <span class="php-var">$user</span>-&gt;setSuperAdmin(<span class="php-keyword1">true</span>); </span><span id="195" class="l"><a class="l" href="#195">195: </a> </span><span id="196" class="l"><a class="l" href="#196">196: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="197" class="l"><a class="l" href="#197">197: </a> -&gt;method(<span class="php-quote">'findUserByUsername'</span>) </span><span id="198" class="l"><a class="l" href="#198">198: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)) </span><span id="199" class="l"><a class="l" href="#199">199: </a> -&gt;with(<span class="php-var">$this</span>-&gt;equalTo(<span class="php-var">$username</span>)); </span><span id="200" class="l"><a class="l" href="#200">200: </a> </span><span id="201" class="l"><a class="l" href="#201">201: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="202" class="l"><a class="l" href="#202">202: </a> -&gt;method(<span class="php-quote">'updateUser'</span>) </span><span id="203" class="l"><a class="l" href="#203">203: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)) </span><span id="204" class="l"><a class="l" href="#204">204: </a> -&gt;with(<span class="php-var">$this</span>-&gt;isInstanceOf(<span class="php-quote">'FOS\UserBundle\Tests\TestUser'</span>)); </span><span id="205" class="l"><a class="l" href="#205">205: </a> </span><span id="206" class="l"><a class="l" href="#206">206: </a> <span class="php-var">$manipulator</span> = <span class="php-keyword1">new</span> UserManipulator(<span class="php-var">$userManagerMock</span>); </span><span id="207" class="l"><a class="l" href="#207">207: </a> <span class="php-var">$manipulator</span>-&gt;demote(<span class="php-var">$username</span>); </span><span id="208" class="l"><a class="l" href="#208">208: </a> </span><span id="209" class="l"><a class="l" href="#209">209: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-var">$username</span>, <span class="php-var">$user</span>-&gt;getUsername()); </span><span id="210" class="l"><a class="l" href="#210">210: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-keyword1">false</span>, <span class="php-var">$user</span>-&gt;isSuperAdmin()); </span><span id="211" class="l"><a class="l" href="#211">211: </a> } </span><span id="212" class="l"><a class="l" href="#212">212: </a> </span><span id="213" class="l"><a class="l" href="#213">213: </a> <span class="php-comment">/** </span></span><span id="214" class="l"><a class="l" href="#214">214: </a><span class="php-comment"> * @expectedException \InvalidArgumentException </span></span><span id="215" class="l"><a class="l" href="#215">215: </a><span class="php-comment"> */</span> </span><span id="216" class="l"><a class="l" href="#216">216: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_testDemoteWithInvalidUsername" href="#_testDemoteWithInvalidUsername">testDemoteWithInvalidUsername</a>() </span><span id="217" class="l"><a class="l" href="#217">217: </a> { </span><span id="218" class="l"><a class="l" href="#218">218: </a> <span class="php-var">$userManagerMock</span> = <span class="php-var">$this</span>-&gt;getMock(<span class="php-quote">'FOS\UserBundle\Model\UserManagerInterface'</span>); </span><span id="219" class="l"><a class="l" href="#219">219: </a> <span class="php-var">$invalidusername</span> = <span class="php-quote">'invalid_username'</span>; </span><span id="220" class="l"><a class="l" href="#220">220: </a> </span><span id="221" class="l"><a class="l" href="#221">221: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="222" class="l"><a class="l" href="#222">222: </a> -&gt;method(<span class="php-quote">'findUserByUsername'</span>) </span><span id="223" class="l"><a class="l" href="#223">223: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-keyword1">null</span>)) </span><span id="224" class="l"><a class="l" href="#224">224: </a> -&gt;with(<span class="php-var">$this</span>-&gt;equalTo(<span class="php-var">$invalidusername</span>)); </span><span id="225" class="l"><a class="l" href="#225">225: </a> </span><span id="226" class="l"><a class="l" href="#226">226: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;never()) </span><span id="227" class="l"><a class="l" href="#227">227: </a> -&gt;method(<span class="php-quote">'updateUser'</span>); </span><span id="228" class="l"><a class="l" href="#228">228: </a> </span><span id="229" class="l"><a class="l" href="#229">229: </a> <span class="php-var">$manipulator</span> = <span class="php-keyword1">new</span> UserManipulator(<span class="php-var">$userManagerMock</span>); </span><span id="230" class="l"><a class="l" href="#230">230: </a> <span class="php-var">$manipulator</span>-&gt;demote(<span class="php-var">$invalidusername</span>); </span><span id="231" class="l"><a class="l" href="#231">231: </a> } </span><span id="232" class="l"><a class="l" href="#232">232: </a> </span><span id="233" class="l"><a class="l" href="#233">233: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_testChangePasswordWithValidUsername" href="#_testChangePasswordWithValidUsername">testChangePasswordWithValidUsername</a>() </span><span id="234" class="l"><a class="l" href="#234">234: </a> { </span><span id="235" class="l"><a class="l" href="#235">235: </a> <span class="php-var">$userManagerMock</span> = <span class="php-var">$this</span>-&gt;getMock(<span class="php-quote">'FOS\UserBundle\Model\UserManagerInterface'</span>); </span><span id="236" class="l"><a class="l" href="#236">236: </a> </span><span id="237" class="l"><a class="l" href="#237">237: </a> <span class="php-var">$user</span> = <span class="php-keyword1">new</span> TestUser(); </span><span id="238" class="l"><a class="l" href="#238">238: </a> <span class="php-var">$username</span> = <span class="php-quote">'test_username'</span>; </span><span id="239" class="l"><a class="l" href="#239">239: </a> <span class="php-var">$password</span> = <span class="php-quote">'test_password'</span>; </span><span id="240" class="l"><a class="l" href="#240">240: </a> <span class="php-var">$oldpassword</span> = <span class="php-quote">'old_password'</span>; </span><span id="241" class="l"><a class="l" href="#241">241: </a> </span><span id="242" class="l"><a class="l" href="#242">242: </a> <span class="php-var">$user</span>-&gt;setUsername(<span class="php-var">$username</span>); </span><span id="243" class="l"><a class="l" href="#243">243: </a> <span class="php-var">$user</span>-&gt;setPlainPassword(<span class="php-var">$oldpassword</span>); </span><span id="244" class="l"><a class="l" href="#244">244: </a> </span><span id="245" class="l"><a class="l" href="#245">245: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="246" class="l"><a class="l" href="#246">246: </a> -&gt;method(<span class="php-quote">'findUserByUsername'</span>) </span><span id="247" class="l"><a class="l" href="#247">247: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)) </span><span id="248" class="l"><a class="l" href="#248">248: </a> -&gt;with(<span class="php-var">$this</span>-&gt;equalTo(<span class="php-var">$username</span>)); </span><span id="249" class="l"><a class="l" href="#249">249: </a> </span><span id="250" class="l"><a class="l" href="#250">250: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="251" class="l"><a class="l" href="#251">251: </a> -&gt;method(<span class="php-quote">'updateUser'</span>) </span><span id="252" class="l"><a class="l" href="#252">252: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-var">$user</span>)) </span><span id="253" class="l"><a class="l" href="#253">253: </a> -&gt;with(<span class="php-var">$this</span>-&gt;isInstanceOf(<span class="php-quote">'FOS\UserBundle\Tests\TestUser'</span>)); </span><span id="254" class="l"><a class="l" href="#254">254: </a> </span><span id="255" class="l"><a class="l" href="#255">255: </a> <span class="php-var">$manipulator</span> = <span class="php-keyword1">new</span> UserManipulator(<span class="php-var">$userManagerMock</span>); </span><span id="256" class="l"><a class="l" href="#256">256: </a> <span class="php-var">$manipulator</span>-&gt;changePassword(<span class="php-var">$username</span>, <span class="php-var">$password</span>); </span><span id="257" class="l"><a class="l" href="#257">257: </a> </span><span id="258" class="l"><a class="l" href="#258">258: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-var">$username</span>, <span class="php-var">$user</span>-&gt;getUsername()); </span><span id="259" class="l"><a class="l" href="#259">259: </a> <span class="php-var">$this</span>-&gt;assertEquals(<span class="php-var">$password</span>, <span class="php-var">$user</span>-&gt;getPlainPassword()); </span><span id="260" class="l"><a class="l" href="#260">260: </a> } </span><span id="261" class="l"><a class="l" href="#261">261: </a> </span><span id="262" class="l"><a class="l" href="#262">262: </a> <span class="php-comment">/** </span></span><span id="263" class="l"><a class="l" href="#263">263: </a><span class="php-comment"> * @expectedException \InvalidArgumentException </span></span><span id="264" class="l"><a class="l" href="#264">264: </a><span class="php-comment"> */</span> </span><span id="265" class="l"><a class="l" href="#265">265: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_testChangePasswordWithInvalidUsername" href="#_testChangePasswordWithInvalidUsername">testChangePasswordWithInvalidUsername</a>() </span><span id="266" class="l"><a class="l" href="#266">266: </a> { </span><span id="267" class="l"><a class="l" href="#267">267: </a> <span class="php-var">$userManagerMock</span> = <span class="php-var">$this</span>-&gt;getMock(<span class="php-quote">'FOS\UserBundle\Model\UserManagerInterface'</span>); </span><span id="268" class="l"><a class="l" href="#268">268: </a> </span><span id="269" class="l"><a class="l" href="#269">269: </a> <span class="php-var">$invalidusername</span> = <span class="php-quote">'invalid_username'</span>; </span><span id="270" class="l"><a class="l" href="#270">270: </a> <span class="php-var">$password</span> = <span class="php-quote">'test_password'</span>; </span><span id="271" class="l"><a class="l" href="#271">271: </a> </span><span id="272" class="l"><a class="l" href="#272">272: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;once()) </span><span id="273" class="l"><a class="l" href="#273">273: </a> -&gt;method(<span class="php-quote">'findUserByUsername'</span>) </span><span id="274" class="l"><a class="l" href="#274">274: </a> -&gt;will(<span class="php-var">$this</span>-&gt;returnValue(<span class="php-keyword1">null</span>)) </span><span id="275" class="l"><a class="l" href="#275">275: </a> -&gt;with(<span class="php-var">$this</span>-&gt;equalTo(<span class="php-var">$invalidusername</span>)); </span><span id="276" class="l"><a class="l" href="#276">276: </a> </span><span id="277" class="l"><a class="l" href="#277">277: </a> <span class="php-var">$userManagerMock</span>-&gt;expects(<span class="php-var">$this</span>-&gt;never()) </span><span id="278" class="l"><a class="l" href="#278">278: </a> -&gt;method(<span class="php-quote">'updateUser'</span>); </span><span id="279" class="l"><a class="l" href="#279">279: </a> </span><span id="280" class="l"><a class="l" href="#280">280: </a> <span class="php-var">$manipulator</span> = <span class="php-keyword1">new</span> UserManipulator(<span class="php-var">$userManagerMock</span>); </span><span id="281" class="l"><a class="l" href="#281">281: </a> <span class="php-var">$manipulator</span>-&gt;changePassword(<span class="php-var">$invalidusername</span>, <span class="php-var">$password</span>); </span><span id="282" class="l"><a class="l" href="#282">282: </a> } </span><span id="283" class="l"><a class="l" href="#283">283: </a>} </span><span id="284" class="l"><a class="l" href="#284">284: </a></span></code></pre> <div id="footer"> seip API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a> </div> </div> </div> </body> </html>
Tecnocreaciones/VzlaGovernmentTemplateDeveloperSeed
api/source-class-FOS.UserBundle.Tests.Util.UserManipulatorTest.html
HTML
mit
195,280
<?php /* * Generated by CRUDigniter v2.1 Beta * www.crudigniter.com */ class Compra extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('Compra_model'); } /* * Listing of compra */ function index() { $data['compra'] = $this->Compra_model->get_all_compra(); $this->load->view('cabecalho'); $this->load->view('compra/index',$data); } /* * Adding a new compra */ function add() { $this->load->library('form_validation'); $this->form_validation->set_rules('value_product','Value Product','required'); $this->form_validation->set_rules('quantidade','Quantidade','required'); if($this->form_validation->run()) { $params = array( 'quantidade' => $this->input->post('quantidade'), 'value_product' => $this->input->post('value_product'), 'data_criacao' => date('Y-m-d'), 'fornecedor_id' => $this->input->post('fornecedor'), 'produto_id' => $this->input->post('produto') ); $compra_id = $this->Compra_model->add_compra($params); redirect('compra/index'); } else { $this->load->model('Fornecedor_model'); $this->load->model('Produto_model'); $data['fornecedor'] = $this->Fornecedor_model->get_all_fornecedor(); $data['produto'] = $this->Produto_model->get_all_produto(); $this->load->view('cabecalho'); $this->load->view('compra/add',$data); } } /* * Editing a compra */ function edit($id) { // check if the compra exists before trying to edit it $compra = $this->Compra_model->get_compra($id); if(isset($compra['id'])) { $this->load->library('form_validation'); $this->form_validation->set_rules('value_product','Value Product','required'); $this->form_validation->set_rules('quantidade','Quantidade','required'); if($this->form_validation->run()) { $params = array( 'quantidade' => $this->input->post('quantidade'), 'value_product' => $this->input->post('value_product'), 'fornecedor_id' => $this->input->post('fornecedor') ); $ids = array( 'produto_id' => $this->input->post('produto_id'), 'compra_id' => $id ); $this->Compra_model->update_compra($ids,$params); redirect('compra/index'); } else { $data['compra'] = $this->Compra_model->get_compra($id); $this->load->model('Fornecedor_model'); $this->load->model('Produto_model'); $data['fornecedor'] = $this->Fornecedor_model->get_all_fornecedor(); $this->load->view('cabecalho'); $this->load->view('compra/edit',$data); } } else show_error('The compra you are trying to edit does not exist.'); } /* * Deleting compra */ function remove($id) { $compra = $this->Compra_model->get_compra($id); // check if the compra exists before trying to delete it if(isset($compra['id'])) { $this->Compra_model->delete_compra($id); redirect('compra/index'); } else show_error('The compra you are trying to delete does not exist.'); } }
anytitleyoulike/axm
application/controllers/Compra.php
PHP
mit
3,662
<?php snippet('magazine/header') ?> <main class="site-main"> <div class="container"> <article class="single-article"> <?php if($cover = $page->cover()->toFile()) : ?> <figure> <img src="<?= $cover->resize(1000)->url() ?>" alt="<?= $page->title()->html() ?>" class="img-responsive"> </figure> <?php endif ?> <div class="content-columns"> <header> <h1 class="entry-title"><?= $page->title()->html() ?></h1> <?php if($page->intro()->isNotEmpty()) : ?> <div class="intro"> <?= $page->intro()->kirbytext() ?> </div> <?php endif ?> </header> <div class="entry-content"> <?= $page->text()->kirbytext() ?> </div> </div> <hr> <footer class="entry-footer"> <div class="row"> <div class="col-md-6"> <div class="tag-links"> <?php foreach(str::split($page->tags()) as $tag): ?> <a href="<?= url('/' . $site->language() . '/blog-results/tag:' . urlencode($tag)) ?>"><?= $tag; ?></a> <?php endforeach ?> </div> </div> <div class="col-md-6"> <?php $user = $page->author(); ?> <!-- <div class="entry-meta"> --> <!-- by <a class="author-link" href="<?php /*echo url('/' . $site->language() . '/blog-author/' . $user) */ ?>" rel="author"> --> <!-- <?php /* echo $site->user($user)->firstName() . " " . $site->user($user)->lastName() */ ?> --> <!-- </a> on <time datetime="<?php /* echo $page->date('c') */?>"><?php /* ehco $page->date('M d, Y') */?></time> --> <!-- </div> --> </div> </div> <ul class="share-buttons list-inline"> <?php if ($site->sharetwitter() == "1" ): ?> <li class="share-button"> <a class="btn btn-default" href="https://twitter.com/intent/tweet?source=webclient&text=<?= rawurlencode($page->title()); ?>%20%7C%20<?= rawurlencode($site->title()); ?>%20<?= rawurlencode($page->url()); ?>" target="blank" title="Tweet this"><i class="fa fa-twitter"></i> Twitter</a> </li> <?php endif ?> <?php if ($site->sharefacebook() == "1" ): ?> <li class="share-button"> <a class="btn btn-default" href="http://www.facebook.com/sharer.php?u=<?= rawurlencode ($page->url()); ?>" target="blank" title="Share on Facebook"><i class="fa fa-facebook"></i> Facebook</a> </li> <?php endif ?> <?php if ($site->sharegoogle() == "1" ): ?> <li class="share-button"> <a class="btn btn-default" href="https://plus.google.com/share?url=<?= rawurlencode ($page->url()); ?>" target="blank" title="Share on Google+"><i class="fa fa-google-plus"></i> Google+</a> </li> <?php endif ?> </ul> <div class="controls"> <a href="#top" class="go-top"> <span class="fa fa-angle-up"></span> </a> </div> </footer> </article> </div><!-- container --> </main> <?php snippet('magazine/footer') ?>
youonlyliveonce/24-1.studio
public/site/templates/blog_article.php
PHP
mit
2,880
import angular from 'angular'; var CrudModule = angular.module('crud', [ 'ui.router', 'ui.bootstrap', 'ngSanitize', 'textAngular', 'ngInflection', 'ui.codemirror', 'ngFileUpload', 'ngNumeraljs' ]); CrudModule.controller('ListLayoutController', require('./list/ListLayoutController')); CrudModule.controller('ListController', require('./list/ListController')); CrudModule.controller('ShowController', require('./show/ShowController')); CrudModule.controller('FormController', require('./form/FormController')); CrudModule.controller('DeleteController', require('./delete/DeleteController')); CrudModule.controller('BatchDeleteController', require('./delete/BatchDeleteController')); CrudModule.service('EntryFormatter', require('./misc/EntryFormatter')); CrudModule.service('PromisesResolver', require('./misc/PromisesResolver')); CrudModule.service('ReadQueries', require('./repository/ReadQueries')); CrudModule.service('ReferenceRefresher', require('./repository/ReferenceRefresher')); CrudModule.service('WriteQueries', require('./repository/WriteQueries')); CrudModule.service('RestWrapper', require('./misc/RestWrapper')); CrudModule.directive('maJsonValidator', require('./validator/maJsonValidator')); CrudModule.directive('maField', require('./field/maField')); CrudModule.directive('maButtonField', require('./field/maButtonField')); CrudModule.directive('maChoiceField', require('./field/maChoiceField')); CrudModule.directive('maChoicesField', require('./field/maChoicesField')); CrudModule.directive('maDateField', require('./field/maDateField')); CrudModule.directive('maEmbeddedListField', require('./field/maEmbeddedListField')); CrudModule.directive('maInputField', require('./field/maInputField')); CrudModule.directive('maJsonField', require('./field/maJsonField')); CrudModule.directive('maFileField', require('./field/maFileField')); CrudModule.directive('maCheckboxField', require('./field/maCheckboxField')); CrudModule.directive('maReferenceField', require('./field/maReferenceField')); CrudModule.directive('maReferenceManyField', require('./field/maReferenceManyField')); CrudModule.directive('maTextField', require('./field/maTextField')); CrudModule.directive('maWysiwygField', require('./field/maWysiwygField')); CrudModule.directive('maTemplateField', require('./field/maTemplateField')); CrudModule.directive('uiSelectRequired', require('./field/uiSelectRequired')); CrudModule.provider('FieldViewConfiguration', require('./fieldView/FieldViewConfiguration')); CrudModule.directive('maListActions', require('./list/maListActions')); CrudModule.directive('maDatagrid', require('./list/maDatagrid')); CrudModule.directive('maDatagridPagination', require('./list/maDatagridPagination')); CrudModule.directive('maDatagridInfinitePagination', require('./list/maDatagridInfinitePagination')); CrudModule.directive('maDatagridItemSelector', require('./list/maDatagridItemSelector')); CrudModule.directive('maDatagridMultiSelector', require('./list/maDatagridMultiSelector')); CrudModule.directive('maFilterForm', require('./filter/maFilterForm')); CrudModule.directive('maFilter', require('./filter/maFilter')); CrudModule.directive('maColumn', require('./column/maColumn')); CrudModule.directive('maBooleanColumn', require('./column/maBooleanColumn')); CrudModule.directive('maChoicesColumn', require('./column/maChoicesColumn')); CrudModule.directive('maDateColumn', require('./column/maDateColumn')); CrudModule.directive('maEmbeddedListColumn', require('./column/maEmbeddedListColumn')); CrudModule.directive('maJsonColumn', require('./column/maJsonColumn')); CrudModule.directive('maNumberColumn', require('./column/maNumberColumn')); CrudModule.directive('maReferenceColumn', require('./column/maReferenceColumn')); CrudModule.directive('maReferencedListColumn', require('./column/maReferencedListColumn')); CrudModule.directive('maReferenceLinkColumn', require('./column/maReferenceLinkColumn')); CrudModule.directive('maReferenceManyColumn', require('./column/maReferenceManyColumn')); CrudModule.directive('maReferenceManyLinkColumn', require('./column/maReferenceManyLinkColumn')); CrudModule.directive('maStringColumn', require('./column/maStringColumn')); CrudModule.directive('maTemplateColumn', require('./column/maTemplateColumn')); CrudModule.directive('maWysiwygColumn', require('./column/maWysiwygColumn')); CrudModule.directive('maBackButton', require('./button/maBackButton')); CrudModule.directive('maCreateButton', require('./button/maCreateButton')); CrudModule.directive('maEditButton', require('./button/maEditButton')); CrudModule.directive('maFilterButton', require('./button/maFilterButton')); CrudModule.directive('maFilteredListButton', require('./button/maFilteredListButton')); CrudModule.directive('maShowButton', require('./button/maShowButton')); CrudModule.directive('maListButton', require('./button/maListButton')); CrudModule.directive('maDeleteButton', require('./button/maDeleteButton')); CrudModule.directive('maBatchDeleteButton', require('./button/maBatchDeleteButton')); CrudModule.directive('maExportToCsvButton', require('./button/maExportToCsvButton')); CrudModule.directive('maSubmitButton', require('./button/maSubmitButton')); CrudModule.directive('maViewBatchActions', require('./button/maViewBatchActions')); CrudModule.directive('maShowItem', require('./show/maShowItem')); CrudModule.directive('maViewActions', require('./misc/ViewActions')); CrudModule.directive('compile', require('./misc/Compile')); CrudModule.config(require('./routing')); CrudModule.config(require('./config/factories')); CrudModule.factory('Papa', function () { return require('papaparse'); }); CrudModule.factory('notification', function () { var humane = require('humane-js'); humane.timeout = 5000; humane.clickToClose = true; return humane; }); CrudModule.factory('progression', function () { return require('nprogress'); }); CrudModule.run(['Restangular', 'NgAdminConfiguration', function(Restangular, NgAdminConfiguration) { Restangular.setBaseUrl(NgAdminConfiguration().baseApiUrl()); }]); export default CrudModule;
SebLours/ng-admin
src/javascripts/ng-admin/Crud/CrudModule.js
JavaScript
mit
6,124
<html> <head> <title>User agent detail - Archos 70 Internet Tablet</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css"> <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> </head> <body> <div class="container"> <div class="section"> <h1 class="header center orange-text">User agent detail</h1> <div class="row center"> <h5 class="header light"> Archos 70 Internet Tablet </h5> </div> </div> <div class="section"> <table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Source result (test suite)</th></tr><tr><td>ua-parser/uap-core<br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Archos</td><td>70 Internet Tablet</td><td></td><td></td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td></td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-test">Detail</a> <!-- Modal Structure --> <div id="modal-test" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>Testsuite result detail</h4> <p><pre><code class="php">Array ( [user_agent_string] => Archos 70 Internet Tablet [family] => Archos 70 Internet Tablet [brand] => Archos [model] => 70 Internet Tablet ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapPhp<br /><small>6012</small></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>DonatjUAParser<br /><small>v0.5.0</small></td><td>Archos </td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661">Detail</a> <!-- Modal Structure --> <div id="modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>DonatjUAParser result detail</h4> <p><pre><code class="php">Array ( [platform] => [browser] => Archos [version] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>NeutrinoApiCom<br /><small></small></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>PiwikDeviceDetector<br /><small>3.5.2</small></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Archos</td><td>70</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.005</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-21638055-738d-46ba-a1b1-f5114bc26475">Detail</a> <!-- Modal Structure --> <div id="modal-21638055-738d-46ba-a1b1-f5114bc26475" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>PiwikDeviceDetector result detail</h4> <p><pre><code class="php">Array ( [client] => [operatingSystem] => Array ( ) [device] => Array ( [brand] => AR [brandName] => Archos [model] => 70 [device] => 1 [deviceName] => smartphone ) [bot] => [extra] => Array ( [isBot] => [isBrowser] => [isFeedReader] => [isMobileApp] => [isPIM] => [isLibrary] => [isMediaPlayer] => [isCamera] => [isCarBrowser] => [isConsole] => [isFeaturePhone] => [isPhablet] => [isPortableMediaPlayer] => [isSmartDisplay] => [isSmartphone] => 1 [isTablet] => [isTV] => [isDesktop] => [isMobile] => 1 [isTouchEnabled] => ) ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.0</small></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>UAParser<br /><small>v3.4.5</small></td><td> </td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Archos</td><td>70 Internet Tablet</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b">Detail</a> <!-- Modal Structure --> <div id="modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>UAParser result detail</h4> <p><pre><code class="php">UAParser\Result\Client Object ( [ua] => UAParser\Result\UserAgent Object ( [major] => [minor] => [patch] => [family] => Other ) [os] => UAParser\Result\OperatingSystem Object ( [major] => [minor] => [patch] => [patchMinor] => [family] => Other ) [device] => UAParser\Result\Device Object ( [brand] => Archos [model] => 70 Internet Tablet [family] => Archos 70 Internet Tablet ) [originalUserAgent] => Archos 70 Internet Tablet ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>UserAgentStringCom<br /><small></small></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>WhatIsMyBrowserCom<br /><small></small></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555"></td><td>Tablet</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.40704</td><td> <!-- Modal Trigger --> <a class="modal-trigger btn waves-effect waves-light" href="#modal-9795f66f-7271-430e-973a-a5c0e14dc35a">Detail</a> <!-- Modal Structure --> <div id="modal-9795f66f-7271-430e-973a-a5c0e14dc35a" class="modal modal-fixed-footer"> <div class="modal-content"> <h4>WhatIsMyBrowserCom result detail</h4> <p><pre><code class="php">stdClass Object ( [operating_system_name] => [simple_sub_description_string] => [simple_browser_string] => [browser_version] => [extra_info] => Array ( ) [operating_platform] => Tablet [extra_info_table] => Array ( ) [layout_engine_name] => [detected_addons] => Array ( ) [operating_system_flavour_code] => [hardware_architecture] => [operating_system_flavour] => [operating_system_frameworks] => Array ( ) [browser_name_code] => [operating_system_version] => [simple_operating_platform_string] => Tablet [is_abusive] => [layout_engine_version] => [browser_capabilities] => Array ( ) [operating_platform_vendor_name] => [operating_system] => [operating_system_version_full] => [operating_platform_code] => [browser_name] => [operating_system_name_code] => [user_agent] => Archos 70 Internet Tablet [browser_version_full] => [browser] => ) </code></pre></p> </div> <div class="modal-footer"> <a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a> </div> </div> </td></tr><tr><td>WhichBrowser<br /><small>2.0.10</small></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>Woothee<br /><small>v1.2.0</small></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr><tr><td>Wurfl<br /><small>1.6.4</small></td> <td colspan="12" class="center-align red lighten-1"> <strong>No result found</strong> </td> </tr></table> </div> <div class="section"> <h1 class="header center orange-text">About this comparison</h1> <div class="row center"> <h5 class="header light"> The primary goal of this project is simple<br /> I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br /> <br /> The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br /> <br /> You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br /> <br /> The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a> </h5> </div> </div> <div class="card"> <div class="card-content"> Comparison created <i>2016-02-13 13:38:41</i> | by <a href="https://github.com/ThaDafinser">ThaDafinser</a> </div> </div> </div> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.1.1/list.min.js"></script> <script> $(document).ready(function(){ // the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered $('.modal-trigger').leanModal(); }); </script> </body> </html>
ThaDafinser/UserAgentParserComparison
v4/user-agent-detail/bc/d4/bcd44322-ea76-46c4-b363-ea54bc2ac90c.html
HTML
mit
12,340
<?php /** * sfUoWidgetFormCheckList * * @package sfUnobstrusiveWidgetPlugin * @subpackage lib.widget.form * @author Franรงois Bรฉliveau <francois.beliveau@my-labz.com> */ class sfUoWidgetFormCheckList extends sfUoWidgetList { /** * Configures the current widget. * * Available options: * * * multiple: Whether to allow multiple values or not (true by default) * * @param array $options An array of options * @param array $attributes An array of default HTML attributes * * @see sfUoWidget */ protected function configure($options = array(), $attributes = array()) { parent::configure($options, $attributes); $this->addOption('multiple', true); } /** * Gets the JavaScript selector. * * @return string A JS selector */ protected function getJsSelector() { return 'uo_widget_form_list'; } /** * Return an item content. * * @param string $key * @param mixed $value * * @return string */ protected function getItemContent($key, $value) { $id = $this->getId().'_'.$key; $name = $this->getOption('multiple') ? $this->getRenderName().'['.$key.']' : $this->getRenderName(); $renderValue = $this->getRenderValue(); $attributes = array('id'=>$id, 'name'=>$name, 'value'=>$key); $attributes['type'] = $this->getOption('multiple') ? 'checkbox' : 'radio'; if ( !empty($renderValue) && $renderValue !== false && ($key == $renderValue || (is_array($renderValue) && in_array($key, $renderValue))) ) { $attributes['checked'] = 'checked'; } if (is_array($value)) { if (array_key_exists('label', $value)) { $value['label'] = $this->renderTag('input', $attributes).$this->renderContentTag('label', $value['label'], array('for'=>$id)); } } else { $value = $this->renderTag('input', $attributes).$this->renderContentTag('label', $value, array('for'=>$id)); } return parent::getItemContent($key, $value); } }
Symfony-Plugins/sfUnobstrusiveWidgetPlugin
lib/widget/form/sfUoWidgetFormCheckList.class.php
PHP
mit
2,107
/** * @author Eberhard Graether / http://egraether.com/ * @author Mark Lundin / http://mark-lundin.com */ THREE.TrackballControls = function ( object, domElement ) { var _this = this; var STATE = { NONE: -1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM_PAN: 4 }; this.object = object; this.domElement = ( domElement !== undefined ) ? domElement : document; // API this.enabled = true; this.screen = { left: 0, top: 0, width: 0, height: 0 }; this.rotateSpeed = 1.0; this.zoomSpeed = 1.2; this.panSpeed = 0.3; this.noRotate = true; this.noZoom = true; this.noPan = false; this.noRoll = false; this.staticMoving = false; this.dynamicDampingFactor = 0.2; this.minDistance = 0; this.maxDistance = Infinity; this.keys = [ 65 /*A*/, 83 /*S*/, 68 /*D*/ ]; // internals this.target = new THREE.Vector3(); var EPS = 0.000001; var lastPosition = new THREE.Vector3(); var _state = STATE.NONE, _prevState = STATE.NONE, _eye = new THREE.Vector3(), _rotateStart = new THREE.Vector3(), _rotateEnd = new THREE.Vector3(), _zoomStart = new THREE.Vector2(), _zoomEnd = new THREE.Vector2(), _touchZoomDistanceStart = 0, _touchZoomDistanceEnd = 0, _panStart = new THREE.Vector2(), _panEnd = new THREE.Vector2(); // for reset this.target0 = this.target.clone(); this.position0 = this.object.position.clone(); this.up0 = this.object.up.clone(); // events var changeEvent = { type: 'change' }; var startEvent = { type: 'start'}; var endEvent = { type: 'end'}; // methods this.handleResize = function () { if ( this.domElement === document ) { this.screen.left = 0; this.screen.top = 0; this.screen.width = window.innerWidth; this.screen.height = window.innerHeight; } else { var box = this.domElement.getBoundingClientRect(); // adjustments come from similar code in the jquery offset() function var d = this.domElement.ownerDocument.documentElement; this.screen.left = box.left + window.pageXOffset - d.clientLeft; this.screen.top = box.top + window.pageYOffset - d.clientTop; this.screen.width = box.width; this.screen.height = box.height; } }; this.handleEvent = function ( event ) { if ( typeof this[ event.type ] == 'function' ) { this[ event.type ]( event ); } }; var getMouseOnScreen = ( function () { var vector = new THREE.Vector2(); return function ( pageX, pageY ) { vector.set( ( pageX - _this.screen.left ) / _this.screen.width, ( pageY - _this.screen.top ) / _this.screen.height ); return vector; }; }() ); var getMouseProjectionOnBall = ( function () { var vector = new THREE.Vector3(); var objectUp = new THREE.Vector3(); var mouseOnBall = new THREE.Vector3(); return function ( pageX, pageY ) { mouseOnBall.set( ( pageX - _this.screen.width * 0.5 - _this.screen.left ) / (_this.screen.width*.5), ( _this.screen.height * 0.5 + _this.screen.top - pageY ) / (_this.screen.height*.5), 0.0 ); var length = mouseOnBall.length(); if ( _this.noRoll ) { if ( length < Math.SQRT1_2 ) { mouseOnBall.z = Math.sqrt( 1.0 - length*length ); } else { mouseOnBall.z = .5 / length; } } else if ( length > 1.0 ) { mouseOnBall.normalize(); } else { mouseOnBall.z = Math.sqrt( 1.0 - length * length ); } _eye.copy( _this.object.position ).sub( _this.target ); vector.copy( _this.object.up ).setLength( mouseOnBall.y ) vector.add( objectUp.copy( _this.object.up ).cross( _eye ).setLength( mouseOnBall.x ) ); vector.add( _eye.setLength( mouseOnBall.z ) ); return vector; }; }() ); this.rotateCamera = (function(){ var axis = new THREE.Vector3(), quaternion = new THREE.Quaternion(); return function () { var angle = Math.acos( _rotateStart.dot( _rotateEnd ) / _rotateStart.length() / _rotateEnd.length() ); if ( angle ) { axis.crossVectors( _rotateStart, _rotateEnd ).normalize(); angle *= _this.rotateSpeed; quaternion.setFromAxisAngle( axis, -angle ); _eye.applyQuaternion( quaternion ); _this.object.up.applyQuaternion( quaternion ); _rotateEnd.applyQuaternion( quaternion ); if ( _this.staticMoving ) { _rotateStart.copy( _rotateEnd ); } else { quaternion.setFromAxisAngle( axis, angle * ( _this.dynamicDampingFactor - 1.0 ) ); _rotateStart.applyQuaternion( quaternion ); } } } }()); this.zoomCamera = function () { if ( _state === STATE.TOUCH_ZOOM_PAN ) { var factor = _touchZoomDistanceStart / _touchZoomDistanceEnd; _touchZoomDistanceStart = _touchZoomDistanceEnd; _eye.multiplyScalar( factor ); } else { var factor = 1.0 + ( _zoomEnd.y - _zoomStart.y ) * _this.zoomSpeed; if ( factor !== 1.0 && factor > 0.0 ) { _eye.multiplyScalar( factor ); if ( _this.staticMoving ) { _zoomStart.copy( _zoomEnd ); } else { _zoomStart.y += ( _zoomEnd.y - _zoomStart.y ) * this.dynamicDampingFactor; } } } }; this.panCamera = (function(){ var mouseChange = new THREE.Vector2(), objectUp = new THREE.Vector3(), pan = new THREE.Vector3(); return function () { mouseChange.copy( _panEnd ).sub( _panStart ); if ( mouseChange.lengthSq() ) { mouseChange.multiplyScalar( _eye.length() * _this.panSpeed ); pan.copy( _eye ).cross( _this.object.up ).setLength( mouseChange.x ); pan.add( objectUp.copy( _this.object.up ).setLength( mouseChange.y ) ); _this.object.position.add( pan ); _this.target.add( pan ); if ( _this.staticMoving ) { _panStart.copy( _panEnd ); } else { _panStart.add( mouseChange.subVectors( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) ); } } } }()); this.checkDistances = function () { if ( !_this.noZoom || !_this.noPan ) { if ( _eye.lengthSq() > _this.maxDistance * _this.maxDistance ) { _this.object.position.addVectors( _this.target, _eye.setLength( _this.maxDistance ) ); } if ( _eye.lengthSq() < _this.minDistance * _this.minDistance ) { _this.object.position.addVectors( _this.target, _eye.setLength( _this.minDistance ) ); } } }; this.update = function () { _eye.subVectors( _this.object.position, _this.target ); if ( !_this.noRotate ) { _this.rotateCamera(); } if ( !_this.noZoom ) { _this.zoomCamera(); } if ( !_this.noPan ) { _this.panCamera(); } _this.object.position.addVectors( _this.target, _eye ); _this.checkDistances(); _this.object.lookAt( _this.target ); if ( lastPosition.distanceToSquared( _this.object.position ) > EPS ) { _this.dispatchEvent( changeEvent ); lastPosition.copy( _this.object.position ); } }; this.reset = function () { _state = STATE.NONE; _prevState = STATE.NONE; _this.target.copy( _this.target0 ); _this.object.position.copy( _this.position0 ); _this.object.up.copy( _this.up0 ); _eye.subVectors( _this.object.position, _this.target ); _this.object.lookAt( _this.target ); _this.dispatchEvent( changeEvent ); lastPosition.copy( _this.object.position ); }; // listeners function keydown( event ) { if ( _this.enabled === false ) return; window.removeEventListener( 'keydown', keydown ); _prevState = _state; if ( _state !== STATE.NONE ) { return; } else if ( event.keyCode === _this.keys[ STATE.ROTATE ] && !_this.noRotate ) { _state = STATE.ROTATE; } else if ( event.keyCode === _this.keys[ STATE.ZOOM ] && !_this.noZoom ) { _state = STATE.ZOOM; } else if ( event.keyCode === _this.keys[ STATE.PAN ] && !_this.noPan ) { _state = STATE.PAN; } } function keyup( event ) { if ( _this.enabled === false ) return; _state = _prevState; window.addEventListener( 'keydown', keydown, false ); } function mousedown( event ) { if ( _this.enabled === false ) return; event.preventDefault(); event.stopPropagation(); if ( _state === STATE.NONE ) { _state = event.button; } if ( _state === STATE.ROTATE && !_this.noRotate ) { _rotateStart.copy( getMouseProjectionOnBall( event.pageX, event.pageY ) ); _rotateEnd.copy( _rotateStart ); } else if ( _state === STATE.ZOOM && !_this.noZoom ) { _zoomStart.copy( getMouseOnScreen( event.pageX, event.pageY ) ); _zoomEnd.copy(_zoomStart); } else if ( _state === STATE.PAN && !_this.noPan ) { _panStart.copy( getMouseOnScreen( event.pageX, event.pageY ) ); _panEnd.copy(_panStart) } document.addEventListener( 'mousemove', mousemove, false ); document.addEventListener( 'mouseup', mouseup, false ); _this.dispatchEvent( startEvent ); } function mousemove( event ) { if ( _this.enabled === false ) return; event.preventDefault(); event.stopPropagation(); if ( _state === STATE.ROTATE && !_this.noRotate ) { _rotateEnd.copy( getMouseProjectionOnBall( event.pageX, event.pageY ) ); } else if ( _state === STATE.ZOOM && !_this.noZoom ) { _zoomEnd.copy( getMouseOnScreen( event.pageX, event.pageY ) ); } else if ( _state === STATE.PAN && !_this.noPan ) { _panEnd.copy( getMouseOnScreen( event.pageX, event.pageY ) ); } } function mouseup( event ) { if ( _this.enabled === false ) return; event.preventDefault(); event.stopPropagation(); _state = STATE.NONE; document.removeEventListener( 'mousemove', mousemove ); document.removeEventListener( 'mouseup', mouseup ); _this.dispatchEvent( endEvent ); } function mousewheel( event ) { if ( _this.enabled === false ) return; event.preventDefault(); event.stopPropagation(); var delta = 0; if ( event.wheelDelta ) { // WebKit / Opera / Explorer 9 delta = event.wheelDelta / 40; } else if ( event.detail ) { // Firefox delta = - event.detail / 3; } _zoomStart.y += delta * 0.01; _this.dispatchEvent( startEvent ); _this.dispatchEvent( endEvent ); } function touchstart( event ) { if ( _this.enabled === false ) return; switch ( event.touches.length ) { case 1: _state = STATE.TOUCH_ROTATE; _rotateStart.copy( getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) ); _rotateEnd.copy( _rotateStart ); break; case 2: _state = STATE.TOUCH_ZOOM_PAN; var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; _touchZoomDistanceEnd = _touchZoomDistanceStart = Math.sqrt( dx * dx + dy * dy ); var x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2; var y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2; _panStart.copy( getMouseOnScreen( x, y ) ); _panEnd.copy( _panStart ); break; default: _state = STATE.NONE; } _this.dispatchEvent( startEvent ); } function touchmove( event ) { if ( _this.enabled === false ) return; event.preventDefault(); event.stopPropagation(); switch ( event.touches.length ) { case 1: _rotateEnd.copy( getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) ); break; case 2: var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; _touchZoomDistanceEnd = Math.sqrt( dx * dx + dy * dy ); var x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2; var y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2; _panEnd.copy( getMouseOnScreen( x, y ) ); break; default: _state = STATE.NONE; } } function touchend( event ) { if ( _this.enabled === false ) return; switch ( event.touches.length ) { case 1: _rotateEnd.copy( getMouseProjectionOnBall( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) ); _rotateStart.copy( _rotateEnd ); break; case 2: _touchZoomDistanceStart = _touchZoomDistanceEnd = 0; var x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2; var y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2; _panEnd.copy( getMouseOnScreen( x, y ) ); _panStart.copy( _panEnd ); break; } _state = STATE.NONE; _this.dispatchEvent( endEvent ); } this.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false ); this.domElement.addEventListener( 'mousedown', mousedown, false ); this.domElement.addEventListener( 'mousewheel', mousewheel, false ); this.domElement.addEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox this.domElement.addEventListener( 'touchstart', touchstart, false ); this.domElement.addEventListener( 'touchend', touchend, false ); this.domElement.addEventListener( 'touchmove', touchmove, false ); window.addEventListener( 'keydown', keydown, false ); window.addEventListener( 'keyup', keyup, false ); this.handleResize(); // force an update at start this.update(); }; THREE.TrackballControls.prototype = Object.create( THREE.EventDispatcher.prototype ); THREE.TrackballControls.prototype.constructor = THREE.TrackballControls;
ezhivitsa/tunnelRun
develop/js/lib/TrackballControls.js
JavaScript
mit
13,092
# frozen_string_literal: true module Cucumber module Formatter module LegacyApi # Adapters to pass to the legacy API formatters that provide the interface # of the old AST classes module Ast # Acts as a null object, or a base class class Node def initialize(node = nil) @node = node end def accept(formatter) end attr_reader :node private :node end # Null object for HeaderRow language. # ExampleTableRow#keyword is never called on them, # but this will pass silently if it happens anyway class NullLanguage def method_missing(*_args, &_block) self end def to_ary [''] end end class HookResultCollection def initialize @children = [] end def accept(formatter) @children.each { |child| child.accept(formatter) } end def send_output_to(formatter) @children.each { |child| child.send_output_to(formatter) } end def describe_exception_to(formatter) @children.each { |child| child.describe_exception_to(formatter) } end def <<(child) @children << child end end Comments = Struct.new(:comments) do def accept(formatter) return if comments.empty? formatter.before_comment comments comments.each do |comment| formatter.comment_line comment.to_s.strip end formatter.after_comment comments end end class HookResult def initialize(result, messages, embeddings) @result = result @messages = messages @embeddings = embeddings @already_accepted = false end def accept(formatter) unless @already_accepted send_output_to(formatter) describe_exception_to(formatter) end self end def send_output_to(formatter) return if @already_accepted @messages.each { |message| formatter.puts(message) } @embeddings.each { |embedding| embedding.send_to_formatter(formatter) } end def describe_exception_to(formatter) return if @already_accepted @result.describe_exception_to(formatter) @already_accepted = true end end StepInvocation = Struct.new(:step_match, :status, :duration, :exception, :indent, :background, :step, :messages, :embeddings) do extend Forwardable def_delegators :step, :keyword, :name, :multiline_arg, :location def accept(formatter) formatter.before_step(self) Ast::Comments.new(step.comments).accept(formatter) messages.each { |message| formatter.puts(message) } embeddings.each { |embedding| embedding.send_to_formatter(formatter) } formatter.before_step_result *step_result_attributes print_step_name(formatter) Ast::MultilineArg.for(multiline_arg).accept(formatter) print_exception(formatter) formatter.after_step_result *step_result_attributes formatter.after_step(self) end def step_result_attributes legacy_multiline_arg = if multiline_arg.kind_of?(Core::Ast::EmptyMultilineArgument) nil else step.multiline_arg end [keyword, step_match, legacy_multiline_arg, status, exception, source_indent, background, file_colon_line] end def failed? status != :passed end def passed? status == :passed end def dom_id end def actual_keyword(previous_step_keyword = nil) step.actual_keyword(previous_step_keyword) end def file_colon_line location.to_s end def backtrace_line step_match.backtrace_line end def step_invocation self end private def source_indent indent.of(self) end def print_step_name(formatter) formatter.step_name( keyword, step_match, status, source_indent, background, location.to_s) end def print_exception(formatter) return unless exception raise exception if ENV['FAIL_FAST'] formatter.exception(exception, status) end end class StepInvocations < Array def failed? any?(&:failed?) end def passed? all?(&:passed?) end def status return :passed if passed? failed_step.status end def exception failed_step.exception if failed_step end private def failed_step detect(&:failed?) end end class DataTableRow def initialize(row, line) @values = row @line = line end def dom_id "row_#{line}" end def accept(formatter) formatter.before_table_row(self) values.each do |value| formatter.before_table_cell(value) formatter.table_cell_value(value, status) formatter.after_table_cell(value) end formatter.after_table_row(self) end def status :skipped end def exception nil end attr_reader :values, :line private :values, :line end ExampleTableRow = Struct.new(:exception, :status, :cells, :location, :language) do def name '| ' + cells.join(' | ') + ' |' end def failed? status == :failed end def line location.line end def keyword # This method is only called when used for the scenario name line with # the expand option, and on that line the keyword is "Scenario" language.scenario_keywords[0] end end class LegacyTableRow < DataTableRow def accept(formatter) formatter.before_table_row(self) values.each do |value| formatter.before_table_cell(value.value) formatter.table_cell_value(value.value, value.status) formatter.after_table_cell(value.value) end formatter.after_table_row(self) end end Tags = Struct.new(:tags) do def accept(formatter) formatter.before_tags tags tags.each do |tag| formatter.tag_name tag.name end formatter.after_tags tags end end Scenario = Struct.new(:status, :name, :location) do def backtrace_line(step_name = "#{name}", line = self.location.line) "#{location.on_line(line)}:in `#{step_name}'" end def failed? :failed == status end def line location.line end end ScenarioOutline = Struct.new(:status, :name, :location) do def backtrace_line(step_name = "#{name}", line = self.location.line) "#{location.on_line(line)}:in `#{step_name}'" end def failed? :failed == status end def line location.line end end module MultilineArg class << self def for(node) Builder.new(node).result end end class Builder def initialize(node) node.describe_to(self) end def doc_string(node) @result = DocString.new(node) end def data_table(node) @result = DataTable.new(node) end def legacy_table(node) @result = LegacyTable.new(node) end def result @result || Node.new(nil) end end class DocString < Node def accept(formatter) formatter.before_multiline_arg node formatter.doc_string(node) formatter.after_multiline_arg node end end class DataTable < Cucumber::MultilineArgument::DataTable def node @ast_table end def accept(formatter) formatter.before_multiline_arg self node.raw.each_with_index do |row, index| line = node.location.line + index DataTableRow.new(row, line).accept(formatter) end formatter.after_multiline_arg self end end end class LegacyTable < SimpleDelegator def accept(formatter) formatter.before_multiline_arg self cells_rows.each_with_index do |row, index| line = location.line + index LegacyTableRow.new(row, line).accept(formatter) end formatter.after_multiline_arg self end end Features = Struct.new(:duration) class Background < SimpleDelegator def initialize(feature, node) super node @feature = feature end def feature @feature end end end end end end
phoebeclarke/cucumber-ruby
lib/cucumber/formatter/legacy_api/ast.rb
Ruby
mit
10,387
// // AppDelegate.m // iosDojo // // Created by Jรฉferson Machado on 25/05/14. // Copyright (c) 2014 Jรฉferson Machado. All rights reserved. // #import "AppDelegate.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } - (void)applicationDidEnterBackground:(UIApplication *)application { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - (void)applicationWillEnterForeground:(UIApplication *)application { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } - (void)applicationDidBecomeActive:(UIApplication *)application { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } - (void)applicationWillTerminate:(UIApplication *)application { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } @end
jefersonm/sandbox
coding-dojo/dojo3/ios_project/iosDojo/AppDelegate.m
Matlab
mit
2,189
<?php require 'flight/Flight.php'; require_once 'functions.php'; if (isset($_COOKIE["ID"]) && !isset($_SESSION["ID"])) { $_SESSION["ID"]=$_COOKIE["ID"]; $_SESSION["NOME"]=$_COOKIE["NOME"]; $_SESSION["COGNOME"]=$_COOKIE["COGNOME"]; $_SESSION["EMAIL"]=$_COOKIE["EMAIL"]; } Flight::route('GET /', function(){ if (logged()) { Flight::render('dashboard'); } else { Flight::render('home'); } exit(); }); Flight::route('GET /explore', function(){ Flight::render('explore'); exit(); }); Flight::route('GET /explore/collections', function(){ Flight::render('explore'); exit(); }); Flight::route('GET /explore/category(/subcategory)', function(){ Flight::render('explore'); exit(); }); Flight::route('GET /register(/@message)', function($message){ if (logged()) { Flight::redirect('/account'); } else { Flight::render('register', array('message' => $message)); } exit(); }); Flight::route('GET /login(/@message)', function($message){ if (logged()) { Flight::redirect('/account'); } else { Flight::render('login', array('message' => $message)); } exit(); }); Flight::route('GET /account(/@message)', function($message){ if (logged()) { Flight::render('account', array('message' => $message)); } else { Flight::redirect('/login'); } exit(); }); Flight::route('GET /create(/@message)', function($message){ if (logged()) { Flight::render('create'); } else { Flight::redirect('/login'); } exit(); }); Flight::route('GET /settings(/@message)', function($message){ if (logged()) { Flight::render('settings', array('message' => $message)); } else { Flight::redirect('/login'); } exit(); }); Flight::route('GET /search(/@message)', function($message){ Flight::render('search', array('message' => $message)); exit(); }); Flight::route('GET /project/@id(/thingview/@thingName)', function($id, $thingName){ if (isset($thingName)) { Flight::render('thingview', array('projectID' => $id, 'thingName' => $thingName)); } else { Flight::render('project', array('id' => $id)); } exit(); }); Flight::route('GET /collection/@id', function($id){ Flight::render('collection', array('id' => $id)); exit(); }); Flight::route('GET /user/@id(/@message)', function($id, $message){ $QUERY=executeQuery("select * FROM utenti where ID=".$id); $num = $QUERY->num_rows; if ($num!=0) { if (logged()) { if ($_SESSION["ID"]==$id) { if (isset($_REQUEST["fx"])) { Flight::redirect('/account?fx='.$_REQUEST["fx"]); } else { Flight::redirect('/account'); } } else { Flight::render('user', array('message' => $message, 'id' => $id)); } } else { Flight::render('user', array('message' => $message, 'id' => $id)); } } else { echo "NO USER IN DATABASE;"; } exit(); }); Flight::route('GET /activate', function() { if (isset($_REQUEST["hash"])) { $code=$_REQUEST["hash"]; if (logged()) { Flight::redirect('/account'); } else { $hash=rawurldecode($code); var2console($hash); $QUERY=executeQuery("select * from utenti where HASH='$hash'"); if ($QUERY && ($QUERY->num_rows > 0)) { $QUERY=executeQuery("update utenti SET ACCETTATO = '1' WHERE HASH = '$hash'"); if ($QUERY) { Flight::redirect('/login/Activated'); } } //Flight::redirect('/login/Activation Error'); } } else { Flight::redirect('/login/Invalid Link'); } exit(); }); //********************************************************************* //POST METHODS //********************************************************************* Flight::route('POST /login', function(){ $email = $_POST['email']; $pass = $_POST['password']; if (!isset($email) || !isset($pass)) { Flight::redirect('/login/Data missing'); exit(); } else { $ris=executeQuery("select HASH as HASHCODE from utenti where utenti.EMAIL='$email'"); $riga=$ris->fetch_assoc(); $hash=$riga['HASHCODE']; if (!password_verify($pass, $hash)) { Flight::redirect('/login/Input Error'); exit(); } $ris=executeQuery("select * from utenti where utenti.EMAIL='$email' AND utenti.HASH='$hash'"); if ($ris && ($ris->num_rows > 0)) { $riga=$ris->fetch_assoc(); if($riga['ACCETTATO']=="0"){ Flight::redirect('/login/Activate your account'); exit(); } $_SESSION["ID"]=$riga['ID']; $_SESSION["NOME"]=$riga['NOME']; $_SESSION["COGNOME"]=$riga['COGNOME']; $_SESSION["EMAIL"]=$riga['EMAIL']; if ((isset($_POST['remember'])) && ($_POST['remember']==true)) { setcookie("ID", $riga['ID'], time() + (86400 * 30), "/"); setcookie("NOME", $riga['NOME'], time() + (86400 * 30), "/"); setcookie("COGNOME", $riga['COGNOME'], time() + (86400 * 30), "/"); setcookie("EMAIL", $riga['EMAIL'], time() + (86400 * 30), "/"); echo "true"; } Flight::redirect('/'); exit(); } else { Flight::redirect('/login/Input error'); exit(); } } exit(); }); Flight::route('POST /create', function() { print_r($_POST); $title=$_POST['title']; $description=$_POST['description']; $subcategory=$_POST['subcategory']; $QUERY=executeQueryAndGetLastId("insert into progetti (DESCRIZIONE, FK_CATEGORIA_SECONDARIA, FK_UTENTE, NOME) VALUES ('$description', $subcategory, $_SESSION[ID], '$title')"); $lastId=$QUERY['id']; $projectPath = "users/".$_SESSION["NOME"]."-".$_SESSION["COGNOME"]."-".$_SESSION["EMAIL"]."/"."Project/"; if (!file_exists($projectPath)) { mkdir($projectPath, 0777, true); copy('img/bg1.jpg', $projectPath."projectWallpaper.jpg"); } $files = array_slice(scandir($projectPath), 2); foreach ($files as $file) { $QUERY=executeQuery("insert into parti_3d (FK_PROGETTO, NOME) VALUES ('$lastId','$file')"); } if (isset($_POST['tags'])) { $tags=$_POST['tags']; foreach ($tags as $tag) { $QUERY=executeQuery("insert ignore into tag (NOME) VALUES ('$tag')"); } foreach ($tags as $tag) { $QUERY=executeQuery("select * from tag where NOME='$tag'"); if ($QUERY && ($QUERY->num_rows > 0)) { $riga=$QUERY->fetch_assoc(); $fkTag = $riga['ID']; $QUERY=executeQuery("select * from progetti_hanno_tag where FK_PROGETTO=$lastId and FK_TAG=$fkTag"); if ($QUERY->num_rows == 0) { $QUERY=executeQuery("insert into progetti_hanno_tag (FK_PROGETTO, FK_TAG) VALUES ('$lastId', '$fkTag')"); } } } } imageUpload($projectPath."projectWallpaper.jpg"); rename ($projectPath,"users/".$_SESSION["NOME"]."-".$_SESSION["COGNOME"]."-".$_SESSION["EMAIL"]."/".$lastId."/"); Flight::redirect("/project/$lastId"); exit(); }); Flight::route('POST /register', function() { $name = $_POST['first-name']; $surname = $_POST['last-name']; $email = $_POST['email']; $city = $_POST['city']; $password = $_POST['password']; if (!isset($name) || !isset($surname) || !isset($email) || !isset($city) || !isset($password)) { Flight::redirect("/register/Data missing"); exit(); } else { $hash = password_hash($password, PASSWORD_BCRYPT, array("cost" => 10)); if (!password_verify($password, $hash)) { Flight::redirect("/register/Error occured"); exit(); } $QUERY=executeQueryAndGetLastId("insert ignore into utenti (NOME, COGNOME, EMAIL, DESCRIZIONE, ACCETTATO, FK_COMUNE, HASH) VALUES ('$name', '$surname', '$email', NULL, 'FALSE', '$city', '$hash')"); if ($QUERY["id"]==0) { Flight::redirect("/register/Mail already exists"); exit(); } else { echo "New record created successfully. Last inserted ID is: " . $QUERY["id"]; if (!file_exists("users/".$name."-".$surname."-".$email)) { mkdir("users/".$name."-".$surname."-".$email, 0777, true); copy('img/default.jpg', "users/".$name."-".$surname."-".$email."/profile.jpg"); } //localMail($email, $name, $surname, $hash); altervistaMail($email, $name, $surname, $hash); imageUpload("users/".$name."-".$surname."-".$email."/profile.jpg"); Flight::redirect("/login/Activate your account"); exit(); } } exit(); }); Flight::route('POST /controlPassword', function() { $email=$_SESSION["EMAIL"]; $data=[]; $ris=executeQuery("select HASH as HASHCODE from utenti where utenti.EMAIL='$email'"); $riga=$ris->fetch_assoc(); $hash=$riga['HASHCODE']; $pass=$_POST["password"]; if (password_verify($pass, $hash)) { $data["status"]=true; //echo "OK"; } else { $data["status"]=false; } echo json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); //echo "OKOKOK"; exit(); }); Flight::route('POST /settings', function() { if (isset($_FILES["fileToUpload"])) { imageUpload("users/".$_SESSION["NOME"]."-".$_SESSION["COGNOME"]."-".$_SESSION["EMAIL"]."/profile.jpg"); } $data=requestData(); if ($data) { if (isset($_POST["description"])) { if ($data["DESCRIZIONE"]!=$_POST["description"]) { if(changeDescription($_POST["description"])) { echo "Description changed"; } } } if (isset($_POST["password"])) { $pass=$_POST["password"]; $hash=$data["HASH"]; if (strlen($_POST["password"])!=0) { if (!password_verify($pass, $hash)) { if (changePassword($_POST["password"])) { echo "Password changed"; } } } } exit(); } echo("Update Error"); exit(); }); Flight::route('POST /logout', function() { $_SESSION=array(); session_unset(); session_destroy(); setcookie("ID", "", time() - 3600); setcookie("NOME", "", time() - 3600); setcookie("COGNOME", "", time() - 3600); setcookie("EMAIL", "", time() - 3600); Flight::redirect("/login"); exit(); }); Flight::route('POST /uploadFile', function() { // A list of permitted file extensions $allowed = array('png', 'jpg', 'zip', 'stl', 'jpeg', 'pdf', 'txt', 'obj'); if(isset($_FILES['filesToUpload']) && $_FILES['filesToUpload']['error'] == 0){ $extension = pathinfo($_FILES['filesToUpload']['name'], PATHINFO_EXTENSION); if(!in_array(strtolower($extension), $allowed)){ echo 'Invalid Extension'; exit(); } $destinationPath = "users/".$_SESSION["NOME"]."-".$_SESSION["COGNOME"]."-".$_SESSION["EMAIL"]."/"."Project/"; if (!file_exists($destinationPath)) { mkdir($destinationPath, 0777, true); copy('img/bg1.jpg', $destinationPath."projectWallpaper.jpg"); } if (file_exists($destinationPath.$_FILES['filesToUpload']['name'])) { echo 'File Already Exists'; exit(); } if(move_uploaded_file($_FILES['filesToUpload']['tmp_name'], $destinationPath.$_FILES['filesToUpload']['name'])){ echo 'Uploaded'; exit(); } } echo 'Unknown Error'; exit(); }); Flight::route('POST /deleteFile', function() { $file = $_POST["name"]; $destinationPath = "users/".$_SESSION["NOME"]."-".$_SESSION["COGNOME"]."-".$_SESSION["EMAIL"]."/"."Project/".$file; if (!unlink($destinationPath)) { echo ("Error Deleting"); } else { echo ("Deleted"); } exit(); }); Flight::route('POST /deleteProjectFolder', function() { $destinationPath = "users/".$_SESSION["NOME"]."-".$_SESSION["COGNOME"]."-".$_SESSION["EMAIL"]."/"."Project/"; if (file_exists($destinationPath)) { deleteDir($destinationPath); } exit(); }); Flight::route('POST /createCollection', function() { $data=[]; $userID=$_POST["user_id"]; $projectID=$_POST["project_id"]; $description=$_POST["description"]; $title=$_POST["name"]; $collectionID = addCollection($title, $description); if ($collectionID) { sleep(1); $addProject=addProjectToCollection($projectID, $collectionID); if ($addProject) $data["message"] = $title." was created"; } $COLLECTION = executeQuery("select * from collezioni_composte_da_progetti where FK_PROGETTO=".$projectID); $QUERY=executeQuery("select * FROM collezioni where FK_UTENTE=".$_SESSION["ID"]); $data["myCollections"] = "$QUERY->num_rows"; $data["projectID"] = $projectID; $data["inCollection"] = "$COLLECTION->num_rows"; echo json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); exit(); }); Flight::route('POST /getCollections', function() { echo getCollections($_SESSION["ID"], $_POST["projectID"]); exit(); }); Flight::route('POST /addProjectToCollection', function() { $data=[]; $collectionID = $_POST["collectionID"]; $projectID = $_POST["projectID"]; if (inCollection($collectionID, $projectID)) { $QUERY = executeQuery("delete from collezioni_composte_da_progetti where FK_COLLEZIONE=".$collectionID." and FK_PROGETTO=".$projectID); $data["message"] = "Project was removed from selected collection"; } else { $QUERY = executeQuery ("insert into collezioni_composte_da_progetti (FK_COLLEZIONE, FK_PROGETTO) values ('$collectionID','$projectID')"); $data["message"] = "Project was added to selected collection"; } $COLLECTION = executeQuery("select * from collezioni_composte_da_progetti where FK_PROGETTO=".$projectID); $CollectionProjects = executeQuery("select DISTINCT COUNT(*) AS NUMERO FROM collezioni_composte_da_progetti, progetti, categorie_primarie, categorie_secondarie, utenti WHERE collezioni_composte_da_progetti.FK_PROGETTO=progetti.ID AND collezioni_composte_da_progetti.FK_COLLEZIONE=$collectionID AND categorie_secondarie.FK_CATEGORIA_PRIMARIA=categorie_primarie.ID AND utenti.ID=progetti.FK_UTENTE AND progetti.FK_CATEGORIA_SECONDARIA=categorie_secondarie.ID"); $data["projectID"] = $projectID; $data["inCollection"] = "$COLLECTION->num_rows"; $data["collectionProjectsNumber"] = $CollectionProjects->fetch_assoc()["NUMERO"]; echo json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); exit(); }); Flight::route('POST /follow', function() { $data=[]; $requestID=$_POST["id"]; $sessionID=$_SESSION["ID"]; $fx=$_POST["fx"]; if ($fx=="follow") { $QUERY=executeQuery("insert into utenti_seguono_utenti (FK_UTENTE, FK_UTENTE_SEGUITO) VALUES ($sessionID, $requestID)"); $data['message']="FOLLOW"; } else { $QUERY=executeQuery("delete from utenti_seguono_utenti where FK_UTENTE=$sessionID and FK_UTENTE_SEGUITO=$requestID"); $data['message']="UNFOLLOW"; } $QUERY=executeQuery("select * FROM utenti_seguono_utenti where FK_UTENTE=".$sessionID); $data['userFollowingNumber'] = "$QUERY->num_rows"; $QUERY=executeQuery("select * FROM utenti_seguono_utenti where FK_UTENTE_SEGUITO=".$sessionID); $data['userFollowersNumber'] = "$QUERY->num_rows"; $data['sessionID'] = $sessionID; $QUERY=executeQuery("select * FROM utenti_seguono_utenti where FK_UTENTE=".$requestID); $data['usersFollowingNumber'] = "$QUERY->num_rows"; $QUERY=executeQuery("select * FROM utenti_seguono_utenti where FK_UTENTE_SEGUITO=".$requestID); $data['usersFollowersNumber'] = "$QUERY->num_rows"; $data['requestID'] = "$requestID"; echo json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); exit(); }); Flight::route('POST /getSubcategory', function() { $idcategory=$_POST['idcategory']; echo "<option value='' disabled selected>Subcategory</option>"; $record = executeQuery("select * from categorie_secondarie where categorie_secondarie.FK_CATEGORIA_PRIMARIA=$idcategory"); while ($riga=$record->fetch_assoc()) { echo "<option value='" .$riga['ID'] ."'>".$riga['NOME'] ."</option>"; } exit(); }); Flight::route('POST /getProvince', function() { $idregione=$_POST['idregione']; echo "<option value='' disabled selected>Province</option>"; $record = executeQuery("select * from province where province.idregione=$idregione"); while ($riga=$record->fetch_assoc()) { echo "<option value='" .$riga['idprovincia'] ."'>".$riga['nomeprovincia'] ."</option>"; } exit(); }); Flight::route('POST /downloadFile', function() { $name=$_POST["name"]; $data=[]; $projectID=$_POST["projectID"]; $QUERY=executeQuery("update parti_3d set NUMERO_DOWNLOAD = (NUMERO_DOWNLOAD + 1) where FK_PROGETTO=$projectID and NOME='$name'"); $QUERY=executeQuery("select NUMERO_DOWNLOAD from parti_3d where FK_PROGETTO=$projectID and NOME='$name'"); $riga=$QUERY->fetch_assoc(); $data["downloads"]=$riga["NUMERO_DOWNLOAD"]; echo json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); exit(); }); Flight::route('POST /likeProject', function() { $data=[]; $projectID=$_POST["projectID"]; $userID=$_SESSION["ID"]; $QUERY=executeQuery("select * from utenti_like_progetti where FK_PROGETTO=$projectID and FK_UTENTE=$userID"); if ($QUERY->num_rows == 0) { $data["like"]=true; $QUERY=executeQuery("insert into utenti_like_progetti (FK_UTENTE, FK_PROGETTO) values ($userID, $projectID)"); } else { $data["like"]=false; $QUERY=executeQuery("delete from utenti_like_progetti where FK_PROGETTO=$projectID and FK_UTENTE=$userID"); } $QUERY=executeQuery("select * from utenti_like_progetti where FK_PROGETTO=$projectID"); $data["likes"]="$QUERY->num_rows"; $QUERY=executeQuery("select * from utenti_like_progetti where FK_UTENTE=$userID"); $data["userLikes"]="$QUERY->num_rows"; //var2console($data); //echo var_dump(json_encode($data)), json_last_error()); echo json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); exit(); }); Flight::route('POST /downloadProject', function() { $projectID=$_POST["projectID"]; $data=[]; $QUERY=executeQuery("update progetti set NUMERO_DOWNLOAD = (NUMERO_DOWNLOAD + 1) where ID=$projectID"); $QUERY=executeQuery("select NUMERO_DOWNLOAD from progetti where ID=$projectID"); $riga=$QUERY->fetch_assoc(); $data["downloads"]=$riga["NUMERO_DOWNLOAD"]; //var2console($data); echo json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); exit(); }); Flight::route('POST /getComune', function() { $idprovincia=$_POST['idprovincia']; echo "<option value='' disabled selected>City</option>"; $record = executeQuery("select * from comuni where comuni.idprovincia=$idprovincia"); while ($riga=$record->fetch_assoc()) { echo "<option value='" .$riga['id'] ."'>".$riga['nome'] ."</option>"; } exit(); }); Flight::route('POST /followCollection', function() { $data=[]; $collectionID=$_POST["collectionID"]; $userID=$_SESSION["ID"]; $QUERY=executeQuery("select * from utenti_seguono_collezioni where FK_COLLEZIONE=$collectionID and FK_UTENTE=$userID"); if ($QUERY->num_rows == 0) { $data["follow"]=true; $QUERY=executeQuery("insert into utenti_seguono_collezioni (FK_UTENTE, FK_COLLEZIONE) values ($userID, $collectionID)"); } else { $data["follow"]=false; $QUERY=executeQuery("delete from utenti_seguono_collezioni where FK_COLLEZIONE=$collectionID and FK_UTENTE=$userID"); } $QUERY=executeQuery("select * from utenti_seguono_collezioni where FK_UTENTE=$userID"); $data["userFollows"]="$QUERY->num_rows"; $QUERY=executeQuery("select * from utenti_seguono_collezioni where FK_COLLEZIONE=$collectionID"); $data["collectionFollowersNumber"]="$QUERY->num_rows"; echo json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP); exit(); }); Flight::start(); ?>
eugeniogrigoras/DDDPartsFinale
index.php
PHP
mit
23,294
/** @jsx React.DOM */ jest.dontMock('../LayerMixin'); jest.dontMock('../modules/Container'); jest.dontMock('../modules/ReactLayer'); describe('LayerMixin', function() { var LayerHolder; beforeEach(function() { var React = require('react'); var LayerMixin = require('../LayerMixin'); LayerHolder = React.createClass({ mixins: [LayerMixin], render: function() { return <div />; }, renderLayer: function() { return this.props.layer; } }); }); it('will mount to container default (document.body)', function() { var React = require('react'); var TestUtils = require('react/lib/ReactTestUtils'); var documentBodyContainer = require('../modules/documentBodyContainer'); var container = document.body; var layerHolder = TestUtils.renderIntoDocument( <LayerHolder layer={<div id="test1" />} /> ); expect(documentBodyContainer.addLayer).toBeCalled(); }); it('will mount to container DOM element', function() { var React = require('react'); var TestUtils = require('react/lib/ReactTestUtils'); var container = document.createElement('div'); var layerHolder = TestUtils.renderIntoDocument( <LayerHolder container={container} layer={<div id="test1" />} /> ); var layerElement = container.querySelector('#test1'); expect(layerElement).not.toBeNull(); expect(layerElement.parentNode.parentNode).toBe(container); }); it('will mount to react component', function() { var React = require('react'); var TestUtils = require('react/lib/ReactTestUtils'); var Holder = React.createClass({ render: function() { return ( <div> <LayerHolder container={this} layer={<div id="test1" />} /> </div> ); } }); var layerHolder = TestUtils.renderIntoDocument( <Holder /> ); var container = layerHolder.getDOMNode(); var layerElement = container.querySelector('#test1'); expect(layerElement).not.toBeNull(); expect(layerElement.parentNode.parentNode).toBe(container); }); it('will mount to Container', function() { var React = require('react'); var TestUtils = require('react/lib/ReactTestUtils'); var Container = require('../modules/Container'); var container = new Container(); container.addLayer = jest.genMockFn(); var layerHolder = TestUtils.renderIntoDocument( <LayerHolder container={container} layer={<div id="test1" />} /> ); expect(container.addLayer).toBeCalled(); }); it('will not mount to container with layer null', function() { var React = require('react'); var TestUtils = require('react/lib/ReactTestUtils'); var container = document.createElement('div'); var layerHolder = TestUtils.renderIntoDocument( <LayerHolder container={container} layer={null} /> ); expect(container.firstChild).toBeNull(); }); it('will unmount layer when not rendered', function() { var React = require('react'); var TestUtils = require('react/lib/ReactTestUtils'); var didMountSpy = jasmine.createSpy('didMount'); var willUnmountSpy = jasmine.createSpy('willUnmount'); var Layer = React.createClass({ render: function() { return <div />; }, componentDidMount: didMountSpy, componentWillUnmount: willUnmountSpy }); var container = document.createElement('div'); var holderContainer = document.createElement('div'); React.renderComponent( <LayerHolder container={container} layer={<Layer />} />, holderContainer ); expect(didMountSpy).toHaveBeenCalled(); expect(willUnmountSpy).not.toHaveBeenCalled(); React.renderComponent( <LayerHolder container={container} layer={null} />, holderContainer ); expect(willUnmountSpy).toHaveBeenCalled(); expect(container.firstChild).toBeNull(); }); it('will unmount layer when parent is unmounted', function() { var React = require('react'); var TestUtils = require('react/lib/ReactTestUtils'); var didMountSpy = jasmine.createSpy('didMount'); var willUnmountSpy = jasmine.createSpy('willUnmount'); var Layer = React.createClass({ render: function() { return <div />; }, componentDidMount: didMountSpy, componentWillUnmount: willUnmountSpy }); var container = document.createElement('div'); var holderContainer = document.createElement('div'); React.renderComponent( <LayerHolder container={container} layer={<Layer />} />, holderContainer ); expect(didMountSpy).toHaveBeenCalled(); expect(willUnmountSpy).not.toHaveBeenCalled(); React.unmountComponentAtNode(holderContainer); expect(willUnmountSpy).toHaveBeenCalled(); expect(container.firstChild).toBeNull(); }); it('will remount when container is changed', function() { var React = require('react'); var TestUtils = require('react/lib/ReactTestUtils'); var didMountSpy = jasmine.createSpy('didMount'); var willUnmountSpy = jasmine.createSpy('willUnmount'); var Layer = React.createClass({ render: function() { return <div />; }, componentDidMount: didMountSpy, componentWillUnmount: willUnmountSpy }); var container = document.createElement('div'); var holderContainer = document.createElement('div'); React.renderComponent( <LayerHolder container={container} layer={<Layer />} />, holderContainer ); expect(didMountSpy).toHaveBeenCalled(); expect(willUnmountSpy).not.toHaveBeenCalled(); var newContainer = document.createElement('div'); React.renderComponent( <LayerHolder container={newContainer} layer={<Layer />} />, holderContainer ); expect(willUnmountSpy).toHaveBeenCalled(); expect(didMountSpy.calls.length).toEqual(2); expect(container.firstChild).toBeNull(); expect(newContainer.firstChild).not.toBeNull(); }); describe('Errors', function() { it('will throw when render returns not a valid component or null', function() { var React = require('react'); var TestUtils = require('react/lib/ReactTestUtils'); function render(layer) { TestUtils.renderIntoDocument( <LayerHolder container={document.createElement('div')} layer={layer} /> ); } var errorMessage = ( 'LayerHolder.renderLayer(): A valid ReactComponent must be returned. You may have ' + 'returned undefined, an array or some other invalid object.' ); expect(render.bind(null, 'a string')).toThrow(errorMessage); expect(render.bind(null, undefined)).toThrow(errorMessage); expect(render.bind(null, {})).toThrow(errorMessage); expect(render.bind(null, [])).toThrow(errorMessage); expect(render.bind(null, null)).not.toThrow(); expect(render.bind(null, <div />)).not.toThrow(); }); it('will throw when layerRender is not defined', function() { var React = require('react'); var TestUtils = require('react/lib/ReactTestUtils'); var LayerMixin = require('../LayerMixin'); var BadLayerHolder = React.createClass({ mixins: [LayerMixin], render: function() { return <div />; } }); function render() { TestUtils.renderIntoDocument( <BadLayerHolder /> ); } var errorMessage = ( 'createClass(...): Class specification of BadLayerHolder using LayerMixin must ' + 'implement a `renderLayer` method.' ); expect(render).toThrow(errorMessage); }); }); });
pieterv/react-layers
__tests__/LayerMixin-test.js
JavaScript
mit
7,677
<?php //- $ranges=Array( "2315321344" => array("2315452415","US"), "2315452416" => array("2315583487","EU"), "2315583488" => array("2315649023","US"), "2315649024" => array("2315714559","EU"), "2315714560" => array("2315780095","AU"), "2315780096" => array("2315911167","US"), "2315911168" => array("2316042239","CA"), "2316042240" => array("2316173311","US"), "2316173312" => array("2316238847","SE"), "2316238848" => array("2316500991","US"), "2316500992" => array("2316566527","AU"), "2316566528" => array("2316632063","US"), "2316632064" => array("2316763135","EU"), "2316763136" => array("2316828671","US"), "2316828672" => array("2316959743","AU"), "2316959744" => array("2317221887","US"), "2317221888" => array("2317287423","JP"), "2317287424" => array("2317484031","US"), "2317484032" => array("2317549567","CA"), "2317549568" => array("2317615103","US"), "2317680640" => array("2317811711","EU"), "2317811712" => array("2317877247","US"), "2317877248" => array("2318008319","EU"), "2318008320" => array("2318139391","US"), "2318139392" => array("2318204927","AU"), "2318204928" => array("2318401535","US"), "2318401536" => array("2318467071","EU"), "2318467072" => array("2318598143","US"), "2318598144" => array("2318663679","CA"), "2318663680" => array("2319122431","US"), "2319187968" => array("2319319039","US"), "2319319040" => array("2319450111","EU"), "2319450112" => array("2319581183","US"), "2319581184" => array("2319646719","IT"), "2319646720" => array("2319843327","US"), "2319843328" => array("2319908863","EU"), "2319908864" => array("2319974399","AU"), "2319974400" => array("2320039935","US"), "2320039936" => array("2320105471","CA"), "2320105472" => array("2320171007","US"), "2320171008" => array("2320236543","NZ"), "2320236544" => array("2320302079","US"), "2320302080" => array("2320367615","AU"), "2320367616" => array("2320433151","US"), "2320433152" => array("2320564223","AU"), "2320564224" => array("2320629759","EU"), "2320629760" => array("2320695295","CA"), "2320695296" => array("2321416191","US"), "2321481728" => array("2321547263","US"), "2321547264" => array("2321612799","EU"), "2321678336" => array("2321743871","US"), "2321809408" => array("2321874943","EU"), "2321874944" => array("2321940479","JP"), "2321940480" => array("2322137087","EU"), "2322137088" => array("2322202623","US"), "2322202624" => array("2322268159","EU"), "2322268160" => array("2322333695","JP"), "2322333696" => array("2322923519","US"), "2323054592" => array("2323185663","CA"), "2323316736" => array("2323382271","US"), "2323382272" => array("2323447807","EU"), "2323447808" => array("2323644415","US"), "2323677184" => array("2323677695","US"), "2323709952" => array("2323775487","US"), "2323775488" => array("2323841023","AU"), "2323841024" => array("2323972095","EU"), "2323972096" => array("2324037631","US"), "2324037632" => array("2324103167","EU"), "2324103168" => array("2327379967","US"), "2327511040" => array("2327838719","EU"), "2327838720" => array("2327969791","US"), "2327969792" => array("2328035327","AU"), "2328035328" => array("2328100863","EU"), "2328100864" => array("2328231935","US"), "2328231936" => array("2328297471","GB"), "2328297472" => array("2328494079","EU"), "2328494080" => array("2328559615","US"), "2328559616" => array("2328625151","EU"), "2328690688" => array("2328821759","EU"), "2328821760" => array("2329083903","US"), "2329083904" => array("2329149439","NZ"), "2329149440" => array("2329280511","JP"), "2329280512" => array("2329346047","CA"), "2329346048" => array("2329477119","EU"), "2329477120" => array("2329542655","AU"), "2329542656" => array("2329608191","CA"), "2329673728" => array("2329739263","US"), "2329739264" => array("2330263551","EU"), "2330263552" => array("2330394623","US"), "2330394624" => array("2330591231","EU"), "2330591232" => array("2330656767","US"), "2330656768" => array("2330722303","NZ"), "2330722304" => array("2331181055","US"), "2331181056" => array("2331246591","JP"), "2331246592" => array("2331443199","EU"), "2331443200" => array("2331508735","US"), "2331508736" => array("2331770879","EU"), "2331770880" => array("2331836415","AU"), "2331836416" => array("2331901951","EU"), "2331901952" => array("2331967487","US"), ); ?>
mfscripts/YetiShare-File-Hosting-Script-Free
includes/ip_to_country/138.php
PHP
mit
4,230
package stray.util; /* * OpenSimplex Noise in Java. * by Kurt Spencer * * v1.1 (October 5, 2014) * - Added 2D and 4D implementations. * - Proper gradient sets for all dimensions, from a * dimensionally-generalizable scheme with an actual * rhyme and reason behind it. * - Removed default permutation array in favor of * default seed. * - Changed seed-based constructor to be independent * of any particular randomization library, so results * will be the same when ported to other languages. */ public class SimplexNoise { private static final double STRETCH_CONSTANT_2D = -0.211324865405187; //(1/Math.sqrt(2+1)-1)/2; private static final double SQUISH_CONSTANT_2D = 0.366025403784439; //(Math.sqrt(2+1)-1)/2; private static final double STRETCH_CONSTANT_3D = -1.0 / 6; //(1/Math.sqrt(3+1)-1)/3; private static final double SQUISH_CONSTANT_3D = 1.0 / 3; //(Math.sqrt(3+1)-1)/3; private static final double STRETCH_CONSTANT_4D = -0.138196601125011; //(1/Math.sqrt(4+1)-1)/4; private static final double SQUISH_CONSTANT_4D = 0.309016994374947; //(Math.sqrt(4+1)-1)/4; private static final double NORM_CONSTANT_2D = 47; private static final double NORM_CONSTANT_3D = 103; private static final double NORM_CONSTANT_4D = 30; private static final long DEFAULT_SEED = 0; private short[] perm; private short[] permGradIndex3D; public SimplexNoise() { this(DEFAULT_SEED); } public SimplexNoise(short[] perm) { this.perm = perm; permGradIndex3D = new short[256]; for (int i = 0; i < 256; i++) { //Since 3D has 24 gradients, simple bitmask won't work, so precompute modulo array. permGradIndex3D[i] = (short)((perm[i] % (gradients3D.length / 3)) * 3); } } //Initializes the class using a permutation array generated from a 64-bit seed. //Generates a proper permutation (i.e. doesn't merely perform N successive pair swaps on a base array) //Uses a simple 64-bit LCG. public SimplexNoise(long seed) { perm = new short[256]; permGradIndex3D = new short[256]; short[] source = new short[256]; for (short i = 0; i < 256; i++) source[i] = i; seed = seed * 6364136223846793005l + 1442695040888963407l; seed = seed * 6364136223846793005l + 1442695040888963407l; seed = seed * 6364136223846793005l + 1442695040888963407l; for (int i = 255; i >= 0; i--) { seed = seed * 6364136223846793005l + 1442695040888963407l; int r = (int)((seed + 31) % (i + 1)); if (r < 0) r += (i + 1); perm[i] = source[r]; permGradIndex3D[i] = (short)((perm[i] % (gradients3D.length / 3)) * 3); source[r] = source[i]; } } //2D OpenSimplex Noise. public double eval(double x, double y) { //Place input coordinates onto grid. double stretchOffset = (x + y) * STRETCH_CONSTANT_2D; double xs = x + stretchOffset; double ys = y + stretchOffset; //Floor to get grid coordinates of rhombus (stretched square) super-cell origin. int xsb = fastFloor(xs); int ysb = fastFloor(ys); //Skew out to get actual coordinates of rhombus origin. We'll need these later. double squishOffset = (xsb + ysb) * SQUISH_CONSTANT_2D; double xb = xsb + squishOffset; double yb = ysb + squishOffset; //Compute grid coordinates relative to rhombus origin. double xins = xs - xsb; double yins = ys - ysb; //Sum those together to get a value that determines which region we're in. double inSum = xins + yins; //Positions relative to origin point. double dx0 = x - xb; double dy0 = y - yb; //We'll be defining these inside the next block and using them afterwards. double dx_ext, dy_ext; int xsv_ext, ysv_ext; double value = 0; //Contribution (1,0) double dx1 = dx0 - 1 - SQUISH_CONSTANT_2D; double dy1 = dy0 - 0 - SQUISH_CONSTANT_2D; double attn1 = 2 - dx1 * dx1 - dy1 * dy1; if (attn1 > 0) { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, dx1, dy1); } //Contribution (0,1) double dx2 = dx0 - 0 - SQUISH_CONSTANT_2D; double dy2 = dy0 - 1 - SQUISH_CONSTANT_2D; double attn2 = 2 - dx2 * dx2 - dy2 * dy2; if (attn2 > 0) { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, dx2, dy2); } if (inSum <= 1) { //We're inside the triangle (2-Simplex) at (0,0) double zins = 1 - inSum; if (zins > xins || zins > yins) { //(0,0) is one of the closest two triangular vertices if (xins > yins) { xsv_ext = xsb + 1; ysv_ext = ysb - 1; dx_ext = dx0 - 1; dy_ext = dy0 + 1; } else { xsv_ext = xsb - 1; ysv_ext = ysb + 1; dx_ext = dx0 + 1; dy_ext = dy0 - 1; } } else { //(1,0) and (0,1) are the closest two vertices. xsv_ext = xsb + 1; ysv_ext = ysb + 1; dx_ext = dx0 - 1 - 2 * SQUISH_CONSTANT_2D; dy_ext = dy0 - 1 - 2 * SQUISH_CONSTANT_2D; } } else { //We're inside the triangle (2-Simplex) at (1,1) double zins = 2 - inSum; if (zins < xins || zins < yins) { //(0,0) is one of the closest two triangular vertices if (xins > yins) { xsv_ext = xsb + 2; ysv_ext = ysb + 0; dx_ext = dx0 - 2 - 2 * SQUISH_CONSTANT_2D; dy_ext = dy0 + 0 - 2 * SQUISH_CONSTANT_2D; } else { xsv_ext = xsb + 0; ysv_ext = ysb + 2; dx_ext = dx0 + 0 - 2 * SQUISH_CONSTANT_2D; dy_ext = dy0 - 2 - 2 * SQUISH_CONSTANT_2D; } } else { //(1,0) and (0,1) are the closest two vertices. dx_ext = dx0; dy_ext = dy0; xsv_ext = xsb; ysv_ext = ysb; } xsb += 1; ysb += 1; dx0 = dx0 - 1 - 2 * SQUISH_CONSTANT_2D; dy0 = dy0 - 1 - 2 * SQUISH_CONSTANT_2D; } //Contribution (0,0) or (1,1) double attn0 = 2 - dx0 * dx0 - dy0 * dy0; if (attn0 > 0) { attn0 *= attn0; value += attn0 * attn0 * extrapolate(xsb, ysb, dx0, dy0); } //Extra Vertex double attn_ext = 2 - dx_ext * dx_ext - dy_ext * dy_ext; if (attn_ext > 0) { attn_ext *= attn_ext; value += attn_ext * attn_ext * extrapolate(xsv_ext, ysv_ext, dx_ext, dy_ext); } return value / NORM_CONSTANT_2D; } //3D OpenSimplex Noise. public double eval(double x, double y, double z) { //Place input coordinates on simplectic honeycomb. double stretchOffset = (x + y + z) * STRETCH_CONSTANT_3D; double xs = x + stretchOffset; double ys = y + stretchOffset; double zs = z + stretchOffset; //Floor to get simplectic honeycomb coordinates of rhombohedron (stretched cube) super-cell origin. int xsb = fastFloor(xs); int ysb = fastFloor(ys); int zsb = fastFloor(zs); //Skew out to get actual coordinates of rhombohedron origin. We'll need these later. double squishOffset = (xsb + ysb + zsb) * SQUISH_CONSTANT_3D; double xb = xsb + squishOffset; double yb = ysb + squishOffset; double zb = zsb + squishOffset; //Compute simplectic honeycomb coordinates relative to rhombohedral origin. double xins = xs - xsb; double yins = ys - ysb; double zins = zs - zsb; //Sum those together to get a value that determines which region we're in. double inSum = xins + yins + zins; //Positions relative to origin point. double dx0 = x - xb; double dy0 = y - yb; double dz0 = z - zb; //We'll be defining these inside the next block and using them afterwards. double dx_ext0, dy_ext0, dz_ext0; double dx_ext1, dy_ext1, dz_ext1; int xsv_ext0, ysv_ext0, zsv_ext0; int xsv_ext1, ysv_ext1, zsv_ext1; double value = 0; if (inSum <= 1) { //We're inside the tetrahedron (3-Simplex) at (0,0,0) //Determine which two of (0,0,1), (0,1,0), (1,0,0) are closest. byte aPoint = 0x01; double aScore = xins; byte bPoint = 0x02; double bScore = yins; if (aScore >= bScore && zins > bScore) { bScore = zins; bPoint = 0x04; } else if (aScore < bScore && zins > aScore) { aScore = zins; aPoint = 0x04; } //Now we determine the two lattice points not part of the tetrahedron that may contribute. //This depends on the closest two tetrahedral vertices, including (0,0,0) double wins = 1 - inSum; if (wins > aScore || wins > bScore) { //(0,0,0) is one of the closest two tetrahedral vertices. byte c = (bScore > aScore ? bPoint : aPoint); //Our other closest vertex is the closest out of a and b. if ((c & 0x01) == 0) { xsv_ext0 = xsb - 1; xsv_ext1 = xsb; dx_ext0 = dx0 + 1; dx_ext1 = dx0; } else { xsv_ext0 = xsv_ext1 = xsb + 1; dx_ext0 = dx_ext1 = dx0 - 1; } if ((c & 0x02) == 0) { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0; if ((c & 0x01) == 0) { ysv_ext1 -= 1; dy_ext1 += 1; } else { ysv_ext0 -= 1; dy_ext0 += 1; } } else { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1; } if ((c & 0x04) == 0) { zsv_ext0 = zsb; zsv_ext1 = zsb - 1; dz_ext0 = dz0; dz_ext1 = dz0 + 1; } else { zsv_ext0 = zsv_ext1 = zsb + 1; dz_ext0 = dz_ext1 = dz0 - 1; } } else { //(0,0,0) is not one of the closest two tetrahedral vertices. byte c = (byte)(aPoint | bPoint); //Our two extra vertices are determined by the closest two. if ((c & 0x01) == 0) { xsv_ext0 = xsb; xsv_ext1 = xsb - 1; dx_ext0 = dx0 - 2 * SQUISH_CONSTANT_3D; dx_ext1 = dx0 + 1 - SQUISH_CONSTANT_3D; } else { xsv_ext0 = xsv_ext1 = xsb + 1; dx_ext0 = dx0 - 1 - 2 * SQUISH_CONSTANT_3D; dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_3D; } if ((c & 0x02) == 0) { ysv_ext0 = ysb; ysv_ext1 = ysb - 1; dy_ext0 = dy0 - 2 * SQUISH_CONSTANT_3D; dy_ext1 = dy0 + 1 - SQUISH_CONSTANT_3D; } else { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy0 - 1 - 2 * SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_3D; } if ((c & 0x04) == 0) { zsv_ext0 = zsb; zsv_ext1 = zsb - 1; dz_ext0 = dz0 - 2 * SQUISH_CONSTANT_3D; dz_ext1 = dz0 + 1 - SQUISH_CONSTANT_3D; } else { zsv_ext0 = zsv_ext1 = zsb + 1; dz_ext0 = dz0 - 1 - 2 * SQUISH_CONSTANT_3D; dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_3D; } } //Contribution (0,0,0) double attn0 = 2 - dx0 * dx0 - dy0 * dy0 - dz0 * dz0; if (attn0 > 0) { attn0 *= attn0; value += attn0 * attn0 * extrapolate(xsb + 0, ysb + 0, zsb + 0, dx0, dy0, dz0); } //Contribution (1,0,0) double dx1 = dx0 - 1 - SQUISH_CONSTANT_3D; double dy1 = dy0 - 0 - SQUISH_CONSTANT_3D; double dz1 = dz0 - 0 - SQUISH_CONSTANT_3D; double attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1; if (attn1 > 0) { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, zsb + 0, dx1, dy1, dz1); } //Contribution (0,1,0) double dx2 = dx0 - 0 - SQUISH_CONSTANT_3D; double dy2 = dy0 - 1 - SQUISH_CONSTANT_3D; double dz2 = dz1; double attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2; if (attn2 > 0) { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, zsb + 0, dx2, dy2, dz2); } //Contribution (0,0,1) double dx3 = dx2; double dy3 = dy1; double dz3 = dz0 - 1 - SQUISH_CONSTANT_3D; double attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3; if (attn3 > 0) { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 0, ysb + 0, zsb + 1, dx3, dy3, dz3); } } else if (inSum >= 2) { //We're inside the tetrahedron (3-Simplex) at (1,1,1) //Determine which two tetrahedral vertices are the closest, out of (1,1,0), (1,0,1), (0,1,1) but not (1,1,1). byte aPoint = 0x06; double aScore = xins; byte bPoint = 0x05; double bScore = yins; if (aScore <= bScore && zins < bScore) { bScore = zins; bPoint = 0x03; } else if (aScore > bScore && zins < aScore) { aScore = zins; aPoint = 0x03; } //Now we determine the two lattice points not part of the tetrahedron that may contribute. //This depends on the closest two tetrahedral vertices, including (1,1,1) double wins = 3 - inSum; if (wins < aScore || wins < bScore) { //(1,1,1) is one of the closest two tetrahedral vertices. byte c = (bScore < aScore ? bPoint : aPoint); //Our other closest vertex is the closest out of a and b. if ((c & 0x01) != 0) { xsv_ext0 = xsb + 2; xsv_ext1 = xsb + 1; dx_ext0 = dx0 - 2 - 3 * SQUISH_CONSTANT_3D; dx_ext1 = dx0 - 1 - 3 * SQUISH_CONSTANT_3D; } else { xsv_ext0 = xsv_ext1 = xsb; dx_ext0 = dx_ext1 = dx0 - 3 * SQUISH_CONSTANT_3D; } if ((c & 0x02) != 0) { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1 - 3 * SQUISH_CONSTANT_3D; if ((c & 0x01) != 0) { ysv_ext1 += 1; dy_ext1 -= 1; } else { ysv_ext0 += 1; dy_ext0 -= 1; } } else { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0 - 3 * SQUISH_CONSTANT_3D; } if ((c & 0x04) != 0) { zsv_ext0 = zsb + 1; zsv_ext1 = zsb + 2; dz_ext0 = dz0 - 1 - 3 * SQUISH_CONSTANT_3D; dz_ext1 = dz0 - 2 - 3 * SQUISH_CONSTANT_3D; } else { zsv_ext0 = zsv_ext1 = zsb; dz_ext0 = dz_ext1 = dz0 - 3 * SQUISH_CONSTANT_3D; } } else { //(1,1,1) is not one of the closest two tetrahedral vertices. byte c = (byte)(aPoint & bPoint); //Our two extra vertices are determined by the closest two. if ((c & 0x01) != 0) { xsv_ext0 = xsb + 1; xsv_ext1 = xsb + 2; dx_ext0 = dx0 - 1 - SQUISH_CONSTANT_3D; dx_ext1 = dx0 - 2 - 2 * SQUISH_CONSTANT_3D; } else { xsv_ext0 = xsv_ext1 = xsb; dx_ext0 = dx0 - SQUISH_CONSTANT_3D; dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_3D; } if ((c & 0x02) != 0) { ysv_ext0 = ysb + 1; ysv_ext1 = ysb + 2; dy_ext0 = dy0 - 1 - SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 2 - 2 * SQUISH_CONSTANT_3D; } else { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy0 - SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_3D; } if ((c & 0x04) != 0) { zsv_ext0 = zsb + 1; zsv_ext1 = zsb + 2; dz_ext0 = dz0 - 1 - SQUISH_CONSTANT_3D; dz_ext1 = dz0 - 2 - 2 * SQUISH_CONSTANT_3D; } else { zsv_ext0 = zsv_ext1 = zsb; dz_ext0 = dz0 - SQUISH_CONSTANT_3D; dz_ext1 = dz0 - 2 * SQUISH_CONSTANT_3D; } } //Contribution (1,1,0) double dx3 = dx0 - 1 - 2 * SQUISH_CONSTANT_3D; double dy3 = dy0 - 1 - 2 * SQUISH_CONSTANT_3D; double dz3 = dz0 - 0 - 2 * SQUISH_CONSTANT_3D; double attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3; if (attn3 > 0) { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 1, ysb + 1, zsb + 0, dx3, dy3, dz3); } //Contribution (1,0,1) double dx2 = dx3; double dy2 = dy0 - 0 - 2 * SQUISH_CONSTANT_3D; double dz2 = dz0 - 1 - 2 * SQUISH_CONSTANT_3D; double attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2; if (attn2 > 0) { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 1, ysb + 0, zsb + 1, dx2, dy2, dz2); } //Contribution (0,1,1) double dx1 = dx0 - 0 - 2 * SQUISH_CONSTANT_3D; double dy1 = dy3; double dz1 = dz2; double attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1; if (attn1 > 0) { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 0, ysb + 1, zsb + 1, dx1, dy1, dz1); } //Contribution (1,1,1) dx0 = dx0 - 1 - 3 * SQUISH_CONSTANT_3D; dy0 = dy0 - 1 - 3 * SQUISH_CONSTANT_3D; dz0 = dz0 - 1 - 3 * SQUISH_CONSTANT_3D; double attn0 = 2 - dx0 * dx0 - dy0 * dy0 - dz0 * dz0; if (attn0 > 0) { attn0 *= attn0; value += attn0 * attn0 * extrapolate(xsb + 1, ysb + 1, zsb + 1, dx0, dy0, dz0); } } else { //We're inside the octahedron (Rectified 3-Simplex) in between. double aScore; byte aPoint; boolean aIsFurtherSide; double bScore; byte bPoint; boolean bIsFurtherSide; //Decide between point (0,0,1) and (1,1,0) as closest double p1 = xins + yins; if (p1 > 1) { aScore = p1 - 1; aPoint = 0x03; aIsFurtherSide = true; } else { aScore = 1 - p1; aPoint = 0x04; aIsFurtherSide = false; } //Decide between point (0,1,0) and (1,0,1) as closest double p2 = xins + zins; if (p2 > 1) { bScore = p2 - 1; bPoint = 0x05; bIsFurtherSide = true; } else { bScore = 1 - p2; bPoint = 0x02; bIsFurtherSide = false; } //The closest out of the two (1,0,0) and (0,1,1) will replace the furthest out of the two decided above, if closer. double p3 = yins + zins; if (p3 > 1) { double score = p3 - 1; if (aScore <= bScore && aScore < score) { aScore = score; aPoint = 0x06; aIsFurtherSide = true; } else if (aScore > bScore && bScore < score) { bScore = score; bPoint = 0x06; bIsFurtherSide = true; } } else { double score = 1 - p3; if (aScore <= bScore && aScore < score) { aScore = score; aPoint = 0x01; aIsFurtherSide = false; } else if (aScore > bScore && bScore < score) { bScore = score; bPoint = 0x01; bIsFurtherSide = false; } } //Where each of the two closest points are determines how the extra two vertices are calculated. if (aIsFurtherSide == bIsFurtherSide) { if (aIsFurtherSide) { //Both closest points on (1,1,1) side //One of the two extra points is (1,1,1) dx_ext0 = dx0 - 1 - 3 * SQUISH_CONSTANT_3D; dy_ext0 = dy0 - 1 - 3 * SQUISH_CONSTANT_3D; dz_ext0 = dz0 - 1 - 3 * SQUISH_CONSTANT_3D; xsv_ext0 = xsb + 1; ysv_ext0 = ysb + 1; zsv_ext0 = zsb + 1; //Other extra point is based on the shared axis. byte c = (byte)(aPoint & bPoint); if ((c & 0x01) != 0) { dx_ext1 = dx0 - 2 - 2 * SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_3D; dz_ext1 = dz0 - 2 * SQUISH_CONSTANT_3D; xsv_ext1 = xsb + 2; ysv_ext1 = ysb; zsv_ext1 = zsb; } else if ((c & 0x02) != 0) { dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 2 - 2 * SQUISH_CONSTANT_3D; dz_ext1 = dz0 - 2 * SQUISH_CONSTANT_3D; xsv_ext1 = xsb; ysv_ext1 = ysb + 2; zsv_ext1 = zsb; } else { dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_3D; dz_ext1 = dz0 - 2 - 2 * SQUISH_CONSTANT_3D; xsv_ext1 = xsb; ysv_ext1 = ysb; zsv_ext1 = zsb + 2; } } else {//Both closest points on (0,0,0) side //One of the two extra points is (0,0,0) dx_ext0 = dx0; dy_ext0 = dy0; dz_ext0 = dz0; xsv_ext0 = xsb; ysv_ext0 = ysb; zsv_ext0 = zsb; //Other extra point is based on the omitted axis. byte c = (byte)(aPoint | bPoint); if ((c & 0x01) == 0) { dx_ext1 = dx0 + 1 - SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_3D; dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_3D; xsv_ext1 = xsb - 1; ysv_ext1 = ysb + 1; zsv_ext1 = zsb + 1; } else if ((c & 0x02) == 0) { dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_3D; dy_ext1 = dy0 + 1 - SQUISH_CONSTANT_3D; dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_3D; xsv_ext1 = xsb + 1; ysv_ext1 = ysb - 1; zsv_ext1 = zsb + 1; } else { dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_3D; dz_ext1 = dz0 + 1 - SQUISH_CONSTANT_3D; xsv_ext1 = xsb + 1; ysv_ext1 = ysb + 1; zsv_ext1 = zsb - 1; } } } else { //One point on (0,0,0) side, one point on (1,1,1) side byte c1, c2; if (aIsFurtherSide) { c1 = aPoint; c2 = bPoint; } else { c1 = bPoint; c2 = aPoint; } //One contribution is a permutation of (1,1,-1) if ((c1 & 0x01) == 0) { dx_ext0 = dx0 + 1 - SQUISH_CONSTANT_3D; dy_ext0 = dy0 - 1 - SQUISH_CONSTANT_3D; dz_ext0 = dz0 - 1 - SQUISH_CONSTANT_3D; xsv_ext0 = xsb - 1; ysv_ext0 = ysb + 1; zsv_ext0 = zsb + 1; } else if ((c1 & 0x02) == 0) { dx_ext0 = dx0 - 1 - SQUISH_CONSTANT_3D; dy_ext0 = dy0 + 1 - SQUISH_CONSTANT_3D; dz_ext0 = dz0 - 1 - SQUISH_CONSTANT_3D; xsv_ext0 = xsb + 1; ysv_ext0 = ysb - 1; zsv_ext0 = zsb + 1; } else { dx_ext0 = dx0 - 1 - SQUISH_CONSTANT_3D; dy_ext0 = dy0 - 1 - SQUISH_CONSTANT_3D; dz_ext0 = dz0 + 1 - SQUISH_CONSTANT_3D; xsv_ext0 = xsb + 1; ysv_ext0 = ysb + 1; zsv_ext0 = zsb - 1; } //One contribution is a permutation of (0,0,2) dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_3D; dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_3D; dz_ext1 = dz0 - 2 * SQUISH_CONSTANT_3D; xsv_ext1 = xsb; ysv_ext1 = ysb; zsv_ext1 = zsb; if ((c2 & 0x01) != 0) { dx_ext1 -= 2; xsv_ext1 += 2; } else if ((c2 & 0x02) != 0) { dy_ext1 -= 2; ysv_ext1 += 2; } else { dz_ext1 -= 2; zsv_ext1 += 2; } } //Contribution (1,0,0) double dx1 = dx0 - 1 - SQUISH_CONSTANT_3D; double dy1 = dy0 - 0 - SQUISH_CONSTANT_3D; double dz1 = dz0 - 0 - SQUISH_CONSTANT_3D; double attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1; if (attn1 > 0) { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, zsb + 0, dx1, dy1, dz1); } //Contribution (0,1,0) double dx2 = dx0 - 0 - SQUISH_CONSTANT_3D; double dy2 = dy0 - 1 - SQUISH_CONSTANT_3D; double dz2 = dz1; double attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2; if (attn2 > 0) { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, zsb + 0, dx2, dy2, dz2); } //Contribution (0,0,1) double dx3 = dx2; double dy3 = dy1; double dz3 = dz0 - 1 - SQUISH_CONSTANT_3D; double attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3; if (attn3 > 0) { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 0, ysb + 0, zsb + 1, dx3, dy3, dz3); } //Contribution (1,1,0) double dx4 = dx0 - 1 - 2 * SQUISH_CONSTANT_3D; double dy4 = dy0 - 1 - 2 * SQUISH_CONSTANT_3D; double dz4 = dz0 - 0 - 2 * SQUISH_CONSTANT_3D; double attn4 = 2 - dx4 * dx4 - dy4 * dy4 - dz4 * dz4; if (attn4 > 0) { attn4 *= attn4; value += attn4 * attn4 * extrapolate(xsb + 1, ysb + 1, zsb + 0, dx4, dy4, dz4); } //Contribution (1,0,1) double dx5 = dx4; double dy5 = dy0 - 0 - 2 * SQUISH_CONSTANT_3D; double dz5 = dz0 - 1 - 2 * SQUISH_CONSTANT_3D; double attn5 = 2 - dx5 * dx5 - dy5 * dy5 - dz5 * dz5; if (attn5 > 0) { attn5 *= attn5; value += attn5 * attn5 * extrapolate(xsb + 1, ysb + 0, zsb + 1, dx5, dy5, dz5); } //Contribution (0,1,1) double dx6 = dx0 - 0 - 2 * SQUISH_CONSTANT_3D; double dy6 = dy4; double dz6 = dz5; double attn6 = 2 - dx6 * dx6 - dy6 * dy6 - dz6 * dz6; if (attn6 > 0) { attn6 *= attn6; value += attn6 * attn6 * extrapolate(xsb + 0, ysb + 1, zsb + 1, dx6, dy6, dz6); } } //First extra vertex double attn_ext0 = 2 - dx_ext0 * dx_ext0 - dy_ext0 * dy_ext0 - dz_ext0 * dz_ext0; if (attn_ext0 > 0) { attn_ext0 *= attn_ext0; value += attn_ext0 * attn_ext0 * extrapolate(xsv_ext0, ysv_ext0, zsv_ext0, dx_ext0, dy_ext0, dz_ext0); } //Second extra vertex double attn_ext1 = 2 - dx_ext1 * dx_ext1 - dy_ext1 * dy_ext1 - dz_ext1 * dz_ext1; if (attn_ext1 > 0) { attn_ext1 *= attn_ext1; value += attn_ext1 * attn_ext1 * extrapolate(xsv_ext1, ysv_ext1, zsv_ext1, dx_ext1, dy_ext1, dz_ext1); } return value / NORM_CONSTANT_3D; } //4D OpenSimplex Noise. public double eval(double x, double y, double z, double w) { //Place input coordinates on simplectic honeycomb. double stretchOffset = (x + y + z + w) * STRETCH_CONSTANT_4D; double xs = x + stretchOffset; double ys = y + stretchOffset; double zs = z + stretchOffset; double ws = w + stretchOffset; //Floor to get simplectic honeycomb coordinates of rhombo-hypercube super-cell origin. int xsb = fastFloor(xs); int ysb = fastFloor(ys); int zsb = fastFloor(zs); int wsb = fastFloor(ws); //Skew out to get actual coordinates of stretched rhombo-hypercube origin. We'll need these later. double squishOffset = (xsb + ysb + zsb + wsb) * SQUISH_CONSTANT_4D; double xb = xsb + squishOffset; double yb = ysb + squishOffset; double zb = zsb + squishOffset; double wb = wsb + squishOffset; //Compute simplectic honeycomb coordinates relative to rhombo-hypercube origin. double xins = xs - xsb; double yins = ys - ysb; double zins = zs - zsb; double wins = ws - wsb; //Sum those together to get a value that determines which region we're in. double inSum = xins + yins + zins + wins; //Positions relative to origin point. double dx0 = x - xb; double dy0 = y - yb; double dz0 = z - zb; double dw0 = w - wb; //We'll be defining these inside the next block and using them afterwards. double dx_ext0, dy_ext0, dz_ext0, dw_ext0; double dx_ext1, dy_ext1, dz_ext1, dw_ext1; double dx_ext2, dy_ext2, dz_ext2, dw_ext2; int xsv_ext0, ysv_ext0, zsv_ext0, wsv_ext0; int xsv_ext1, ysv_ext1, zsv_ext1, wsv_ext1; int xsv_ext2, ysv_ext2, zsv_ext2, wsv_ext2; double value = 0; if (inSum <= 1) { //We're inside the pentachoron (4-Simplex) at (0,0,0,0) //Determine which two of (0,0,0,1), (0,0,1,0), (0,1,0,0), (1,0,0,0) are closest. byte aPoint = 0x01; double aScore = xins; byte bPoint = 0x02; double bScore = yins; if (aScore >= bScore && zins > bScore) { bScore = zins; bPoint = 0x04; } else if (aScore < bScore && zins > aScore) { aScore = zins; aPoint = 0x04; } if (aScore >= bScore && wins > bScore) { bScore = wins; bPoint = 0x08; } else if (aScore < bScore && wins > aScore) { aScore = wins; aPoint = 0x08; } //Now we determine the three lattice points not part of the pentachoron that may contribute. //This depends on the closest two pentachoron vertices, including (0,0,0,0) double uins = 1 - inSum; if (uins > aScore || uins > bScore) { //(0,0,0,0) is one of the closest two pentachoron vertices. byte c = (bScore > aScore ? bPoint : aPoint); //Our other closest vertex is the closest out of a and b. if ((c & 0x01) == 0) { xsv_ext0 = xsb - 1; xsv_ext1 = xsv_ext2 = xsb; dx_ext0 = dx0 + 1; dx_ext1 = dx_ext2 = dx0; } else { xsv_ext0 = xsv_ext1 = xsv_ext2 = xsb + 1; dx_ext0 = dx_ext1 = dx_ext2 = dx0 - 1; } if ((c & 0x02) == 0) { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb; dy_ext0 = dy_ext1 = dy_ext2 = dy0; if ((c & 0x01) == 0x01) { ysv_ext0 -= 1; dy_ext0 += 1; } else { ysv_ext1 -= 1; dy_ext1 += 1; } } else { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb + 1; dy_ext0 = dy_ext1 = dy_ext2 = dy0 - 1; } if ((c & 0x04) == 0) { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb; dz_ext0 = dz_ext1 = dz_ext2 = dz0; if ((c & 0x03) != 0) { if ((c & 0x03) == 0x03) { zsv_ext0 -= 1; dz_ext0 += 1; } else { zsv_ext1 -= 1; dz_ext1 += 1; } } else { zsv_ext2 -= 1; dz_ext2 += 1; } } else { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb + 1; dz_ext0 = dz_ext1 = dz_ext2 = dz0 - 1; } if ((c & 0x08) == 0) { wsv_ext0 = wsv_ext1 = wsb; wsv_ext2 = wsb - 1; dw_ext0 = dw_ext1 = dw0; dw_ext2 = dw0 + 1; } else { wsv_ext0 = wsv_ext1 = wsv_ext2 = wsb + 1; dw_ext0 = dw_ext1 = dw_ext2 = dw0 - 1; } } else { //(0,0,0,0) is not one of the closest two pentachoron vertices. byte c = (byte)(aPoint | bPoint); //Our three extra vertices are determined by the closest two. if ((c & 0x01) == 0) { xsv_ext0 = xsv_ext2 = xsb; xsv_ext1 = xsb - 1; dx_ext0 = dx0 - 2 * SQUISH_CONSTANT_4D; dx_ext1 = dx0 + 1 - SQUISH_CONSTANT_4D; dx_ext2 = dx0 - SQUISH_CONSTANT_4D; } else { xsv_ext0 = xsv_ext1 = xsv_ext2 = xsb + 1; dx_ext0 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; dx_ext1 = dx_ext2 = dx0 - 1 - SQUISH_CONSTANT_4D; } if ((c & 0x02) == 0) { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb; dy_ext0 = dy0 - 2 * SQUISH_CONSTANT_4D; dy_ext1 = dy_ext2 = dy0 - SQUISH_CONSTANT_4D; if ((c & 0x01) == 0x01) { ysv_ext1 -= 1; dy_ext1 += 1; } else { ysv_ext2 -= 1; dy_ext2 += 1; } } else { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb + 1; dy_ext0 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; dy_ext1 = dy_ext2 = dy0 - 1 - SQUISH_CONSTANT_4D; } if ((c & 0x04) == 0) { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb; dz_ext0 = dz0 - 2 * SQUISH_CONSTANT_4D; dz_ext1 = dz_ext2 = dz0 - SQUISH_CONSTANT_4D; if ((c & 0x03) == 0x03) { zsv_ext1 -= 1; dz_ext1 += 1; } else { zsv_ext2 -= 1; dz_ext2 += 1; } } else { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb + 1; dz_ext0 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; dz_ext1 = dz_ext2 = dz0 - 1 - SQUISH_CONSTANT_4D; } if ((c & 0x08) == 0) { wsv_ext0 = wsv_ext1 = wsb; wsv_ext2 = wsb - 1; dw_ext0 = dw0 - 2 * SQUISH_CONSTANT_4D; dw_ext1 = dw0 - SQUISH_CONSTANT_4D; dw_ext2 = dw0 + 1 - SQUISH_CONSTANT_4D; } else { wsv_ext0 = wsv_ext1 = wsv_ext2 = wsb + 1; dw_ext0 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; dw_ext1 = dw_ext2 = dw0 - 1 - SQUISH_CONSTANT_4D; } } //Contribution (0,0,0,0) double attn0 = 2 - dx0 * dx0 - dy0 * dy0 - dz0 * dz0 - dw0 * dw0; if (attn0 > 0) { attn0 *= attn0; value += attn0 * attn0 * extrapolate(xsb + 0, ysb + 0, zsb + 0, wsb + 0, dx0, dy0, dz0, dw0); } //Contribution (1,0,0,0) double dx1 = dx0 - 1 - SQUISH_CONSTANT_4D; double dy1 = dy0 - 0 - SQUISH_CONSTANT_4D; double dz1 = dz0 - 0 - SQUISH_CONSTANT_4D; double dw1 = dw0 - 0 - SQUISH_CONSTANT_4D; double attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1 - dw1 * dw1; if (attn1 > 0) { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, zsb + 0, wsb + 0, dx1, dy1, dz1, dw1); } //Contribution (0,1,0,0) double dx2 = dx0 - 0 - SQUISH_CONSTANT_4D; double dy2 = dy0 - 1 - SQUISH_CONSTANT_4D; double dz2 = dz1; double dw2 = dw1; double attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2 - dw2 * dw2; if (attn2 > 0) { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, zsb + 0, wsb + 0, dx2, dy2, dz2, dw2); } //Contribution (0,0,1,0) double dx3 = dx2; double dy3 = dy1; double dz3 = dz0 - 1 - SQUISH_CONSTANT_4D; double dw3 = dw1; double attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3 - dw3 * dw3; if (attn3 > 0) { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 0, ysb + 0, zsb + 1, wsb + 0, dx3, dy3, dz3, dw3); } //Contribution (0,0,0,1) double dx4 = dx2; double dy4 = dy1; double dz4 = dz1; double dw4 = dw0 - 1 - SQUISH_CONSTANT_4D; double attn4 = 2 - dx4 * dx4 - dy4 * dy4 - dz4 * dz4 - dw4 * dw4; if (attn4 > 0) { attn4 *= attn4; value += attn4 * attn4 * extrapolate(xsb + 0, ysb + 0, zsb + 0, wsb + 1, dx4, dy4, dz4, dw4); } } else if (inSum >= 3) { //We're inside the pentachoron (4-Simplex) at (1,1,1,1) //Determine which two of (1,1,1,0), (1,1,0,1), (1,0,1,1), (0,1,1,1) are closest. byte aPoint = 0x0E; double aScore = xins; byte bPoint = 0x0D; double bScore = yins; if (aScore <= bScore && zins < bScore) { bScore = zins; bPoint = 0x0B; } else if (aScore > bScore && zins < aScore) { aScore = zins; aPoint = 0x0B; } if (aScore <= bScore && wins < bScore) { bScore = wins; bPoint = 0x07; } else if (aScore > bScore && wins < aScore) { aScore = wins; aPoint = 0x07; } //Now we determine the three lattice points not part of the pentachoron that may contribute. //This depends on the closest two pentachoron vertices, including (0,0,0,0) double uins = 4 - inSum; if (uins < aScore || uins < bScore) { //(1,1,1,1) is one of the closest two pentachoron vertices. byte c = (bScore < aScore ? bPoint : aPoint); //Our other closest vertex is the closest out of a and b. if ((c & 0x01) != 0) { xsv_ext0 = xsb + 2; xsv_ext1 = xsv_ext2 = xsb + 1; dx_ext0 = dx0 - 2 - 4 * SQUISH_CONSTANT_4D; dx_ext1 = dx_ext2 = dx0 - 1 - 4 * SQUISH_CONSTANT_4D; } else { xsv_ext0 = xsv_ext1 = xsv_ext2 = xsb; dx_ext0 = dx_ext1 = dx_ext2 = dx0 - 4 * SQUISH_CONSTANT_4D; } if ((c & 0x02) != 0) { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb + 1; dy_ext0 = dy_ext1 = dy_ext2 = dy0 - 1 - 4 * SQUISH_CONSTANT_4D; if ((c & 0x01) != 0) { ysv_ext1 += 1; dy_ext1 -= 1; } else { ysv_ext0 += 1; dy_ext0 -= 1; } } else { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb; dy_ext0 = dy_ext1 = dy_ext2 = dy0 - 4 * SQUISH_CONSTANT_4D; } if ((c & 0x04) != 0) { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb + 1; dz_ext0 = dz_ext1 = dz_ext2 = dz0 - 1 - 4 * SQUISH_CONSTANT_4D; if ((c & 0x03) != 0x03) { if ((c & 0x03) == 0) { zsv_ext0 += 1; dz_ext0 -= 1; } else { zsv_ext1 += 1; dz_ext1 -= 1; } } else { zsv_ext2 += 1; dz_ext2 -= 1; } } else { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb; dz_ext0 = dz_ext1 = dz_ext2 = dz0 - 4 * SQUISH_CONSTANT_4D; } if ((c & 0x08) != 0) { wsv_ext0 = wsv_ext1 = wsb + 1; wsv_ext2 = wsb + 2; dw_ext0 = dw_ext1 = dw0 - 1 - 4 * SQUISH_CONSTANT_4D; dw_ext2 = dw0 - 2 - 4 * SQUISH_CONSTANT_4D; } else { wsv_ext0 = wsv_ext1 = wsv_ext2 = wsb; dw_ext0 = dw_ext1 = dw_ext2 = dw0 - 4 * SQUISH_CONSTANT_4D; } } else { //(1,1,1,1) is not one of the closest two pentachoron vertices. byte c = (byte)(aPoint & bPoint); //Our three extra vertices are determined by the closest two. if ((c & 0x01) != 0) { xsv_ext0 = xsv_ext2 = xsb + 1; xsv_ext1 = xsb + 2; dx_ext0 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; dx_ext1 = dx0 - 2 - 3 * SQUISH_CONSTANT_4D; dx_ext2 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D; } else { xsv_ext0 = xsv_ext1 = xsv_ext2 = xsb; dx_ext0 = dx0 - 2 * SQUISH_CONSTANT_4D; dx_ext1 = dx_ext2 = dx0 - 3 * SQUISH_CONSTANT_4D; } if ((c & 0x02) != 0) { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb + 1; dy_ext0 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; dy_ext1 = dy_ext2 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D; if ((c & 0x01) != 0) { ysv_ext2 += 1; dy_ext2 -= 1; } else { ysv_ext1 += 1; dy_ext1 -= 1; } } else { ysv_ext0 = ysv_ext1 = ysv_ext2 = ysb; dy_ext0 = dy0 - 2 * SQUISH_CONSTANT_4D; dy_ext1 = dy_ext2 = dy0 - 3 * SQUISH_CONSTANT_4D; } if ((c & 0x04) != 0) { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb + 1; dz_ext0 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; dz_ext1 = dz_ext2 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D; if ((c & 0x03) != 0) { zsv_ext2 += 1; dz_ext2 -= 1; } else { zsv_ext1 += 1; dz_ext1 -= 1; } } else { zsv_ext0 = zsv_ext1 = zsv_ext2 = zsb; dz_ext0 = dz0 - 2 * SQUISH_CONSTANT_4D; dz_ext1 = dz_ext2 = dz0 - 3 * SQUISH_CONSTANT_4D; } if ((c & 0x08) != 0) { wsv_ext0 = wsv_ext1 = wsb + 1; wsv_ext2 = wsb + 2; dw_ext0 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; dw_ext1 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D; dw_ext2 = dw0 - 2 - 3 * SQUISH_CONSTANT_4D; } else { wsv_ext0 = wsv_ext1 = wsv_ext2 = wsb; dw_ext0 = dw0 - 2 * SQUISH_CONSTANT_4D; dw_ext1 = dw_ext2 = dw0 - 3 * SQUISH_CONSTANT_4D; } } //Contribution (1,1,1,0) double dx4 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D; double dy4 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D; double dz4 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D; double dw4 = dw0 - 3 * SQUISH_CONSTANT_4D; double attn4 = 2 - dx4 * dx4 - dy4 * dy4 - dz4 * dz4 - dw4 * dw4; if (attn4 > 0) { attn4 *= attn4; value += attn4 * attn4 * extrapolate(xsb + 1, ysb + 1, zsb + 1, wsb + 0, dx4, dy4, dz4, dw4); } //Contribution (1,1,0,1) double dx3 = dx4; double dy3 = dy4; double dz3 = dz0 - 3 * SQUISH_CONSTANT_4D; double dw3 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D; double attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3 - dw3 * dw3; if (attn3 > 0) { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 1, ysb + 1, zsb + 0, wsb + 1, dx3, dy3, dz3, dw3); } //Contribution (1,0,1,1) double dx2 = dx4; double dy2 = dy0 - 3 * SQUISH_CONSTANT_4D; double dz2 = dz4; double dw2 = dw3; double attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2 - dw2 * dw2; if (attn2 > 0) { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 1, ysb + 0, zsb + 1, wsb + 1, dx2, dy2, dz2, dw2); } //Contribution (0,1,1,1) double dx1 = dx0 - 3 * SQUISH_CONSTANT_4D; double dz1 = dz4; double dy1 = dy4; double dw1 = dw3; double attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1 - dw1 * dw1; if (attn1 > 0) { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 0, ysb + 1, zsb + 1, wsb + 1, dx1, dy1, dz1, dw1); } //Contribution (1,1,1,1) dx0 = dx0 - 1 - 4 * SQUISH_CONSTANT_4D; dy0 = dy0 - 1 - 4 * SQUISH_CONSTANT_4D; dz0 = dz0 - 1 - 4 * SQUISH_CONSTANT_4D; dw0 = dw0 - 1 - 4 * SQUISH_CONSTANT_4D; double attn0 = 2 - dx0 * dx0 - dy0 * dy0 - dz0 * dz0 - dw0 * dw0; if (attn0 > 0) { attn0 *= attn0; value += attn0 * attn0 * extrapolate(xsb + 1, ysb + 1, zsb + 1, wsb + 1, dx0, dy0, dz0, dw0); } } else if (inSum <= 2) { //We're inside the first dispentachoron (Rectified 4-Simplex) double aScore; byte aPoint; boolean aIsBiggerSide = true; double bScore; byte bPoint; boolean bIsBiggerSide = true; //Decide between (1,1,0,0) and (0,0,1,1) if (xins + yins > zins + wins) { aScore = xins + yins; aPoint = 0x03; } else { aScore = zins + wins; aPoint = 0x0C; } //Decide between (1,0,1,0) and (0,1,0,1) if (xins + zins > yins + wins) { bScore = xins + zins; bPoint = 0x05; } else { bScore = yins + wins; bPoint = 0x0A; } //Closer between (1,0,0,1) and (0,1,1,0) will replace the further of a and b, if closer. if (xins + wins > yins + zins) { double score = xins + wins; if (aScore >= bScore && score > bScore) { bScore = score; bPoint = 0x09; } else if (aScore < bScore && score > aScore) { aScore = score; aPoint = 0x09; } } else { double score = yins + zins; if (aScore >= bScore && score > bScore) { bScore = score; bPoint = 0x06; } else if (aScore < bScore && score > aScore) { aScore = score; aPoint = 0x06; } } //Decide if (1,0,0,0) is closer. double p1 = 2 - inSum + xins; if (aScore >= bScore && p1 > bScore) { bScore = p1; bPoint = 0x01; bIsBiggerSide = false; } else if (aScore < bScore && p1 > aScore) { aScore = p1; aPoint = 0x01; aIsBiggerSide = false; } //Decide if (0,1,0,0) is closer. double p2 = 2 - inSum + yins; if (aScore >= bScore && p2 > bScore) { bScore = p2; bPoint = 0x02; bIsBiggerSide = false; } else if (aScore < bScore && p2 > aScore) { aScore = p2; aPoint = 0x02; aIsBiggerSide = false; } //Decide if (0,0,1,0) is closer. double p3 = 2 - inSum + zins; if (aScore >= bScore && p3 > bScore) { bScore = p3; bPoint = 0x04; bIsBiggerSide = false; } else if (aScore < bScore && p3 > aScore) { aScore = p3; aPoint = 0x04; aIsBiggerSide = false; } //Decide if (0,0,0,1) is closer. double p4 = 2 - inSum + wins; if (aScore >= bScore && p4 > bScore) { bScore = p4; bPoint = 0x08; bIsBiggerSide = false; } else if (aScore < bScore && p4 > aScore) { aScore = p4; aPoint = 0x08; aIsBiggerSide = false; } //Where each of the two closest points are determines how the extra three vertices are calculated. if (aIsBiggerSide == bIsBiggerSide) { if (aIsBiggerSide) { //Both closest points on the bigger side byte c1 = (byte)(aPoint | bPoint); byte c2 = (byte)(aPoint & bPoint); if ((c1 & 0x01) == 0) { xsv_ext0 = xsb; xsv_ext1 = xsb - 1; dx_ext0 = dx0 - 3 * SQUISH_CONSTANT_4D; dx_ext1 = dx0 + 1 - 2 * SQUISH_CONSTANT_4D; } else { xsv_ext0 = xsv_ext1 = xsb + 1; dx_ext0 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D; dx_ext1 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; } if ((c1 & 0x02) == 0) { ysv_ext0 = ysb; ysv_ext1 = ysb - 1; dy_ext0 = dy0 - 3 * SQUISH_CONSTANT_4D; dy_ext1 = dy0 + 1 - 2 * SQUISH_CONSTANT_4D; } else { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D; dy_ext1 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; } if ((c1 & 0x04) == 0) { zsv_ext0 = zsb; zsv_ext1 = zsb - 1; dz_ext0 = dz0 - 3 * SQUISH_CONSTANT_4D; dz_ext1 = dz0 + 1 - 2 * SQUISH_CONSTANT_4D; } else { zsv_ext0 = zsv_ext1 = zsb + 1; dz_ext0 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D; dz_ext1 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; } if ((c1 & 0x08) == 0) { wsv_ext0 = wsb; wsv_ext1 = wsb - 1; dw_ext0 = dw0 - 3 * SQUISH_CONSTANT_4D; dw_ext1 = dw0 + 1 - 2 * SQUISH_CONSTANT_4D; } else { wsv_ext0 = wsv_ext1 = wsb + 1; dw_ext0 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D; dw_ext1 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; } //One combination is a permutation of (0,0,0,2) based on c2 xsv_ext2 = xsb; ysv_ext2 = ysb; zsv_ext2 = zsb; wsv_ext2 = wsb; dx_ext2 = dx0 - 2 * SQUISH_CONSTANT_4D; dy_ext2 = dy0 - 2 * SQUISH_CONSTANT_4D; dz_ext2 = dz0 - 2 * SQUISH_CONSTANT_4D; dw_ext2 = dw0 - 2 * SQUISH_CONSTANT_4D; if ((c2 & 0x01) != 0) { xsv_ext2 += 2; dx_ext2 -= 2; } else if ((c2 & 0x02) != 0) { ysv_ext2 += 2; dy_ext2 -= 2; } else if ((c2 & 0x04) != 0) { zsv_ext2 += 2; dz_ext2 -= 2; } else { wsv_ext2 += 2; dw_ext2 -= 2; } } else { //Both closest points on the smaller side //One of the two extra points is (0,0,0,0) xsv_ext2 = xsb; ysv_ext2 = ysb; zsv_ext2 = zsb; wsv_ext2 = wsb; dx_ext2 = dx0; dy_ext2 = dy0; dz_ext2 = dz0; dw_ext2 = dw0; //Other two points are based on the omitted axes. byte c = (byte)(aPoint | bPoint); if ((c & 0x01) == 0) { xsv_ext0 = xsb - 1; xsv_ext1 = xsb; dx_ext0 = dx0 + 1 - SQUISH_CONSTANT_4D; dx_ext1 = dx0 - SQUISH_CONSTANT_4D; } else { xsv_ext0 = xsv_ext1 = xsb + 1; dx_ext0 = dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_4D; } if ((c & 0x02) == 0) { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0 - SQUISH_CONSTANT_4D; if ((c & 0x01) == 0x01) { ysv_ext0 -= 1; dy_ext0 += 1; } else { ysv_ext1 -= 1; dy_ext1 += 1; } } else { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_4D; } if ((c & 0x04) == 0) { zsv_ext0 = zsv_ext1 = zsb; dz_ext0 = dz_ext1 = dz0 - SQUISH_CONSTANT_4D; if ((c & 0x03) == 0x03) { zsv_ext0 -= 1; dz_ext0 += 1; } else { zsv_ext1 -= 1; dz_ext1 += 1; } } else { zsv_ext0 = zsv_ext1 = zsb + 1; dz_ext0 = dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_4D; } if ((c & 0x08) == 0) { wsv_ext0 = wsb; wsv_ext1 = wsb - 1; dw_ext0 = dw0 - SQUISH_CONSTANT_4D; dw_ext1 = dw0 + 1 - SQUISH_CONSTANT_4D; } else { wsv_ext0 = wsv_ext1 = wsb + 1; dw_ext0 = dw_ext1 = dw0 - 1 - SQUISH_CONSTANT_4D; } } } else { //One point on each "side" byte c1, c2; if (aIsBiggerSide) { c1 = aPoint; c2 = bPoint; } else { c1 = bPoint; c2 = aPoint; } //Two contributions are the bigger-sided point with each 0 replaced with -1. if ((c1 & 0x01) == 0) { xsv_ext0 = xsb - 1; xsv_ext1 = xsb; dx_ext0 = dx0 + 1 - SQUISH_CONSTANT_4D; dx_ext1 = dx0 - SQUISH_CONSTANT_4D; } else { xsv_ext0 = xsv_ext1 = xsb + 1; dx_ext0 = dx_ext1 = dx0 - 1 - SQUISH_CONSTANT_4D; } if ((c1 & 0x02) == 0) { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0 - SQUISH_CONSTANT_4D; if ((c1 & 0x01) == 0x01) { ysv_ext0 -= 1; dy_ext0 += 1; } else { ysv_ext1 -= 1; dy_ext1 += 1; } } else { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1 - SQUISH_CONSTANT_4D; } if ((c1 & 0x04) == 0) { zsv_ext0 = zsv_ext1 = zsb; dz_ext0 = dz_ext1 = dz0 - SQUISH_CONSTANT_4D; if ((c1 & 0x03) == 0x03) { zsv_ext0 -= 1; dz_ext0 += 1; } else { zsv_ext1 -= 1; dz_ext1 += 1; } } else { zsv_ext0 = zsv_ext1 = zsb + 1; dz_ext0 = dz_ext1 = dz0 - 1 - SQUISH_CONSTANT_4D; } if ((c1 & 0x08) == 0) { wsv_ext0 = wsb; wsv_ext1 = wsb - 1; dw_ext0 = dw0 - SQUISH_CONSTANT_4D; dw_ext1 = dw0 + 1 - SQUISH_CONSTANT_4D; } else { wsv_ext0 = wsv_ext1 = wsb + 1; dw_ext0 = dw_ext1 = dw0 - 1 - SQUISH_CONSTANT_4D; } //One contribution is a permutation of (0,0,0,2) based on the smaller-sided point xsv_ext2 = xsb; ysv_ext2 = ysb; zsv_ext2 = zsb; wsv_ext2 = wsb; dx_ext2 = dx0 - 2 * SQUISH_CONSTANT_4D; dy_ext2 = dy0 - 2 * SQUISH_CONSTANT_4D; dz_ext2 = dz0 - 2 * SQUISH_CONSTANT_4D; dw_ext2 = dw0 - 2 * SQUISH_CONSTANT_4D; if ((c2 & 0x01) != 0) { xsv_ext2 += 2; dx_ext2 -= 2; } else if ((c2 & 0x02) != 0) { ysv_ext2 += 2; dy_ext2 -= 2; } else if ((c2 & 0x04) != 0) { zsv_ext2 += 2; dz_ext2 -= 2; } else { wsv_ext2 += 2; dw_ext2 -= 2; } } //Contribution (1,0,0,0) double dx1 = dx0 - 1 - SQUISH_CONSTANT_4D; double dy1 = dy0 - 0 - SQUISH_CONSTANT_4D; double dz1 = dz0 - 0 - SQUISH_CONSTANT_4D; double dw1 = dw0 - 0 - SQUISH_CONSTANT_4D; double attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1 - dw1 * dw1; if (attn1 > 0) { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, zsb + 0, wsb + 0, dx1, dy1, dz1, dw1); } //Contribution (0,1,0,0) double dx2 = dx0 - 0 - SQUISH_CONSTANT_4D; double dy2 = dy0 - 1 - SQUISH_CONSTANT_4D; double dz2 = dz1; double dw2 = dw1; double attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2 - dw2 * dw2; if (attn2 > 0) { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, zsb + 0, wsb + 0, dx2, dy2, dz2, dw2); } //Contribution (0,0,1,0) double dx3 = dx2; double dy3 = dy1; double dz3 = dz0 - 1 - SQUISH_CONSTANT_4D; double dw3 = dw1; double attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3 - dw3 * dw3; if (attn3 > 0) { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 0, ysb + 0, zsb + 1, wsb + 0, dx3, dy3, dz3, dw3); } //Contribution (0,0,0,1) double dx4 = dx2; double dy4 = dy1; double dz4 = dz1; double dw4 = dw0 - 1 - SQUISH_CONSTANT_4D; double attn4 = 2 - dx4 * dx4 - dy4 * dy4 - dz4 * dz4 - dw4 * dw4; if (attn4 > 0) { attn4 *= attn4; value += attn4 * attn4 * extrapolate(xsb + 0, ysb + 0, zsb + 0, wsb + 1, dx4, dy4, dz4, dw4); } //Contribution (1,1,0,0) double dx5 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy5 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; double dz5 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D; double dw5 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D; double attn5 = 2 - dx5 * dx5 - dy5 * dy5 - dz5 * dz5 - dw5 * dw5; if (attn5 > 0) { attn5 *= attn5; value += attn5 * attn5 * extrapolate(xsb + 1, ysb + 1, zsb + 0, wsb + 0, dx5, dy5, dz5, dw5); } //Contribution (1,0,1,0) double dx6 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy6 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; double dz6 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; double dw6 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D; double attn6 = 2 - dx6 * dx6 - dy6 * dy6 - dz6 * dz6 - dw6 * dw6; if (attn6 > 0) { attn6 *= attn6; value += attn6 * attn6 * extrapolate(xsb + 1, ysb + 0, zsb + 1, wsb + 0, dx6, dy6, dz6, dw6); } //Contribution (1,0,0,1) double dx7 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy7 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; double dz7 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D; double dw7 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; double attn7 = 2 - dx7 * dx7 - dy7 * dy7 - dz7 * dz7 - dw7 * dw7; if (attn7 > 0) { attn7 *= attn7; value += attn7 * attn7 * extrapolate(xsb + 1, ysb + 0, zsb + 0, wsb + 1, dx7, dy7, dz7, dw7); } //Contribution (0,1,1,0) double dx8 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy8 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; double dz8 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; double dw8 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D; double attn8 = 2 - dx8 * dx8 - dy8 * dy8 - dz8 * dz8 - dw8 * dw8; if (attn8 > 0) { attn8 *= attn8; value += attn8 * attn8 * extrapolate(xsb + 0, ysb + 1, zsb + 1, wsb + 0, dx8, dy8, dz8, dw8); } //Contribution (0,1,0,1) double dx9 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy9 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; double dz9 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D; double dw9 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; double attn9 = 2 - dx9 * dx9 - dy9 * dy9 - dz9 * dz9 - dw9 * dw9; if (attn9 > 0) { attn9 *= attn9; value += attn9 * attn9 * extrapolate(xsb + 0, ysb + 1, zsb + 0, wsb + 1, dx9, dy9, dz9, dw9); } //Contribution (0,0,1,1) double dx10 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy10 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; double dz10 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; double dw10 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; double attn10 = 2 - dx10 * dx10 - dy10 * dy10 - dz10 * dz10 - dw10 * dw10; if (attn10 > 0) { attn10 *= attn10; value += attn10 * attn10 * extrapolate(xsb + 0, ysb + 0, zsb + 1, wsb + 1, dx10, dy10, dz10, dw10); } } else { //We're inside the second dispentachoron (Rectified 4-Simplex) double aScore; byte aPoint; boolean aIsBiggerSide = true; double bScore; byte bPoint; boolean bIsBiggerSide = true; //Decide between (0,0,1,1) and (1,1,0,0) if (xins + yins < zins + wins) { aScore = xins + yins; aPoint = 0x0C; } else { aScore = zins + wins; aPoint = 0x03; } //Decide between (0,1,0,1) and (1,0,1,0) if (xins + zins < yins + wins) { bScore = xins + zins; bPoint = 0x0A; } else { bScore = yins + wins; bPoint = 0x05; } //Closer between (0,1,1,0) and (1,0,0,1) will replace the further of a and b, if closer. if (xins + wins < yins + zins) { double score = xins + wins; if (aScore <= bScore && score < bScore) { bScore = score; bPoint = 0x06; } else if (aScore > bScore && score < aScore) { aScore = score; aPoint = 0x06; } } else { double score = yins + zins; if (aScore <= bScore && score < bScore) { bScore = score; bPoint = 0x09; } else if (aScore > bScore && score < aScore) { aScore = score; aPoint = 0x09; } } //Decide if (0,1,1,1) is closer. double p1 = 3 - inSum + xins; if (aScore <= bScore && p1 < bScore) { bScore = p1; bPoint = 0x0E; bIsBiggerSide = false; } else if (aScore > bScore && p1 < aScore) { aScore = p1; aPoint = 0x0E; aIsBiggerSide = false; } //Decide if (1,0,1,1) is closer. double p2 = 3 - inSum + yins; if (aScore <= bScore && p2 < bScore) { bScore = p2; bPoint = 0x0D; bIsBiggerSide = false; } else if (aScore > bScore && p2 < aScore) { aScore = p2; aPoint = 0x0D; aIsBiggerSide = false; } //Decide if (1,1,0,1) is closer. double p3 = 3 - inSum + zins; if (aScore <= bScore && p3 < bScore) { bScore = p3; bPoint = 0x0B; bIsBiggerSide = false; } else if (aScore > bScore && p3 < aScore) { aScore = p3; aPoint = 0x0B; aIsBiggerSide = false; } //Decide if (1,1,1,0) is closer. double p4 = 3 - inSum + wins; if (aScore <= bScore && p4 < bScore) { bScore = p4; bPoint = 0x07; bIsBiggerSide = false; } else if (aScore > bScore && p4 < aScore) { aScore = p4; aPoint = 0x07; aIsBiggerSide = false; } //Where each of the two closest points are determines how the extra three vertices are calculated. if (aIsBiggerSide == bIsBiggerSide) { if (aIsBiggerSide) { //Both closest points on the bigger side byte c1 = (byte)(aPoint & bPoint); byte c2 = (byte)(aPoint | bPoint); //Two contributions are permutations of (0,0,0,1) and (0,0,0,2) based on c1 xsv_ext0 = xsv_ext1 = xsb; ysv_ext0 = ysv_ext1 = ysb; zsv_ext0 = zsv_ext1 = zsb; wsv_ext0 = wsv_ext1 = wsb; dx_ext0 = dx0 - SQUISH_CONSTANT_4D; dy_ext0 = dy0 - SQUISH_CONSTANT_4D; dz_ext0 = dz0 - SQUISH_CONSTANT_4D; dw_ext0 = dw0 - SQUISH_CONSTANT_4D; dx_ext1 = dx0 - 2 * SQUISH_CONSTANT_4D; dy_ext1 = dy0 - 2 * SQUISH_CONSTANT_4D; dz_ext1 = dz0 - 2 * SQUISH_CONSTANT_4D; dw_ext1 = dw0 - 2 * SQUISH_CONSTANT_4D; if ((c1 & 0x01) != 0) { xsv_ext0 += 1; dx_ext0 -= 1; xsv_ext1 += 2; dx_ext1 -= 2; } else if ((c1 & 0x02) != 0) { ysv_ext0 += 1; dy_ext0 -= 1; ysv_ext1 += 2; dy_ext1 -= 2; } else if ((c1 & 0x04) != 0) { zsv_ext0 += 1; dz_ext0 -= 1; zsv_ext1 += 2; dz_ext1 -= 2; } else { wsv_ext0 += 1; dw_ext0 -= 1; wsv_ext1 += 2; dw_ext1 -= 2; } //One contribution is a permutation of (1,1,1,-1) based on c2 xsv_ext2 = xsb + 1; ysv_ext2 = ysb + 1; zsv_ext2 = zsb + 1; wsv_ext2 = wsb + 1; dx_ext2 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; dy_ext2 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; dz_ext2 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; dw_ext2 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; if ((c2 & 0x01) == 0) { xsv_ext2 -= 2; dx_ext2 += 2; } else if ((c2 & 0x02) == 0) { ysv_ext2 -= 2; dy_ext2 += 2; } else if ((c2 & 0x04) == 0) { zsv_ext2 -= 2; dz_ext2 += 2; } else { wsv_ext2 -= 2; dw_ext2 += 2; } } else { //Both closest points on the smaller side //One of the two extra points is (1,1,1,1) xsv_ext2 = xsb + 1; ysv_ext2 = ysb + 1; zsv_ext2 = zsb + 1; wsv_ext2 = wsb + 1; dx_ext2 = dx0 - 1 - 4 * SQUISH_CONSTANT_4D; dy_ext2 = dy0 - 1 - 4 * SQUISH_CONSTANT_4D; dz_ext2 = dz0 - 1 - 4 * SQUISH_CONSTANT_4D; dw_ext2 = dw0 - 1 - 4 * SQUISH_CONSTANT_4D; //Other two points are based on the shared axes. byte c = (byte)(aPoint & bPoint); if ((c & 0x01) != 0) { xsv_ext0 = xsb + 2; xsv_ext1 = xsb + 1; dx_ext0 = dx0 - 2 - 3 * SQUISH_CONSTANT_4D; dx_ext1 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D; } else { xsv_ext0 = xsv_ext1 = xsb; dx_ext0 = dx_ext1 = dx0 - 3 * SQUISH_CONSTANT_4D; } if ((c & 0x02) != 0) { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D; if ((c & 0x01) == 0) { ysv_ext0 += 1; dy_ext0 -= 1; } else { ysv_ext1 += 1; dy_ext1 -= 1; } } else { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0 - 3 * SQUISH_CONSTANT_4D; } if ((c & 0x04) != 0) { zsv_ext0 = zsv_ext1 = zsb + 1; dz_ext0 = dz_ext1 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D; if ((c & 0x03) == 0) { zsv_ext0 += 1; dz_ext0 -= 1; } else { zsv_ext1 += 1; dz_ext1 -= 1; } } else { zsv_ext0 = zsv_ext1 = zsb; dz_ext0 = dz_ext1 = dz0 - 3 * SQUISH_CONSTANT_4D; } if ((c & 0x08) != 0) { wsv_ext0 = wsb + 1; wsv_ext1 = wsb + 2; dw_ext0 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D; dw_ext1 = dw0 - 2 - 3 * SQUISH_CONSTANT_4D; } else { wsv_ext0 = wsv_ext1 = wsb; dw_ext0 = dw_ext1 = dw0 - 3 * SQUISH_CONSTANT_4D; } } } else { //One point on each "side" byte c1, c2; if (aIsBiggerSide) { c1 = aPoint; c2 = bPoint; } else { c1 = bPoint; c2 = aPoint; } //Two contributions are the bigger-sided point with each 1 replaced with 2. if ((c1 & 0x01) != 0) { xsv_ext0 = xsb + 2; xsv_ext1 = xsb + 1; dx_ext0 = dx0 - 2 - 3 * SQUISH_CONSTANT_4D; dx_ext1 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D; } else { xsv_ext0 = xsv_ext1 = xsb; dx_ext0 = dx_ext1 = dx0 - 3 * SQUISH_CONSTANT_4D; } if ((c1 & 0x02) != 0) { ysv_ext0 = ysv_ext1 = ysb + 1; dy_ext0 = dy_ext1 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D; if ((c1 & 0x01) == 0) { ysv_ext0 += 1; dy_ext0 -= 1; } else { ysv_ext1 += 1; dy_ext1 -= 1; } } else { ysv_ext0 = ysv_ext1 = ysb; dy_ext0 = dy_ext1 = dy0 - 3 * SQUISH_CONSTANT_4D; } if ((c1 & 0x04) != 0) { zsv_ext0 = zsv_ext1 = zsb + 1; dz_ext0 = dz_ext1 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D; if ((c1 & 0x03) == 0) { zsv_ext0 += 1; dz_ext0 -= 1; } else { zsv_ext1 += 1; dz_ext1 -= 1; } } else { zsv_ext0 = zsv_ext1 = zsb; dz_ext0 = dz_ext1 = dz0 - 3 * SQUISH_CONSTANT_4D; } if ((c1 & 0x08) != 0) { wsv_ext0 = wsb + 1; wsv_ext1 = wsb + 2; dw_ext0 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D; dw_ext1 = dw0 - 2 - 3 * SQUISH_CONSTANT_4D; } else { wsv_ext0 = wsv_ext1 = wsb; dw_ext0 = dw_ext1 = dw0 - 3 * SQUISH_CONSTANT_4D; } //One contribution is a permutation of (1,1,1,-1) based on the smaller-sided point xsv_ext2 = xsb + 1; ysv_ext2 = ysb + 1; zsv_ext2 = zsb + 1; wsv_ext2 = wsb + 1; dx_ext2 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; dy_ext2 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; dz_ext2 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; dw_ext2 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; if ((c2 & 0x01) == 0) { xsv_ext2 -= 2; dx_ext2 += 2; } else if ((c2 & 0x02) == 0) { ysv_ext2 -= 2; dy_ext2 += 2; } else if ((c2 & 0x04) == 0) { zsv_ext2 -= 2; dz_ext2 += 2; } else { wsv_ext2 -= 2; dw_ext2 += 2; } } //Contribution (1,1,1,0) double dx4 = dx0 - 1 - 3 * SQUISH_CONSTANT_4D; double dy4 = dy0 - 1 - 3 * SQUISH_CONSTANT_4D; double dz4 = dz0 - 1 - 3 * SQUISH_CONSTANT_4D; double dw4 = dw0 - 3 * SQUISH_CONSTANT_4D; double attn4 = 2 - dx4 * dx4 - dy4 * dy4 - dz4 * dz4 - dw4 * dw4; if (attn4 > 0) { attn4 *= attn4; value += attn4 * attn4 * extrapolate(xsb + 1, ysb + 1, zsb + 1, wsb + 0, dx4, dy4, dz4, dw4); } //Contribution (1,1,0,1) double dx3 = dx4; double dy3 = dy4; double dz3 = dz0 - 3 * SQUISH_CONSTANT_4D; double dw3 = dw0 - 1 - 3 * SQUISH_CONSTANT_4D; double attn3 = 2 - dx3 * dx3 - dy3 * dy3 - dz3 * dz3 - dw3 * dw3; if (attn3 > 0) { attn3 *= attn3; value += attn3 * attn3 * extrapolate(xsb + 1, ysb + 1, zsb + 0, wsb + 1, dx3, dy3, dz3, dw3); } //Contribution (1,0,1,1) double dx2 = dx4; double dy2 = dy0 - 3 * SQUISH_CONSTANT_4D; double dz2 = dz4; double dw2 = dw3; double attn2 = 2 - dx2 * dx2 - dy2 * dy2 - dz2 * dz2 - dw2 * dw2; if (attn2 > 0) { attn2 *= attn2; value += attn2 * attn2 * extrapolate(xsb + 1, ysb + 0, zsb + 1, wsb + 1, dx2, dy2, dz2, dw2); } //Contribution (0,1,1,1) double dx1 = dx0 - 3 * SQUISH_CONSTANT_4D; double dz1 = dz4; double dy1 = dy4; double dw1 = dw3; double attn1 = 2 - dx1 * dx1 - dy1 * dy1 - dz1 * dz1 - dw1 * dw1; if (attn1 > 0) { attn1 *= attn1; value += attn1 * attn1 * extrapolate(xsb + 0, ysb + 1, zsb + 1, wsb + 1, dx1, dy1, dz1, dw1); } //Contribution (1,1,0,0) double dx5 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy5 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; double dz5 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D; double dw5 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D; double attn5 = 2 - dx5 * dx5 - dy5 * dy5 - dz5 * dz5 - dw5 * dw5; if (attn5 > 0) { attn5 *= attn5; value += attn5 * attn5 * extrapolate(xsb + 1, ysb + 1, zsb + 0, wsb + 0, dx5, dy5, dz5, dw5); } //Contribution (1,0,1,0) double dx6 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy6 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; double dz6 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; double dw6 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D; double attn6 = 2 - dx6 * dx6 - dy6 * dy6 - dz6 * dz6 - dw6 * dw6; if (attn6 > 0) { attn6 *= attn6; value += attn6 * attn6 * extrapolate(xsb + 1, ysb + 0, zsb + 1, wsb + 0, dx6, dy6, dz6, dw6); } //Contribution (1,0,0,1) double dx7 = dx0 - 1 - 2 * SQUISH_CONSTANT_4D; double dy7 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; double dz7 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D; double dw7 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; double attn7 = 2 - dx7 * dx7 - dy7 * dy7 - dz7 * dz7 - dw7 * dw7; if (attn7 > 0) { attn7 *= attn7; value += attn7 * attn7 * extrapolate(xsb + 1, ysb + 0, zsb + 0, wsb + 1, dx7, dy7, dz7, dw7); } //Contribution (0,1,1,0) double dx8 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy8 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; double dz8 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; double dw8 = dw0 - 0 - 2 * SQUISH_CONSTANT_4D; double attn8 = 2 - dx8 * dx8 - dy8 * dy8 - dz8 * dz8 - dw8 * dw8; if (attn8 > 0) { attn8 *= attn8; value += attn8 * attn8 * extrapolate(xsb + 0, ysb + 1, zsb + 1, wsb + 0, dx8, dy8, dz8, dw8); } //Contribution (0,1,0,1) double dx9 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy9 = dy0 - 1 - 2 * SQUISH_CONSTANT_4D; double dz9 = dz0 - 0 - 2 * SQUISH_CONSTANT_4D; double dw9 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; double attn9 = 2 - dx9 * dx9 - dy9 * dy9 - dz9 * dz9 - dw9 * dw9; if (attn9 > 0) { attn9 *= attn9; value += attn9 * attn9 * extrapolate(xsb + 0, ysb + 1, zsb + 0, wsb + 1, dx9, dy9, dz9, dw9); } //Contribution (0,0,1,1) double dx10 = dx0 - 0 - 2 * SQUISH_CONSTANT_4D; double dy10 = dy0 - 0 - 2 * SQUISH_CONSTANT_4D; double dz10 = dz0 - 1 - 2 * SQUISH_CONSTANT_4D; double dw10 = dw0 - 1 - 2 * SQUISH_CONSTANT_4D; double attn10 = 2 - dx10 * dx10 - dy10 * dy10 - dz10 * dz10 - dw10 * dw10; if (attn10 > 0) { attn10 *= attn10; value += attn10 * attn10 * extrapolate(xsb + 0, ysb + 0, zsb + 1, wsb + 1, dx10, dy10, dz10, dw10); } } //First extra vertex double attn_ext0 = 2 - dx_ext0 * dx_ext0 - dy_ext0 * dy_ext0 - dz_ext0 * dz_ext0 - dw_ext0 * dw_ext0; if (attn_ext0 > 0) { attn_ext0 *= attn_ext0; value += attn_ext0 * attn_ext0 * extrapolate(xsv_ext0, ysv_ext0, zsv_ext0, wsv_ext0, dx_ext0, dy_ext0, dz_ext0, dw_ext0); } //Second extra vertex double attn_ext1 = 2 - dx_ext1 * dx_ext1 - dy_ext1 * dy_ext1 - dz_ext1 * dz_ext1 - dw_ext1 * dw_ext1; if (attn_ext1 > 0) { attn_ext1 *= attn_ext1; value += attn_ext1 * attn_ext1 * extrapolate(xsv_ext1, ysv_ext1, zsv_ext1, wsv_ext1, dx_ext1, dy_ext1, dz_ext1, dw_ext1); } //Third extra vertex double attn_ext2 = 2 - dx_ext2 * dx_ext2 - dy_ext2 * dy_ext2 - dz_ext2 * dz_ext2 - dw_ext2 * dw_ext2; if (attn_ext2 > 0) { attn_ext2 *= attn_ext2; value += attn_ext2 * attn_ext2 * extrapolate(xsv_ext2, ysv_ext2, zsv_ext2, wsv_ext2, dx_ext2, dy_ext2, dz_ext2, dw_ext2); } return value / NORM_CONSTANT_4D; } private double extrapolate(int xsb, int ysb, double dx, double dy) { int index = perm[(perm[xsb & 0xFF] + ysb) & 0xFF] & 0x0E; return gradients2D[index] * dx + gradients2D[index + 1] * dy; } private double extrapolate(int xsb, int ysb, int zsb, double dx, double dy, double dz) { int index = permGradIndex3D[(perm[(perm[xsb & 0xFF] + ysb) & 0xFF] + zsb) & 0xFF]; return gradients3D[index] * dx + gradients3D[index + 1] * dy + gradients3D[index + 2] * dz; } private double extrapolate(int xsb, int ysb, int zsb, int wsb, double dx, double dy, double dz, double dw) { int index = perm[(perm[(perm[(perm[xsb & 0xFF] + ysb) & 0xFF] + zsb) & 0xFF] + wsb) & 0xFF] & 0xFC; return gradients4D[index] * dx + gradients4D[index + 1] * dy + gradients4D[index + 2] * dz + gradients4D[index + 3] * dw; } private static int fastFloor(double x) { int xi = (int)x; return x < xi ? xi - 1 : xi; } //Gradients for 2D. They approximate the directions to the //vertices of an octagon from the center. private static byte[] gradients2D = new byte[] { 5, 2, 2, 5, -5, 2, -2, 5, 5, -2, 2, -5, -5, -2, -2, -5, }; //Gradients for 3D. They approximate the directions to the //vertices of a rhombicuboctahedron from the center, skewed so //that the triangular and square facets can be inscribed inside //circles of the same radius. private static byte[] gradients3D = new byte[] { -11, 4, 4, -4, 11, 4, -4, 4, 11, 11, 4, 4, 4, 11, 4, 4, 4, 11, -11, -4, 4, -4, -11, 4, -4, -4, 11, 11, -4, 4, 4, -11, 4, 4, -4, 11, -11, 4, -4, -4, 11, -4, -4, 4, -11, 11, 4, -4, 4, 11, -4, 4, 4, -11, -11, -4, -4, -4, -11, -4, -4, -4, -11, 11, -4, -4, 4, -11, -4, 4, -4, -11, }; //Gradients for 4D. They approximate the directions to the //vertices of a disprismatotesseractihexadecachoron from the center, //skewed so that the tetrahedral and cubic facets can be inscribed inside //spheres of the same radius. private static byte[] gradients4D = new byte[] { 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3, }; }
chrislo27/Stray-core
src/stray/util/SimplexNoise.java
Java
mit
69,292
import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { Challenge, ChallengeService, KataPlayerStatus, SocketService } from './../core'; @Component({ selector: 'app-streaming', templateUrl: './streaming.component.html', styleUrls: ['./streaming.component.scss'] }) export class StreamingComponent implements OnInit { config: any; timeSpent: number; counterDownObs: Observable<number>; codePlayerA: string; codePlayerB: string; challengeId: string; currentChallenge: Challenge; challengeState: string; challengeProgress: { playerA: { state: string, tests: number, passedTests: number }, playerB: { state: string, tests: number, passedTests: number } }; constructor(private route: ActivatedRoute, private challengeSrv: ChallengeService, private socketSrv: SocketService) {} ngOnInit() { // Global view config this.timeSpent = 0; this.counterDownObs = Observable.interval(1000); // Editor's config this.config = { cursorBlinkRate: 200, lineNumbers: true, mode: { name: "javascript", json: true }, readOnly: true, tabSize: 2, theme: 'material' }; // Structure to hold the results this.challengeProgress = { playerA: { state: KataPlayerStatus.WAITING, tests: 0, passedTests: 0 }, playerB: { state: KataPlayerStatus.WAITING, tests: 0, passedTests: 0 } }; // Initialitate the code editors this.codePlayerA = ''; this.codePlayerB = ''; // Send challenge signal-message and join into a challenge room this.route.params.subscribe(params => { this.challengeId = params['challengeId']; this.socketSrv.sendMessage('challenge', { event: 'joinToChallenge', challengeId: this.challengeId }); this.challengeSrv.getChallengeInfo(this.challengeId).subscribe( (challenge: Challenge) => this.currentChallenge = challenge ); }); // Connect to streaming this.socketSrv.connectToStreaming('challenge').subscribe((data: any) => { if(data.event === 'codeUpdated') { this.updateChallengeCode(data); } else if(data.event === 'playerReady') { // If the streaming players info is empty, request it again if(!this.currentChallenge.playerA && !this.currentChallenge.playerB) { this.getChallengeInfo(data); } else if(this.currentChallenge.playerA && !this.currentChallenge.playerB) { this.getChallengeInfo(data); } else { this.updatePlayerNames(data); } } else if(data.event === 'startedChallenge') { this.challengeState = KataPlayerStatus.PLAYING; this.counterDownObs.subscribe((tick) => this.timeSpent++); this.challengeProgress.playerA.state = KataPlayerStatus.PLAYING; this.challengeProgress.playerB.state = KataPlayerStatus.PLAYING; } else if(data.event === 'challengeProgress') { console.log('str: ', data); if(data.playerId === this.currentChallenge.playerA) { this.challengeProgress.playerA.tests = data.tests; this.challengeProgress.playerA.passedTests = data.passedTests; this.challengeProgress.playerA.state = (data.status) ? KataPlayerStatus.WINNER : KataPlayerStatus.PLAYING; } else if(data.playerId === this.currentChallenge.playerB) { this.challengeProgress.playerB.tests = data.tests; this.challengeProgress.playerB.passedTests = data.passedTests; this.challengeProgress.playerB.state = (data.status) ? KataPlayerStatus.WINNER : KataPlayerStatus.PLAYING; } } }); } /** * * @param event */ chronoEvent(event) { } /** * Method to retrieve the most updated info about the callenge (with player IDs and usernames) * @param data WebSocket message */ getChallengeInfo(data) { this.challengeSrv.getChallengeInfo(this.challengeId).subscribe( (challenge: Challenge) => { this.currentChallenge = challenge; this.updatePlayerNames(data); } ); } /** * Method to update the players' implementation body function * @param data WebSocket message */ updateChallengeCode(data) { if(data.playerId === this.currentChallenge.playerA) this.codePlayerA = data.code; else if(data.playerId === this.currentChallenge.playerB) this.codePlayerB = data.code; } /** * Method to update the both challengees info fields * @param data WebSocket message */ updatePlayerNames(data) { if(data.playerId === this.currentChallenge.playerA) this.currentChallenge.usernamePlayerA = data.who; else if(data.playerId === this.currentChallenge.playerB) this.currentChallenge.usernamePlayerB = data.who; } }
semagarcia/javascript-kata-player
src/app/streaming/streaming.component.ts
TypeScript
mit
5,555
import arrow from typing import Union from merakicommons.cache import lazy, lazy_property from merakicommons.container import searchable from ..data import Region, Platform from .common import CoreData, CassiopeiaObject, CassiopeiaGhost, CassiopeiaLazyList, CoreDataList, get_latest_version, provide_default_region, ghost_load_on from ..dto.championmastery import ChampionMasteryDto from .staticdata.champion import Champion from .summoner import Summoner from ..dto import championmastery as dto ############## # Data Types # ############## class ChampionMasteryListData(CoreDataList): _dto_type = dto.ChampionMasteryListDto _renamed = {} class ChampionMasteryData(CoreData): _dto_type = ChampionMasteryDto _renamed = {"championLevel": "level", "championPoints": "points", "playerId": "summonerId", "championPointsUntilNextLevel": "pointsUntilNextLevel", "championPointsSinceLastLevel": "pointsSinceLastLevel", "lastPlayTime": "lastPlayed", "tokensEarned": "tokens"} ############## # Core Types # ############## class ChampionMasteries(CassiopeiaLazyList): _data_types = {ChampionMasteryListData} @provide_default_region def __init__(self, *, summoner: Summoner, region: Union[Region, str] = None): self.__summoner = summoner kwargs = {"region": region} CassiopeiaObject.__init__(self, **kwargs) @classmethod @provide_default_region def __get_query_from_kwargs__(cls, *, summoner: Union[Summoner, int, str], region: Union[Region, str]) -> dict: query = {"region": region} if isinstance(summoner, Summoner): query["summoner.id"] = summoner.id elif isinstance(summoner, str): query["summoner.id"] = Summoner(name=summoner, region=region).id else: # int query["summoner.id"] = summoner return query @lazy_property def region(self) -> Region: return Region(self._data[ChampionMasteryListData].region) @lazy_property def platform(self) -> Platform: return self.region.platform @property def summoner(self): return self.__summoner @searchable({str: ["champion", "summoner"], int: ["points", "level"], bool: ["chest_granted"], arrow.Arrow: ["last_played"], Champion: ["champion"], Summoner: ["summoner"]}) class ChampionMastery(CassiopeiaGhost): _data_types = {ChampionMasteryData} @provide_default_region def __init__(self, *, summoner: Union[Summoner, int, str] = None, champion: Union[Champion, int, str] = None, region: Union[Region, str] = None, _account_id: int = None): kwargs = {"region": region} if _account_id is not None: summoner = Summoner(account=_account_id, region=region) if summoner is not None: if isinstance(summoner, Summoner): self.__class__.summoner.fget._lazy_set(self, summoner) elif isinstance(summoner, str): summoner = Summoner(name=summoner, region=region) self.__class__.summoner.fget._lazy_set(self, summoner) else: # int kwargs["summonerId"] = summoner if champion is not None: if isinstance(champion, Champion): self.__class__.champion.fget._lazy_set(self, champion) elif isinstance(champion, str): champion = Champion(name=champion, region=self.region, version=get_latest_version(self.region, endpoint="champion")) self.__class__.champion.fget._lazy_set(self, champion) else: # int kwargs["championId"] = champion super().__init__(**kwargs) @classmethod @provide_default_region def __get_query_from_kwargs__(cls, *, summoner: Union[Summoner, int, str], champion: Union[Champion, int, str], region: Union[Region, str]) -> dict: query = {"region": region} if isinstance(summoner, Summoner): query["summoner.id"] = summoner.id elif isinstance(summoner, str): query["summoner.id"] = Summoner(name=summoner, region=region).id else: # int query["summoner.id"] = summoner if isinstance(champion, Champion): query["champion.id"] = champion.id elif isinstance(champion, str): query["champion.id"] = Champion(name=champion, region=region).id else: # int query["champion.id"] = champion return query def __get_query__(self): return {"region": self.region, "platform": self.platform.value, "summoner.id": self.summoner.id, "champion.id": self.champion.id} def __load__(self, load_group: CoreData = None) -> None: from datapipelines import NotFoundError try: return super().__load__(load_group) except NotFoundError: from ..transformers.championmastery import ChampionMasteryTransformer dto = { "championLevel": 0, "chestGranted": False, "championPoints": 0, "championPointsUntilNextLevel": 1800, "tokensEarned": 0, "championPointsSinceLastLevel": 0, "lastPlayTime": None } data = ChampionMasteryTransformer.champion_mastery_dto_to_data(None, dto) self.__load_hook__(load_group, data) def __eq__(self, other: "ChampionMastery"): if not isinstance(other, ChampionMastery) or self.region != other.region: return False return self.champion == other.champion and self.summoner == other.summoner def __str__(self): return "ChampionMastery(summoner={summoner}, champion={champion})".format(summoner=str(self.summoner), champion=str(self.champion)) __hash__ = CassiopeiaGhost.__hash__ @property def region(self) -> Region: return Region(self._data[ChampionMasteryData].region) @lazy_property def platform(self) -> Platform: return self.region.platform @CassiopeiaGhost.property(ChampionMasteryData) @lazy def champion(self) -> Champion: """Champion for this entry.""" return Champion(id=self._data[ChampionMasteryData].championId, region=self.region, version=get_latest_version(self.region, endpoint="champion")) @CassiopeiaGhost.property(ChampionMasteryData) @lazy def summoner(self) -> Summoner: """Summoner for this entry.""" return Summoner(id=self._data[ChampionMasteryData].summonerId, region=self.region) @CassiopeiaGhost.property(ChampionMasteryData) @ghost_load_on def chest_granted(self) -> bool: """Is chest granted for this champion or not in current season?""" return self._data[ChampionMasteryData].chestGranted @CassiopeiaGhost.property(ChampionMasteryData) @ghost_load_on def level(self) -> int: """Champion level for specified player and champion combination.""" return self._data[ChampionMasteryData].level @CassiopeiaGhost.property(ChampionMasteryData) @ghost_load_on def points(self) -> int: """Total number of champion points for this player and champion combination - used to determine champion level.""" return self._data[ChampionMasteryData].points @CassiopeiaGhost.property(ChampionMasteryData) @ghost_load_on def points_until_next_level(self) -> int: """Number of points needed to achieve next level. Zero if player reached maximum champion level for this champion.""" return self._data[ChampionMasteryData].pointsUntilNextLevel @CassiopeiaGhost.property(ChampionMasteryData) @ghost_load_on def tokens(self) -> int: """Number of tokens earned toward next mastery level.""" return self._data[ChampionMasteryData].tokens @CassiopeiaGhost.property(ChampionMasteryData) @ghost_load_on def points_since_last_level(self) -> int: """Number of points earned since current level has been achieved. Zero if player reached maximum champion level for this champion.""" return self._data[ChampionMasteryData].pointsSinceLastLevel @CassiopeiaGhost.property(ChampionMasteryData) @ghost_load_on @lazy def last_played(self) -> arrow.Arrow: """Last time this champion was played by this player.""" return arrow.get(self._data[ChampionMasteryData].lastPlayed / 1000)
10se1ucgo/cassiopeia
cassiopeia/core/championmastery.py
Python
mit
8,389
/* * Copyright 2017 - KBC Group NV - Franky Braem - The MIT license * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #include "MQ/Web/ListenerInquire.h" namespace MQ { namespace Web { ListenerInquire::ListenerInquire(CommandServer& commandServer, Poco::JSON::Object::Ptr input) : PCFCommand(commandServer, MQCMD_INQUIRE_LISTENER, "Listener", input), _excludeSystem(false) { // Required parameters addParameter<std::string>(MQCACH_LISTENER_NAME, "ListenerName"); // Optional parameters addIntegerFilter(); addAttributeList(MQIACF_LISTENER_ATTRS, "ListenerAttrs"); addStringFilter(); addParameterNumFromString(MQIACH_XMIT_PROTOCOL_TYPE, "TransportType"); _excludeSystem = input->optValue("ExcludeSystem", false); } ListenerInquire::~ListenerInquire() { } Poco::JSON::Array::Ptr ListenerInquire::execute() { PCFCommand::execute(); Poco::JSON::Array::Ptr json = new Poco::JSON::Array(); for(PCF::Vector::const_iterator it = begin(); it != end(); it++) { if ( (*it)->isExtendedResponse() ) // Skip extended response continue; if ( (*it)->getReasonCode() != MQRC_NONE ) continue; std::string listenerName = (*it)->getParameters().getString(MQCACH_LISTENER_NAME); if ( _excludeSystem && listenerName.compare(0, 7, "SYSTEM.") == 0 ) { continue; } json->add(createJSON(**it)); } return json; } }} // Namespace MQ::Web
fbraem/mqweb
MQWeb/src/ListenerInquire.cpp
C++
mit
2,372
<HTML><HEAD> <TITLE>Review for Murder Over New York (1940)</TITLE> <LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css"> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1 ALIGN="CENTER" CLASS="title"><A HREF="/Title?0032819">Murder Over New York (1940)</A></H1><H3 ALIGN=CENTER>reviewed by<BR><A HREF="/ReviewsBy?Dennis+Schwartz">Dennis Schwartz</A></H3><HR WIDTH="40%" SIZE="4"> <P>MURDER OVER NEW YORK (director/writer: Harry Lachman; screenwriter: Lester Ziffren; cinematographer: Virgil E. Miller; editor: Louis Loeffler; cast: Sidney Toler (Charlie Chan), Sen Yung (Jimmy Chan), Marjorie Weaver (Patricia Narvo), Shemp Howard (Fakir), Robert Lowery (David Elliott), Ricardo Cortez (George Kirby), Donald MacBride (Inspector Vance), Clarence Muse (Butler), Melville Cooper (Herbert Fenton), Joan Valerie (June Preston), Kane Richmond (Ralph Percy), John Sutton (Richard Jeffery), Frederic Worlock (Hugh Drake), Leyland Hodgson (Boggs, Butler), Lal Chand Mehra (Ramullah/Aga Singh); Runtime: 65; 20th Century Fox; 1940) </P> <PRE>Reviewed by Dennis Schwartz </PRE> <P>An uneven production marred by some ethnic slurs against a black butler (Muse) and by holes in the mystery story, yet had its moments of sheer joy and ends up being a below average entry but can still be enjoyed as your typical Charlie Chan formula mystery story. Shemp Howard, one of the Three Stooges, does a funny bit as he fakes being a Hindu fakir during a police line-up. </P> <P>Charlie leaves Honolulu for the annual police convention in New York and meets on the plane his old friend Inspector Drake of Scotland Yard (Worlock), who is now with British Military Intelligence. He's been working on a case of bomber plane saboteurs, and believes the ring is headed by Paul Narvo. They can't locate him but his ex-wife, a former actress, has been traced as living in New York, which is why Drake is on the flight. He says he has in his briefcase Narvo's photo and fingerprints. He invites Charlie to help in the case, and tells him he's staying with the owner of an aircraft company, Mr. Kirby (Cortez), whose firm manufactures these experimental bombers . </P> <P>When Charlie lands in the Big Apple he's surprised to see his eager but inept number two son, Jimmy (Yung), who tells pop he took a break from attending USC and came to see the World's Fair and to help him. Also there to greet Charlie, is Inspector Vance (MacBride) of New York. When Charlie goes to see Drake, he finds him poisoned in the library of Kirby's apartment. All the guests at Kirby's party immediately become suspects. Herbert Fenton (Cooper) is a schoolmate of Drake's from their Oxford days, but has a snappy attitude when questioned and doesn't seem that concerned that he's dead. Mr. Jeffery (Sutton) is a silky smooth stock broker and business advisor of Kirby's. Ralph Percy (Richmond) is the designer of Kirby's new test bomber. Boggs is the butler, who claims he was falsely arrested in London, which is why he steamed open a radiogram sent to Drake. June Preston is a beautiful actress who has a pearl missing from her brooch, which is later found in the library. Since she said she wasn't in the library, Charlie returns to her apartment later on for further questioning. There she reveals Drake questioned her about Mrs. Patricia Narvo (Weaver), also an actress. She believes her friend is innocent and therefore refused to tell Drake where he could find her. Charlie visits Patricia and her chemist boyfriend, David Elliott (Lowery). He happens to be experimenting with the chemical poison that killed Drake, and he also came to the party to see Drake when the regular butler was called to other duties and the temporary black butler let him in. </P> <P>The funniest scene in the film was when the police are after a Hindu who jumped Jimmy and was following Charlie, as he's Narvo's trusted servant according to Patricia. To get this Hindu, Vance orders that all the Hindus in NYC be brought into a line-up for Jimmy to identify. Wouldn't you know it, one of those brought in is the servant Ramullah (Mehra) posing as the owner of a curio shop, but he's killed inside the station. This part of the investigation was slapstick comedy and ridiculous. There were also a healthy dosage of slurs against the Hindus; such as, the cops saying: "They all look alike to me." "How many more Ali Baba's are there?" </P> <P>The film was not tightly scripted as the story just didn't make sense, making it not logical to follow who the chief suspects were and what they were up to. Also, we never learn why the planes are being sabotaged. But the old formulas to the story come in place, as Charlie in the climax sets a trap for the saboteurs; and, furthermore it is explained that Mrs. Narvo doesn't recognize her husband because he received plastic surgery after a car accident. Too many tacked on explanations still can't clear up all the discrepancies, but that shouldn't really matter to the die-hard fans of the series. </P> <PRE>REVIEWED ON 8/3/2001 GRADE: C </PRE> <P>Dennis Schwartz: "Ozus' World Movie Reviews" </P> <PRE><A HREF="http://www.sover.net/~ozus">http://www.sover.net/~ozus</A> </PRE> <PRE><A HREF="mailto:ozus@sover.net">ozus@sover.net</A> </PRE> <P>ยฉ ALL RIGHTS RESERVED DENNIS SCHWARTZ </P> <PRE>========== X-RAMR-ID: 29031 X-Language: en X-RT-ReviewID: 241807 X-RT-TitleID: 1014423 X-RT-SourceID: 873 X-RT-AuthorID: 1315 X-RT-RatingText: C</PRE> <HR><P CLASS=flush><SMALL>The review above was posted to the <A HREF="news:rec.arts.movies.reviews">rec.arts.movies.reviews</A> newsgroup (<A HREF="news:de.rec.film.kritiken">de.rec.film.kritiken</A> for German reviews).<BR> The Internet Movie Database accepts no responsibility for the contents of the review and has no editorial control. Unless stated otherwise, the copyright belongs to the author.<BR> Please direct comments/criticisms of the review to relevant newsgroups.<BR> Broken URLs inthe reviews are the responsibility of the author.<BR> The formatting of the review is likely to differ from the original due to ASCII to HTML conversion. </SMALL></P> <P ALIGN=CENTER>Related links: <A HREF="/Reviews/">index of all rec.arts.movies.reviews reviews</A></P> </P></BODY></HTML>
xianjunzhengbackup/code
data science/machine_learning_for_the_web/chapter_4/movie/29031.html
HTML
mit
6,319
/* Order List */ var OrderList = (function () { /** * Order List constructor * @constructor */ function OrderList(element, database) { this.element = element; this.database = database; // bloqueia o build enquanto o delay de 3000 milisegundos nรฃo passar this.locked = true; // global list this.list = []; // global list view list this.viewList = []; // a diferenรงa entre viewList e list, รฉ que na list, ficam armazenados os dados 'seguros', na listView, os dados sรฃo apenas ordenados this.config = { orderType: 'time', orderReverse: false, approvedOnly: true, hiddenCanceled: true } } /** * build the list * se tiver uma findString, a funรงรฃo mostra apenas entradas com nome que inclua a string * @param findString {String} */ OrderList.prototype.build = function (findString) { // fix findString value findString = !!findString ? findString.toLowerCase() : ''; this.element.innerHTML = ''; if (!this.locked) { // se nรฃo tiver uma viewList, cria uma if (!this.viewList.length) this.buildViewList(); var self = this; // funรงรฃo para fazer o append dos items dentro da lista, usada no prรณximo for function appendOrderItem(orderItemElement) { self.element.appendChild(orderItemElement); } for (var i = 0; i < this.viewList.length; i++) { // permite apenas transaรงรตes com estado if (!!this.list[i].status) { var addToViewList = false; // permite apenas transaรงรตes com nome parecido com a findString if (this.list[i].clientName) addToViewList = this.list[i].clientName.toLowerCase().includes(findString); if (this.config.hiddenCanceled && !findString.length) if (this.list[i].status == 'Cancelada' || this.list[i].status == 'Pagamento negado pela empresa de cartรฃo de crรฉdito') addToViewList = false; if (addToViewList) appendOrderItem(this.list[i].element); } } } }; OrderList.prototype.buildViewList = function () { var viewList = this.list; viewList.sort(function (a, b) { if (a.clientName > b.clientName) { return 1; } if (a.clientName < b.clientName) { return -1; } // a must be equal to b return 0; }); this.viewList = viewList; }; OrderList.prototype.isInList = function (orderItem) { var filterItemReference = this.list.filter(function (orderListItem) { return orderListItem.reference == orderItem.reference; }); return !!filterItemReference.length; }; OrderList.prototype.push = function (orderItem) { // check if order item is on order list if (!this.isInList(orderItem)) this.list.push(orderItem); }; OrderList.prototype.start = function () { var self = this; this.database.ref('transactions/').on('child_added', function (snap) { // create the order item object var orderItem = new OrderItem(snap.val()); // push order item object to order list self.push(orderItem); document.getElementById('orderList-count').innerText = self.list.length + ' registro processados'; if (!self.locked) { self.buildViewList(); self.build(); } if (!snap.val().reference) console.log(snap.key); }); setTimeout(function () { self.locked = false; self.build(); }, 3000); }; return OrderList; })();
elbitdigital/tonovaso
_src/js/order-list.js
JavaScript
mit
3,324
-- Store the list of articles to be reviewed or being reviewed already -- For ptrp_reviewed, values are: -- 0 = unreviewed, 1 = reviewed, 2 = patrolled, 3 = autopatrolled CREATE TABLE /*_*/pagetriage_page ( ptrp_page_id int unsigned NOT NULL PRIMARY KEY, ptrp_reviewed tinyint unsigned NOT NULL DEFAULT 0, -- page reviewed status ptrp_deleted tinyint unsigned NOT NULL DEFAULT 0, -- the page is nominated for deletion or not ptrp_created VARBINARY(14) NOT NULL, -- page created timestamp ptrp_tags_updated VARBINARY(14) NOT NULL, -- metadata (tags) updated timestamp ptrp_reviewed_updated VARBINARY(14) NOT NULL, -- the timestamp when ptrp_reviewed gets updated ptrp_last_reviewed_by int unsigned NOT NULL default 0 -- the last user who reviewed the page ) /*$wgDBTableOptions*/; CREATE INDEX /*i*/ptrp_reviewed_created_page_del ON /*_*/pagetriage_page (ptrp_reviewed, ptrp_created, ptrp_page_id, ptrp_deleted); CREATE INDEX /*i*/ptrp_created_page_del ON /*_*/pagetriage_page (ptrp_created, ptrp_page_id, ptrp_deleted); CREATE INDEX /*i*/ptrp_del_created_page_reviewed ON /*_*/pagetriage_page (ptrp_deleted, ptrp_created, ptrp_page_id, ptrp_reviewed); CREATE INDEX /*i*/ptrp_updated_page_reviewed ON /*_*/pagetriage_page (ptrp_tags_updated, ptrp_page_id, ptrp_reviewed); CREATE INDEX /*i*/ptrp_reviewed_updated ON /*_*/pagetriage_page (ptrp_reviewed_updated);
wikimedia/mediawiki-extensions-PageTriage
sql/PageTriagePage.sql
SQL
mit
1,368
/* pygame - Python Game Library Module adapted from bufferproxy.c, Copyright (C) 2007 Marcus von Appen This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* This module exports an object which provides a C level interface to another object's buffer. For now only an array structure - __array_struct__ - interface is exposed. When memoryview is ready it will replace the View object. */ #define NO_PYGAME_C_API #include "pygame.h" #include "pgcompat.h" #include "pgview.h" typedef struct { PyObject_HEAD PyObject *capsule; /* Wrapped array struct */ PyObject *parent; /* Object responsible for the view */ PgView_Destructor destructor; /* Optional release callback */ PyObject *pydestructor; /* Python callable destructor */ PyObject *weakrefs; /* There can be reference cycles */ } PgViewObject; static int Pg_GetArrayInterface(PyObject *, PyObject **, PyArrayInterface **); static PyObject *Pg_ArrayStructAsDict(PyArrayInterface *); /** * Helper functions. */ static void _view_default_destructor(PyObject *view) { PgViewObject *v = (PgViewObject *)view; PyObject *rvalue; if (v->pydestructor) { rvalue = PyObject_CallFunctionObjArgs(v->pydestructor, v->capsule, v->parent, 0); PyErr_Clear(); Py_XDECREF(rvalue); } } static PyObject * _view_new_from_type(PyTypeObject *type, PyObject *capsule, PyObject *parent, PgView_Destructor destructor, PyObject *pydestructor) { PgViewObject *self = (PgViewObject *)type->tp_alloc(type, 0); if (!self) { return 0; } self->weakrefs = 0; Py_INCREF(capsule); self->capsule = capsule; if (!parent) { parent = Py_None; } Py_INCREF(parent); self->parent = parent; self->destructor = destructor ? destructor : _view_default_destructor; Py_XINCREF(pydestructor); self->pydestructor = pydestructor; return (PyObject *)self; } static PyObject * _shape_as_tuple(PyArrayInterface *inter_p) { PyObject *shapeobj = PyTuple_New((Py_ssize_t)inter_p->nd); PyObject *lengthobj; Py_ssize_t i; if (!shapeobj) { return 0; } for (i = 0; i < inter_p->nd; ++i) { lengthobj = PyInt_FromLong((long)inter_p->shape[i]); if (!lengthobj) { Py_DECREF(shapeobj); return 0; } PyTuple_SET_ITEM(shapeobj, i, lengthobj); } return shapeobj; } #if SDL_BYTEORDER == SDL_LIL_ENDIAN #define MY_ENDIAN '<' #define OTHER_ENDIAN '>' #else #define MY_ENDIAN '>' #define OTHER_ENDIAN '<' #endif static PyObject * _typekind_as_str(PyArrayInterface *inter_p) { return Text_FromFormat("%c%c%i", inter_p->flags & PAI_NOTSWAPPED ? MY_ENDIAN : OTHER_ENDIAN, inter_p->typekind, inter_p->itemsize); } #undef MY_ENDIAN #undef OTHER_ENDIAN static PyObject *_strides_as_tuple(PyArrayInterface *inter_p) { PyObject *stridesobj = PyTuple_New((Py_ssize_t)inter_p->nd); PyObject *lengthobj; Py_ssize_t i; if (!stridesobj) { return 0; } for (i = 0; i < inter_p->nd; ++i) { lengthobj = PyInt_FromLong((long)inter_p->strides[i]); if (!lengthobj) { Py_DECREF(stridesobj); return 0; } PyTuple_SET_ITEM(stridesobj, i, lengthobj); } return stridesobj; } static PyObject *_data_as_tuple(PyArrayInterface *inter_p) { long readonly = (inter_p->flags & PAI_WRITEABLE) == 0; return Py_BuildValue("NN", PyLong_FromVoidPtr(inter_p->data), PyBool_FromLong(readonly)); } /** * Creates a new PgViewObject. */ static PyObject * _view_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *capsule; PyObject *parent = 0; PyObject *pydestructor = 0; char *keywords[] = {"capsule", "parent", "destructor", 0}; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO:View", keywords, &capsule, &parent, &pydestructor)) { return 0; } if (pydestructor == Py_None) { pydestructor = 0; } return _view_new_from_type(type, capsule, parent, 0, pydestructor); } /** * Deallocates the PgViewObject and its members. */ static void _view_dealloc(PgViewObject *self) { PgView_Destructor destructor = self->destructor; /* Guard against recursion */ self->destructor = 0; if (!destructor) { return; } destructor((PyObject *)self); Py_DECREF(self->capsule); Py_DECREF(self->parent); Py_XDECREF(self->pydestructor); if (self->weakrefs) { PyObject_ClearWeakRefs((PyObject *)self); } Py_TYPE(self)->tp_free(self); } /**** Getter and setter access ****/ static PyObject * _view_get_arraystruct(PgViewObject *self, PyObject *closure) { Py_INCREF(self->capsule); return self->capsule; } static PyObject * _view_get_parent(PgViewObject *self, PyObject *closure) { if (!self->parent) { Py_RETURN_NONE; } Py_INCREF(self->parent); return self->parent; } /**** Methods ****/ /** * Representation method. */ static PyObject * _view_repr (PgViewObject *self) { return Text_FromFormat("<%s(%p)>", Py_TYPE(self)->tp_name, self->capsule); } /** * Getters and setters for the PgViewObject. */ static PyGetSetDef _view_getsets[] = { {"__array_struct__", (getter)_view_get_arraystruct, 0, 0, 0}, {"parent", (getter)_view_get_parent, 0, 0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject PgView_Type = { TYPE_HEAD (NULL, 0) "pygame._view.View", /* tp_name */ sizeof (PgViewObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)_view_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ (reprfunc)_view_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ (Py_TPFLAGS_HAVE_WEAKREFS | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_CLASS), "Object view as an array struct\n", 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ offsetof(PgViewObject, weakrefs), /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ 0, /* tp_members */ _view_getsets, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ _view_new, /* tp_new */ 0, /* tp_free */ #ifndef __SYMBIAN32__ 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ 0 /* tp_del */ #endif }; /**** Module methods ***/ static PyObject * get_array_interface(PyObject *self, PyObject *arg) { PyObject *cobj; PyArrayInterface *inter_p; PyObject *dictobj; if (Pg_GetArrayInterface(arg, &cobj, &inter_p)) { return 0; } dictobj = Pg_ArrayStructAsDict(inter_p); Py_DECREF(cobj); return dictobj; } static PyMethodDef _view_methods[] = { { "get_array_interface", get_array_interface, METH_O, "return an array struct interface as an interface dictionary" }, {0, 0, 0, 0} }; /**** Public C api ***/ static PyObject * PgView_New(PyObject *capsule, PyObject *parent, PgView_Destructor destructor) { if (!capsule) { PyErr_SetString(PyExc_TypeError, "the capsule argument is required"); return 0; } return _view_new_from_type(&PgView_Type, capsule, parent, destructor, 0); } static PyObject * PgView_GetCapsule(PyObject *view) { PyObject *capsule = ((PgViewObject *)view)->capsule; Py_INCREF(capsule); return capsule; } static PyObject * PgView_GetParent(PyObject *view) { PyObject *parent = ((PgViewObject *)view)->parent; Py_INCREF(parent); return parent; } static int Pg_GetArrayInterface(PyObject *obj, PyObject **cobj_p, PyArrayInterface **inter_p) { PyObject *cobj = PyObject_GetAttrString(obj, "__array_struct__"); PyArrayInterface *inter = NULL; if (cobj == NULL) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); PyErr_SetString(PyExc_ValueError, "no C-struct array interface"); } return -1; } #if PG_HAVE_COBJECT if (PyCObject_Check(cobj)) { inter = (PyArrayInterface *)PyCObject_AsVoidPtr(cobj); } #endif #if PG_HAVE_CAPSULE if (PyCapsule_IsValid(cobj, NULL)) { inter = (PyArrayInterface *)PyCapsule_GetPointer(cobj, NULL); } #endif if (inter == NULL || /* conditional or */ inter->two != 2 ) { Py_DECREF(cobj); PyErr_SetString(PyExc_ValueError, "invalid array interface"); return -1; } *cobj_p = cobj; *inter_p = inter; return 0; } static PyObject * Pg_ArrayStructAsDict(PyArrayInterface *inter_p) { PyObject *dictobj = Py_BuildValue("{sisNsNsNsN}", "version", (int)3, "typestr", _typekind_as_str(inter_p), "shape", _shape_as_tuple(inter_p), "strides", _strides_as_tuple(inter_p), "data", _data_as_tuple(inter_p)); if (!dictobj) { return 0; } if (inter_p->flags & PAI_ARR_HAS_DESCR) { if (!inter_p->descr) { Py_DECREF(dictobj); PyErr_SetString(PyExc_ValueError, "Array struct has descr flag set" " but no descriptor"); return 0; } if (PyDict_SetItemString(dictobj, "descr", inter_p->descr)) { return 0; } } return dictobj; } /*DOC*/ static char _view_doc[] = /*DOC*/ "exports View, a generic wrapper object for an array " /*DOC*/ "struct capsule"; MODINIT_DEFINE(_view) { PyObject *module; PyObject *apiobj; static void* c_api[PYGAMEAPI_VIEW_NUMSLOTS]; #if PY3 static struct PyModuleDef _module = { PyModuleDef_HEAD_INIT, "_view", _view_doc, -1, _view_methods, NULL, NULL, NULL, NULL }; #endif if (PyType_Ready(&PgView_Type) < 0) { MODINIT_ERROR; } /* create the module */ #if PY3 module = PyModule_Create(&_module); #else module = Py_InitModule3(MODPREFIX "_view", _view_methods, _view_doc); #endif Py_INCREF(&PgView_Type); if (PyModule_AddObject(module, "View", (PyObject *)&PgView_Type)) { Py_DECREF(&PgView_Type); DECREF_MOD(module); MODINIT_ERROR; } #if PYGAMEAPI_VIEW_NUMSLOTS != 6 #error export slot count mismatch #endif c_api[0] = &PgView_Type; c_api[1] = PgView_New; c_api[2] = PgView_GetCapsule; c_api[3] = PgView_GetParent; c_api[4] = Pg_GetArrayInterface; c_api[5] = Pg_ArrayStructAsDict; apiobj = encapsulate_api(c_api, "_view"); if (apiobj == NULL) { DECREF_MOD(module); MODINIT_ERROR; } if (PyModule_AddObject(module, PYGAMEAPI_LOCAL_ENTRY, apiobj)) { Py_DECREF(apiobj); DECREF_MOD(module); MODINIT_ERROR; } MODINIT_RETURN(module); }
gmittal/aar-nlp-research-2016
src/pygame-pygame-6625feb3fc7f/src/_view.c
C
mit
13,548
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>compcert: Not compatible ๐Ÿ‘ผ</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.1+1 / compcert - 3.4</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">ยซ Up</a> <h1> compcert <small> 3.4 <span class="label label-info">Not compatible ๐Ÿ‘ผ</span> </small> </h1> <p>๐Ÿ“… <em><script>document.write(moment("2022-01-17 00:38:27 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-17 00:38:27 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-ocamlbuild base OCamlbuild binary and libraries distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 1 Virtual package relying on perl coq 8.7.1+1 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.02.3 The OCaml compiler (virtual package) ocaml-base-compiler 4.02.3 Official 4.02.3 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Jacques-Henri Jourdan &lt;jacques-Henri.jourdan@normalesup.org&gt;&quot; homepage: &quot;http://compcert.inria.fr/&quot; dev-repo: &quot;git+https://github.com/AbsInt/CompCert.git&quot; bug-reports: &quot;https://github.com/AbsInt/CompCert/issues&quot; license: &quot;INRIA Non-Commercial License Agreement&quot; build: [ [ &quot;./configure&quot; &quot;ia32-linux&quot; {os = &quot;linux&quot;} &quot;ia32-macosx&quot; {os = &quot;macos&quot;} &quot;ia32-cygwin&quot; {os = &quot;cygwin&quot;} &quot;-bindir&quot; &quot;%{bin}%&quot; &quot;-libdir&quot; &quot;%{lib}%/compcert&quot; &quot;-install-coqdev&quot; &quot;-clightgen&quot; &quot;-coqdevdir&quot; &quot;%{lib}%/coq/user-contrib/compcert&quot; &quot;-ignore-coq-version&quot; ] [make &quot;-j%{jobs}%&quot;] ] install: [ [make &quot;install&quot;] [&quot;install&quot; &quot;-m&quot; &quot;0644&quot; &quot;VERSION&quot; &quot;%{lib}%/coq/user-contrib/compcert/&quot;] ] remove: [ [&quot;rm&quot; &quot;%{bin}%/ccomp&quot;] [&quot;rm&quot; &quot;%{bin}%/clightgen&quot;] [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/compcert&quot;] [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/compcert&quot;] [&quot;rm&quot; &quot;%{share}%/compcert.ini&quot;] [&quot;rm&quot; &quot;%{share}%/man/man1/ccomp.1&quot;] [&quot;sh&quot; &quot;-c&quot; &quot;rmdir -p %{share}%/man/man1 || true&quot;] ] depends: [ &quot;ocaml&quot; {&lt; &quot;4.08&quot;} &quot;coq&quot; {&gt;= &quot;8.8.1&quot; &amp; &lt;= &quot;8.8.2&quot;} &quot;menhir&quot; {&gt;= &quot;20180530&quot; &amp; &lt; &quot;20181006&quot;} ] synopsis: &quot;The CompCert C compiler&quot; authors: &quot;Xavier Leroy &lt;xavier.leroy@inria.fr&gt;&quot; url { src: &quot;https://github.com/AbsInt/CompCert/archive/v3.4.tar.gz&quot; checksum: &quot;md5=122b717e2c48c1a8fe36c89ec5a1050d&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install ๐Ÿœ๏ธ</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-compcert.3.4 coq.8.7.1+1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+1). The following dependencies couldn&#39;t be met: - coq-compcert -&gt; coq &gt;= 8.8.1 -&gt; ocaml &gt;= 4.05.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-compcert.3.4</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install ๐Ÿš€</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall ๐Ÿงน</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> ยฉ Guillaume Claret ๐Ÿฃ </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.02.3-2.0.6/released/8.7.1+1/compcert/3.4.html
HTML
mit
7,904
<?php namespace AppBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; class PublicController extends Controller { /** * @Route("public/accueil", name="accueil") */ public function ViewAction(Request $request) { $em = $this->getDoctrine()->getManager(); $products = $em->getRepository("adminBundle:Product")->findAll(); $produitLesPlusEnStock = $em->getRepository('adminBundle:Product')->findbystock(); return $this->render('Public/Accueil.html.twig', [ 'produitLesPlusEnStock' => $produitLesPlusEnStock, 'products' => $products ]); } /** * @Route("public/accueil/cookiesAgree", name="cookiesAgree") */ public function cookiesAgreeAction(Request $request) { $disabled = $request->get('disclaimer'); $session = $request->getSession(); $session->set('disclaimer', $disabled); } }
cbelier/symfony
src/AppBundle/Controller/PublicController.php
PHP
mit
1,083
// var Feedparser = Npm.require('feedparser') // , request = Npm.require('request') // , fs = Npm.require('fs') // , Fiber = Npm.require('fibers'); var request = Npm.require('request'), fs = Npm.require('fs'), Fiber = Npm.require('fibers'); function done(err, result){ if(err){ console.log(err); } else if(result) { console.log(result); }; }; // Adds a new feed. function addFeed(url, userId, done){ if( !(Feeds.findOne({url: url, userId: userId})) ){ request(url) .pipe(new Feedparser([])) .on('meta', function(meta){ Fiber(function(){ Feeds.insert({ title: meta.title, url: url, userId: userId, unread: 0 }, function(err, feedId){ if(feedId) { readFeed(Feeds.findOne({_id: feedId})); } }); }).run(); }) .on('error', function(error){ console.log(error); }); return "Added feed " + url; } else { return "Feed " + url + " already exists."; }; }; // Adds a new article to the feed. function addArticle(article, feed, done){ Fiber(function(){ if(Articles.findOne({feedId: feed._id, guid: article.guid})) return false; var date = null; if (article.date){ date = article.date; } else { date = article.pubdate; }; Articles.insert({ title: article.title, date: date, pubdate: article.pubdate, author: article.author, content: article.description, link: article.link, origlink: article.origlink, feedId: feed._id, userId: feed.userId, summary: article.summary, guid: article.guid, read: false, starred: false, comments: article.comments, image: article.image, categories: article.categories, source: article.source, }); Feeds.update(feed._id, {$inc: {unread: 1}}); }).run(); }; // Reads the feed and updates the articles. function readFeed(feed){ if(Feeds.findOne({_id: feed._id})){ request(feed.url) .pipe(new Feedparser([])) .on('error', function (error) { return error; }) .on('readable', function() { var stream = this, item; while (item = stream.read()) { addArticle(item, feed, done); } }); updateUnreadCount(feed); return "Feed updated"; } else { return "Feed does not exist"; }; }; // Removes all articles. function removeAllArticles(){ Articles.remove({}, function(){ updateAllUnreadCount(done); return "All articles removed"; }); }; // Updates the unread count of a feed. function updateUnreadCount(feed, done){ var unreadCount = Articles.find({feedId: feed._id, read: false}).count(); Feeds.update(feed._id, {$set: {unread: unreadCount}}, done); }; // Updates the unread count of all feeds. function updateAllUnreadCount(done){ Feeds.find({userId: this.userId}).forEach(updateUnreadCount(feed, done)); }; // Marks all articles in a feed as read. function markAllRead(feed){ Articles.update({feedId: feed._id}, {$set: {read: true}}, {multi: true}, function(){ updateUnreadCount(feed, done); return "Marked all read"; }); }; // Mark a single article as read. function markRead(articleId, done){ var article = Articles.findOne({_id: articleId}); if (!article.read) { Articles.update(article._id, {$set: {read: true}}, done); Feeds.update(article.feedId, {$inc: {unread: -1}}, done); }; }; // Mark a single article as unread. function markUnread(articleId, done){ var article = Articles.findOne({_id: articleId}); if (article.read){ Articles.update(article._id, {$set: {read: false}}, done); Feeds.update(article.feedId, {$inc: {unread: 1}}, done); }; }; // Remove a single feed, and all it's unstarred articles. function removeFeed(feed, done){ Feeds.remove(feed._id, done); Articles.remove({feedId: feed._id, starred: false}, done); }; // Remove a single article. function removeArticle(articleId, done){ Articles.remove(articleId, done); }; Meteor.methods({ addFeed: function(url) { return addFeed(url, this.userId, done); }, removeFeed: function(feed){ return removeFeed(feed, done); }, removeAll: function(){ return removeAllArticles(); }, refreshFeed: function(feed){ return readFeed(feed); }, markAllRead: function(feed){ return markAllRead(feed); }, markRead: function(articleId){ return markRead(articleId, done); }, markUnread: function(articleId){ return markUnread(articleId, done); } }); Meteor.startup(function () { // code to run on server at startup });
DBeath/meteor-rss
server/server.js
JavaScript
mit
4,419
๏ปฟusing System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using ChallengeAccepted.Data.Contracts; using ChallengeAccepted.Models; namespace ChallengeAccepted.Api.Controllers { // [Authorize] public class BaseController : ApiController { protected IChallengeAcceptedData data; private User currentUser; public BaseController(IChallengeAcceptedData data) { this.data = data; //this.CurrentUser = this.data.Users.All().FirstOrDefault(u => u.UserName == this.User.Identity.Name); } protected User CurrentUser { get { if (this.currentUser == null) { this.currentUser = this.data.Users .All() .FirstOrDefault(x => x.UserName == this.User.Identity.Name); } return this.currentUser; } } } }
NativeScriptHybrids/ChallengeAccepted
ChallengeAccepted.Service/ChallengeAccepted.Api/Controllers/BaseController.cs
C#
mit
1,034
// DOM elements var $source; var $photographer; var $save; var $textColor; var $logo; var $crop; var $logoColor; var $imageLoader; var $imageLink; var $imageLinkButton; var $canvas; var canvas; var $qualityQuestions; var $copyrightHolder; var $dragHelp; var $filename; var $fileinput; var $customFilename; // Constants var IS_MOBILE = Modernizr.touch && Modernizr.mq('screen and max-width(700px)'); var MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif']; // state var scaledImageHeight; var scaledImageWidth; var fixedWidth = 1000; var previewScale = IS_MOBILE ? 0.32 : 0.64; var dy = 0; var dx = 0; var logoDimensions = { 'npr': { w: 150, h: 51 }, 'music': { w: 306, h: 81 } }; var elementPadding = 40; var image; var imageFilename = 'image'; var currentCrop = 'twitter'; var currentLogo = 'npr'; var currentLogoColor = 'white'; var currentTextColor = 'white'; var currentCopyright; var credit = 'Belal Khan/Flickr' var shallowImage = false; // JS objects var ctx; var img = new Image(); var logo = new Image(); var onDocumentLoad = function(e) { $source = $('#source'); $photographer = $('#photographer'); $canvas = $('#imageCanvas'); canvas = $canvas[0]; $imageLoader = $('#imageLoader'); $imageLink = $('#imageLink'); $imageLinkButton = $('#imageLinkButton'); ctx = canvas.getContext('2d'); $save = $('.save-btn'); $textColor = $('input[name="textColor"]'); $logo = $('input[name="logo"]'); $crop = $('input[name="crop"]'); $logoColor = $('input[name="logoColor"]'); $qualityQuestions = $('.quality-question'); $copyrightHolder = $('.copyright-holder'); $dragHelp = $('.drag-help'); $filename = $('.fileinput-filename'); $fileinput = $('.fileinput'); $customFilename = $('.custom-filename'); img.src = APP_CONFIG.DEFAULT_IMAGE; img.onload = onImageLoad; logo.src = '../assets/logo-' + currentLogo + '-' + currentLogoColor + '.png'; logo.onload = renderCanvas; $photographer.on('keyup', renderCanvas); $source.on('keyup', renderCanvas); $imageLoader.on('change', handleImage); $imageLinkButton.on('click', handleImageLink); $save.on('click', onSaveClick); $textColor.on('change', onTextColorChange); $logo.on('change', onLogoChange); $logoColor.on('change', onLogoColorChange); $crop.on('change', onCropChange); $canvas.on('mousedown touchstart', onDrag); $copyrightHolder.on('change', onCopyrightChange); $customFilename.on('click', function(e) { e.stopPropagation(); }) $("body").on("contextmenu", "canvas", function(e) { return false; }); $imageLink.keypress(function(e) { if (e.keyCode == 13) { handleImageLink(); } }); // $imageLink.on('paste', handleImageLink); renderCanvas(); } /* * Draw the image, then the logo, then the text */ var renderCanvas = function() { // canvas is always the same width canvas.width = fixedWidth; // if we're cropping, use the aspect ratio for the height if (currentCrop !== 'original') { canvas.height = fixedWidth / (16/9); } // clear the canvas ctx.clearRect(0,0,canvas.width,canvas.height); // determine height of canvas and scaled image, then draw the image var imageAspect = img.width / img.height; if (currentCrop === 'original') { canvas.height = fixedWidth / imageAspect; scaledImageHeight = canvas.height; ctx.drawImage( img, 0, 0, fixedWidth, scaledImageHeight ); } else { if (img.width / img.height > canvas.width / canvas.height) { shallowImage = true; scaledImageHeight = fixedWidth / imageAspect; scaledImageWidth = canvas.height * (img.width / img.height) ctx.drawImage( img, 0, 0, img.width, img.height, dx, dy, scaledImageWidth, canvas.height ); } else { shallowImage = false; scaledImageHeight = fixedWidth / imageAspect; ctx.drawImage( img, 0, 0, img.width, img.height, dx, dy, fixedWidth, scaledImageHeight ); } } // set alpha channel, draw the logo if (currentLogoColor === 'white') { ctx.globalAlpha = "0.8"; } else { ctx.globalAlpha = "0.6"; } ctx.drawImage( logo, elementPadding, currentLogo === 'npr'? elementPadding : elementPadding - 14, logoDimensions[currentLogo]['w'], logoDimensions[currentLogo]['h'] ); // reset alpha channel so text is not translucent ctx.globalAlpha = "1"; // draw the text ctx.textBaseline = 'bottom'; ctx.textAlign = 'left'; ctx.fillStyle = currentTextColor; ctx.font = 'normal 20pt "Gotham SSm"'; if (currentTextColor === 'white') { ctx.shadowColor = 'rgba(0,0,0,0.7)'; ctx.shadowOffsetX = 0; ctx.shadowOffsetY = 0; ctx.shadowBlur = 10; } if (currentCopyright) { credit = buildCreditString(); } var creditWidth = ctx.measureText(credit); ctx.fillText( credit, canvas.width - (creditWidth.width + elementPadding), canvas.height - elementPadding ); validateForm(); } /* * Build the proper format for the credit based on current copyright */ var buildCreditString = function() { var creditString; var val = $copyrightHolder.val(); if (val === 'npr') { if ($photographer.val() === '') { creditString = 'NPR'; } else { creditString = $photographer.val() + '/NPR'; } } else if (val === 'freelance') { creditString = $photographer.val() + ' for NPR'; if ($photographer.val() !== '') { $photographer.parents('.form-group').removeClass('has-warning'); } else { $photographer.parents('.form-group').addClass('has-warning'); } } else if (val === 'ap') { if ($photographer.val() !== '') { creditString = $photographer.val() + '/AP'; } else { creditString = 'AP'; } } else if (val === 'getty') { if ($photographer.val() !== '') { creditString = $photographer.val() + '/Getty Images'; } else { creditString = 'Getty Images'; } } else { if ($photographer.val() !== '') { creditString = $photographer.val() + '/' + $source.val(); } else { creditString = $source.val(); } if ($source.val() !== '') { $source.parents('.form-group').removeClass('has-warning'); } else { $source.parents('.form-group').addClass('has-warning'); } } return creditString; } /* * Check to see if any required fields have not been * filled out before enabling saving */ var validateForm = function() { if ($('.has-warning').length === 0 && currentCopyright) { $save.removeAttr('disabled'); $("body").off("contextmenu", "canvas"); } else { $save.attr('disabled', ''); $("body").on("contextmenu", "canvas", function(e) { return false; }); } } /* * Handle dragging the image for crops when applicable */ var onDrag = function(e) { e.preventDefault(); var originY = e.clientY||e.originalEvent.targetTouches[0].clientY; originY = originY/previewScale; var originX = e.clientX||e.originalEvent.targetTouches[0].clientX; originX = originX/previewScale; var startY = dy; var startX = dx; if (currentCrop === 'original') { return; } function update(e) { var dragY = e.clientY||e.originalEvent.targetTouches[0].clientY; dragY = dragY/previewScale; var dragX = e.clientX||e.originalEvent.targetTouches[0].clientX; dragX = dragX/previewScale; if (shallowImage === false) { if (Math.abs(dragY - originY) > 1) { dy = startY - (originY - dragY); // Prevent dragging image below upper bound if (dy > 0) { dy = 0; return; } // Prevent dragging image above lower bound if (dy < canvas.height - scaledImageHeight) { dy = canvas.height - scaledImageHeight; return; } renderCanvas(); } } else { if (Math.abs(dragX - originX) > 1) { dx = startX - (originX - dragX); // Prevent dragging image below left bound if (dx > 0) { dx = 0; return; } // Prevent dragging image above right bound if (dx < canvas.width - scaledImageWidth) { dx = canvas.width - scaledImageWidth; return; } renderCanvas(); } } } // Perform drag sequence: $(document).on('mousemove.drag touchmove', _.debounce(update, 5, true)) .on('mouseup.drag touchend', function(e) { $(document).off('mouseup.drag touchmove mousemove.drag'); update(e); }); } /* * Take an image from file input and load it */ var handleImage = function(e) { var reader = new FileReader(); reader.onload = function(e){ // reset dy value dy = 0; dx = 0; image = e.target.result; imageFilename = $('.fileinput-filename').text().split('.')[0]; img.src = image; $customFilename.text(imageFilename); $customFilename.parents('.form-group').addClass('has-file'); $imageLink.val(''); $imageLink.parents('.form-group').removeClass('has-file'); } reader.readAsDataURL(e.target.files[0]); } /* * Load a remote image */ var handleImageLink = function(e) { var requestStatus = // Test if image URL returns a 200 $.ajax({ url: $imageLink.val(), success: function(data, status, xhr) { var responseType = xhr.getResponseHeader('content-type').toLowerCase(); // if content type is jpeg, gif or png, load the image into the canvas if (MIME_TYPES.indexOf(responseType) >= 0) { // reset dy value dy = 0; dx = 0; $fileinput.fileinput('clear'); $imageLink.parents('.form-group').addClass('has-file').removeClass('has-error'); $imageLink.parents('.input-group').next().text('Click to edit name'); img.src = $imageLink.val(); img.crossOrigin = "anonymous" var filename = $imageLink.val().split('/'); imageFilename = filename[filename.length - 1].split('.')[0]; $imageLink.val(imageFilename); // otherwise, display an error } else { $imageLink.parents('.form-group').addClass('has-error'); $imageLink.parents('.input-group').next().text('Not a valid image URL'); return; } }, error: function(data) { $imageLink.parents('.form-group').addClass('has-error'); $imageLink.parents('.input-group').next().text('Not a valid image URL'); } }); } /* * Set dragging status based on image aspect ratio and render canvas */ var onImageLoad = function(e) { // firefox won't render image on first try without this ยฏ\_(ใƒ„)_/ยฏ img.src = img.src; renderCanvas(); onCropChange(); } /* * Load the logo based on radio buttons */ var loadLogo = function() { logo.src = '../assets/logo-' + currentLogo + '-' + currentLogoColor + '.png'; } /* * Download the image on save click */ var onSaveClick = function(e) { e.preventDefault(); /// create an "off-screen" anchor tag var link = document.createElement('a'), e; /// the key here is to set the download attribute of the a tag if ($customFilename.text()) { imageFilename = $customFilename.text(); } if ($imageLink.val() !== "") { var filename = $imageLink.val().split('/'); imageFilename = filename[filename.length - 1].split('.')[0]; } link.download = 'twitterbug-' + imageFilename + '.png'; /// convert canvas content to data-uri for link. When download /// attribute is set the content pointed to by link will be /// pushed as "download" in HTML5 capable browsers link.href = canvas.toDataURL(); link.target = "_blank"; /// create a "fake" click-event to trigger the download if (document.createEvent) { e = document.createEvent("MouseEvents"); e.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); link.dispatchEvent(e); } else if (link.fireEvent) { link.fireEvent("onclick"); } } /* * Handle logo radio button clicks */ var onLogoColorChange = function(e) { currentLogoColor = $(this).val(); loadLogo(); renderCanvas(); } /* * Handle text color radio button clicks */ var onTextColorChange = function(e) { currentTextColor = $(this).val(); renderCanvas(); } /* * Handle logo radio button clicks */ var onLogoChange = function(e) { currentLogo = $(this).val(); loadLogo(); renderCanvas(); } /* * Handle crop radio button clicks */ var onCropChange = function() { currentCrop = $crop.filter(':checked').val(); if (currentCrop !== 'original') { var dragClass = shallowImage ? 'is-draggable shallow' : 'is-draggable'; $canvas.addClass(dragClass); $dragHelp.show(); } else { $canvas.removeClass('is-draggable shallow'); $dragHelp.hide(); } renderCanvas(); } /* * Show the appropriate fields based on the chosen copyright */ var onCopyrightChange = function() { currentCopyright = $copyrightHolder.val(); $photographer.parents('.form-group').removeClass('has-warning'); $source.parents('.form-group').removeClass('has-warning'); if (currentCopyright === 'npr') { $photographer.parents('.form-group').removeClass('required').slideDown(); $source.parents('.form-group').slideUp(); } else if (currentCopyright === 'freelance') { $photographer.parents('.form-group').slideDown(); $source.parents('.form-group').slideUp(); $photographer.parents('.form-group').addClass('has-warning required'); } else if (currentCopyright === 'ap' || currentCopyright === 'getty') { $photographer.parents('.form-group').removeClass('required').slideDown(); $source.parents('.form-group') .slideUp() .removeClass('has-warning required'); } else if (currentCopyright === 'third-party') { $photographer.parents('.form-group').removeClass('required').slideDown(); $source.parents('.form-group').slideDown(); $source.parents('.form-group').addClass('has-warning required'); } else { credit = ''; $photographer.parents('.form-group').slideUp(); $source.parents('.form-group') .slideUp() .parents('.form-group').removeClass('has-warning required'); } renderCanvas(); } $(onDocumentLoad);
nprapps/portland
www/js/waterbug.js
JavaScript
mit
15,778
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="author" content="Open Knowledge"> <meta name="description" content="The Global Open Data Index assesses the state of open government data around the world. "> <meta name="keywords" content="Open Government, Open Data, Government Transparency, Open Knowledge "> <meta property="og:type" content="website"/> <meta property="og:title" content="Open Data Index - Open Knowledge"/> <meta property="og:site_name" content="Open Data Index"/> <meta property="og:description" content="The Global Open Data Index assesses the state of open government data around the world."/> <meta property="og:image" content="/static/images/favicon.ico"/> <title>Kosovo / Procurement tenders (2014) | Global Open Data Index by Open Knowledge</title> <base href="/"> <!--[if lt IE 9]> <script src="/static/vendor/html5shiv.min.js"></script> <![endif]--> <link rel="stylesheet" href="/static/css/site.css"> <link rel="icon" href="/static/images/favicon.ico"> <script> var siteUrl = ''; </script> </head> <body class="na"> <div class="fixed-ok-panel"> <div id="ok-panel" class="closed"> <iframe src="http://assets.okfn.org/themes/okfn/okf-panel.html" scrolling="no"></iframe> </div> <a class="ok-ribbon"><img src="http://okfnlabs.org/ok-panel/assets/images/ok-ribbon.png" alt="Open Knowledge"></a> </div> <header id="header"> <nav class="navbar navbar-default" role="navigation"> <div class="container"> <div> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <div class="logo"> <a href="/"> <img src="/static/images/logo2.png"> <span>Global<br/>Open Data Index</span> </a> </div> </div> <div class="collapse navbar-collapse" id="navbar-collapse"> <ul class="nav navbar-nav" style="margin-right: 132px;"> <li> <a href="/place/" title="About the Open Data Index project"> Places </a> </li> <li> <a href="/dataset/" title="About the Open Data Index project"> Datasets </a> </li> <li> <a href="/download/" title="Download Open Data Index data"> Download </a> </li> <li> <a href="/insights/" title="Insights"> Insights </a> </li> <li> <a href="/methodology/" title="The methodology behind the Open Data Index"> Methodology </a> </li> <li> <a href="/about/" title="About the Open Data Index project"> About </a> </li> <li> <a href="/press/" title="Press information for the Open Data Index"> Press </a> </li> </ul> </div> </div> </div> </nav> </header> <div class="container"> <div class="content"> <div class="row"> <div class="col-md-12"> <ol class="breadcrumb"> <li> <a href="/">Home</a> </li> <li class="active">Kosovo / Procurement tenders (2014)</li> </ol> <header class="page-header"> <h1>Kosovo / Procurement tenders (2014)</h1> </header> <h3>Sorry</h3> <p> There is no data available for Kosovo / Procurement tenders (2014) in the Index. </p> </div> </div> </div> </div> <footer id="footer"> <div class="container"> <div class="row"> <div class="footer-main col-md-8"> <div class="footer-attribution"> <p> <a href="http://opendefinition.org/ossd/" title="Open Online Software Service"> <img src="http://assets.okfn.org/images/ok_buttons/os_80x15_orange_grey.png" alt="" border=""/> </a> <a href="http://opendefinition.org/okd/" title="Open Online Software Service"> <img src="http://assets.okfn.org/images/ok_buttons/od_80x15_blue.png" alt="" border=""/> </a> <a href="http://opendefinition.org/okd/" title="Open Content"> <img src="http://assets.okfn.org/images/ok_buttons/oc_80x15_blue.png" alt="" border=""/> </a> &ndash; <a href="http://creativecommons.org/licenses/by/3.0/" title="Content Licensed under a CC Attribution"></a> <a href="http://opendatacommons.org/licenses/pddl/1.0" title="Data License (Public Domain)">Data License (Public Domain)</a> </p> </div> <div class="footer-meta"> <p> This service is run by <a href="https://okfn.org/" title="Open Knowledge">Open Knowledge</a> </p> <a class="naked" href="http://okfn.org/" title="Open Knowledge"><img src="http://assets.okfn.org/p/okfn/img/okfn-logo-landscape-black-s.png" alt="" height="28"></a> </div> </div> <div class="footer-links col-md-2"> <li><a href="http://okfn.org/" title="Open Knowledge">Open Knowledge</a></li> <li><a href="http://okfn.org/opendata/" title="What is Open Data?">What is Open Data?</a></li> <li><a href="http://census.okfn.org/" title="Run your own Index">Run your own Index</a></li> <li><a href="https://github.com/okfn/opendataindex" title="The source code for Open Data Index">Source Code</a></li> </div> <div class="footer-links col-md-2"> <li><a href="/" title="Open Data Index home">Home</a></li> <li><a href="/download/" title="Download data">Download</a></li> <li><a href="/methodology/" title="The methodology behind the Open Data Index">Methodology</a></li> <li><a href="/faq/" title=" Open Data Index FAQ">FAQ</a></li> <li><a href="/about/" title="About the Open Data Index">About</a></li> <li><a href="/about/" title="Contact us">Contact</a></li> <li><a href="/press/" title="Press">Press</a></li> </div> </div> </div> </footer> <script data-main="/static/scripts/site" src="/static/scripts/require.js"></script> </body> </html>
okfn/opendataindex-2015
place/kosovo/procurement/2014/index.html
HTML
mit
8,150
package com.daviancorp.android.ui.adapter; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import com.daviancorp.android.ui.list.ArmorExpandableListFragment; public class ArmorExpandableListPagerAdapter extends FragmentPagerAdapter { // Tab titles private String[] tabs = {"Blade", "Gunner", "Both"}; public ArmorExpandableListPagerAdapter(FragmentManager fm) { super(fm); } @Override public Fragment getItem(int index) { switch (index) { case 0: // Armor list for both Blademaster return ArmorExpandableListFragment.newInstance("Blade"); case 1: // Armor list for both Gunner return ArmorExpandableListFragment.newInstance("Gunner"); case 2: // Armor list for both Blademaster and Gunner return ArmorExpandableListFragment.newInstance("Both"); default: return null; } } @Override public CharSequence getPageTitle(int index) { return tabs[index]; } @Override public int getCount() { // get item count - equal to number of tabs return 3; } }
zachdayz/MonsterHunter4UDatabase
app/src/main/java/com/daviancorp/android/ui/adapter/ArmorExpandableListPagerAdapter.java
Java
mit
1,301
package belight; /** * Created 4/16/16. Description... * * @author Andrey Chergik <achergik@gmail.com> */ import java.util.HashSet; import java.util.Set; import com.amazon.speech.speechlet.lambda.SpeechletRequestStreamHandler; /** * This class could be the handler for an AWS Lambda function powering an Alexa Skills Kit * experience. To do this, simply set the handler field in the AWS Lambda console to * "HelloWorldSpeachletRequestStreamHandler" For this to work, you'll also need to build * this project using the {@code lambda-compile} Ant task and upload the resulting zip file to power * your function. */ public final class HelloWorldSpeachletRequestStreamHandler extends SpeechletRequestStreamHandler { private static final Set<String> supportedApplicationIds = new HashSet<String>(); static { /* * This Id can be found on https://developer.amazon.com/edw/home.html#/ "Edit" the relevant * Alexa Skill and put the relevant Application Ids in this Set. */ supportedApplicationIds.add("amzn1.echo-sdk-ams.app.faa4a039-14a1-40c4-91f1-6193ac91eb77"); } public HelloWorldSpeachletRequestStreamHandler() { super(new BeLightSpeachlet(), supportedApplicationIds); } }
intervoice/belight
src/main/java/belight/HelloWorldSpeachletRequestStreamHandler.java
Java
mit
1,255
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>constructive-geometry: Not compatible</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.0 / constructive-geometry - 8.8.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">ยซ Up</a> <h1> constructive-geometry <small> 8.8.0 <span class="label label-info">Not compatible</span> </small> </h1> <p><em><script>document.write(moment("2020-07-31 07:04:33 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-07-31 07:04:33 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.12 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.7.0 Formal proof management system. num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/constructive-geometry&quot; license: &quot;Unknown&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/ConstructiveGeometry&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.8&quot; &amp; &lt; &quot;8.9~&quot;} ] tags: [ &quot;keyword: Constructive mathematics&quot; &quot;keyword: Geometry&quot; &quot;category: Mathematics/Geometry/General&quot; ] authors: [ &quot;Gilles Kahn&quot; ] bug-reports: &quot;https://github.com/coq-contribs/constructive-geometry/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/constructive-geometry.git&quot; synopsis: &quot;Elements of Constructive Geometry&quot; description: &quot;Constructive Geometry following Jan von Plato.&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/constructive-geometry/archive/v8.8.0.tar.gz&quot; checksum: &quot;md5=2e8694d62ceca9d3fd54a84064acbfc6&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-constructive-geometry.8.8.0 coq.8.7.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.0). The following dependencies couldn&#39;t be met: - coq-constructive-geometry -&gt; coq &gt;= 8.8 Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-constructive-geometry.8.8.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. ยฉ Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.05.0-2.0.6/released/8.7.0/constructive-geometry/8.8.0.html
HTML
mit
6,943
#region License /* The MIT License * * Copyright (c) 2011 Red Badger Consulting * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #endregion namespace RedBadger.Xpf.Data { internal enum BindingResolutionMode { Immediate, Deferred } }
redbadger/XPF
XPF/RedBadger.Xpf/Data/BindingResolutionMode.cs
C#
mit
1,329
package com.paouke.gdp.googleTranslate.helper; import com.alibaba.fastjson.JSONArray; import com.paouke.gdp.googleTranslate.bean.DictResultBean; import com.paouke.gdp.googleTranslate.bean.WordsInfoBean; import com.paouke.gdp.googleTranslate.constant.GdpGoogleTranslateConstant; import jodd.http.HttpRequest; import jodd.http.HttpResponse; public class CallGoogleApiHelper { public static String getGoogleTkkAlgorithm() { HttpResponse httpResponse = HttpRequest.get(GdpGoogleTranslateConstant.URL_GOOGLE_CRAWLER) .header("User-Agent", "Mozilla/5.0") .send(); String html = httpResponse.bodyText(); if(html.contains("TKK=")) { return "var TKK" + html.split("TKK")[1].split("\\);")[0] + ");"; } else { return null; } } public static DictResultBean callTranslateApi(WordsInfoBean wordsInfoBean) { if(wordsInfoBean.getSourceLangType() == null) wordsInfoBean.setSourceLangType(GdpGoogleTranslateConstant.KEY_LANGUAGE_TYPE_AUTO); if(wordsInfoBean.getPurposeLangType() == null) wordsInfoBean.setPurposeLangType(GdpGoogleTranslateConstant.KEY_LANGUAGE_TYPE_ZNCH); DictResultBean dictResultBean = callGoogleTranslateApi(wordsInfoBean); if(dictResultBean == null) return null; if(GdpGoogleTranslateConstant.KEY_LANGUAGE_TYPE_ZNCH.equals(dictResultBean.getSourceLangType())) { wordsInfoBean.setPurposeLangType(GdpGoogleTranslateConstant.KEY_LANGUAGE_TYPE_EN); return callGoogleTranslateApi(wordsInfoBean); } else { return dictResultBean; } } private static DictResultBean callGoogleTranslateApi(WordsInfoBean wordsInfoBean) { DictResultBean dictResultBean = new DictResultBean(); HttpResponse httpResponse = HttpRequest.get(GdpGoogleTranslateConstant.URL_GOOGLE_TRANSLATE) .header("User-Agent", "Mozilla/5.0") .query("sl", wordsInfoBean.getSourceLangType()) .query("tl", wordsInfoBean.getPurposeLangType()) .query("tk", wordsInfoBean.getToken()) .query("q", wordsInfoBean.getWords()) .send(); if(httpResponse.statusCode() != 200) { return null; } else { JSONArray JARes = JSONArray.parseArray(httpResponse.bodyText()); if(JARes != null && JARes.size() >= 3) { dictResultBean.setSourceLangType(JARes.getString(2)); JSONArray JATrans = JARes.getJSONArray(0); if(JATrans != null) { StringBuilder querySb = new StringBuilder(); StringBuilder tranSb = new StringBuilder(); for(int i = 0; i < JATrans.size() - 1; i++) { JSONArray JATran = JATrans.getJSONArray(i); querySb.append(JATran.getString(1)); tranSb.append(JATran.getString(0)); } dictResultBean.setQuery(querySb.toString()); dictResultBean.setTranslation(tranSb.toString()); } } else { throw new RuntimeException("ๅค„็†้”™่ฏฏ๏ผ"); } } return dictResultBean; } public static void main(String[] args){ System.out.println(getGoogleTkkAlgorithm()); } }
NinthCode/gdp
com.paouke.gdp.googleTranslate/src/main/java/com/paouke/gdp/googleTranslate/helper/CallGoogleApiHelper.java
Java
mit
3,402
๏ปฟusing System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // ๆœ‰ๅ…ณ็จ‹ๅบ้›†็š„ๅธธ่ง„ไฟกๆฏ้€š่ฟ‡ไปฅไธ‹ // ็‰นๆ€ง้›†ๆŽงๅˆถใ€‚ๆ›ดๆ”น่ฟ™ไบ›็‰นๆ€งๅ€ผๅฏไฟฎๆ”น // ไธŽ็จ‹ๅบ้›†ๅ…ณ่”็š„ไฟกๆฏใ€‚ [assembly: AssemblyTitle("JsonHelper")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("JsonHelper")] [assembly: AssemblyCopyright("Copyright ยฉ 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // ๅฐ† ComVisible ่ฎพ็ฝฎไธบ false ไฝฟๆญค็จ‹ๅบ้›†ไธญ็š„็ฑปๅž‹ // ๅฏน COM ็ป„ไปถไธๅฏ่งใ€‚ๅฆ‚ๆžœ้œ€่ฆไปŽ COM ่ฎฟ้—ฎๆญค็จ‹ๅบ้›†ไธญ็š„็ฑปๅž‹๏ผŒ // ๅˆ™ๅฐ†่ฏฅ็ฑปๅž‹ไธŠ็š„ ComVisible ็‰นๆ€ง่ฎพ็ฝฎไธบ trueใ€‚ [assembly: ComVisible(false)] // ๅฆ‚ๆžœๆญค้กน็›ฎๅ‘ COM ๅ…ฌๅผ€๏ผŒๅˆ™ไธ‹ๅˆ— GUID ็”จไบŽ็ฑปๅž‹ๅบ“็š„ ID [assembly: Guid("dc25dd33-dd16-4993-bf9f-45a1b685824f")] // ็จ‹ๅบ้›†็š„็‰ˆๆœฌไฟกๆฏ็”ฑไธ‹้ขๅ››ไธชๅ€ผ็ป„ๆˆ: // // ไธป็‰ˆๆœฌ // ๆฌก็‰ˆๆœฌ // ็”Ÿๆˆๅท // ไฟฎ่ฎขๅท // // ๅฏไปฅๆŒ‡ๅฎšๆ‰€ๆœ‰่ฟ™ไบ›ๅ€ผ๏ผŒไนŸๅฏไปฅไฝฟ็”จโ€œ็”Ÿๆˆๅทโ€ๅ’Œโ€œไฟฎ่ฎขๅทโ€็š„้ป˜่ฎคๅ€ผ๏ผŒ // ๆ–นๆณ•ๆ˜ฏๆŒ‰ๅฆ‚ไธ‹ๆ‰€็คบไฝฟ็”จโ€œ*โ€: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
fsjohnhuang/Kit.Net
BaseLibrary/JsonHelper/Properties/AssemblyInfo.cs
C#
mit
1,304
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 11 02:01:23 EET 2011 --> <TITLE> SymmetricPerspectiveCameraProxy </TITLE> <META NAME="date" CONTENT="2011-12-11"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="SymmetricPerspectiveCameraProxy"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SymmetricPerspectiveCameraProxy.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/SpriteProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/TextProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../../index.html?edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/SymmetricPerspectiveCameraProxy.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="SymmetricPerspectiveCameraProxy.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer.ComponentProxy">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer</FONT> <BR> Class SymmetricPerspectiveCameraProxy</H2> <PRE> java.lang.Object <IMG SRC="../../../../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/AbstractProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer">edu.cmu.cs.stage3.alice.scenegraph.renderer.AbstractProxy</A> <IMG SRC="../../../../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/ElementProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer">edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer.ElementProxy</A> <IMG SRC="../../../../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/ComponentProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer">edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer.ComponentProxy</A> <IMG SRC="../../../../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/CameraProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer">edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer.CameraProxy</A> <IMG SRC="../../../../../../../../resources/inherit.gif" ALT="extended by "><B>edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer.SymmetricPerspectiveCameraProxy</B> </PRE> <HR> <DL> <DT><PRE>public abstract class <B>SymmetricPerspectiveCameraProxy</B><DT>extends <A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/CameraProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer">CameraProxy</A></DL> </PRE> <P> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/SymmetricPerspectiveCameraProxy.html#SymmetricPerspectiveCameraProxy()">SymmetricPerspectiveCameraProxy</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer.ComponentProxy"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer.<A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/ComponentProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer">ComponentProxy</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/ComponentProxy.html#initialize(edu.cmu.cs.stage3.alice.scenegraph.Element, edu.cmu.cs.stage3.alice.scenegraph.renderer.AbstractProxyRenderer)">initialize</A>, <A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/ComponentProxy.html#onAbsoluteTransformationChange()">onAbsoluteTransformationChange</A>, <A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/ComponentProxy.html#onHierarchyChange()">onHierarchyChange</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer.ElementProxy"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer.<A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/ElementProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer">ElementProxy</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/ElementProxy.html#release()">release</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_edu.cmu.cs.stage3.alice.scenegraph.renderer.AbstractProxy"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class edu.cmu.cs.stage3.alice.scenegraph.renderer.<A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/AbstractProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer">AbstractProxy</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/AbstractProxy.html#getRenderer()">getRenderer</A>, <A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/AbstractProxy.html#getSceneGraphElement()">getSceneGraphElement</A>, <A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/AbstractProxy.html#toString()">toString</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="SymmetricPerspectiveCameraProxy()"><!-- --></A><H3> SymmetricPerspectiveCameraProxy</H3> <PRE> public <B>SymmetricPerspectiveCameraProxy</B>()</PRE> <DL> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SymmetricPerspectiveCameraProxy.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/SpriteProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../../../../edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/TextProxy.html" title="class in edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../../../index.html?edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/SymmetricPerspectiveCameraProxy.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="SymmetricPerspectiveCameraProxy.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_edu.cmu.cs.stage3.alice.scenegraph.renderer.nativerenderer.ComponentProxy">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
ai-ku/langvis
doc/edu/cmu/cs/stage3/alice/scenegraph/renderer/nativerenderer/SymmetricPerspectiveCameraProxy.html
HTML
mit
14,689
using System; using DotJEM.Json.Validation.Context; using DotJEM.Json.Validation.Descriptive; using DotJEM.Json.Validation.Results; using Newtonsoft.Json.Linq; namespace DotJEM.Json.Validation.Constraints { public sealed class NotJsonConstraint : JsonConstraint { public JsonConstraint Constraint { get; } public NotJsonConstraint(JsonConstraint constraint) { Constraint = constraint; } public override JsonConstraint Optimize() { NotJsonConstraint not = Constraint as NotJsonConstraint; return not != null ? not.Constraint : base.Optimize(); } public override Result DoMatch(JToken token, IJsonValidationContext context) => !Constraint.DoMatch(token, context); public override bool Matches(JToken token, IJsonValidationContext context) => !Constraint.Matches(token, context); public override string ToString() { return $"not {Constraint}"; } } }
dotJEM/json-validation
DotJEM.Json.Validation/Constraints/NotJsonConstraint.cs
C#
mit
1,034
<html itemscope="itemscope" itemtype="http://schema.org/NewsArticle" class="no-js" lang="en-ca"> <head><base href="http://www.montrealgazette.com/news/local-news/" /> <link href="/web2.0/css/main.css" rel="stylesheet" /><link href="/web2.0/css/postmedia-alerts.css" rel="stylesheet" /><link href="/web2.0/css/lego-widgets.css" rel="stylesheet" /><link href="/web2.0/css/story-gallery.css" rel="stylesheet" /><link href="/css/advertise-header.css" rel="stylesheet" /> <script src="http://code.jquery.com/jquery-1.10.2.min.js" /> <script language="javascript"> var $j = jQuery.noConflict(); </script> <link rel="shortcut icon" type="image/x-icon" href="http://1.gravatar.com/blavatar/76a7ba48d7358d7017973af2eede1e33?s=16" sizes="16x16" /><link rel="apple-touch-icon-precomposed" href="http://0.gravatar.com/blavatar/ab6c5a9287c37a4f2ebe4dac7a314814?s=114" /> <script>document.documentElement.className = document.documentElement.className.replace(/(\s|^)no-js(\s|$)/, &apos;&apos;);</script> <script type="text/javascript"> var contentid = &quot;10307785&quot;; var iabterms = new Array(); var informterms = new Array(); informterms.push(&quot;Montreal Gazette&quot;); informterms.push(&quot;firebombing&quot;); informterms.push(&quot;News&quot;); var iablength = iabterms.length, inflength = informterms.length, iabstring = &quot;&quot;, informstring = &quot;&quot;; for(i=0; i&lt;iablength; i++) { iabterms[i] = iabterms[i].replace(/[\&amp;]/g,&quot;and&quot;); iabterms[i] = iabterms[i].replace(/[^A-Za-z0-9\s]/g,&quot;&quot;); iabstring += &quot;ciab=&quot; + iabterms[i] + &quot;;&quot;; } for (j=0; j&lt;inflength; j++) { informterms[j] = informterms[j].replace(/[\&amp;]/g,&quot;and&quot;); informterms[j] = informterms[j].replace(/[^A-Za-z0-9\s]/g,&quot;&quot;); informstring += &quot;cinf=&quot; + informterms[j] + &quot;;&quot;; } iabstring = iabstring.toLowerCase(); iabstring = iabstring.replace(/\s/g,&quot;-&quot;); informstring = informstring.toLowerCase(); informstring = informstring.replace(/\s/g,&quot;-&quot;); </script> <script type="text/javascript" src="http://s.ppjol.net/lightbox/pp4.js" /> <script type="text/javascript"> var pp = { client: { config: { &apos;zone&apos;:&quot;0SM0P3BAKvzathiaMvh9KM&quot;, &apos;mode&apos;:&quot;meter&quot;, &apos;debug&apos;:0, &apos;cookieDomain&apos;:&quot;montrealgazette.com&quot;, &apos;precheck&apos;: function(){ var bBreaking = false, aMetaTags = document.getElementsByTagName(&apos;meta&apos;); // check for exemption (Paywall whitelist plugin) if (typeof pnMeterExempt !== &apos;undefined&apos; &amp;&amp; !!pnMeterExempt) { return 0; } // Only apply to story pages if (document.getElementsByTagName(&apos;body&apos;)[0].className.indexOf(&apos;single-post&apos;) &gt; -1) { // check within keywords for (i = 0; i &lt; aMetaTags.length; i += 1) { if (aMetaTags[i].name.match(/(keywords)/i)) { if (aMetaTags[i].content.match(/(^|,)\s*(editors|sponsored)\s*(,|$)/i)) { return 0; } else if (aMetaTags[i].content.match(/(premium)/i)) { return 1; } else if (aMetaTags[i].content.match(/(^|,)\s*(breaking)\s*(,|$)/i)) { bBreaking = true; } } } // exclude &quot;breaking&quot; &lt; 24 hours old (from NP/FP) if (bBreaking) { return Math.floor((new Date()).getTime() * 0.001) - Math.floor(new Date(npJ(&apos;.npDateline &gt; span[property = &quot;dc:created&quot;]&apos;).attr(&apos;content&apos;)).getTime() * 0.001) &gt; 86400 ? 1 : 0; } return 1; } return 0; } } } } </script> <script type="text/javascript"> var Postmedia = Postmedia || {}; Postmedia.adConfig = Postmedia.adConfig || {}; </script> <script type="text/javascript"> if (typeof iabterms !== &apos;undefined&apos;) { for(j=0; j&lt;iabterms.length; j++){ iabterms[j] = iabterms[j].toLowerCase(); iabterms[j] = iabterms[j].replace(/[\&amp;]/g,&quot;and&quot;).replace(/[^A-Za-z0-9\s]/g,&quot;&quot;).replace(/\s/g,&quot;-&quot;); } } else { var iabterms = &quot;&quot;; } if (typeof informterms !== &apos;undefined&apos;) { for(j=0; j&lt;informterms.length; j++){ informterms[j] = informterms[j].toLowerCase(); informterms[j] = informterms[j].replace(/[\&amp;]/g,&quot;and&quot;).replace(/[^A-Za-z0-9\s]/g,&quot;&quot;).replace(/\s/g,&quot;-&quot;); } } else { var informterms = &quot;&quot;; } function get_aamCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(&quot;;&quot;); for (i=0;i&lt;ARRcookies.length;i++) { x=ARRcookies[i].substr(0,ARRcookies[i].indexOf(&quot;=&quot;)); y=ARRcookies[i].substr(ARRcookies[i].indexOf(&quot;=&quot;)+1); x=x.replace(/^\s+|\s+$/g,&quot;&quot;); if (x==c_name) { return unescape(y); } } } Postmedia = typeof(Postmedia) != &apos;undefined&apos; ? Postmedia : {}; Postmedia.Weather = {&quot;City&quot;:&quot;Montrรƒยฉal&quot;,&quot;Country&quot;:&quot;Canada&quot;,&quot;CurrentBarometricPressureHg&quot;:&quot;30.1 Hg&quot;,&quot;CurrentBarometricPressureKpa&quot;:&quot;102.0 kPa&quot;,&quot;CurrentDate&quot;:&quot;\/Date(1480104000000-0500)\/&quot;,&quot;CurrentDetails&quot;:&quot;Light rain&quot;,&quot;CurrentDewpointC&quot;:&quot;1 degrees C&quot;,&quot;CurrentDewpointF&quot;:&quot;34 degrees F&quot;,&quot;CurrentHumidexC&quot;:null,&quot;CurrentHumidexF&quot;:null,&quot;CurrentHumidity&quot;:&quot;100 %&quot;,&quot;CurrentIcon&quot;:&quot;http:\/\/www.canada.com\/images\/weather\/large\/hp_w_ir-115x100.gif&quot;,&quot;CurrentRealC&quot;:&quot;-1 degrees C&quot;,&quot;CurrentRealF&quot;:&quot;30 degrees F&quot;,&quot;CurrentStation&quot;:&quot;Montrรƒยฉal&quot;,&quot;CurrentTempC&quot;:&quot;1 degrees C&quot;,&quot;CurrentTempF&quot;:&quot;34 degrees F&quot;,&quot;CurrentWindKm&quot;:&quot;7 km N&quot;,&quot;CurrentWindMi&quot;:&quot;4 mi N&quot;,&quot;CurrentWindchillC&quot;:null,&quot;CurrentWindchillF&quot;:&quot;30 degrees F&quot;,&quot;NormalHighC&quot;:&quot;3 degrees C&quot;,&quot;NormalHighF&quot;:&quot;37 degrees F&quot;,&quot;NormalLowC&quot;:&quot;-3 degrees C&quot;,&quot;NormalLowF&quot;:&quot;27 degrees F&quot;,&quot;RecordHighC&quot;:&quot;18.0 degrees C&quot;,&quot;RecordHighF&quot;:&quot;64 degrees F&quot;,&quot;RecordLowC&quot;:&quot;-14.0 degrees C&quot;,&quot;RecordLowF&quot;:&quot;7 degrees F&quot;,&quot;Sunrise&quot;:&quot;7:06am&quot;,&quot;Sunset&quot;:&quot;4:16pm&quot;,&quot;WeatherForecastLongTermTimePeriods&quot;:[{&quot;Caption&quot;:&quot;Saturday&quot;,&quot;Date&quot;:&quot;\/Date(1480179600000-0500)\/&quot;,&quot;Details&quot;:&quot;Cloudy with showers&quot;,&quot;Icon&quot;:&quot;http:\/\/www.canada.com\/images\/weather\/large\/hp_w_il-115x100.gif&quot;,&quot;Id&quot;:2,&quot;Pop&quot;:&quot;70&quot;,&quot;HighC&quot;:&quot;3 degrees C&quot;,&quot;HighF&quot;:&quot;37 degrees F&quot;,&quot;LowC&quot;:&quot;-1 degrees C&quot;,&quot;LowF&quot;:&quot;30 degrees F&quot;},{&quot;Caption&quot;:&quot;Sunday&quot;,&quot;Date&quot;:&quot;\/Date(1480266000000-0500)\/&quot;,&quot;Details&quot;:&quot;Cloudy with sunny breaks&quot;,&quot;Icon&quot;:&quot;http:\/\/www.canada.com\/images\/weather\/large\/hp_w_ib-115x100.gif&quot;,&quot;Id&quot;:3,&quot;Pop&quot;:&quot;30&quot;,&quot;HighC&quot;:&quot;2 degrees C&quot;,&quot;HighF&quot;:&quot;36 degrees F&quot;,&quot;LowC&quot;:&quot;-2 degrees C&quot;,&quot;LowF&quot;:&quot;28 degrees F&quot;},{&quot;Caption&quot;:&quot;Monday&quot;,&quot;Date&quot;:&quot;\/Date(1480352400000-0500)\/&quot;,&quot;Details&quot;:&quot;Variable cloudiness&quot;,&quot;Icon&quot;:&quot;http:\/\/www.canada.com\/images\/weather\/large\/hp_w_ib-115x100.gif&quot;,&quot;Id&quot;:4,&quot;Pop&quot;:&quot;30&quot;,&quot;HighC&quot;:&quot;2 degrees C&quot;,&quot;HighF&quot;:&quot;36 degrees F&quot;,&quot;LowC&quot;:&quot;-2 degrees C&quot;,&quot;LowF&quot;:&quot;28 degrees F&quot;},{&quot;Caption&quot;:&quot;Tuesday&quot;,&quot;Date&quot;:&quot;\/Date(1480438800000-0500)\/&quot;,&quot;Details&quot;:&quot;Rain or snow&quot;,&quot;Icon&quot;:&quot;http:\/\/www.canada.com\/images\/weather\/large\/hp_w_im-115x100.gif&quot;,&quot;Id&quot;:5,&quot;Pop&quot;:&quot;70&quot;,&quot;HighC&quot;:&quot;3 degrees C&quot;,&quot;HighF&quot;:&quot;37 degrees F&quot;,&quot;LowC&quot;:&quot;3 degrees C&quot;,&quot;LowF&quot;:&quot;37 degrees F&quot;}],&quot;WeatherForecastShortTermTimePeriods&quot;:[{&quot;Caption&quot;:&quot;This afternoon&quot;,&quot;Date&quot;:&quot;\/Date(1480114800000-0500)\/&quot;,&quot;Details&quot;:&quot;Cloudy with showers&quot;,&quot;Icon&quot;:&quot;http:\/\/www.canada.com\/images\/weather\/large\/hp_w_il-115x100.gif&quot;,&quot;Id&quot;:2,&quot;Pop&quot;:&quot;70&quot;,&quot;TempC&quot;:&quot;2 degrees C&quot;,&quot;TempF&quot;:&quot;35 degrees F&quot;,&quot;WindKm&quot;:&quot;5 km E&quot;,&quot;WindMi&quot;:&quot;3 mi E&quot;},{&quot;Caption&quot;:&quot;This evening&quot;,&quot;Date&quot;:&quot;\/Date(1480136400000-0500)\/&quot;,&quot;Details&quot;:&quot;Mainly cloudy&quot;,&quot;Icon&quot;:&quot;http:\/\/www.canada.com\/images\/weather\/large\/hp_w_ion-115x100.gif&quot;,&quot;Id&quot;:3,&quot;Pop&quot;:&quot;30&quot;,&quot;TempC&quot;:&quot;2 degrees C&quot;,&quot;TempF&quot;:&quot;35 degrees F&quot;,&quot;WindKm&quot;:&quot;5 km S&quot;,&quot;WindMi&quot;:&quot;3 mi S&quot;},{&quot;Caption&quot;:&quot;Tonight&quot;,&quot;Date&quot;:&quot;\/Date(1480158000000-0500)\/&quot;,&quot;Details&quot;:&quot;Mixed precip.&quot;,&quot;Icon&quot;:&quot;http:\/\/www.canada.com\/images\/weather\/large\/hp_w_iin-115x100.gif&quot;,&quot;Id&quot;:4,&quot;Pop&quot;:&quot;40&quot;,&quot;TempC&quot;:&quot;1 degrees C&quot;,&quot;TempF&quot;:&quot;33 degrees F&quot;,&quot;WindKm&quot;:&quot;5 km SW&quot;,&quot;WindMi&quot;:&quot;3 mi SW&quot;},{&quot;Caption&quot;:&quot;Saturday morning&quot;,&quot;Date&quot;:&quot;\/Date(1480179600000-0500)\/&quot;,&quot;Details&quot;:&quot;Cloudy with showers&quot;,&quot;Icon&quot;:&quot;http:\/\/www.canada.com\/images\/weather\/large\/hp_w_il-115x100.gif&quot;,&quot;Id&quot;:5,&quot;Pop&quot;:&quot;70&quot;,&quot;TempC&quot;:&quot;2 degrees C&quot;,&quot;TempF&quot;:&quot;35 degrees F&quot;,&quot;WindKm&quot;:&quot;5 km E&quot;,&quot;WindMi&quot;:&quot;3 mi E&quot;}]}; if (Postmedia.hasOwnProperty(&quot;adConfig&quot;)) { Postmedia.adConfigPartner=Postmedia.adConfig; } </script> <script type="text/javascript"> Postmedia.adConfig = { &quot;site&quot;: &quot;mg_news.com&quot;, &quot;async&quot;: true, &quot;sra&quot;: true, &quot;networkId&quot;: &quot;3081&quot;, &quot;mobileSite&quot;: &quot;mg.m&quot;, &quot;enablelazy&quot;: true, &quot;enablerefresh&quot;: true, &quot;disableInitialLoad&quot;: false, &quot;zone&quot;: &quot;news/local-news/story&quot;, &quot;burt&quot;: { }, &quot;keys&quot;: { &quot;pr&quot;: &quot;mg&quot;, &quot;nk&quot;: &quot;print&quot;, &quot;cnt&quot;: &quot;news&quot;, &quot;ck&quot;: &quot;news&quot;, &quot;sck&quot;: &quot;local-news&quot;, &quot;page&quot;: &quot;story&quot;, &quot;aid&quot;: &quot;10307785&quot;, &quot;author&quot;: [&quot;anne-sutherland&quot;,&quot;-montreal-gazette&quot;], &quot;ciab&quot;: iabterms, &quot;cinf&quot;: informterms }, &quot;adslots&quot;:[ { &quot;name&quot;: &quot;gpt-leaderboard2&quot;, &quot;type&quot;: &quot;leaderboard2&quot;, &quot;isCompanion&quot;: false, &quot;lazy&quot;: true, &quot;refresh&quot;: true }, { &quot;name&quot;: &quot;gpt-bigboxtop2&quot;, &quot;type&quot;: &quot;bigboxtop2&quot;, &quot;isCompanion&quot;: false, &quot;lazy&quot;: true, &quot;refresh&quot;: true }, { &quot;name&quot;: &quot;gpt-bigboxmid&quot;, &quot;type&quot;: &quot;bigboxmid&quot;, &quot;isCompanion&quot;: false, &quot;lazy&quot;: true, &quot;refresh&quot;: true }, { &quot;name&quot;: &quot;gpt-wallpaper&quot;, &quot;type&quot;: &quot;wallpaper&quot;, &quot;isCompanion&quot;: false, &quot;lazy&quot;: true, &quot;refresh&quot;: true }, { &quot;name&quot;: &quot;gpt-mobilebigboxtop&quot;, &quot;type&quot;: &quot;mobilebigboxtop&quot;, &quot;isCompanion&quot;: false, &quot;lazy&quot;: true, &quot;refresh&quot;: true }, { &quot;name&quot;: &quot;gpt-mobilebigboxmid&quot;, &quot;type&quot;: &quot;mobilebigboxmid&quot;, &quot;isCompanion&quot;: false, &quot;lazy&quot;: true, &quot;refresh&quot;: true }, { &quot;name&quot;: &quot;gpt-mobilebigboxbot&quot;, &quot;type&quot;: &quot;mobilebigboxbot&quot;, &quot;isCompanion&quot;: false, &quot;lazy&quot;: true, &quot;refresh&quot;: true }, { &quot;name&quot;: &quot;gpt-bigboxbot&quot;, &quot;type&quot;: &quot;bigboxbot&quot;, &quot;isCompanion&quot;: false, &quot;lazy&quot;: true, &quot;refresh&quot;: true }, { &quot;name&quot;: &quot;gpt-oop&quot;, &quot;type&quot;: &quot;oop&quot;, &quot;isCompanion&quot;: false, &quot;lazy&quot;: true, &quot;refresh&quot;: true } ] }; </script> <script type="text/javascript" src="/js/postmedia_obj_init.js?v=1" /> <script type="text/javascript" src="/js/analytics/VisitorAPI.js?v=1" /> <script async="async" data-client-id="RLOZZfEYphHhbhj" type="text/javascript" src="//d2lv4zbk7v5f93.cloudfront.net/zephyr.js" /> <script type="text/javascript" src="/js/gpt.js?v=6" /> <script src="/web2.0/js/mobileMeta.js" /> <script async src="http://cdn.mediavoice.com/nativeads/script/postmedia/polarAd-2.0-prod.js" /> <script src="https://static.freeskreen.com/publisher/1574/freeskreen.min.js" /> <script id="scriptMg2Widget" src="http://d24ftjcfgttqm3.cloudfront.net/dist/1.0/MG2Widget-newsletterwidget-nojquery.min.js" async /> <script src="/js/manageNewsletters.js" type="text/javascript" /> <script> var emailAlerts = new ManageNewsletters(5); </script> <title>Montreal police release photos of firebombing suspects</title> <script src="/web2.0/js/photogallery.min.js" /> <meta property="og:title" content="Montreal police release photos of firebombing suspects" /> <meta property="og:type" content="article" /> <meta property="og:url" content="http://www.montrealgazette.com/news/local-news/Montreal+police+release+photos+firebombing+suspects/10307785/story.html" /> <meta property="og:image" content="http://www.montrealgazette.com/cms/binary/10307787.jpg" /> <meta property="og:site_name" content="www.montrealgazette.com" /> <meta property="og:description" content="Police have released surveillance video of two men walking down a street in Montreal early in the morning on July 31, who&#160;they believe were responsible for firebombing Cavalli restaurant. In a still lifted from the video and blown up, one of the men is masked and the other is wearing a hooded sweatshirt, and his [&#8230;]" /><meta name="twitter:card" content="summary" /> <meta name="twitter:site" content="@montrealgazette" /> <meta name="twitter:title" content="Montreal police release photos of firebombing suspects" /> <meta name="twitter:description" content="Police have released surveillance video of two men walking down a street in Montreal early in the morning on July 31, who&#160;they believe were responsible for firebombing Cavalli restaurant. In a still lifted from the video and blown up, one of the men is masked and the other is wearing a hooded sweatshirt, and his [&#8230;]" /> <meta name="twitter:image" content="http://www.montrealgazette.com/cms/binary/10307787.jpg" /> <script type="text/javascript" src="//platform.twitter.com/widgets.js" /><link href="http://www.montrealgazette.com/news/montreal+police+release+photos+firebombing+suspects/10307785/story.html" rel="canonical" /><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /><meta name="description" content="Police have released surveillance video of two men walking down a street in Montreal early in the morning" /><meta name="author" content=",Anne Sutherland, Montreal Gazette" /><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><meta property="fb:app_id" content="262483350536461" /><meta name="ROBOTS" content="NOARCHIVE" /><meta name="Keywords" content="Montreal Gazette,1,Dave Sidaway,Anne Sutherland,Arson,Crime,Crime and Law,Montreal Gazette,firebombing,local news,Montreal,Montreal police release photos of firebombing suspects,news" /><meta name="PubDate" content="2014-10-19" /></head> <body id="news" class="single single-post"> <div class="out-of-page"> <div class="pn_dfpads"> <div class="ad"> <div id="gpt-oop" class="adslot"> <script type="text/javascript"> Postmedia.adConfig.writeAd(&apos;gpt-oop&apos;); </script> </div> </div> </div> </div> <script type="text/javascript"> var axel = Math.random() + &quot;&quot;; var a = axel * 10000000000000; document.write(&apos;&lt;iframe src=&quot;http://4436230.fls.doubleclick.net/activityi;src=4436230;type=invmedia;cat=UqVwOibI;ord=&apos; + a + &apos;?&quot; width=&quot;1&quot; height=&quot;1&quot; frameborder=&quot;0&quot; style=&quot;display:none&quot;&gt;&lt;/iframe&gt;&apos;); </script> <noscript> <iframe src="http://4436230.fls.doubleclick.net/activityi;src=4436230;type=invmedia;cat=UqVwOibI;ord=1?" width="1" height="1" frameborder="0" style="display:none" /> </noscript> <nav class="accessibility-nav"> <ol> <li><a href="#side-navigation">Skip to navigation</a></li> <li><a href="#main">Skip to content</a></li> <li><a href="#sidebar">Skip to sidebar</a></li> </ol> </nav> <hr /> <div id="page" class="hfeed site"> <header class="l-header"> <div class="l-constrained"> <div class="header-nav"> <script type="text/javascript" src="http://montrealgazette.com/partial/header-top-mobile/" /> <script type="text/javascript" src="http://montrealgazette.com/partial/header-logo/" /> <script type="text/javascript" src="http://montrealgazette.com/partial/header-nav/" /> <div class="lower-header"> <div class="breadcrumb-wrap "> <ul class="breadcrumb-list"> <div id="syndication5"> <div class="breadcrumb news"> <ul class="breadcrumb-list"> <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="breadcrumb news"> <a href="http://montrealgazette.com/category/news" itemprop="url"> <span itemprop="title">news</span> </a> </li> <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> <span itemprop="title">local news</span> </li> </ul> </div></div> </ul> <div class="more-category-and-feature"> <ul class="circular-list"> <script type="text/javascript" src="http://montrealgazette.com/partial/header-global-feature/" /> </ul> </div> <div class="right-drop-shadow" /> <a href="javascript:void(0);" class="more-items">More</a> </div> <script type="text/javascript" src="http://montrealgazette.com/partial/header-search/" /> </div> <script type="text/javascript" src="http://montrealgazette.com/partial/header-links/" /> </div> </div> </header> <div class="ad"> <div id="gpt-wallpaper" class="adslot"> <script type="text/javascript"> Postmedia.adConfig.writeAd(&apos;gpt-wallpaper&apos;); </script> </div> </div> <hr /> <script type="text/javascript" src="http://montrealgazette.com/partial/alerts/" /> <div id="content" class="site-content"> <div class="l-content"> <div class="l-constrained container contentbody"> <div id="fb-root" /> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = &quot;//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=262483350536461&quot;; //this is windsor&apos;s app id -- needs to be changed fjs.parentNode.insertBefore(js, fjs); }(document, &apos;script&apos;, &apos;facebook-jssdk&apos;));</script> <section class="l-top-content"> <div class="adunit"> <div class="widget widget-advertisement is-border"> <div class="ad"> <div id="gpt-leaderboard2" class="adslot"> <script type="text/javascript"> Postmedia.adConfig.writeAd(&apos;gpt-leaderboard2&apos;); </script> </div> </div> </div> </div> </section> <div id="LEGO_story"> <div class="l-main" id="main" role="main"><article class="l-article post hentry"><header><h1 itemprop="headline" class="entry-title">Montreal police release photos of firebombing suspects</h1><p class="entry-details"><span class="author">Anne Sutherland, Montreal Gazette, Montreal Gazette</span>ร‚ <time datetime="2014-10-20T21:55:15Z" class="pubdate" itemprop="datePublished">10.20.2014</time></p></header><div class="entry-content" itemprop="articleBody"><div class="wfull topstory" xmlns:fb="urn:facebook.com:fb"><figure class="post-img wp-caption"><img id="storyphoto" class="wp-post-image" src="cms/binary/10307787.jpg?size=sw620x65" alt="Montreal police release photos of firebombing suspects" title="2 suspects in Cavalli firebombing" /><figcaption class="wp-caption-text"><p>2 suspects in Cavalli firebombing</p><span class="img-author">SPVM / Montreal Gazette</span></figcaption></figure><div class="wfull-content"><div class="article-actions"><a class="icon-share" data-modal-target="#modal-share" href="#">Share</a><a href="#" class="icon-adjust">Adjust</a><a href="#" class="icon-comment">Comment</a><a class="icon-print" href="javascript:window.print();">Print</a></div><div class="story-content"><div id="page1"><p>Police have released surveillance video of two men walking down a street in Montreal early in the morning on July 31, who they believe were responsible for firebombing Cavalli restaurant.</p><p>In a still lifted from the video and blown up, one of the men is masked and the other is wearing a hooded sweatshirt, and his face is visible.</p><p>Both are dressed in entirely in black and one of them is carrying a shopping bag.</p><p>At around 5:45 a.m. the front window of the restaurant at 2040 Peel St. was smashed and a Molotov cocktail tossed inside.</p><p>Because the fire was criminal in nature, the arson squad has been investigating.</p><p>The restaurant was firebombed twice in three months. Here are <a href="http://www.montrealgazette.com/news/Video+Cavalli+restaurant+firebombed+again/10079345/story.html" _fcksavedurl="http://www.montrealgazette.com/news/Video+Cavalli+restaurant+firebombed+again/10079345/story.html" target="_blank">the stories</a> and <a href="http://www.montrealgazette.com/news/Restaurant+Cavalli+Peel+firebombed+again/10078855/story.html" _fcksavedurl="http://www.montrealgazette.com/news/Restaurant+Cavalli+Peel+firebombed+again/10078855/story.html" target="_blank">a video</a> taken on July 31 by Montreal Gazette photographer Dave Sidaway.</p><p><a href="mailto:asutherland@montrealgazette.com" _fcksavedurl="mailto:asutherland@montrealgazette.com"><a href="mailto:asutherland@montrealgazette.com">asutherland@montrealgazette.com</a></a></p></div></div></div></div> <style> #weeklyads &gt; .article span, #weeklyads article &gt; h3, #weeklyads article &gt; p {font-size:16px;line-height:25px;} article#weeklyads {border-bottom:0px !important;} #weeklyads{clear:both;} #weeklyads &gt; .article &gt; div {float: none !important; vertical-align: top; display: inline-block; } #weeklyads &gt; .article &gt; div:last-child {display: block; clear: both; float: none !important;} #weeklyads span {display: block;} #weeklyads &gt; .article &gt; div:first-child {display: block; clear: both;} @media all and (max-width: 580px){ #weeklyads .article &gt; div:nth-child(2), #weeklyads .article &gt; div:nth-child(3), #weeklyads .article &gt; div:nth-child(4), #weeklyads .article &gt; div:nth-child(5){width: 49% !important}} </style> <div id="flyertown_module_2376" /> <script src="http://api.flyertown.ca/2376/5bb86e746e4af072/flyertown_module.js" /> <div class="clear" /> <div id="comments" class="comments-area"><h2 class="comments-title">Comments</h2><div id="soundoff"> <style type="text/css"> .comment-intro {padding: 12px;background:#f2f2f2;color:#464646;font-size:14px;} </style> <div class="comment-intro"> We encourage all readers to share their views on our articles and blog posts. We are committed to maintaining a lively but civil forum for discussion, so we ask you to avoid personal attacks, and please keep your comments relevant and respectful. If you encounter a comment that is abusive, click the &quot;X&quot; in the upper right corner of the comment box to report spam or abuse. We are using Facebook commenting. <a href="/news/story.html?id=7195492">Visit our FAQ page for more information.</a> </div> <div class="fb-comments" data-href="http://www.montrealgazette.com/story.html?id=10307785" data-num-posts="5" data-width="826" /></div></div></div><input type="hidden" id="storyimg" value=" http://www.montrealgazette.com/cms/binary/10307787.jpg" /><input type="hidden" id="storytext" value="Police have released surveillance video of two men walking down a street in Montreal early in the morning on July 31, who&#160;they believe were responsible for firebombing Cavalli restaurant. In a still lifted from the video and blown up, one of the men is masked and the other is wearing a hooded sweatshirt, and his [&#8230;]" /><script type="text/javascript"> var story_image = jQuery(&quot;#storyimg&quot;).val(); var story_title = &quot;Montreal police release photos of firebombing suspects&quot;; var story_abstract = jQuery(&quot;#storytext&quot;).val(); // var story_abstract = &quot;Police have released surveillance video of two men walking down a street in Montreal early in the morning on July 31, who&amp;#160;they believe were responsible for firebombing Cavalli restaurant. In a still lifted from the video and blown up, one of the men is masked and the other is wearing a hooded sweatshirt, and his [&amp;#8230;]&quot;; var story_url = &quot;http://&quot; + &apos;www.montrealgazette.com&apos; + &quot;/&quot; + &apos;news&apos; + &quot;/&quot; + &apos;10307785&apos; + &quot;/story.html&quot;; </script><div id="modal-share" class="modal"><div class="modal-wrap"><button class="modal-close" type="button" title="Close (Esc)">x</button><header class="modal-header"><span class="share">Share</span><h2 class="modal-title">Montreal police release photos of firebombing suspects</h2></header><div class="modal-content"><div class="copy-wrap"><input class="url" value /></div><ul class="share-icons"><li><a class="share-icon email" href="mailto:?subject=Montreal police release photos of firebombing suspects&body=Police have released surveillance video of two men walking down a street in Montreal early in the morning on July 31, who&#160;they believe were responsible for firebombing Cavalli restaurant. In a still lifted from the video and blown up, one of the men is masked and the other is wearing a hooded sweatshirt, and his [&#8230;]%0A%0A http://www.montrealgazette.com/news/10307785/story.html %0A%0A"><svg xml:space="preserve" enable-background="new 0 0 72 70" viewBox="0 0 72 70" y="0px" x="0px" id="plane-email" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"> <path d="M4.369 36.084c0 0 13.3 7.4 14.5 8.032c-0.038 1.337-0.438 17.029-0.438 17 s13.22-10.036 14.397-10.928c1.267 0.6 10.7 5.3 10.7 5.317l22.652-45.29L4.369 36.084z M21.147 54.3 c0.097-3.491 0.247-9.11 0.296-11.014l32.368-23.026L26.305 43.8" fill="#EAC200" /> </svg> Email</a></li><li><a class="share-icon tw" target="_blank" href="https://twitter.com/share?url= http://www.montrealgazette.com/news/10307785/story.html &text=Montreal police release photos of firebombing suspects"><svg xml:space="preserve" enable-background="new 0 0 72 70" viewBox="0 0 72 70" y="0px" x="0px" id="twitter-bird" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"> <path d="M71.873 13.278c-2.643 1.174-5.491 1.966-8.469 2.318c3.041-1.82 5.382-4.713 6.489-8.157 c-2.854 1.686-6.01 2.915-9.372 3.578c-2.69-2.863-6.526-4.659-10.765-4.659c-8.142 0-14.751 6.604-14.751 14.7 c0 1.2 0.1 2.3 0.4 3.362C23.141 23.9 12.3 18 5 9.058c-1.272 2.175-1.995 4.711-1.995 7.4 c0 5.1 2.2 9.6 6.1 12.279C6.705 28.7 2 28 2 26.899c0 0.1 0 0.1 0 0.189c0 7.1 5.5 13.1 12.3 14.5 c-1.247 0.338-2.324 0.52-3.661 0.52c-0.958 0-1.772-0.097-2.673-0.266c1.88 5.9 7.4 10.1 13.8 10.2 c-5.043 3.952-11.372 6.316-18.278 6.316c-1.198 0-2.349-0.078-3.503-0.215c6.527 4.2 14.3 6.6 22.6 6.6 c27.109 0 41.952-22.469 41.952-41.957c0-0.639-0.016-1.275-0.043-1.908C67.392 18.8 69.9 16.2 71.9 13.278z" fill="#2CAAE1" /> </svg> Twitter</a></li><li><a class="share-icon fb" target="_blank" href=" http://www.facebook.com/sharer/sharer.php?u= http://www.montrealgazette.com/news/10307785/story.html &t=Montreal police release photos of firebombing suspects"><svg xml:space="preserve" enable-background="new 0 0 72 70" viewBox="0 0 72 70" y="0px" x="0px" id="facebook-f" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"> <path d="M53.811 13.983H43.696c-0.667 0-1.26 0.356-1.782 1.069c-0.524 0.713-0.783 1.592-0.783 2.636v7.266h12.679 v10.544H41.132v31.488H29.02V35.498H18.191V24.954H29.02v-6.127c0-4.463 1.4-8.239 4.204-11.327c2.8-3.084 6.29-4.63 10.472-4.63 h10.115V13.983z" fill="#3C5A99" /> </svg> Facebook</a></li><li><a class="share-icon pin" target="_blank" href=" http://pinterest.com/pin/create/button/?url= http://www.montrealgazette.com/news/10307785/story.html &media= http://www.montrealgazette.com/cms/binary/10307787.jpg&description=Montreal police release photos of firebombing suspects"><svg xml:space="preserve" enable-background="new 0 0 72 70" viewBox="0 0 72 70" y="0px" x="0px" id="pinterest-p" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"> <path d="M30.292 46.904c-1.218 5.972-2.578 10.817-4.074 14.539c-1.496 3.718-3.743 6.681-6.739 8.9 c-0.282-3.397-0.447-6.152-0.491-8.268c-0.049-2.111 0.209-4.636 0.771-7.578c0.562-2.938 1.073-5.327 1.545-7.166 c0.467-1.835 1.073-4.11 1.827-6.819c0.747-2.709 1.309-4.983 1.683-6.822c-1.123-2.387-1.567-5.05-1.334-7.992 c0.233-2.937 1.358-5.372 3.372-7.301c2.014-1.93 4.33-2.389 6.953-1.379c1.871 0.7 2.9 2.1 3.1 4.1 c0.185 1.976-0.12 4.159-0.916 6.545c-0.798 2.391-1.545 4.754-2.245 7.096c-0.705 2.345-0.798 4.411-0.282 6.2 c0.513 1.8 2 2.9 4.4 3.374c3.181 0.6 6.015-0.228 8.495-2.616s4.212-5.396 5.197-9.026 c0.982-3.627 1.238-7.372 0.774-11.229c-0.469-3.86-1.734-6.798-3.792-8.82c-2.903-2.941-6.439-4.549-10.604-4.824 c-4.168-0.276-7.984 0.485-11.447 2.275c-3.465 1.79-6.275 4.478-8.428 8.061c-2.154 3.583-2.903 7.489-2.245 11.7 c0.187 1 0.7 2.2 1.5 3.583c0.842 1.4 1.3 2.5 1.5 3.238c0.14 0.781-0.26 2.319-1.198 4.6 c-6.832-1.559-10.109-6.841-9.829-15.844c0.187-6.339 2.643-11.712 7.373-16.123c4.728-4.409 10.184-6.979 16.361-7.715 c7.679-0.828 14.5 0.5 20.4 3.926c5.897 3.4 9.3 8.5 10.1 15.089c1.216 8.085-0.329 15.364-4.634 21.8 c-4.31 6.476-10.206 9.438-17.699 8.89c-1.031-0.092-2.014-0.298-2.947-0.621c-0.938-0.321-1.64-0.62-2.107-0.896 c-0.469-0.276-1.194-0.758-2.176-1.448C31.488 47.7 30.8 47.2 30.3 46.904z" fill="#C8242D" /> </svg> Pinterest</a></li><li><a class="share-icon google" target="_blank" href="https://plus.google.com/share?url= http://www.montrealgazette.com/news/10307785/story.html "><svg xml:space="preserve" enable-background="new 0 0 72 70" viewBox="0 0 72 70" y="0px" x="0px" id="google-plus" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"> <path d="M11.605 21.71c0-2.327 0.5-4.373 1.504-6.139c1.002-1.765 2.124-3.07 3.371-3.911 c1.243-0.843 2.626-1.524 4.152-2.047c1.526-0.523 2.648-0.823 3.371-0.903c0.723-0.079 1.243-0.12 1.564-0.12h13.844v0.24 c0 0.886-1.564 1.606-4.694 2.167c-1.123 0-1.887 0.121-2.287 0.362c1.604 0.8 2.7 1.9 3.2 3.4 c0.562 1.4 0.8 3.4 0.8 5.779c0 4.093-1.367 7.263-4.094 9.508c-1.524 1.529-2.287 2.61-2.287 3.3 c0 0.7 1 2 3 3.851c4.174 3.6 6.3 7.2 6.3 10.715c0 5.619-2.329 9.511-6.981 11.7 c-2.73 1.364-5.738 2.046-9.029 2.046c-0.078 0-0.161 0-0.239 0l-0.243-0.12c-0.078 0.08-0.161 0.12-0.239 0.1 c-0.964 0-2.048-0.1-3.253-0.3c-1.201-0.198-2.709-0.621-4.514-1.263c-1.805-0.642-3.291-1.788-4.455-3.433 c-1.163-1.644-1.743-3.71-1.743-6.2c0-2.406 0.641-4.432 1.926-6.078c1.283-1.645 2.948-2.788 4.997-3.43 c2.044-0.642 3.809-1.083 5.295-1.325c1.484-0.241 2.907-0.361 4.273-0.361h0.122c-0.644-0.882-1.126-1.824-1.446-2.829 c-0.323-1.002-0.482-1.785-0.482-2.348l0.12-0.841H22.68c-2.572 0-4.776-0.602-6.622-1.808 C13.087 29.6 11.6 26.4 11.6 21.71z M31.649 54.212c1.641-1.446 2.386-3.21 2.227-5.297 c-0.164-2.086-1.024-3.772-2.59-5.056c-1.564-1.284-3.632-1.927-6.198-1.927h-0.962c-2.572 0.081-4.859 1.006-6.863 2.8 c-1.847 1.686-2.69 3.571-2.528 5.656c0.159 2.1 1.2 3.7 3.2 4.818c1.964 1.1 4.4 1.6 7.2 1.4 C27.814 56.5 30 55.7 31.6 54.212z M30.264 18.82c-1.205-4.332-3.652-6.501-7.344-6.501c-0.482 0-0.883 0.042-1.203 0.1 c-1.608 0.482-2.769 1.728-3.49 3.732c-0.644 2.006-0.683 4.133-0.122 6.378c0.56 2.1 1.5 3.8 2.8 5.1 c1.325 1.3 2.7 2 4.3 1.986c0.482 0 0.843-0.04 1.086-0.12c1.685-0.482 2.948-1.786 3.791-3.913 C30.924 23.5 31 21.2 30.3 18.82z M53.617 29.293h9.029v5.658h-9.029v9.028h-5.658v-9.028H38.93v-5.658h9.029v-9.029 h5.658V29.293z" fill="#DD4B38" /> </svg> Google</a></li><li><a class="share-icon lin" target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url= http://www.montrealgazette.com/news/10307785/story.html &title=Montreal police release photos of firebombing suspects&summary=Police have released surveillance video of two men walking down a street in Montreal early in the morning on July 31, who&#160;they believe were responsible for firebombing Cavalli restaurant. In a still lifted from the video and blown up, one of the men is masked and the other is wearing a hooded sweatshirt, and his [&#8230;]"><svg xml:space="preserve" enable-background="new 0 0 72 70" viewBox="0 0 72 70" y="0px" x="0px" id="Layer_1" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"> <path d="M19.023 10.817c0 1.85-0.672 3.42-2.01 4.714c-1.341 1.296-3.076 1.94-5.199 1.9 c-2.034 0-3.699-0.644-4.99-1.94c-1.296-1.294-1.943-2.865-1.943-4.714c0-1.941 0.648-3.535 1.943-4.783 c1.291-1.249 2.999-1.873 5.129-1.873c2.123 0 3.8 0.6 5.1 1.873C18.26 7.3 18.9 8.9 19 10.817z M5.297 65.58V22.74 h13.308V65.58H5.297z M26.508 36.465c0-3.973-0.094-8.548-0.276-13.724h11.506l0.693 5.961h0.276 c2.773-4.621 7.164-6.931 13.171-6.931c4.621 0 8.3 1.5 11.2 4.645c2.817 3.1 4.2 7.7 4.2 13.794V65.58H53.959V41.871 c0-6.19-2.267-9.287-6.794-9.287c-3.237 0-5.499 1.663-6.792 4.99c-0.278 0.555-0.415 1.665-0.415 3.326V65.58h-13.45V36.465z" fill="#1176A9" /> </svg> Linkedin</a></li></ul></div></div><div class="bg-modal" /></div><script> // Determine newspaper name by domain var domain = window.location.hostname; var newspapers = [&quot;calgaryherald&quot;, &quot;edmontonjournal&quot;, &quot;leaderpost&quot;, &quot;montrealgazette&quot;, &quot;ottawacitizen&quot;, &quot;thestarphoenix&quot;, &quot;theprovince&quot;, &quot;vancouversun&quot;, &quot;windsorstar&quot;]; var newspaper, newspaper_name; for (var paper in newspapers) { if (domain.indexOf(newspapers[paper]) &gt; -1) { newspaper = newspapers[paper]; } } switch (newspaper) { case &quot;calgaryherald&quot; : newspaper_name = &quot;Calgary Herald&quot;; break; case &quot;edmontonjournal&quot; : newspaper_name = &quot;Edmonton Journal&quot;; break; case &quot;leaderpost&quot; : newspaper_name = &quot;Leader-Post&quot;; break; case &quot;montrealgazette&quot; : newspaper_name = &quot;Montreal Gazette&quot;; break; case &quot;ottawacitizen&quot; : newspaper_name = &quot;Ottawa Citizen&quot;; break; case &quot;thestarphoenix&quot; : newspaper_name = &quot;The StarPhoenix&quot;; break; case &quot;theprovince&quot; : newspaper_name = &quot;The Province&quot;; break; case &quot;vancouversun&quot; : newspaper_name = &quot;Vancouver Sun&quot;; break; case &quot;windsorstar&quot; : newspaper_name = &quot;Windsor Star&quot;; break; default : newspaper_name = &quot;canada.com&quot;; break; } // Creating an element and parsing out the value with .text() fixes the special characters issue story_title = jQuery(&apos;&lt;textarea /&gt;&apos;).html(story_title).text(); story_abstract = jQuery(&apos;&lt;textarea /&gt;&apos;).html(story_abstract).text(); story_image = jQuery(&apos;&lt;textarea /&gt;&apos;).html(story_image).text(); story_image = story_image.trim(); // Build social network URLs var em_href = &quot;mailto:?subject=&quot; + newspaper_name + &quot;: &quot; + story_title + &quot;&amp;body=I wanted to share a story with you from &quot; + newspaper_name + &quot;: %0D%0A %0D%0A&quot; + story_abstract + &quot;%0D%0A %0D%0A&quot; + window.location; var tw_href = &quot;https://twitter.com/share?url=&quot; + story_url + &quot;&amp;text=&quot; + story_title; var fb_href = &quot;http://www.facebook.com/sharer/sharer.php?u=&quot; + story_url + &quot;&amp;t=&quot; + story_title.replace(/\s/g, &apos;+&apos;); var pin_href = &quot;http://pinterest.com/pin/create/button/?url=&quot; + story_url + &quot;&amp;media=&quot; + story_image + &quot;&amp;description=&quot; + story_abstract; var lin_href = &quot;http://www.linkedin.com/shareArticle?mini=true&amp;url=&quot; + story_url + &quot;&amp;title=&quot; + story_title + &quot;&amp;summary=&quot; + story_abstract; // Replace current href values with new URLs jQuery(&quot;.email&quot;).attr(&quot;href&quot;, em_href); jQuery(&quot;.tw&quot;).attr(&quot;href&quot;, tw_href); jQuery(&quot;.fb&quot;).attr(&quot;href&quot;, fb_href); jQuery(&quot;.pin&quot;).attr(&quot;href&quot;, pin_href); jQuery(&quot;.lin&quot;).attr(&quot;href&quot;, lin_href); </script></article></div></div> <section class="l-bottom-content mobile-only tablet-only clearfix"> </section> <aside id="sidebar" class="l-sidebar" role="complementary"> <div class="widget widget-advertisement"> </div> <div class="widget widget-advertisement"> <div id="gpt-mobilebigboxtop" class="adslot"> <script type="text/javascript"> Postmedia.adConfig.writeAd(&apos;gpt-mobilebigboxtop&apos;); </script> </div> <div class="ad"> <div id="gpt-bigboxtop2" class="adslot"> <script type="text/javascript"> Postmedia.adConfig.writeAd(&apos;gpt-bigboxtop2&apos;); </script> </div> </div> </div> <div class="widget"> <h2 class="widget-title cat-head"><span>Video</span></h2> <div class="pm_player"> <div class="video300" style="width:300px;min-height:168px;" data-playlist-id="0_svyoa6g2"> <div id="Player2" itemprop="video" itemtype="http://schema.org/VideoObject" itemscope="itemscope" data-playlist-id="0_svyoa6g2"> </div> </div> <script type="text/javascript"> (function () { var params = { playlistId: &apos;0_svyoa6g2&apos;, //playlistId shareUrl:&apos;http%3A%2F%2Fwww.montrealgazette.com%2Fnews%2Flocal-news%2F%7BvideoId%7D%2Fvideo.html&apos;, autoplay: &apos;false&apos;, targetId: &apos;Player2&apos;, lazyLoad: &apos;true&apos; }; var url = &apos;http://app.canada.com/Video/video.svc/loader/?&apos;; for (var key in params) { if (params[key] != &apos;&apos; &amp; params[key] != &apos;undefined&apos; &amp; typeof params[key] != undefined ) { url += key + &apos;=&apos; + escape(params[key]) + &apos;&amp;&apos;; } } var pv = document.createElement(&apos;script&apos;); pv.type = &apos;text/javascript&apos;; pv.async = false; pv.src = url.slice(0, -1); var s = document.getElementsByTagName(&apos;script&apos;)[0]; s.parentNode.insertBefore(pv, s); })(); </script> </div> </div> <div class="widget"> <div class="rightrail-nativeadcollection"><div class="nativeadcollection" /></div> </div> <div class="widget"> <div class="rightrail_native_ad"> <div class="nativead"> <div class="adcontent" /> </div> </div> </div> <div class="widget widget-advertisement"> <div id="gpt-mobilebigboxmid" class="adslot"> <script type="text/javascript"> Postmedia.adConfig.writeAd(&apos;gpt-mobilebigboxmid&apos;); </script> </div> <div class="ad"> <div id="gpt-bigboxmid" class="adslot"> <script type="text/javascript"> Postmedia.adConfig.writeAd(&apos;gpt-bigboxmid&apos;); </script> </div> </div> </div> <div class="widget widget-posts-list"> <h2 class="widget-title cat-head"><span>Editor&apos;s Picks</span></h2> <div id="syndication8"> <div class="wfull"><a href="http://montrealgazette.com/tag/aislin-and-pascal-editorial-cartoons" target="_blank"><h2>Gallery of the latest Aislin, Pascal and Boris cartoons</h2></a><a href="http://montrealgazette.com/tag/aislin-and-pascal-editorial-cartoons" target="_blank"><img src="http://wpmedia.montrealgazette.com/2014/10/aislinoportrait2.jpg?w=140crop=1" alt="image" title="image" /></a><span /></div><div class="wfull"><a href="http://montrealgazette.com/entertainment/television/miniseries-charts-jean-beliveaus-path-from-underdog-to-canadiens-icon" target="_blank"><h2>Miniseries charts Jean Bรƒยฉliveau&apos;s path from underdog to Canadiens icon</h2></a><a href="http://montrealgazette.com/entertainment/television/miniseries-charts-jean-beliveaus-path-from-underdog-to-canadiens-icon" target="_blank"><img src="http://wpmedia.montrealgazette.com/2016/11/montreal-que-november-21-2016-patrice-belanger-as-boo1.jpeg?w=140crop=1" alt="image" title="image" /></a><span>The French-language show, now shooting in Montreal, looks at the life and hockey...</span></div><div class="wfull"><a href="http://montrealgazette.com/life/bill-zacharkiw-bouncing-back-from-beaujolais-nouveau" target="_blank"><h2>Bill Zacharkiw: Bouncing back from Beaujolais Nouveau</h2></a><a href="http://montrealgazette.com/life/bill-zacharkiw-bouncing-back-from-beaujolais-nouveau" target="_blank"><img src="http://wpmedia.montrealgazette.com/2016/11/alain-coudert-of-clos-la-roilette-in-fleurie-i-dont-sell-be.jpeg?w=140crop=1" alt="image" title="image" /></a><span>Despite the lingering stigma, the Beaujolais region produces a range of wines offering...</span></div></div> </div> <div class="widget widget-posts-list"> <h2 class="widget-title cat-head"><span>Featured Columnists</span></h2> <div id="syndication9"> <div class="wfull"><a href="http://montrealgazette.com/opinion/columnists/don-macpherson-identity-politics-makes-quebec-look-like-a-big-herouxville"><h2>Don Macpherson: A greater Hรƒยฉrouxville</h2></a><a href="http://montrealgazette.com/opinion/columnists/don-macpherson-identity-politics-makes-quebec-look-like-a-big-herouxville"><img src="http://wpmedia.montrealgazette.com/2016/11/the-small-quebec-town-of-herouxville-is.jpeg?w=140crop=1" alt="image" title="image" /></a><span>The escalation in identity politics in Quebec this week was reminiscent of the hysteria...</span></div><div class="wfull"><a href="http://montrealgazette.com/opinion/columnists/the-right-chemistry-forest-bathing-is-good-for-you-but-hot-potting-can-be-fatal"><h2>The Right Chemistry: &apos;Forest bathing&apos; is good for you, but &apos;hot potting&apos; can be fatal</h2></a><a href="http://montrealgazette.com/opinion/columnists/the-right-chemistry-forest-bathing-is-good-for-you-but-hot-potting-can-be-fatal"><img src="http://wpmedia.montrealgazette.com/2016/11/files-us-park-death-yellowstone.jpeg?w=140crop=1" alt="image" title="image" /></a><span>รขHot pottingรข refers to straying from designated paths and illegally dipping into...</span></div><div class="wfull"><a href="http://montrealgazette.com/opinion/columnists/second-draft-lachine-to-montreal-in-nine-minutes-in-1848"><h2>Second Draft: Lachine to Montreal in nine minutes รข in 1848</h2></a><a href="http://montrealgazette.com/opinion/columnists/second-draft-lachine-to-montreal-in-nine-minutes-in-1848"><img src="http://wpmedia.montrealgazette.com/2016/11/t3-cp-note-magazines-out-tv-out-10con5-spe-oct-1-97-gor.jpeg?w=140crop=1" alt="image" title="image" /></a><span>The Montreal and Lachine Rail Road trip normally took 20 minutes. A trip to show...</span></div><div class="wfull noborder"><a href="http://montrealgazette.com/opinion/columnists/opinion-decision-in-val-dor-case-is-a-blow-to-reconciliation-hopes"><h2>Opinion: Decision in Val-d&apos;Or case is a blow to reconciliation hopes</h2></a><a href="http://montrealgazette.com/opinion/columnists/opinion-decision-in-val-dor-case-is-a-blow-to-reconciliation-hopes"><img src="http://wpmedia.montrealgazette.com/2016/11/val-dor-que-october-28-2015-downtown-val-dor-north-of.jpeg?w=140crop=1" alt="image" title="image" /></a><span>As students with hope for the future, we want to live in a society with a legal ...</span></div></div> </div> <div class="widget widget-advertisement"> <div id="gpt-mobilebigboxbot" class="adslot"> <script type="text/javascript"> Postmedia.adConfig.writeAd(&apos;gpt-mobilebigboxbot&apos;); </script> </div> <div class="ad"> <div id="gpt-bigboxbot" class="adslot"> <script type="text/javascript"> Postmedia.adConfig.writeAd(&apos;gpt-bigboxbot&apos;); </script> </div> </div> </div> <div class="widget widget-posts-list"> <h2 class="widget-title cat-head"><span>Top Stories</span></h2> <div id="syndication10"> <div class="wfull"><a href="http://montrealgazette.com/news/local-news/three-rem-train-stations-added-to-proposed-route-through-downtown-montreal"><h2>Three REM train stations added to proposed route through downtown Montreal</h2></a><a href="http://montrealgazette.com/news/local-news/three-rem-train-stations-added-to-proposed-route-through-downtown-montreal"><img src="http://wpmedia.montrealgazette.com/2016/11/a-light-rail-station-could-be-built-underneath-the-douard-mo.jpeg?w=140crop=1" alt="image" title="image" /></a><span>Builders of the new Rรƒยฉseau รƒยฉlectrique mรƒยฉtropolitain announced it will add three ...</span></div><div class="wfull"><a href="http://montrealgazette.com/business/bombardier-to-deliver-first-c300-on-monday-to-airbaltic"><h2>Bombardier to deliver first C300 on Monday to launch carrier airBaltic</h2></a><a href="http://montrealgazette.com/business/bombardier-to-deliver-first-c300-on-monday-to-airbaltic"><img src="http://wpmedia.montrealgazette.com/2016/11/abcs300ff_en_4.jpg?w=140crop=1" alt="image" title="image" /></a><span>First passenger flight of largest CSeries jet will be Dec. 14</span></div><div class="wfull"><a href="http://montrealgazette.com/opinion/columnists/don-macpherson-identity-politics-makes-quebec-look-like-a-big-herouxville"><h2>Don Macpherson: Identity politics makes Quebec look like a big Hรƒยฉrouxville</h2></a><a href="http://montrealgazette.com/opinion/columnists/don-macpherson-identity-politics-makes-quebec-look-like-a-big-herouxville"><img src="http://wpmedia.montrealgazette.com/2016/11/the-small-quebec-town-of-herouxville-is.jpeg?w=140crop=1" alt="image" title="image" /></a><span>The escalation in identity politics in Quebec this week was reminiscent of the hysteria...</span></div><div class="wfull noborder"><a href="http://montrealgazette.com/entertainment/television/miniseries-charts-jean-beliveaus-path-from-underdog-to-canadiens-icon"><h2>Miniseries charts Jean Bรƒยฉliveau&apos;s path from underdog to Canadiens icon</h2></a><a href="http://montrealgazette.com/entertainment/television/miniseries-charts-jean-beliveaus-path-from-underdog-to-canadiens-icon"><img src="http://wpmedia.montrealgazette.com/2016/11/montreal-que-november-21-2016-patrice-belanger-as-boo1.jpeg?w=140crop=1" alt="image" title="image" /></a><span>The French-language show, now shooting in Montreal, looks at the life and hockey...</span></div></div> </div> </aside> <section class="l-bottom-content desktop-only clearfix"> </section> </div> </div> </div> <script type="text/javascript" src="http://montrealgazette.com/partial/footer/" /> <script>window.jQuery || document.write(&quot;&lt;script src=&apos;_ui/js/jquery-1.10.2.min.js&apos;&gt;\x3C/script&gt;&quot;)</script> <script src="/web2.0/js/plugins.js" /> <script src="/web2.0/js/main.js" /> <script src="/web2.0/js/postmedia-alerts.js" /> <script> jQuery( document ).ready( function() { var cki_ = pm_alerts_cookie_get(); if ( 0 &lt; jQuery( &apos;#pmalerts_body&apos; ).length ) { //if ( cki_[&apos;pm_alert&apos;] !== document.getElementById(&apos;pmalerts_body&apos;).innerHTML ) { if ( cki_[&apos;pm_alert&apos;] !== pmalerts_content ) { document.getElementById(&apos;pmalerts_holder&apos;).style.display = &apos;block&apos;; jQuery( &quot;body&quot; ).addClass( &apos;pm_isalert&apos; ); } } }); </script> <script> emailAlerts.enableFooterPopup(); </script> </div> <div id="mg2Widget-newsletter-container" /> <script type="text/javascript"> /**Postmedia values**/ var chartbeatPath = window.location.pathname.split( &apos;/&apos; ); var chartbeatpage = chartbeatPath[chartbeatPath.length-1].substring(0,chartbeatPath[chartbeatPath.length-1].lastIndexOf(&apos;.&apos;)); var sectionName = &apos;&apos;; var authorName = &apos;&apos;; if (chartbeatPath[1].lastIndexOf(&apos;.&apos;)==-1) sectionName = chartbeatPath[1]; if (chartbeatpage == &apos;story&apos;) authorName = $j(&apos;#storyheader .name&apos;).text(); /**Chartbeat values**/ var _sf_async_config={}; /** CONFIGURATION START **/ _sf_async_config.uid = 3498; _sf_async_config.useCanonical = true; _sf_async_config.domain = &apos;postmedia.com&apos;; _sf_async_config.sections = &apos;montrealgazette.com&apos;; //This to your Section name _sf_async_config.authors = authorName; //This to your Author name _sf_async_config.videoPageGroups = &apos;true&apos;; /** CONFIGURATION END **/ (function(){ function loadChartbeat() { window._sf_endpt=(new Date()).getTime(); var e = document.createElement(&apos;script&apos;); e.setAttribute(&apos;language&apos;, &apos;javascript&apos;); e.setAttribute(&apos;type&apos;, &apos;text/javascript&apos;); e.setAttribute(&apos;src&apos;, ((&apos;https:&apos; == document.location.protocol) ? &apos;https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/&apos; : &apos;http://static.chartbeat.com/&apos;) + &apos;js/chartbeat_video.js&apos;); document.body.appendChild(e); } var oldonload = window.onload; window.onload = (typeof window.onload != &apos;function&apos;) ? loadChartbeat : function() { oldonload(); loadChartbeat(); }; })(); </script> <img src="http://leadback.advertising.com/adcedge/lb?site=695501&betr=gazettesitert_cs=[+]1[720],3[8760]" width="1" height="1" border="0" /> <script>/* 2011-2015 iPerceptions, Inc. All rights reserved. Do not distribute.iPerceptions provides this code &apos;as is&apos; without warranty of any kind, either express or implied. */window.iperceptionskey = &apos;c639aab4-61e2-4b9e-a7f4-63794e5cd998&apos;;(function () { var a = document.createElement(&apos;script&apos;),b = document.getElementsByTagName(&apos;body&apos;)[0]; a.type = &apos;text/javascript&apos;; a.async = true;a.src = &apos;//universal.iperceptions.com/wrapper.js&apos;;b.appendChild(a);} )();</script> <form name="frmPage" method="post" action="story.html" id="frmPage"> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNDcwODc2MDUzZGT7SCls1bdsXwCxzsDnLHihVoxKUA==" /> <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="BDADDD24" /></form> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push([&apos;_setAccount&apos;, &apos;UA-24419597-2&apos;]); _gaq.push([&apos;_setDomainName&apos;, &apos;montrealgazette.com&apos;]); _gaq.push([&apos;_trackPageview&apos;]); (function() { var ga = document.createElement(&apos;script&apos;); ga.type = &apos;text/javascript&apos;; ga.async = true; ga.src = (&apos;https:&apos; == document.location.protocol ? &apos;https://&apos; : &apos;http://&apos;) + &apos;stats.g.doubleclick.net/dc.js&apos;; var s = document.getElementsByTagName(&apos;script&apos;)[0]; s.parentNode.insertBefore(ga, s); })(); </script> <script> var _comscore = _comscore || []; _comscore.push({ c1: &apos;2&apos;, c2: &apos;10276888&apos; }); (function() { var s = document.createElement(&apos;script&apos;), el = document.getElementsByTagName(&apos;script&apos;)[0]; s.async = true; s.src = (document.location.protocol == &apos;https:&apos; ? &apos;https://sb&apos; : &apos;http://b&apos;) + &apos;.scorecardresearch.com/beacon.js&apos;; el.parentNode.insertBefore(s, el); })(); </script> <noscript> <img src="http://b.scorecardresearch.com/p?c1=2&c2=10276888&cv=2.0&cj=1" /> </noscript> <script language="JavaScript" type="text/javascript" src="/js/account_s_code.js" /> <script language="JavaScript" type="text/javascript" src="http://www.canada.com/js/analytics/core.js?v3" /> <script language="JavaScript" type="text/javascript" src="/js/local_s_code.js" /> <script language="JavaScript" type="text/javascript"> &lt;!-- /* You may give each page an identifying name, server, and channel on the next lines. */ s.pageName=&apos;/news/local-news/story.html&apos;; s.server=window.location.hostname.toLowerCase(); s.channel=&apos;news&apos;; s.pageType=&apos;&apos;; s.prop2=&apos;news/local-news&apos;; s.prop3=&apos;postmedia&apos;; s.prop4=&apos;Non-Registered&apos;; s.prop6=&apos;Metered Content&apos;; s.prop7=&apos;Montreal Gazette&apos;; s.prop8=&apos;10307785&apos;; s.prop10=&apos;&apos;; s.prop11=&apos;&apos;; s.prop13=&apos;&apos;; s.prop23=document.title; s.prop24=&apos;2014/10/19&apos; s.prop25=&apos;story&apos;; s.prop27=&apos;news/local-news&apos;; s.prop28=&apos;&apos;; s.prop29=&apos;&apos;; s.prop36=&apos;firebombing||100~News||100~Montreal Gazette||90&apos;; s.prop37=&apos;&apos;; s.prop48=&apos;Anne Sutherland, Montreal Gazette, Montreal Gazette&apos;; s.events=&apos;event45&apos;; /************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/ var s_code=s.t();if(s_code)document.write(s_code)//--&gt;</script> <script language="JavaScript" type="text/javascript" /><noscript><img src="http://canwest.112.2o7.net/b/ss/canwestglobal/1/H.25.4--NS/0" height="1" width="1" border="0" /></noscript> <script type="text/javascript"> /* &lt;![CDATA[ */ var google_conversion_id = 990309138; var google_custom_params = window.google_tag_params; var google_remarketing_only = true; /* ]]&gt; */ </script> <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js" /> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/990309138/?value=0&guid=ON&script=0" /> </div> </noscript></body> </html>
dajbych/samples
2016/MsFest/Demo2/dataset/02b8ed2a-b434-4dc3-a9d9-1a66d40c4213.html
HTML
mit
57,009
๏ปฟ// -------------------------------------------------------------------- // ยฉ Copyright 2013 Hewlett-Packard Development Company, L.P. //-------------------------------------------------------------------- using HP.LR.Vugen.Common; using HP.LR.VuGen.ServiceCore; using HP.LR.VuGen.ServiceCore.Data.ProjectSystem; using HP.LR.VuGen.ServiceCore.Interfaces; using HP.Utt.ProjectSystem; using HP.Utt.UttCore; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TransactionWriterAddin { public class AutostartCommand : UttBaseCommand { public override void Run() { VuGenServiceManager.RunWhenInitialized(InnerRun); } private void InnerRun() { IVuGenProjectService projectService = VuGenServiceManager.GetService<IVuGenProjectService>(); projectService.ScriptSaved += projectService_ScriptSaved; projectService.ScriptSavedAs += projectService_ScriptSavedAs; if (projectService is UttProjectService) (projectService as UttProjectService).ScriptExported+=AutostartCommand_ScriptExported; } void projectService_ScriptSavedAs(object sender, SaveAsEventArgs e) { AddTransactionNames(e.Script as IVuGenScript); } void AutostartCommand_ScriptExported(object sender, ExportEventArgs e) { AddTransactionNames(e.Script as IVuGenScript,Path.Combine(e.PersistenceToken.LocalPath,e.PersistenceToken.LoadData)); } void projectService_ScriptSaved(object sender, HP.Utt.ProjectSystem.SaveEventArgs e) { AddTransactionNames(e.Script as IVuGenScript); } private static void AddTransactionNames(IVuGenScript script, string usrFileName=null) { try { if (script == null) return; List<IExtraFileScriptItem> extraFiles = script.GetExtraFiles(); IExtraFileScriptItem dynamicTransacrions = null; foreach (IExtraFileScriptItem extraFile in extraFiles) { if (extraFile.FileName == "dynamic_transactions.txt") //This is not configurable. This is the file name! { dynamicTransacrions = extraFile; break; } } if (dynamicTransacrions == null) return; string fileContent = File.ReadAllText(dynamicTransacrions.FullFileName); string[] transactionNames = fileContent.Split(new String[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); IScriptDataObject scriptData = script.GenerateDataObject() as IScriptDataObject; if (scriptData == null) return; List<String> transactionsList = scriptData.SpecialSteps.Transactions; transactionsList.AddRange(transactionNames); IniUsrFile usr; if (usrFileName != null) { usr = new IniUsrFile(usrFileName); } else { usr = new IniUsrFile(script.FileName); } usr.WriteTransactions(transactionsList); usr.Save(); } catch { //Don't want to have adverse influence on the regular usage of VuGen. If this fails it does so silently. } } } }
HPSoftware/VuGenPowerPack
Experimental/TransactionWriterAddin/AutostartCommand.cs
C#
mit
3,176
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>pautomata: Not compatible ๐Ÿ‘ผ</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.12.1 / pautomata - 8.10.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">ยซ Up</a> <h1> pautomata <small> 8.10.0 <span class="label label-info">Not compatible ๐Ÿ‘ผ</span> </small> </h1> <p>๐Ÿ“… <em><script>document.write(moment("2022-01-11 21:45:50 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-11 21:45:50 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.12.1 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.1 Official release 4.09.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/pautomata&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/PAutomata&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.11~&quot;} ] tags: [ &quot;keyword: p-automata&quot; &quot;keyword: ABR&quot; &quot;keyword: PGM&quot; &quot;keyword: time&quot; &quot;category: Computer Science/Concurrent Systems and Protocols/Theory of concurrent systems&quot; ] authors: [ &quot;Emmanuel Freund &amp; Christine Paulin&quot; ] bug-reports: &quot;https://github.com/coq-contribs/pautomata/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/pautomata.git&quot; synopsis: &quot;Parameterized automata&quot; description: &quot;&quot;&quot; This contribution is a modelisation in Coq of the p-automata designed in the CALIFE project (http://www.loria.fr/calife). It contains an axiomatisation of time, the definition of a p-automaton, the definition of binary and arbitrary synchronisation of a family of p-automaton, the semantics of a p-automaton as a labelled transition system. The description of the ABR algorithm as a p-automaton is also given. This work is reported in : P. Castรฉran, E. Freund, C. Paulin and D. Rouillard ``Bibliothรจques Coq et Isabelle-HOL pour les systรจmes de transitions et les p-automates&#39;&#39;&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/pautomata/archive/v8.10.0.tar.gz&quot; checksum: &quot;md5=1b4f2e81e720f28eac572f8ade520e52&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install ๐Ÿœ๏ธ</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-pautomata.8.10.0 coq.8.12.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.12.1). The following dependencies couldn&#39;t be met: - coq-pautomata -&gt; coq &lt; 8.11~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-pautomata.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install ๐Ÿš€</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall ๐Ÿงน</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> ยฉ Guillaume Claret ๐Ÿฃ </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.09.1-2.0.6/released/8.12.1/pautomata/8.10.0.html
HTML
mit
7,398
๏ปฟusing System.Threading.Tasks; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin; using WebProject.Models; namespace WebProject { // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application. public class ApplicationUserManager : UserManager<ApplicationUser> { public ApplicationUserManager(IUserStore<ApplicationUser> store) : base(store) { } public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context) { var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(context.Get<ApplicationDbContext>())); // Configure validation logic for usernames manager.UserValidator = new UserValidator<ApplicationUser>(manager) { AllowOnlyAlphanumericUserNames = false, RequireUniqueEmail = true }; // Configure validation logic for passwords manager.PasswordValidator = new PasswordValidator { RequiredLength = 6, RequireNonLetterOrDigit = true, RequireDigit = true, RequireLowercase = true, RequireUppercase = true, }; var dataProtectionProvider = options.DataProtectionProvider; if (dataProtectionProvider != null) { manager.UserTokenProvider = new DataProtectorTokenProvider<ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity")); } return manager; } } }
saifcoding/angular-apartments-project
WebProject_Server/WebProject/App_Start/IdentityConfig.cs
C#
mit
1,784
#!/usr/bin/env php <?php /** * This file is part of cyberspectrum/pharpiler. * * (c) Christian Schiffler <c.schiffler@cyberspectrum.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * This project is provided in good faith and hope to be usable by anyone. * * @package cyberspectrum/pharpiler * @author Christian Schiffler <c.schiffler@cyberspectrum.de> * @copyright 2015 Christian Schiffler <c.schiffler@cyberspectrum.de> * @license https://github.com/cyberspectrum/pharpiler/blob/master/LICENSE MIT * @link https://github.com/cyberspectrum/pharpiler * @filesource */ if (version_compare(phpversion(), '@@MIN_PHP_VERSION@@', '<=')) { fwrite( STDERR, 'Error: Pharpiler needs at least PHP @@MIN_PHP_VERSION@@ while you have ' . phpversion() . PHP_EOL ); exit; } if (!extension_loaded('Phar')) { fwrite(STDERR, 'Error: Phar extension is needed.' . PHP_EOL); exit; } Phar::mapPhar('pharpiler.phar'); // @codingStandardsIgnoreStart // Compiler generated warning time: // @@DEV_WARNING_TIME@@ require 'phar://pharpiler.phar/bin/pharpiler'; __HALT_COMPILER();
cyberspectrum/pharpiler
phar/stub.php
PHP
mit
1,213
<!DOCTYPE html> <html xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <head> <meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-16" http-equiv="Content-Type" /> <title _locid="PortabilityAnalysis0">.NET Portability Report</title> <style> /* Body style, for the entire document */ body { background: #F3F3F4; color: #1E1E1F; font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; padding: 0; margin: 0; } /* Header1 style, used for the main title */ h1 { padding: 10px 0px 10px 10px; font-size: 21pt; background-color: #E2E2E2; border-bottom: 1px #C1C1C2 solid; color: #201F20; margin: 0; font-weight: normal; } /* Header2 style, used for "Overview" and other sections */ h2 { font-size: 18pt; font-weight: normal; padding: 15px 0 5px 0; margin: 0; } /* Header3 style, used for sub-sections, such as project name */ h3 { font-weight: normal; font-size: 15pt; margin: 0; padding: 15px 0 5px 0; background-color: transparent; } h4 { font-weight: normal; font-size: 12pt; margin: 0; padding: 0 0 0 0; background-color: transparent; } /* Color all hyperlinks one color */ a { color: #1382CE; } /* Paragraph text (for longer informational messages) */ p { font-size: 10pt; } /* Table styles */ table { border-spacing: 0 0; border-collapse: collapse; font-size: 10pt; } table th { background: #E7E7E8; text-align: left; text-decoration: none; font-weight: normal; padding: 3px 6px 3px 6px; } table td { vertical-align: top; padding: 3px 6px 5px 5px; margin: 0px; border: 1px solid #E7E7E8; background: #F7F7F8; } .NoBreakingChanges { color: darkgreen; font-weight:bold; } .FewBreakingChanges { color: orange; font-weight:bold; } .ManyBreakingChanges { color: red; font-weight:bold; } .BreakDetails { margin-left: 30px; } .CompatMessage { font-style: italic; font-size: 10pt; } .GoodMessage { color: darkgreen; } /* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */ .localLink { color: #1E1E1F; background: #EEEEED; text-decoration: none; } .localLink:hover { color: #1382CE; background: #FFFF99; text-decoration: none; } /* Center text, used in the over views cells that contain message level counts */ .textCentered { text-align: center; } /* The message cells in message tables should take up all avaliable space */ .messageCell { width: 100%; } /* Padding around the content after the h1 */ #content { padding: 0px 12px 12px 12px; } /* The overview table expands to width, with a max width of 97% */ #overview table { width: auto; max-width: 75%; } /* The messages tables are always 97% width */ #messages table { width: 97%; } /* All Icons */ .IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded { min-width: 18px; min-height: 18px; background-repeat: no-repeat; background-position: center; } /* Success icon encoded */ .IconSuccessEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==); } /* Information icon encoded */ .IconInfoEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=); } /* Warning icon encoded */ .IconWarningEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==); } /* Error icon encoded */ .IconErrorEncoded { /* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */ /* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=); } </style> </head> <body> <h1 _locid="PortabilityReport">.NET Portability Report</h1> <div id="content"> <div id="submissionId" style="font-size:8pt;"> <p> <i> Submission Id&nbsp; 0ebaaa90-cd97-4915-87f4-108974bb5c51 </i> </p> </div> <h2 _locid="SummaryTitle"> <a name="Portability Summary"></a>Portability Summary </h2> <div id="summary"> <table> <tbody> <tr> <th>Assembly</th> <th>ASP.NET 5,Version=v1.0</th> <th>Windows,Version=v8.1</th> <th>.NET Framework,Version=v4.6</th> <th>Windows Phone,Version=v8.1</th> </tr> <tr> <td><strong><a href="#System.Threading.Tasks.WP7">System.Threading.Tasks.WP7</a></strong></td> <td class="text-center">99.29 %</td> <td class="text-center">97.43 %</td> <td class="text-center">100.00 %</td> <td class="text-center">97.43 %</td> </tr> </tbody> </table> </div> <div id="details"> <a name="System.Threading.Tasks.WP7"><h3>System.Threading.Tasks.WP7</h3></a> <table> <tbody> <tr> <th>Target type</th> <th>ASP.NET 5,Version=v1.0</th> <th>Windows,Version=v8.1</th> <th>.NET Framework,Version=v4.6</th> <th>Windows Phone,Version=v8.1</th> <th>Recommended changes</th> </tr> <tr> <td>System.Collections.Generic.List`1</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Call System.Collections.ObjectModel.ReadOnlyCollection&lt;T&gt; constructor</td> </tr> <tr> <td style="padding-left:2em">AsReadOnly</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Call System.Collections.ObjectModel.ReadOnlyCollection&lt;T&gt; constructor</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Delegate</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use System.Reflection.RuntimeReflectionExtensions.GetMethodInfo</td> </tr> <tr> <td style="padding-left:2em">get_Method</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use System.Reflection.RuntimeReflectionExtensions.GetMethodInfo</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.SystemException</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.String)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.String,System.Exception)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Threading.RegisteredWaitHandle</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Threading.Thread</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>This is only reliable in SQL Server. Elsewhere, don&#39;t use it.</td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Threading.ThreadStart)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">Abort</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>This is only reliable in SQL Server. Elsewhere, don&#39;t use it.</td> </tr> <tr> <td style="padding-left:2em">get_CurrentThread</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_ManagedThreadId</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">get_ThreadState</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">MemoryBarrier</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>Use System.Threading.Interlocked.MemoryBarrier instead</td> </tr> <tr> <td style="padding-left:2em">set_IsBackground(System.Boolean)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">set_Name(System.String)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">Sleep(System.Int32)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">SpinWait(System.Int32)</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">Start</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Threading.ThreadPool</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">QueueUserWorkItem(System.Threading.WaitCallback,System.Object)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">RegisterWaitForSingleObject(System.Threading.WaitHandle,System.Threading.WaitOrTimerCallback,System.Object,System.Int32,System.Boolean)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Threading.ThreadStart</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Object,System.IntPtr)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Threading.ThreadState</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Threading.WaitCallback</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Object,System.IntPtr)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Threading.WaitOrTimerCallback</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td style="padding-left:2em">#ctor(System.Object,System.IntPtr)</td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>System.Type</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().IsGenericType</td> </tr> <tr> <td style="padding-left:2em">get_IsGenericType</td> <td class="IconErrorEncoded"></td> <td class="IconErrorEncoded"></td> <td class="IconSuccessEncoded"></td> <td class="IconErrorEncoded"></td> <td>.GetTypeInfo().IsGenericType</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </tbody> </table> <p> <a href="#Portability Summary">Back to Summary</a> </p> </div> </div> </body> </html>
kuhlenh/port-to-core
Reports/sy/system.threading.tasks.unofficial.3.1.0/System.Threading.Tasks.WP7-sl3-wp.html
HTML
mit
29,038
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Coq bench</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../../..">Unstable</a></li> <li><a href=".">8.4.5 / contrib:cfgv dev</a></li> <li class="active"><a href="">2014-11-19 16:22:58</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="../../../../../about.html">About</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href=".">ยซ Up</a> <h1> contrib:cfgv <small> dev <span class="label label-info">Not compatible with this Coq</span> </small> </h1> <p><em><script>document.write(moment("2014-11-19 16:22:58 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2014-11-19 16:22:58 UTC)</em><p> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>ruby lint.rb unstable ../unstable/packages/coq:contrib:cfgv/coq:contrib:cfgv.dev</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> <dt>Output</dt> <dd><pre>The package is valid. </pre></dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --dry-run coq:contrib:cfgv.dev coq.8.4.5</code></dd> <dt>Return code</dt> <dd>768</dd> <dt>Duration</dt> <dd>0 s</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.4.5). The following dependencies couldn&#39;t be met: - coq:contrib:cfgv -&gt; coq = dev Your request can&#39;t be satisfied: - Conflicting version constraints for coq No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq, to test if the problem was incompatibility with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --dry-run coq:contrib:cfgv.dev</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>3 s</dd> <dt>Output</dt> <dd><pre>The following actions will be performed: - remove coq.8.4.5 === 1 to remove === =-=- Removing Packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Removing coq.8.4.5. [WARNING] Directory /home/bench/.opam/system/lib/coq is not empty, not removing [WARNING] Directory /home/bench/.opam/system/share/coq is not empty, not removing The following actions will be performed: - install coq.dev [required by coq:contrib:cfgv] - install coq:contrib:cfgv.dev === 2 to install === =-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= =-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Building coq.dev: ./configure -configdir /home/bench/.opam/system/lib/coq/config -mandir /home/bench/.opam/system/man -docdir /home/bench/.opam/system/doc -prefix /home/bench/.opam/system -usecamlp5 -camlp5dir /home/bench/.opam/system/lib/camlp5 -coqide no -no-native-compiler make -j4 make install Installing coq.dev. Building coq:contrib:cfgv.dev: coq_makefile -f Make -o Makefile make -j4 make install Installing coq:contrib:cfgv.dev. </pre></dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>Data not available in this bench.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. ยฉ Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io-old
clean/Linux-x86_64-4.02.1-1.2.0/unstable/8.4.5/contrib:cfgv/dev/2014-11-19_16-22-58.html
HTML
mit
6,892
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>Create.js Dokumentation | Bitmap Klasse</title> <link href='http://fonts.googleapis.com/css?family=Roboto:400,300,500,400italic,300italic,700' rel='stylesheet' type='text/css'> <!-- Bootstrap Core CSS --> <link href="../css/bootstrap.min.css" rel="stylesheet"> <!-- Custom CSS --> <link href="../css/simple-sidebar.css" rel="stylesheet"> <link href="../css/style.css" rel="stylesheet"> <link rel="stylesheet" href="../highlight/styles/monokai_sublime.css"> <script src="../highlight/highlight.pack.js"></script> <script>hljs.initHighlightingOnLoad();</script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body data-spy="scroll" data-offset="0" data-target="#myScrollspy"> <div id="wrapper"> <!-- Sidebar --> <div id="sidebar-wrapper"> <ul class="sidebar-nav" id="myScrollspy"> <li class="sidebar-brand"> <a href="#">Methods</a> </li> <li><a href="addEventListener.html">addEventListener</a></li> <li><a href="cache.html">cache</a></li> <li><a href="clone.html">clone</a></li> <li><a href="dispatchEvent.html">dispatchEvent</a></li> <li><a href="draw.html">draw</a></li> <li><a href="getBounds.html">getBounds</a></li> <li><a href="getCacheDataURL.html">getCacheDataURL</a></li> <li><a href="getConcatenatedDisplayProps.html">getConcatenatedDisplayProps</a></li> <li><a href="getConcatenatedMatrix.html">getConcatenatedMatrix</a></li> <li><a href="getMatrix.html">getMatrix</a></li> <li><a href="getTransformedBounds.html">getTransformedBounds</a></li> <li><a href="globalToLocal.html">globalToLocal</a></li> <li><a href="hasEventListener.html">hasEventListener</a></li> <li><a href="hitTest.html">hitTest</a></li> <li><a href="isVisible.html">isVisible</a></li> <li class="active"><a href="localToGlobal.html">localToGlobal</a></li> <li><a href="localToLocal.html">localToLocal</a></li> <li><a href="off.html">off</a></li> <li><a href="on.html">on</a></li> <li><a href="removeAllEventListeners.html">removeAllEventListeners</a></li> <li><a href="removeEventListener.html">removeEventListener</a></li> <li><a href="set.html">set</a></li> <li><a href="setBounds.html">setBounds</a></li> <li><a href="setTransform.html">setTransform</a></li> <li><a href="toString.html">toString</a></li> <li><a href="uncache.html">uncache</a></li> <li><a href="updateCache.html">updateCache</a></li> <li><a href="updateContext.html">updateContext</a></li> <li><a href="willTrigger.html">willTrigger</a></li> </ul> </div> <!-- /#sidebar-wrapper --> <!-- Page Content --> <div id="page-content-wrapper"> <img id="meteor" src="../enemy.png"> <section id="section-intro"> <div class="row"> <div class="col-lg-12"> <h1 class="page-header">Bitmap Klasse</h1> </div> </div> </section> <section id="section-basics"> <div class="row"> <div class="col-lg-12"> <script> var stage; var pictures = []; var listeners = []; function init() { stage = new createjs.Stage(document.getElementById("myCanvas")); createjs.Ticker.setFPS(30); createjs.Ticker.addEventListener("tick",updateStage,false); start(); } function updateStage() { stage.update(); } function start() { shape = new createjs.Shape(); shape.graphics.beginFill(createjs.Graphics.getHSL(0,0,0)).drawRect(0,0,100,100); shape.x = 100; shape.y = 100; stage.addChild(shape); var point = shape.localToGlobal(100, 100); console.log("x: " + point.x, "y: " + point.y); } window.addEventListener("load",init,false); </script> <h3>localToGlobal</h3> <p>Stellt die Umkehrung zu globalToLocal dar, bzw. wandelt Koordinaten eines lokalen Koordinatensystems in das globale Koordinatensystem um.</p> <p>Gibt die Koordinaten 200, 200 zurรผck.</p> <canvas id="myCanvas" width="600" height="400" style="border: 3px solid black;"></canvas> </div> <div class="col-lg-12"> <pre> <code class="javascript">shape = new createjs.Shape(); shape.graphics.beginFill(createjs.Graphics.getHSL(0,0,0)).drawRect(0,0,100,100); shape.x = 100; shape.y = 100; stage.addChild(shape); var point = shape.localToGlobal(100, 100); console.log("x: " + point.x, "y: " + point.y); </code> </pre> </div> </div> </section> </div> <!-- /#page-content-wrapper --> </div> <div id="close-game">&times;</div> <!-- jQuery Version 1.11.1 --> <script src="../js/jquery.js"></script> <!-- Bootstrap Core JavaScript --> <script src="../js/bootstrap.min.js"></script> <script src="../../app/lib/easeljs-0.8.0.min.js"></script> <script src="../../app/lib/preloadjs-0.6.0.min.js"></script> <script src="../../app/lib/soundjs-0.6.0.min.js"></script> <script src="../../app/lib/tweenjs-0.6.0.min.js"></script> <script src="../../app/src/app.js"></script> <!-- TODO: mobile toggle --> <script> $("#menu-toggle").click(function(e) { e.preventDefault(); $("#wrapper").toggleClass("toggled"); }); $('#start-game').click(function() { $('#close-game').fadeIn(); if ($('#game').length <= 0) { $('body').append('<canvas id="game" width="800px" height="200px"><\/canvas>'); var canvas = document.getElementById('game'); canvas.width = window.innerWidth; canvas.height = window.innerHeight; // Spiel Starten new Game(); $('#game').fadeIn(); } }); $('#close-game').click(function() { $(this).fadeOut(); $('#game').fadeOut(function() { $('#game').remove(); $('#game-src').remove(); }); }); </script> </body> </html>
INSY5BI/INSY5BI.github.io
doku/bitmap/localToGlobal.html
HTML
mit
6,810
import {Stage} from '../display/Stage'; import {Event} from '../event/Event'; import {EventEmitter} from '../event/EventEmitter'; export class Media extends EventEmitter { protected readonly $element: HTMLImageElement | HTMLAudioElement; protected $loaded: boolean = false; protected $errored: boolean = false; protected readonly $stage: Stage; protected readonly $boundOnLoad: () => void; protected readonly $boundOnError: (e: ErrorEvent) => void; protected constructor(stage: Stage) { super(); this.$stage = stage; this.$boundOnLoad = this.$onLoad.bind(this); this.$boundOnError = this.$onError.bind(this); } public get element(): HTMLImageElement | HTMLAudioElement { return this.$element; } public get url(): string { return this.$element.src || ''; } public set url(url: string) { this.$loaded = false; this.$errored = false; this.$element.src = url; } public on(type: string, listener: (...args: any[]) => void): this { super.on(type, listener); if (type === Event.LOAD && this.$loaded) { let event = Event.create(type); listener.call(this, event); event.release(); } else if (type === Event.ERROR && this.$errored) { let event = Event.create(type); listener.call(this, event); event.release(); } return this; } protected $onLoad(): void { this.$loaded = true; this.emit(Event.LOAD); this.$element.removeEventListener(Event.LOAD, this.$boundOnLoad); } protected $onError(): void { this.$errored = true; this.emit(Event.ERROR); this.$element.removeEventListener(Event.ERROR, this.$boundOnError); } }
Lanfei/Go2d
src/media/Media.ts
TypeScript
mit
1,594
// UrlRewriter - A .NET URL Rewriter module // Version 2.0 // // Copyright 2011 Intelligencia // Copyright 2011 Seth Yates // using System; namespace Intelligencia.UrlRewriter.Actions { /// <summary> /// Action that sets properties in the context. /// </summary> public class SetPropertyAction : IRewriteAction { /// <summary> /// Default constructor. /// </summary> /// <param name="name">The name of the variable.</param> /// <param name="value">The name of the value.</param> public SetPropertyAction(string name, string value) { if (name == null) { throw new ArgumentNullException("name"); } if (value == null) { throw new ArgumentNullException("value"); } _name = name; _value = value; } /// <summary> /// The name of the variable. /// </summary> public string Name { get { return _name; } } /// <summary> /// The value of the variable. /// </summary> public string Value { get { return _value; } } /// <summary> /// Executes the action. /// </summary> /// <param name="context">The rewrite context.</param> public RewriteProcessing Execute(IRewriteContext context) { if (context == null) { throw new ArgumentNullException("context"); } context.Properties.Set(Name, context.Expand(Value)); return RewriteProcessing.ContinueProcessing; } private string _name; private string _value; } }
sethyates/urlrewriter
src/Actions/SetPropertyAction.cs
C#
mit
1,857
package name.reidmiller.iesoreports.client; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import java.io.IOException; import java.net.MalformedURLException; import java.util.Calendar; import java.util.Date; import java.util.List; import name.reidmiller.iesoreports.IesoPublicReportBindingsConfig; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.Before; import org.junit.Test; import ca.ieso.reports.schema.predispmkttotals.Document; import ca.ieso.reports.schema.predispmkttotals.DocHeader; import ca.ieso.reports.schema.predispmkttotals.DocBody; public class PredispatchMarketTotalsClientTest { private Logger logger = LogManager.getLogger(this.getClass()); private PredispatchMarketTotalsClient predispatchMarketTotalsClient; @Before public void setUp() throws Exception { predispatchMarketTotalsClient = IesoPublicReportBindingsConfig .predispatchMarketTotalsClient(); } @Test public void testGetDefaultDocument() { try { assertNotNull(Document.class.getName() + " could not be retrieved from XML", predispatchMarketTotalsClient.getDefaultDocument()); } catch (MalformedURLException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); } } @Test public void testGetDefaultDocHeader() { try { assertNotNull(DocHeader.class.getName() + " could not be retrieved from XML", predispatchMarketTotalsClient.getDefaultDocHeader()); } catch (MalformedURLException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); } } @Test public void testGetDocHeaderForDate() { Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, -1); Date yesterday = cal.getTime(); try { assertNotNull(DocHeader.class.getName() + " could not be retrieved from XML", predispatchMarketTotalsClient.getDocHeaderForDate(yesterday)); } catch (MalformedURLException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); } } @Test public void testGetDocHeadersInDateRange() { Calendar calStart = Calendar.getInstance(); calStart.add(Calendar.DATE, -3); try { List<DocHeader> docHeaders = predispatchMarketTotalsClient .getDocHeadersInDateRange(calStart.getTime(), new Date()); assertNotNull("List of " + DocHeader.class.getName() + " Objects could not be retrieved from XML", docHeaders); assertEquals("Unexpected number of " + DocHeader.class.getName() + " Objects returned.", docHeaders.size(), 4); } catch (MalformedURLException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); } } @Test public void testGetDocBodiesInDateRange() { Calendar calStart = Calendar.getInstance(); calStart.add(Calendar.DATE, -3); try { List<DocBody> docBodies = predispatchMarketTotalsClient.getDocBodiesInDateRange( calStart.getTime(), new Date()); assertNotNull("List of " + DocBody.class.getName() + " Objects could not be retrieved from XML", docBodies); assertEquals("Unexpected number of " + DocBody.class.getName() + " Objects returned.", docBodies.size(), 4); } catch (MalformedURLException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); } } @Test public void testGetDefaultDocBody() { try { assertNotNull(DocBody.class.getName() + " could not be retrieved from XML", predispatchMarketTotalsClient.getDefaultDocBody()); } catch (MalformedURLException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); } } @Test public void testGetDocBodyForDate() { Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, -1); Date yesterday = cal.getTime(); try { assertNotNull(DocBody.class.getName() + " could not be retrieved from XML", predispatchMarketTotalsClient.getDocBodyForDate(yesterday)); } catch (MalformedURLException e) { fail(e.getMessage()); } catch (IOException e) { fail(e.getMessage()); } } }
r24mille/IesoPublicReportBindings
src/test/java/name/reidmiller/iesoreports/client/PredispatchMarketTotalsClientTest.java
Java
mit
4,264
#include "btree.h" #include "tqueue.h" #include <stdio.h> #include <stdlib.h> BTree btree_crear() { return NULL; } void btree_destruir(BTree nodo) { if (nodo != NULL) { btree_destruir(nodo->left); btree_destruir(nodo->right); free(nodo); } } BTree btree_unir(int dato, BTree left, BTree right) { BTree nuevoNodo = malloc(sizeof(BTNodo)); nuevoNodo->dato = dato; nuevoNodo->left = left; nuevoNodo->right = right; return nuevoNodo; } /** * Ejercicio 3 */ int btree_sum(BTree arbol) { if (arbol) { return (arbol->dato + btree_sum(arbol->left) + btree_sum(arbol->right)); } else { return 0; } } int btree_nodos(BTree arbol) { if (arbol) { return (1 + btree_nodos(arbol->left) + btree_nodos(arbol->right)); } else return 0; } int btree_altura(BTree arbol) { int profundidadDerecha, profundidadIzquierda; if (!arbol) { return 0; } else { profundidadIzquierda = btree_altura(arbol->left); profundidadDerecha = btree_altura(arbol->right); if (profundidadIzquierda > profundidadDerecha) { return (profundidadIzquierda + 1); } else { return (profundidadDerecha + 1); } } } /** * Ejercicio 4 */ void btree_recorrer(BTree arbol, BTreeOrdenDeRecorrido orden, FuncionVisitante visit) { if (arbol) { if (orden == BTREE_RECORRIDO_IN) { btree_recorrer(arbol->left, orden, visit); visit(arbol->dato); btree_recorrer(arbol->right, orden, visit); } else if (orden == BTREE_RECORRIDO_POST) { btree_recorrer(arbol->left, orden, visit); btree_recorrer(arbol->right, orden, visit); visit(arbol->dato); } else if (orden == BTREE_RECORRIDO_PRE) { visit(arbol->dato); btree_recorrer(arbol->left, orden, visit); btree_recorrer(arbol->right, orden, visit); } else return; } else return; } /** * Ejercicio 5 */ void btree_recorrer_extra(BTree arbol, BTreeOrdenDeRecorrido orden, FuncionVisitanteExtra visit, void *extra) { if (arbol) { if (orden == BTREE_RECORRIDO_IN) { btree_recorrer_extra(arbol->left, orden, visit, extra); visit(arbol->dato, extra); btree_recorrer_extra(arbol->right, orden, visit, extra); } else if (orden == BTREE_RECORRIDO_POST) { btree_recorrer_extra(arbol->left, orden, visit, extra); btree_recorrer_extra(arbol->right, orden, visit, extra); visit(arbol->dato, extra); } else if (orden == BTREE_RECORRIDO_PRE) { visit(arbol->dato, extra); btree_recorrer_extra(arbol->left, orden, visit, extra); btree_recorrer_extra(arbol->right, orden, visit, extra); } } } /* Sumar nodos */ static void sumar_nodos(int dato, void *extra) { *((int *)extra) += dato; } int btree_sum_extra(BTree arbol) { int sumaTotal = 0; btree_recorrer_extra(arbol, BTREE_RECORRIDO_PRE, sumar_nodos, &sumaTotal); return sumaTotal; } /* Contar nodos */ static void contar_nodos(int data, void *extra) { *((int *)extra) += 1; } int btree_nodos_extra(BTree arbol) { int contador = 0; btree_recorrer_extra(arbol, BTREE_RECORRIDO_IN, contar_nodos, &contador); return contador; } /* La funcion que calcula la altura no se puede rehacer con el recorrido * con dato extra porque el recorrido va solamente hacia abajo y para * calcular la altura necesito comparar entre los subarboles */ /** * Ejercicio 6 */ void btree_recorrer_bfs(BTree arbol, FuncionVisitante visit) { TQueue cola = NULL; BTNodo *temp = arbol; if(!arbol) return; cola = tqueue_encolar(cola, arbol); while(cola != NULL) { visit(cola->currentNode->dato); if(cola->currentNode->left) { cola = tqueue_encolar(cola, cola->currentNode->left); } if(cola->currentNode->right) { cola = tqueue_encolar(cola, cola->currentNode->right); } cola = tqueue_desencolar(cola); } } /** * Ejercicio 7 */ BTree btree_espejar(BTree arbol) { BTree temp = arbol; BTNodo *nodo; if(!arbol) return NULL; temp->left = btree_espejar(temp->left); temp->right = btree_espejar(temp->right); nodo = temp->left; temp->left = temp->right; temp->right = nodo; }
Elvf/EDyA1
Practica 4/BTree/btree.c
C
mit
4,198
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_292) on Fri Jul 02 16:35:38 UTC 2021 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>org.bukkit.configuration.serialization Class Hierarchy (Glowkit 1.16.5-R0.1-SNAPSHOT API)</title> <meta name="date" content="2021-07-02"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.bukkit.configuration.serialization Class Hierarchy (Glowkit 1.16.5-R0.1-SNAPSHOT API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/bukkit/configuration/file/package-tree.html">Prev</a></li> <li><a href="../../../../org/bukkit/conversations/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/bukkit/configuration/serialization/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 class="title">Hierarchy For Package org.bukkit.configuration.serialization</h1> <span class="packageHierarchyLabel">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="../../../../overview-tree.html">All Packages</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="typeNameLink">Object</span></a> <ul> <li type="circle">org.bukkit.configuration.serialization.<a href="../../../../org/bukkit/configuration/serialization/ConfigurationSerialization.html" title="class in org.bukkit.configuration.serialization"><span class="typeNameLink">ConfigurationSerialization</span></a></li> </ul> </li> </ul> <h2 title="Interface Hierarchy">Interface Hierarchy</h2> <ul> <li type="circle">org.bukkit.configuration.serialization.<a href="../../../../org/bukkit/configuration/serialization/ConfigurationSerializable.html" title="interface in org.bukkit.configuration.serialization"><span class="typeNameLink">ConfigurationSerializable</span></a></li> </ul> <h2 title="Annotation Type Hierarchy">Annotation Type Hierarchy</h2> <ul> <li type="circle">org.bukkit.configuration.serialization.<a href="../../../../org/bukkit/configuration/serialization/DelegateDeserialization.html" title="annotation in org.bukkit.configuration.serialization"><span class="typeNameLink">DelegateDeserialization</span></a> (implements java.lang.annotation.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>)</li> <li type="circle">org.bukkit.configuration.serialization.<a href="../../../../org/bukkit/configuration/serialization/SerializableAs.html" title="annotation in org.bukkit.configuration.serialization"><span class="typeNameLink">SerializableAs</span></a> (implements java.lang.annotation.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>)</li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/bukkit/configuration/file/package-tree.html">Prev</a></li> <li><a href="../../../../org/bukkit/conversations/package-tree.html">Next</a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/bukkit/configuration/serialization/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2021. All rights reserved.</small></p> </body> </html>
GlowstoneMC/glowstonemc.github.io
jd/glowkit/1.16/org/bukkit/configuration/serialization/package-tree.html
HTML
mit
6,529
var assert = require('assert'); var Stream = require('readable-stream'); var csv = require('../src'); // Tools function getStreamObjs(stream, cb) { var objs = []; stream.on('readable', function () { var obj; do { obj = stream.read(); if(obj !== null) { objs.push(obj); } } while(obj !== null); }); stream.on('end', function () { cb(objs); }); } function getStreamText(stream, cb) { var text = ''; stream.on('readable', function () { var chunk; do { chunk = stream.read(); if(chunk !== null) { text += chunk.toString(); } } while(chunk !== null); }); stream.on('end', function () { cb(text); }); } function getStreamBuffer(stream, cb) { var buf = new Buffer(''); stream.on('readable', function () { var chunk; do { chunk = stream.read(); if(chunk) { buf = Buffer.concat([buf, chunk]); } } while(chunk !== null); }); stream.on('end', function () { cb(buf); }); } describe('csv parser', function() { describe('in array mode', function() { it('should work for csv with single seps config', function(done) { var parser = new csv.Parser({ esc: '\\', sep: ',', linesep: '\n' }); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ [1, 'te,st1', 'anot,her test1'], [2, 'te,st2', 'anot,her test2'], [3, 'te,st3', 'anot,her test3'], [4, 'te,st4', 'anot,her test4'] ]); done(); }); parser.write('1,te\\,st1,anot\\,her test1\n'); parser.write('2,te\\,st2,anot\\,her test2\n'); parser.write('3,te\\,st3,anot\\,her test3\n'); parser.write('4,te\\,st4,anot\\,her test4\n'); parser.end(); }); it('should work for csv with csv config', function(done) { var parser = new csv.Parser(csv.csvOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ [1, 'test1', 'another test1'], [2, 'test2', 'another test2'], [3, 'test3', 'another test3'], [4, 'test4', 'another test4'] ]); done(); }); parser.write('1,test1,another test1\r\n'); parser.write('2,test2,another test2\r\n'); parser.write('3,test3,another test3\r\n'); parser.write('4,test4,another test4\r\n'); parser.end(); }); it('should work for csv with csv config with an empty first column', function(done) { var parser = new csv.Parser(csv.csvOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ ['', 'test1', 'another test1'], ['', 'test2', 'another test2'], ['', 'test3', 'another test3'], ['', 'test4', 'another test4'] ]); done(); }); parser.write(',test1,another test1\r\n'); parser.write(',test2,another test2\r\n'); parser.write(',test3,another test3\r\n'); parser.write(',test4,another test4\r\n'); parser.end(); }); it('should work for csv with csv config with an empty last column', function(done) { var parser = new csv.Parser(csv.csvOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ [1, 'test1', ''], [2, 'test2', ''], [3, 'test3', ''], [4, 'test4', ''] ]); done(); }); parser.write('1,test1,\r\n'); parser.write('2,test2,\r\n'); parser.write('3,test3,\r\n'); parser.write('4,test4,\r\n'); parser.end(); }); it('should work for csv with csv config with only 2 empty columns', function(done) { var parser = new csv.Parser(csv.csvOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ ['', ''], ['', ''], ['', ''], ['', ''] ]); done(); }); parser.write(',\r\n'); parser.write(',\r\n'); parser.write(',\r\n'); parser.write(',\r\n'); parser.end(); }); it('should work for csv with one field per line', function(done) { var parser = new csv.Parser(csv.csvOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ ['another test1'], ['another test2'], ['another test3'], ['another test4'] ]); done(); }); parser.write('another test1\r\n'); parser.write('another test2\r\n'); parser.write('another test3\r\n'); parser.write('another test4\r\n'); parser.end(); }); it('should work for csv with one field per line and no new line at the end', function(done) { var parser = new csv.Parser(csv.csvOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ ['another test1'], ['another test2'], ['another test3'], ['another test4'] ]); done(); }); parser.write('another test1\r\n'); parser.write('another test2\r\n'); parser.write('another test3\r\n'); parser.write('another test4'); parser.end(); }); it('should work for tsv with tsv config', function(done) { var parser = new csv.Parser(csv.tsvOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ [1, 'test1', 'another test1'], [2, 'test2', 'another test2'], [3, 'test3', 'another test3'], [4, 'test4', 'another test4'] ]); done(); }); parser.write('1\ttest1\tanother test1\r\n'); parser.write('2\ttest2\tanother test2\n'); parser.write('3\ttest3\tanother test3\r\n'); parser.write('4\ttest4\tanother test4\n'); parser.end(); }); it('should work for tsv with tsv config and complexer content', function(done) { var parser = new csv.Parser(csv.tsvOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ [1, 'test1', 'multi\r\nline\r\ntest1'], [2, 'test2', 'multi\r\nline\r\ntest1'], [3, 'test3', 'multi\r\nline\r\ntest1'], [4, 'test4', 'multi\r\nline\r\ntest1'] ]); done(); }); parser.write('1\ttest1\t"multi\r\nline\r\ntest1"\r\n'); parser.write('2\ttest2\t"multi\r\nline\r\ntest1"\n'); parser.write('3\ttest3\t"multi\r\nline\r\ntest1"\r\n'); parser.write('4\ttest4\t"multi\r\nline\r\ntest1"\n'); parser.end(); }); it('should work for csv with RFC csv config', function(done) { var parser = new csv.Parser(csv.csvRFCOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ [1, 'test1', 'another test1'], [2, 'test2', 'another test2'], [3, 'test3', 'another test3'], [4, 'test4', 'another test4'] ]); done(); }); parser.write('1,test1,another test1\r\n'); parser.write('2,test2,another test2\r\n'); parser.write('3,test3,another test3\r\n'); parser.write('4,test4,another test4\r\n'); parser.end(); }); it('should work with multichars config', function(done) { var parser = new csv.Parser({ linesep: 'aaaa', sep: 'bbbb', esc: 'cccc', quot: 'dddd' }); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ [1, 'test1', 'anobbther test1'], [2, 'test2', 'anobbbbther test2'], [3, 'test3', 'anobbther test3'], [4, 'test4', 'anobbbbther test4'] ]); done(); }); parser.write('1bbbbtest1bbbbanobbther test1aaaa'); parser.write('2bbbbtest2bbbbanoccccbbbbther test2aaaa'); parser.write('3bbbbtest3bbbbanobbther test3aaaa'); parser.write('4bbbbtest4bbbbanoccccbbbbther test4aaaa'); parser.end(); }); it('should work for csv when fields are given', function(done) { var parser = new csv.Parser({ fields: ['id', 'label', 'description'] }); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [{ id: 1, label: 'test1', description: 'another test1' },{ id: 2, label: 'test2', description: 'another test2' },{ id: 3, label: 'test3', description: 'another test3' },{ id: 4, label: 'test4', description: 'another test4' }]); done(); }); parser.write('1,test1,another test1\r\n'); parser.write('2,test2,another test2\r\n'); parser.write('3,test3,another test3\r\n'); parser.write('4,test4,another test4\r\n'); parser.end(); }); it('should work for csv with csv config and quotes', function(done) { var parser = new csv.Parser(csv.csvQuotOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ [1, 'test1', 'an "other" test1'], [2, 'test2', 'an "other" test2'], [3, 'test3', 'an "other" test3'], [4, 'test4', 'an "other" test4'] ]); done(); }); parser.write('1,"test1","an \\"other\\" test1"\r\n'); parser.write('2,"test2","an \\"other\\" test2"\r\n'); parser.write('3,"test3","an \\"other\\" test3"\r\n'); parser.write('4,"test4","an \\"other\\" test4"\r\n'); parser.end(); }); it('should work for csv with RFC csv config and quotes', function(done) { var parser = new csv.Parser(csv.csvRFCOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ [1, 'test1', 'an "other" test1'], [2, 'test2', 'an "other" test2'], [3, 'test3', 'an "other" test3'], [4, 'test4', 'an "other" test4'] ]); done(); }); parser.write('1,"test1","an ""other"" test1"\r\n'); parser.write('2,"test2","an ""other"" test2"\r\n'); parser.write('3,"test3","an ""other"" test3"\r\n'); parser.write('4,"test4","an ""other"" test4"\r\n'); parser.end(); }); it('should work for csv with RFC csv config and quotes but no new line at the end', function(done) { var parser = new csv.Parser(csv.csvRFCOpts); getStreamObjs(parser, function(objs) { assert.deepEqual(objs, [ [1, 'test1', 'an "other" test1'], [2, 'test2', 'an "other" test2'], [3, 'test3', 'an "other" test3'], [4, 'test4', 'an "other" test4'] ]); done(); }); parser.write('1,"test1","an ""other"" test1"\r\n'); parser.write('2,"test2","an ""other"" test2"\r\n'); parser.write('3,"test3","an ""other"" test3"\r\n'); parser.write('4,"test4","an ""other"" test4"'); parser.end(); }); it('should fail when a quoted field isn\'t closed', function(done) { var parser = new csv.Parser(csv.csvRFCOpts); parser.on('error', function(err) { assert.equal(err.message, 'Unclosed field detected.'); done(); }); parser.write('1,"test1","an ""other"" test1\r\n'); parser.write('2,test2,an other test2\r\n'); parser.write('3,test3,an other test3\r\n'); parser.write('4,test4,an other test4\r\n'); parser.end(); }); it('should fail when a quoted field is closed with another quote than the one that opened it', function(done) { var parser = new csv.Parser({ quote:['"','\''] }); parser.on('error', function(err) { assert.equal(err.message, 'Unclosed field detected.'); done(); }); parser.write('1,"test1","an ""other"" test1\r\n'); parser.write('2,"test2\',an other test2\r\n'); parser.write('3,test3,an other test3\r\n'); parser.write('4,test4,an other test4\r\n'); parser.end(); }); }); it('should work when new wasn\'t used', function() { assert.doesNotThrow(function() { csv.Parser() instanceof csv.Parser; }) }); it('should fail with no linesep is given', function() { assert.throws(function() { new csv.Parser({ linesep:[] }); }) }); it('should fail with no field sep is given', function() { assert.throws(function() { new csv.Parser({ sep:[] }); }) }); }); describe('csv encoder', function() { describe('with arrays', function() { describe('should work with csv config', function() { it('and simple input', function(done) { var encoder = new csv.Encoder(csv.csvOpts); getStreamText(encoder, function(text) { assert.equal(text, '1,test1,another test1\r\n' + '2,test2,another test2\r\n' + '3,test3,another test3\r\n' + '4,test4,another test4\r\n' ); done(); }); encoder.write([1, 'test1', 'another test1']); encoder.write([2, 'test2', 'another test2']); encoder.write([3, 'test3', 'another test3']); encoder.write([4, 'test4', 'another test4']); encoder.end(); }); it('with an empty first column', function(done) { var encoder = new csv.Encoder(csv.csvOpts); getStreamText(encoder, function(text) { assert.equal(text, ',test1,another test1\r\n' + ',test2,another test2\r\n' + ',test3,another test3\r\n' + ',test4,another test4\r\n' ); done(); }); encoder.write(['', 'test1', 'another test1']); encoder.write(['', 'test2', 'another test2']); encoder.write(['', 'test3', 'another test3']); encoder.write(['', 'test4', 'another test4']); encoder.end(); }); it('with an empty last column', function(done) { var encoder = new csv.Encoder(csv.csvOpts); getStreamText(encoder, function(text) { assert.equal(text, '1,test1,\r\n' + '2,test2,\r\n' + '3,test3,\r\n' + '4,test4,\r\n' ); done(); }); encoder.write([1, 'test1', '']); encoder.write([2, 'test2', '']); encoder.write([3, 'test3', '']); encoder.write([4, 'test4', '']); encoder.end(); }); it('with only 2 empty columns', function(done) { var encoder = new csv.Encoder(csv.csvOpts); getStreamText(encoder, function(text) { assert.equal(text, ',\r\n' + ',\r\n' + ',\r\n' + ',\r\n' ); done(); }); encoder.write(['', '']); encoder.write(['', '']); encoder.write(['', '']); encoder.write(['', '']); encoder.end(); }); it('only one field per line', function(done) { var encoder = new csv.Encoder(csv.csvOpts); getStreamText(encoder, function(text) { assert.equal(text, 'another test1\r\n' + 'another test2\r\n' + 'another test3\r\n' + 'another test4\r\n' ); done(); }); encoder.write(['another test1']); encoder.write(['another test2']); encoder.write(['another test3']); encoder.write(['another test4']); encoder.end(); }); it('and input needing escape', function(done) { var encoder = new csv.Encoder(csv.csvOpts); getStreamText(encoder, function(text) { assert.equal(text, '1,te\\,st1,ano\\,ther \\,test1\r\n' + '2,te\\,st2,ano\\,ther \\,test2\r\n' + '3,te\\,st3,ano\\,ther \\,test3\r\n' + '4,te\\,st4,ano\\,ther \\,test4\r\n' ); done(); }); encoder.write([1, 'te,st1', 'ano,ther ,test1']); encoder.write([2, 'te,st2', 'ano,ther ,test2']); encoder.write([3, 'te,st3', 'ano,ther ,test3']); encoder.write([4, 'te,st4', 'ano,ther ,test4']); encoder.end(); }); it('in object mode', function(done) { var encoder = new csv.Encoder({ fields: ['id', 'label', 'description'] }); getStreamText(encoder, function(text) { assert.equal(text, '1,te\\,st1,ano\\,ther \\,test1\r\n' + '2,te\\,st2,ano\\,ther \\,test2\r\n' + '3,te\\,st3,ano\\,ther \\,test3\r\n' + '4,te\\,st4,ano\\,ther \\,test4\r\n' ); done(); }); encoder.write({ id: 1, label: 'te,st1', description: 'ano,ther ,test1' }); encoder.write({ id: 2, label: 'te,st2', description: 'ano,ther ,test2' }); encoder.write({ id: 3, label: 'te,st3', description: 'ano,ther ,test3' }); encoder.write({ id: 4, label: 'te,st4', description: 'ano,ther ,test4' }); encoder.end(); }); }); describe('should work with tsv config', function() { it('and simple input', function(done) { var encoder = new csv.Encoder(csv.tsvOpts); getStreamText(encoder, function(text) { assert.equal(text, '1\ttest1\tanother test1\r\n' + '2\ttest2\tanother test2\r\n' + '3\ttest3\tanother test3\r\n' + '4\ttest4\tanother test4\r\n' ); done(); }); encoder.write([1, 'test1', 'another test1']); encoder.write([2, 'test2', 'another test2']); encoder.write([3, 'test3', 'another test3']); encoder.write([4, 'test4', 'another test4']); encoder.end(); }); it('and input needing escape', function(done) { var encoder = new csv.Encoder(csv.tsvOpts); getStreamText(encoder, function(text) { assert.equal(text, '1\t"te\tst1\n"\t"\r\nano\tther\r \ttest1"\r\n' + '2\t"te\tst2\n"\t"\r\nano\tther\r \ttest2"\r\n' + '3\t"te\tst3\n"\t"\r\nano\tther\r \ttest3"\r\n' + '4\t"te\tst4\n"\t"\r\nano\tther\r \ttest4"\r\n' ); done(); }); encoder.write([1, 'te\tst1\n', '\r\nano\tther\r \ttest1']); encoder.write([2, 'te\tst2\n', '\r\nano\tther\r \ttest2']); encoder.write([3, 'te\tst3\n', '\r\nano\tther\r \ttest3']); encoder.write([4, 'te\tst4\n', '\r\nano\tther\r \ttest4']); encoder.end(); }); }); describe('should work with the CSV RFC config', function() { it('with fields containing quotes', function(done) { var encoder = new csv.Encoder(csv.csvRFCOpts); getStreamText(encoder, function(text) { assert.equal(text, '1,tu,"""peux""",pas,"te""st"\r\n' + '2,tu,"""peux""",pas,"te""st"\r\n' + '3,tu,"""peux""",pas,"te""st"\r\n' + '4,tu,"""peux""",pas,"te""st"\r\n' ); done(); }); encoder.write([1, 'tu', '"peux"', 'pas', 'te"st']); encoder.write([2, 'tu', '"peux"', 'pas', 'te"st']); encoder.write([3, 'tu', '"peux"', 'pas', 'te"st']); encoder.write([4, 'tu', '"peux"', 'pas', 'te"st']); encoder.end(); }); it('with fields with new lines', function(done) { var encoder = new csv.Encoder(csv.csvRFCOpts); getStreamText(encoder, function(text) { assert.equal(text, '1,tu,"pe\r\nux","\r\npas\r\n",test\r\n' + '2,tu,"pe\r\nux","\r\npas\r\n",test\r\n' + '3,tu,"pe\r\nux","\r\npas\r\n",test\r\n' + '4,tu,"pe\r\nux","\r\npas\r\n",test\r\n' ); done(); }); encoder.write([1, 'tu', 'pe\r\nux', '\r\npas\r\n', 'test']); encoder.write([2, 'tu', 'pe\r\nux', '\r\npas\r\n', 'test']); encoder.write([3, 'tu', 'pe\r\nux', '\r\npas\r\n', 'test']); encoder.write([4, 'tu', 'pe\r\nux', '\r\npas\r\n', 'test']); encoder.end(); }); }); describe('should work with custom config', function() { it('introducing quotes and unix new lines', function(done) { var encoder = new csv.Encoder({ quote: '"', linesep: '\n' }); getStreamText(encoder, function(text) { assert.equal(text, '1,"\\"tu",peux,pas,"test\\""\n' + '2,"\\"tu",peux,pas,"test\\""\n' + '3,"\\"tu",peux,pas,"test\\""\n' + '4,"\\"tu",peux,pas,"test\\""\n' ); done(); }); encoder.write([1, '"tu', 'peux', 'pas', 'test"']); encoder.write([2, '"tu', 'peux', 'pas', 'test"']); encoder.write([3, '"tu', 'peux', 'pas', 'test"']); encoder.write([4, '"tu', 'peux', 'pas', 'test"']); encoder.end(); }); it('introducing exotic chars', function(done) { var encoder = new csv.Encoder({ quote: '~', sep: 'รฉ', esc: 'โ‚ฌ', toEsc: ['โ‚ฌ', '~', 'รฉ', 'ร '], linesep: 'ร ' }); getStreamText(encoder, function(text) { assert.equal(text, '1รฉ~tโ‚ฌ~u~รฉ~pโ‚ฌรฉux~รฉ~pโ‚ฌโ‚ฌs~รฉ~tโ‚ฌร st~ร ' + '2รฉ~tโ‚ฌ~u~รฉ~pโ‚ฌรฉux~รฉ~pโ‚ฌโ‚ฌs~รฉ~tโ‚ฌร st~ร ' + '3รฉ~tโ‚ฌ~u~รฉ~pโ‚ฌรฉux~รฉ~pโ‚ฌโ‚ฌs~รฉ~tโ‚ฌร st~ร ' + '4รฉ~tโ‚ฌ~u~รฉ~pโ‚ฌรฉux~รฉ~pโ‚ฌโ‚ฌs~รฉ~tโ‚ฌร st~ร ' ); done(); }); encoder.write([1, 't~u', 'pรฉux', 'pโ‚ฌs', 'tร st']); encoder.write([2, 't~u', 'pรฉux', 'pโ‚ฌs', 'tร st']); encoder.write([3, 't~u', 'pรฉux', 'pโ‚ฌs', 'tร st']); encoder.write([4, 't~u', 'pรฉux', 'pโ‚ฌs', 'tร st']); encoder.end(); }); it('introducing exotic chars', function(done) { var encoder = new csv.Encoder({ quote: '~', sep: 'รฉ', esc: 'โ‚ฌ', linesep: 'ร ' }); getStreamText(encoder, function(text) { assert.equal(text, '1รฉ~tโ‚ฌ~u~รฉ~pรฉux~รฉ~pโ‚ฌโ‚ฌs~รฉ~tร st~ร ' + '2รฉ~tโ‚ฌ~u~รฉ~pรฉux~รฉ~pโ‚ฌโ‚ฌs~รฉ~tร st~ร ' + '3รฉ~tโ‚ฌ~u~รฉ~pรฉux~รฉ~pโ‚ฌโ‚ฌs~รฉ~tร st~ร ' + '4รฉ~tโ‚ฌ~u~รฉ~pรฉux~รฉ~pโ‚ฌโ‚ฌs~รฉ~tร st~ร ' ); done(); }); encoder.write([1, 't~u', 'pรฉux', 'pโ‚ฌs', 'tร st']); encoder.write([2, 't~u', 'pรฉux', 'pโ‚ฌs', 'tร st']); encoder.write([3, 't~u', 'pรฉux', 'pโ‚ฌs', 'tร st']); encoder.write([4, 't~u', 'pรฉux', 'pโ‚ฌs', 'tร st']); encoder.end(); }); }); }); it('should work when new wasn\'t used', function() { assert.doesNotThrow(function() { csv.Encoder() instanceof csv.Encoder; }) }); it('should fail with objects when no fields were given', function() { var encoder = new csv.Encoder(); assert.throws(function() { encoder.write({ id:1, label: 'test' }); }) }); }); describe('csv excel wrapper', function() { it('should work as expected', function(done) { var input = new Stream.PassThrough(); var output = csv.wrapForExcel(input); getStreamBuffer(output, function(buf) { assert.deepEqual(buf, Buffer.concat([ new Buffer([0xFF, 0xFE]), new Buffer( '1,test1,another test1\r\n' + '2,test2,another test2\r\n', 'ucs2' ) ]) ); done(); }); input.write('1,test1,another test1\r\n'); input.write('2,test2,another test2\r\n'); input.end(); }); });
SimpliField/oh-csv
tests/index.mocha.js
JavaScript
mit
24,089
/* * Floern, dev@floern.com, 2017, MIT Licence */ package com.floern.genericbot.frame.stackexchange.api; import com.floern.genericbot.frame.GenericBot; import com.floern.genericbot.frame.stackexchange.api.model.Comment; import com.floern.genericbot.frame.stackexchange.api.model.CommentsContainer; import java.util.HashSet; import java.util.Set; public class CommentsLoaderService extends ApiLoaderService<CommentsContainer> { /** unix timestamp of most recent known comment */ private long newestPostUnixTimestamp = 0; /** unix timestamp of newest comment from previous scheduled run */ private long newestPostFromPrevTimer; private Set<OnCommentLoadedListener> onCommentLoadedListeners = new HashSet<>(); public CommentsLoaderService(GenericBot genericBot) { super(genericBot, CommentsContainer.class); newestPostUnixTimestamp = (System.currentTimeMillis() - getTimeInterval()) / 1000; } public void addOnCommentLoadedListener(OnCommentLoadedListener onAnswerLoadedListener) { onCommentLoadedListeners.add(onAnswerLoadedListener); } @Override protected long getTimeInterval() { return TIME_4_MINUTES; } @Override protected void timerFired() { newestPostFromPrevTimer = newestPostUnixTimestamp; } @Override protected boolean onResult(CommentsContainer result) { for (Comment comment : result.getItems()) { newestPostUnixTimestamp = Math.max(comment.getCreationDate(), newestPostUnixTimestamp); if (newestPostFromPrevTimer >= comment.getCreationDate()) { // we got all new/updated posts return false; } // invoke listeners for (OnCommentLoadedListener listener : onCommentLoadedListeners) { listener.onCommentLoaded(comment); } } return true; } @Override protected String getRequestUrl(int page) { return Requests.comments(page); } public interface OnCommentLoadedListener { void onCommentLoaded(Comment comment); } }
Floern/generic-bot-frame
src/main/java/com/floern/genericbot/frame/stackexchange/api/CommentsLoaderService.java
Java
mit
1,916
/* * GF-Complete: A Comprehensive Open Source Library for Galois Field Arithmetic * James S. Plank, Ethan L. Miller, Kevin M. Greenan, * Benjamin A. Arnold, John A. Burnum, Adam W. Disney, Allen C. McBride. * * gf_w32.c * * Routines for 32-bit Galois fields */ #include "gf_int.h" #include <stdio.h> #include <stdlib.h> #include "gf_w32.h" #define MM_PRINT32(s, r) { uint8_t blah[16], ii; printf("%-12s", s); _mm_storeu_si128((__m128i *)blah, r); for (ii = 0; ii < 16; ii += 4) printf(" %02x%02x%02x%02x", blah[15-ii], blah[14-ii], blah[13-ii], blah[12-ii]); printf("\n"); } #define MM_PRINT8(s, r) { uint8_t blah[16], ii; printf("%-12s", s); _mm_storeu_si128((__m128i *)blah, r); for (ii = 0; ii < 16; ii += 1) printf("%s%02x", (ii%4==0) ? " " : " ", blah[15-ii]); printf("\n"); } #define AB2(ip, am1 ,am2, b, t1, t2) {\ t1 = (b << 1) & am1;\ t2 = b & am2; \ t2 = ((t2 << 1) - (t2 >> (GF_FIELD_WIDTH-1))); \ b = (t1 ^ (t2 & ip));} #define SSE_AB2(pp, m1 ,m2, va, t1, t2) {\ t1 = _mm_and_si128(_mm_slli_epi64(va, 1), m1); \ t2 = _mm_and_si128(va, m2); \ t2 = _mm_sub_epi64 (_mm_slli_epi64(t2, 1), _mm_srli_epi64(t2, (GF_FIELD_WIDTH-1))); \ va = _mm_xor_si128(t1, _mm_and_si128(t2, pp)); } static inline uint32_t gf_w32_inverse_from_divide (gf_t *gf, uint32_t a) { return gf->divide.w32(gf, 1, a); } static inline uint32_t gf_w32_divide_from_inverse (gf_t *gf, uint32_t a, uint32_t b) { b = gf->inverse.w32(gf, b); return gf->multiply.w32(gf, a, b); } static void gf_w32_multiply_region_from_single(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { int i; uint32_t *s32; uint32_t *d32; s32 = (uint32_t *) src; d32 = (uint32_t *) dest; if (xor) { for (i = 0; i < bytes/sizeof(uint32_t); i++) { d32[i] ^= gf->multiply.w32(gf, val, s32[i]); } } else { for (i = 0; i < bytes/sizeof(uint32_t); i++) { d32[i] = gf->multiply.w32(gf, val, s32[i]); } } } #if defined(INTEL_SSE4_PCLMUL) static void gf_w32_clm_multiply_region_from_single_2(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { int i; uint32_t *s32; uint32_t *d32; __m128i a, b; __m128i result; __m128i prim_poly; __m128i w; gf_internal_t * h = gf->scratch; prim_poly = _mm_set_epi32(0, 0, 1, (uint32_t)(h->prim_poly & 0xffffffffULL)); if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } a = _mm_insert_epi32 (_mm_setzero_si128(), val, 0); s32 = (uint32_t *) src; d32 = (uint32_t *) dest; if (xor) { for (i = 0; i < bytes/sizeof(uint32_t); i++) { b = _mm_insert_epi32 (a, s32[i], 0); result = _mm_clmulepi64_si128 (a, b, 0); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); d32[i] ^= ((gf_val_32_t)_mm_extract_epi32(result, 0)); } } else { for (i = 0; i < bytes/sizeof(uint32_t); i++) { b = _mm_insert_epi32 (a, s32[i], 0); result = _mm_clmulepi64_si128 (a, b, 0); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); d32[i] = ((gf_val_32_t)_mm_extract_epi32(result, 0)); } } } #endif #if defined(INTEL_SSE4_PCLMUL) static void gf_w32_clm_multiply_region_from_single_3(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { int i; uint32_t *s32; uint32_t *d32; __m128i a, b; __m128i result; __m128i prim_poly; __m128i w; gf_internal_t * h = gf->scratch; prim_poly = _mm_set_epi32(0, 0, 1, (uint32_t)(h->prim_poly & 0xffffffffULL)); if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } a = _mm_insert_epi32 (_mm_setzero_si128(), val, 0); s32 = (uint32_t *) src; d32 = (uint32_t *) dest; if (xor) { for (i = 0; i < bytes/sizeof(uint32_t); i++) { b = _mm_insert_epi32 (a, s32[i], 0); result = _mm_clmulepi64_si128 (a, b, 0); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); d32[i] ^= ((gf_val_32_t)_mm_extract_epi32(result, 0)); } } else { for (i = 0; i < bytes/sizeof(uint32_t); i++) { b = _mm_insert_epi32 (a, s32[i], 0); result = _mm_clmulepi64_si128 (a, b, 0); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); d32[i] = ((gf_val_32_t)_mm_extract_epi32(result, 0)); } } } #endif #if defined(INTEL_SSE4_PCLMUL) static void gf_w32_clm_multiply_region_from_single_4(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { int i; uint32_t *s32; uint32_t *d32; __m128i a, b; __m128i result; __m128i prim_poly; __m128i w; gf_internal_t * h = gf->scratch; prim_poly = _mm_set_epi32(0, 0, 1, (uint32_t)(h->prim_poly & 0xffffffffULL)); if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } a = _mm_insert_epi32 (_mm_setzero_si128(), val, 0); s32 = (uint32_t *) src; d32 = (uint32_t *) dest; if (xor) { for (i = 0; i < bytes/sizeof(uint32_t); i++) { b = _mm_insert_epi32 (a, s32[i], 0); result = _mm_clmulepi64_si128 (a, b, 0); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); d32[i] ^= ((gf_val_32_t)_mm_extract_epi32(result, 0)); } } else { for (i = 0; i < bytes/sizeof(uint32_t); i++) { b = _mm_insert_epi32 (a, s32[i], 0); result = _mm_clmulepi64_si128 (a, b, 0); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); d32[i] = ((gf_val_32_t)_mm_extract_epi32(result, 0)); } } } #endif static inline uint32_t gf_w32_euclid (gf_t *gf, uint32_t b) { uint32_t e_i, e_im1, e_ip1; uint32_t d_i, d_im1, d_ip1; uint32_t y_i, y_im1, y_ip1; uint32_t c_i; if (b == 0) return -1; e_im1 = ((gf_internal_t *) (gf->scratch))->prim_poly; e_i = b; d_im1 = 32; for (d_i = d_im1-1; ((1 << d_i) & e_i) == 0; d_i--) ; y_i = 1; y_im1 = 0; while (e_i != 1) { e_ip1 = e_im1; d_ip1 = d_im1; c_i = 0; while (d_ip1 >= d_i) { c_i ^= (1 << (d_ip1 - d_i)); e_ip1 ^= (e_i << (d_ip1 - d_i)); d_ip1--; if (e_ip1 == 0) return 0; while ((e_ip1 & (1 << d_ip1)) == 0) d_ip1--; } y_ip1 = y_im1 ^ gf->multiply.w32(gf, c_i, y_i); y_im1 = y_i; y_i = y_ip1; e_im1 = e_i; d_im1 = d_i; e_i = e_ip1; d_i = d_ip1; } return y_i; } static gf_val_32_t gf_w32_extract_word(gf_t *gf, void *start, int bytes, int index) { uint32_t *r32, rv; r32 = (uint32_t *) start; rv = r32[index]; return rv; } static gf_val_32_t gf_w32_composite_extract_word(gf_t *gf, void *start, int bytes, int index) { int sub_size; gf_internal_t *h; uint8_t *r8, *top; uint32_t a, b, *r32; gf_region_data rd; h = (gf_internal_t *) gf->scratch; gf_set_region_data(&rd, gf, start, start, bytes, 0, 0, 32); r32 = (uint32_t *) start; if (r32 + index < (uint32_t *) rd.d_start) return r32[index]; if (r32 + index >= (uint32_t *) rd.d_top) return r32[index]; index -= (((uint32_t *) rd.d_start) - r32); r8 = (uint8_t *) rd.d_start; top = (uint8_t *) rd.d_top; sub_size = (top-r8)/2; a = h->base_gf->extract_word.w32(h->base_gf, r8, sub_size, index); b = h->base_gf->extract_word.w32(h->base_gf, r8+sub_size, sub_size, index); return (a | (b << 16)); } static gf_val_32_t gf_w32_split_extract_word(gf_t *gf, void *start, int bytes, int index) { int i; uint32_t *r32, rv; uint8_t *r8; gf_region_data rd; gf_set_region_data(&rd, gf, start, start, bytes, 0, 0, 64); r32 = (uint32_t *) start; if (r32 + index < (uint32_t *) rd.d_start) return r32[index]; if (r32 + index >= (uint32_t *) rd.d_top) return r32[index]; index -= (((uint32_t *) rd.d_start) - r32); r8 = (uint8_t *) rd.d_start; r8 += ((index & 0xfffffff0)*4); r8 += (index & 0xf); r8 += 48; rv =0; for (i = 0; i < 4; i++) { rv <<= 8; rv |= *r8; r8 -= 16; } return rv; } static inline uint32_t gf_w32_matrix (gf_t *gf, uint32_t b) { return gf_bitmatrix_inverse(b, 32, ((gf_internal_t *) (gf->scratch))->prim_poly); } /* JSP: GF_MULT_SHIFT: The world's dumbest multiplication algorithm. I only include it for completeness. It does have the feature that it requires no extra memory. */ #if defined(INTEL_SSE4_PCLMUL) static inline gf_val_32_t gf_w32_cfmgk_multiply (gf_t *gf, gf_val_32_t a32, gf_val_32_t b32) { gf_val_32_t rv = 0; __m128i a, b; __m128i result; __m128i w; __m128i g, q; gf_internal_t * h = gf->scratch; uint64_t g_star, q_plus; q_plus = *(uint64_t *) h->private; g_star = *((uint64_t *) h->private + 1); a = _mm_insert_epi32 (_mm_setzero_si128(), a32, 0); b = _mm_insert_epi32 (a, b32, 0); g = _mm_insert_epi64 (a, g_star, 0); q = _mm_insert_epi64 (a, q_plus, 0); result = _mm_clmulepi64_si128 (a, b, 0); w = _mm_clmulepi64_si128 (q, _mm_srli_si128 (result, 4), 0); w = _mm_clmulepi64_si128 (g, _mm_srli_si128 (w, 4), 0); result = _mm_xor_si128 (result, w); /* Extracts 32 bit value from result. */ rv = ((gf_val_32_t)_mm_extract_epi32(result, 0)); return rv; } #endif #if defined(INTEL_SSE4_PCLMUL) static void gf_w32_cfmgk_multiply_region_from_single(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { int i; uint32_t *s32; uint32_t *d32; __m128i a, b; __m128i result; __m128i w; __m128i g, q; gf_internal_t * h = gf->scratch; uint64_t g_star, q_plus; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } q_plus = *(uint64_t *) h->private; g_star = *((uint64_t *) h->private + 1); g = _mm_insert_epi64 (a, g_star, 0); q = _mm_insert_epi64 (a, q_plus, 0); a = _mm_insert_epi32 (_mm_setzero_si128(), val, 0); s32 = (uint32_t *) src; d32 = (uint32_t *) dest; if (xor) { for (i = 0; i < bytes/sizeof(uint32_t); i++) { b = _mm_insert_epi32 (a, s32[i], 0); result = _mm_clmulepi64_si128 (a, b, 0); w = _mm_clmulepi64_si128 (q, _mm_srli_si128 (result, 4), 0); w = _mm_clmulepi64_si128 (g, _mm_srli_si128 (w, 4), 0); result = _mm_xor_si128 (result, w); d32[i] ^= ((gf_val_32_t)_mm_extract_epi32(result, 0)); } } else { for (i = 0; i < bytes/sizeof(uint32_t); i++) { b = _mm_insert_epi32 (a, s32[i], 0); result = _mm_clmulepi64_si128 (a, b, 0); w = _mm_clmulepi64_si128 (q, _mm_srli_si128 (result, 4), 0); w = _mm_clmulepi64_si128 (g, _mm_srli_si128 (w, 4), 0); result = _mm_xor_si128 (result, w); d32[i] = ((gf_val_32_t)_mm_extract_epi32(result, 0)); } } } #endif static inline gf_val_32_t gf_w32_clm_multiply_2 (gf_t *gf, gf_val_32_t a32, gf_val_32_t b32) { gf_val_32_t rv = 0; #if defined(INTEL_SSE4_PCLMUL) __m128i a, b; __m128i result; __m128i prim_poly; __m128i w; gf_internal_t * h = gf->scratch; a = _mm_insert_epi32 (_mm_setzero_si128(), a32, 0); b = _mm_insert_epi32 (a, b32, 0); prim_poly = _mm_set_epi32(0, 0, 1, (uint32_t)(h->prim_poly & 0xffffffffULL)); /* Do the initial multiply */ result = _mm_clmulepi64_si128 (a, b, 0); /* Ben: Do prim_poly reduction twice. We are guaranteed that we will only have to do the reduction at most twice, because (w-2)/z == 2. Where z is equal to the number of zeros after the leading 1 _mm_clmulepi64_si128 is the carryless multiply operation. Here _mm_srli_si128 shifts the result to the right by 4 bytes. This allows us to multiply the prim_poly by the leading bits of the result. We then xor the result of that operation back with the result.*/ w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); /* Extracts 32 bit value from result. */ rv = ((gf_val_32_t)_mm_extract_epi32(result, 0)); #endif return rv; } static inline gf_val_32_t gf_w32_clm_multiply_3 (gf_t *gf, gf_val_32_t a32, gf_val_32_t b32) { gf_val_32_t rv = 0; #if defined(INTEL_SSE4_PCLMUL) __m128i a, b; __m128i result; __m128i prim_poly; __m128i w; gf_internal_t * h = gf->scratch; a = _mm_insert_epi32 (_mm_setzero_si128(), a32, 0); b = _mm_insert_epi32 (a, b32, 0); prim_poly = _mm_set_epi32(0, 0, 1, (uint32_t)(h->prim_poly & 0xffffffffULL)); /* Do the initial multiply */ result = _mm_clmulepi64_si128 (a, b, 0); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); /* Extracts 32 bit value from result. */ rv = ((gf_val_32_t)_mm_extract_epi32(result, 0)); #endif return rv; } static inline gf_val_32_t gf_w32_clm_multiply_4 (gf_t *gf, gf_val_32_t a32, gf_val_32_t b32) { gf_val_32_t rv = 0; #if defined(INTEL_SSE4_PCLMUL) __m128i a, b; __m128i result; __m128i prim_poly; __m128i w; gf_internal_t * h = gf->scratch; a = _mm_insert_epi32 (_mm_setzero_si128(), a32, 0); b = _mm_insert_epi32 (a, b32, 0); prim_poly = _mm_set_epi32(0, 0, 1, (uint32_t)(h->prim_poly & 0xffffffffULL)); /* Do the initial multiply */ result = _mm_clmulepi64_si128 (a, b, 0); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); w = _mm_clmulepi64_si128 (prim_poly, _mm_srli_si128 (result, 4), 0); result = _mm_xor_si128 (result, w); /* Extracts 32 bit value from result. */ rv = ((gf_val_32_t)_mm_extract_epi32(result, 0)); #endif return rv; } static inline uint32_t gf_w32_shift_multiply (gf_t *gf, uint32_t a32, uint32_t b32) { uint64_t product, i, pp, a, b, one; gf_internal_t *h; a = a32; b = b32; h = (gf_internal_t *) gf->scratch; one = 1; pp = h->prim_poly | (one << 32); product = 0; for (i = 0; i < GF_FIELD_WIDTH; i++) { if (a & (one << i)) product ^= (b << i); } for (i = (GF_FIELD_WIDTH*2-2); i >= GF_FIELD_WIDTH; i--) { if (product & (one << i)) product ^= (pp << (i-GF_FIELD_WIDTH)); } return product; } static int gf_w32_cfmgk_init(gf_t *gf) { gf->inverse.w32 = gf_w32_euclid; gf->multiply_region.w32 = gf_w32_multiply_region_from_single; #if defined(INTEL_SSE4_PCLMUL) gf_internal_t *h; h = (gf_internal_t *) gf->scratch; gf->multiply.w32 = gf_w32_cfmgk_multiply; gf->multiply_region.w32 = gf_w32_cfmgk_multiply_region_from_single; uint64_t *q_plus = (uint64_t *) h->private; uint64_t *g_star = (uint64_t *) h->private + 1; uint64_t tmp = h->prim_poly << 32; *q_plus = 1ULL << 32; int i; for(i = 63; i >= 32; i--) if((1ULL << i) & tmp) { *q_plus |= 1ULL << (i-32); tmp ^= h->prim_poly << (i-32); } *g_star = h->prim_poly & ((1ULL << 32) - 1); return 1; #endif return 0; } static int gf_w32_cfm_init(gf_t *gf) { gf->inverse.w32 = gf_w32_euclid; gf->multiply_region.w32 = gf_w32_multiply_region_from_single; /*Ben: We also check to see if the prim poly will work for pclmul */ /*Ben: Check to see how many reduction steps it will take*/ #if defined(INTEL_SSE4_PCLMUL) gf_internal_t *h; h = (gf_internal_t *) gf->scratch; if ((0xfffe0000 & h->prim_poly) == 0){ gf->multiply.w32 = gf_w32_clm_multiply_2; gf->multiply_region.w32 = gf_w32_clm_multiply_region_from_single_2; }else if ((0xffc00000 & h->prim_poly) == 0){ gf->multiply.w32 = gf_w32_clm_multiply_3; gf->multiply_region.w32 = gf_w32_clm_multiply_region_from_single_3; }else if ((0xfe000000 & h->prim_poly) == 0){ gf->multiply.w32 = gf_w32_clm_multiply_4; gf->multiply_region.w32 = gf_w32_clm_multiply_region_from_single_4; } else { return 0; } return 1; #endif return 0; } static int gf_w32_shift_init(gf_t *gf) { gf->inverse.w32 = gf_w32_euclid; gf->multiply_region.w32 = gf_w32_multiply_region_from_single; gf->multiply.w32 = gf_w32_shift_multiply; return 1; } static void gf_w32_group_set_shift_tables(uint32_t *shift, uint32_t val, gf_internal_t *h) { int i; uint32_t j; shift[0] = 0; for (i = 1; i < (1 << h->arg1); i <<= 1) { for (j = 0; j < i; j++) shift[i|j] = shift[j]^val; if (val & GF_FIRST_BIT) { val <<= 1; val ^= h->prim_poly; } else { val <<= 1; } } } static void gf_w32_group_s_equals_r_multiply_region(gf_t *gf, void *src, void *dest, gf_val_32_t val, int bytes, int xor) { int leftover, rs; uint32_t p, l, ind, a32; int bits_left; int g_s; gf_region_data rd; uint32_t *s32, *d32, *top; struct gf_w32_group_data *gd; gf_internal_t *h = (gf_internal_t *) gf->scratch; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } gd = (struct gf_w32_group_data *) h->private; g_s = h->arg1; gf_w32_group_set_shift_tables(gd->shift, val, h); gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 4); gf_do_initial_region_alignment(&rd); s32 = (uint32_t *) rd.s_start; d32 = (uint32_t *) rd.d_start; top = (uint32_t *) rd.d_top; leftover = 32 % g_s; if (leftover == 0) leftover = g_s; while (d32 < top) { rs = 32 - leftover; a32 = *s32; ind = a32 >> rs; a32 <<= leftover; p = gd->shift[ind]; bits_left = rs; rs = 32 - g_s; while (bits_left > 0) { bits_left -= g_s; ind = a32 >> rs; a32 <<= g_s; l = p >> rs; p = (gd->shift[ind] ^ gd->reduce[l] ^ (p << g_s)); } if (xor) p ^= *d32; *d32 = p; d32++; s32++; } gf_do_final_region_alignment(&rd); } static void gf_w32_group_multiply_region(gf_t *gf, void *src, void *dest, gf_val_32_t val, int bytes, int xor) { uint32_t *s32, *d32, *top; int i; int leftover; uint64_t p, l, r; uint32_t a32, ind; int g_s, g_r; struct gf_w32_group_data *gd; gf_region_data rd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } gf_internal_t *h = (gf_internal_t *) gf->scratch; g_s = h->arg1; g_r = h->arg2; gd = (struct gf_w32_group_data *) h->private; gf_w32_group_set_shift_tables(gd->shift, val, h); leftover = GF_FIELD_WIDTH % g_s; if (leftover == 0) leftover = g_s; gd = (struct gf_w32_group_data *) h->private; gf_w32_group_set_shift_tables(gd->shift, val, h); gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 4); gf_do_initial_region_alignment(&rd); s32 = (uint32_t *) rd.s_start; d32 = (uint32_t *) rd.d_start; top = (uint32_t *) rd.d_top; while (d32 < top) { a32 = *s32; ind = a32 >> (GF_FIELD_WIDTH - leftover); p = gd->shift[ind]; p <<= g_s; a32 <<= leftover; i = (GF_FIELD_WIDTH - leftover); while (i > g_s) { ind = a32 >> (GF_FIELD_WIDTH-g_s); p ^= gd->shift[ind]; a32 <<= g_s; p <<= g_s; i -= g_s; } ind = a32 >> (GF_FIELD_WIDTH-g_s); p ^= gd->shift[ind]; for (i = gd->tshift ; i >= 0; i -= g_r) { l = p & (gd->rmask << i); r = gd->reduce[l >> (i+32)]; r <<= (i); p ^= r; } if (xor) p ^= *d32; *d32 = p; d32++; s32++; } gf_do_final_region_alignment(&rd); } static inline gf_val_32_t gf_w32_group_s_equals_r_multiply(gf_t *gf, gf_val_32_t a, gf_val_32_t b) { int leftover, rs; uint32_t p, l, ind, a32; int bits_left; int g_s; struct gf_w32_group_data *gd; gf_internal_t *h = (gf_internal_t *) gf->scratch; g_s = h->arg1; gd = (struct gf_w32_group_data *) h->private; gf_w32_group_set_shift_tables(gd->shift, b, h); leftover = 32 % g_s; if (leftover == 0) leftover = g_s; rs = 32 - leftover; a32 = a; ind = a32 >> rs; a32 <<= leftover; p = gd->shift[ind]; bits_left = rs; rs = 32 - g_s; while (bits_left > 0) { bits_left -= g_s; ind = a32 >> rs; a32 <<= g_s; l = p >> rs; p = (gd->shift[ind] ^ gd->reduce[l] ^ (p << g_s)); } return p; } static inline gf_val_32_t gf_w32_group_multiply(gf_t *gf, gf_val_32_t a, gf_val_32_t b) { int i; int leftover; uint64_t p, l, r; uint32_t a32, ind; int g_s, g_r; struct gf_w32_group_data *gd; gf_internal_t *h = (gf_internal_t *) gf->scratch; g_s = h->arg1; g_r = h->arg2; gd = (struct gf_w32_group_data *) h->private; gf_w32_group_set_shift_tables(gd->shift, b, h); leftover = GF_FIELD_WIDTH % g_s; if (leftover == 0) leftover = g_s; a32 = a; ind = a32 >> (GF_FIELD_WIDTH - leftover); p = gd->shift[ind]; p <<= g_s; a32 <<= leftover; i = (GF_FIELD_WIDTH - leftover); while (i > g_s) { ind = a32 >> (GF_FIELD_WIDTH-g_s); p ^= gd->shift[ind]; a32 <<= g_s; p <<= g_s; i -= g_s; } ind = a32 >> (GF_FIELD_WIDTH-g_s); p ^= gd->shift[ind]; for (i = gd->tshift ; i >= 0; i -= g_r) { l = p & (gd->rmask << i); r = gd->reduce[l >> (i+32)]; r <<= (i); p ^= r; } return p; } static inline gf_val_32_t gf_w32_bytwo_b_multiply (gf_t *gf, gf_val_32_t a, gf_val_32_t b) { uint32_t prod, pp, bmask; gf_internal_t *h; h = (gf_internal_t *) gf->scratch; pp = h->prim_poly; prod = 0; bmask = 0x80000000; while (1) { if (a & 1) prod ^= b; a >>= 1; if (a == 0) return prod; if (b & bmask) { b = ((b << 1) ^ pp); } else { b <<= 1; } } } static inline gf_val_32_t gf_w32_bytwo_p_multiply (gf_t *gf, gf_val_32_t a, gf_val_32_t b) { uint32_t prod, pp, pmask, amask; gf_internal_t *h; h = (gf_internal_t *) gf->scratch; pp = h->prim_poly; prod = 0; pmask = 0x80000000; amask = 0x80000000; while (amask != 0) { if (prod & pmask) { prod = ((prod << 1) ^ pp); } else { prod <<= 1; } if (a & amask) prod ^= b; amask >>= 1; } return prod; } static void gf_w32_bytwo_p_nosse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_32_t val, int bytes, int xor) { uint64_t *s64, *d64, t1, t2, ta, prod, amask; gf_region_data rd; struct gf_w32_bytwo_data *btd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } btd = (struct gf_w32_bytwo_data *) ((gf_internal_t *) (gf->scratch))->private; gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 8); gf_do_initial_region_alignment(&rd); s64 = (uint64_t *) rd.s_start; d64 = (uint64_t *) rd.d_start; if (xor) { while (s64 < (uint64_t *) rd.s_top) { prod = 0; amask = 0x80000000; ta = *s64; while (amask != 0) { AB2(btd->prim_poly, btd->mask1, btd->mask2, prod, t1, t2); if (val & amask) prod ^= ta; amask >>= 1; } *d64 ^= prod; d64++; s64++; } } else { while (s64 < (uint64_t *) rd.s_top) { prod = 0; amask = 0x80000000; ta = *s64; while (amask != 0) { AB2(btd->prim_poly, btd->mask1, btd->mask2, prod, t1, t2); if (val & amask) prod ^= ta; amask >>= 1; } *d64 = prod; d64++; s64++; } } gf_do_final_region_alignment(&rd); } #define BYTWO_P_ONESTEP {\ SSE_AB2(pp, m1 ,m2, prod, t1, t2); \ t1 = _mm_and_si128(v, one); \ t1 = _mm_sub_epi32(t1, one); \ t1 = _mm_and_si128(t1, ta); \ prod = _mm_xor_si128(prod, t1); \ v = _mm_srli_epi64(v, 1); } #ifdef INTEL_SSE2 static void gf_w32_bytwo_p_sse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_32_t val, int bytes, int xor) { int i; uint8_t *s8, *d8; uint32_t vrev; __m128i pp, m1, m2, ta, prod, t1, t2, tp, one, v; struct gf_w32_bytwo_data *btd; gf_region_data rd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } btd = (struct gf_w32_bytwo_data *) ((gf_internal_t *) (gf->scratch))->private; gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 16); gf_do_initial_region_alignment(&rd); vrev = 0; for (i = 0; i < 32; i++) { vrev <<= 1; if (!(val & (1 << i))) vrev |= 1; } s8 = (uint8_t *) rd.s_start; d8 = (uint8_t *) rd.d_start; pp = _mm_set1_epi32(btd->prim_poly&0xffffffff); m1 = _mm_set1_epi32((btd->mask1)&0xffffffff); m2 = _mm_set1_epi32((btd->mask2)&0xffffffff); one = _mm_set1_epi32(1); while (d8 < (uint8_t *) rd.d_top) { prod = _mm_setzero_si128(); v = _mm_set1_epi32(vrev); ta = _mm_load_si128((__m128i *) s8); tp = (!xor) ? _mm_setzero_si128() : _mm_load_si128((__m128i *) d8); BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; BYTWO_P_ONESTEP; _mm_store_si128((__m128i *) d8, _mm_xor_si128(prod, tp)); d8 += 16; s8 += 16; } gf_do_final_region_alignment(&rd); } #endif static void gf_w32_bytwo_b_nosse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_32_t val, int bytes, int xor) { uint64_t *s64, *d64, t1, t2, ta, tb, prod; struct gf_w32_bytwo_data *btd; gf_region_data rd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 32); gf_do_initial_region_alignment(&rd); btd = (struct gf_w32_bytwo_data *) ((gf_internal_t *) (gf->scratch))->private; s64 = (uint64_t *) rd.s_start; d64 = (uint64_t *) rd.d_start; switch (val) { case 2: if (xor) { while (d64 < (uint64_t *) rd.d_top) { ta = *s64; AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); *d64 ^= ta; d64++; s64++; } } else { while (d64 < (uint64_t *) rd.d_top) { ta = *s64; AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); *d64 = ta; d64++; s64++; } } break; case 3: if (xor) { while (d64 < (uint64_t *) rd.d_top) { ta = *s64; prod = ta; AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); *d64 ^= (ta ^ prod); d64++; s64++; } } else { while (d64 < (uint64_t *) rd.d_top) { ta = *s64; prod = ta; AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); *d64 = (ta ^ prod); d64++; s64++; } } break; case 4: if (xor) { while (d64 < (uint64_t *) rd.d_top) { ta = *s64; AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); *d64 ^= ta; d64++; s64++; } } else { while (d64 < (uint64_t *) rd.d_top) { ta = *s64; AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); *d64 = ta; d64++; s64++; } } break; case 5: if (xor) { while (d64 < (uint64_t *) rd.d_top) { ta = *s64; prod = ta; AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); *d64 ^= (ta ^ prod); d64++; s64++; } } else { while (d64 < (uint64_t *) rd.d_top) { ta = *s64; prod = ta; AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); *d64 = ta ^ prod; d64++; s64++; } } break; default: if (xor) { while (d64 < (uint64_t *) rd.d_top) { prod = *d64 ; ta = *s64; tb = val; while (1) { if (tb & 1) prod ^= ta; tb >>= 1; if (tb == 0) break; AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); } *d64 = prod; d64++; s64++; } } else { while (d64 < (uint64_t *) rd.d_top) { prod = 0 ; ta = *s64; tb = val; while (1) { if (tb & 1) prod ^= ta; tb >>= 1; if (tb == 0) break; AB2(btd->prim_poly, btd->mask1, btd->mask2, ta, t1, t2); } *d64 = prod; d64++; s64++; } } break; } gf_do_final_region_alignment(&rd); } #ifdef INTEL_SSE2 static void gf_w32_bytwo_b_sse_region_2_noxor(gf_region_data *rd, struct gf_w32_bytwo_data *btd) { uint8_t *d8, *s8; __m128i pp, m1, m2, t1, t2, va; s8 = (uint8_t *) rd->s_start; d8 = (uint8_t *) rd->d_start; pp = _mm_set1_epi32(btd->prim_poly&0xffffffff); m1 = _mm_set1_epi32((btd->mask1)&0xffffffff); m2 = _mm_set1_epi32((btd->mask2)&0xffffffff); while (d8 < (uint8_t *) rd->d_top) { va = _mm_load_si128 ((__m128i *)(s8)); SSE_AB2(pp, m1, m2, va, t1, t2); _mm_store_si128((__m128i *)d8, va); d8 += 16; s8 += 16; } } #endif #ifdef INTEL_SSE2 static void gf_w32_bytwo_b_sse_region_2_xor(gf_region_data *rd, struct gf_w32_bytwo_data *btd) { uint8_t *d8, *s8; __m128i pp, m1, m2, t1, t2, va, vb; s8 = (uint8_t *) rd->s_start; d8 = (uint8_t *) rd->d_start; pp = _mm_set1_epi32(btd->prim_poly&0xffffffff); m1 = _mm_set1_epi32((btd->mask1)&0xffffffff); m2 = _mm_set1_epi32((btd->mask2)&0xffffffff); while (d8 < (uint8_t *) rd->d_top) { va = _mm_load_si128 ((__m128i *)(s8)); SSE_AB2(pp, m1, m2, va, t1, t2); vb = _mm_load_si128 ((__m128i *)(d8)); vb = _mm_xor_si128(vb, va); _mm_store_si128((__m128i *)d8, vb); d8 += 16; s8 += 16; } } #endif #ifdef INTEL_SSE2 static void gf_w32_bytwo_b_sse_multiply_region(gf_t *gf, void *src, void *dest, gf_val_32_t val, int bytes, int xor) { uint32_t itb; uint8_t *d8, *s8; __m128i pp, m1, m2, t1, t2, va, vb; struct gf_w32_bytwo_data *btd; gf_region_data rd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 16); gf_do_initial_region_alignment(&rd); btd = (struct gf_w32_bytwo_data *) ((gf_internal_t *) (gf->scratch))->private; if (val == 2) { if (xor) { gf_w32_bytwo_b_sse_region_2_xor(&rd, btd); } else { gf_w32_bytwo_b_sse_region_2_noxor(&rd, btd); } gf_do_final_region_alignment(&rd); return; } s8 = (uint8_t *) rd.s_start; d8 = (uint8_t *) rd.d_start; pp = _mm_set1_epi32(btd->prim_poly&0xffffffff); m1 = _mm_set1_epi32((btd->mask1)&0xffffffff); m2 = _mm_set1_epi32((btd->mask2)&0xffffffff); while (d8 < (uint8_t *) rd.d_top) { va = _mm_load_si128 ((__m128i *)(s8)); vb = (!xor) ? _mm_setzero_si128() : _mm_load_si128 ((__m128i *)(d8)); itb = val; while (1) { if (itb & 1) vb = _mm_xor_si128(vb, va); itb >>= 1; if (itb == 0) break; SSE_AB2(pp, m1, m2, va, t1, t2); } _mm_store_si128((__m128i *)d8, vb); d8 += 16; s8 += 16; } gf_do_final_region_alignment(&rd); } #endif static int gf_w32_bytwo_init(gf_t *gf) { gf_internal_t *h; uint64_t ip, m1, m2; struct gf_w32_bytwo_data *btd; h = (gf_internal_t *) gf->scratch; btd = (struct gf_w32_bytwo_data *) (h->private); ip = h->prim_poly & 0xffffffff; m1 = 0xfffffffe; m2 = 0x80000000; btd->prim_poly = 0; btd->mask1 = 0; btd->mask2 = 0; while (ip != 0) { btd->prim_poly |= ip; btd->mask1 |= m1; btd->mask2 |= m2; ip <<= GF_FIELD_WIDTH; m1 <<= GF_FIELD_WIDTH; m2 <<= GF_FIELD_WIDTH; } if (h->mult_type == GF_MULT_BYTWO_p) { gf->multiply.w32 = gf_w32_bytwo_p_multiply; #ifdef INTEL_SSE2 if (h->region_type & GF_REGION_NOSIMD) gf->multiply_region.w32 = gf_w32_bytwo_p_nosse_multiply_region; else gf->multiply_region.w32 = gf_w32_bytwo_p_sse_multiply_region; #else gf->multiply_region.w32 = gf_w32_bytwo_p_nosse_multiply_region; if(h->region_type & GF_REGION_SIMD) return 0; #endif } else { gf->multiply.w32 = gf_w32_bytwo_b_multiply; #ifdef INTEL_SSE2 if (h->region_type & GF_REGION_NOSIMD) gf->multiply_region.w32 = gf_w32_bytwo_b_nosse_multiply_region; else gf->multiply_region.w32 = gf_w32_bytwo_b_sse_multiply_region; #else gf->multiply_region.w32 = gf_w32_bytwo_b_nosse_multiply_region; if(h->region_type & GF_REGION_SIMD) return 0; #endif } gf->inverse.w32 = gf_w32_euclid; return 1; } static inline uint32_t gf_w32_split_8_8_multiply (gf_t *gf, uint32_t a32, uint32_t b32) { uint32_t product, i, j, mask, tb; gf_internal_t *h; struct gf_w32_split_8_8_data *d8; h = (gf_internal_t *) gf->scratch; d8 = (struct gf_w32_split_8_8_data *) h->private; product = 0; mask = 0xff; for (i = 0; i < 4; i++) { tb = b32; for (j = 0; j < 4; j++) { product ^= d8->tables[i+j][a32&mask][tb&mask]; tb >>= 8; } a32 >>= 8; } return product; } static inline void gf_w32_split_8_32_lazy_multiply_region(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { gf_internal_t *h; uint32_t *s32, *d32, *top, p, a, v; struct gf_split_8_32_lazy_data *d8; struct gf_w32_split_8_8_data *d88; uint32_t *t[4]; int i, j, k, change; uint32_t pp; gf_region_data rd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } h = (gf_internal_t *) gf->scratch; if (h->arg1 == 32 || h->arg2 == 32 || h->mult_type == GF_MULT_DEFAULT) { d8 = (struct gf_split_8_32_lazy_data *) h->private; for (i = 0; i < 4; i++) t[i] = d8->tables[i]; change = (val != d8->last_value); if (change) d8->last_value = val; } else { d88 = (struct gf_w32_split_8_8_data *) h->private; for (i = 0; i < 4; i++) t[i] = d88->region_tables[i]; change = (val != d88->last_value); if (change) d88->last_value = val; } pp = h->prim_poly; gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 4); gf_do_initial_region_alignment(&rd); s32 = (uint32_t *) rd.s_start; d32 = (uint32_t *) rd.d_start; top = (uint32_t *) rd.d_top; if (change) { v = val; for (i = 0; i < 4; i++) { t[i][0] = 0; for (j = 1; j < 256; j <<= 1) { for (k = 0; k < j; k++) { t[i][k^j] = (v ^ t[i][k]); } v = (v & GF_FIRST_BIT) ? ((v << 1) ^ pp) : (v << 1); } } } while (d32 < top) { p = (xor) ? *d32 : 0; a = *s32; i = 0; while (a != 0) { v = (a & 0xff); p ^= t[i][v]; a >>= 8; i++; } *d32 = p; d32++; s32++; } gf_do_final_region_alignment(&rd); } static inline void gf_w32_split_16_32_lazy_multiply_region(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { gf_internal_t *h; uint32_t *s32, *d32, *top, p, a, v; struct gf_split_16_32_lazy_data *d16; uint32_t *t[2]; int i, j, k, change; uint32_t pp; gf_region_data rd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } h = (gf_internal_t *) gf->scratch; d16 = (struct gf_split_16_32_lazy_data *) h->private; for (i = 0; i < 2; i++) t[i] = d16->tables[i]; change = (val != d16->last_value); if (change) d16->last_value = val; pp = h->prim_poly; gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 4); gf_do_initial_region_alignment(&rd); s32 = (uint32_t *) rd.s_start; d32 = (uint32_t *) rd.d_start; top = (uint32_t *) rd.d_top; if (change) { v = val; for (i = 0; i < 2; i++) { t[i][0] = 0; for (j = 1; j < (1 << 16); j <<= 1) { for (k = 0; k < j; k++) { t[i][k^j] = (v ^ t[i][k]); } v = (v & GF_FIRST_BIT) ? ((v << 1) ^ pp) : (v << 1); } } } while (d32 < top) { p = (xor) ? *d32 : 0; a = *s32; i = 0; while (a != 0 && i < 2) { v = (a & 0xffff); p ^= t[i][v]; a >>= 16; i++; } *d32 = p; d32++; s32++; } gf_do_final_region_alignment(&rd); } static void gf_w32_split_2_32_lazy_multiply_region(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { gf_internal_t *h; struct gf_split_2_32_lazy_data *ld; int i; uint32_t pp, v, v2, s, *s32, *d32, *top; gf_region_data rd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 4); gf_do_initial_region_alignment(&rd); h = (gf_internal_t *) gf->scratch; pp = h->prim_poly; ld = (struct gf_split_2_32_lazy_data *) h->private; if (ld->last_value != val) { v = val; for (i = 0; i < 16; i++) { v2 = (v << 1); if (v & GF_FIRST_BIT) v2 ^= pp; ld->tables[i][0] = 0; ld->tables[i][1] = v; ld->tables[i][2] = v2; ld->tables[i][3] = (v2 ^ v); v = (v2 << 1); if (v2 & GF_FIRST_BIT) v ^= pp; } } ld->last_value = val; s32 = (uint32_t *) rd.s_start; d32 = (uint32_t *) rd.d_start; top = (uint32_t *) rd.d_top; while (d32 != top) { v = (xor) ? *d32 : 0; s = *s32; i = 0; while (s != 0) { v ^= ld->tables[i][s&3]; s >>= 2; i++; } *d32 = v; d32++; s32++; } gf_do_final_region_alignment(&rd); } #ifdef INTEL_SSSE3 static void gf_w32_split_2_32_lazy_sse_multiply_region(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { gf_internal_t *h; int i, tindex; uint32_t pp, v, v2, *s32, *d32, *top; __m128i vi, si, pi, shuffler, tables[16], adder, xi, mask1, mask2; gf_region_data rd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 32); gf_do_initial_region_alignment(&rd); h = (gf_internal_t *) gf->scratch; pp = h->prim_poly; s32 = (uint32_t *) rd.s_start; d32 = (uint32_t *) rd.d_start; top = (uint32_t *) rd.d_top; v = val; for (i = 0; i < 16; i++) { v2 = (v << 1); if (v & GF_FIRST_BIT) v2 ^= pp; tables[i] = _mm_set_epi32(v2 ^ v, v2, v, 0); v = (v2 << 1); if (v2 & GF_FIRST_BIT) v ^= pp; } shuffler = _mm_set_epi8(0xc, 0xc, 0xc, 0xc, 8, 8, 8, 8, 4, 4, 4, 4, 0, 0, 0, 0); adder = _mm_set_epi8(3, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 0, 3, 2, 1, 0); mask1 = _mm_set1_epi8(0x3); mask2 = _mm_set1_epi8(0xc); while (d32 != top) { pi = (xor) ? _mm_load_si128 ((__m128i *) d32) : _mm_setzero_si128(); vi = _mm_load_si128((__m128i *) s32); tindex = 0; for (i = 0; i < 4; i++) { si = _mm_shuffle_epi8(vi, shuffler); xi = _mm_and_si128(si, mask1); xi = _mm_slli_epi16(xi, 2); xi = _mm_xor_si128(xi, adder); pi = _mm_xor_si128(pi, _mm_shuffle_epi8(tables[tindex], xi)); tindex++; xi = _mm_and_si128(si, mask2); xi = _mm_xor_si128(xi, adder); pi = _mm_xor_si128(pi, _mm_shuffle_epi8(tables[tindex], xi)); si = _mm_srli_epi16(si, 2); tindex++; xi = _mm_and_si128(si, mask2); xi = _mm_xor_si128(xi, adder); pi = _mm_xor_si128(pi, _mm_shuffle_epi8(tables[tindex], xi)); si = _mm_srli_epi16(si, 2); tindex++; xi = _mm_and_si128(si, mask2); xi = _mm_xor_si128(xi, adder); pi = _mm_xor_si128(pi, _mm_shuffle_epi8(tables[tindex], xi)); tindex++; vi = _mm_srli_epi32(vi, 8); } _mm_store_si128((__m128i *) d32, pi); d32 += 4; s32 += 4; } gf_do_final_region_alignment(&rd); } #endif static void gf_w32_split_4_32_lazy_multiply_region(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { gf_internal_t *h; struct gf_split_4_32_lazy_data *ld; int i, j, k; uint32_t pp, v, s, *s32, *d32, *top; gf_region_data rd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } h = (gf_internal_t *) gf->scratch; pp = h->prim_poly; ld = (struct gf_split_4_32_lazy_data *) h->private; gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 4); gf_do_initial_region_alignment(&rd); if (ld->last_value != val) { v = val; for (i = 0; i < 8; i++) { ld->tables[i][0] = 0; for (j = 1; j < 16; j <<= 1) { for (k = 0; k < j; k++) { ld->tables[i][k^j] = (v ^ ld->tables[i][k]); } v = (v & GF_FIRST_BIT) ? ((v << 1) ^ pp) : (v << 1); } } } ld->last_value = val; s32 = (uint32_t *) rd.s_start; d32 = (uint32_t *) rd.d_start; top = (uint32_t *) rd.d_top; while (d32 != top) { v = (xor) ? *d32 : 0; s = *s32; i = 0; while (s != 0) { v ^= ld->tables[i][s&0xf]; s >>= 4; i++; } *d32 = v; d32++; s32++; } gf_do_final_region_alignment(&rd); } static void gf_w32_split_4_32_lazy_sse_altmap_multiply_region(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { #ifdef INTEL_SSSE3 gf_internal_t *h; int i, j, k; uint32_t pp, v, *s32, *d32, *top; __m128i si, tables[8][4], p0, p1, p2, p3, mask1, v0, v1, v2, v3; struct gf_split_4_32_lazy_data *ld; uint8_t btable[16]; gf_region_data rd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } h = (gf_internal_t *) gf->scratch; pp = h->prim_poly; gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 64); gf_do_initial_region_alignment(&rd); s32 = (uint32_t *) rd.s_start; d32 = (uint32_t *) rd.d_start; top = (uint32_t *) rd.d_top; ld = (struct gf_split_4_32_lazy_data *) h->private; v = val; for (i = 0; i < 8; i++) { ld->tables[i][0] = 0; for (j = 1; j < 16; j <<= 1) { for (k = 0; k < j; k++) { ld->tables[i][k^j] = (v ^ ld->tables[i][k]); } v = (v & GF_FIRST_BIT) ? ((v << 1) ^ pp) : (v << 1); } for (j = 0; j < 4; j++) { for (k = 0; k < 16; k++) { btable[k] = (uint8_t) ld->tables[i][k]; ld->tables[i][k] >>= 8; } tables[i][j] = _mm_loadu_si128((__m128i *) btable); } } mask1 = _mm_set1_epi8(0xf); if (xor) { while (d32 != top) { p0 = _mm_load_si128 ((__m128i *) d32); p1 = _mm_load_si128 ((__m128i *) (d32+4)); p2 = _mm_load_si128 ((__m128i *) (d32+8)); p3 = _mm_load_si128 ((__m128i *) (d32+12)); v0 = _mm_load_si128((__m128i *) s32); s32 += 4; v1 = _mm_load_si128((__m128i *) s32); s32 += 4; v2 = _mm_load_si128((__m128i *) s32); s32 += 4; v3 = _mm_load_si128((__m128i *) s32); s32 += 4; si = _mm_and_si128(v0, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[0][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[0][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[0][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[0][3], si)); v0 = _mm_srli_epi32(v0, 4); si = _mm_and_si128(v0, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[1][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[1][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[1][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[1][3], si)); si = _mm_and_si128(v1, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[2][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[2][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[2][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[2][3], si)); v1 = _mm_srli_epi32(v1, 4); si = _mm_and_si128(v1, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[3][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[3][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[3][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[3][3], si)); si = _mm_and_si128(v2, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[4][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[4][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[4][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[4][3], si)); v2 = _mm_srli_epi32(v2, 4); si = _mm_and_si128(v2, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[5][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[5][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[5][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[5][3], si)); si = _mm_and_si128(v3, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[6][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[6][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[6][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[6][3], si)); v3 = _mm_srli_epi32(v3, 4); si = _mm_and_si128(v3, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[7][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[7][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[7][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[7][3], si)); _mm_store_si128((__m128i *) d32, p0); _mm_store_si128((__m128i *) (d32+4), p1); _mm_store_si128((__m128i *) (d32+8), p2); _mm_store_si128((__m128i *) (d32+12), p3); d32 += 16; } } else { while (d32 != top) { v0 = _mm_load_si128((__m128i *) s32); s32 += 4; v1 = _mm_load_si128((__m128i *) s32); s32 += 4; v2 = _mm_load_si128((__m128i *) s32); s32 += 4; v3 = _mm_load_si128((__m128i *) s32); s32 += 4; si = _mm_and_si128(v0, mask1); p0 = _mm_shuffle_epi8(tables[0][0], si); p1 = _mm_shuffle_epi8(tables[0][1], si); p2 = _mm_shuffle_epi8(tables[0][2], si); p3 = _mm_shuffle_epi8(tables[0][3], si); v0 = _mm_srli_epi32(v0, 4); si = _mm_and_si128(v0, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[1][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[1][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[1][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[1][3], si)); si = _mm_and_si128(v1, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[2][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[2][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[2][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[2][3], si)); v1 = _mm_srli_epi32(v1, 4); si = _mm_and_si128(v1, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[3][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[3][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[3][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[3][3], si)); si = _mm_and_si128(v2, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[4][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[4][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[4][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[4][3], si)); v2 = _mm_srli_epi32(v2, 4); si = _mm_and_si128(v2, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[5][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[5][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[5][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[5][3], si)); si = _mm_and_si128(v3, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[6][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[6][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[6][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[6][3], si)); v3 = _mm_srli_epi32(v3, 4); si = _mm_and_si128(v3, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[7][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[7][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[7][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[7][3], si)); _mm_store_si128((__m128i *) d32, p0); _mm_store_si128((__m128i *) (d32+4), p1); _mm_store_si128((__m128i *) (d32+8), p2); _mm_store_si128((__m128i *) (d32+12), p3); d32 += 16; } } gf_do_final_region_alignment(&rd); #endif } static void gf_w32_split_4_32_lazy_sse_multiply_region(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { #ifdef INTEL_SSSE3 gf_internal_t *h; int i, j, k; uint32_t pp, v, *s32, *d32, *top, tmp_table[16]; __m128i si, tables[8][4], p0, p1, p2, p3, mask1, v0, v1, v2, v3, mask8; __m128i tv1, tv2, tv3, tv0; uint8_t btable[16]; gf_region_data rd; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } if (val == 1) { gf_multby_one(src, dest, bytes, xor); return; } h = (gf_internal_t *) gf->scratch; pp = h->prim_poly; gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 64); gf_do_initial_region_alignment(&rd); s32 = (uint32_t *) rd.s_start; d32 = (uint32_t *) rd.d_start; top = (uint32_t *) rd.d_top; v = val; for (i = 0; i < 8; i++) { tmp_table[0] = 0; for (j = 1; j < 16; j <<= 1) { for (k = 0; k < j; k++) { tmp_table[k^j] = (v ^ tmp_table[k]); } v = (v & GF_FIRST_BIT) ? ((v << 1) ^ pp) : (v << 1); } for (j = 0; j < 4; j++) { for (k = 0; k < 16; k++) { btable[k] = (uint8_t) tmp_table[k]; tmp_table[k] >>= 8; } tables[i][j] = _mm_loadu_si128((__m128i *) btable); } } mask1 = _mm_set1_epi8(0xf); mask8 = _mm_set1_epi16(0xff); if (xor) { while (d32 != top) { v0 = _mm_load_si128((__m128i *) s32); s32 += 4; v1 = _mm_load_si128((__m128i *) s32); s32 += 4; v2 = _mm_load_si128((__m128i *) s32); s32 += 4; v3 = _mm_load_si128((__m128i *) s32); s32 += 4; p0 = _mm_srli_epi16(v0, 8); p1 = _mm_srli_epi16(v1, 8); p2 = _mm_srli_epi16(v2, 8); p3 = _mm_srli_epi16(v3, 8); tv0 = _mm_and_si128(v0, mask8); tv1 = _mm_and_si128(v1, mask8); tv2 = _mm_and_si128(v2, mask8); tv3 = _mm_and_si128(v3, mask8); v0 = _mm_packus_epi16(p1, p0); v1 = _mm_packus_epi16(tv1, tv0); v2 = _mm_packus_epi16(p3, p2); v3 = _mm_packus_epi16(tv3, tv2); p0 = _mm_srli_epi16(v0, 8); p1 = _mm_srli_epi16(v1, 8); p2 = _mm_srli_epi16(v2, 8); p3 = _mm_srli_epi16(v3, 8); tv0 = _mm_and_si128(v0, mask8); tv1 = _mm_and_si128(v1, mask8); tv2 = _mm_and_si128(v2, mask8); tv3 = _mm_and_si128(v3, mask8); v0 = _mm_packus_epi16(p2, p0); v1 = _mm_packus_epi16(p3, p1); v2 = _mm_packus_epi16(tv2, tv0); v3 = _mm_packus_epi16(tv3, tv1); si = _mm_and_si128(v0, mask1); p0 = _mm_shuffle_epi8(tables[6][0], si); p1 = _mm_shuffle_epi8(tables[6][1], si); p2 = _mm_shuffle_epi8(tables[6][2], si); p3 = _mm_shuffle_epi8(tables[6][3], si); v0 = _mm_srli_epi32(v0, 4); si = _mm_and_si128(v0, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[7][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[7][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[7][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[7][3], si)); si = _mm_and_si128(v1, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[4][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[4][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[4][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[4][3], si)); v1 = _mm_srli_epi32(v1, 4); si = _mm_and_si128(v1, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[5][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[5][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[5][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[5][3], si)); si = _mm_and_si128(v2, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[2][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[2][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[2][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[2][3], si)); v2 = _mm_srli_epi32(v2, 4); si = _mm_and_si128(v2, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[3][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[3][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[3][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[3][3], si)); si = _mm_and_si128(v3, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[0][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[0][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[0][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[0][3], si)); v3 = _mm_srli_epi32(v3, 4); si = _mm_and_si128(v3, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[1][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[1][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[1][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[1][3], si)); tv0 = _mm_unpackhi_epi8(p1, p3); tv1 = _mm_unpackhi_epi8(p0, p2); tv2 = _mm_unpacklo_epi8(p1, p3); tv3 = _mm_unpacklo_epi8(p0, p2); p0 = _mm_unpackhi_epi8(tv1, tv0); p1 = _mm_unpacklo_epi8(tv1, tv0); p2 = _mm_unpackhi_epi8(tv3, tv2); p3 = _mm_unpacklo_epi8(tv3, tv2); v0 = _mm_load_si128 ((__m128i *) d32); v1 = _mm_load_si128 ((__m128i *) (d32+4)); v2 = _mm_load_si128 ((__m128i *) (d32+8)); v3 = _mm_load_si128 ((__m128i *) (d32+12)); p0 = _mm_xor_si128(p0, v0); p1 = _mm_xor_si128(p1, v1); p2 = _mm_xor_si128(p2, v2); p3 = _mm_xor_si128(p3, v3); _mm_store_si128((__m128i *) d32, p0); _mm_store_si128((__m128i *) (d32+4), p1); _mm_store_si128((__m128i *) (d32+8), p2); _mm_store_si128((__m128i *) (d32+12), p3); d32 += 16; } } else { while (d32 != top) { v0 = _mm_load_si128((__m128i *) s32); s32 += 4; v1 = _mm_load_si128((__m128i *) s32); s32 += 4; v2 = _mm_load_si128((__m128i *) s32); s32 += 4; v3 = _mm_load_si128((__m128i *) s32); s32 += 4; p0 = _mm_srli_epi16(v0, 8); p1 = _mm_srli_epi16(v1, 8); p2 = _mm_srli_epi16(v2, 8); p3 = _mm_srli_epi16(v3, 8); tv0 = _mm_and_si128(v0, mask8); tv1 = _mm_and_si128(v1, mask8); tv2 = _mm_and_si128(v2, mask8); tv3 = _mm_and_si128(v3, mask8); v0 = _mm_packus_epi16(p1, p0); v1 = _mm_packus_epi16(tv1, tv0); v2 = _mm_packus_epi16(p3, p2); v3 = _mm_packus_epi16(tv3, tv2); p0 = _mm_srli_epi16(v0, 8); p1 = _mm_srli_epi16(v1, 8); p2 = _mm_srli_epi16(v2, 8); p3 = _mm_srli_epi16(v3, 8); tv0 = _mm_and_si128(v0, mask8); tv1 = _mm_and_si128(v1, mask8); tv2 = _mm_and_si128(v2, mask8); tv3 = _mm_and_si128(v3, mask8); v0 = _mm_packus_epi16(p2, p0); v1 = _mm_packus_epi16(p3, p1); v2 = _mm_packus_epi16(tv2, tv0); v3 = _mm_packus_epi16(tv3, tv1); si = _mm_and_si128(v0, mask1); p0 = _mm_shuffle_epi8(tables[6][0], si); p1 = _mm_shuffle_epi8(tables[6][1], si); p2 = _mm_shuffle_epi8(tables[6][2], si); p3 = _mm_shuffle_epi8(tables[6][3], si); v0 = _mm_srli_epi32(v0, 4); si = _mm_and_si128(v0, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[7][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[7][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[7][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[7][3], si)); si = _mm_and_si128(v1, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[4][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[4][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[4][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[4][3], si)); v1 = _mm_srli_epi32(v1, 4); si = _mm_and_si128(v1, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[5][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[5][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[5][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[5][3], si)); si = _mm_and_si128(v2, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[2][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[2][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[2][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[2][3], si)); v2 = _mm_srli_epi32(v2, 4); si = _mm_and_si128(v2, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[3][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[3][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[3][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[3][3], si)); si = _mm_and_si128(v3, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[0][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[0][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[0][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[0][3], si)); v3 = _mm_srli_epi32(v3, 4); si = _mm_and_si128(v3, mask1); p0 = _mm_xor_si128(p0, _mm_shuffle_epi8(tables[1][0], si)); p1 = _mm_xor_si128(p1, _mm_shuffle_epi8(tables[1][1], si)); p2 = _mm_xor_si128(p2, _mm_shuffle_epi8(tables[1][2], si)); p3 = _mm_xor_si128(p3, _mm_shuffle_epi8(tables[1][3], si)); tv0 = _mm_unpackhi_epi8(p1, p3); tv1 = _mm_unpackhi_epi8(p0, p2); tv2 = _mm_unpacklo_epi8(p1, p3); tv3 = _mm_unpacklo_epi8(p0, p2); p0 = _mm_unpackhi_epi8(tv1, tv0); p1 = _mm_unpacklo_epi8(tv1, tv0); p2 = _mm_unpackhi_epi8(tv3, tv2); p3 = _mm_unpacklo_epi8(tv3, tv2); _mm_store_si128((__m128i *) d32, p0); _mm_store_si128((__m128i *) (d32+4), p1); _mm_store_si128((__m128i *) (d32+8), p2); _mm_store_si128((__m128i *) (d32+12), p3); d32 += 16; } } gf_do_final_region_alignment(&rd); #endif } static int gf_w32_split_init(gf_t *gf) { gf_internal_t *h; struct gf_split_2_32_lazy_data *ld2; struct gf_split_4_32_lazy_data *ld4; struct gf_w32_split_8_8_data *d8; struct gf_split_8_32_lazy_data *d32; struct gf_split_16_32_lazy_data *d16; uint32_t p, basep; int i, j, exp, ispclmul, issse3; int isneon = 0; #if defined(INTEL_SSE4_PCLMUL) ispclmul = 1; #else ispclmul = 0; #endif #ifdef INTEL_SSSE3 issse3 = 1; #else issse3 = 0; #endif #ifdef ARM_NEON isneon = 1; #endif h = (gf_internal_t *) gf->scratch; /* Defaults */ gf->inverse.w32 = gf_w32_euclid; /* JSP: First handle single multiplication: If args == 8, then we're doing split 8 8. Otherwise, if PCLMUL, we use that. Otherwise, we use bytwo_p. */ if (h->arg1 == 8 && h->arg2 == 8) { gf->multiply.w32 = gf_w32_split_8_8_multiply; } else if (ispclmul) { if ((0xfffe0000 & h->prim_poly) == 0){ gf->multiply.w32 = gf_w32_clm_multiply_2; } else if ((0xffc00000 & h->prim_poly) == 0){ gf->multiply.w32 = gf_w32_clm_multiply_3; } else if ((0xfe000000 & h->prim_poly) == 0){ gf->multiply.w32 = gf_w32_clm_multiply_4; } } else { gf->multiply.w32 = gf_w32_bytwo_p_multiply; } /* Easy cases: 16/32 and 2/32 */ if ((h->arg1 == 16 && h->arg2 == 32) || (h->arg1 == 32 && h->arg2 == 16)) { d16 = (struct gf_split_16_32_lazy_data *) h->private; d16->last_value = 0; gf->multiply_region.w32 = gf_w32_split_16_32_lazy_multiply_region; return 1; } if ((h->arg1 == 2 && h->arg2 == 32) || (h->arg1 == 32 && h->arg2 == 2)) { ld2 = (struct gf_split_2_32_lazy_data *) h->private; ld2->last_value = 0; #ifdef INTEL_SSSE3 if (!(h->region_type & GF_REGION_NOSIMD)) gf->multiply_region.w32 = gf_w32_split_2_32_lazy_sse_multiply_region; else gf->multiply_region.w32 = gf_w32_split_2_32_lazy_multiply_region; #else gf->multiply_region.w32 = gf_w32_split_2_32_lazy_multiply_region; if(h->region_type & GF_REGION_SIMD) return 0; #endif return 1; } /* 4/32 or Default + SSE - There is no ALTMAP/NOSSE. */ if ((h->arg1 == 4 && h->arg2 == 32) || (h->arg1 == 32 && h->arg2 == 4) || ((issse3 || isneon) && h->mult_type == GF_REGION_DEFAULT)) { ld4 = (struct gf_split_4_32_lazy_data *) h->private; ld4->last_value = 0; if ((h->region_type & GF_REGION_NOSIMD) || !(issse3 || isneon)) { gf->multiply_region.w32 = gf_w32_split_4_32_lazy_multiply_region; } else if (isneon) { #ifdef ARM_NEON gf_w32_neon_split_init(gf); #endif } else if (h->region_type & GF_REGION_ALTMAP) { gf->multiply_region.w32 = gf_w32_split_4_32_lazy_sse_altmap_multiply_region; } else { gf->multiply_region.w32 = gf_w32_split_4_32_lazy_sse_multiply_region; } return 1; } /* 8/32 or Default + no SSE */ if ((h->arg1 == 8 && h->arg2 == 32) || (h->arg1 == 32 && h->arg2 == 8) || h->mult_type == GF_MULT_DEFAULT) { d32 = (struct gf_split_8_32_lazy_data *) h->private; d32->last_value = 0; gf->multiply_region.w32 = gf_w32_split_8_32_lazy_multiply_region; return 1; } /* Finally, if args == 8, then we have to set up the tables here. */ if (h->arg1 == 8 && h->arg2 == 8) { d8 = (struct gf_w32_split_8_8_data *) h->private; d8->last_value = 0; gf->multiply.w32 = gf_w32_split_8_8_multiply; gf->multiply_region.w32 = gf_w32_split_8_32_lazy_multiply_region; basep = 1; for (exp = 0; exp < 7; exp++) { for (j = 0; j < 256; j++) d8->tables[exp][0][j] = 0; for (i = 0; i < 256; i++) d8->tables[exp][i][0] = 0; d8->tables[exp][1][1] = basep; for (i = 2; i < 256; i++) { if (i&1) { p = d8->tables[exp][i^1][1]; d8->tables[exp][i][1] = p ^ basep; } else { p = d8->tables[exp][i>>1][1]; d8->tables[exp][i][1] = GF_MULTBY_TWO(p); } } for (i = 1; i < 256; i++) { p = d8->tables[exp][i][1]; for (j = 1; j < 256; j++) { if (j&1) { d8->tables[exp][i][j] = d8->tables[exp][i][j^1] ^ p; } else { d8->tables[exp][i][j] = GF_MULTBY_TWO(d8->tables[exp][i][j>>1]); } } } for (i = 0; i < 8; i++) basep = GF_MULTBY_TWO(basep); } return 1; } /* If we get here, then the arguments were bad. */ return 0; } static int gf_w32_group_init(gf_t *gf) { uint32_t i, j, p, index; struct gf_w32_group_data *gd; gf_internal_t *h = (gf_internal_t *) gf->scratch; int g_r, g_s; g_s = h->arg1; g_r = h->arg2; gd = (struct gf_w32_group_data *) h->private; gd->shift = (uint32_t *) (&(gd->memory)); gd->reduce = gd->shift + (1 << g_s); gd->rmask = (1 << g_r) - 1; gd->rmask <<= 32; gd->tshift = 32 % g_s; if (gd->tshift == 0) gd->tshift = g_s; gd->tshift = (32 - gd->tshift); gd->tshift = ((gd->tshift-1)/g_r) * g_r; gd->reduce[0] = 0; for (i = 0; i < (1 << g_r); i++) { p = 0; index = 0; for (j = 0; j < g_r; j++) { if (i & (1 << j)) { p ^= (h->prim_poly << j); index ^= (1 << j); index ^= (h->prim_poly >> (32-j)); } } gd->reduce[index] = p; } if (g_s == g_r) { gf->multiply.w32 = gf_w32_group_s_equals_r_multiply; gf->multiply_region.w32 = gf_w32_group_s_equals_r_multiply_region; } else { gf->multiply.w32 = gf_w32_group_multiply; gf->multiply_region.w32 = gf_w32_group_multiply_region; } gf->divide.w32 = NULL; gf->inverse.w32 = gf_w32_euclid; return 1; } static uint32_t gf_w32_composite_multiply_recursive(gf_t *gf, uint32_t a, uint32_t b) { gf_internal_t *h = (gf_internal_t *) gf->scratch; gf_t *base_gf = h->base_gf; uint32_t b0 = b & 0x0000ffff; uint32_t b1 = (b & 0xffff0000) >> 16; uint32_t a0 = a & 0x0000ffff; uint32_t a1 = (a & 0xffff0000) >> 16; uint32_t a1b1; uint32_t rv; a1b1 = base_gf->multiply.w32(base_gf, a1, b1); rv = ((base_gf->multiply.w32(base_gf, a1, b0) ^ base_gf->multiply.w32(base_gf, a0, b1) ^ base_gf->multiply.w32(base_gf, a1b1, h->prim_poly)) << 16) | (base_gf->multiply.w32(base_gf, a0, b0) ^ a1b1); return rv; } /* JSP: This could be made faster. Someday, when I'm bored. */ static uint32_t gf_w32_composite_multiply_inline(gf_t *gf, uint32_t a, uint32_t b) { gf_internal_t *h = (gf_internal_t *) gf->scratch; uint32_t b0 = b & 0x0000ffff; uint32_t b1 = b >> 16; uint32_t a0 = a & 0x0000ffff; uint32_t a1 = a >> 16; uint32_t a1b1, prod; uint16_t *log, *alog; struct gf_w32_composite_data *cd; cd = (struct gf_w32_composite_data *) h->private; log = cd->log; alog = cd->alog; a1b1 = GF_W16_INLINE_MULT(log, alog, a1, b1); prod = GF_W16_INLINE_MULT(log, alog, a1, b0); prod ^= GF_W16_INLINE_MULT(log, alog, a0, b1); prod ^= GF_W16_INLINE_MULT(log, alog, a1b1, h->prim_poly); prod <<= 16; prod ^= GF_W16_INLINE_MULT(log, alog, a0, b0); prod ^= a1b1; return prod; } /* * Composite field division trick (explained in 2007 tech report) * * Compute a / b = a*b^-1, where p(x) = x^2 + sx + 1 * * let c = b^-1 * * c*b = (s*b1c1+b1c0+b0c1)x+(b1c1+b0c0) * * want (s*b1c1+b1c0+b0c1) = 0 and (b1c1+b0c0) = 1 * * let d = b1c1 and d+1 = b0c0 * * solve s*b1c1+b1c0+b0c1 = 0 * * solution: d = (b1b0^-1)(b1b0^-1+b0b1^-1+s)^-1 * * c0 = (d+1)b0^-1 * c1 = d*b1^-1 * * a / b = a * c */ static uint32_t gf_w32_composite_inverse(gf_t *gf, uint32_t a) { gf_internal_t *h = (gf_internal_t *) gf->scratch; gf_t *base_gf = h->base_gf; uint16_t a0 = a & 0x0000ffff; uint16_t a1 = (a & 0xffff0000) >> 16; uint16_t c0, c1, d, tmp; uint32_t c; uint16_t a0inv, a1inv; if (a0 == 0) { a1inv = base_gf->inverse.w32(base_gf, a1); c0 = base_gf->multiply.w32(base_gf, a1inv, h->prim_poly); c1 = a1inv; } else if (a1 == 0) { c0 = base_gf->inverse.w32(base_gf, a0); c1 = 0; } else { a1inv = base_gf->inverse.w32(base_gf, a1); a0inv = base_gf->inverse.w32(base_gf, a0); d = base_gf->multiply.w32(base_gf, a1, a0inv); tmp = (base_gf->multiply.w32(base_gf, a1, a0inv) ^ base_gf->multiply.w32(base_gf, a0, a1inv) ^ h->prim_poly); tmp = base_gf->inverse.w32(base_gf, tmp); d = base_gf->multiply.w32(base_gf, d, tmp); c0 = base_gf->multiply.w32(base_gf, (d^1), a0inv); c1 = base_gf->multiply.w32(base_gf, d, a1inv); } c = c0 | (c1 << 16); return c; } static void gf_w32_composite_multiply_region(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { gf_internal_t *h = (gf_internal_t *) gf->scratch; gf_t *base_gf = h->base_gf; uint32_t b0 = val & 0x0000ffff; uint32_t b1 = (val & 0xffff0000) >> 16; uint32_t *s32, *d32, *top; uint16_t a0, a1, a1b1, *log, *alog; uint32_t prod; gf_region_data rd; struct gf_w32_composite_data *cd; cd = (struct gf_w32_composite_data *) h->private; log = cd->log; alog = cd->alog; if (val == 0) { gf_multby_zero(dest, bytes, xor); return; } gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 4); s32 = rd.s_start; d32 = rd.d_start; top = rd.d_top; if (log == NULL) { if (xor) { while (d32 < top) { a0 = *s32 & 0x0000ffff; a1 = (*s32 & 0xffff0000) >> 16; a1b1 = base_gf->multiply.w32(base_gf, a1, b1); *d32 ^= ((base_gf->multiply.w32(base_gf, a0, b0) ^ a1b1) | ((base_gf->multiply.w32(base_gf, a1, b0) ^ base_gf->multiply.w32(base_gf, a0, b1) ^ base_gf->multiply.w32(base_gf, a1b1, h->prim_poly)) << 16)); s32++; d32++; } } else { while (d32 < top) { a0 = *s32 & 0x0000ffff; a1 = (*s32 & 0xffff0000) >> 16; a1b1 = base_gf->multiply.w32(base_gf, a1, b1); *d32 = ((base_gf->multiply.w32(base_gf, a0, b0) ^ a1b1) | ((base_gf->multiply.w32(base_gf, a1, b0) ^ base_gf->multiply.w32(base_gf, a0, b1) ^ base_gf->multiply.w32(base_gf, a1b1, h->prim_poly)) << 16)); s32++; d32++; } } } else { if (xor) { while (d32 < top) { a0 = *s32 & 0x0000ffff; a1 = (*s32 & 0xffff0000) >> 16; a1b1 = GF_W16_INLINE_MULT(log, alog, a1, b1); prod = GF_W16_INLINE_MULT(log, alog, a1, b0); prod ^= GF_W16_INLINE_MULT(log, alog, a0, b1); prod ^= GF_W16_INLINE_MULT(log, alog, a1b1, h->prim_poly); prod <<= 16; prod ^= GF_W16_INLINE_MULT(log, alog, a0, b0); prod ^= a1b1; *d32 ^= prod; s32++; d32++; } } else { while (d32 < top) { a0 = *s32 & 0x0000ffff; a1 = (*s32 & 0xffff0000) >> 16; a1b1 = GF_W16_INLINE_MULT(log, alog, a1, b1); prod = GF_W16_INLINE_MULT(log, alog, a1, b0); prod ^= GF_W16_INLINE_MULT(log, alog, a0, b1); prod ^= GF_W16_INLINE_MULT(log, alog, a1b1, h->prim_poly); prod <<= 16; prod ^= GF_W16_INLINE_MULT(log, alog, a0, b0); prod ^= a1b1; *d32 = prod; s32++; d32++; } } } } static void gf_w32_composite_multiply_region_alt(gf_t *gf, void *src, void *dest, uint32_t val, int bytes, int xor) { gf_internal_t *h = (gf_internal_t *) gf->scratch; gf_t *base_gf = h->base_gf; uint16_t val0 = val & 0x0000ffff; uint16_t val1 = (val & 0xffff0000) >> 16; gf_region_data rd; int sub_reg_size; uint8_t *slow, *shigh; uint8_t *dlow, *dhigh, *top; /* JSP: I want the two pointers aligned wrt each other on 16 byte boundaries. So I'm going to make sure that the area on which the two operate is a multiple of 32. Of course, that junks up the mapping, but so be it -- that's why we have extract_word.... */ gf_set_region_data(&rd, gf, src, dest, bytes, val, xor, 32); gf_do_initial_region_alignment(&rd); slow = (uint8_t *) rd.s_start; dlow = (uint8_t *) rd.d_start; top = (uint8_t *) rd.d_top; sub_reg_size = (top - dlow)/2; shigh = slow + sub_reg_size; dhigh = dlow + sub_reg_size; base_gf->multiply_region.w32(base_gf, slow, dlow, val0, sub_reg_size, xor); base_gf->multiply_region.w32(base_gf, shigh, dlow, val1, sub_reg_size, 1); base_gf->multiply_region.w32(base_gf, slow, dhigh, val1, sub_reg_size, xor); base_gf->multiply_region.w32(base_gf, shigh, dhigh, val0, sub_reg_size, 1); base_gf->multiply_region.w32(base_gf, shigh, dhigh, base_gf->multiply.w32(base_gf, h->prim_poly, val1), sub_reg_size, 1); gf_do_final_region_alignment(&rd); } static int gf_w32_composite_init(gf_t *gf) { gf_internal_t *h = (gf_internal_t *) gf->scratch; struct gf_w32_composite_data *cd; if (h->base_gf == NULL) return 0; cd = (struct gf_w32_composite_data *) h->private; cd->log = gf_w16_get_log_table(h->base_gf); cd->alog = gf_w16_get_mult_alog_table(h->base_gf); if (h->region_type & GF_REGION_ALTMAP) { gf->multiply_region.w32 = gf_w32_composite_multiply_region_alt; } else { gf->multiply_region.w32 = gf_w32_composite_multiply_region; } if (cd->log == NULL) { gf->multiply.w32 = gf_w32_composite_multiply_recursive; } else { gf->multiply.w32 = gf_w32_composite_multiply_inline; } gf->divide.w32 = NULL; gf->inverse.w32 = gf_w32_composite_inverse; return 1; } int gf_w32_scratch_size(int mult_type, int region_type, int divide_type, int arg1, int arg2) { int issse3 = 0; int isneon = 0; #ifdef INTEL_SSSE3 issse3 = 1; #endif #ifdef ARM_NEON isneon = 1; #endif switch(mult_type) { case GF_MULT_BYTWO_p: case GF_MULT_BYTWO_b: return sizeof(gf_internal_t) + sizeof(struct gf_w32_bytwo_data) + 64; break; case GF_MULT_GROUP: return sizeof(gf_internal_t) + sizeof(struct gf_w32_group_data) + sizeof(uint32_t) * (1 << arg1) + sizeof(uint32_t) * (1 << arg2) + 64; break; case GF_MULT_DEFAULT: case GF_MULT_SPLIT_TABLE: if (arg1 == 8 && arg2 == 8){ return sizeof(gf_internal_t) + sizeof(struct gf_w32_split_8_8_data) + 64; } if ((arg1 == 16 && arg2 == 32) || (arg2 == 16 && arg1 == 32)) { return sizeof(gf_internal_t) + sizeof(struct gf_split_16_32_lazy_data) + 64; } if ((arg1 == 2 && arg2 == 32) || (arg2 == 2 && arg1 == 32)) { return sizeof(gf_internal_t) + sizeof(struct gf_split_2_32_lazy_data) + 64; } if ((arg1 == 8 && arg2 == 32) || (arg2 == 8 && arg1 == 32) || (mult_type == GF_MULT_DEFAULT && !(issse3 || isneon))) { return sizeof(gf_internal_t) + sizeof(struct gf_split_8_32_lazy_data) + 64; } if ((arg1 == 4 && arg2 == 32) || (arg2 == 4 && arg1 == 32) || mult_type == GF_MULT_DEFAULT) { return sizeof(gf_internal_t) + sizeof(struct gf_split_4_32_lazy_data) + 64; } return 0; case GF_MULT_CARRY_FREE: return sizeof(gf_internal_t); break; case GF_MULT_CARRY_FREE_GK: return sizeof(gf_internal_t) + sizeof(uint64_t)*2; break; case GF_MULT_SHIFT: return sizeof(gf_internal_t); break; case GF_MULT_COMPOSITE: return sizeof(gf_internal_t) + sizeof(struct gf_w32_composite_data) + 64; break; default: return 0; } return 0; } int gf_w32_init(gf_t *gf) { gf_internal_t *h; h = (gf_internal_t *) gf->scratch; /* Allen: set default primitive polynomial / irreducible polynomial if needed */ if (h->prim_poly == 0) { if (h->mult_type == GF_MULT_COMPOSITE) { h->prim_poly = gf_composite_get_default_poly(h->base_gf); if (h->prim_poly == 0) return 0; /* This shouldn't happen */ } else { /* Allen: use the following primitive polynomial to make carryless multiply work more efficiently for GF(2^32).*/ /* h->prim_poly = 0xc5; */ /* Allen: The following is the traditional primitive polynomial for GF(2^32) */ h->prim_poly = 0x400007; } } /* No leading one */ if(h->mult_type != GF_MULT_COMPOSITE) h->prim_poly &= 0xffffffff; gf->multiply.w32 = NULL; gf->divide.w32 = NULL; gf->inverse.w32 = NULL; gf->multiply_region.w32 = NULL; switch(h->mult_type) { case GF_MULT_CARRY_FREE: if (gf_w32_cfm_init(gf) == 0) return 0; break; case GF_MULT_CARRY_FREE_GK: if (gf_w32_cfmgk_init(gf) == 0) return 0; break; case GF_MULT_SHIFT: if (gf_w32_shift_init(gf) == 0) return 0; break; case GF_MULT_COMPOSITE: if (gf_w32_composite_init(gf) == 0) return 0; break; case GF_MULT_DEFAULT: case GF_MULT_SPLIT_TABLE: if (gf_w32_split_init(gf) == 0) return 0; break; case GF_MULT_GROUP: if (gf_w32_group_init(gf) == 0) return 0; break; case GF_MULT_BYTWO_p: case GF_MULT_BYTWO_b: if (gf_w32_bytwo_init(gf) == 0) return 0; break; default: return 0; } if (h->divide_type == GF_DIVIDE_EUCLID) { gf->divide.w32 = gf_w32_divide_from_inverse; gf->inverse.w32 = gf_w32_euclid; } else if (h->divide_type == GF_DIVIDE_MATRIX) { gf->divide.w32 = gf_w32_divide_from_inverse; gf->inverse.w32 = gf_w32_matrix; } if (gf->inverse.w32 != NULL && gf->divide.w32 == NULL) { gf->divide.w32 = gf_w32_divide_from_inverse; } if (gf->inverse.w32 == NULL && gf->divide.w32 != NULL) { gf->inverse.w32 = gf_w32_inverse_from_divide; } if (h->region_type == GF_REGION_CAUCHY) { gf->extract_word.w32 = gf_wgen_extract_word; gf->multiply_region.w32 = gf_wgen_cauchy_region; } else if (h->region_type & GF_REGION_ALTMAP) { if (h->mult_type == GF_MULT_COMPOSITE) { gf->extract_word.w32 = gf_w32_composite_extract_word; } else { gf->extract_word.w32 = gf_w32_split_extract_word; } } else { gf->extract_word.w32 = gf_w32_extract_word; } return 1; }
drmingdrmer/lrc-ec
src/gf_w32.c
C
mit
79,272
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Coq bench</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../../..">Unstable</a></li> <li><a href=".">8.4.5 / contrib:qarith-stern-brocot dev</a></li> <li class="active"><a href="">2015-01-29 16:27:40</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="../../../../../about.html">About</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href=".">ยซ Up</a> <h1> contrib:qarith-stern-brocot <small> dev <span class="label label-info">Not compatible with this Coq</span> </small> </h1> <p><em><script>document.write(moment("2015-01-29 16:27:40 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2015-01-29 16:27:40 UTC)</em><p> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>ruby lint.rb unstable ../unstable/packages/coq:contrib:qarith-stern-brocot/coq:contrib:qarith-stern-brocot.dev</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> <dt>Output</dt> <dd><pre>The package is valid. </pre></dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --dry-run coq:contrib:qarith-stern-brocot.dev coq.8.4.5</code></dd> <dt>Return code</dt> <dd>768</dd> <dt>Duration</dt> <dd>0 s</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.4.5). The following dependencies couldn&#39;t be met: - coq:contrib:qarith-stern-brocot -&gt; coq &gt;= 8.5beta1 Your request can&#39;t be satisfied: - Conflicting version constraints for coq No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq, to test if the problem was incompatibility with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --dry-run coq:contrib:qarith-stern-brocot.dev</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>4 s</dd> <dt>Output</dt> <dd><pre>The following actions will be performed: - remove coq.8.4.5 === 1 to remove === =-=- Removing Packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Removing coq.8.4.5. [WARNING] Directory /home/bench/.opam/system/lib/coq is not empty, not removing [WARNING] Directory /home/bench/.opam/system/share/coq is not empty, not removing The following actions will be performed: - install coq.hott [required by coq:contrib:qarith-stern-brocot] - install coq:contrib:qarith-stern-brocot.dev === 2 to install === =-=- Synchronizing package archives -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= =-=- Installing packages =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Building coq.hott: ./configure -configdir /home/bench/.opam/system/lib/coq/config -mandir /home/bench/.opam/system/man -docdir /home/bench/.opam/system/doc -prefix /home/bench/.opam/system -usecamlp5 -camlp5dir /home/bench/.opam/system/lib/camlp5 -coqide opt make -j4 make install Installing coq.hott. Building coq:contrib:qarith-stern-brocot.dev: coq_makefile -f Make -o Makefile make -j4 make install Installing coq:contrib:qarith-stern-brocot.dev. </pre></dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. ยฉ Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io-old
clean/Linux-x86_64-4.02.1-1.2.0/unstable/8.4.5/contrib:qarith-stern-brocot/dev/2015-01-29_16-27-40.html
HTML
mit
7,040
require 'spec_helper' RSpec.describe 'Generators' do let(:destination) { Howitzer::BaseGenerator.destination } let(:output) { StringIO.new } subject { file_tree_info(destination) } before do Howitzer::BaseGenerator.logger = output generator_name.new(turnip: true) end after { FileUtils.rm_r(destination) } describe Howitzer::TurnipGenerator do let(:generator_name) { described_class } let(:expected_result) do [ { name: '/spec', is_directory: true }, { name: '/spec/acceptance', is_directory: true }, { name: '/spec/acceptance/example.feature', is_directory: false, size: template_file_size('turnip', 'example.feature') }, { name: '/spec/spec_helper.rb', is_directory: false, size: template_file_size('turnip', 'spec_helper.rb') }, { name: '/spec/steps', is_directory: true }, { name: '/spec/steps/common_steps.rb', is_directory: false, size: template_file_size('turnip', 'common_steps.rb') }, { name: '/spec/turnip_helper.rb', is_directory: false, size: template_file_size('turnip', 'turnip_helper.rb') }, { name: '/tasks', is_directory: true }, { name: '/tasks/turnip.rake', is_directory: false, size: template_file_size('turnip', 'turnip.rake') } ] end it { is_expected.to eql(expected_result) } describe 'output' do let(:expected_output) do " * Turnip integration to the framework ... Added '.rspec' file Added 'spec/spec_helper.rb' file Added 'spec/turnip_helper.rb' file Added 'spec/acceptance/example.feature' file Added 'spec/steps/common_steps.rb' file Added 'tasks/turnip.rake' file\n" end subject { output.string } it { is_expected.to eql(expected_output) } end end end
trofymenko/howitzer
spec/unit/generators/turnip_generator_spec.rb
Ruby
mit
1,860
namespace ZincDB { export namespace Encoding { export namespace UTF8 { declare const TextEncoder: any; declare const TextDecoder: any; let nativeTextEncoder: any; let nativeTextDecoder: any; export const encode = function(str: string): Uint8Array { if (!str || str.length == 0) return new Uint8Array(0); if (runningInNodeJS()) { return BufferTools.bufferToUint8Array(new Buffer(str, "utf8")); } else if (createNativeTextEncoderAndDecoderIfAvailable()) { return nativeTextEncoder.encode(str); } else { return encodeWithJS(str); } } export const decode = function(utf8Bytes: Uint8Array): string { if (!utf8Bytes || utf8Bytes.length == 0) return ""; if (runningInNodeJS()) { return BufferTools.uint8ArrayToBuffer(utf8Bytes).toString("utf8"); } else if (createNativeTextEncoderAndDecoderIfAvailable()) { return nativeTextDecoder.decode(utf8Bytes); } else { return decodeWithJS(utf8Bytes); } } export const encodeWithJS = function(str: string, outputArray?: Uint8Array): Uint8Array { if (!str || str.length == 0) return new Uint8Array(0); if (!outputArray) outputArray = new Uint8Array(str.length * 4); let writeIndex = 0; for (let readIndex = 0; readIndex < str.length; readIndex++) { const charCode = CodePoint.encodeFromString(str, readIndex); if (charCode <= 0x7F) { outputArray[writeIndex++] = charCode; } else if (charCode <= 0x7FF) { outputArray[writeIndex++] = 0xC0 | (charCode >>> 6); outputArray[writeIndex++] = 0x80 | (charCode & 63); } else if (charCode <= 0xFFFF) { outputArray[writeIndex++] = 0xE0 | (charCode >>> 12); outputArray[writeIndex++] = 0x80 | ((charCode >>> 6) & 63); outputArray[writeIndex++] = 0x80 | (charCode & 63); } else if (charCode <= 0x10FFFF) { outputArray[writeIndex++] = 0xF0 | (charCode >>> 18); outputArray[writeIndex++] = 0x80 | ((charCode >>> 12) & 63); outputArray[writeIndex++] = 0x80 | ((charCode >>> 6) & 63); outputArray[writeIndex++] = 0x80 | (charCode & 63); readIndex++; // A character outside the BMP had to be made from two surrogate characters } else throw new Error("Invalid UTF-16 string: Encountered a character unsupported by UTF-8/16 (RFC 3629)"); } return outputArray.subarray(0, writeIndex); } export const decodeWithJS = function(utf8Bytes: Uint8Array, startOffset = 0, endOffset?: number): string { if (!utf8Bytes || utf8Bytes.length == 0) return ""; if (endOffset === undefined) endOffset = utf8Bytes.length; const output = new StringBuilder(); let outputCodePoint: number; let leadByte: number; for (let readIndex = startOffset, length = endOffset; readIndex < length;) { leadByte = utf8Bytes[readIndex]; if ((leadByte >>> 7) === 0) { outputCodePoint = leadByte; readIndex += 1; } else if ((leadByte >>> 5) === 6) { if (readIndex + 1 >= endOffset) throw new Error("Invalid UTF-8 stream: Truncated codepoint sequence encountered at position " + readIndex); outputCodePoint = ((leadByte & 31) << 6) | (utf8Bytes[readIndex + 1] & 63); readIndex += 2; } else if ((leadByte >>> 4) === 14) { if (readIndex + 2 >= endOffset) throw new Error("Invalid UTF-8 stream: Truncated codepoint sequence encountered at position " + readIndex); outputCodePoint = ((leadByte & 15) << 12) | ((utf8Bytes[readIndex + 1] & 63) << 6) | (utf8Bytes[readIndex + 2] & 63); readIndex += 3; } else if ((leadByte >>> 3) === 30) { if (readIndex + 3 >= endOffset) throw new Error("Invalid UTF-8 stream: Truncated codepoint sequence encountered at position " + readIndex); outputCodePoint = ((leadByte & 7) << 18) | ((utf8Bytes[readIndex + 1] & 63) << 12) | ((utf8Bytes[readIndex + 2] & 63) << 6) | (utf8Bytes[readIndex + 3] & 63); readIndex += 4; } else throw new Error("Invalid UTF-8 stream: An invalid lead byte value encountered at position " + readIndex); output.appendCodePoint(outputCodePoint); } return output.getOutputString(); } export const createNativeTextEncoderAndDecoderIfAvailable = function(): boolean { if (nativeTextEncoder) return true; if (typeof TextEncoder == "function") { nativeTextEncoder = new TextEncoder("utf-8"); nativeTextDecoder = new TextDecoder("utf-8"); return true; } else return false; } } } }
zincbase/zincdb
src/Library/Encoding/UTF8.ts
TypeScript
mit
4,610
// Copyright (c) 2012-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "key.h" #include "base58.h" #include "script/script.h" #include "uint256.h" #include "util.h" #include "utilstrencodings.h" #include "test/test_adn.h" #include <string> #include <vector> #include <boost/test/unit_test.hpp> using namespace std; static const string strSecret1 ("7qh6LYnLN2w2ntz2wwUhRUEgkQ2j8XB16FGw77ZRDZmC29bn7cD"); static const string strSecret2 ("7rve4MxeWFQHGbSYH6J2yaaZd3MBUqoDEwN6ZAZ6ZHmhTT4r3hW"); static const string strSecret1C ("XBuxZHH6TqXUuaSjbVTFR1DQSYecxCB9QA1Koyx5tTc3ddhqEnhm"); static const string strSecret2C ("XHMkZqWcY6Zkoq1j42NBijD8z5N5FtNy2Wx7WyAfXX2HZgxry8cr"); static const CBitcoinAddress addr1 ("Xywgfc872nn5CKtpATCoAjZCc4v96pJczy"); static const CBitcoinAddress addr2 ("XpmouUj9KKJ99ZuU331ZS1KqsboeFnLGgK"); static const CBitcoinAddress addr1C("XxV9h4Xmv6Pup8tVAQmH97K6grzvDwMG9F"); static const CBitcoinAddress addr2C("Xn7ZrYdExuk79Dm7CJCw7sfUWi2qWJSbRy"); static const string strAddressBad("Xta1praZQjyELweyMByXyiREw1ZRsjXzVP"); #ifdef KEY_TESTS_DUMPINFO void dumpKeyInfo(uint256 privkey) { CKey key; key.resize(32); memcpy(&secret[0], &privkey, 32); vector<unsigned char> sec; sec.resize(32); memcpy(&sec[0], &secret[0], 32); printf(" * secret (hex): %s\n", HexStr(sec).c_str()); for (int nCompressed=0; nCompressed<2; nCompressed++) { bool fCompressed = nCompressed == 1; printf(" * %s:\n", fCompressed ? "compressed" : "uncompressed"); CBitcoinSecret bsecret; bsecret.SetSecret(secret, fCompressed); printf(" * secret (base58): %s\n", bsecret.ToString().c_str()); CKey key; key.SetSecret(secret, fCompressed); vector<unsigned char> vchPubKey = key.GetPubKey(); printf(" * pubkey (hex): %s\n", HexStr(vchPubKey).c_str()); printf(" * address (base58): %s\n", CBitcoinAddress(vchPubKey).ToString().c_str()); } } #endif BOOST_FIXTURE_TEST_SUITE(key_tests, BasicTestingSetup) BOOST_AUTO_TEST_CASE(key_test1) { CBitcoinSecret bsecret1, bsecret2, bsecret1C, bsecret2C, baddress1; BOOST_CHECK( bsecret1.SetString (strSecret1)); BOOST_CHECK( bsecret2.SetString (strSecret2)); BOOST_CHECK( bsecret1C.SetString(strSecret1C)); BOOST_CHECK( bsecret2C.SetString(strSecret2C)); BOOST_CHECK(!baddress1.SetString(strAddressBad)); CKey key1 = bsecret1.GetKey(); BOOST_CHECK(key1.IsCompressed() == false); CKey key2 = bsecret2.GetKey(); BOOST_CHECK(key2.IsCompressed() == false); CKey key1C = bsecret1C.GetKey(); BOOST_CHECK(key1C.IsCompressed() == true); CKey key2C = bsecret2C.GetKey(); BOOST_CHECK(key2C.IsCompressed() == true); CPubKey pubkey1 = key1. GetPubKey(); CPubKey pubkey2 = key2. GetPubKey(); CPubKey pubkey1C = key1C.GetPubKey(); CPubKey pubkey2C = key2C.GetPubKey(); BOOST_CHECK(key1.VerifyPubKey(pubkey1)); BOOST_CHECK(!key1.VerifyPubKey(pubkey1C)); BOOST_CHECK(!key1.VerifyPubKey(pubkey2)); BOOST_CHECK(!key1.VerifyPubKey(pubkey2C)); BOOST_CHECK(!key1C.VerifyPubKey(pubkey1)); BOOST_CHECK(key1C.VerifyPubKey(pubkey1C)); BOOST_CHECK(!key1C.VerifyPubKey(pubkey2)); BOOST_CHECK(!key1C.VerifyPubKey(pubkey2C)); BOOST_CHECK(!key2.VerifyPubKey(pubkey1)); BOOST_CHECK(!key2.VerifyPubKey(pubkey1C)); BOOST_CHECK(key2.VerifyPubKey(pubkey2)); BOOST_CHECK(!key2.VerifyPubKey(pubkey2C)); BOOST_CHECK(!key2C.VerifyPubKey(pubkey1)); BOOST_CHECK(!key2C.VerifyPubKey(pubkey1C)); BOOST_CHECK(!key2C.VerifyPubKey(pubkey2)); BOOST_CHECK(key2C.VerifyPubKey(pubkey2C)); BOOST_CHECK(addr1.Get() == CTxDestination(pubkey1.GetID())); BOOST_CHECK(addr2.Get() == CTxDestination(pubkey2.GetID())); BOOST_CHECK(addr1C.Get() == CTxDestination(pubkey1C.GetID())); BOOST_CHECK(addr2C.Get() == CTxDestination(pubkey2C.GetID())); for (int n=0; n<16; n++) { string strMsg = strprintf("Very secret message %i: 11", n); uint256 hashMsg = Hash(strMsg.begin(), strMsg.end()); // normal signatures vector<unsigned char> sign1, sign2, sign1C, sign2C; BOOST_CHECK(key1.Sign (hashMsg, sign1)); BOOST_CHECK(key2.Sign (hashMsg, sign2)); BOOST_CHECK(key1C.Sign(hashMsg, sign1C)); BOOST_CHECK(key2C.Sign(hashMsg, sign2C)); BOOST_CHECK( pubkey1.Verify(hashMsg, sign1)); BOOST_CHECK(!pubkey1.Verify(hashMsg, sign2)); BOOST_CHECK( pubkey1.Verify(hashMsg, sign1C)); BOOST_CHECK(!pubkey1.Verify(hashMsg, sign2C)); BOOST_CHECK(!pubkey2.Verify(hashMsg, sign1)); BOOST_CHECK( pubkey2.Verify(hashMsg, sign2)); BOOST_CHECK(!pubkey2.Verify(hashMsg, sign1C)); BOOST_CHECK( pubkey2.Verify(hashMsg, sign2C)); BOOST_CHECK( pubkey1C.Verify(hashMsg, sign1)); BOOST_CHECK(!pubkey1C.Verify(hashMsg, sign2)); BOOST_CHECK( pubkey1C.Verify(hashMsg, sign1C)); BOOST_CHECK(!pubkey1C.Verify(hashMsg, sign2C)); BOOST_CHECK(!pubkey2C.Verify(hashMsg, sign1)); BOOST_CHECK( pubkey2C.Verify(hashMsg, sign2)); BOOST_CHECK(!pubkey2C.Verify(hashMsg, sign1C)); BOOST_CHECK( pubkey2C.Verify(hashMsg, sign2C)); // compact signatures (with key recovery) vector<unsigned char> csign1, csign2, csign1C, csign2C; BOOST_CHECK(key1.SignCompact (hashMsg, csign1)); BOOST_CHECK(key2.SignCompact (hashMsg, csign2)); BOOST_CHECK(key1C.SignCompact(hashMsg, csign1C)); BOOST_CHECK(key2C.SignCompact(hashMsg, csign2C)); CPubKey rkey1, rkey2, rkey1C, rkey2C; BOOST_CHECK(rkey1.RecoverCompact (hashMsg, csign1)); BOOST_CHECK(rkey2.RecoverCompact (hashMsg, csign2)); BOOST_CHECK(rkey1C.RecoverCompact(hashMsg, csign1C)); BOOST_CHECK(rkey2C.RecoverCompact(hashMsg, csign2C)); BOOST_CHECK(rkey1 == pubkey1); BOOST_CHECK(rkey2 == pubkey2); BOOST_CHECK(rkey1C == pubkey1C); BOOST_CHECK(rkey2C == pubkey2C); } // test deterministic signing std::vector<unsigned char> detsig, detsigc; string strMsg = "Very deterministic message"; uint256 hashMsg = Hash(strMsg.begin(), strMsg.end()); BOOST_CHECK(key1.Sign(hashMsg, detsig)); BOOST_CHECK(key1C.Sign(hashMsg, detsigc)); BOOST_CHECK(detsig == detsigc); BOOST_CHECK(detsig == ParseHex("304402205dbbddda71772d95ce91cd2d14b592cfbc1dd0aabd6a394b6c2d377bbe59d31d022014ddda21494a4e221f0824f0b8b924c43fa43c0ad57dccdaa11f81a6bd4582f6")); BOOST_CHECK(key2.Sign(hashMsg, detsig)); BOOST_CHECK(key2C.Sign(hashMsg, detsigc)); BOOST_CHECK(detsig == detsigc); BOOST_CHECK(detsig == ParseHex("3044022052d8a32079c11e79db95af63bb9600c5b04f21a9ca33dc129c2bfa8ac9dc1cd5022061d8ae5e0f6c1a16bde3719c64c2fd70e404b6428ab9a69566962e8771b5944d")); BOOST_CHECK(key1.SignCompact(hashMsg, detsig)); BOOST_CHECK(key1C.SignCompact(hashMsg, detsigc)); BOOST_CHECK(detsig == ParseHex("1c5dbbddda71772d95ce91cd2d14b592cfbc1dd0aabd6a394b6c2d377bbe59d31d14ddda21494a4e221f0824f0b8b924c43fa43c0ad57dccdaa11f81a6bd4582f6")); BOOST_CHECK(detsigc == ParseHex("205dbbddda71772d95ce91cd2d14b592cfbc1dd0aabd6a394b6c2d377bbe59d31d14ddda21494a4e221f0824f0b8b924c43fa43c0ad57dccdaa11f81a6bd4582f6")); BOOST_CHECK(key2.SignCompact(hashMsg, detsig)); BOOST_CHECK(key2C.SignCompact(hashMsg, detsigc)); BOOST_CHECK(detsig == ParseHex("1c52d8a32079c11e79db95af63bb9600c5b04f21a9ca33dc129c2bfa8ac9dc1cd561d8ae5e0f6c1a16bde3719c64c2fd70e404b6428ab9a69566962e8771b5944d")); BOOST_CHECK(detsigc == ParseHex("2052d8a32079c11e79db95af63bb9600c5b04f21a9ca33dc129c2bfa8ac9dc1cd561d8ae5e0f6c1a16bde3719c64c2fd70e404b6428ab9a69566962e8771b5944d")); } BOOST_AUTO_TEST_SUITE_END()
AdnCoin/AdnCoin
src/test/key_tests.cpp
C++
mit
7,958
<div id="actions-content"> <!-- Trigger/Open The Modal --> <section> <button class="action-button" ng-click="vm.toggleContent(1)">Reserve</button> <button class="action-button" ng-click="vm.toggleContent(2)">Trade In</button> <button class="action-button" ng-click="vm.toggleContent(3)">Test Drive</button> </section> <!-- Reserve --> <div class="action-area" id="action1" ng-show="vm.reserveShow"> <vdp-reserve></vdp-reserve> </div> <!-- Trade In --> <div class="action-area" id="action2" ng-show="vm.tradeShow"> <vdp-tradein></vdp-tradein> </div> <!-- Test Drive --> <div class="action-area" id="action3" ng-show="vm.testShow"> <vdp-testdrive></vdp-testdrive> </div> </div> <!-- Reserve -- <div id="modal1" class="modal"> <div class="modal-fade-screen"> <div class="modal-content"> <span class="close" ng-click="vm.closeModal(1)">x</span> <vdp-reserve></vdp-reserve> </div> </div> </div> <!-- Trade In -- <div id="modal2" class="modal"> <div class="modal-fade-screen"> <div class="modal-content"> <span class="close" ng-click="vm.closeModal(2)">x</span> <vdp-tradein></vdp-tradein> </div> </div> </div> <!-- Test Drive -- <div id="modal3" class="modal"> <div class="modal-fade-screen"> <div class="modal-content"> <span class="close" ng-click="vm.closeModal(3)">x</span> <vdp-testdrive></vdp-testdrive> </div> </div> </div> <!-- THIS WORKS DON'T TOUCH IT <!-- The Modal -- <div id="myModal" class="modal"> <!-- Modal content -- <div class="modal-fade-screen"> <div class="modal-content"> <span class="close" ng-click="vm.closeModal()">x</span> <vdp-reserve></vdp-reserve> </div> </div> </div> --> <!-- <div class="modal"> <label for="modal-1"> <span class="modal-trigger action-button" ng-click="vm.openModal(1)">Reserve</span> </label> <label for="modal-2"> <span class="modal-trigger action-button" ng-click="vm.openModal(2)">Trade In</span> </label> <label for="modal-3"> <span class="modal-trigger action-button" ng-click="vm.openModal(3)">Test Drive</span> </label> <input class="modal-state" id="modal-1" type="checkbox" /> <div class="modal-fade-screen"> <div class="modal-inner mi1"> <div class="modal-close" for="modal-1" ng-click="vm.exitModal(1)"></div> <vdp-reserve></vdp-reserve> </div> </div> <input class="modal-state" id="modal-2" type="checkbox" /> <div class="modal-fade-screen"> <div class="modal-inner mi2"> <div class="modal-close" for="modal-2" ng-click="vm.exitModal(2)"></div> <vdp-reserve></vdp-reserve> </div> </div> </div> --> <!-- <section> <button class="action-button">Trade In</button> <button class="action-button">Test Drive</button> </section> -->
nicrobbie/testsite
client/app/components/vdpActions/vdpActions.tpl.html
HTML
mit
2,846
package com.derf.utils; import java.lang.reflect.Array; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; import net.minecraft.block.Block; import net.minecraft.client.renderer.block.model.ModelBakery; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.common.brewing.BrewingRecipeRegistry; import net.minecraftforge.fml.common.IFuelHandler; import net.minecraftforge.fml.common.IWorldGenerator; import net.minecraftforge.fml.common.registry.GameRegistry; /** * This basically wraps up some stuff for registry... * @author Fred * */ public class DRegistry { // Models public static void registerRenderer(Item item, int meta, String name) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(DLoader.modid + ":" + name, "inventory")); } public static void registerRenderer(Item item, String name) { registerRenderer(item, 0, name); } public static void registerRenderer(Block block, int meta, String name) { registerRenderer(Item.getItemFromBlock(block), meta, name); } public static void registerRenderer(Block block, String name) { registerRenderer(block, 0, name); } // Variants public static void addVariants(Block block, String... args) { addVariants(Item.getItemFromBlock(block), args); } public static void addVariants(Item item, String... args) { List<String> argsList = Arrays.asList(args); List<ResourceLocation> resList = argsList.stream() .map(arg -> new ResourceLocation(DLoader.modid + ":" + arg)) .collect(Collectors.toList()); if(resList.size() > 0) { ModelBakery.registerItemVariants(item,resList.toArray(new ResourceLocation[0])); } } // Fuel Handler public static void registerFuelHandler(IFuelHandler fuel) { GameRegistry.registerFuelHandler(fuel); } // Smelting... public static void addSmelting(ItemStack input, ItemStack output, float xp) { GameRegistry.addSmelting(input, output, xp); } public static void addSmelting(Item input, ItemStack output, float xp) { GameRegistry.addSmelting(input, output, xp); } public static void addSmelting(Block input, ItemStack output, float xp) { GameRegistry.addSmelting(input, output, xp); } // Brewing... Note: I'm going to have some fun with brewing... Pendents... public static void addBrewingRecipe(ItemStack input, ItemStack ingredient, ItemStack output) { BrewingRecipeRegistry.addRecipe(input, ingredient, output); } // World Generator public static void registerWorldGenerator(IWorldGenerator generator, int weight) { GameRegistry.registerWorldGenerator(generator, weight); } // TileEntity public static void registerTileEntity(Class<? extends TileEntity> tileEntityClass, String name) { GameRegistry.registerTileEntity(tileEntityClass, name); } }
aod6060/dutils
src/main/java/com/derf/utils/DRegistry.java
Java
mit
3,077
import { LOGIN_REQUEST, LOGIN_SUCCESS, LOGIN_FAILURE } from '../actions/LoginActions' export function login(state = {loadState : {loading: false, success: false, failure: false}}, action) { switch (action.type) { case LOGIN_REQUEST: return Object.assign({}, state, { loadState: {loading: true, success: false, failure: false}, }); case LOGIN_SUCCESS: if (action.payload.state == '1'){ return Object.assign({}, state, { loadState: {loading: false, success: true, failure: false}, username: action.payload.data.username, nickname: action.payload.data.nickname, data: action.payload.data }); } else { return Object.assign({}, state, { loadState: {loading: false, success: false, failure: false}, }); } case LOGIN_FAILURE: return Object.assign({}, state, { loadState: {loading: false, success: false, failure: true}, }); default: return state } }
sgt39007/waji_redux
app/js/redux/reducers/LoginReducers.js
JavaScript
mit
1,066
<?php namespace PhpExtended\Gmth; use PhpExtended\Json\JsonCollection; use PhpExtended\Json\JsonException; use PhpExtended\Json\JsonObject; class GmthApiGrilleBloc extends JsonObject { /** * The label of the question bloc. * * @var string */ private $_label = null; /** * The variable name of the question bloc. * * @var string */ private $_variable = null; /** * The css class that represents the level of the question bloc. * * @var string */ private $_class = null; /** * The id of the group page the question bloc is in. * * @var string */ private $_group = null; /** * The help text to fill the question bloc. * * @var string */ private $_help = null; /** * The response parameters for this question bloc. * * @var GmthApiGrilleBlocResponse */ private $_response = null; /** * The criteria parameters for this question bloc. * * @var GmthApiGrilleBlocCriteria */ private $_criteria = null; /** * The display rules for this question bloc. * * @var JsonCollection [GmthApiGrilleBlocDisplayRule] */ private $_display_rules = null; /** * The display scope for this question bloc. * * @var string */ private $_display_scope = null; /** * The expected message when the question bloc is not filled in. * * @var string */ private $_expected_msg = null; /** * Builds a new GmthApiGrilleBloc object with the given decoded * json data and the given silent policy. * * @param mixed[] $json * @param boolean $silent * @throws JsonException if the object cannot be built and if not silent */ public function __construct(array $json, $silent = false) { foreach($json as $key => $value) { switch($key) { case 'label': $this->_label = $this->asString($value, $silent); break; case 'name': $this->_variable = $this->asString($value, $silent); break; case 'class': $this->_class = $this->asString($value, $silent); break; case 'group': $this->_group = $this->asString($value, $silent); break; case 'help': $this->_help = $this->asString($value, $silent); break; case 'response': $this->_response = new GmthApiGrilleBlocResponse($this->asArray($value, $silent), $silent); break; case 'criteria': $this->_criteria = new GmthApiGrilleBlocCriteria($this->asArray($value, $silent), $silent); break; case 'displayRules': $this->_display_rules = new JsonCollection('\PhpExtended\Gmth\GmthApiGrilleBlocDisplayRule', $this->asArray($value, $silent), $silent); break; case 'displayScope': $this->_display_scope = $this->asString($value, $silent); break; case 'expectedMsg': $this->_expected_msg = $this->asString($value, $silent); break; default: if(!$silent) throw new JsonException(strtr('Forbidden key "{key}" in object "{class}".', array('{key}' => $key, '{class}' => get_class($this)))); } } if($this->_display_rules === null) $this->_display_rules = new JsonCollection('\PhpExtended\Gmth\GmthApiGrilleBlocDisplayRule', array()); } /** * Gets the label of the bloc. * * @return string */ public function getLabel() { return $this->_label; } /** * Gets the variable name of the bloc. * * @return string */ public function getVariable() { return $this->_variable; } /** * Gets the display class of this block. * * @return string */ public function getClass() { return $this->_class; } /** * Gets the group id for this block. * * @return string */ public function getGroup() { return $this->_group; } /** * Gets the help text of the block. * * @return string */ public function getHelp() { return $this->_help; } /** * Gets the response of the block. * * @return \PhpExtended\Gmth\GmthApiGrilleBlocResponse */ public function getResponse() { return $this->_response; } /** * Gets the criteria of the block. * * @return \PhpExtended\Gmth\GmthApiGrilleBlocCriteria */ public function getCriteria() { return $this->_criteria; } /** * Gets the rules of the block. * * @return \PhpExtended\Json\JsonCollection[GmthApiGrilleBlocDisplayRule] */ public function getDisplayRules() { return $this->_display_rules; } /** * Gets the scope of the block. * * @return string */ public function getDisplayScope() { return $this->_display_scope; } /** * Gets the expected message for the block. * * @return string */ public function getExpectedMessage() { return $this->_expected_msg; } }
php-extended/php-gmth-fgfr-api
src/GmthApiGrilleBloc.php
PHP
mit
4,661
/* * Open Payments Cloud Application API * Open Payments Cloud API * * OpenAPI spec version: 1.0.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package com.ixaris.ope.applications.client.model; import java.util.Objects; import com.google.gson.annotations.SerializedName; import com.ixaris.ope.applications.client.model.Transfer; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; /** * Transfers */ @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2017-08-30T15:46:40.836+02:00") public class Transfers { @SerializedName("transfers") private List<Transfer> transfers = new ArrayList<Transfer>(); @SerializedName("count") private Integer count = null; /** * Gets or Sets actions */ public enum ActionsEnum { @SerializedName("CREATE") CREATE("CREATE"); private String value; ActionsEnum(String value) { this.value = value; } @Override public String toString() { return String.valueOf(value); } } @SerializedName("actions") private List<ActionsEnum> actions = new ArrayList<ActionsEnum>(); public Transfers transfers(List<Transfer> transfers) { this.transfers = transfers; return this; } public Transfers addTransfersItem(Transfer transfersItem) { this.transfers.add(transfersItem); return this; } /** * Get transfers * @return transfers **/ @ApiModelProperty(example = "null", value = "") public List<Transfer> getTransfers() { return transfers; } public void setTransfers(List<Transfer> transfers) { this.transfers = transfers; } public Transfers count(Integer count) { this.count = count; return this; } /** * The total number of entries that match the given filter, including any entries which were not returned due to paging constraints. * @return count **/ @ApiModelProperty(example = "null", value = "The total number of entries that match the given filter, including any entries which were not returned due to paging constraints.") public Integer getCount() { return count; } public void setCount(Integer count) { this.count = count; } public Transfers actions(List<ActionsEnum> actions) { this.actions = actions; return this; } public Transfers addActionsItem(ActionsEnum actionsItem) { this.actions.add(actionsItem); return this; } /** * The actions that can be performed on this particular resource instance. * @return actions **/ @ApiModelProperty(example = "null", value = "The actions that can be performed on this particular resource instance.") public List<ActionsEnum> getActions() { return actions; } public void setActions(List<ActionsEnum> actions) { this.actions = actions; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Transfers transfers = (Transfers) o; return Objects.equals(this.transfers, transfers.transfers) && Objects.equals(this.count, transfers.count) && Objects.equals(this.actions, transfers.actions); } @Override public int hashCode() { return Objects.hash(transfers, count, actions); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Transfers {\n"); sb.append(" transfers: ").append(toIndentedString(transfers)).append("\n"); sb.append(" count: ").append(toIndentedString(count)).append("\n"); sb.append(" actions: ").append(toIndentedString(actions)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
ixaris/ope-applicationclients
java-client/src/main/java/com/ixaris/ope/applications/client/model/Transfers.java
Java
mit
4,201
# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # database schema. If you need to create the application database on another # system, you should be using db:schema:load, not running all the migrations # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema.define(version: 20150721000159) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" create_table "currencies", force: :cascade do |t| t.string "name" t.string "abbrev" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "image" end create_table "exchange_requests", force: :cascade do |t| t.integer "amount_cents" t.float "exchange_rate" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "to_currency_id" t.integer "from_currency_id" end end
nevern02/bread_exchange
db/schema.rb
Ruby
mit
1,409
import {loadGenders} from '../../services/masterdata'; // load here all your reference lists export default [ { name: 'genders', service: loadGenders }, { name: 'scopes', service: () => { return Promise.resolve( //here call your webservice to get scope references [ {code: 'ALL', label: 'search.scope.all'}, {code: 'movie', label: 'search.scope.movie'}, {code: 'person', label: 'search.scope.person'} ] ).then(scopes => { //here define application icons scopes.map(_applyAdditionalScopeProperties); return scopes ; }); } } ]; function _applyAdditionalScopeProperties(scope) { switch (scope.code) { case 'ALL': scope.icon = 'all_inclusive'; break; case 'movie': scope.icon = 'movie' break; case 'person': scope.icon = 'person'; break; default: scope.icon = 'mood_bad' break; } };
get-focus/focus-demo-app
app/config/master-datas/index.js
JavaScript
mit
1,146
<!doctype html> <html class="no-js" lang="ar" dir="rtl"> <head> <meta charset="utf-8"> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui"> <title>Simple HTML Template</title> <!-- build:css assets/css/main.css --> <!-- bower:css --> <link rel="stylesheet" href="../bower_components/fontawesome/css/font-awesome.css" /> <link rel="stylesheet" href="styles/main.css"> <!-- endbower --> <!-- endbuild --> <link rel="stylesheet" href="http://fonts.googleapis.com/earlyaccess/droidarabickufi.css"> <!-- build:js assets/js/modernizr.js --> <script src="../bower_components/modernizr/modernizr.js"></script> <!-- endbuild --> </head> <body> <header class="container"> <div class="row"> <div class="large-12 columns"> <h1 class="logo">ุนู†ูˆุงู† ุงู„ู…ูˆู‚ุน</h1> </div> <div class="large-8 right columns"> <nav class="top-bar" data-topbar role="navigation"> <ul class="title-area right"> <li class="toggle-topbar menu-icon"><a href="#"><span></span></a></li> </ul> <section class="top-bar-section"> <ul class="right"> <li><a href="#">ู…ู†ูˆุนุงุช</a></li> <li><a href="#">ุชู‚ู†ูŠ</a></li> <li><a href="#">ุดุฎุตูŠ</a></li> <li><a href="#">ุชู†ู…ูŠุฉ</a></li> <li><a href="#">ุตูˆุฑ ูˆููŠุฏูŠูˆ</a></li> </ul> </section> </nav> </div> <div class="large-4 columns"> <form action=""> <div class="row"> <div class="large-12 columns"> <div class="row collapse"> <div class="small-2 columns"> <a href="#" class="button postfix"><i class="fa fa-search fa-lg"></i></a> </div> <div class="small-10 columns"> <input type="text" placeholder="ุจุญุซ"> </div> </div> </div> </div> </form> </div> </div> </header> <div class="main-content"> <div class="row"> <div class="large-8 right columns news"> <div class="row"> <div class="medium-12 columns"> <article class="card"> <h1>ุฃุฑุดูŠู ุงู„ู…ู‚ุงู„ุงุช</h1> </article> </div> <div class="medium-6 columns"> <article class="card"> <header> <h1>Post title</h1> </header> <div class="date">4 ูƒุงู†ูˆู† ุงู„ุฃูˆู„ 2014</div> <p>ุฎู„ุงูุงูŽ ู„ู„ุงุนุชู‚ุงุฏ <a href="#">ุงู„ุณุงุฆุฏ</a> ูุฅู† ู„ูˆุฑูŠู… ุฅูŠุจุณูˆู… ู„ูŠุณ ู†ุตุงูŽ ุนุดูˆุงุฆูŠุงู‹ุŒ ุจู†ุฐ ุงู„ุนุงู… 45 ู‚ุจู„ ุงู„ู…ูŠู„ุงุฏุŒ ู…ู…ุง ูŠุฌุนู„ู‡ ุฃูƒุซุฑ ู…ู† 2000 ุนุงู… ููŠ ุงู„ู‚ุฏู…. ู‚ุงู… ุงู„ุจุฑูˆููŠุณูˆุฑ "ุฑูŠุชุดุงุฑุฏ ู…ุงูƒ ู„ูŠู†ุชูˆูƒ" (Richard McClintock) ูˆู‡ูˆ ุจุฑูˆููŠุณูˆุฑ ุงู„ู„ุบุฉ ุงู„ู„ุงุชูŠู†ูŠุฉ ููŠ ุฌุงู…ุนุฉ ู‡ุงู…ุจุฏู†-ุณูŠุฏู†ูŠ ููŠ ููŠุฑุฌูŠู†ูŠุง ุจุงู„ุจุญุซ ุนู† ุฃุตูˆู„ ูƒู„ู…ุฉ ู„ุงุชูŠู†ูŠุฉ ุบุงู…ุถุฉ ููŠ ู†ุต ู„ูˆุฑูŠู… ุฅูŠุจุณูˆู… ูˆู‡ูŠ "consectetur"ุŒ ูˆุฎู„ุงู„ ุชุชุจุนู‡ ู„ู‡ุฐู‡ ุงู„ูƒู„ู…ุฉ ููŠ ุงู„ุฃุฏุจ ุงู„ู„ุงุชูŠู†ูŠ ุงูƒุชุดู ุงู„ู…ุตุฏุฑ ุงู„ุบูŠุฑ ู‚ุงุจู„ ู„ู„ุดูƒ. ูู„ู‚ุฏ ุงุชุถุญ ุฃู† ูƒู„ู…ุงุช ู†ุต ู„ูˆุฑูŠู… ุฅูŠุจุณูˆู… ุชุฃุชูŠ ู…ู† ุงู„ุฃู‚ุณุงู… 1.10.32 ูˆ 1.10.33 ู…ู† ูƒุชุงุจ </p> <div class="read-more text-left"> <a href="#">ุชุงุจุน ู‚ุฑุงุกุฉ ุงู„ู…ู‚ุงู„ &raquo;</a> </div> <footer class="tags"> <span class="label">ุชู‚ู†ูŠ</span> <span class="label">ุชู†ู…ูŠุฉ</span> <span class="label">ู…ู†ูˆุนุงุช</span> </footer> </article> </div> <div class="medium-6 columns"> <article class="card"> <header> <h1>Post title</h1> </header> <div class="date">4 ูƒุงู†ูˆู† ุงู„ุฃูˆู„ 2014</div> <p>ุฎู„ุงูุงูŽ ู„ู„ุงุนุชู‚ุงุฏ <a href="#">ุงู„ุณุงุฆุฏ</a> ูุฅู† ู„ูˆุฑูŠู… ุฅูŠุจุณูˆู… ู„ูŠุณ ู†ุตุงูŽ ุนุดูˆุงุฆูŠุงู‹ุŒ ุจู†ุฐ ุงู„ุนุงู… 45 ู‚ุจู„ ุงู„ู…ูŠู„ุงุฏุŒ ู…ู…ุง ูŠุฌุนู„ู‡ ุฃูƒุซุฑ ู…ู† 2000 ุนุงู… ููŠ ุงู„ู‚ุฏู…. ู‚ุงู… ุงู„ุจุฑูˆููŠุณูˆุฑ "ุฑูŠุชุดุงุฑุฏ ู…ุงูƒ ู„ูŠู†ุชูˆูƒ" (Richard McClintock) ูˆู‡ูˆ ุจุฑูˆููŠุณูˆุฑ ุงู„ู„ุบุฉ ุงู„ู„ุงุชูŠู†ูŠุฉ ููŠ ุฌุงู…ุนุฉ ู‡ุงู…ุจุฏู†-ุณูŠุฏู†ูŠ ููŠ ููŠุฑุฌูŠู†ูŠุง ุจุงู„ุจุญุซ ุนู† ุฃุตูˆู„ ูƒู„ู…ุฉ ู„ุงุชูŠู†ูŠุฉ ุบุงู…ุถุฉ ููŠ ู†ุต ู„ูˆุฑูŠู… ุฅูŠุจุณูˆู… ูˆู‡ูŠ "consectetur"ุŒ ูˆุฎู„ุงู„ ุชุชุจุนู‡ ู„ู‡ุฐู‡ ุงู„ูƒู„ู…ุฉ ููŠ ุงู„ุฃุฏุจ ุงู„ู„ุงุชูŠู†ูŠ ุงูƒุชุดู ุงู„ู…ุตุฏุฑ ุงู„ุบูŠุฑ ู‚ุงุจู„ ู„ู„ุดูƒ. ูู„ู‚ุฏ ุงุชุถุญ ุฃู† ูƒู„ู…ุงุช ู†ุต ู„ูˆุฑูŠู… ุฅูŠุจุณูˆู… ุชุฃุชูŠ ู…ู† ุงู„ุฃู‚ุณุงู… 1.10.32 ูˆ 1.10.33 ู…ู† ูƒุชุงุจ </p> <div class="read-more text-left"> <a href="#">ุชุงุจุน ู‚ุฑุงุกุฉ ุงู„ู…ู‚ุงู„ &raquo;</a> </div> <footer class="tags"> <span class="label">ุชู‚ู†ูŠ</span> <span class="label">ุชู†ู…ูŠุฉ</span> </footer> </article> </div> </div> <div class="row"> <div class="medium-12 columns"> <ul class="pagination"> <li class="arrow unavailable"><a href="">&laquo;</a></li> <li class="current"><a href="">1</a></li> <li><a href="">2</a></li> <li><a href="">3</a></li> <li><a href="">4</a></li> <li class="unavailable"><a href="">&hellip;</a></li> <li><a href="">12</a></li> <li><a href="">13</a></li> <li class="arrow"><a href="">&raquo;</a></li> </ul> </div> </div> </div> <div class="large-4 columns sidebar"> <div class="card"> Sidebar </div> </div> </div> </div> <div class="site-footer"> <div class="row"> <div class="medium-12 columns"> No rights reserved <a href="http://aalakkad.me" target="_blank">Ammar Alakkad</a> 2014 </div> </div> </div> <!-- build:js assets/js/vendor.js --> <!-- bower:js --> <script src="../bower_components/jquery/dist/jquery.js"></script> <script src="../bower_components/fastclick/lib/fastclick.js"></script> <script src="../bower_components/jquery.cookie/jquery.cookie.js"></script> <script src="../bower_components/jquery-placeholder/jquery.placeholder.js"></script> <script src="../bower_components/foundation/js/foundation.min.js"></script> <!-- endbower --> <!-- endbuild --> <script> $(document).ready(function(){ $(document).foundation(); }); </script> </body> </html>
AAlakkad/Simple-Template
app/archive.html
HTML
mit
8,141
<!DOCTYPE html> <html class="no-js"> <head> <meta charset="utf-8"> <title>Blog | Bootaide</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <link rel="shortcut icon" href="/favicon.ico"> <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css" /> <link rel="stylesheet" href="bower_components/animate.css/animate.min.css" /> <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css" /> <link rel="stylesheet" href="bower_components/simple-line-icons/css/simple-line-icons.css" /> <link rel="stylesheet" href="bower_components/fontface-source-sans-pro/css/source-sans-pro.min.css"/> <link rel="stylesheet" href="dist/css/bootaide.min.css" /> </head> <body> <!--[if lt IE 10]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <header class="bg-white navbar-fixed-top box-shadow"> <div class="container"> <div class="navbar-header"> <button class="btn btn-link visible-xs pull-right m-r m-t-sm" type="button" data-toggle="collapse" data-target=".navbar-collapse"> <i class="fa fa-bars"></i> </button> <a href="." class="navbar-brand m-r-lg"><img src="img/logo.png" class="m-r-sm hide"><span class="h3 font-bold">Bootaide</span></a> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav navbar-right"> <li class="hide"> <a href=".">Home</a> </li> <li> <a href="start.html">Start</a> </li> <li> <a href="css.html">CSS</a> </li> <li> <a href="typo.html">Typo</a> </li> <li> <a href="components.html">Components</a> </li> <li> <a href="ui-kit.html">UI Kit</a> </li> <li class="dropdown active"> <a href data-toggle="dropdown">Hello <i class="fa fa-caret-down"></i></a> <!-- dropdown --> <ul class="dropdown-menu w p-t"> <li> <a href="typography.html">Typography</a> </li> <li> <a href="progress-bar.html">Progress-bar</a> </li> <li> <a href="seperators.html"> <span class="badge bg-success pull-right">NEW</span> <span>Separators</span> </a> </li> <li> <a href="pricing.html">Pricing</a> </li> <li> <a href="says.html">Says</a> </li> <li> <a href="form.html"> <span class="label bg-info pull-right">valid</span> Form </a> </li> <li class="active"> <a href="blog.html">Blog</a> </li> <li> <a href="parallax.html">Parallax</a> </li> <li> <a href="chat.html"> <span class="badge bg-light pull-right">NEW</span> Chat</a> </li> <li> <a href="photoswipe.html">PhotoSwipe</a> </li> <li> <a href="video.html">Video</a> </li> <li class="divider"></li> <li> <a href="themeaide.html" target="_blank">Themeaide</a> </li> <li> <a href="personal-bio.html">Personal Bio</a> </li> </ul> <!-- / dropdown --> </li> </ul> </div> </div> </header> <section class="bg-info"> <div class="container"> <div class="row"> <div class="col-sm-8 col-sm-offset-2 p-v-xxl text-center"> <h1 class="h1 m-t-xxl p-v-xxl">Blog</h1> </div> </div> </div> </section> <section class="p-v-xxl bg-light"> <div class="container"> <div class="row"> <!--blog post --> <div class="col-sm-8"> <!--post --> <div class="panel"> <div class="item img-bg img-info"> <div class="top wrapper-lg w-full"> <div class="pull-right m-t-xxs"> <a href="" class="m-r-sm text-white"><i class="fa fa-heart-o"></i> 36K</a> <a href="" class="text-white"><i class="icon-eye"></i> 313K</a> </div> <div class="clear m-b"> <a class="pull-left thumb-xxs m-r-sm" herf=""> <img src="imgs/a0.jpg" alt="..." class="img-full img-circle"> </a> <div class="clear m-t-xs p-t-2x"> <p class="h6"> <a href="" class="text-white">Gifaree Evan</a></p> </div> </div> </div> <div class="bottom wrapper-lg w-full"> <h4 class="h4 text-inline"><a class="text-white" href>Its her love which made me having my beer sitting on the moon</a></h4> <small class="text-light">5 minutes ago</small> </div> <img class="img-full" src="imgs/c6.jpg" /> </div> <div class="wrapper b-b"> <p class="m-b-none"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi id neque quam. Aliquam sollicitudin venenatis ipsum ac feugiat. Vestibulum ullamcorper sodales nisi nec condimentum. Mauris convallis mauris at pellentesque volutpat. </p> </div> <div class="wrapper-lg"> <a href="" class="m-r-xl"><span>23</span> Comments</a> <a href=""><span>434</span> Shares</a> <a class="pull-right" href=""><i class="icon-speech fa-2x text-muted pos-abt m-l-n-xs"></i> <span class="m-l-xl">leave a comment</span></a> </div> </div> <!--/ post --> <div class="panel"> <div class="item img-bg img-primary"> <div class="top wrapper-lg w-full"> <div class="pull-right m-t-xxs"> <a href="" class="m-r-sm text-white"><i class="fa fa-heart-o"></i> 29K</a> <a href="" class="text-white"><i class="icon-eye"></i> 113K</a> </div> <div class="clear m-b"> <a class="pull-left thumb-xxs m-r-sm" herf=""> <img src="imgs/a1.jpg" alt="..." class="img-full img-circle"> </a> <div class="clear m-t-xs p-t-2x"> <p class="h6"> <a href="" class="text-white">Hasin Hayder</a></p> </div> </div> </div> <div class="bottom wrapper-lg w-full"> <h4 class="h4 text-inline"><a class="text-white" href>Its her love which made me having my beer sitting on the moon</a></h4> <small class="text-light">1 day ago</small> </div> <img class="img-full" src="imgs/c8.jpg" /> </div> <div class="wrapper b-b"> <p class="m-b-none"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi id neque quam. Aliquam sollicitudin venenatis ipsum ac feugiat. Vestibulum ullamcorper sodales nisi nec condimentum. Mauris convallis mauris at pellentesque volutpat. </p> </div> <div class="wrapper-lg"> <a href="" class="m-r-xl"><span>353</span> Comments</a> <a href=""><span>64</span> Shares</a> <a class="pull-right" href=""><i class="icon-speech fa-2x text-muted pos-abt m-l-n-xs"></i> <span class="m-l-xl">leave a comment</span></a> </div> </div> <div class="panel"> <div class="item img-bg img-success"> <div class="top wrapper-lg w-full"> <div class="pull-right m-t-xxs"> <a href="" class="m-r-sm text-white"><i class="fa fa-heart-o"></i> 29K</a> <a href="" class="text-white"><i class="icon-eye"></i> 113K</a> </div> <div class="clear m-b"> <a class="pull-left thumb-xxs m-r-sm" herf=""> <img src="imgs/a2.jpg" alt="..." class="img-full img-circle"> </a> <div class="clear m-t-xs p-t-2x"> <p class="h6"> <a href="" class="text-white">Natai Baba</a></p> </div> </div> </div> <div class="bottom wrapper-lg w-full"> <h4 class="h4 text-inline"><a class="text-white" href>Its her love which made me having my beer sitting on the moon</a></h4> <small class="text-light">3 days ago</small> </div> <img class="img-full" src="imgs/c9.jpg" /> </div> <div class="wrapper b-b"> <p class="m-b-none"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi id neque quam. Aliquam sollicitudin venenatis ipsum ac feugiat. Vestibulum ullamcorper sodales nisi nec condimentum. Mauris convallis mauris at pellentesque volutpat. </p> </div> <div class="wrapper-lg"> <a href="" class="m-r-xl"><span>23</span> Comments</a> <a href=""><span>434</span> Shares</a> <a class="pull-right" href=""><i class="icon-speech fa-2x text-muted pos-abt m-l-n-xs"></i> <span class="m-l-xl">leave a comment</span></a> </div> </div> <div class="panel"> <div class="item img-bg img-danger"> <div class="top wrapper-lg w-full"> <div class="pull-right m-t-xxs"> <a href="" class="m-r-sm text-white"><i class="fa fa-heart-o"></i> 29K</a> <a href="" class="text-white"><i class="icon-eye"></i> 113K</a> </div> <div class="clear m-b"> <a class="pull-left thumb-xxs m-r-sm" herf=""> <img src="imgs/a4.jpg" alt="..." class="img-full img-circle"> </a> <div class="clear m-t-xs p-t-2x"> <p class="h6"> <a href="" class="text-white">Storyteller</a></p> </div> </div> </div> <div class="bottom wrapper-lg w-full"> <h4 class="h4 text-inline"><a class="text-white" href>Its her love which made me having my beer sitting on the moon</a></h4> <small class="text-light">14 May 2015</small> </div> <img class="img-full" src="imgs/c10.jpg" /> </div> <div class="wrapper b-b"> <p class="m-b-none"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi id neque quam. Aliquam sollicitudin venenatis ipsum ac feugiat. Vestibulum ullamcorper sodales nisi nec condimentum. Mauris convallis mauris at pellentesque volutpat. </p> </div> <div class="wrapper-lg"> <a href="" class="m-r-xl"><span>23</span> Comments</a> <a href=""><span>434</span> Shares</a> <a class="pull-right" href=""><i class="icon-speech fa-2x text-muted pos-abt m-l-n-xs"></i> <span class="m-l-xl">leave a comment</span></a> </div> </div> <div class="panel"> <div class="item img-bg img-warning"> <div class="top wrapper-lg w-full"> <div class="pull-right m-t-xxs"> <a href="" class="m-r-sm text-white"><i class="fa fa-heart-o"></i> 29K</a> <a href="" class="text-white"><i class="icon-eye"></i> 113K</a> </div> <div class="clear m-b"> <a class="pull-left thumb-xxs m-r-sm" herf=""> <img src="imgs/a5.jpg" alt="..." class="img-full img-circle"> </a> <div class="clear m-t-xs p-t-2x"> <p class="h6"> <a href="" class="text-white">Tutul Chowdhury</a></p> </div> </div> </div> <div class="bottom wrapper-lg w-full"> <h4 class="h4 text-inline"><a class="text-white" href>Its her love which made me having my beer sitting on the moon</a></h4> <small class="text-light">1 Years ago</small> </div> <img class="img-full" src="imgs/c13.jpg" /> </div> <div class="wrapper b-b"> <p class="m-b-none"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi id neque quam. Aliquam sollicitudin venenatis ipsum ac feugiat. Vestibulum ullamcorper sodales nisi nec condimentum. Mauris convallis mauris at pellentesque volutpat. </p> </div> <div class="wrapper-lg"> <a href="" class="m-r-xl"><span>23</span> Comments</a> <a href=""><span>434</span> Shares</a> <a class="pull-right" href=""><i class="icon-speech fa-2x text-muted pos-abt m-l-n-xs"></i> <span class="m-l-xl">leave a comment</span></a> </div> </div> <div class="text-center m-t-lg m-b-lg"> <ul class="pagination pagination-md"> <li> <a href="#" aria-label="Previous"> <i class="icon-control-start"></i> </a> </li> <li class="active"><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li> <a href="#" aria-label="Next"> <i class="icon-control-end"></i> </a> </li> </ul> </div> <div class=""> <h4 class="font-thin">3 Comments</h4> <div class="media"> <div class="media-left"> <a class="thumb-sm" href> <img class="media-object img-circle" src="imgs/a0.jpg"> </a> </div> <div class="media-body"> <a href class="media-heading text-dark font-semi-bold">Gifaree Evan <span class="label bg-success">Admin</span></a> <small class="clear m-b-sm">40 minutes ago</small> <p> Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus. </p> <small class="clear"><a class="text-muted" href> Like </a> . <a class="text-muted" href> Reply </a></small> </div> </div> <div class="media"> <div class="media-left"> <a class="thumb-sm" href> <img class="media-object img-circle" src="imgs/a1.jpg"> </a> </div> <div class="media-body"> <a href class="media-heading text-dark font-semi-bold">Hasin Hayder</a> <small class="clear m-b-sm">21 minutes ago</small> <p> Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at. </p> <small class="clear"><a class="text-muted" href> Like </a> . <a class="text-muted" href> Reply </a></small> <div class="media"> <div class="media-left"> <a class="thumb-sm" href> <img class="media-object img-circle" src="imgs/a0.jpg"> </a> </div> <div class="media-body"> <a href class="media-heading text-dark font-semi-bold">Gifaree Evan <span class="label bg-success">Admin</span></a> <small class="clear m-b-sm">18 minutes ago</small> <p> Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at. </p> <small class="clear"><a class="text-muted" href> Like </a> . <a class="text-muted" href> Reply </a></small> </div> </div> </div> </div> <div class="media"> <div class="media-left"> <a class="thumb-sm" href> <img class="media-object img-circle" src="imgs/a2.jpg"> </a> </div> <div class="media-body"> <a href class="media-heading text-dark font-semi-bold">Natai Baba</a> <small class="clear m-b-sm">20 minutes ago</small> <p> Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at. </p> <small class="clear"><a class="text-muted" href> Like </a> . <a class="text-muted" href> Reply </a></small> </div> </div> <div class="m-t-xxl"> <h3>Leave a comment</h3> <form> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Name</label> <input class="form-control" placeholder="Name" type="text"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Email</label> <input class="form-control" placeholder="Email" type="email"> </div> </div> </div> <div class="form-group"> <label>Message</label> <textarea class="form-control" name="message" placeholder="Write your message" rows="4"></textarea> </div> <div class="form-group"> <button type="submit" class="btn btn-primary"> Send Message </button> </div> </form> </div> </div> </div> <!--/ blog post --> <!--blog sidebar --> <div class="col-sm-4"> <div class="panel wrapper-xxl bg-offWhite"> <h5 class="m-t-none m-b-lg">Categories</h5> <div class=""> <a href=""> <span class="badge pull-right bg-light dker">15</span> Photograph </a> </div> <div class="line-sm b-b"></div> <div class=""> <a href=""> <span class="badge pull-right bg-light dker">30</span> Life style </a> </div> <div class="line-sm b-b"></div> <div class=""> <a href=""> <span class="badge pull-right bg-light dker">9</span> Food </a> </div> <div class="line-sm b-b"></div> <div class=""> <a href=""> <span class="badge pull-right bg-light dker">4</span> Travel world </a> </div> </div> <div class="panel wrapper-xxl bg-offWhite"> <h5 class="m-t-none m-b-lg">Tags</h5> <div class="tags l-h-2x"> <a href="" class="label bg-warning">Bootstrap</a> <a href="" class="label bg-info">Application</a> <a href="" class="label bg-danger">Apple</a> <a href="" class="label bg-success">Less</a> <a href="" class="label bg-primary">Theme</a> <a href="" class="label bg-dark">Wordpress</a> </div> </div> <div class="panel wrapper-xxl bg-offWhite"> <h5 class="m-t-none m-b-lg">Popular Post</h5> <div class=""> <a herf="" class="pull-left thumb-md b m-r-sm"> <img src="imgs/c0.jpg" alt="..." class="img-full"> </a> <div class="clear"> <a href="" class="text-info text-ellipsis">Star Kabab &amp; Restaurant</a> <small class="block text-muted">2 hours ago</small> </div> </div> <div class="line-sm"></div> <div class=""> <a herf="" class="pull-left thumb-md b m-r-sm"> <img src="imgs/c1.jpg" alt="..." class="img-full"> </a> <div class="clear"> <a href="" class="text-info text-ellipsis">London Plaza</a> <small class="block text-muted">2 hours ago</small> </div> </div> <div class="line-sm"></div> <div class=""> <a herf="" class="pull-left thumb-md b m-r-sm"> <img src="imgs/c2.jpg" alt="..." class="img-full"> </a> <div class="clear"> <a href="" class="text-info text-ellipsis">Long text looks cute as a title</a> <small class="block text-muted">2 hours ago</small> </div> </div> </div> </div> <!--/ blog sidebar --> </div> </div> </section> <footer class="bg-dark"> <div class="container"> <div class="row p-v m-t-md text-center"> <p class="m-b-none"> Build with <i class="fa fa-heart-o m-h-2x"></i> by <a href="https://www.facebook.com/zafree" target="_blank"> Zafree</a> </p> <p> Code licensed under <a href="https://github.com/zafree/bootaide/blob/master/LICENSE">MIT</a>, documentation under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>. </p> <p> 2015 &copy; Bootaide </p> </div> </div> </footer> <script src="bower_components/jquery/dist/jquery.min.js"></script> <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="bower_components/headroom.js/dist/headroom.min.js"></script> <script src="dist/js/bootaide.min.js"></script> </body> </html>
zafree/bootaide
blog.html
HTML
mit
20,325
/************************************************************************************************/ /** * @file KsColorReal.cpp * @brief ยƒJยƒย‰ย[ * @author A567W * @date 2008/02/06 * @since 2008/02/06 * @version 1.0.0 */ /************************************************************************************************/ /*==============================================================================================*/ /* << ยƒCยƒย“ยƒNยƒย‹ย[ยƒh >> */ /*==============================================================================================*/ #include "KsColor.h" #include "KsColorReal.h" /*==============================================================================================*/ /* << ย’รจย‹` >> */ /*==============================================================================================*/ /*==============================================================================================*/ /* << ยรฉยŒยพ >> */ /*==============================================================================================*/ ksNS_KS_BEGIN const KsColorReal KsColorReal::RED( 1.0f, 0.0f, 0.0f, 1.0f ); const KsColorReal KsColorReal::GREEN( 0.0f, 1.0f, 0.0f, 1.0f ); const KsColorReal KsColorReal::BLUE( 0.0f, 0.0f, 1.0f, 1.0f ); const KsColorReal KsColorReal::YELLOW( 1.0f, 1.0f, 0.0f, 1.0f ); const KsColorReal KsColorReal::WHITE( 1.0f, 1.0f, 1.0f, 1.0f ); const KsColorReal KsColorReal::BLACK( 0.0f, 0.0f, 0.0f, 1.0f ); /************************************************************************************************/ /* * */ /************************************************************************************************/ KsColorReal& KsColorReal::operator = ( const KsColor& refColor ) { KsInt32 inv = 1 / 255; set( ( KsReal )( inv*refColor.getRed() ), ( KsReal )( inv*refColor.getGreen() ), ( KsReal )( inv*refColor.getBlue() ), ( KsReal )( inv*refColor.getAlpha() ) ); return ( *this ); } ksNS_KS_END
a567w/Aria
Aria/graphics/KsColorReal.cpp
C++
mit
2,169
package utils import ( "crypto/rand" "encoding/json" "io/ioutil" "net/http" "net/url" "app/config" "github.com/stathat/go" "golang.org/x/net/context" "google.golang.org/appengine" "google.golang.org/appengine/log" "google.golang.org/appengine/urlfetch" ) func genRand(dict string, n int) string { var bytes = make([]byte, n) rand.Read(bytes) for k, v := range bytes { bytes[k] = dict[v%byte(len(dict))] } return string(bytes) } //GenKey returns a randomly generated 64 character string, using only //alphanumeric characters and a small selection of special characters. func GenKey() string { dict := "ABCDEFGHIJKLMNOPQRSTUVWXYZ" dict += "abcdefghijklmnopqrstuvwxyz" dict += "1234567890=+~-" return genRand(dict, 64) } //GenSlug returns a randomly generated 6 character alphanumeric string. func GenSlug() string { dict := "ABCDEFGHIJKLMNOPQRSTUVWXYZ" dict += "1234567890" dict += "abcdefghijklmnopqrstuvwxyz" return genRand(dict, 6) } //PostValue sends a value stat to the configured StatHat account. func PostValue(c context.Context, key string, value float64) { rt := urlfetch.Client(c).Transport cnfg := config.Load(c) stathat.DefaultReporter = stathat.NewReporter(100000, 10, rt) if appengine.IsDevAppServer() { key = key + " [DEV]" } if err := stathat.PostEZValue(key, cnfg["stathatKey"], value); err != nil { log.Errorf(c, "Error posting %v value %v to stathat: %v", key, value, err) } } //PostCount sends a count stat to the configured StatHat account. func PostCount(c context.Context, key string, count int) { rt := urlfetch.Client(c).Transport cnfg := config.Load(c) stathat.DefaultReporter = stathat.NewReporter(100000, 10, rt) if appengine.IsDevAppServer() { key = key + " [DEV]" } if err := stathat.PostEZCount(key, cnfg["stathatKey"], count); err != nil { log.Errorf(c, "Error posting %v value %v to stathat: %v", key, count, err) } } //VerifyCaptcha verifies the supplied values are a valid solved captcha. //Read the required parameters in the reCAPTCHA documentation, found //here: https://developers.google.com/recaptcha/docs/verify func VerifyCaptcha(c context.Context, vals map[string]string) bool { cnfg := config.Load(c) client := urlfetch.Client(c) uri, _ := url.Parse("https://www.google.com/recaptcha/api/siteverify") q := url.Values{} q.Add("secret", cnfg["captchaPrivate"]) for k := range vals { q.Add(k, vals[k]) } uri.RawQuery = q.Encode() req, _ := http.NewRequest("GET", uri.String(), nil) resp, err := client.Do(req) if err != nil { log.Errorf(c, "got err: %v", err) return false } body, _ := ioutil.ReadAll(resp.Body) var data map[string]interface{} json.Unmarshal(body, &data) return data["success"].(bool) }
AustinDizzy/davine
app/utils/utils.go
GO
mit
2,725
package relay // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/tracing" "net/http" ) // OperationsClient is the use these API to manage Azure Relay resources through Azure Resources Manager. type OperationsClient struct { BaseClient } // NewOperationsClient creates an instance of the OperationsClient client. func NewOperationsClient(subscriptionID string) OperationsClient { return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this // when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List lists all of the available Relay REST API operations. func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { sc := -1 if result.olr.Response.Response != nil { sc = result.olr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "relay.OperationsClient", "List", nil, "Failure preparing request") return } resp, err := client.ListSender(req) if err != nil { result.olr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "relay.OperationsClient", "List", resp, "Failure sending request") return } result.olr, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "relay.OperationsClient", "List", resp, "Failure responding to request") return } if result.olr.hasNextLink() && result.olr.IsEmpty() { err = result.NextWithContext(ctx) return } return } // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { const APIVersion = "2016-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), autorest.WithPath("/providers/Microsoft.Relay/operations"), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always // closes the http.Response Body. func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } // listNextResults retrieves the next set of results, if any. func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { req, err := lastResults.operationListResultPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "relay.OperationsClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return } resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} return result, autorest.NewErrorWithError(err, "relay.OperationsClient", "listNextResults", resp, "Failure sending next results request") } result, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "relay.OperationsClient", "listNextResults", resp, "Failure responding to next results request") } return } // ListComplete enumerates all values, automatically crossing page boundaries as required. func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { sc = result.page.Response().Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() } result.page, err = client.List(ctx) return }
Azure/azure-sdk-for-go
services/relay/mgmt/2016-07-01/relay/operations.go
GO
mit
5,136
package konstructs.api; /** * This class represents an event ID. An event ID should follow the same rules as a {@link BlockTypeId}. */ public class EventTypeId { private final String namespace; private final String name; /** * Create a new immutable EventTypeId from a name string. A name * string consist of the namespace appended with a / and then the * name, e.g. namespace "org/konstructs" and name "removed" would * become "org/konstructs/removed". The name of an event type always * begins with a lower case letter. * @param id the block id to be parsed for * @return a new immutable EventTypeId */ public static EventTypeId fromString(String id) { int lastSlash = id.lastIndexOf('/'); String namespace = id.substring(0, lastSlash); String name = id.substring(lastSlash + 1); return new EventTypeId(namespace, name); } /** * Creates a new immutable event type id. * Name must start with a lower case letter. * @param namespace The namespace of this EventTypeId * @param name The name of this block type id (must begin with a lower case letter) */ public EventTypeId(String namespace, String name) { if(name.length() == 0 || namespace.length() == 0) { throw new IllegalArgumentException("Name and namespace must not be empty string"); } if(Character.isUpperCase(name.charAt(0))) { throw new IllegalArgumentException("First character of event type name must be lower case"); } this.namespace = namespace; this.name = name; } /** * Returns the namespace of this EventTypeId * @return the namespace * @see BlockClassId */ public String getNamespace() { return namespace; } /** * Returns the name of this EventTypeId * @return the name */ public String getName() { return name; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; EventTypeId that = (EventTypeId) o; if (!namespace.equals(that.namespace)) return false; return name.equals(that.name); } @Override public int hashCode() { int result = namespace.hashCode(); result = 31 * result + name.hashCode(); return result; } @Override public String toString() { return "EventTypeId(" + "namespace='" + namespace + '\'' + ", name='" + name + '\'' + ')'; } }
konstructs/server-api
src/main/java/konstructs/api/EventTypeId.java
Java
mit
2,637