text:
define({
  "_widgetLabel": "Edytor atrybutów wsadowych",
  "widgetIntroSelectByArea": "Użyj jednego z poniższych narzędzi, aby utworzyć wybrany zestaw obiektów do zaktualizowania. Jeśli wiersz został wyróżniony, przekroczono maksymalną liczbę rekordów.",
  "widgetIntroSelectByFeature": "Użyj poniższego narzędzia, aby wybrać obiekt z warstwy ${0}. Ten obiekt zostanie użyty do wybrania i zaktualizowania wszystkich przecinających się z nim obiektów. Jeśli wiersz został wyróżniony, przekroczono maksymalną liczbę rekordów.",
  "widgetIntroSelectByFeatureQuery": "Użyj poniższego narzędzia, aby wybrać obiekt z warstwy ${0}. Atrybut ${1} tego obiektu będzie używany do tworzenia zapytań dotyczących poniższych warstw i aktualizowania obiektów wynikowych. Jeśli wiersz został wyróżniony, przekroczono maksymalną liczbę rekordów.",
  "widgetIntroSelectByQuery": "Wprowadź wartość, aby utworzyć zestaw wybranych elementów. Jeśli wiersz został wyróżniony, przekroczono maksymalną liczbę rekordów.",
  "layerTable": {
    "colLabel": "Nazwa warstwy tematycznej",
    "numSelected": "#",
    "colSyncStatus": ""
  },
  "noConfiguredLayers": "Brak skonfigurowanych edytowalnych warstw",
  "editorPopupTitle": "Edytor atrybutów wsadowych",
  "editorPopupSaveBtn": "Zapisz",
  "editorPopupMultipleValues": "",
  "clear": "Wyczyść",
  "featuresUpdated": "Uaktualnione obiekty: ${0} / ${1}",
  "featuresSelected": "Wybrane obiekty: ${0}",
  "featuresSkipped": "Pominięte",
  "search": "Szukaj",
  "queryInput": "Wprowadź wartość do zapytania",
  "noFilterTip": "Jeżeli wyrażenie filtru nie zostanie zdefiniowane, zadanie zapytania zwróci wszystkie obiekty w podanym źródle danych.",
  "setFilterTip": "Skonfiguruj poprawnie filtr.",
  "filterPopup": "Filtruj warstwę",
  "cancel": "Anuluj",
  "noValue": "Brak wartości",
  "emptyString": "Pusty ciąg",
  "existingValue": "Zachowaj istniejącą wartość",
  "newDate": "Nowa data",
  "valueChooser": "Wybierz/wprowadź wartość",
  "ok": "OK",
  "drawBox": {
    "point": "Punkt",
    "line": "Linia",
    "polyline": "Polilinia",
    "freehandPolyline": "Polilinia odręczna",
    "extent": "Zasięg",
    "polygon": "Wielokąt",
    "freehandPolygon": "Poligon odręczny",
    "clear": "Wyczyść",
    "addPointToolTip": "Kliknij, aby wybrać na tym obszarze",
    "addShapeToolTip": "Aby wybrać obiekty, zaznacz obszar",
    "freehandToolTip": "Naciśnij i przytrzymaj, aby narysować kształt w celu zaznaczenia obiektów",
    "startToolTip": "Aby wybrać obiekty, zaznacz obszar"
  },
  "errors": {
    "layerNotFound": "Nie znaleziono na mapie warstwy ${0} z identyfikatorem ${1}; od chwili konfiguracji widżetu mapa mogła się zmienić",
    "queryNullID": "Obiekt z ${0} zwrócił nieprawidłowy identyfikator",
    "noSelectedLayers": "Brak wybranych warstw z rekordami do uaktualnienia",
    "inputValueError": "Nieprawidłowa wartość w formularzu",
    "saveError": "Liczba obiektów, dla których zapis był niemożliwy: ${0}, szczegóły dodano do konsoli",
    "requiredValue": "Wartość wymagana"
  }
});


text:
Contributing to FuelPHP
=======================

Any person or company wanting to contribute to FuelPHP should follow the
following rules to increase the change of the contribution being accepted.

Sign your Work
--------------

We require that all contributors "sign-off" on their commits.  This
certifies that the contribution is your original work, or you have rights to
submit it under the same license, or a compatible license.

Any contribution which contains commits that are not Signed-Off will not be
accepted.

To sign off on a commit you simply use the `--signoff` (or `-s`) option when
committing your changes:

    $ git commit -s -m "Adding a new widget driver for cogs."

This will append the following to your commit message:

    Signed-off-by: Your Name <your@email.com>

By doing this you certify the below:

    Developer's Certificate of Origin 1.1

    By making a contribution to this project, I certify that:

    (a) The contribution was created in whole or in part by me and I
        have the right to submit it under the open source license
        indicated in the file; or

    (b) The contribution is based upon previous work that, to the best
        of my knowledge, is covered under an appropriate open source
        license and I have the right under that license to submit that
        work with modifications, whether created in whole or in part
        by me, under the same open source license (unless I am
        permitted to submit under a different license), as indicated
        in the file; or

    (c) The contribution was provided directly to me by some other
        person who certified (a), (b) or (c) and I have not modified
        it.

    (d) I understand and agree that this project and the contribution
        are public and that a record of the contribution (including all
        personal information I submit with it, including my sign-off) is
        maintained indefinitely and may be redistributed consistent with
        this project or the open source license(s) involved.

#### Quick Tip

If you would like to Sign-Off on all of your commits automatically (not
recommended unless you are 100% sure).  To do this, you can simply create
an alias for `git commit -s`:

    $ git config --global alias.cs 'commit -s'

If you wish to only include this for your current repository, simply leave
the `--global` option off:

    $ git config alias.cs 'commit -s'

Now you can Sign-Off on all of your commits if you commit with `git cs`.

Creating and Submitting Contributions
-------------------------------------

FuelPHP uses the Git version control system and hosts it's repositories on
GitHub.  All contributions are submitted using the GitHub Pull Request
system.  No contributions are accepted via email or the community forums.

FuelPHP takes advantage of Git submodules.  They allow for the separation of
the components and packages into individual repositories, making it easier
for development and upgrades.

### Setting Up Your Local Environment

To get started, you first need to Fork the repository you wish to contribute
to on GitHub by visiting the the repository GitHub and clicking the "Fork"
button.

**Note:** We will assume throughout this document that you are contributing
to the _core_ repository.

Once you have setup your Fork you are ready to clone it and start working:

1.  Start by cloning your Fork:

        $ git clone git@github.com:USERNAME/core.git

2.  Next you need to add the original repository as a new remote named
`upstream`:

        $ cd core
        $ git remote add upstream git://github.com/fuel/core.git
        $ git fetch upstream

### Developing with Contribution in Mind

When developing with the intent for contribution, there are a few things to
keep in mind:

1.  All contributions must be made on the appropriate branch.  Most of the
    time, this will be the `develop` branch for the appropriate version.

    The best way to do this is to make a branch off of the current version's
    `develop` branch:

        $ git checkout BRANCH_NAME 1.3/develop

    **Note:** If the contribution is submitted to the wrong branch, you will
    be asked to re-submit on the correct branch.

2.  Ensure you follow the FuelPHP Coding Standards.
3.  Unit Tests should be submitted with the contribution if applicable.
4.  A separate complimentary contribution should be submitted to the `doc`
    repository containing the documentation for your change if applicable.
5.  Write good commit messages (no "Some changes" type messages please).

### Submitting your Contribution

After you are done making all of your changes, you need to push them up to
your Fork on GitHub, but *first* you need to update your branch with any
changes from the original repository.

When updating your branch, you should use `rebase` and not merge in the
changes:

1.  Update your `1.3/develop` branch with changes from `upstream`:

        $ git checkout 1.3/develop
        $ git fetch upstream
        $ git merge upstream/1.3/develop

2.  Rebase your branch with the `1.3/develop` branch:

        $ git checkout BRANCH_NAME
        $ git rebase 1.3/develop

    You may get merge conflicts while running the `rebase` command.  Resolve
    all conflicts, then continue the `rebase`:

        $ git add ...
        $ git rebase --continue

Once the rebase is complete, you are ready to push your changes up to GitHub:

    $ git push origin BRANCH_NAME

