text:
/* DSblock model generated by Dymola from Modelica model componentz.ThermTB
 Dymola Version 2014 (64-bit), 2013-03-25 translated this at Fri Sep 27 11:59:28 2013

   */

#include <matrixop.h>
/* Declaration of C-structs */
/* Prototypes for functions used in model */
/* Codes used in model */
/* DSblock C-code: */

#include <moutil.c>
PreNonAliasDef(0)
PreNonAliasDef(1)
DYMOLA_STATIC const char*modelName="componentz.ThermTB";
DYMOLA_STATIC const char*usedLibraries[]={0};
DYMOLA_STATIC const char*dllLibraryPath[]={0};
DYMOLA_STATIC const char*default_dymosim_license_filename=
 "c:/users/ted/appdata/roaming/dynasim/dymola.lic";
#include <dsblock1.c>

/* Define variable names. */

#define Sections_

TranslatedEquations

BoundParameterSection
InitialSection
#if defined(DynSimStruct) || defined(BUILDFMU)
F_[0] = 0;
F_[1] = 0;
#endif
InitialSection
DefaultSection
InitializeData(0)
InitialSection
InitialSection
Init=false;InitializeData(2);Init=true;
EndInitialSection

OutputSection

DynamicsSection
W_[1] = X_[1]-X_[0];
W_[0] = DP_[1]*W_[1];
 /* Linear system of equations to solve. */
F_[0] = RememberSimple_(F_[0], 0);
SolveScalarLinearParametric(DP_[0],"term_edited.heatCapacitor.C", W_[0],
  "term_edited.port_a.Q_flow", F_[0],"der(term_edited.heatCapacitor.T)");
 /* End of Equation Block */

 /* Linear system of equations to solve. */
F_[1] = RememberSimple_(F_[1], 1);
SolveScalarLinearParametric(DP_[2],"heatCapacitor.C",  -W_[0]," -term_edited.port_a.Q_flow",
   F_[1],"der(heatCapacitor.T)");
 /* End of Equation Block */

AcceptedSection1

AcceptedSection2

DefaultSection
InitializeData(1)
EndTranslatedEquations

#include <dsblock6.c>

PreNonAliasNew(0)
StartNonAlias(0)
DeclareParameter("term_edited.heatCapacitor.C", "Heat capacity of element (= cp*m) [J/K]",\
 0, 200, 0.0,0.0,0.0,0,560)
DeclareState("term_edited.heatCapacitor.T", "Temperature of element [K|degC]", 0,\
 293.15, 0.0,1E+100,0.0,0,560)
DeclareDerivative("term_edited.heatCapacitor.der(T)", "der(Temperature of element) [K/s]",\
 0, 0.0,0.0,0.0,0,512)
DeclareAlias2("term_edited.heatCapacitor.der_T", "Time derivative of temperature (= der(T)) [K/s]",\
 "term_edited.heatCapacitor.der(T)", 1, 6, 0, 0)
DeclareAlias2("term_edited.heatCapacitor.port.T", "Port temperature [K|degC]", \
"term_edited.heatCapacitor.T", 1, 1, 0, 4)
DeclareAlias2("term_edited.heatCapacitor.port.Q_flow", "Heat flow rate (positive if flowing from outside into the component) [W]",\
 "term_edited.port_a.Q_flow", 1, 5, 0, 132)
DeclareAlias2("term_edited.port_a.T", "Port temperature [K|degC]", \
"heatCapacitor.T", 1, 1, 1, 4)
DeclareVariable("term_edited.port_a.Q_flow", "Heat flow rate (positive if flowing from outside into the component) [W]",\
 0.0, 0.0,0.0,0.0,0,776)
DeclareAlias2("term_edited.thermalConductor.Q_flow", "Heat flow rate from port_a -> port_b [W]",\
 "term_edited.port_a.Q_flow", 1, 5, 0, 0)
DeclareVariable("term_edited.thermalConductor.dT", "port_a.T - port_b.T [K,]", \
0.0, 0.0,0.0,0.0,0,512)
DeclareAlias2("term_edited.thermalConductor.port_a.T", "Port temperature [K|degC]",\
 "heatCapacitor.T", 1, 1, 1, 4)
DeclareAlias2("term_edited.thermalConductor.port_a.Q_flow", "Heat flow rate (positive if flowing from outside into the component) [W]",\
 "term_edited.port_a.Q_flow", 1, 5, 0, 132)
DeclareAlias2("term_edited.thermalConductor.port_b.T", "Port temperature [K|degC]",\
 "term_edited.heatCapacitor.T", 1, 1, 0, 4)
DeclareAlias2("term_edited.thermalConductor.port_b.Q_flow", "Heat flow rate (positive if flowing from outside into the component) [W]",\
 "term_edited.port_a.Q_flow", -1, 5, 0, 132)
DeclareParameter("term_edited.thermalConductor.G", "Constant thermal conductance of material [W/K]",\
 1, 3, 0.0,0.0,0.0,0,560)
DeclareParameter("heatCapacitor.C", "Heat capacity of element (= cp*m) [J/K]", 2,\
 10, 0.0,0.0,0.0,0,560)
DeclareState("heatCapacitor.T", "Temperature of element [K|degC]", 1, 573.15, \
0.0,1E+100,0.0,0,560)
DeclareDerivative("heatCapacitor.der(T)", "der(Temperature of element) [K/s]", 0,\
 0.0,0.0,0.0,0,512)
DeclareAlias2("heatCapacitor.der_T", "Time derivative of temperature (= der(T)) [K/s]",\
 "heatCapacitor.der(T)", 1, 6, 1, 0)
DeclareAlias2("heatCapacitor.port.T", "Port temperature [K|degC]", \
"heatCapacitor.T", 1, 1, 1, 4)
DeclareAlias2("heatCapacitor.port.Q_flow", "Heat flow rate (positive if flowing from outside into the component) [W]",\
 "term_edited.port_a.Q_flow", -1, 5, 0, 132)
EndNonAlias(0)
#define NX_    2
#define NX2_   0
#define NU_    0
#define NY_    0
#define NW_    2
#define NP_    3
#define NPS_   0
#define MAXAuxStr_   0
#define MAXAuxStrLen_   500
#define NHash1_ 548404218
#define NHash2_ -284135242
#define NHash3_ 0
#define NI_    0
#define NRelF_ 0
#define NRel_  0
#define NTim_  0
#define NSamp_ 0
#define NCons_ 0
#define NA_    12
#define SizePre_ 0
#define SizeEq_ 2
#define SizeDelay_ 0
#define QNLmax_ 0
#define MAXAux 0
#define NrDymolaTimers_ 0
#define NWhen_ 0
#define NCheckIf_ 0
#define NGlobalHelp_ 0
#ifndef NExternalObject_
#define NExternalObject_ 0
#endif

#define DymolaHaveUpdateInitVars 1
#include <dsblock5.c>

DYMOLA_STATIC void UpdateInitVars(double *time, double X_[], double XD_[], double U_[],
double DP_[], long IP_[], Dymola_bool LP_[], double F_[], double Y_[], double W_[], double QZ_[], double duser_[], long iuser_[], void*cuser_[]) {
static Real initStore[1];
}
StartDataBlock
StartEqBlock
DoRemember_(F_[1], 0, 1);
DoRemember_(F_[0], 0, 0);
EndEqBlock
EndDataBlock


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Renci.SshNet.Common;
using Renci.SshNet.Sftp;
using System;
using System.Diagnostics;
using System.Threading;
using BufferedRead = Renci.SshNet.Sftp.SftpFileReader.BufferedRead;

namespace Renci.SshNet.Tests.Classes.Sftp
{
    [TestClass]
    public class SftpFileReaderTest_LastChunkBeforeEofIsPartial : SftpFileReaderTestBase
    {
        private const int ChunkLength = 32 * 1024;

        private MockSequence _seq;
        private byte[] _handle;
        private int _fileSize;
        private WaitHandle[] _waitHandleArray;
        private int _operationTimeout;
        private SftpCloseAsyncResult _closeAsyncResult;
        private byte[] _chunk1;
        private byte[] _chunk2;
        private byte[] _chunk3;
        private SftpFileReader _reader;
        private byte[] _actualChunk1;
        private byte[] _actualChunk2;
        private byte[] _actualChunk3;

        protected override void SetupData()
        {
            var random = new Random();

            _handle = CreateByteArray(random, 5);
            _chunk1 = CreateByteArray(random, ChunkLength);
            _chunk2 = CreateByteArray(random, ChunkLength);
            _chunk3 = new byte[0];
            _fileSize = _chunk1.Length + _chunk2.Length;
            _waitHandleArray = new WaitHandle[2];
            _operationTimeout = random.Next(10000, 20000);
            _closeAsyncResult = new SftpCloseAsyncResult(null, null);
        }

        protected override void SetupMocks()
        {
            _seq = new MockSequence();

            SftpSessionMock.InSequence(_seq)
                           .Setup(p => p.CreateWaitHandleArray(It.IsNotNull<WaitHandle>(), It.IsNotNull<WaitHandle>()))
                           .Returns<WaitHandle, WaitHandle>((disposingWaitHandle, semaphoreAvailableWaitHandle) =>
                           {
                               _waitHandleArray[0] = disposingWaitHandle;
                               _waitHandleArray[1] = semaphoreAvailableWaitHandle;
                               return _waitHandleArray;
                           });
            SftpSessionMock.InSequence(_seq).Setup(p => p.OperationTimeout).Returns(_operationTimeout);
            SftpSessionMock.InSequence(_seq)
                           .Setup(p => p.WaitAny(_waitHandleArray, _operationTimeout))
                           .Returns(() => WaitAny(_waitHandleArray, _operationTimeout));
            SftpSessionMock.InSequence(_seq)
                            .Setup(p => p.BeginRead(_handle, 0, ChunkLength, It.IsNotNull<AsyncCallback>(), It.IsAny<BufferedRead>()))
                            .Callback<byte[], ulong, uint, AsyncCallback, object>((handle, offset, length, callback, state) =>
                            {
                                var asyncResult = new SftpReadAsyncResult(callback, state);
                                asyncResult.SetAsCompleted(_chunk1, false);
                            })
                            .Returns((SftpReadAsyncResult)null);
            SftpSessionMock.InSequence(_seq).Setup(p => p.OperationTimeout).Returns(_operationTimeout);
            SftpSessionMock.InSequence(_seq)
                           .Setup(p => p.WaitAny(_waitHandleArray, _operationTimeout))
                           .Returns(() => WaitAny(_waitHandleArray, _operationTimeout));
            SftpSessionMock.InSequence(_seq)
                            .Setup(p => p.BeginRead(_handle, ChunkLength, ChunkLength, It.IsNotNull<AsyncCallback>(), It.IsAny<BufferedRead>()))
                            .Callback<byte[], ulong, uint, AsyncCallback, object>((handle, offset, length, callback, state) =>
                            {
                                var asyncResult = new SftpReadAsyncResult(callback, state);
                                asyncResult.SetAsCompleted(_chunk2, false);
                            })
                            .Returns((SftpReadAsyncResult)null);
            SftpSessionMock.InSequence(_seq).Setup(p => p.OperationTimeout).Returns(_operationTimeout);
            SftpSessionMock.InSequence(_seq)
                           .Setup(p => p.WaitAny(_waitHandleArray, _operationTimeout))
                           .Returns(() => WaitAny(_waitHandleArray, _operationTimeout));
            SftpSessionMock.InSequence(_seq)
                            .Setup(p => p.BeginRead(_handle, 2 * ChunkLength, ChunkLength, It.IsNotNull<AsyncCallback>(), It.IsAny<BufferedRead>()))
                            .Callback<byte[], ulong, uint, AsyncCallback, object>((handle, offset, length, callback, state) =>
                            {
                                var asyncResult = new SftpReadAsyncResult(callback, state);
                                asyncResult.SetAsCompleted(_chunk3, false);
                            })
                            .Returns((SftpReadAsyncResult)null);
        }

