text:
namespace DummyDataInitializer.ViewModels
{
	using Catel.IoC;
	using Catel.MVVM;
	using Catel.MVVM.Services;
	using SchedulerDAC.DAL;
	using SchedulerDAC.Models;
	using System;
	using System.Linq;
	using System.Collections.Generic;
	using System.IO;
	using System.Text;
	using System.Text.RegularExpressions;
	using System.Collections.ObjectModel;
	using Catel.Data;
	using DummyDataInitializer.Models;
using Scheduler.Logic;

    /// <summary>
    /// MainWindow view model.
    /// </summary>
    public class MainWindowViewModel : ViewModelBase
    {
        #region Fields
        private IServiceLocator serviceLocator;
		private Random rand;
		private int currentSemester;
		private ScheduleMaker scheduleMaker;
		private bool isScheduleMakerStarted = false;
        #endregion

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindowViewModel"/> class.
        /// </summary>
        public MainWindowViewModel(IServiceLocator serviceLocator)
            : base(serviceLocator)
        {
            this.serviceLocator = serviceLocator;
			InitializeCommand = new Command(OnInitializeCommandExecute);
			StartScheduleMakerCommand = new Command(OnStartScheduleMakerCommandExecute, OnStartScheduleMakerCommandCanExecute);
			StopScheduleMakerCommand = new Command(OnStopScheduleMakerCommandExecute, OnStopScheduleMakerCommandCanExecute);

			ProgrammeFiles = new ObservableCollection<ProgrammeFile>();
			foreach(var filename in Directory.GetFiles(Environment.CurrentDirectory, "programme*.txt"))
			{
				ProgrammeFiles.Add(new ProgrammeFile(filename));
			}
        }
        #endregion

        #region Properties
        /// <summary>
        /// Gets the title of the view model.
        /// </summary>
        /// <value>The title.</value>
        public override string Title { get { return "View model title"; } }

        // TODO: Register models with the vmpropmodel codesnippet
        // TODO: Register view model properties with the vmprop or vmpropviewmodeltomodel codesnippets

		/// <summary>
		/// Gets or sets the property value.
		/// </summary>
		public ObservableCollection<ProgrammeFile> ProgrammeFiles
		{
			get { return GetValue<ObservableCollection<ProgrammeFile>>(ProgrammeFilesProperty); }
			set { SetValue(ProgrammeFilesProperty, value); }
		}

		/// <summary>
		/// Register the ProgrammesFiles property so it is known in the class.
		/// </summary>
		public static readonly PropertyData ProgrammeFilesProperty = RegisterProperty("ProgrammeFiles", typeof(ObservableCollection<ProgrammeFile>), null);

		/// <summary>
		/// Gets or sets the property value.
		/// </summary>
		public Scheduler.Logic.Schedule Schedule
		{
			get { return GetValue<Scheduler.Logic.Schedule>(ScheduleProperty); }
			set { SetValue(ScheduleProperty, value); }
		}

		/// <summary>
		/// Register the Schedule property so it is known in the class.
		/// </summary>
		public static readonly PropertyData ScheduleProperty = RegisterProperty("Schedule", typeof(Scheduler.Logic.Schedule), null);

        #endregion

        #region Commands
        /// <summary>
		/// Gets the InitializeCommand command.
		/// </summary>
		public Command InitializeCommand { get; private set; }

		/// <summary>
		/// Gets the StartScheduleMakerCommand command.
		/// </summary>
		public Command StartScheduleMakerCommand { get; private set; }

		/// <summary>
		/// Gets the StopScheduleMakerCommand command.
		/// </summary>
		public Command StopScheduleMakerCommand { get; private set; }

        #endregion

        #region Methods
		#region Dummy data initialization
		/// <summary>
		/// Method to invoke when the InitializeCommand command is executed.
		/// </summary>
		private void OnInitializeCommandExecute()
		{
			LoadDummyData();
		}

		private void LoadDummyData()
		{
			var context = new SchedulerContext();
			rand = new Random();
			currentSemester = rand.Next(0, 1);
			var start = DateTime.Now;
			foreach (var file in ProgrammeFiles)
			{
				if(file.IsSelected)
				{
					ImportProgrammeData(file.Filename, context);
				}

			}
			GenerateStudents(context);
			GenerateEnrollments(context);
			GenerateRooms(context);
			var end = DateTime.Now;
			var messageService = (IMessageService)serviceLocator.GetService(typeof(IMessageService));
			messageService.Show("Time taken to initialize:" + end.Subtract(start).ToString());
		}