Now visit your Fork on GitHub (https://github.com/USERNAME/core), switch to
your new branch, then click the "Pull Request" button.

In your Pull Request message you should give as much detail as you can,
including any related links (Issues, Forum Threads, etc.).

### After Submission

After submission, you may need to make changes after discussions on the Pull
Request.  If this is the case, there are a few things you need to be aware
of or do.

1.  After making your changes and committing them locally, you need to
    Rebase your branch with
    the the `upstream/1.3/develop` branch:

        $ git rebase -f upstream/1.3/develop

2.  You will need to Force Push your changes up to GitHub.  This will
    automatically update your Pull Request:

        $ git push -f origin BRANCH_NAME

Once we are satisfied, we will merge and close your Pull Request.

### Resources

* [Git Reference](http://gitref.org/)
* [FuelPHP GitHub](https://github.com/fuel)

If you have any questions, you can usually find at least one of the core
developers in our IRC channel: #fuelphp on FreeNode

redpajama_set_name: RedPajamaGithub


text:
package org.apache.hadoop.mapred.gridmix;

import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.security.UnixUserGroupInformation;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.LineReader;

/**
 * Maps users in the trace to a set of valid target users on the test cluster.
 */
public abstract class UserResolver {

  /**
   * Userlist assumes one UGI per line, each UGI matching
   * <username>,<group>[,group]*
   */
  protected List<UserGroupInformation> parseUserList(
      URI userUri, Configuration conf) throws IOException {
    if (null == userUri) {
      return Collections.emptyList();
    }
    final Path userloc = new Path(userUri.toString());
    final Text rawUgi = new Text();
    final FileSystem fs = userloc.getFileSystem(conf);
    final ArrayList<UserGroupInformation> ret = new ArrayList();

    LineReader in = null;
    try {
      final ArrayList<String> groups = new ArrayList();
      in = new LineReader(fs.open(userloc));
      while (in.readLine(rawUgi) > 0) {
        int e = rawUgi.find(",");
        if (e <= 0) {
          throw new IOException("Missing username: " + rawUgi);
        }
        final String username = Text.decode(rawUgi.getBytes(), 0, e);
        int s = e;
        while ((e = rawUgi.find(",", ++s)) != -1) {
          groups.add(Text.decode(rawUgi.getBytes(), s, e - s));
          s = e;
        }
        groups.add(Text.decode(rawUgi.getBytes(), s, rawUgi.getLength() - s));
        if (groups.size() == 0) {
          throw new IOException("Missing groups: " + rawUgi);
        }
        ret.add(new UnixUserGroupInformation(
              username, groups.toArray(new String[groups.size()])));
        groups.clear();
      }
    } finally {
      if (in != null) {
        in.close();
      }
    }
    return ret;
  }

  /**
   * Configure the user map given the URI and configuration. The resolver's
   * contract will define how the resource will be interpreted, but the default
   * will typically interpret the URI as a {@link org.apache.hadoop.fs.Path}
   * listing target users. The format of this file is defined by {@link
   * #parseUserList}.
   * @param userdesc URI (possibly null) from which user information may be
   * loaded per the subclass contract.
   * @param conf The tool configuration.
   * @return true if the resource provided was used in building the list of
   * target users
   */
  public abstract boolean setTargetUsers(URI userdesc, Configuration conf)
    throws IOException;

  // tmp compatibility hack prior to UGI from Rumen
  public UserGroupInformation getTargetUgi(String user)
      throws IOException {
    return getTargetUgi(new UnixUserGroupInformation(
          user, new String[] { "users" }));
  }

  /**
   * Map the given UGI to another per the subclass contract.
   * @param ugi User information from the trace.
   */
  public abstract UserGroupInformation getTargetUgi(UserGroupInformation ugi);

}


text:
/* See the comment by the definition of LIBGCC2_UNITS_PER_WORD in
   m32c.h for why we are creating extra versions of some of the
   functions defined in libgcc2.c.

   Note - this file is separate from lib2funcs.c so that the following
   functions will appear in the their object file.  This is necessary
   because they call abort() which is defined in the C library whereas
   the functions in lib2funcs.c are completely self sufficient.  */

#define LIBGCC2_UNITS_PER_WORD 2

#define L_mulvsi3
#define L_negvsi2
#define L_addvsi3
#define L_subvsi3

#include "libgcc2.c"


text:
using System;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Mvc;
using Bandwidth.Net;
using Bandwidth.Net.Model;
using Microsoft.AspNet.Identity.Owin;
using TranscriptionApp.Models;

namespace TranscriptionApp.Lib
{
    public sealed class ExtractEventAttribute : ActionFilterAttribute
    {
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            try
            {
                using (var reader = new StreamReader(filterContext.RequestContext.HttpContext.Request.InputStream,
                    Encoding.UTF8))
                {
                    var json = reader.ReadToEnd();
                    var ev = BaseEvent.CreateFromString(json);
                    var pi = ev.GetType().GetProperty("CallId");
                    if (pi != null)
                    {
                        var call = new Call {Id = (string)pi.GetValue(ev)};
                        var activeCall =
                            filterContext.RequestContext.HttpContext.GetOwinContext()
                                .Get<ApplicationDbContext>()
                                .ActiveCalls.Find(call.Id);
                        if (activeCall != null)
                        {
                            filterContext.Controller.ViewBag.User = activeCall.User;
                        }
                        filterContext.Controller.ViewBag.Call = call;
                    }
                    filterContext.Controller.ViewBag.Event = ev;
                }
            }
            catch (Exception ex)
            {
                Debugger.Log(0, "Error", ex.Message);
                Trace.WriteLine(ex.Message, "Error");
                filterContext.Result = new HttpStatusCodeResult(HttpStatusCode.BadRequest, "Malformed event");
                return;
            }
            base.OnActionExecuting(filterContext);
        }
    }
}


text:
package id3.utils;

import id3.main.Program;
import id3.main.Settings;
import org.jaudiotagger.audio.AudioFile;
import org.jaudiotagger.audio.AudioFileIO;
import org.jaudiotagger.audio.exceptions.CannotReadException;
import org.jaudiotagger.audio.exceptions.CannotWriteException;
import org.jaudiotagger.audio.exceptions.InvalidAudioFrameException;
import org.jaudiotagger.audio.exceptions.ReadOnlyFileException;
import org.jaudiotagger.tag.FieldKey;
import org.jaudiotagger.tag.Tag;
import org.jaudiotagger.tag.TagException;
import org.jaudiotagger.tag.id3.ID3v23Tag;
import org.jaudiotagger.tag.images.Artwork;

import javax.swing.text.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.text.Normalizer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;

/** A set of utility methods that range from
 * string manipulation to ID3 Tag related
 * operations.
 */
public final class Utils
{
	private static final Logger LOG = Program.LOG;

	/** These words will not be capitalized
	 * @see #capitalizeTitle(String, boolean)
	 */
	public static final String[] IGNORE_CAPS = {"a", "of", "the", "in", "an", "and", "to",
												"with", "are", "if", "be", "has"};

	/* Available fields in iTunes, split by like-data type */
	public static final String[] FIELDS_STRINGS 	= {"Artist", "Album", "Album Artist", "Composer",
														"Grouping", "Genre", "Comments"};
	public static final String[] FIELDS_INTS 		= {"Year", "Track Number", "Track Count", "Disc Number",
														"Disc Count", "BPM"};

	private Utils() {}

	/** Capitalizes the first letter of every word,
	 * by default.
	 * @param toProperTitle  String to capitalize words in.
	 * @param isUseProperEnglishCaps  If true, skip capitalizing
	 * certain words, such as articles (a, of, etc.).
	 * @return  The capitalized String.
	 * @see #IGNORE_CAPS
	 */
	public static String capitalizeTitle(String toProperTitle, boolean isUseProperEnglishCaps)
	{
		if(toProperTitle.isEmpty())
		{
			return "";
		}

		StringBuilder sb = new StringBuilder();
		String[] temp = toProperTitle.split(" ");

		for(String word : temp)
		{
			if(word.matches("[a-zA-Z].*"))
			{
				word = Character.toUpperCase(word.charAt(0)) + word.substring(1);

				if(isUseProperEnglishCaps)
				{
					if(!word.equals(temp[0]))	//Is not first word, check if should be de-capitalized
					{
						for(String article : IGNORE_CAPS)
						{
							if(word.toLowerCase().equals(article))
							{
								word = Character.toLowerCase(word.charAt(0)) + word.substring(1);
								break;
							}
						}
					}
				}
			}
			sb.append(word + " ");
		}
		sb.deleteCharAt(sb.length()-1);

		LOG.log(Level.FINEST, sb.toString());
		return sb.toString();
	}

	/** Replaces metacharacters disallowed in file paths in windows
	 * with an underscore character ("_")
	 * @param text  File path to be altered.
	 * @returns  Windows OS safe file path.
	 */
	public static String removeIllegalWindowsFilePathChars(String text)
	{
		return text.replaceAll("[\\\\:\\/\\*\\?\"<>\\|\\;\\+\\`\\~\\{\\}\\[\\]\\="
								+ "\\!@\\#\\$\\%\\^\\&]", "_");
	}

	/** Removes extension from file name
	 * @param file  {@code File} to remove extension from.
	 * @returns  Literal file name without the extension.
	 */
	public static String getFileNameNoExt(File file)
	{
		String filename = file.getName();
		return filename.substring(0, filename.lastIndexOf("."));
	}

	/** Changes forward slashes '/' to
	 * backslashes '\'. Useful for
	 * comparing inconsistent file path formats.
	 * @param path  File path string to change slashes
	 * @return  Converted string
	 */
	public static String convertForwardToBackSlash(String path)
	{
		if(path.charAt(0) == '/' || path.charAt(0) == '\\')
		{
			path = path.substring(1);
		}

		if(path.charAt(2) == '/')
		{
			path = path.replaceAll("[/]", "\\\\");
		}

		path = path.substring(0, path.lastIndexOf("\\"));
		path = "\"" + path + "\"";
		return path;
	}

	/** Escapes metacharacters for proper string comparison
	 * @param string  String to be escaped
	 * @returns  Meta-character escaped string
	 */
	public static String escapeMetaCharacters(String string)
	{
		string = string.replaceAll("\\\\", "\\\\\\\\");
		string = string.replaceAll("\\.", "\\\\.");
		string = string.replaceAll("\\?", "\\\\?");
		string = string.replaceAll("\\(", "\\\\(");
		string = string.replaceAll("\\)", "\\\\)");
		string = string.replaceAll("\\[", "\\\\[");
		string = string.replaceAll("\\]", "\\\\]");
		string = string.replaceAll("\\{", "\\\\{");
		string = string.replaceAll("\\}", "\\\\}");
		string = string.replaceAll("\\<", "\\\\<");
		string = string.replaceAll("\\>", "\\\\>");
		string = string.replaceAll("\\!", "\\\\!");
		string = string.replaceAll("\\@", "\\\\@");
		string = string.replaceAll("\\#", "\\\\#");
		string = string.replaceAll("\\$", "\\\\\\$");
		string = string.replaceAll("\\%", "\\\\%");
		string = string.replaceAll("\\^", "\\\\^");
		string = string.replaceAll("\\&", "\\\\&");
		string = string.replaceAll("\\*", "\\\\*");
		string = string.replaceAll("\\+", "\\\\+");
		string = string.replaceAll("\\=", "\\\\+");
		string = string.replaceAll("\\-", "\\\\-");
		string = string.replaceAll("\\_", "\\\\_");
		string = string.replaceAll("\\|", "\\\\|");
		string = string.replaceAll("\\\"", "\\\\\"");
		string = string.replaceAll("\\'", "\\\\'");
		string = string.replaceAll("\\:", "\\\\:");
		string = string.replaceAll("\\;", "\\\\;");
		string = string.replaceAll("\\," , "\\\\,");
		string = string.replaceAll("\\/", "\\\\/");
		string = string.replaceAll("\\\\~", "\\\\~");
		return string;
	}

	/** Checks each char in a string to see if the string contains
	 * any char values greater than those used in ASCII.
	 * @param string  String to search for Non-ASCII chars.
	 * @returns  True if any char is greater than u007f, false otherwise
	 */
	public static boolean isContainsNonAscii(String string)
	{
        string = Normalizer.normalize(string, Normalizer.Form.NFD);
        for (char c : string.toCharArray())
        {
            if (c >= '\u007F')
            {
            	return true;
            }
        }
        return false;
    }

	/** Takes a directory and returns all files within
	 * that directory as well as all sub directories
	 * @param directory  Directory to be searched
	 * @return  List of all file paths
	 */
	public static ArrayList<String> getAllFilesInSubDirs(File directory)
	{
		ArrayList<String> files = new ArrayList<String>();
		try
		{
		    Path startPath = Paths.get(directory.getAbsolutePath());
		    Files.walkFileTree(startPath, new SimpleFileVisitor<Path>()
		    {
		        @Override
		        public FileVisitResult preVisitDirectory(Path dir,
		                BasicFileAttributes attrs)
		        {
		            return FileVisitResult.CONTINUE;
		        }

		        @Override
		        public FileVisitResult visitFile(Path file, BasicFileAttributes attrs)
		        {
		        	files.add(file.toString().toLowerCase());
		            return FileVisitResult.CONTINUE;
		        }

		        @Override
		        public FileVisitResult visitFileFailed(Path file, IOException e)
		        {
		            return FileVisitResult.CONTINUE;
		        }
		    });
		}
		catch (IOException e)
		{
		    LOG.log(Level.SEVERE, "Failed to retrieve subdir files. Check dir exists");
		}
		return files;
	}

	/** Creates a document filter that accepts
	 * only numbers.
	 * @param document  Document to apply filter to.
	 */
	public static void setDocFormatNumbersOnly(AbstractDocument document)
	{
        document.setDocumentFilter(new DocumentFilter()
        {
            @Override
            public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException
            {
                Document doc = fb.getDocument();
                StringBuilder sb = new StringBuilder();
                sb.append(doc.getText(0,  doc.getLength()));
                sb.insert(offset, string);

                if(doc.getLength() >= 2)
                {
                	return;
                }

                if(testInput(sb.toString()))
                {
                	super.insertString(fb, offset, string, attr);
                }
                else
                {
                	Toolkit.getDefaultToolkit().beep();
                }

            }

            @Override
            public void replace(FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException
            {
            	Document doc = fb.getDocument();
                StringBuilder sb = new StringBuilder();
                sb.append(doc.getText(0,  doc.getLength()));
                sb.replace(offset, offset + length, text);

                if(doc.getLength() >= 2)
                {
                	return;
                }

                if(testInput(sb.toString()))
                {
                	super.replace(fb, offset, length, text, attrs);
                }
                else
                {
                	Toolkit.getDefaultToolkit().beep();
                }
            }

            private boolean testInput(String input)
            {
            	try
            	{
            		Integer.parseInt(input);
            		return true;
            	}
            	catch (NumberFormatException e)
            	{
            		return false;
            	}
            }
        });
    }

	/** Gets the "Location" field from an iTunes Track Entry
	 * (aka: the file path) and formats it to a proper URI.
	 * @param entry  Library file's equivalent to a track in iTunes
	 * @return  File path corresponding to the Track Entry
	 * @see id3.objects.Library
	 */
	public static String getFilePathFromTrackEntry(Entry<String, Map> entry)
	{
		return URI.create((String) entry.getValue().get("Location")).getPath();
	}

	/** Attempts to find the relevant {@code FieldKey} from
	 * the supplied string. This FieldKey is a pointer to
	 * a file's ID3 tag's corresponding field.
	 * @param item  Text to find matching {@code FieldKey} for.
	 * @return  {@code FieldKey} representing the literal string item.
	 */
	public static FieldKey getFieldKeyFromString(String item)
	{
		switch(item)
		{
			default :
				LOG.log(Level.SEVERE, "FIELD KEY DOESN'T EXIST FOR: " + item);
				return null;
			case "Artist" :
				return FieldKey.ARTIST;
			case "Album" :
				return FieldKey.ALBUM;
			case "Album Artist" :
				return FieldKey.ALBUM_ARTIST;
			case "Composer" :
				return FieldKey.COMPOSER;
			case "Grouping" :
				return FieldKey.GROUPING;
			case "Genre" :
				return FieldKey.GENRE;
			case "Comments" :
				return FieldKey.COMMENT;
			case "Year" :
				return FieldKey.YEAR;
			case "Track Number" :
				return FieldKey.TRACK;
			case "Track Count" :
				return FieldKey.TRACK_TOTAL;
			case "Disc Number" :
				return FieldKey.DISC_NO;
			case "Disc Count" :
				return FieldKey.DISC_TOTAL;
			case "BPM" :
				return FieldKey.BPM;
		}
	}

	/** Reads ID3 tag on file and creates a new {@code Map} with
	 * all available information.
	 * @param id  Arbitrary trackID # to be used (no duplicates)
	 * @param file  File to read ID3 tag from
	 * @returns  Map with info and matching keys. Values' types
	 * cannot be generic objects - otherwise xml parsing
	 * will fail.
	 * @see id3.objects.Library
	 */
	public static HashMap createNewTrackEntry(int id, File file)
	{
		HashMap<String, Object> entry = new HashMap<>();
		try
		{
			AudioFile af = AudioFileIO.read(file);
			Tag tag = af.getTag();
			if(tag == null)
			{
				throw new TagException();
			}

			entry.put("Track ID", id);
			entry.put("Location", "file://localhost" + file.toURI().getPath().replace("#", "%23"));
			entry.put("Name", tag.getFirst(FieldKey.TITLE));
			entry.put("Artist", tag.getFirst(FieldKey.ARTIST));
			entry.put("Album Artist", tag.getFirst(FieldKey.ALBUM_ARTIST));
			entry.put("Composer", tag.getFirst(FieldKey.COMPOSER));
			entry.put("Album", tag.getFirst(FieldKey.ALBUM));
			entry.put("Grouping", tag.getFirst(FieldKey.GROUPING));
			entry.put("Genre", tag.getFirst(FieldKey.GENRE));
			entry.put("Size", (int) file.length());
			entry.put("Total Time", af.getAudioHeader().getTrackLength() * 1000);
			entry.put("Rating", convertID3ToItunesRating(tag.getFirst(FieldKey.RATING)));
			entry.put("Comments", tag.getFirst(FieldKey.COMMENT));

			String field = "";
			field = tag.getFirst(FieldKey.DISC_NO);
			if(!field.isEmpty())
			{
				if(field.matches("[0-9]{1,2}"))
				{
					entry.put("Disc Number", Integer.parseInt(field));
				}
			}
			field = tag.getFirst(FieldKey.DISC_TOTAL);
			if(!field.isEmpty())
			{
				if(field.matches("[0-9]{1,2}"))
				{
					entry.put("Disc Count", Integer.parseInt(field));
				}
			}
			field = tag.getFirst(FieldKey.TRACK);
			if(!field.isEmpty()) {
				if(field.matches("[0-9]{1,2}"))
				{
					entry.put("Track Number", Integer.parseInt(field));
				}
			}
			field = tag.getFirst(FieldKey.TRACK_TOTAL);
			if(!field.isEmpty())
			{
				if(field.matches("[0-9]{1,2}"))
				{
					entry.put("Track Count", Integer.parseInt(field));
				}
			}
			field = tag.getFirst(FieldKey.YEAR);
			if(!field.isEmpty())
			{
				if(field.matches("[0-9]{2,4}"))
				{
					entry.put("Year", Integer.parseInt(field));
				}
			}
			field = tag.getFirst(FieldKey.BPM);
			if(!field.isEmpty())
			{
				if(field.matches("[0-9]{1,3}"))
				{
					entry.put("BPM", Integer.parseInt(field));
				}
			}
		}
		catch (TagException | InvalidAudioFrameException e)
		{
			LOG.log(Level.WARNING, "Error reading tag during entry creation: " + file.getAbsolutePath());
		}
		catch (IOException | ReadOnlyFileException | CannotReadException e)
		{
			LOG.log(Level.SEVERE, "Failed to read file for entry creation: " + file.getAbsolutePath());
		}
		return entry;
	}

	/** Gets ID3 tag info from a file. If the tag is empty or doesn't exist,
	 * a new one will be created. This new tag will then attempt to be filled
	 * with information from the iTunes Track Entry. Even if a new
	 * tag isn't necessary, empty fields will  still attempt to be filled.
	 * All tag objects are forced into ID3v2.3 format, the
	 * most compatible format.
	 * @param entry  iTunes Track Entry
	 * @returns new tag object
	 * @see id3.objects.Library
	 */
	public static Tag getTagFromTrackEntry(Entry<String, Map> entry)
	{
		String filePath = Utils.getFilePathFromTrackEntry(entry);
		Tag tag = null;

		try
		{
			tag = getTagFromAudioFile(filePath);

			if(tag == null)
			{
				tag = new ID3v23Tag();
				LOG.log(Level.WARNING, " : EMPTY TAG, creating new");
			}

			tag.setField(FieldKey.TITLE, (String) entry.getValue().getOrDefault("Name", ""));
			tag.setField(FieldKey.ARTIST, (String) entry.getValue().getOrDefault("Artist", ""));
			tag.setField(FieldKey.ALBUM_ARTIST, (String) entry.getValue().getOrDefault("Album Artist", ""));
			tag.setField(FieldKey.COMPOSER, (String) entry.getValue().getOrDefault("Composer", ""));
			tag.setField(FieldKey.ALBUM, (String) entry.getValue().getOrDefault("Album", ""));
			tag.setField(FieldKey.GROUPING, (String) entry.getValue().getOrDefault("Grouping", ""));
			tag.setField(FieldKey.GENRE, (String) entry.getValue().getOrDefault("Genre", ""));
			tag.setField(FieldKey.DISC_NO, String.valueOf(entry.getValue().getOrDefault("Disc Number", "0")));
			tag.setField(FieldKey.DISC_TOTAL, String.valueOf(entry.getValue().getOrDefault("Disc Count", "0")));
			tag.setField(FieldKey.TRACK, String.valueOf(entry.getValue().getOrDefault("Track Number", "0")));
			tag.setField(FieldKey.TRACK_TOTAL, String.valueOf(entry.getValue().getOrDefault("Track Count", "0")));
			tag.setField(FieldKey.YEAR, String.valueOf(entry.getValue().getOrDefault("Year", "0")));
			tag.setField(FieldKey.COMMENT, (String) entry.getValue().getOrDefault("Comments", ""));
			tag.setField(FieldKey.BPM, String.valueOf(entry.getValue().getOrDefault("BPM" , "0")));

			String rating = String.valueOf(entry.getValue().getOrDefault("Rating", 0));
			rating = convertITunesRatingToID3(rating);
			tag.setField(FieldKey.RATING, rating);

		}
		catch (TagException e)
		{
			LOG.log(Level.SEVERE, "Error reading/creating tag: " + filePath);
		}
		return tag;
	}

	/** Searches a file's ID3 tag for artwork information.
	 * @param filePath  File path to search
	 * @returns  {@link Artwork} object containing byte[] of artwork
	 */
	public static Artwork getArtworkFromID3(String filePath)
	{
		Artwork artwork = null;
		if(!new File(filePath).exists())
		{
			return null;
		}

		Tag tag = getTagFromAudioFile(filePath);

		if(tag != null)
		{
			artwork = tag.getFirstArtwork();
		}

		return artwork;
	}

	/** Converts song rating string from iTunes library xml (0 - 100) to its
	 * equivalent value used in an ID3 tag (0 - 255).
	 * <li> 224-255 = 5 stars when READ with Windows Explorer, writes 255
	 * <li> 160-223 = 4 stars when READ with Windows Explorer, writes 196
	 * <li> 096-159 = 3 stars when READ with Windows Explorer, writes 128
	 * <li> 032-095 = 2 stars when READ with Windows Explorer, writes 64
	 * <li> 001-031 = 1 stars when READ with Windows Explorer, writes 1
	 * @param rating  iTunes Track Entry rating.
	 * @return  String representing iTunes equivalent rating.
	 */
	public static String convertITunesRatingToID3(String rating)
	{
		switch(rating)
		{
			default :
				return "0";
			case "20" :
				return "1";
			case "40" :
				return "64";
			case "60" :
				return "128";
			case "80" :
				return "196";
			case "100" :
				return "255";
		}
	}

	/** Converts ID3 tag rating (0 - 255) to its equivalent iTunes
	 * rating value (0 - 100).
	 * <li> 224-255 = 5 stars when READ with Windows Explorer, writes 255
	 * <li> 160-223 = 4 stars when READ with Windows Explorer, writes 196
	 * <li> 096-159 = 3 stars when READ with Windows Explorer, writes 128
	 * <li> 032-095 = 2 stars when READ with Windows Explorer, writes 64
	 * <li> 001-031 = 1 stars when READ with Windows Explorer, writes 1
	 * @param rating  ID3 tag rating field text.
	 * @returns
	 */
	public static int convertID3ToItunesRating(String rating)
	{
		switch(rating)
		{
			default :
				return 0;
			case "1" :
				return 20;
			case "64" :
				return 40;
			case "128" :
				return 60;
			case "196" :
				return 80;
			case "255" :
				return 100;
		}
	}

	/** Combines multiple arrays to generate
	 * one array of all available iTunes fields.
	 * @returns  String[] of iTunes fields.
	 */
	public static String[] getFieldDisplay()
	{
		String[] FIELDS;
		String[] a = {"Select a Field"};
		String[] a1 = FIELDS_STRINGS;
		String[] a2 = FIELDS_INTS;
		FIELDS = new String[1 + a1.length + a2.length];
		System.arraycopy(a, 0, FIELDS, 0, 1);
		System.arraycopy(a1,0,FIELDS, 1, a1.length);
		System.arraycopy(a2,0,FIELDS,a1.length + 1, a2.length);
		return FIELDS;
	}

	/** Saves a {@code Tag} (ID3 Tag) to the supplied
	 * iTunes Track Entry's file.
	 * @param entry  Library file's equivalent to a track in iTunes
	 * @param tag  {@link Tag} to save to file.
	 */
	public static void saveTagToFile(Entry<String, Map> entry, Tag tag)
	{
		String fileLocation = Utils.getFilePathFromTrackEntry(entry);
		saveTagToFile(fileLocation, tag);
	}

	/** Saves a [@code Tag} (ID3 Tag) to the supplied
	 * file path.
	 * @param filePath  File path to save ID3 tag to.
	 * @param tag  {@link Tag} to save to file.
	 */
	public static void saveTagToFile(String filePath, Tag tag)
	{
		if(!Settings.isDebugMode)
		{
			try
			{
				AudioFile af = AudioFileIO.read(new File(filePath));
				af.setTag(tag);
				if(!af.getFile().canWrite())
				{
					af.getFile().setWritable(true);
				}
				af.commit();
				LOG.log(Level.FINER, "Tag written successfully" + filePath);
			}
			catch (CannotReadException | IOException
					| ReadOnlyFileException e)
			{
				LOG.log(Level.SEVERE, "Tried to save tag to file, file doesn't exist: " + filePath);
			}
			catch (TagException | InvalidAudioFrameException e)
			{
				LOG.log(Level.WARNING, "Error saving tag: " + filePath);
			}
			catch (CannotWriteException e)
			{
				LOG.log(Level.SEVERE, "ID3 Tag failed to write: " + filePath);
			}
			catch (StringIndexOutOfBoundsException ex)
			{
				// do nothing : bug w/ JAudioTagger, sometimes throws this ex
			}
		}
	}

	/** Gets a {@link Tag} object, representing
	 * the supplied file path's ID3 tag info.
	 * @param path  File path to retrieve ID3 tag info from.
	 * @return  {@code Tag} representing ID3 tag info.
	 */
	public static Tag getTagFromAudioFile(String path)
	{
		Tag tag = null;
		try
		{
			tag = AudioFileIO.read(new File(path)).getTag();
		}
		catch (CannotReadException | IOException
				| ReadOnlyFileException e)
		{
			LOG.log(Level.SEVERE, "Failed to read file: " + path);
		}
		catch (TagException | InvalidAudioFrameException e)
		{
			LOG.log(Level.WARNING, "Error reading tag: " + path);
		}
		catch (StringIndexOutOfBoundsException ex)
		{
			// do nothing : bug w/ JAudioTagger, sometimes throws this ex
		}
		return tag;
	}

}


text:
from student.models import Student
from django.template import loader,Context
from django.template.loader import render_to_string
from django.http import HttpResponse

def show_student_homepage(request):
	#check if user is authenticated
	#and if he has permission to see this page
	#user = User.objects.get(username=request.user.username)
	#profile = Profile.objects(get request.user)[0]
	template = loader.get_template('student_homepage_template.html')
	#return HttpResponse(' <html>here %s</html>'%request.user.username)
	a = template.render(Context({ 'user' : request.user}))
	#a = render_to_string('student_homepage_template.html',{'user':'dfs'})
	return HttpResponse(a)


text:
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self.view addSubview:[[PointSmoothView alloc] initWithFrame:[UIScreen mainScreen].bounds]];
}

@end


text:
import hashlib
from Crypto.Cipher import AES
import base64

class PonyCrypto(object):
    def __init__(self, kms_key_arn, client):
        """
            Initalize with KMS Key ARN
        """
        self.kms_key_arn = kms_key_arn
        self.client = client

    def encrypt(self, payload):
        """
            Encrypts the file in a data envelope using
            provided data key and CMK returns ciphertext
        """

        data_key = self.__generate_data_key()
        encypted_payload = self.__encrypt_with_aes(
            data_key['Plaintext'],
            payload
        )

        result = {
            'ciphertext_key': data_key['CiphertextBlob'],
            'payload': encypted_payload
        }

        return result

    def hash_payload(self, payload):
        """
            Returns a hash of the payload for storage
            with the asset if necessary
        """
        h = hashlib.new('sha256')
        h.update(payload)
        payload_hash = h.hexdigest()
        return payload_hash

    def __encrypt_with_aes(self, plaintext_key, payload):
        """
            Takes a data key and returns ciphertext for
            use in public encrypt method
        """
        str_payload = str(payload)
        pad = lambda s: s + (32 - len(s) % 32) * ' '
        crypter = AES.new(plaintext_key)
        ciphertext = base64.b64encode(crypter.encrypt(pad(str_payload)))
        return ciphertext

    def __generate_data_key(self):
        """
            Returns a data key for the KMS ARN
        """
        response = self.client.generate_data_key(
            KeyId=self.kms_key_arn,
            KeySpec='AES_128'
        )
        return response


text:
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using FluentValidation;
using Gallifrey.RestApi.Application.Validation;
using Gallifrey.SharedKernel.Application.Persistence.Repository;
using Gallifrey.SharedKernel.Application.Validation;

namespace Gallifrey.RestApi.Application.Controller
{
    public abstract class AbstractRestApiController<TModel, TIdentityType, TRepository> : ApiController
        where TRepository : IDatabaseRepository<TModel, TIdentityType>
        where TModel : class
        where TIdentityType : struct
    {
        private readonly TRepository _respository;
        private readonly IValidationHelper<TModel> _validationHelper;

        protected AbstractRestApiController(TRepository respository,
            IEnumerable<IValidator<TModel>> validators)
        {
            _respository = respository;
            //Usefull for serialization of REST API
            _respository.DisableProxyAndLazyLoading();

            _validationHelper = new ModelStateValidationHelper<TModel>(ModelState, validators);
        }

        private void Validate(TModel model)
        {
            _validationHelper.Validate(model);
        }

        // GET api/transactionapi
        public virtual IEnumerable<TModel> Get()
        {
            return _respository.GetAllFiltered();
        }

        // GET api/transactionapi/5
        [System.Web.Mvc.HttpGet]
        public virtual TModel Get(TIdentityType id)
        {
            return _respository.Find(id);
        }

        // POST api/transactionapi
        [System.Web.Mvc.HttpPost]
        public virtual HttpResponseMessage Post([FromBody]TModel value)
        {
            try
            {
                Validate(value);

                if (!ModelState.IsValid)
                    return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);

                _respository.InsertOrUpdate(value);
                _respository.Save();
            }
            catch (Exception e)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, e);
            }

            return new HttpResponseMessage(HttpStatusCode.OK);
        }

        // PUT api/transactionapi/5
        public virtual HttpResponseMessage Put(int id, [FromBody]TModel value)
        {
            try
            {
                Validate(value);

                if (!ModelState.IsValid)
                    Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);

                _respository.InsertOrUpdate(value);
                _respository.Save();
            }
            catch (Exception e)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, e);
            }

            return new HttpResponseMessage(HttpStatusCode.OK);
        }

        // DELETE api/transactionapi/5
        public virtual HttpResponseMessage Delete(TIdentityType id)
        {
            _respository.Delete(id);
            _respository.Save();

            return new HttpResponseMessage(HttpStatusCode.OK);
        }
    }
}