        protected override void Arrange()
        {
            base.Arrange();

            _reader = new SftpFileReader(_handle, SftpSessionMock.Object, ChunkLength, 15, _fileSize);
        }

        protected override void Act()
        {
            _actualChunk1 = _reader.Read();
            _actualChunk2 = _reader.Read();
            _actualChunk3 = _reader.Read();
        }

        [TestMethod]
        public void FirstReadShouldReturnChunk1()
        {
            Assert.IsNotNull(_actualChunk1);
            Assert.AreSame(_chunk1, _actualChunk1);
        }

        [TestMethod]
        public void SecondReadShouldReturnChunk2()
        {
            Assert.IsNotNull(_actualChunk2);
            Assert.AreSame(_chunk2, _actualChunk2);
        }

        [TestMethod]
        public void ThirdReadShouldReturnChunk3()
        {
            Assert.IsNotNull(_actualChunk3);
            Assert.AreSame(_chunk3, _actualChunk3);
        }

        [TestMethod]
        public void ReadAfterEndOfFileShouldThrowSshException()
        {
            try
            {
                _reader.Read();
                Assert.Fail();
            }
            catch (SshException ex)
            {
                Assert.IsNull(ex.InnerException);
                Assert.AreEqual("Attempting to read beyond the end of the file.", ex.Message);
            }
        }

        [TestMethod]
        public void DisposeShouldCloseHandleAndCompleteImmediately()
        {
            SftpSessionMock.InSequence(_seq).Setup(p => p.IsOpen).Returns(true);
            SftpSessionMock.InSequence(_seq).Setup(p => p.BeginClose(_handle, null, null)).Returns(_closeAsyncResult);
            SftpSessionMock.InSequence(_seq).Setup(p => p.EndClose(_closeAsyncResult));

            var stopwatch = Stopwatch.StartNew();
            _reader.Dispose();
            stopwatch.Stop();

            Assert.IsTrue(stopwatch.ElapsedMilliseconds < 200, "Dispose took too long to complete: " + stopwatch.ElapsedMilliseconds);

            SftpSessionMock.Verify(p => p.IsOpen, Times.Once);
            SftpSessionMock.Verify(p => p.BeginClose(_handle, null, null), Times.Once);
            SftpSessionMock.Verify(p => p.EndClose(_closeAsyncResult), Times.Once);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace Dominio.Dtos
{
    [DataContract()]
    public partial class hotelDTO
    {
        [DataMember()]
        public Int32 hotel_id { get; set; }

        [DataMember()]
        public String nombre { get; set; }

        [DataMember()]
        public Int32 estrellas { get; set; }

        [DataMember()]
        public String direccion { get; set; }

        [DataMember()]
        public String ciudad { get; set; }

        [DataMember()]
        public String telefono { get; set; }

        [DataMember()]
        public List<habitacionDTO> habitacion { get; set; }

        public hotelDTO()
        {
        }

        public hotelDTO(Int32 hotel_id, String nombre, Int32 estrellas, String direccion, String ciudad, String telefono, List<habitacionDTO> habitacion)
        {
			this.hotel_id = hotel_id;
			this.nombre = nombre;
			this.estrellas = estrellas;
			this.direccion = direccion;
			this.ciudad = ciudad;
			this.telefono = telefono;
			this.habitacion = habitacion;
        }
    }
}


text:
<?php

namespace Admin\StateBundle\Repository;

use Doctrine\ORM\EntityRepository;

/**
 * StateRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class StateRepository extends EntityRepository
{
}


text:
' Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

Imports Microsoft.CodeAnalysis.Editor.Host
Imports Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces
Imports Microsoft.CodeAnalysis.GeneratedCodeRecognition
Imports Microsoft.CodeAnalysis.Navigation
Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.VisualStudio.Composition
Imports Microsoft.VisualStudio.Text

Namespace Microsoft.CodeAnalysis.Editor.UnitTests.Utilities.GoToHelpers
    Friend Module GoToTestHelpers
        Public ReadOnly Catalog As ComposableCatalog = TestExportProvider.MinimumCatalogWithCSharpAndVisualBasic.WithParts(
                        GetType(MockDocumentNavigationServiceFactory),
                        GetType(DefaultSymbolNavigationServiceFactory),
                        GetType(GeneratedCodeRecognitionServiceFactory))

        Public ReadOnly ExportProvider As ExportProvider = MinimalTestExportProvider.CreateExportProvider(Catalog)

    End Module

    Friend Structure FilePathAndSpan
        Implements IComparable(Of FilePathAndSpan)

        Public ReadOnly Property FilePath As String
        Public ReadOnly Property Span As TextSpan

        Public Sub New(filePath As String, span As TextSpan)
            Me.FilePath = filePath
            Me.Span = span
        End Sub

        Public Function CompareTo(other As FilePathAndSpan) As Integer Implements IComparable(Of FilePathAndSpan).CompareTo
            Dim result = String.CompareOrdinal(FilePath, other.FilePath)

            If result <> 0 Then
                Return result
            End If

            Return Span.CompareTo(other.Span)
        End Function

        Public Overrides Function ToString() As String
            Return $"{FilePath}, {Span}"
        End Function
    End Structure

End Namespace


text:
// Original Code: Copyright (c) 2009-2014 The Bitcoin Core Developers
// Modified Code: Copyright (c) 2014 Project Bitmark
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITMARK_CHECKPOINT_H
#define BITMARK_CHECKPOINT_H

#include <map>

class CBlockIndex;
class uint256;

/** Block-chain checkpoints are compiled-in sanity checks.
 * They are updated every release or three.
 */
namespace Checkpoints
{
    // Returns true if block passes checkpoint checks
    bool CheckBlock(int nHeight, const uint256& hash);

    // Return conservative estimate of total number of blocks, 0 if unknown
    int GetTotalBlocksEstimate();

    // Returns last CBlockIndex* in mapBlockIndex that is a checkpoint
    CBlockIndex* GetLastCheckpoint(const std::map<uint256, CBlockIndex*>& mapBlockIndex);

    double GuessVerificationProgress(CBlockIndex *pindex, bool fSigchecks = true);

    extern bool fEnabled;
}

#endif


text:
//
//  UIButton+ArrayButton.h
//  RYSearch
//
//  Created by Robert on 15/4/24.
//  Copyright (c) 2015年 NationSky. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIButton (ArrayButton)

/**
 *  批量生成Button
 *
 *  @param array NSString类型的数组
 *  @param gap   Button之间的间距
 *
 *  @return Button数组
 */
+ (NSArray *)ButtonWithArray:(NSArray *)array Gap:(NSUInteger)gap;

@end


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>BoxSharedLinkRequestEntity</title>
<meta name="date" content="2014-03-17">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.box.boxjavalibv2.jsonentities

Class BoxSharedLinkRequestEntity

java.lang.Object

java.util.AbstractMap<K,V>

java.util.HashMap<K,V>

java.util.LinkedHashMap<java.lang.String,java.lang.Object>

com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

com.box.boxjavalibv2.jsonentities.BoxSharedLinkRequestEntity

All Implemented Interfaces:

IBoxJSONStringEntity, java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>

public class BoxSharedLinkRequestEntity
extends MapJSONStringEntity

Entity for shared link.

See Also:

Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class java.util.AbstractMap

java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>

Constructor Summary

Constructors

Constructor and Description

BoxSharedLinkRequestEntity(java.lang.String accessLevel)

Method Summary

Methods

Modifier and Type
Method and Description

BoxSharedLinkRequestEntity
setAccess(java.lang.String accessLevel)

Set access String.

void
setPermissions(boolean canDownload)

Set permissions

void
setUnshared_at(java.util.Date unsharedAt)

Set the time to unshare the link.

Methods inherited from class com.box.boxjavalibv2.jsonentities.MapJSONStringEntity

toJSONString

Methods inherited from class java.util.LinkedHashMap

clear, containsValue, get, removeEldestEntry

Methods inherited from class java.util.HashMap

clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values

Methods inherited from class java.util.AbstractMap

equals, hashCode, toString

Methods inherited from class java.lang.Object

finalize, getClass, notify, notifyAll, wait, wait, wait

Methods inherited from interface java.util.Map

containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values

Constructor Detail

BoxSharedLinkRequestEntity

public BoxSharedLinkRequestEntity(java.lang.String accessLevel)

Parameters:

accessLevel - access(String can be the strings defined in BoxSharedLinkAccess.)

Method Detail

setAccess

public BoxSharedLinkRequestEntity setAccess(java.lang.String accessLevel)

Set access String. This defines who has access to the link. String can be the strings defined in BoxSharedLinkAccess.

Parameters:

accessLevel - access

Returns:

setUnshared_at

public void setUnshared_at(java.util.Date unsharedAt)

Set the time to unshare the link. This String is an ISO8601 time String and can be generated from Date by
 ISO8601DateParser

Parameters:

unsharedAt - time to unshare the link

setPermissions

public void setPermissions(boolean canDownload)

Set permissions

Parameters:

canDownload - Whether shared item can be downloaded.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
'use-strict';

import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {Dimmer, Loader} from 'semantic-ui-react';

export default class Loading extends Component {
    static propTypes = {
        active: PropTypes.bool,
        content: PropTypes.string
    }

    render() {
        const {props: {children, active, content = 'Loading...'}} = this;

        return (
            <Dimmer.Dimmable dimmed={active}>
                <Dimmer active={active} inverted page>
                    <Loader size="large" content={content} />
                </Dimmer>
                {children}
            </Dimmer.Dimmable>
        );
    }
}


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	errorHandler = require('./errors.server.controller'),
	Proveedore = mongoose.model('Proveedore'),
	_ = require('lodash');

/**
 * Create a Proveedore
 */
exports.create = function(req, res) {
	var proveedore = new Proveedore(req.body);
	proveedore.user = req.user;

	proveedore.save(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(proveedore);
		}
	});
};

/**
 * Show the current Proveedore
 */
exports.read = function(req, res) {
	res.jsonp(req.proveedore);
};

/**
 * Update a Proveedore
 */
exports.update = function(req, res) {
	var proveedore = req.proveedore ;

	proveedore = _.extend(proveedore , req.body);

	proveedore.save(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(proveedore);
		}
	});
};

/**
 * Delete an Proveedore
 */
exports.delete = function(req, res) {
	var proveedore = req.proveedore ;

	proveedore.remove(function(err) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(proveedore);
		}
	});
};

/**
 * List of Proveedores
 */
exports.list = function(req, res) {
	Proveedore.find().sort('-created').populate('user', 'displayName').exec(function(err, proveedores) {
		if (err) {
			return res.status(400).send({
				message: errorHandler.getErrorMessage(err)
			});
		} else {
			res.jsonp(proveedores);
		}
	});
};

/**
 * Proveedore middleware
 */
exports.proveedoreByID = function(req, res, next, id) {
	Proveedore.findById(id).populate('user', 'displayName').exec(function(err, proveedore) {
		if (err) return next(err);
		if (! proveedore) return next(new Error('Failed to load Proveedore ' + id));
		req.proveedore = proveedore ;
		next();
	});
};