		private void GenerateRooms(SchedulerContext context)
		{
			for(int i = 0; i < context.Programmes.Count(); i++)
			{
				var room = new Room() { Name = string.Format("LEC{0:00}", i), Capacity = rand.Next(200, 300) };
				room.HostedActivitie = LessonType.Lecture;
				context.Rooms.Add(room);
			}

			for (int i = 0; i < context.Programmes.Count() * 5; i++)
			{
				var room = new Room() { Name = string.Format("EXE{0:00}", i), Capacity = rand.Next(30, 50) };
				room.HostedActivitie = LessonType.Exercise;
				context.Rooms.Add(room);
			}

			for (int i = 0; i < context.Programmes.Count() * 3; i++)
			{
				var room = new Room() { Name = string.Format("LAB{0:00}", i), Capacity = rand.Next(30, 50) };
				room.HostedActivitie = LessonType.LabExercise;
				context.Rooms.Add(room);
			}

			context.SaveChanges();
		}

		private void GenerateEnrollments(SchedulerContext context)
		{
			foreach(var semester in context.Semesters)
			{
				if((semester.SemesterNumber - 1) % 2 == currentSemester)
				{
					foreach(var course in semester.Courses)
					{
						foreach (var courseLesson in course.Lessons)
						{
							if (courseLesson.LessonType == LessonType.Exercise || courseLesson.LessonType == LessonType.LabExercise)
							{
								var groups = courseLesson.Course.Semester.StudentGroups;
								foreach (var group in groups)
								{
									var teacherId = GetRandomTeacherId(courseLesson.CourseId, context);
									for (int i = 0; i < courseLesson.LessonCount; i++)
									{
										var enrollment = new Enrollment()
										{
											CourseId = courseLesson.CourseId,
											LessonType = courseLesson.LessonType,
											TeacherId = teacherId
										};
										context.Enrollments.Add(enrollment);
										context.SaveChanges();

										group.Enrollments.Add(enrollment);
										context.SaveChanges();
										foreach (var student in group.Students)
										{
											student.Enrollments.Add(enrollment);
										}
										context.SaveChanges();
									}
								}
							}
							else
							{
								var t1TeacherId = GetRandomTeacherId(courseLesson.CourseId, context);
								var t2TeacherId = GetRandomTeacherId(courseLesson.CourseId, context);
								for (int i = 0; i < courseLesson.LessonCount; i++)
								{
									var torrent1 = courseLesson.Course.Semester.StudentGroups.Where(sg => sg.Number <= 4);
									var enrollment1 = new Enrollment()
									{
										CourseId = courseLesson.CourseId,
										LessonType = courseLesson.LessonType,
										TeacherId = t1TeacherId
									};
									context.Enrollments.Add(enrollment1);
									context.SaveChanges();

									foreach (var group in torrent1)
									{
										group.Enrollments.Add(enrollment1);
										foreach (var student in group.Students)
										{
											student.Enrollments.Add(enrollment1);
										}
										context.SaveChanges();
									}

									var torrent2 = courseLesson.Course.Semester.StudentGroups.Where(sg => sg.Number <= 4);
									var enrollment2 = new Enrollment()
									{
										CourseId = courseLesson.CourseId,
										LessonType = courseLesson.LessonType,
										TeacherId = t2TeacherId
									};
									context.Enrollments.Add(enrollment2);
									context.SaveChanges();

									foreach (var group in torrent2)
									{
										group.Enrollments.Add(enrollment2);
										foreach (var student in group.Students)
										{
											student.Enrollments.Add(enrollment2);
										}
										context.SaveChanges();
									}
								}
							}
						}
					}
				}
			}
		}

		private int GetRandomTeacherId(int courseId, SchedulerContext context)
		{
			var teachers = context.Teachers.Where(t => t.Courses.Count(c => c.Id == courseId) > 0);
			int index = rand.Next(0, teachers.Count() - 1);
			return teachers.AsEnumerable().ElementAt(index).Id;
		}

		private void GenerateStudents(SchedulerContext context)
		{
			foreach(var semester in context.Semesters)
			{
				if((semester.SemesterNumber - 1) % 2 == currentSemester)
				{
					int studentNumberCounter = 0;
					var numberPrefix = GetStudentNumberPrefix(semester.Programme.Name);
					for(int i = 0; i < rand.Next(4, 8); i++)
					{
						var group = new StudentGroup() { Number = i + 1, SemesterId = semester.Id };
						context.StudentGroups.Add(group);
						context.SaveChanges();
						for(int j = 0; j < rand.Next(25, 35); j++)
						{
							var student = new Student() { StudentGroupId = group.Id, Number = string.Format("{0}{1:00000}", numberPrefix, studentNumberCounter++) };
							context.Students.Add(student);
						}
						context.SaveChanges();
					}
				}
			}
		}