text:
namespace PPx {

class View;

namespace NibDecoderUtils {

	void				SetQDRectFromString(
								CFStringRef	inString,
								Rect&		outRect);

	void				SetHIRectFromString(
								CFStringRef	inString,
								HIRect&		outRect);

	void				SetViewFont(
								View*		inView,
								ControlSize	inControlSize);

	void				SetViewSizeAndFont(
								View*		inView,
								ControlSize	inControlSize);

} // namespace NibDecoderUtils

} // namespace PPx

#endif	// H_PPxNibDecoderUtils


text:
#include "DepthConvertLayer.h"

#include "tests/validation/Helpers.h"

#include "support/Rounding.h"
#include "support/SaturateCast.h"

#include "tests/Types.h"

namespace arm_compute
{
namespace test
{
namespace validation
{
namespace reference
{
template < typename T1, typename T2, typename std::enable_if < std::is_integral<T1>::value &&!std::is_same<T1, T2>::value, int >::type >
SimpleTensor<T2> depth_convert(const SimpleTensor<T1> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
{
    SimpleTensor<T2> result(src.shape(), dt_out);

    // Up-casting
    if(element_size_from_data_type(src.data_type()) < element_size_from_data_type(dt_out))
    {
#if defined(_OPENMP)
        #pragma omp parallel for
#endif /* _OPENMP */
        for(int i = 0; i < src.num_elements(); ++i)
        {
            result[i] = src[i] << shift;
        }
    }
    // Down-casting
    else
    {
#if defined(_OPENMP)
        #pragma omp parallel for
#endif /* _OPENMP */
        for(int i = 0; i < src.num_elements(); ++i)
        {
            T1 val    = src[i] >> shift;
            result[i] = (policy == ConvertPolicy::SATURATE) ? utils::cast::saturate_cast<T2>(val) : static_cast<T2>(val);
        }
    }
    return result;
}

template < typename T1, typename T2, typename std::enable_if < is_floating_point<T1>::value &&(!std::is_same<T1, T2>::value &&!std::is_same<T2, bfloat16>::value), int >::type >
SimpleTensor<T2> depth_convert(const SimpleTensor<T1> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
{
    SimpleTensor<T2> result(src.shape(), dt_out);
    ARM_COMPUTE_ERROR_ON(shift != 0);
    ARM_COMPUTE_UNUSED(policy, shift);

    if(!std::is_same<T2, bfloat16>::value && !is_floating_point<T2>::value)
    {
        // Always saturate on floats
        for(int i = 0; i < src.num_elements(); ++i)
        {
            T1 val    = utils::rounding::round_half_away_from_zero(src[i]);
            result[i] = utils::cast::saturate_cast<T2>(val);
        }
    }
    else
    {
        for(int i = 0; i < src.num_elements(); ++i)
        {
            result[i] = static_cast<T2>(src[i]);
        }
    }
    return result;
}

template < typename T1, typename T2, typename std::enable_if < std::is_same<T1, bfloat16>::value || std::is_same<T2, bfloat16>::value, int >::type >
SimpleTensor<T2> depth_convert(const SimpleTensor<T1> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift)
{
    SimpleTensor<T2> result(src.shape(), dt_out);
    ARM_COMPUTE_ERROR_ON(shift != 0);
    ARM_COMPUTE_UNUSED(policy, shift);

    for(int i = 0; i < src.num_elements(); ++i)
    {
        result[i] = static_cast<T2>(src[i]);
    }

    return result;
}

// U8
template SimpleTensor<int8_t> depth_convert(const SimpleTensor<uint8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint16_t> depth_convert(const SimpleTensor<uint8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int16_t> depth_convert(const SimpleTensor<uint8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint32_t> depth_convert(const SimpleTensor<uint8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int32_t> depth_convert(const SimpleTensor<uint8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<half> depth_convert(const SimpleTensor<uint8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<float> depth_convert(const SimpleTensor<uint8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);

// S8
template SimpleTensor<uint8_t> depth_convert(const SimpleTensor<int8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint16_t> depth_convert(const SimpleTensor<int8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int16_t> depth_convert(const SimpleTensor<int8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint32_t> depth_convert(const SimpleTensor<int8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int32_t> depth_convert(const SimpleTensor<int8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<half> depth_convert(const SimpleTensor<int8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<float> depth_convert(const SimpleTensor<int8_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);

// U16
template SimpleTensor<uint8_t> depth_convert(const SimpleTensor<uint16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int8_t> depth_convert(const SimpleTensor<uint16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int16_t> depth_convert(const SimpleTensor<uint16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint32_t> depth_convert(const SimpleTensor<uint16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int32_t> depth_convert(const SimpleTensor<uint16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<half> depth_convert(const SimpleTensor<uint16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<float> depth_convert(const SimpleTensor<uint16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);

// S16
template SimpleTensor<uint8_t> depth_convert(const SimpleTensor<int16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int8_t> depth_convert(const SimpleTensor<int16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint16_t> depth_convert(const SimpleTensor<int16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint32_t> depth_convert(const SimpleTensor<int16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int32_t> depth_convert(const SimpleTensor<int16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<half> depth_convert(const SimpleTensor<int16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<float> depth_convert(const SimpleTensor<int16_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);

// U32
template SimpleTensor<uint8_t> depth_convert(const SimpleTensor<uint32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int8_t> depth_convert(const SimpleTensor<uint32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint16_t> depth_convert(const SimpleTensor<uint32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int16_t> depth_convert(const SimpleTensor<uint32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int32_t> depth_convert(const SimpleTensor<uint32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<half> depth_convert(const SimpleTensor<uint32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<float> depth_convert(const SimpleTensor<uint32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);

// S32
template SimpleTensor<uint8_t> depth_convert(const SimpleTensor<int32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int8_t> depth_convert(const SimpleTensor<int32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint16_t> depth_convert(const SimpleTensor<int32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int16_t> depth_convert(const SimpleTensor<int32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint32_t> depth_convert(const SimpleTensor<int32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<half> depth_convert(const SimpleTensor<int32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<float> depth_convert(const SimpleTensor<int32_t> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);

// BFLOAT16
template SimpleTensor<float> depth_convert(const SimpleTensor<bfloat16> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);

// F16
template SimpleTensor<uint8_t> depth_convert(const SimpleTensor<half> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int8_t> depth_convert(const SimpleTensor<half> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint16_t> depth_convert(const SimpleTensor<half> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int16_t> depth_convert(const SimpleTensor<half> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint32_t> depth_convert(const SimpleTensor<half> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int32_t> depth_convert(const SimpleTensor<half> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<float> depth_convert(const SimpleTensor<half> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);

// F32
template SimpleTensor<uint8_t> depth_convert(const SimpleTensor<float> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int8_t> depth_convert(const SimpleTensor<float> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint16_t> depth_convert(const SimpleTensor<float> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int16_t> depth_convert(const SimpleTensor<float> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<uint32_t> depth_convert(const SimpleTensor<float> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<int32_t> depth_convert(const SimpleTensor<float> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<half> depth_convert(const SimpleTensor<float> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);
template SimpleTensor<bfloat16> depth_convert(const SimpleTensor<float> &src, DataType dt_out, ConvertPolicy policy, uint32_t shift);

} // namespace reference
} // namespace validation
} // namespace test
} // namespace arm_compute


text:
package graph

import "github.com/pkg/errors"

func (g *Graph) TopologicalSort() ([]V, error) {
	results := newOrderedSet()
	for _, name := range g.orderedVertices {
		err := g.visit(name, results, nil)
		if err != nil {
			return nil, err
		}
	}

	return results.items, nil
}

func (g *Graph) visit(name V, results *orderedset, visited *orderedset) error {
	if visited == nil {
		visited = newOrderedSet()
	}

	added := visited.add(name)
	if !added {
		index := visited.index(name)
		cycle := append(visited.items[index:], name)
		return errors.Errorf("cycle error: %v", cycle)
	}

	n := g.Vertices[name]
	for _, edge := range n.OutgoingEdges {
		err := g.visit(edge, results, visited.clone())
		if err != nil {
			return err
		}
	}

	results.add(name)
	return nil
}

type orderedset struct {
	indexes map[V]int
	items   []V
	length  int
}

func newOrderedSet() *orderedset {
	return &orderedset{
		indexes: make(map[V]int),
		length:  0,
	}
}

func (s *orderedset) add(item V) bool {
	_, ok := s.indexes[item]
	if ok {
		return false
	}
	s.indexes[item] = s.length
	s.items = append(s.items, item)
	s.length++
	return true
}

func (s *orderedset) clone() *orderedset {
	clone := newOrderedSet()
	for _, item := range s.items {
		clone.add(item)
	}
	return clone
}

func (s *orderedset) index(item V) int {
	index, ok := s.indexes[item]
	if ok {
		return index
	}
	return -1
}


text:
package hudson.console;

import static org.junit.Assert.assertTrue;

import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.Launcher;
import hudson.MarkupText;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
import hudson.model.FreeStyleBuild;
import hudson.model.FreeStyleProject;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.TestBuilder;

import java.io.IOException;

/**
 * @author Kohsuke Kawaguchi
 */
public class UrlAnnotatorTest {

    @Rule
    public JenkinsRule j = new JenkinsRule();

    @Test
    public void test1() throws Exception {
        FreeStyleProject p = j.createFreeStyleProject();
        p.getBuildersList().add(new TestBuilder() {
            @Override
            public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) {
                listener.getLogger().println("http://www.sun.com/");
                listener.getLogger().println("<http://www.kohsuke.org/>");
                listener.getLogger().println("");
                return true;
            }
        });
        FreeStyleBuild b = j.buildAndAssertSuccess(p);

        HtmlPage c = j.createWebClient().getPage(b, "console");
        String rsp = c.getWebResponse().getContentAsString();
        assertTrue(rsp, rsp.contains("http://www.sun.com/"));
        assertTrue(rsp, rsp.contains("http://www.kohsuke.org/"));
        assertTrue(rsp, rsp.contains("http://www.oracle.com/"));
    }

    /**
     * Mark up of URL should consider surrounding markers, if any.
     */
    @Test
    public void test2() throws Exception {
        MarkupText m = new MarkupText("{abc='http://url/',def='ghi'}");
        new UrlAnnotator().newInstance(null).annotate(null,m);
        String html = m.toString(false);
        assertTrue(html.contains("http://url/"));
        System.out.println(html);
    }
}


text:
layout: post
published: true
title: Martin Cruz Smith - Order of Arkady Renko Novels
subtitle: 'From Gorky Park, the full list of the Arkady Renko Series'
date: '2017-07-25'
tags:
  - Book Order
  - Arkady Renko
  - 'Smith, Martin Cruz'
---

![Martin Cruz Smith]({{site.baseurl}}/)

1. **Gorky Park** (1981) [Kindle Price](http://amzn.to/2tBbO3D)
1. **Polar Star** (1989) [Kindle Price](http://amzn.to/2unAawv)
1. **Red Square** (1992) [Kindle Price](http://amzn.to/2vVXQ8X)
1. Havana Bay (1999) [Kindle Price](http://amzn.to/2v3Hvms)
1. Wolves Eat Dogs (2004) [Kindle Price](http://amzn.to/2uVz4c3)
1. Stalin's Ghost (2006) [Kindle Price](http://amzn.to/2uty6mp)
1. Three Stations (2010) [Kindle Price](http://amzn.to/2vW2bcj)
1. Tatiana (2013) [Kindle Price](http://amzn.to/2v3Svjo)

Books in bold are in my collection.


text:
package org.hoteia.qalingo.core.web.mvc.form;

import org.springframework.web.multipart.MultipartFile;

public class CmsMenuBlockForm {

	protected String cmsMenuId;

    protected String title;
    protected String text;

    protected MultipartFile file;

	public String getCmsMenuId() {
		return cmsMenuId;
	}

	public void setCmsMenuId(String cmsMenuId) {
		this.cmsMenuId = cmsMenuId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public MultipartFile getFile() {
		return file;
	}

	public void setFile(MultipartFile file) {
		this.file = file;
	}

}


text:
nginx proxy_pass docker image

`TARGET_HTTP=http`

`TARGET_SERVER=ip` or `TARGET_SERVER=example.com`

example:

`docker run -p 80:80 --rm -e TARGET_SERVER=rancher.com gorniv/proxy_pass`


text:
package com.gzm.xm.web.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gzm.xm.common.entity.Type;
import com.gzm.xm.common.enums.PageEnum;
import com.gzm.xm.common.enums.TypeEnum;
import com.gzm.xm.service.TypeService;

@Controller
public class TypeController {
    @Autowired
    private TypeService typeService;

    @RequestMapping(value = "/types",method = RequestMethod.GET)
    public String getAllTypeList(@RequestParam(required = false)Integer id,  ModelMap map) {
       List<Type> typeList = typeService.getSubTypeListUnderType(TypeEnum.PRODUCT_TYPE.getId());
       map.put("typeList", typeList);
       return "type/list";
    }

    @RequestMapping(value = "/type/{id}",method = RequestMethod.DELETE)
    public @ResponseBody void delType(@PathVariable Integer id) {
        typeService.delType(id);
    }

    @RequestMapping(value = "/type/addType",method = RequestMethod.POST)
    public String addType(Integer parentType,
                          String name) {
        typeService.addType(name, parentType);
        return "redirect:/backend/types";
    }

    @RequestMapping(value = "/admin/type/editType", method = RequestMethod.POST)
    public @ResponseBody void editType(Type type) {
        Type t = typeService.getType(type.getId());
        t.setName(type.getName());
        t.setParentType(type.getParentType());
        typeService.saveType(t);
    }

    @ModelAttribute("pageType")
    public Integer getPageType() {
        return PageEnum.TYPE.getId();
    }

}


text:
/* CalendarFetcher Tester
 * use this script with `node debug.js` to test the fetcher without the need
 * of starting the MagicMirror core. Adjust the values below to your desire.
 *
 * By Michael Teeuw https://michaelteeuw.nl
 * MIT Licensed.
 */
// Alias modules mentioned in package.js under _moduleAliases.
require("module-alias/register");

const CalendarFetcher = require("./calendarfetcher.js");

const url = "https://calendar.google.com/calendar/ical/pkm1t2uedjbp0uvq1o7oj1jouo%40group.calendar.google.com/private-08ba559f89eec70dd74bbd887d0a3598/basic.ics"; // Standard test URL
//const url = "https://www.googleapis.com/calendar/v3/calendars/primary/events/"; // URL for Bearer auth (must be configured  in Google OAuth2 first)
const fetchInterval = 60 * 60 * 1000;
const maximumEntries = 10;
const maximumNumberOfDays = 365;
const user = "magicmirror";
const pass = "MyStrongPass";
const auth = {
	user: user,
	pass: pass
};

console.log("Create fetcher ...");

const fetcher = new CalendarFetcher(url, fetchInterval, [], maximumEntries, maximumNumberOfDays, auth);

fetcher.onReceive(function (fetcher) {
	console.log(fetcher.events());
	console.log("------------------------------------------------------------");
	process.exit(0);
});

fetcher.onError(function (fetcher, error) {
	console.log("Fetcher error:");
	console.log(error);
	process.exit(1);
});

fetcher.startFetch();

console.log("Create fetcher done! ");


text:
<?php

use yii\helpers\Html;

use app\models\general\GeneralLabel;

/* @var $this yii\web\View */
/* @var $model app\models\MuatNaikDokumen */

$this->title = GeneralLabel::createTitle . ' ' . GeneralLabel::maklumat_sukan_malaysia;
$this->params['breadcrumbs'][] = ['label' => GeneralLabel::maklumat_sukan_malaysia, 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?= $this->render('_form', [
        'model' => $model,
        'readonly' => $readonly,
    ]) ?>


text:
NirvanaHQ Gem
=============

A gem for the [NirvanaHQ.com](http://nirvanahq.com) API.

Includes a command line tool, **nirv**

NirvanaHQ is an online todo/task manager, based around the GTD method.

**gem install nirvanahq**

Features
--------

Command Line Tool:

* Add a task via the CLI
* Backup

Gem / Library: (API docs coming - have to spend a few hours reading up on RDoc)

Have a look at the lib & tests for some example usage.

This is by no means a final version, so you know the deal.

Usage (CLI)
-----------

First thing: run **`nirv init`**

This will create **~/.nirvanahq/config.rb**. You need to edit that file - change the values for your username and password. For now, you have to make your own md5 of you password, and put that in there. Sorry :/

**Add Task**

basic:

**`nirv add "task name"`** adds a task to your inbox

with tags & a note:

**`nirv add "task name" -n "this will show up in the task note." -t "Tag 1,Tag 2"`**

**Backup**

**nirv backup**

Dumps a full copy of your account to ~/.nirvanahq/backup.json.

I added it just because. For the data loss paranoid, or those just wanting their data.

**Everything Else**

**nirv version** obvious.

**nirv help** pretty much the info in this section.

About
-----

Wanted a quick way to add tasks from the cli. Also learning ruby, so this seemed a good fit. So, started a gem with a cli tool.

Right now, just focused on adding a task easily.

You can examine the nirvanahq api in your browser - their web app uses it, so its pretty straight-forward to see whats going on.

**gems - what why and how** from [ruby learning blog](http://rubylearning.com/blog/2010/12/14/ruby-gems-%E2%80%94-what-why-and-how/) helped, as well as studying  [boom](https://github.com/holman/boom). Was a good example to work & learn from initially. Seems to be doing something similar to what I wanted to do, so picked up some gem tips there. And just talking to some people :)

comments/examples how to improve it welcome.

Feature requests always welcome.

no association with nirvanahq.com, so any problems you have, open ticket on the [github site](https://github.com/meeech/nirv/issues).

m.


text:
package co.cask.hydrator.plugin.spark;

import co.cask.cdap.api.annotation.Description;
import co.cask.cdap.api.annotation.Name;
import co.cask.cdap.api.annotation.Plugin;
import co.cask.cdap.api.data.schema.Schema;
import co.cask.cdap.etl.api.batch.SparkSink;
import org.apache.spark.SparkContext;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.mllib.regression.LabeledPoint;
import org.apache.spark.mllib.tree.DecisionTree;
import org.apache.spark.mllib.tree.model.DecisionTreeModel;

import java.util.Map;
import javax.annotation.Nullable;

/**
 * Spark Sink plugin that trains a model based upon a label in the structured record using Decision Tree Regression.
 * Writes this model to a FileSet.
 */
@Plugin(type = SparkSink.PLUGIN_TYPE)
@Name(DecisionTreeTrainer.PLUGIN_NAME)
@Description("Trains a regression model based upon a particular label and features of a record.")
public class DecisionTreeTrainer extends SparkMLTrainer {
  public static final String PLUGIN_NAME = "DecisionTreeTrainer";
  //Impurity measure of the homogeneity of the labels at the node. Expected value for regression is "variance".
  private static final String IMPURITY = "variance";
  private DecisionTreeTrainerConfig config;

  public DecisionTreeTrainer(DecisionTreeTrainerConfig config) {
    super(config);
    this.config = config;
  }

  @Override
  public void trainModel(SparkContext context, Schema schema, JavaRDD<LabeledPoint> trainingData, String outputPath) {
    Map<Integer, Integer> categoricalFeaturesInfo =
      SparkUtils.getCategoricalFeatureInfo(schema, config.featureFieldsToInclude, config.featureFieldsToExclude,
                                           config.labelField, config.cardinalityMapping);
    final DecisionTreeModel model = DecisionTree.trainRegressor(trainingData, categoricalFeaturesInfo, IMPURITY,
                                                                config.maxDepth, config.maxBins);
    model.save(context, outputPath);
  }

  /**
   * Configuration for DecisionTreeTrainer.
   */
  public static class DecisionTreeTrainerConfig extends MLTrainerConfig {

    @Nullable
    @Description("Mapping of the feature to the cardinality of that feature; required for categorical features.")
    private String cardinalityMapping;

    @Nullable
    @Description("Maximum depth of the tree.\n For example, depth 0 means 1 leaf node; depth 1 means 1 internal node " +
      "+ 2 leaf nodes. Default is 10.")
    private Integer maxDepth;

    @Nullable
    @Description("Maximum number of bins used for splitting when discretizing continuous features. " +
      "DecisionTree requires maxBins to be at least as large as the number of values in each categorical feature. " +
      "Default is 100.")
    private Integer maxBins;

    public DecisionTreeTrainerConfig() {
      super();
      maxDepth = 10;
      maxBins = 100;
    }

    public DecisionTreeTrainerConfig(String fileSetName, String path, @Nullable String featuresToInclude,
                                     @Nullable String featuresToExclude, @Nullable String cardinalityMapping,
                                     String labelField, @Nullable Integer maxDepth, @Nullable Integer maxBins) {
      super(fileSetName, path, featuresToInclude, featuresToExclude, labelField);
      this.cardinalityMapping = cardinalityMapping;
      this.maxDepth = maxDepth;
      this.maxBins = maxBins;
    }
  }
}


text:
<%!
   from r2.lib.template_helpers import get_domain
   from r2.lib.template_helpers import media_https_if_secure
   from r2.lib.pages.things import LinkButtons
   from r2.lib.pages import WrappedUser
   from r2.lib.strings import Score, strings
%>

<%inherit  file="printable.html"/>
<%namespace file="utils.html" import="plain_link, thing_timestamp, edited" />
<%namespace file="printablebuttons.html" import="toggle_button" />

<%def name="numcol()">
  <% num = thing.num %>

    %if thing.num > 0:
      ${thing.num}
    %endif

</%def>

<%def name="make_link(name, css_class, tabindex=0)">
  <a class="${css_class} ${ c.user_is_loggedin and 'loggedin' or ''}"
     href="${thing.href_url}"
     %if tabindex:
       tabindex="${tabindex}"
     %endif
     %if thing.nofollow:
       rel="nofollow"
     %endif
     %if thing.newwindow:
       target="_blank"
     %elif c.cname:
       target="_top"
     %endif
     %if thing.mousedown_url:
       onmousedown="save_href($(this));this.href='${thing.mousedown_url}'"
     %endif
     %if thing.link_child and getattr(thing, "media_override", False):
       onclick="return expando_child(this)"
     %endif
     >
     ${caller.body()}

</%def>

<%def name="bottom_buttons()">

    %if thing.nsfw:

       <acronym title="${_('Adult content: Not Safe For Work')}">
         ${_("NSFW")}
       </acronym>

    %endif
    ${self.buttons()}
    ${self.admintagline()}

 </%def>

<%def name="flair()">
  %if c.user.pref_show_link_flair and thing.flair_text:
    ${thing.flair_text}
  %endif
</%def>

<%def name="entry()">

    %if c.site.link_flair_position == 'left':
      <%call expr="flair()" />
    %endif
    <%call expr="make_link('title', 'title', tabindex=1)">
      ${thing.title}
    </%call>
    %if c.site.link_flair_position == 'right':
      <%call expr="flair()" />
    %endif
    ${self.approval_checkmark()}

    ${self.domain()}

    %if c.user_is_admin:
        %for link_note in thing.link_notes:
            [${link_note}]
        %endfor
    %endif

  ##the expando button
  <% selftext_hide = thing.is_self and not thing.selftext %>
  %if thing.link_child and not thing.link_child.expand and not selftext_hide:

  %endif

    ${self.tagline()}

  <%
     child_content = ""
     if thing.link_child and thing.link_child.load:
       child_content = unsafe(thing.link_child.content())
     expand = thing.link_child and thing.link_child.expand
  %>

  ## if we're not on a permalink page we'll render the buttons on top
  %if not expand:
    ${bottom_buttons()}
  %endif

%if not getattr(thing, "votable", True):

${strings.unvotable_message}

%endif

    %if expand:
      ${child_content}
    %else:
      loading...
    %endif

  ##if we are on a permalink page, we'll render the buttons below
  %if expand:
    ${bottom_buttons()}
  %endif

 ##populate the expando cache if we have something
  %if not expand and child_content:

  %endif
</%def>

<%def name="thing_css_class(what)" buffered="True">
${parent.thing_css_class(what)} ${"over18" if thing.over_18 else ""} ${thing.visited and 'visited' or ''}
%if c.user.pref_show_link_flair and (thing.flair_text or thing.flair_css_class):
  <% css = thing.flair_css_class or '' %>
  linkflair ${' '.join('linkflair-' + c for c in css.split())}
%endif
</%def>

<%def name="thing_data_attributes(what)" buffered="True">
${parent.thing_data_attributes(what)} data-ups="${what.upvotes}" data-downs="${what.downvotes}"
</%def>

<%def name="subreddit()" buffered="True">
  ${plain_link(thing.subreddit.name, thing.subreddit_path, sr_path = False,
               cname = False, _class = "subreddit hover",
               target='_blank' if thing.newwindow else '')}
</%def>

<%def name="midcol(display=True, cls = '')">

    ${self.arrow(thing, 1, thing.likes)}
    %if thing.pref_compress:

    %elif thing.hide_score:

•

•

•

    %else:
      ${self.score(thing, thing.likes, tag='div')}
    %endif
    ${self.arrow(thing, 0, thing.likes == False)}

 ${self.thumbnail()}
</%def>

<%def name="domain()">

    (${thing.domain_str})
    %if c.user_is_admin:

      d
    %endif

</%def>

<%def name="tagline()">
  <%
    taglinetext = thing.taglinetext.replace(" ", " ")
  %>
  ${unsafe(taglinetext % dict(reddit=self.subreddit(),
                              score=capture(self.score, thing, thing.likes, tag='span'),
                              when=capture(thing_timestamp, thing, thing.timesince),
                              author=WrappedUser(thing.author, thing.attribs, thing).render(),
                              lastedited=capture(edited, thing, thing.lastedited)
                              ))}
  %if c.permalink_page or c.profilepage:
    ${self.gildings()}
  %endif
  %if thing.stickied:
     - stickied post
  %endif

  %if getattr(thing, 'savedcategory', None) is not None:
    ${plain_link(_('category: %s') % thing.savedcategory,
                 '/user/%s/saved/%s' % (c.user.name, thing.savedcategory),
                 _class='save-category' + ('' if thing.savedcategory else ' hidden')
                )}
  %endif
</%def>

<%def name="child()">
</%def>

<%def name="buttons(comments=True, delete=True, report=True, additional='')">
  ${LinkButtons(thing, comments = comments, delete = delete,
                report = report,
               )}
</%def>

<%def name="thumbnail()">
  %if thing.thumbnail:
  <%call expr="make_link('thumbnail', 'thumbnail ' + (thing.thumbnail if thing.thumbnail_sprited else ''))">
    % if not thing.thumbnail_sprited:
        <%
            if hasattr(thing, 'thumbnail_size'):
                size_str = "width='%d' height='%d'" % (thing.thumbnail_size[0], thing.thumbnail_size[1])
            else:
                size_str = ""
        %>

    % endif
  </%call>
  %endif
</%def>