/**
 * Proveedore authorization middleware
 */
exports.hasAuthorization = function(req, res, next) {
	if (req.proveedore.user.id !== req.user.id) {
		return res.status(403).send('User is not authorized');
	}
	next();
};


text:
#include "cache.h"
#include "commit.h"
#include "walker.h"
#include "http.h"
#include "list.h"
#include "transport.h"

struct alt_base {
	char *base;
	int got_indices;
	struct packed_git *packs;
	struct alt_base *next;
};

enum object_request_state {
	WAITING,
	ABORTED,
	ACTIVE,
	COMPLETE
};

struct object_request {
	struct walker *walker;
	unsigned char sha1[20];
	struct alt_base *repo;
	enum object_request_state state;
	struct http_object_request *req;
	struct list_head node;
};

struct alternates_request {
	struct walker *walker;
	const char *base;
	struct strbuf *url;
	struct strbuf *buffer;
	struct active_request_slot *slot;
	int http_specific;
};

struct walker_data {
	const char *url;
	int got_alternates;
	struct alt_base *alt;
};

static LIST_HEAD(object_queue_head);

static void fetch_alternates(struct walker *walker, const char *base);

static void process_object_response(void *callback_data);

static void start_object_request(struct walker *walker,
				 struct object_request *obj_req)
{
	struct active_request_slot *slot;
	struct http_object_request *req;

	req = new_http_object_request(obj_req->repo->base, obj_req->sha1);
	if (req == NULL) {
		obj_req->state = ABORTED;
		return;
	}
	obj_req->req = req;

	slot = req->slot;
	slot->callback_func = process_object_response;
	slot->callback_data = obj_req;

	/* Try to get the request started, abort the request on error */
	obj_req->state = ACTIVE;
	if (!start_active_slot(slot)) {
		obj_req->state = ABORTED;
		release_http_object_request(req);
		return;
	}
}

static void finish_object_request(struct object_request *obj_req)
{
	if (finish_http_object_request(obj_req->req))
		return;

	if (obj_req->req->rename == 0)
		walker_say(obj_req->walker, "got %s\n", sha1_to_hex(obj_req->sha1));
}

static void process_object_response(void *callback_data)
{
	struct object_request *obj_req =
		(struct object_request *)callback_data;
	struct walker *walker = obj_req->walker;
	struct walker_data *data = walker->data;
	struct alt_base *alt = data->alt;

	process_http_object_request(obj_req->req);
	obj_req->state = COMPLETE;

	/* Use alternates if necessary */
	if (missing_target(obj_req->req)) {
		fetch_alternates(walker, alt->base);
		if (obj_req->repo->next != NULL) {
			obj_req->repo =
				obj_req->repo->next;
			release_http_object_request(obj_req->req);
			start_object_request(walker, obj_req);
			return;
		}
	}

	finish_object_request(obj_req);
}

static void release_object_request(struct object_request *obj_req)
{
	if (obj_req->req !=NULL && obj_req->req->localfile != -1)
		error("fd leakage in release: %d", obj_req->req->localfile);

	list_del(&obj_req->node);
	free(obj_req);
}

#ifdef USE_CURL_MULTI
static int fill_active_slot(struct walker *walker)
{
	struct object_request *obj_req;
	struct list_head *pos, *tmp, *head = &object_queue_head;

	list_for_each_safe(pos, tmp, head) {
		obj_req = list_entry(pos, struct object_request, node);
		if (obj_req->state == WAITING) {
			if (has_sha1_file(obj_req->sha1))
				obj_req->state = COMPLETE;
			else {
				start_object_request(walker, obj_req);
				return 1;
			}
		}
	}
	return 0;
}
#endif

static void prefetch(struct walker *walker, unsigned char *sha1)
{
	struct object_request *newreq;
	struct walker_data *data = walker->data;

	newreq = xmalloc(sizeof(*newreq));
	newreq->walker = walker;
	hashcpy(newreq->sha1, sha1);
	newreq->repo = data->alt;
	newreq->state = WAITING;
	newreq->req = NULL;

	http_is_verbose = walker->get_verbosely;
	list_add_tail(&newreq->node, &object_queue_head);

#ifdef USE_CURL_MULTI
	fill_active_slots();
	step_active_slots();
#endif
}

static int is_alternate_allowed(const char *url)
{
	const char *protocols[] = {
		"http", "https", "ftp", "ftps"
	};
	int i;

	if (http_follow_config != HTTP_FOLLOW_ALWAYS) {
		warning("alternate disabled by http.followRedirects: %s", url);
		return 0;
	}

	for (i = 0; i < ARRAY_SIZE(protocols); i++) {
		const char *end;
		if (skip_prefix(url, protocols[i], &end) &&
		    starts_with(end, "://"))
			break;
	}

	if (i >= ARRAY_SIZE(protocols)) {
		warning("ignoring alternate with unknown protocol: %s", url);
		return 0;
	}
	if (!is_transport_allowed(protocols[i], 0)) {
		warning("ignoring alternate with restricted protocol: %s", url);
		return 0;
	}

	return 1;
}

static void process_alternates_response(void *callback_data)
{
	struct alternates_request *alt_req =
		(struct alternates_request *)callback_data;
	struct walker *walker = alt_req->walker;
	struct walker_data *cdata = walker->data;
	struct active_request_slot *slot = alt_req->slot;
	struct alt_base *tail = cdata->alt;
	const char *base = alt_req->base;
	const char null_byte = '\0';
	char *data;
	int i = 0;

	if (alt_req->http_specific) {
		if (slot->curl_result != CURLE_OK ||
		    !alt_req->buffer->len) {

			/* Try reusing the slot to get non-http alternates */
			alt_req->http_specific = 0;
			strbuf_reset(alt_req->url);
			strbuf_addf(alt_req->url, "%s/objects/info/alternates",
				    base);
			curl_easy_setopt(slot->curl, CURLOPT_URL,
					 alt_req->url->buf);
			active_requests++;
			slot->in_use = 1;
			if (slot->finished != NULL)
				(*slot->finished) = 0;
			if (!start_active_slot(slot)) {
				cdata->got_alternates = -1;
				slot->in_use = 0;
				if (slot->finished != NULL)
					(*slot->finished) = 1;
			}
			return;
		}
	} else if (slot->curl_result != CURLE_OK) {
		if (!missing_target(slot)) {
			cdata->got_alternates = -1;
			return;
		}
	}

	fwrite_buffer((char *)&null_byte, 1, 1, alt_req->buffer);
	alt_req->buffer->len--;
	data = alt_req->buffer->buf;

	while (i < alt_req->buffer->len) {
		int posn = i;
		while (posn < alt_req->buffer->len && data[posn] != '\n')
			posn++;
		if (data[posn] == '\n') {
			int okay = 0;
			int serverlen = 0;
			struct alt_base *newalt;
			if (data[i] == '/') {
				/*
				 * This counts
				 * http://git.host/pub/scm/linux.git/
				 * -----------here^
				 * so memcpy(dst, base, serverlen) will
				 * copy up to "...git.host".
				 */
				const char *colon_ss = strstr(base,"://");
				if (colon_ss) {
					serverlen = (strchr(colon_ss + 3, '/')
						     - base);
					okay = 1;
				}
			} else if (!memcmp(data + i, "../", 3)) {
				/*
				 * Relative URL; chop the corresponding
				 * number of subpath from base (and ../
				 * from data), and concatenate the result.
				 *
				 * The code first drops ../ from data, and
				 * then drops one ../ from data and one path
				 * from base.  IOW, one extra ../ is dropped
				 * from data than path is dropped from base.
				 *
				 * This is not wrong.  The alternate in
				 *     http://git.host/pub/scm/linux.git/
				 * to borrow from
				 *     http://git.host/pub/scm/linus.git/
				 * is ../../linus.git/objects/.  You need
				 * two ../../ to borrow from your direct
				 * neighbour.
				 */
				i += 3;
				serverlen = strlen(base);
				while (i + 2 < posn &&
				       !memcmp(data + i, "../", 3)) {
					do {
						serverlen--;
					} while (serverlen &&
						 base[serverlen - 1] != '/');
					i += 3;
				}
				/* If the server got removed, give up. */
				okay = strchr(base, ':') - base + 3 <
				       serverlen;
			} else if (alt_req->http_specific) {
				char *colon = strchr(data + i, ':');
				char *slash = strchr(data + i, '/');
				if (colon && slash && colon < data + posn &&
				    slash < data + posn && colon < slash) {
					okay = 1;
				}
			}
			if (okay) {
				struct strbuf target = STRBUF_INIT;
				strbuf_add(&target, base, serverlen);
				strbuf_add(&target, data + i, posn - i);
				if (!strbuf_strip_suffix(&target, "objects")) {
					warning("ignoring alternate that does"
						" not end in 'objects': %s",
						target.buf);
					strbuf_release(&target);
				} else if (is_alternate_allowed(target.buf)) {
					warning("adding alternate object store: %s",
						target.buf);
					newalt = xmalloc(sizeof(*newalt));
					newalt->next = NULL;
					newalt->base = strbuf_detach(&target, NULL);
					newalt->got_indices = 0;
					newalt->packs = NULL;

					while (tail->next != NULL)
						tail = tail->next;
					tail->next = newalt;
				} else {
					strbuf_release(&target);
				}
			}
		}
		i = posn + 1;
	}

	cdata->got_alternates = 1;
}

static void fetch_alternates(struct walker *walker, const char *base)
{
	struct strbuf buffer = STRBUF_INIT;
	struct strbuf url = STRBUF_INIT;
	struct active_request_slot *slot;
	struct alternates_request alt_req;
	struct walker_data *cdata = walker->data;

	/*
	 * If another request has already started fetching alternates,
	 * wait for them to arrive and return to processing this request's
	 * curl message
	 */
#ifdef USE_CURL_MULTI
	while (cdata->got_alternates == 0) {
		step_active_slots();
	}
#endif

	/* Nothing to do if they've already been fetched */
	if (cdata->got_alternates == 1)
		return;

	/* Start the fetch */
	cdata->got_alternates = 0;

	if (walker->get_verbosely)
		fprintf(stderr, "Getting alternates list for %s\n", base);

	strbuf_addf(&url, "%s/objects/info/http-alternates", base);

	/*
	 * Use a callback to process the result, since another request
	 * may fail and need to have alternates loaded before continuing
	 */
	slot = get_active_slot();
	slot->callback_func = process_alternates_response;
	alt_req.walker = walker;
	slot->callback_data = &alt_req;

	curl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);
	curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
	curl_easy_setopt(slot->curl, CURLOPT_URL, url.buf);

	alt_req.base = base;
	alt_req.url = &url;
	alt_req.buffer = &buffer;
	alt_req.http_specific = 1;
	alt_req.slot = slot;

	if (start_active_slot(slot))
		run_active_slot(slot);
	else
		cdata->got_alternates = -1;

	strbuf_release(&buffer);
	strbuf_release(&url);
}

static int fetch_indices(struct walker *walker, struct alt_base *repo)
{
	int ret;

	if (repo->got_indices)
		return 0;

	if (walker->get_verbosely)
		fprintf(stderr, "Getting pack list for %s\n", repo->base);

	switch (http_get_info_packs(repo->base, &repo->packs)) {
	case HTTP_OK:
	case HTTP_MISSING_TARGET:
		repo->got_indices = 1;
		ret = 0;
		break;
	default:
		repo->got_indices = 0;
		ret = -1;
	}

	return ret;
}