		private string GetStudentNumberPrefix(string programmeName)
		{
			StringBuilder prefix = new StringBuilder();
			string[] words = programmeName.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
			foreach(var word in words)
			{
				if(word.Trim().Length > 1)
				{
					prefix.Append(word.Trim().Substring(0, 1));
				}
			}

			return prefix.ToString();
		}

		private void ImportProgrammeData(string filename, SchedulerContext context)
		{
			using (FileStream stream = File.OpenRead(filename))
			{
				using (StreamReader reader = new StreamReader(stream))
				{
					//adds programme
					Programme programme = new Programme();
					programme.Name = reader.ReadLine().Replace("\"", string.Empty).Trim();
					context.Programmes.Add(programme);
					context.SaveChanges();

					string line;
					Regex regex = new Regex(@"^(?<code>([^\t]+\t){4})(?<name>[^\t]+)\t(?<semester>[^\t]+)\t(?<credits>[^\t]+)\t(?<lectures>[^\+]+)\+(?<exercises>[^\+]+)\+(?<labs>[^\+]+)\s*$");
					var semesters = new List<Semester>();
					int semesterNumber = 0;
					string lastSemesterId = string.Empty;
					bool skip = false;
					while((line = reader.ReadLine()) != null)
					{
						var match = regex.Match(line);
						if (match.Success)
						{
							var groups = match.Groups;
							//adds semester
							if (string.Compare(lastSemesterId, groups["semester"].Value.Trim()) != 0)
							{
								if(semesterNumber % 2 == currentSemester)
								{
									semesterNumber++;
									lastSemesterId = groups["semester"].Value.Trim();

									var semester = new Semester() { ProgrammeId = programme.Id, SemesterNumber = semesterNumber };
									context.Semesters.Add(semester);
									context.SaveChanges();
									semesters.Add(semester);
									skip = false;
								}
								else
								{
									skip = true;
								}
							}

							if (skip) continue;

							//Adds course
							var course = new Course()
							{
								Code = groups["code"].Value.Replace("	", string.Empty).Replace(" ", string.Empty),
								Name = groups["name"].Value.Trim(),
								SemesterId = semesters[semesterNumber - 1].Id,
								IsMandatory = true
							};
							context.Courses.Add(course);
							context.SaveChanges();

							//adds teachers
							for(int i = 0; i < rand.Next(2, 4); i++)
							{
								Teacher teacher = new Teacher() { Name = "Преподавател " + course.Name + "ов" };
								teacher.Courses.Add(course);
								context.Teachers.Add(teacher);
								context.SaveChanges();

								//adds teacher availability periods
								for(int j = 0; j < rand.Next(4, 7); j++)
								{
									int start = rand.Next(7, 14);
									int end = rand.Next(start, 21);
									DayOfWeek day = (DayOfWeek)(rand.Next() % 7);
									var period = new TeacherAvailabilityPeriod() { Start = start, End = end, DayOfWeek = day, TeacherId = teacher.Id };
									context.TeacherAvailabilityPeriods.Add(period);
								}
								context.SaveChanges();
							}

							//adds course lessons
							int lectures = Convert.ToInt32(groups["lectures"].Value.Trim());
							int exercises = Convert.ToInt32(groups["exercises"].Value.Trim());
							int labs = Convert.ToInt32(groups["labs"].Value.Trim());
							if (lectures > 0)
							{
								var courseLesson = new CourseLesson() { CourseId = course.Id, LessonType = LessonType.Lecture, LessonCount = lectures };
								context.CourseLessons.Add(courseLesson);
							}
							if (exercises > 0)
							{
								var courseLesson = new CourseLesson() { CourseId = course.Id, LessonType = LessonType.Exercise, LessonCount = exercises };
								context.CourseLessons.Add(courseLesson);
							}
							if (labs > 0)
							{
								var courseLesson = new CourseLesson() { CourseId = course.Id, LessonType = LessonType.LabExercise, LessonCount = labs };
								context.CourseLessons.Add(courseLesson);
							}
							context.SaveChanges();
						}
					}
				}
			}
		}
		#endregion

		#region Schedule Maker
		/// <summary>
		/// Method to check whether the StartScheduleMakerCommand command can be executed.
		/// </summary>
		/// <returns><c>true</c> if the command can be executed; otherwise <c>false</c></returns>
		private bool OnStartScheduleMakerCommandCanExecute()
		{
			return !isScheduleMakerStarted;
		}

		/// <summary>
		/// Method to invoke when the StartScheduleMakerCommand command is executed.
		/// </summary>
		private void OnStartScheduleMakerCommandExecute()
		{
			isScheduleMakerStarted = true;
			scheduleMaker = new ScheduleMaker();
			scheduleMaker.StartMakeSchedule(true);
		}