static int http_fetch_pack(struct walker *walker, struct alt_base *repo, unsigned char *sha1)
{
	struct packed_git *target;
	int ret;
	struct slot_results results;
	struct http_pack_request *preq;

	if (fetch_indices(walker, repo))
		return -1;
	target = find_sha1_pack(sha1, repo->packs);
	if (!target)
		return -1;

	if (walker->get_verbosely) {
		fprintf(stderr, "Getting pack %s\n",
			sha1_to_hex(target->sha1));
		fprintf(stderr, " which contains %s\n",
			sha1_to_hex(sha1));
	}

	preq = new_http_pack_request(target, repo->base);
	if (preq == NULL)
		goto abort;
	preq->lst = &repo->packs;
	preq->slot->results = &results;

	if (start_active_slot(preq->slot)) {
		run_active_slot(preq->slot);
		if (results.curl_result != CURLE_OK) {
			error("Unable to get pack file %s\n%s", preq->url,
			      curl_errorstr);
			goto abort;
		}
	} else {
		error("Unable to start request");
		goto abort;
	}

	ret = finish_http_pack_request(preq);
	release_http_pack_request(preq);
	if (ret)
		return ret;

	return 0;

abort:
	return -1;
}

static void abort_object_request(struct object_request *obj_req)
{
	release_object_request(obj_req);
}

static int fetch_object(struct walker *walker, unsigned char *sha1)
{
	char *hex = sha1_to_hex(sha1);
	int ret = 0;
	struct object_request *obj_req = NULL;
	struct http_object_request *req;
	struct list_head *pos, *head = &object_queue_head;

	list_for_each(pos, head) {
		obj_req = list_entry(pos, struct object_request, node);
		if (!hashcmp(obj_req->sha1, sha1))
			break;
	}
	if (obj_req == NULL)
		return error("Couldn't find request for %s in the queue", hex);

	if (has_sha1_file(obj_req->sha1)) {
		if (obj_req->req != NULL)
			abort_http_object_request(obj_req->req);
		abort_object_request(obj_req);
		return 0;
	}

#ifdef USE_CURL_MULTI
	while (obj_req->state == WAITING)
		step_active_slots();
#else
	start_object_request(walker, obj_req);
#endif

	/*
	 * obj_req->req might change when fetching alternates in the callback
	 * process_object_response; therefore, the "shortcut" variable, req,
	 * is used only after we're done with slots.
	 */
	while (obj_req->state == ACTIVE)
		run_active_slot(obj_req->req->slot);

	req = obj_req->req;

	if (req->localfile != -1) {
		close(req->localfile);
		req->localfile = -1;
	}

	/*
	 * we turned off CURLOPT_FAILONERROR to avoid losing a
	 * persistent connection and got CURLE_OK.
	 */
	if (req->http_code >= 300 && req->curl_result == CURLE_OK &&
			(starts_with(req->url, "http://") ||
			 starts_with(req->url, "https://"))) {
		req->curl_result = CURLE_HTTP_RETURNED_ERROR;
		xsnprintf(req->errorstr, sizeof(req->errorstr),
			  "HTTP request failed");
	}

	if (obj_req->state == ABORTED) {
		ret = error("Request for %s aborted", hex);
	} else if (req->curl_result != CURLE_OK &&
		   req->http_code != 416) {
		if (missing_target(req))
			ret = -1; /* Be silent, it is probably in a pack. */
		else
			ret = error("%s (curl_result = %d, http_code = %ld, sha1 = %s)",
				    req->errorstr, req->curl_result,
				    req->http_code, hex);
	} else if (req->zret != Z_STREAM_END) {
		walker->corrupt_object_found++;
		ret = error("File %s (%s) corrupt", hex, req->url);
	} else if (hashcmp(obj_req->sha1, req->real_sha1)) {
		ret = error("File %s has bad hash", hex);
	} else if (req->rename < 0) {
		ret = error("unable to write sha1 filename %s",
			    sha1_file_name(req->sha1));
	}

	release_http_object_request(req);
	release_object_request(obj_req);
	return ret;
}

static int fetch(struct walker *walker, unsigned char *sha1)
{
	struct walker_data *data = walker->data;
	struct alt_base *altbase = data->alt;

	if (!fetch_object(walker, sha1))
		return 0;
	while (altbase) {
		if (!http_fetch_pack(walker, altbase, sha1))
			return 0;
		fetch_alternates(walker, data->alt->base);
		altbase = altbase->next;
	}
	return error("Unable to find %s under %s", sha1_to_hex(sha1),
		     data->alt->base);
}

static int fetch_ref(struct walker *walker, struct ref *ref)
{
	struct walker_data *data = walker->data;
	return http_fetch_ref(data->alt->base, ref);
}

static void cleanup(struct walker *walker)
{
	struct walker_data *data = walker->data;
	struct alt_base *alt, *alt_next;

	if (data) {
		alt = data->alt;
		while (alt) {
			alt_next = alt->next;

			free(alt->base);
			free(alt);

			alt = alt_next;
		}
		free(data);
		walker->data = NULL;
	}
}

struct walker *get_http_walker(const char *url)
{
	char *s;
	struct walker_data *data = xmalloc(sizeof(struct walker_data));
	struct walker *walker = xmalloc(sizeof(struct walker));

	data->alt = xmalloc(sizeof(*data->alt));
	data->alt->base = xstrdup(url);
	for (s = data->alt->base + strlen(data->alt->base) - 1; *s == '/'; --s)
		*s = 0;

	data->alt->got_indices = 0;
	data->alt->packs = NULL;
	data->alt->next = NULL;
	data->got_alternates = -1;

	walker->corrupt_object_found = 0;
	walker->fetch = fetch;
	walker->fetch_ref = fetch_ref;
	walker->prefetch = prefetch;
	walker->cleanup = cleanup;
	walker->data = data;

#ifdef USE_CURL_MULTI
	add_fill_function(walker, (int (*)(void *)) fill_active_slot);
#endif

	return walker;
}


text:
ENV['RAILS_ENV'] ||= 'test'

require File.expand_path("../dummy/config/environment.rb", __FILE__)

require "rspec/rails"
require "capybara/rspec"
require "greedo"

RSpec.configure do |config|
  config.mock_with :rspec
  config.use_transactional_fixtures = true
  config.infer_base_class_for_anonymous_controllers = false
  config.order = "random"
end


text:
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        217
#define _APS_NEXT_COMMAND_VALUE         32809
#define _APS_NEXT_CONTROL_VALUE         1049
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif


text:
/**
 * This class handles the creation of native windows and dialogs. This class can be extended to provide for example inline dialogs.
 *
 * @class tinymce.WindowManager
 * @example
 * // Opens a new dialog with the file.htm file and the size 320x240
 * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog.
 * tinymce.activeEditor.windowManager.open({
 *    url: 'file.htm',
 *    width: 320,
 *    height: 240
 * }, {
 *    custom_param: 1
 * });
 *
 * // Displays an alert box using the active editors window manager instance
 * tinymce.activeEditor.windowManager.alert('Hello world!');
 *
 * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm
 * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) {
 *    if (s)
 *       tinymce.activeEditor.windowManager.alert("Ok");
 *    else
 *       tinymce.activeEditor.windowManager.alert("Cancel");
 * });
 */
define("tinymce/WindowManager", [
	"tinymce/ui/Window",
	"tinymce/ui/MessageBox"
], function(Window, MessageBox) {
	return function(editor) {
		var self = this, windows = [];

		function getTopMostWindow() {
			if (windows.length) {
				return windows[windows.length - 1];
			}
		}

		self.windows = windows;

		editor.on('remove', function() {
			var i = windows.length;

			while (i--) {
				windows[i].close();
			}
		});

		/**
		 * Opens a new window.
		 *
		 * @method open
		 * @param {Object} args Optional name/value settings collection contains things like width/height/url etc.
		 * @option {String} title Window title.
		 * @option {String} file URL of the file to open in the window.
		 * @option {Number} width Width in pixels.
		 * @option {Number} height Height in pixels.
		 * @option {Boolean} autoScroll Specifies whether the popup window can have scrollbars if required (i.e. content
		 * larger than the popup size specified).
		 */
		self.open = function(args, params) {
			var win;

			editor.editorManager.setActive(editor);

			args.title = args.title || ' ';

			// Handle URL
			args.url = args.url || args.file; // Legacy
			if (args.url) {
				args.width = parseInt(args.width || 320, 10);
				args.height = parseInt(args.height || 240, 10);
			}

			// Handle body
			if (args.body) {
				args.items = {
					defaults: args.defaults,
					type: args.bodyType || 'form',
					items: args.body
				};
			}

			if (!args.url && !args.buttons) {
				args.buttons = [
					{text: 'Ok', subtype: 'primary', onclick: function() {
						win.find('form')[0].submit();
					}},

					{text: 'Cancel', onclick: function() {
						win.close();
					}}
				];
			}

			win = new Window(args);
			windows.push(win);

			win.on('close', function() {
				var i = windows.length;

				while (i--) {
					if (windows[i] === win) {
						windows.splice(i, 1);
					}
				}

				if (!windows.length) {
					editor.focus();
				}
			});

			// Handle data
			if (args.data) {
				win.on('postRender', function() {
					this.find('*').each(function(ctrl) {
						var name = ctrl.name();

						if (name in args.data) {
							ctrl.value(args.data[name]);
						}
					});
				});
			}

			// store args and parameters
			win.features = args || {};
			win.params = params || {};

			// Takes a snapshot in the FocusManager of the selection before focus is lost to dialog
			if (windows.length === 1) {
				editor.nodeChanged();
			}

			return win.renderTo().reflow();
		};

		/**
		 * Creates a alert dialog. Please don't use the blocking behavior of this
		 * native version use the callback method instead then it can be extended.
		 *
		 * @method alert
		 * @param {String} message Text to display in the new alert dialog.
		 * @param {function} callback Callback function to be executed after the user has selected ok.
		 * @param {Object} scope Optional scope to execute the callback in.
		 * @example
		 * // Displays an alert box using the active editors window manager instance
		 * tinymce.activeEditor.windowManager.alert('Hello world!');
		 */
		self.alert = function(message, callback, scope) {
			MessageBox.alert(message, function() {
				if (callback) {
					callback.call(scope || this);
				} else {
					editor.focus();
				}
			});
		};

		/**
		 * Creates a confirm dialog. Please don't use the blocking behavior of this
		 * native version use the callback method instead then it can be extended.
		 *
		 * @method confirm
		 * @param {String} messageText to display in the new confirm dialog.
		 * @param {function} callback Callback function to be executed after the user has selected ok or cancel.
		 * @param {Object} scope Optional scope to execute the callback in.
		 * @example
		 * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm
		 * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) {
		 *    if (s)
		 *       tinymce.activeEditor.windowManager.alert("Ok");
		 *    else
		 *       tinymce.activeEditor.windowManager.alert("Cancel");
		 * });
		 */
		self.confirm = function(message, callback, scope) {
			MessageBox.confirm(message, function(state) {
				callback.call(scope || this, state);
			});
		};

		/**
		 * Closes the top most window.
		 *
		 * @method close
		 */
		self.close = function() {
			if (getTopMostWindow()) {
				getTopMostWindow().close();
			}
		};

		/**
		 * Returns the params of the last window open call. This can be used in iframe based
		 * dialog to get params passed from the tinymce plugin.
		 *
		 * @example
		 * var dialogArguments = top.tinymce.activeEditor.windowManager.getParams();
		 *
		 * @method getParams
		 * @return {Object} Name/value object with parameters passed from windowManager.open call.
		 */
		self.getParams = function() {
			return getTopMostWindow() ? getTopMostWindow().params : null;
		};

		/**
		 * Sets the params of the last opened window.
		 *
		 * @method setParams
		 * @param {Object} params Params object to set for the last opened window.
		 */
		self.setParams = function(params) {
			if (getTopMostWindow()) {
				getTopMostWindow().params = params;
			}
		};

		/**
		 * Returns the currently opened window objects.
		 *
		 * @method getWindows
		 * @return {Array} Array of the currently opened windows.
		 */
		self.getWindows = function() {
			return windows;
		};
	};
});


text:
//
//  Generated by the J2ObjC translator.  DO NOT EDIT!
//  source: /Users/nitin/Framework/Logger/ConvertCode/OnePoint/Runtime/Common/Helpers/ICollectionObject.java
//
//  Created by nitin on 1/15/14.
//

#ifndef _ICollectionObject_H_
#define _ICollectionObject_H_

#import "SortOrder.h"
@protocol ICollectionObject < NSObject >
- (void)addWithId:(id)key
           withId:(id)value;
- (void)addWithId:(id)key
           withId:(id)value
          withInt:(int)index;
- (id)itemWithId:(id)index;
- (void)removeWithInt:(int)index;
- (void)removeWithId:(id)key;
-(SortOrder) getOrder ;

-(void)setOrder:(SortOrder)value;

/**
 * Gets the items.
 */
-(NSArray*)getItems ;

-(int) getCount;

-(id)get___idx:(id) key ;

-(void) set___idx:(id) key value:(id)value ;

/**
 * The item.
 *
 *  @param index
 * The index.
 *
 *  @return
 * The
 *  {@link #TV}
 * .
 */
//TV get___idx(Object index) throws Exception ;

//void set___idx(Object index, TV value) throws Exception ;

-(BOOL) containsKey:(id) key;

-(BOOL) containsValue:(id) value ;

/**
 * The add.
 *
 *  @param key
 * The key.
 *
 *  @param value
 * The value.
 */
-(void) add:(id) key value:(id)value;

/**
 * The add.
 *
 *  @param key
 * The key.
 *
 *  @param value
 * The value.
 *
 *  @param index
 * The index.
 */
-(void) add:(id)key value:(id)value index:(int) index;

/**
 * The remove.
 *
 *  @param index
 * The index.
 */
-(void) removeAtIndex:(int) index ;

/**
 * The remove.
 *
 *  @param key
 * The key.
 */
-(void)removeKey:(id) key;

-(void) clear;

-(void) clearForSort;

-(void) sortList ;
@end

#endif // _ICollectionObject_H_


text:
using Darjeel.EventSourcing;
using System.Data.Entity;

namespace Darjeel.EntityFramework.EventSourcing
{
    public interface IEventContext : IContext
    {
        IDbSet<StoredEvent> Events { get; }
    }
}


text:
import {
  getConstantByNetwork,
  Network,
  networks,
  schedulerSupportedChainsArray,
  SchedulerCapableNetworks,
} from '@cardstack/cardpay-sdk';
import { action } from '@ember/object';
import Service from '@ember/service';
import { tracked } from '@glimmer/tracking';

interface NetworkInfo {
  chainId: number;
  name: string;
  symbol: Network;
}
const DEFAULT_NETWORK = 'mainnet' as const; // TODO: add default based on env

export default class NetworkService extends Service {
  @tracked networkInfo: NetworkInfo = {
    chainId: getConstantByNetwork('chainId', DEFAULT_NETWORK),
    name: getConstantByNetwork('name', DEFAULT_NETWORK),
    symbol: DEFAULT_NETWORK,
  };

  get supportedList() {
    return schedulerSupportedChainsArray
      .map((networkSymbol) => ({
        name: getConstantByNetwork('name', networkSymbol),
        chainId: getConstantByNetwork('chainId', networkSymbol),
        symbol: networkSymbol,
      }))
      .filter(({ name }) => name !== this.name);
  }

  @action onSelect(networkInfo: NetworkInfo) {
    this.networkInfo = networkInfo;
  }

  @action onChainChanged(chainId: number) {
    const symbol = networks[chainId];
    const name = getConstantByNetwork('name', symbol);

    this.onSelect({ chainId, symbol, name } as NetworkInfo);
  }

  get chainId() {
    return this.networkInfo.chainId;
  }
  get name() {
    return this.networkInfo.name;
  }
  get symbol(): SchedulerCapableNetworks {
    return this.networkInfo.symbol as SchedulerCapableNetworks;
  }
}

declare module '@ember/service' {
  interface Registry {
    network: NetworkService;
  }
}


text:
{% extends 'base.html' %}

{% block body %}

Register

            <form action="" method="post">

                        <input type="text" placeholder="username" required/>

                        <input type="text" placeholder="first name" />

                        <input type="text" placeholder="last name" />

                        <input type="email" placeholder="email" required />

                        <input type="password" placeholder="password"/>

                        <button class="right">Finish</button>

            </form>

        {% if error %}

                Hello!
                ×

        {% endif %}

Log in!

                <form action="{% url 'login' %}" method="post">
                    {% csrf_token %}

                            <input type="text" name="username" placeholder="username" required />

                            <input type="password" name="password" placeholder="password" required />

                            <button class="right">Send</button>

                </form>

{% endblock body %}


text:
  {{ getPlainProtocolText(item) | limitTo: 30 }}{{ (getPlainProtocolText(item).length > 30) ? '...' : '' }}
  <translate>Create protocol</translate>...


text:
ActiveRecord::Schema.define(version: 20160424090309) do

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"
  enable_extension "uuid-ossp"

  create_table "socks", id: :uuid, default: "uuid_generate_v4()", force: :cascade do |t|
    t.string  "title",     limit: 255
    t.string  "body",      limit: 255
    t.integer "user_id"
    t.decimal "latitude",              precision: 10, scale: 6
    t.decimal "longitude",             precision: 10, scale: 6
  end

end


text:
package org.apache.avro.compiler.idl;

import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

public class TestReferenceAnnotationNotAllowed {