		/// <summary>
		/// Method to check whether the StopScheduleMakerCommand command can be executed.
		/// </summary>
		/// <returns><c>true</c> if the command can be executed; otherwise <c>false</c></returns>
		private bool OnStopScheduleMakerCommandCanExecute()
		{
			return isScheduleMakerStarted;
		}

		/// <summary>
		/// Method to invoke when the StopScheduleMakerCommand command is executed.
		/// </summary>
		private void OnStopScheduleMakerCommandExecute()
		{
			isScheduleMakerStarted = false;
			scheduleMaker.StopMakeSchedule();
		}
		#endregion

		#endregion
	}
}


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

<title>Debugging with GDB: Symbols In Python</title>

<meta name="description" content="Debugging with GDB: Symbols In Python">
<meta name="keywords" content="Debugging with GDB: Symbols In Python">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Python-API.html#Python-API" rel="up" title="Python API">
<link href="Symbol-Tables-In-Python.html#Symbol-Tables-In-Python" rel="next" title="Symbol Tables In Python">
<link href="Blocks-In-Python.html#Blocks-In-Python" rel="prev" title="Blocks In Python">

Next: Symbol Tables In Python, Previous: Blocks In Python, Up: Python API   [Contents][Index]

23.2.2.26 Python representation of Symbols.

GDB represents every variable, function and type as an
entry in a symbol table.  See Examining the Symbol Table.
Similarly, Python represents these symbols in GDB with the
gdb.Symbol object.

The following symbol-related functions are available in the gdb
module:

Function: gdb.lookup_symbol (name [, block [, domain]])

This function searches for a symbol by name.  The search scope can be
restricted to the parameters defined in the optional domain and block
arguments.

<var>name</var> is the name of the symbol.  It must be a string.  The
optional <var>block</var> argument restricts the search to symbols visible
in that <var>block</var>.  The <var>block</var> argument must be a
gdb.Block object.  If omitted, the block for the current frame
is used.  The optional <var>domain</var> argument restricts
the search to the domain type.  The <var>domain</var> argument must be a
domain constant defined in the gdb module and described later
in this chapter.

The result is a tuple of two elements.
The first element is a gdb.Symbol object or None if the symbol
is not found.
If the symbol is found, the second element is True if the symbol
is a field of a method’s object (e.g., this in C<tt>++</tt>),
otherwise it is False.
If the symbol is not found, the second element is False.

Function: gdb.lookup_global_symbol (name [, domain])

This function searches for a global symbol by name.
The search scope can be restricted to by the domain argument.

<var>name</var> is the name of the symbol.  It must be a string.
The optional <var>domain</var> argument restricts the search to the domain type.
The <var>domain</var> argument must be a domain constant defined in the gdb
module and described later in this chapter.

The result is a gdb.Symbol object or None if the symbol
is not found.

A gdb.Symbol object has the following attributes:

Variable: Symbol.type

The type of the symbol or None if no type is recorded.
This attribute is represented as a gdb.Type object.
See Types In Python.  This attribute is not writable.

Variable: Symbol.symtab

The symbol table in which the symbol appears.  This attribute is
represented as a gdb.Symtab object.  See Symbol Tables In Python.  This attribute is not writable.

Variable: Symbol.line

The line number in the source code at which the symbol was defined.
This is an integer.

Variable: Symbol.name

The name of the symbol as a string.  This attribute is not writable.

Variable: Symbol.linkage_name

The name of the symbol, as used by the linker (i.e., may be mangled).
This attribute is not writable.

Variable: Symbol.print_name

The name of the symbol in a form suitable for output.  This is either
name or linkage_name, depending on whether the user
asked GDB to display demangled or mangled names.

Variable: Symbol.addr_class

The address class of the symbol.  This classifies how to find the value
of a symbol.  Each address class is a constant defined in the
gdb module and described later in this chapter.

Variable: Symbol.needs_frame

This is True if evaluating this symbol’s value requires a frame
(see Frames In Python) and False otherwise.  Typically,
local variables will require a frame, but other symbols will not.

Variable: Symbol.is_argument

True if the symbol is an argument of a function.

Variable: Symbol.is_constant

True if the symbol is a constant.

Variable: Symbol.is_function

True if the symbol is a function or a method.

Variable: Symbol.is_variable

True if the symbol is a variable.

A gdb.Symbol object has the following methods:

Function: Symbol.is_valid ()

Returns True if the gdb.Symbol object is valid,
False if not.  A gdb.Symbol object can become invalid if
the symbol it refers to does not exist in GDB any longer.
All other gdb.Symbol methods will throw an exception if it is
invalid at the time the method is called.

Function: Symbol.value ([frame])

Compute the value of the symbol, as a gdb.Value.  For
functions, this computes the address of the function, cast to the
appropriate type.  If the symbol requires a frame in order to compute
its value, then <var>frame</var> must be given.  If <var>frame</var> is not
given, or if <var>frame</var> is invalid, then this method will throw an
exception.

The available domain categories in gdb.Symbol are represented
as constants in the gdb module:

gdb.SYMBOL_UNDEF_DOMAIN

This is used when a domain has not been discovered or none of the
following domains apply.  This usually indicates an error either
in the symbol information or in GDB’s handling of symbols.

gdb.SYMBOL_VAR_DOMAIN

This domain contains variables, function names, typedef names and enum
type values.

gdb.SYMBOL_STRUCT_DOMAIN

This domain holds struct, union and enum type names.

gdb.SYMBOL_LABEL_DOMAIN

This domain contains names of labels (for gotos).

gdb.SYMBOL_VARIABLES_DOMAIN

This domain holds a subset of the SYMBOLS_VAR_DOMAIN; it
contains everything minus functions and types.

gdb.SYMBOL_FUNCTION_DOMAIN

This domain contains all functions.

gdb.SYMBOL_TYPES_DOMAIN

This domain contains all types.

The available address class categories in gdb.Symbol are represented
as constants in the gdb module:

gdb.SYMBOL_LOC_UNDEF

If this is returned by address class, it indicates an error either in
the symbol information or in GDB’s handling of symbols.

gdb.SYMBOL_LOC_CONST

Value is constant int.

gdb.SYMBOL_LOC_STATIC

Value is at a fixed address.

gdb.SYMBOL_LOC_REGISTER

Value is in a register.

gdb.SYMBOL_LOC_ARG

Value is an argument.  This value is at the offset stored within the
symbol inside the frame’s argument list.

gdb.SYMBOL_LOC_REF_ARG

Value address is stored in the frame’s argument list.  Just like
LOC_ARG except that the value’s address is stored at the
offset, not the value itself.

gdb.SYMBOL_LOC_REGPARM_ADDR

Value is a specified register.  Just like LOC_REGISTER except
the register holds the address of the argument instead of the argument
itself.

gdb.SYMBOL_LOC_LOCAL

Value is a local variable.

gdb.SYMBOL_LOC_TYPEDEF

Value not used.  Symbols in the domain SYMBOL_STRUCT_DOMAIN all
have this class.

gdb.SYMBOL_LOC_BLOCK

Value is a block.

gdb.SYMBOL_LOC_CONST_BYTES

Value is a byte-sequence.

gdb.SYMBOL_LOC_UNRESOLVED

Value is at a fixed address, but the address of the variable has to be
determined from the minimal symbol table whenever the variable is
referenced.

gdb.SYMBOL_LOC_OPTIMIZED_OUT

The value does not actually exist in the program.

gdb.SYMBOL_LOC_COMPUTED

The value’s address is a computed location.

Next: Symbol Tables In Python, Previous: Blocks In Python, Up: Python API   [Contents][Index]

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Javascript Data Structures</title>

  <link rel="shortcut icon" type="image/png" href="lib/jasmine-2.2.0/jasmine_favicon.png">
  <link rel="stylesheet" href="lib/jasmine-2.2.0/jasmine.css">

  <script src="lib/jasmine-2.2.0/jasmine.js"></script>
  <script src="lib/jasmine-2.2.0/jasmine-html.js"></script>
  <script src="lib/jasmine-2.2.0/boot.js"></script>

  <!-- include source files here... -->
  <script src="src/linkedlist.js"></script>
  <script src="src/tree.js"></script>
  <script src="src/binarytree.js"></script>

  <!-- include spec files here... -->
  <script src="spec/linkedlistspec.js"></script>
  <script src="spec/treespec.js"></script>
  <script src="spec/binarytreespec.js"></script>
</head>

<body>
</body>
</html>


text:
import * as React from 'react';
import { alpha } from '@mui/material/styles';
import Box, { BoxProps } from '@mui/material/Box';
import Chip from '@mui/material/Chip';
import Typography from '@mui/material/Typography';
import Stack from '@mui/material/Stack';
import IconImage from 'docs/src/components/icon/IconImage';
import FEATURE_TOGGLE from 'docs/src/featureToggle';
import ROUTES from 'docs/src/route';
import Link from 'docs/src/modules/components/Link';
import useRouterExtra from 'docs/src/modules/utils/useRouterExtra';

const shouldShowJoy =
  process.env.NODE_ENV === 'development' ||
  process.env.PULL_REQUEST ||
  FEATURE_TOGGLE.enable_joy_scope;