  @Test
  public void testReferenceAnnotationNotAllowed() {

    final ClassLoader cl = Thread.currentThread().getContextClassLoader();
    Idl idl = new Idl(cl.getResourceAsStream("AnnotationOnTypeReference.avdl"), "UTF-8");

    try {
      idl.CompilationUnit();

      fail("Compilation should fail: annotations on type references are not allowed.");
    } catch (ParseException e) {
      assertEquals("Type references may not be annotated, at line 29, column 17", e.getMessage());
    }
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<title>libexecstream news</title>
<link href="libexecstream.css" type="text/css" rel="stylesheet"></link>

The libexecstream library news

<col class="linksbar"></col>
<col class="body"></col>

Overview

Download

Installation

Reference

News

License

April 12, 2004.
Version 0.3 - first public release.


text:
<?php

namespace com_brucemyers\test\DataflowBot;

class MockCurlTPV
{
	static public $lastError = '';
	static public $data = '{"items":[{"project":"en.wikipedia","access":"all-access","year":"2016","month":"05","day":"15","articles":[{"article":"Main_Page","views":19054328,"rank":1},{"article":"Special:Search","views":1657012,"rank":2},{"article":"Paris: France","views":55,"rank":3},{"article":"Rome","views":27,"rank":4}]}]}';
	static public $rows = array(
		array('Article', 'Views'),
		array('Paris: France', 55),
		array('Rome', 27)
	);

	/**
	 * Get a urls contents.
	 *
	 * @param string $URL
	 * @return mixed false = error, string = contents
	 */
	static public function getUrlContents($URL)
	{
		self::$lastError = '';
		$theurl = "https://wikimedia.org/api/rest_v1/metrics/pageviews/top/en.wikipedia.org/all-access/" .
			date('Y/m/d', strtotime('-5 days'));

		if ($URL != $theurl) {
			self::$lastError = ' != ' . $theurl;
			return false;
		}

		return self::$data;
	}
}


text:
layout: default
modal-id: 4
date: 2014-07-15
img: zerorez.jpg
alt: Zerorez
project-date: 2012
client: Zerorez
siteurl: http://www.zeroreznc.com/
category: Internet Marketing
description: ZEROREZ Raleigh specializes in carpet, tile, upholstery, area rug, hard surface, pet treatment, and mattress cleaning for homes and businesses in the Raleigh, Durham, and Cary area.
task: I was the lead internet marketer in charge of their Pay-Per-Click campaign to target local customers in North Carolina.

---


text:
********
Analysis
********

In addition to supporting the actual harvesting, transformation, and publishing of metadata for aggregation purposes, Combine strives to also support the analysis of groups of Records.  Analysis may include looking at the use of metadata fields across Records, or viewing the results of Validation tests performed across Records.

This section will describe some areas of Combine related to analysis.  This includes `Analysis Jobs <#analysis-jobs>`__ proper, a particular kind of Job in Combine, and analysis more broadly when looking at the results of Jobs and their Records.

Analysis Jobs
=============

Analysis Jobs are a bit of an island.  On the back-end, they are essentially Duplicate / Merge Jobs, and have the same input and configuration requirements.  They can pull input Jobs from across Organizations and Records Groups.

Analysis Jobs *differ* in that they do not exist within a Record Group.  They are imagined to be ephemeral, disposable Jobs used entirely for analysis purposes.

You can see previously run, or start a new Analysis Job, from the "Analysis" link from the top-most navigation.

Below, is an example of an Analysis Job comparing two Jobs, from *different* Record Groups.  This ability to pull Jobs from different Record Groups is shared with Merge Jobs.  You can see only one Job in the table, but the entire lineage of what Jobs contribute to this Analysis Job.  When the Analysis Job is deleted, none of the other Jobs will be touched (and currently, they are not aware of the Analysis Job in their own lineage).

.. figure:: img/analysis_job_example.png
   :alt: Analysis Job showing analysis of two Jobs, across two different Record Groups
   :target: _images/analysis_job_example.png

   Analysis Job showing analysis of two Jobs, across two different Record Groups

Analyzing Indexed Fields
========================

Undoubtedly one of Combine's more interesting, confusing, and potentially powerful areas is the indexing of Record XML into ElasticSearch.  This section will outline how that happens, and some possible insights that can be gleamed from the results.

How and Why?
------------

All Records in Combine store their raw metadata as XML in a Mongo database.  With that raw metadata, are some other fields about validity, internal identifiers, etc., as they relate to the Record.  But, because the metadata is still an opaque XML "blob" at this point, it does not allow for inspection or analysis.  To this end, when all Jobs are run, all Records are also **indexed** in ElasticSearch.

As many who have worked with complex metadata can attest to, flattening or mapping hierarchical metadata to a flat document store like ElasticSearch or Solr is difficult.  Combine approaches this problem by generically flattening all elements in a Record's XML document into XPath paths, which are converted into field names that are stored in ElasticSearch.  This includes attributes as well, further dynamically defining the ElasticSearch field name.

For example, the following XML metadata element:

.. code-block:: xml

    <mods:accessCondition type="useAndReproduction">This book is in the public domain.</mods:accessCondition>

would become the following ElasticSearch field name:

.. code-block:: text

    mods_accessCondition_@type_useAndReproduction

While ``mods_accessCondition_@type_useAndReproduction`` is not terribly pleasant to look at, it's telling where this value came from inside the XML document.  And most importantly, this generic XPath flattening approach can be applied across all XML documents that Combine might encounter.

This "flattening", aka "mapping", of XML to fields that can be stored and readily queried in ElasticSearch is done through `Field Mapping Configurations <configuration.html#field-mapper-configurations>`__.

Breakdown of indexed fields for a Job
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When viewing the details of a Job, the tab "Mapped Fields" shows a breakdown of all fields, for all records in this job, in a table.  They can be thought of roughly as **facets** for the Job.

.. figure:: img/job_indexed_fields_example.png
   :alt: Example of Field Analysis tab from Job details, showing all indexed fields for a Job
   :target: _images/job_indexed_fields_example.png

   Example of Field Analysis tab from Job details, showing all indexed fields for a Job

There is a button "What does these numbers mean?" that outlines what the various columns mean:

.. figure:: img/field_analysis_explain.png
   :alt: Collapsible explanation of indexed fields breakdown table
   :target: _images/field_analysis_explain.png

   Collapsible explanation of indexed fields breakdown table

All columns are sortable, and some are linked out to another view that drills further into that particular field.  One way to drill down into a field is to click on the field name itself.  This will present another view with values from that field.  Below is doing that for the field ``mods_subject_topic``:

.. figure:: img/mods_subject_topic.png
   :alt: Drill down to ``mods_subject_topic`` indexed field
   :target: _images/mods_subject_topic.png

   Drill down to ``mods_subject_topic`` indexed field

At the top, you can see some high-level metrics that recreate numbers from the overview, such as:

  - how many documents have this field
  - how many do not
  - how many total *values* are there, remembering that a single document can have multiple values
  - how many *distinct* values are there
  - percentage of unique (distinct / total values)
  - and percentage of all documents that have this field

In the table, you can see actual values for the field, with counts across documents in this Job.  In the last column, you can click to see Records that **have** or **do not have** this particular value for this particular field.

Clicking into a subject like "fairy tales", we get the following screen:

.. figure:: img/fairy_tales_drilldown.png
   :alt: Details for "fairy tales" ``mods_subject_topic`` indexed field
   :target: _images/fairy_tales_drilldown.png

   Details for "fairy tales" ``mods_subject_topic`` indexed field

At this level, we have the option to click into individual Records.

Validation Tests Results
========================

Results for Validation Tests run on a particular Job are communicated in the following ways:

  - in the Records Table from a Job's details page
  - a quick overview of all tests performed, and number passed, from a Job's details page
  - exported as an Excel or .csv from a Job's details page
  - results for each Validation test on a Record's details page

When a Record fails *any* test from *any* applied Validation Scenario to its parent Job, it is considered "invalid".  When selecting an input Job for another Job, users have the options of selecting all Records, those that passed all validations tests, or those that may have failed one or more.

The following is a screenshot from a Job Details page, showing that one Validation Scenario was run, and 761 Records failed validation:

.. figure:: img/job_details_validation_results.png
   :alt: All Validation Tests run for this Job
   :target: _images/job_details_validation_results.png

   Results of all Validation Tests run for this Job

Clicking into "See Failures" brings up the resulting screen:

.. figure:: img/validation_failures_table.png
   :alt: Table of all Validation failures, for a particular Validation, for a Job
   :target: _images/validation_failures_table.png

   Table of all Validation failures, for a particular Validation, for a Job

The column ``Validation Results Payload`` contains the message from the Validation Test (results may be generated from Schematron, or Python, and there may be multiple results), and the ``Failure Count`` column shows how many specific tests were failed for that Record (a single Validation Scenario may contain multiple individual tests).

Clicking into a single Record from this table will reveal the Record details page, which has its own area dedicated to what Validation Tests it may have failed:

.. figure:: img/record_validation_results.png
   :alt: Record's Validation Results tab
   :target: _images/record_validation_results.png

   Record's Validation Results tab

From this screen, it is possible to Run the Validation and receive the raw results from the "Run Validation" link:

.. figure:: img/raw_schematron_results.png
   :alt: Raw Schematron validation results
   :target: _images/raw_schematron_results.png

   Raw Schematron validation results

Or, a user can send this single Record to the Validation testing area to re-run validation scenarios, or test new ones, by clicking the "Test Validation Scenario on this Record" button.  From this page, it is possible select pre-existing Validation Scenarios to apply to this Record in real-time, users can then edit those to test, or try completely new ones (see `Validation Scenarios for more on testing <configuration.html#validation-scenario>`_):

.. figure:: img/validation_testing.png
   :alt: Validation Scenario testing screen
   :target: _images/validation_testing.png

   Validation Scenario testing screen


text:
Experiments, mostly. Some math, some puzzle solving.

For the story behind Nicomedes.c: http://pergelator.blogspot.com/search?q=Nicomedes

For the story behind permute.c:   http://pergelator.blogspot.com/2015/05/permutations.html

For the story behind base64.c:    https://pergelator.blogspot.com/2008/10/sarah-base64.html

For the story behind Factorial.c  https://pergelator.blogspot.com/2018/03/factorial.html

For the story behind permute.c    http://qr.ae/TUTJVh (Quora.com)


text:
package me.prettyprint.cassandra.service;

import java.util.List;
import java.util.Set;

import me.prettyprint.cassandra.connection.HConnectionManager;
import me.prettyprint.hector.api.exceptions.HectorTransportException;

/**
 * Defines the various JMX methods the CassandraClientMonitor exposes.
 *
 * @author Ran Tavory (ran@outbain.com)
 *
 */
public interface CassandraClientMonitorMBean {

  /**
   * @return Number of failed (and not-recovered) writes.
   */
  long getWriteFail();

  /**
   * @return Number of failed (and not recovered) reads.
   */
  long getReadFail();

  /**
   * @return Number of {@link org.apache.cassandra.thrift.TimedOutException} that the client has been able to recover from by
   * failing over to a different host in the ring.
   */
  long getRecoverableTimedOutCount();

  /**
   * @return Number of {@link org.apache.cassandra.thrift.UnavailableException} that the client has been able to recover from by
   * failing over to a different host in the ring.
   */
  long getRecoverableUnavailableCount();

  /**
   * @return Number of {@link TTransportException} that the client has been able to recover from by
   * failing over to a different host in the ring.
   */
  long getRecoverableTransportExceptionCount();

  /**
   * Returns the total number of recoverable errors which is the sum of getRecoverableTimedOutCount,
   * getRecoverableTimedOutCount and getRecoverableTransportExceptionCount
   * @return the total number of recoverable errors by failing over the other hosts.
   */
  long getRecoverableErrorCount();

  /**
   * @return Number of times a skip-host was performed. Hosts are skipped when there are errors at
   * the current host.
   */
  long getSkipHostSuccess();

  /**
   * @return Number of times clients were requested when connection pools were exhausted.
   */
  long getNumPoolExhaustedEventCount();

  /**
   * Number of existing connection pools.
   * There may be up to one pool per cassandra host.
   */
  int getNumPools();

  /**
   * Total number of idle clients in all client pools
   */
  int getNumIdleConnections();

  /**
   * Total number of active clients in all client pools
   */
  int getNumActive();

  /**
   * Number of exhausted connection pools
   * @return
   */
  int getNumExhaustedPools();

  long getRecoverableLoadBalancedConnectErrors();

  /**
   * List of exhausted pools.
   * @return
   */
  Set<String> getExhaustedPoolNames();

  /**
   * Number of threads that are currently blocked, waiting for a free connection.
   */
  int getNumBlockedThreads();

  /**
   * How many times did initial connection failed.
   * @return
   */
  long getNumConnectionErrors();

  public List<String> getKnownHosts();

  /**
   * Tells all pulls to update their list of known hosts.
   * This is useful when an admin adds/removes a host from the ring and wants the application to
   * update asap.
   */
  public void updateKnownHosts() throws HectorTransportException;

  /**
   * Retrieves stats per pool.
   *
   */
  public List<String> getStatisticsPerPool();

  /**
   * Add a host in the format of "[hostname]:[port]"
   *
   * @param hostStr
   * @return
   */
  boolean addCassandraHost(String hostStr);

  /**
   * Remove a host in the format of "[hostname]:[port]"
   * @see {@link CassandraHost#equals(Object)} for how hosts are compared
   *
   * @param hostStr
   * @return
   */
  boolean removeCassandraHost(String hostStr);

  /**
   * @see {@link #removeCassandraHost(String)} above for semantics of the host string.
   * @see {@link HConnectionManager#removeCassandraHost(CassandraHost)} for details of this operation.
   * @param hostStr
   * @return
   */
  boolean suspendCassandraHost(String hostStr);

  /**
   * @see {@link #suspendCassandraHost(String)} above. This is the opposite.
   * @param hostStr
   * @return
   */
  boolean unsuspendCassandraHost(String hostStr);

  Set<String> getSuspendedCassandraHosts();

  boolean setCassandraHostRetryDelay(String retryDelay);

  /**
   * Total number of connections created due to previous idle connections.
   */
  int getNumRenewedIdleConnections();

  /**
   * Total number of connections created due to previous too long connections.
   */
  int getNumRenewedTooLongConnections();
}


text:
from flask.ext.wtf import Form
from wtforms import TextField, BooleanField, TextAreaField, IntegerField,DecimalField,HiddenField,SelectField
from wtforms.widgets import HiddenInput
#from wtforms_components  import read_only
from wtforms.ext.dateutil.fields import DateField, DateTimeField
from wtforms.validators import Required, Length
from flask.ext.babel import gettext
from app.models import User
import bust_a_bill_forms

class LoginForm(Form):
    openid = TextField('openid', validators = [Required()])
    remember_me = BooleanField('remember_me', default = False)

class EditForm(Form):
    nickname = TextField('nickname', validators = [Required()])
    about_me = TextAreaField('about_me', validators = [Length(min = 0, max = 140)])

    def __init__(self, original_nickname, *args, **kwargs):
        Form.__init__(self, *args, **kwargs)
        self.original_nickname = original_nickname

    def validate(self):
        if not Form.validate(self):
            return False
        if self.nickname.data == self.original_nickname:
            return True
        if self.nickname.data != User.make_valid_nickname(self.nickname.data):
            self.nickname.errors.append(gettext('This nickname has invalid characters. Please use letters, numbers, dots and underscores only.'))
            return False
        user = User.query.filter_by(nickname = self.nickname.data).first()
        if user != None:
            self.nickname.errors.append(gettext('This nickname is already in use. Please choose another one.'))
            return False
        return True

class PostForm(Form):
    post = TextField('post', validators = [Required()])

class SearchForm(Form):
    search = TextField('search', validators = [Required()])

class InputIncomeForm(Form):
    id = IntegerField('id',widget=HiddenInput())
    next_step = HiddenField('next_step')
    start_date = DateField('start_date', validators = [Required()], display_format='%m-%d-%Y')
    end_date = DateField('end_date', validators = [Required()], display_format='%m-%d-%Y')
    description = TextField('description',validators = [Required()])
    no_vacations = IntegerField('no_vacations', validators = [Required()])
    no_holidays = IntegerField('no_holidays', validators = [Required()])
    no_sickdays = IntegerField('no_sickdays', validators = [Required()])
    hourly_rate = DecimalField('hourly_rate', validators = [Required()], places=2)
    hourly_perdiem = DecimalField('hourly_perdiem', validators = [Required()], places=2)

    work_hours = DecimalField('work_hours', validators = [Required()],places=2)
#    exclude_nth = SelectField('exclude_nth', choices=[('1', 'Every'), ('2', '2nd'), ('3', '3rd'),('4', '4th'),('5', '5th'),('6', '6th'),('7', '7th'),('8', '8th'),('9', '9th'),('10', '10th')])
    exclude_nth = SelectField('exclude_nth',choices=[(0, 'Select'),(1, 'Every')])

    exclude_day = SelectField('exclude_day', choices=[('SU', 'SU'), ('MO', 'MO'), ('TU', 'TU'),('WE', 'WE'),('TH', 'TH'),('FR', 'FR'),('SA', 'SA')])

    income = DecimalField('income',places=2, widget = HiddenInput())
    total_perdiem = DecimalField('income',places=2, widget = HiddenInput())
    total_income = DecimalField('total_income',places=2)  #form only field
    total_days=IntegerField('total_days',widget=HiddenInput())
    total_weekends=IntegerField('total_weekends',widget=HiddenInput())
    total_exclusion_days=IntegerField('total_exclusion_days',widget=HiddenInput())

    def __init__(self,   *args, **kwargs):
        Form.__init__(self, *args, **kwargs)

    def validate(self):
	#if not Form.validate(self):
        #    return False
        #if self.nickname.data != User.make_valid_nickname(self.nickname.data):
        #    self.nickname.errors.append(gettext('Error message here.'))
        #    return False
        #user = User.query.filter_by(nickname = self.nickname.data).first()
        #if user != None:
        #    self.nickname.errors.append(gettext('This nickname is already in use. Please choose another one.'))
        #    return False
        return True

class ContractsListForm(Form):
    """
    start_date = DateField('start_date', validators = [Required()], display_format='%Y-%m-%d')
    end_date = DateField('end_date', validators = [Required()], display_format='%Y-%m-%d')
    description = TextField('description',validators = [Required()])
    income = TextField('income')
    """
    search = TextField('search',validators = [Required()])
    sel = BooleanField('sel')
    def __init__(self,   *args, **kwargs):
        Form.__init__(self, *args, **kwargs)

    def validate(self):
	if not Form.validate(self):
            return False
        return True

class InputExpenseForm(Form):
    id = IntegerField('id',widget=HiddenInput())
    next_step = HiddenField('next_step')
    description = TextField('description')
    start_date = DateField('start_date', display_format='%m-%d-%Y')
    end_date = DateField('end_date', display_format='%m-%d-%Y')
    no_vacations = IntegerField('no_vacations',widget=HiddenInput())
    total_exclusion_days = IntegerField('total_exclusion_days',widget=HiddenInput())
    no_holidays = IntegerField('no_holidays',widget=HiddenInput())
    no_sickdays = IntegerField('no_sickdays',widget=HiddenInput())

    tp_from = TextField('tp_from')
    tp_to = TextField('tp_to')

    tp_depart_date = DateField('tp_depart_date', display_format='%m-%d-%Y')
    tp_return_date = DateField('tp_return_date', display_format='%m-%d-%Y')

    is_rent_acar = BooleanField('is_rent_acar')
    rental_st_day = SelectField('rental_st_day', choices=[('SU', 'SU'), ('MO', 'MO'), ('TU', 'TU'),('WE', 'WE'),('TH', 'TH'),('FR', 'FR'),('SA', 'SA')])
    rental_end_day = SelectField('rental_end_day', choices=[('SU', 'SU'), ('MO', 'MO'), ('TU', 'TU'),('WE', 'WE'),('TH', 'TH'),('FR', 'FR'),('SA', 'SA')])
    rental_car_rate = DecimalField('rental_car_rate', validators = [Required()], places=2)

    is_hotel = BooleanField('is_hotel')
    hotel_st_day = SelectField('hotel_st_day', choices=[('SU', 'SU'), ('MO', 'MO'), ('TU', 'TU'),('WE', 'WE'),('TH', 'TH'),('FR', 'FR'),('SA', 'SA')])
    hotel_end_day = SelectField('hotel_end_day', choices=[('SU', 'SU'), ('MO', 'MO'), ('TU', 'TU'),('WE', 'WE'),('TH', 'TH'),('FR', 'FR'),('SA', 'SA')])
    hotel_rate = DecimalField('hotel_rate', validators = [Required()], places=2)
    daily_expense = DecimalField('daily_expense', validators = [Required()], places=2)

    is_flight = BooleanField('is_flight')
    flight_ticket = DecimalField('flight_ticket', validators = [Required()], places=2)

    is_airport_pickup = BooleanField('is_airport_pickup')
    airport_pickup = DecimalField('airport_pickup', validators = [Required()], places=2)

    is_mileage = BooleanField('is_mileage')
    commute_st_day = SelectField('commute_st_day', choices=[('SU', 'SU'), ('MO', 'MO'), ('TU', 'TU'),('WE', 'WE'),('TH', 'TH'),('FR', 'FR'),('SA', 'SA')])
    commute_end_day = SelectField('commute_end_day', choices=[('SU', 'SU'), ('MO', 'MO'), ('TU', 'TU'),('WE', 'WE'),('TH', 'TH'),('FR', 'FR'),('SA', 'SA')])
    daily_miles = DecimalField('daily_miles', validators = [Required()], places=2)
    mileage_rate = DecimalField('mileage_rate', validators = [Required()], places=2)
    expense = DecimalField('expense',places=2)

    rental_days=IntegerField('rental_days',widget=HiddenInput())
    hotel_days=IntegerField('hotel_days',widget=HiddenInput())
    no_flights=IntegerField('no_flights',widget=HiddenInput())
    commute_days=IntegerField('commute_days',widget=HiddenInput())

    def __init__(self,   *args, **kwargs):
        Form.__init__(self, *args, **kwargs)

    def validate(self):
	#if not Form.validate(self):
        #    return False
        return True

class InputOtherDedForm(Form):

    id = IntegerField('id',widget=HiddenInput())
    next_step = HiddenField('next_step')
    description = TextField('description')
    start_date = DateField('start_date', display_format='%m-%d-%Y')
    end_date = DateField('end_date', display_format='%m-%d-%Y')
    other_deductions = DecimalField('other_deductions',places=2)

    hsa_contr = DecimalField('hsa_contr', validators = [Required()], places=2)
    hsa_contr_freq = SelectField('hsa_contr_freq', choices=[('W', 'Weekly'), ('BW', 'Bi-Weekly'), ('M', 'Monthly')])
    is_hsa_pre_tax = BooleanField('is_hsa_pre_tax')
    retirement_contr = DecimalField('retirement_contr', validators = [Required()], places=2)
    retirement_contr_freq = SelectField('retirement_contr_freq', choices=[('W', 'Weekly'), ('BW', 'Bi-Weekly'), ('M', 'Monthly')])
    is_retirement_pre_tax =BooleanField('is_retirement_pre_tax')
    health_ins_prem = DecimalField('health_ins_prem', validators = [Required()], places=2)
    health_ins_freq = SelectField('health_ins_freq', choices=[('W', 'Weekly'), ('BW', 'Bi-Weekly'), ('M', 'Monthly')])
    is_health_pre_tax = BooleanField('is_health_pre_tax')
    vision_ins_prem = DecimalField('vision_ins_prem', validators = [Required()], places=2)
    is_vision_pre_tax = BooleanField('is_vision_pre_tax')
    vision_ins_freq = SelectField('vision_ins_freq', choices=[('W', 'Weekly'), ('BW', 'Bi-Weekly'), ('M', 'Monthly')])
    dental_ins_prem = DecimalField('dental_ins_prem', validators = [Required()], places=2)
    dental_ins_freq =SelectField('dental_ins_freq', choices=[('W', 'Weekly'), ('BW', 'Bi-Weekly'), ('M', 'Monthly')])
    is_dental_pre_tax = BooleanField('is_dental_pre_tax')
    shortterm_dis_prem = DecimalField('shortterm_dis_prem', validators = [Required()], places=2)
    shortterm_dis_freq=SelectField('shortterm_dis_freq', choices=[('W', 'Weekly'), ('BW', 'Bi-Weekly'), ('M', 'Monthly')])
    is_shortterm_pre_tax=BooleanField('is_shortterm_pre_tax')
    longterm_dis_prem = DecimalField('longterm_dis_prem', validators = [Required()], places=2)
    longterm_dis_freq=SelectField('longterm_dis_freq', choices=[('W', 'Weekly'), ('BW', 'Bi-Weekly'), ('M', 'Monthly')])
    is_longterm_pre_tax = BooleanField('is_longterm_pre_tax')
    life_ins_prem = DecimalField('life_ins_prem', validators = [Required()], places=2)
    life_ins_freq=SelectField('life_ins_freq', choices=[('W', 'Weekly'), ('BW', 'Bi-Weekly'), ('M', 'Monthly')])
    is_life_pre_tax = BooleanField('is_life_pre_tax')

    no_hsa_contr=IntegerField('no_hsa_contr',widget=HiddenInput())
    no_retirement_contr=IntegerField('no_retirement_contr',widget=HiddenInput())
    no_health_ins=IntegerField('no_health_ins',widget=HiddenInput())
    no_vision_ins=IntegerField('no_vision_ins',widget=HiddenInput())
    no_dental_ins=IntegerField('no_dental_ins',widget=HiddenInput())
    no_shortterm_dis=IntegerField('no_shortterm_dis',widget=HiddenInput())
    no_longterm_dis=IntegerField('no_longterm_dis',widget=HiddenInput())
    no_life_ins=IntegerField('no_life_ins',widget=HiddenInput())

    def __init__(self,   *args, **kwargs):
        Form.__init__(self, *args, **kwargs)

    def validate(self):
	#if not Form.validate(self):
        #    return False
        return True

class InputTaxForm(Form):

    id = IntegerField('id',widget=HiddenInput())
    description = TextField('description')

    next_step = HiddenField('next_step')
    start_date = DateField('start_date', display_format='%m-%d-%Y')
    end_date = DateField('end_date', display_format='%m-%d-%Y')
    taxes = DecimalField('taxes',places=2)

    fed_tax_perc = DecimalField('fed_tax_perc', validators = [Required()], places=2)
    state_tax_perc = DecimalField('state_tax_perc', validators = [Required()], places=2)
    ssn_tax_perc = DecimalField('ssn_tax_perc', validators = [Required()], places=2)
    self_emp_tax_perc = DecimalField('self_emp_tax_perc', validators = [Required()], places=2)
    medicare_tax_perc=DecimalField('medicare_tax_perc', validators = [Required()], places=2)

    fed_tax = DecimalField('fed_tax', validators = [Required()], places=2)
    state_tax = DecimalField('state_tax', validators = [Required()], places=2)
    ssn_tax = DecimalField('ssn_tax', validators = [Required()], places=2)
    self_emp_tax = DecimalField('self_emp_tax', validators = [Required()], places=2)
    medicare_tax=DecimalField('medicare_tax', validators = [Required()], places=2)

    def __init__(self,   *args, **kwargs):
        Form.__init__(self, *args, **kwargs)

    def validate(self):
	#if not Form.validate(self):
        #    return False
        return True

class InputDocsForm(Form):

    id = IntegerField('id',widget=HiddenInput())
    description = TextField('description')
    sel = BooleanField('sel')
    next_step = HiddenField('next_step')
    start_date = DateField('start_date', display_format='%m-%d-%Y')
    end_date = DateField('end_date', display_format='%m-%d-%Y')

    def __init__(self,   *args, **kwargs):
        Form.__init__(self, *args, **kwargs)

    def validate(self):
	#if not Form.validate(self):
        #    return False
        return True


text:
import Media from 'appkit/libs/media';

var Folder = Media.extend({
  mediaType    : 'folder',
  id           : null,
  title        : null,
  description  : null,
  parentId     : null,
  folderChain  : null
});

Folder.reopenClass({
  createFromData: function(data) {
    var folder = Folder.create({
      id          : data.id,
      title       : data.title,
      description : data.description,
      parentId    : data.parent_id
    });
    return folder;
  }
});

export default Folder;


text:
title: "Kubeflow's 1.4 release lays the foundation for advanced ML metadata workflows"
layout: post
toc: true
comments: true
image: images/logo.png
hide: false
categories: [release]
permalink: /kubeflow-1.4-release/
author: "Josh Bottum, Kimonas Sotirchos, Thea Lamkin"
---

The Kubeflow 1.4 release lays several important building blocks for the use of advanced metadata workflows. A quick summary of
1.4's top deliveries includes:

- Advanced metadata workflows with improved metric visualization and pipeline
  step [caching](https://www.kubeflow.org/docs/components/pipelines/caching-v2/)
  in Kubeflow Pipelines (KFP) via the KFP Software Development Kit (SDK)
- A new KFServing
  [model user interface](https://www.kubeflow.org/docs/components/kfserving/webapp/)
  that displays ML model status, configuration, yaml, logs, and metrics
- New [Optuna](https://github.com/optuna/optuna) Suggestion Service with
  multivariate TPE algorithm and Sobol's
  [Quasirandom](https://github.com/kubeflow/katib/pull/1523) Sequence support
  for hyperparameter tuning
- A new, unified training operator that supports all deep learning frameworks
  with a Python SDK, enhanced monitoring and advanced scheduling support

Kubeflow 1.4 enables the use of metadata in advanced machine learning (ML) workflows, especially
in the Kubeflow Pipelines SDK. With the Pipelines SDK and its new
[V2-compatible mode](https://www.kubeflow.org/docs/components/pipelines/sdk/v2/v2-compatibility/),
users can create advanced ML pipelines with Python functions that use the [MLMD](https://github.com/google/ml-metadata) as
input/output arguments. This simplifies
[metrics visualization](https://www.kubeflow.org/docs/components/pipelines/sdk/output-viewer/#v2-sdk-use-sdk-visualization-apis).

Another enhancement to Pipelines is the option to use the
[Emissary executor](https://www.kubeflow.org/docs/components/pipelines/installation/choose-executor/)
for non-Docker Kubernetes container runtime requirements. In addition, 1.4 can
support metadata-based workflows to streamline the creation of TensorBoard
visualizations and to serve ML models.

## Core improvements to code, process, and documentation

For the Kubeflow Working Groups, 1.4 was primarily a maintenance release,
which enabled the Community to concentrate on core improvements to code,
process, and documentation. In the
[2021 Kubeflow User Survey](https://blog.kubeflow.org/kubeflow-continues-to-move-to-production),
users requested documentation improvements (please see the figure below). The
Kubeflow 1.4 release cycle included the 1.4 Docs Sprint that generated nearly
fifty (50) PRs. These PRs were tracked in this
[issue](https://github.com/kubeflow/website/issues/2879) and this
[Kanban](https://github.com/orgs/kubeflow/projects/46) board, and we encourage
more users to contribute by reading and improving the Kubeflow documentation.

![docs sprint](/images/2021-10-12-kubeflow-1.4-release/docs-sprint.png)

The 1.4 release improvements simplify future feature development by reducing
redundant code, increasing CI/CD, and automating testing. An important delivery
was the new Unified Training Operator for Tensorflow, PyTorch, MXNet, and
XGBoost [PR#1302](https://github.com/kubeflow/tf-operator/pull/1302). 1.4 also
initiated the Community's adoption of a defined release process in its new
Kubeflow [Release Handbook](https://github.com/kubeflow/manifests/pull/1907).
The Handbook defines the stages of the release and contributors' roles, which
has helped to improve responsibilities and quality.

## Simplified installation

As shown in the Kubeflow User Survey (see the figure above), users have also
asked for installation improvements. In Kubeflow 1.3, the Community refactored
the Kubeflow deployment pattern to use manifests files (in yaml or json), which
are stored in Git repositories, and then deployed using the Kustomize
installation tool. This flexible installation pattern simplifies customization
by overlaying manifests. This pattern is now being exploited in 1.4.

In 1.4, the Community provides an upstream set of base manifests in the
Kubeflow manifest repo. Third parties have built custom installation guides
or distributions with overlays that extend the base manifests. In 1.4, the
third party overlays were removed from the Kubeflow
[manifest repo](https://github.com/kubeflow/manifests) and moved to the
repository of their choosing. This pattern provides third parties more
flexibility to upgrade and document their overlays. You can see a full set of
installation guides and distributions
[here](https://www.kubeflow.org/docs/started/installing-kubeflow/).

In addition, on-prem Kubeflow users can use the base installation manifests
which utilize open source solutions like [Istio](https://istio.io/),
[Dex](https://dexidp.io/), and
[AuthService](https://github.com/arrikto/oidc-authservice) for authentication.
The Community and the Manifests Working Group are actively working to provide
extra overlays and patches to accommodate more advanced use cases and
installations. For example, we recently
[configured](https://github.com/kubeflow/manifests/pull/2048) Knative to work
with the AuthService and Dex.

## Dependencies, change logs, tracking issues and roadmaps

Kubeflow has many software dependencies. In 1.4, the top dependencies used in
testing are defined below:

    Kubeflow Dependency
    Version

    Kubernetes
    1.19.0

    Istio
    1.9.6

    Knative
    0.22.1

    Kustomize
    3.2.0

This chart provides links to important details from the Working Groups,
including their 1.4 tracking issues, change logs, and roadmaps. Please
note that the Working Groups use version numbers that are specific to
their project. As a result, many Kubeflow components, which have been
incorporated and tested in Kubeflow 1.4, may have a different version
number than 1.4.

    Working Group
    Changelog / Release Notes
    Roadmap

    Notebooks

      1.4,

        releases/tag/v1.4.0

        kubeflow/issues/5978

    Training Operators

      1.3,

        Training Operator Changelog

        Training Operators Roadmap

    Katib

      V0.12,

        Katib Release Notes

        PR for v0.12

        Katib Roadmap

    Kubeflow Pipelines

      v1.7

        Release Notes, Changelog

        Pipelines Roadmap

    KFServing

      v0.6.1,

        kfserving/releases/tag/v0.6.1

        KFServing Roadmap

## Kubeflow 1.4 video update and tutorials

The Kubeflow Working Group representatives have recorded a
[presentation](https://youtu.be/gG61gHw4J14) on Kubeflow 1.4's new
features, which you can find on the
[Kubeflow YouTube channel](https://www.youtube.com/kubeflow). Additionally,
Kubeflow 1.4's new features are easy to try in these tutorials:

- AutoML [Tutorial](https://codelabs.arrikto.com/codelabs/minikf-kale-automl/index.html?index=../..index#0)
  with metadata based workflows to build TensorBoards and to serve models
- Run Katib from your **local laptop** by following [this example](https://github.com/kubeflow/katib/tree/master/examples/v1beta1/kind-cluster).
- KFP [Tutorial](https://www.kubeflow.org/docs/components/pipelines/sdk/v2/build-pipeline/)
  using Pipelines SDK v2 to orchestrate your ML workflow as a pipeline
- KFServing [Tutorial](https://github.com/kserve/kserve/tree/release-0.6/docs/samples)
- Training Operator [Tutorial](https://github.com/kubeflow/training-operator/tree/master/examples)

## What's coming

The Kubeflow Community is working on Kubeflow 1.5 planning and the Kubeflow
Conformance Program [proposal](https://github.com/kubeflow/community/pull/524).
Please watch [blog.kubeflow.org](https://blog.kubeflow.org/) for updates on
these topics and more.

## Join the community

We would like to thank everyone for their efforts on Kubeflow 1.4, especially
the users, code contributors and working group leads. As you can see from the
extensive contributions to Kubeflow 1.4, the Kubeflow Community is vibrant and
diverse, and solving real world problems for organizations around the world.

Want to help? The Kubeflow Community
[Working Groups](https://github.com/kubeflow/community/blob/master/wg-list.md)
hold open meetings, public lists, and are always looking for more volunteers
and users to unlock the potential of machine learning. If you're interested in
becoming a Kubeflow contributor, please feel free to check out the resources
below. We look forward to working with you!

- Visit our [Kubeflow website](https://www.kubeflow.org/) or
  [Kubeflow GitHub page](https://github.com/kubeflow)
- Join the [Kubeflow Slack channel](https://join.slack.com/t/kubeflow/shared_invite/enQtMjgyMzMxNDgyMTQ5LWUwMTIxNmZlZTk2NGU0MmFiNDE4YWJiMzFiOGNkZGZjZmRlNTExNmUwMmQ2NzMwYzk5YzQxOWQyODBlZGY2OTg)
- Join the
  [kubeflow-discuss](https://groups.google.com/forum/#!forum/kubeflow-discuss)
  mailing list
- Attend a
  [weekly community meeting](https://www.kubeflow.org/docs/about/community/)


text:
import { Component, OnInit } from '@angular/core';
import { MatSnackBar } from '@angular/material';
import { Router } from '@angular/router';
import { UserInfo } from '../../shared/models/user.info.model';
import { ApiUserService } from '../../shared/service/api.users.service';
import { ApplicationState } from '../../shared/service/application.state';
import { MessageUtils } from '../../shared/utils/message.utils';

@Component({
  selector: 'app-edit',
  templateUrl: './edit.component.html',
  styleUrls: ['./edit.component.css']
})
export class EditComponent implements OnInit {

  public jsonPayload: string;
  public isEditable = false;

  constructor(private userService: ApiUserService,
    private state: ApplicationState,
    private snackBar: MatSnackBar,
    private router: Router,
  ) {}

  ngOnInit() {

    this.userService.getUserInfo()
      .subscribe(
        data => {
          this.isEditable = data.editable;
          if (!data.editable) {
            new MessageUtils().showError(this.snackBar, 'No permission to edit data!');
            this.router.navigateByUrl('/home');
            return;
          }

          this.jsonPayload = this.jsonify(data);
        },
        error => {
          console.log('Error: ' + error);
          new MessageUtils().showError(this.snackBar, error);
        }
      );
  }

  public save() {
    console.log('Save the JSON payload!');

    this.state.setProgress(true);

    let user: UserInfo;
    user = JSON.parse(this.jsonPayload);
    this.userService.saveUserInfo(user)
      .subscribe(
        data => {
          // stupid hack, to enforce a redirect to re-challenge authentication
          // the better approach would be to handle 302 or 403 and act accordingly
          if (data.userName === '__RELOGIN__') {
            console.log('No result received from backend - re-trigger authentication process!');
            window.location.href = '/relogin';
            return;
          }

          console.log('saved!');
          this.jsonPayload = this.jsonify(data);
          this.state.setProgress(false);
        },
        error => {
          this.state.setProgress(false);
          console.log('Error: ' + error);
          new MessageUtils().showError(this.snackBar, error);
        }
      );
  }

  private jsonify(data: UserInfo) {
    return JSON.stringify(data, null, 4);
  }
}