function ProductSubMenu({
  icon,
  name,
  description,
  sx = [],
  ...props
}: {
  icon: React.ReactNode;
  name: React.ReactNode;
  description: React.ReactNode;
} & BoxProps) {
  return (
    <Box
      {...props}
      sx={[
        {
          display: 'flex',
          alignItems: 'flex-start',
          gap: 2,
        },
        ...(Array.isArray(sx) ? sx : [sx]),
      ]}
    >
      <Box
        sx={{
          '& circle': {
            fill: (theme) =>
              theme.palette.mode === 'dark'
                ? theme.palette.primaryDark[700]
                : theme.palette.grey[100],
          },
        }}
      >
        {icon}
      </Box>

        <Typography color="text.primary" variant="body2" fontWeight="700">
          {name}
        </Typography>
        <Typography color="text.secondary" variant="body2">
          {description}
        </Typography>

    </Box>
  );
}

export default function MuiProductSelector() {
  const { product } = useRouterExtra();

  return (
    <React.Fragment>
      <Box
        component="li"
        role="none"
        sx={{
          p: 2,
          borderBottom: '1px solid',
          borderColor: (theme) =>
            theme.palette.mode === 'dark'
              ? alpha(theme.palette.primary[100], 0.08)
              : theme.palette.grey[100],
        }}
      >
        <ProductSubMenu
          role="menuitem"
          icon={<IconImage name="product-core" />}
          name="MUI Core"
          description="Ready-to-use foundational components, free forever."
        />
        <Box
          sx={{
            ml: '36px',
            pl: 2,
            pt: 1.5,
            position: 'relative',
          }}
        >
          <Stack
            direction={{ xs: 'column', sm: 'row' }}
            alignItems="flex-start"
            spacing={1}
            sx={{
              '& > .MuiChip-root': {
                position: 'initial',
                '&:hover': {
                  '& .product-description': {
                    opacity: 1,
                  },
                },
              },
            }}
          >
            <Chip
              color={product === 'material-ui' ? 'default' : undefined}
              variant={product === 'material-ui' ? 'filled' : 'outlined'}
              component={Link}
              href={ROUTES.materialDocs}
              label={<React.Fragment>Material UI </React.Fragment>}
              clickable
              size="small"
            />
            {shouldShowJoy && (
              <Chip
                color={product === 'joy-ui' ? 'default' : undefined}
                variant={product === 'joy-ui' ? 'filled' : 'outlined'}
                component={Link}
                href={ROUTES.joyDocs}
                label={<React.Fragment>Joy UI </React.Fragment>}
                clickable
                size="small"
              />
            )}
            <Chip
              color={product === 'base' ? 'default' : undefined}
              variant={product === 'base' ? 'filled' : 'outlined'}
              component={Link}
              href={ROUTES.baseDocs}
              label={<React.Fragment>MUI Base </React.Fragment>}
              clickable
              size="small"
            />
            <Chip
              color={product === 'system' ? 'default' : undefined}
              variant={product === 'system' ? 'filled' : 'outlined'}
              component={Link}
              href={ROUTES.systemDocs}
              label={<React.Fragment>MUI System </React.Fragment>}
              clickable
              size="small"
            />
          </Stack>
        </Box>
      </Box>

        <Link
          href={ROUTES.advancedComponents}
          sx={{
            p: 2,
            width: '100%',
            '&:hover': {
              backgroundColor: (theme) =>
                theme.palette.mode === 'dark'
                  ? alpha(theme.palette.primaryDark[700], 0.4)
                  : theme.palette.grey[50],
            },
          }}
        >
          <ProductSubMenu
            role="menuitem"
            icon={<IconImage name="product-advanced" />}
            name={
              <Box component="span" display="inline-flex" alignItems="center">
                MUI X
              </Box>
            }
            description="Advanced and powerful components for complex use cases."
          />
        </Link>

    </React.Fragment>
  );
}


text:
"""Run linters for App Engine apps.

By default, this looks at all files under the current directory for
those named *_lint.py, and runs all functions named lint_*() inside
those files.  Each lint_*() function is passed a list of files to
lint, which by default is all files under the current directory.
"""

import argparse
import importlib
import os
import subprocess
import sys
import time
import types

# This is needed so the import_module() below can succeed.
import appengine_tool_setup
appengine_tool_setup.fix_sys_path()

from shared import ka_root
from shared.testutil import lintutil

# We can't do a normal import here because 'khan-linter-src' has
# dashes in it.  We could fix that, but we don't want people
# importing khan-linter-src in general; we're a special case.
sys.path.insert(0, ka_root.join('third_party', 'khan-linter-src'))
import runlint as khan_linter

LINT_FILE_SUFFIX = '_lint.py'

def _get_lint_py_files(use_vcs, verbose=False):
    """All *_lint.py files in the current repo."""
    # The fastest way to find out what files are in the current repo is
    # to ask the version control system.  Only if that fails do we ask
    # the filesystem.  This can be disabled by setting use_vcs to False.
    if use_vcs:
        try:
            if verbose:
                print >>sys.stderr, 'Finding linter modules using git ...',
            # This git command essentially lists files in the stage or HEAD.
            # TODO(benkraft): we should also filter out unstaged deletions.
            files = subprocess.check_output(
                ['git', 'ls-files', '--full-name', '-z'])
            files = files.split('\0')
            if verbose:
                print >>sys.stderr, 'done'
            return [f for f in files if f.endswith(LINT_FILE_SUFFIX)]
        except subprocess.CalledProcessError:    # probably not a git repo
            if verbose:
                print >>sys.stderr, '(not a git repo)'

        try:
            if verbose:
                print >>sys.stderr, 'Finding linter modules using hg ...',
            files = subprocess.check_output(['hg', 'locate', '-0',
                                             LINT_FILE_SUFFIX])
            if verbose:
                print >>sys.stderr, 'done'
            return files.split('\0')
        except subprocess.CalledProcessError:    # probably not an hg repo
            if verbose:
                print >>sys.stderr, '(not a mercurial repo)'

    # We could speed this up by taking a list of sub-directories to
    # look under, rather than always looking under '.', but we don't
    # bother because a) we should 'never' get to this case anyway, and
    # b) 99% of the time the user is asking to lint under '.' anyway.
    files = []
    if verbose:
        print >>sys.stderr, 'Finding linter modules using `find` ...',
    for (root, dirnames, filenames) in os.walk('.'):
        for f in filenames:
            if f.endswith(LINT_FILE_SUFFIX):
                files.append(os.path.join(root, f))
    if verbose:
        print >>sys.stderr, 'done'
    return files

def find_linter_files(files_and_dirs, use_vcs=True, verbose=False):
    """Return a list of all files named *_lint.py under the given dirs."""
    all_lint_py_files = _get_lint_py_files(use_vcs, verbose)

    retval = set()
    for d in files_and_dirs:
        if d == '.':
            retval.update(all_lint_py_files)
        elif os.path.isdir(d):
            retval.update(f for f in all_lint_py_files
                          if f.startswith(d.rstrip(os.sep) + os.sep))
        else:
            retval.add(d)     # if they specified a file, just use it
    return retval

def run_lint(linter_files, files_to_lint, verbose=False):
    """Run all the linters in linter_files on all files in files_to_lint.

    Arguments:
        linter_files: a list of files with linter function in it.  Every
          function named lint_* in this file will be run.  Each such
          function returns a list of error-triples:
             (filename, lineno, error_message)
        files_to_lint: a list of files to lint, or None to lint 'all' files
          (whatever that means for a given linter).

    Returns:
        A list of
           ((filename, lineno, errormsg), linter_fn_name)
        tuples.  linter_fn_name is the name of the function (including
        the module) that had the linter error.  filename:lineno is where
        the lint error was identified, and errormsg is a description of
        the error.
    """
    linter_modules = {}
    # First, import all the linters.
    if verbose:
        print >>sys.stderr, "Importing linters...",
    for f in linter_files:
        module_name = os.path.relpath(f).replace(os.sep, '.')
        if module_name.endswith('.py'):
            module_name = module_name[:-len('.py')]
        module = importlib.import_module(module_name)
        linter_modules[module_name] = module
    if verbose:
        print >>sys.stderr, "done"

    # Now, go through each linter file and find the functions to run.
    linter_functions = {}
    for (module_name, module) in linter_modules.iteritems():
        for fn_name in dir(module):
            if ((fn_name.startswith('lint_') or fn_name == 'lint') and
                type(getattr(module, fn_name)) == types.FunctionType):

                linter_functions['%s.%s' % (module_name, fn_name)] = (
                    getattr(module, fn_name))

    # Now, run all the linter functions.
    errors = []
    for (fn_name, fn) in linter_functions.iteritems():
        if verbose:
            print >>sys.stderr, 'Running %s ...' % fn_name,

        num_errors_previously = len(errors)
        start = time.time()
        for (filename, lineno, error) in fn(files_to_lint):
            if (error.endswith(lintutil.NOLINT_NOT_ALLOWED) or
                    not lintutil.has_nolint(filename, lineno)):
                errors.append(((filename, lineno, error), fn_name))
        elapsed = time.time() - start
        num_errors = len(errors) - num_errors_previously

        if verbose:
            print >>sys.stderr, ('%d errors (%.2f seconds)'
                                 % (num_errors, elapsed))

    return errors

def print_lint_errors(errors, use_abspath, verbose, fout):
    """Print to stdout all errors returned by run_lint."""
    if verbose and errors:
        print >>fout, '-- LINT ERRORS:'
    errors.sort()
    for ((filename, lineno, error), linter_fn) in errors:
        if filename is None:
            filename = '<none>'
        if lineno is None:
            lineno = 0
        if not use_abspath:
            filename = os.path.relpath(filename)
        # The 'E314' is to fit this regexp format to what 'arc lint' expects.
        print >>fout, '%s:%s: E314 %s (%s)' % (filename, lineno, error,
                                               linter_fn)

if __name__ == '__main__':
    parser = argparse.ArgumentParser(
        description='Run linters for App Engine apps.')
    parser.add_argument('--blacklist', choices=['yes', 'no', 'auto'],
                        default='auto',
                        help=('If yes, ignore files that are on the blacklist.'
                              ' If no, do not consult the blacklist.'
                              ' If auto, use the blacklist for directories'
                              ' listed on the commandline, but not for files.'
                              ' (default: %(default)s)'))
    parser.add_argument('--blacklist-filename',
                        default=khan_linter._DEFAULT_BLACKLIST_PATTERN,
                        help=('The file to use as a blacklist. If the filename'
                              ' starts with "<ancestor>/", then, for each file'
                              ' to be linted, we take its blacklist to be from'
                              ' the closest parent directory that contains'
                              ' the (rest of the) blacklist filename.'
                              ' (default: %(default)s)'))
    parser.add_argument('--lint-spec', '-l', action='append', default=[],
                        help=("Specify lint-spec by directory or file.  May "
                              "specify more than once."
                              "  Directory name: "
                              "recursively search for files named *_lint.py."
                              "  File name: "
                              "run all methods named `lint_*' in this file."
                              "  (default: ['.'])"))
    parser.add_argument('--abspath', '-a', action='store_true', default=False,
                        help=("When printing lint errors, make all filenames "
                              "absolute paths"))
    parser.add_argument('--no-vcs', action='store_true', default=False,
                        help=("Don't ask git/hg where the lint files are,"
                              " but rather look at the filesystem directly."
                              " This is slower but can be more accurate."))
    parser.add_argument('--verbose', '-v', action='store_true', default=False,
                        help=("More verbose output."))
    parser.add_argument('files_to_lint', nargs='*', default=['.'],
                        metavar='FILE_OR_DIR_TO_LINT',
                        help=('The files or directories to run the linters'
                              ' over; - to read files/data via stdin, one'
                              ' per line (default: %(default)s'))
    args = parser.parse_args()

    lint_specs = args.lint_spec or ['.']
    linter_files = find_linter_files(lint_specs, not args.no_vcs,
                                     args.verbose)

    files_to_lint = args.files_to_lint
    if '-' in files_to_lint:
        files_to_lint.remove('-')
        files_to_lint.extend(sys.stdin.read().splitlines())

    files_to_lint = khan_linter.find_files_to_lint(files_to_lint,
                                                   args.blacklist,
                                                   args.blacklist_filename,
                                                   args.verbose)
    errors = run_lint(linter_files, files_to_lint, args.verbose)
    print_lint_errors(errors, args.abspath, args.verbose, sys.stdout)

    # Clamp, since exitcode of 128+ is reserved for signals.
    sys.exit(min(len(errors), 127))


text:
package myapp.app.com.demo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

/**
 * Created by technicise4 on 20/7/17.
 */

public class Ananya extends AppCompatActivity
{

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.ananya);
    }
}


text:
package ep.opensource.jpa.legacy.persistence.annotation;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * Specifies the primary key of an entity.
 * The mapped column for the primary key of the entity is assumed to be the primary key of the primary table.
 * If no {@link Column} annotation is specified, the primary key column name is assumed to be the name of the primary
 * key field.
 */
@Target(value = FIELD)
@Retention(value = RUNTIME)
public @interface Id {
}


text: tar c src/* examples/* README.md LICENSE | gzip -9 > holes.tar.gz


text:
namespace speech {

extensions::api::speech_recognition_private::SpeechRecognitionType
SpeechRecognitionTypeToApiType(SpeechRecognitionType type) {
  switch (type) {
    case SpeechRecognitionType::kNetwork:
      return extensions::api::speech_recognition_private::
          SpeechRecognitionType::SPEECH_RECOGNITION_TYPE_NETWORK;
    case SpeechRecognitionType::kOnDevice:
      return extensions::api::speech_recognition_private::
          SpeechRecognitionType::SPEECH_RECOGNITION_TYPE_ONDEVICE;
  }

  NOTREACHED();
}

}  // namespace speech