text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Marketplace_model extends CI_Model {

	/**
	* Funcion para traer todas las aplicaciones por categoria y demas
	*/
	public function get_apps($id_category = NULL, $limit=0)
	{
		try
		{
			if($id_category===NULL)
			{
				$this->db->select('wapp.*, COUNT(comment_app.app_id) AS total_comentario');
				$this->db->from('wapp');
				$this->db->join('comment_app', 'wapp.id = comment_app.app_id', 'left');
				$this->db->where('wapp.aproved', 1);
				$this->db->where('wapp.private', 0);
				$this->db->group_by("wapp.id");
				$this->db->order_by("wapp.created", "desc");
				//$this->db->limit(8,$limit);
				$result = $this->db->get()->result();
			}
			else
			{
				$this->db->select('wapp.*, COUNT(comment_app.app_id) AS total_comentario');
				$this->db->from('wapp');
				$this->db->join('comment_app', 'wapp.id = comment_app.app_id', 'left');
				$this->db->where('wapp.category',$id_category);
				$this->db->where('wapp.aproved', 1);
				$this->db->where('wapp.private', 0);
				$this->db->group_by("wapp.id");
				$this->db->order_by("wapp.created", "desc");
				$this->db->limit(8,$limit);
				$result= $this->db->get()->result();
			}
			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorgetapps $e){
			log_message('debug','Error al tratar de traer todas las aplicaciones disponibles');
			return FALSE;
		}
	}
	/**
	* Funcion para traer los comentarios de una aplicación
	*/
	public function get_comments_app($id)
	{
		try
		{
			$result= $this->db->get_where('comment_app', array('app_id' => $id))->result();
			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorgetappini $e){
			log_message('debug','Error al tratar de traer una aplicación inicial para el marketplace');
			return FALSE;
		}
	}
	/**
	* Funcion para traer la aplicación inicial del market
	*/
	public function get_app_ini()
	{
		try
		{
			$result= $this->db->get_where('wapp', array('inicial' => 1), 1)->row();
			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorgetappini $e){
			log_message('debug','Error al tratar de traer una aplicación inicial para el marketplace');
			return FALSE;
		}
	}
	/**
	* Funcion para listar las categorias disponibles de aplicaciones
	*/
	public function get_category()
	{
		try
		{
			$result = $this->db->get('category')->result();
			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorgetcategory $e){
			log_message('debug','Error al tratar de traer todas las categorias para el marketplace');
			return FALSE;
		}
	}
	/**
	* Funcion para traer la url de una categoria
	*/
	public function get_uri_category($category = NULL)
	{
		try
		{
			if($category !== NULL)
			{
				$result= $this->db->get_where('category', array('uri' => $category))->row();
			}
			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorgetcategory $e){
			log_message('debug','Error al tratar de traer todas las categorias para el marketplace');
			return FALSE;
		}
	}
	/**
	* Funcion para agregar que un usuario ya realizó el voto por una aplicación
	*/
	public function insert_vote_app($user_id, $app_id)
	{
		try
		{
			$data	= array(
								'app_id'	=>$app_id,
								'user_id'	=>$user_id
							);
			$result = $this->db->insert('voted_app', $data);
			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorinsertapp $e){
			log_message('debug','Error al tratar de ingresar el voto de un usuario');
			return FALSE;
		}
	}
	/**
	* Funcion para aumentar los puntos de ranking de las aplicaciones
	*/
	public function update_rank_app($app_id,$points)
	{
		try
		{
	        $this->db->set('cuantos', 'cuantos+1',FALSE);
	        $this->db->set('points', 'points+'.$points,FALSE);
			$this->db->where('id', $app_id);
			$result = $this->db->update('wapp');
			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorupdaterank $e){
			log_message('debug','Error al tratar de ingresar el voto de un usuario en la app');
			return FALSE;
		}
	}
	public function get_points($app_id,$points)
	{
		try{
		$this->db->select('points', $points);
		$this->db->from('wapp');
		$this->db->where('id', $app_id);
		$result = $this->db->get('wapp');
			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorupdaterank $e){
			log_message('debug','Error al tratar de ingresar el voto de un usuario en la app');
			return FALSE;
		}
	}
	/**
	* Funcion para realizar una busqueda booleana entre los titulos y descripcion de la aplicación
	*/

	public function get_search($q,$limit=0)
	{
		try
		{
			$this->db->select('wapp.*, COUNT(comment_app.app_id) AS total_comentario');
			$this->db->from('wapp');
			$this->db->join('comment_app', 'wapp.id = comment_app.app_id', 'left');
			$this->db->where("MATCH(wapp.title, wapp.description)AGAINST('".$q."' IN BOOLEAN MODE)", NULL, FALSE);
			$this->db->group_by("wapp.id");
			$this->db->limit(10,$limit);
			$result = $this->db->get()->result();

			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorupdaterank $e){
			log_message('debug','Error al tratar de consultar una aplicacion por el metodo search');
			return FALSE;
		}
	}

	/******************************************
	FUNCIONES AJAX PARA CARGAR DATOS EN EL MARKETPLACE
	*******************************************/
	public function insert_comment_app($data)
	{
		try
		{
			$this->db->set('fecha', 'NOW()',false);
			$result = $this->db->insert('comment_app', $data);
			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorgetappini $e){
			log_message('debug','Error al tratar de agregar un comentario a una aplicacion');
			return FALSE;
		}
	}
	/**
	* Funcion para traer una aplicación en base a un ID
	*/
	public function get_app_by_id($id)
	{
		try
		{
			$result= $this->db->get_where('wapp', array('id' => $id), 1)->row();
			$result->comments = $this->get_comments_app($result->id);
			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorgetappini $e){
			log_message('debug','Error al tratar de traer una aplicación inicial para el marketplace');
			return FALSE;
		}
	}
	/**
	* Funcion publica saber si un usuario ha realizado un voto por una aplicacion
	*/
	public function get_voted_app($user_id, $app_id)
	{
		try
		{
			$result= $this->db->get_where('voted_app', array('user_id' => $user_id,'app_id'=>$app_id))->row();
			if(empty($result))
			{
				return FALSE;
			}
			else
			{
				return $result;
			}
		}catch(Errorvotedapp $e){
			log_message('debug','Error al tratar de saber si un usuario ha realizado un voto por una aplicacion');
			return FALSE;
		}
	}

	public function get_user_credits($user_id=0)
	{
		$user_id = $this->session->userdata('user_id');
		if (empty($user_id)) {
			echo "";
		}else{
			$query = $this->db->query("SELECT credits FROM user where id = ". $user_id . "");
			$row = $query->row();

			return $row->credits;
		}

	}
	public function get_user_name($user_id=0)
	{
		$user_id = $this->session->userdata('user_id');
		if (empty($user_id)) {
			echo "";
		}else{
			$query = $this->db->query("SELECT fullname FROM user where id = ". $user_id . "");
			$row = $query->row();

			return $row->fullname;
		}

	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Anal. Soc. cient. argent. 26(1): 44 (1888)

#### Original name
Montagnella opuntiarum var. opuntiarum

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
import {CreateArticleComponent} from './create-article.component';

export const routes = [
    {path: '', component: CreateArticleComponent, pathMatch: 'full'},
];


text:
package com.bwssystems.HABridge.plugins.fibaro;

public class FibaroFilter {
	boolean useSaveLogs;
	boolean useUserDescription;
	boolean scenesLiliCmddOnly;
	boolean replaceTrash;

	public boolean isUseSaveLogs() {
		return useSaveLogs;
	}
	public void setUseSaveLogs(boolean useSaveLogs) {
		this.useSaveLogs = useSaveLogs;
	}
	public boolean isUseUserDescription() {
		return useUserDescription;
	}
	public void setUseUserDescription(boolean useUserDescription) {
		this.useUserDescription = useUserDescription;
	}
	public boolean isReplaceTrash() {
		return replaceTrash;
	}
	public void setReplaceTrash(boolean replaceTrash) {
		this.replaceTrash = replaceTrash;
	}
	public boolean isScenesLiliCmddOnly() {
		return scenesLiliCmddOnly;
	}
	public void setScenesLiliCmddOnly(boolean scenesLiliCmddOnly) {
		this.scenesLiliCmddOnly = scenesLiliCmddOnly;
	}

}


text:
This project follows semantic versioning.

Possible log types:

- `[added]` for new features.
- `[changed]` for changes in existing functionality.
- `[deprecated]` for once-stable features removed in upcoming releases.
- `[removed]` for deprecated features removed in this release.
- `[fixed]` for any bug fixes.
- `[security]` to invite users to upgrade in case of vulnerabilities.

### Unreleased

- [changed] Update redis to 0.21 and remove r2d2\_redis (#110)

### v0.6.0  (2021-08-30)

- [changed] Update redis to 0.20 and r2d2\_redis to 0.14 (#105, #106)
- [changed] Update quick-error to 2.0 (#106)
- [changed] Update spaceapi to 0.8 to support SpaceAPI v14. See the [spaceapi
  changelog] for more details. (#107)

### v0.5.0 (2020-04-21)

- [changed] Replace last use of `rustc_serialize` with `serde` (#86)
- [changed] Move to Rust 2018 edition (#88)
- [changed] Do not guarantee a fixed MSRV anymore (#99)
- [changed] Bump dependencies, including spaceapi which now uses an enum for
  the `issue_report_channels` see the [spaceapi changelog] for more details
  (#92, #97)
- [changed] Bump redis version. This changes some inner types in the
  `SpaceapiServerError` (#96, #100)
- [added] Add usage and API documentation (#94)
- [changed] Some internal types that were never meant to be
  used outside the crate are now not public anymore (#94)
- [added] Allow to set custom redis pool for custom options (#90)
- [fixed] Panic in `StateFromPeopleNowPresent` (#104)

### v0.4.1 (2018-06-28)

- [changed] Bump minimal required Rust version (#76, #78)
- [changed] Fixed various links in metadata (#75, #79)

### v0.4.0 (2017-06-19)

- [changed] Update spaceapi (0.5) and thus use serde for serialization (#58, #66)
- [changed] Update iron dependency to 0.5 (#62)
- [changed] Add `SpaceApiServerBuilder` and remove `SpaceApiServer::new()` (#68)
- [changed] Add version info statically and remove `modifiers::LibraryVersions` (#70)

### v0.3.1 (2016-09-02)

- [fixed] Removed star version dependency in `Cargo.toml` preventing publication (#55)

### v0.3.0 (2016-09-01)

- [added] Top level `get_version` function (#4)
- [added] Add `LibraryVersions` status modifier (#4)
- [changed] Introduced internal Redis connection pooling (#43)
- [changed] Updated spaceapi dependency to 0.3 (#46)
- [changed] Updated hyper dependency to 0.9 (#51)
- [changed] Updated iron dependency to 0.4 (#51)

### v0.2.0 (2016-03-14)

- [changed] Removed datastore module, use Redis directly (#10)
- [changed] `SpaceapiServer::new()` now returns a Result (#16)
- [changed] `SpaceapiServer.serve()` now returns a `HttpResult<Listening>` (#16)
- [changed] Use `ToSocketAddrs` instead of `IPv4addr` and port in `SpaceapiServer::new()` (#22)
- [added] Support status modifiers (#8)
- [added] Add simple examples (#30)

### v0.1.1 (2015-11-16)

- [fixed] Fixed metadata in `Cargo.toml`

### v0.1.0 (2015-11-14)

- First crates.io release

[spaceapi changelog]: https://github.com/spaceapi-community/spaceapi-rs/blob/master/CHANGELOG.md


text:
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { styled, useThemeProps } from '@mui/material/styles';
import { capitalize } from '@mui/material/utils';
import { unstable_composeClasses as composeClasses } from '@mui/base';
import { getTimelineDotUtilityClass } from './timelineDotClasses';

const useUtilityClasses = (ownerState) => {
  const { color, variant, classes } = ownerState;

  const slots = {
    root: ['root', variant, color !== 'inherit' && `${variant}${capitalize(color)}`],
  };

  return composeClasses(slots, getTimelineDotUtilityClass, classes);
};

const TimelineDotRoot = styled('span', {
  name: 'MuiTimelineDot',
  slot: 'Root',
  overridesResolver: (props, styles) => {
    const { ownerState } = props;

    return [
      styles.root,
      styles[
        ownerState.color !== 'inherit' && `${ownerState.variant}${capitalize(ownerState.color)}`
      ],
      styles[ownerState.variant],
    ];
  },
})(({ ownerState, theme }) => ({
  display: 'flex',
  alignSelf: 'baseline',
  borderStyle: 'solid',
  borderWidth: 2,
  padding: 4,
  borderRadius: '50%',
  boxShadow: (theme.vars || theme).shadows[1],
  margin: '11.5px 0',
  ...(ownerState.variant === 'filled' && {
    borderColor: 'transparent',
    ...(ownerState.color !== 'inherit' && {
      ...(ownerState.color === 'grey'
        ? {
            color: (theme.vars || theme).palette.grey[50],
            backgroundColor: (theme.vars || theme).palette.grey[400],
          }
        : {
            color: (theme.vars || theme).palette[ownerState.color].contrastText,
            backgroundColor: (theme.vars || theme).palette[ownerState.color].main,
          }),
    }),
  }),
  ...(ownerState.variant === 'outlined' && {
    boxShadow: 'none',
    backgroundColor: 'transparent',
    ...(ownerState.color !== 'inherit' && {
      ...(ownerState.color === 'grey'
        ? {
            borderColor: (theme.vars || theme).palette.grey[400],
          }
        : {
            borderColor: (theme.vars || theme).palette[ownerState.color].main,
          }),
    }),
  }),
}));

const TimelineDot = React.forwardRef(function TimelineDot(inProps, ref) {
  const props = useThemeProps({ props: inProps, name: 'MuiTimelineDot' });
  const { className, color = 'grey', variant = 'filled', ...other } = props;

  const ownerState = {
    ...props,
    color,
    variant,
  };

  const classes = useUtilityClasses(ownerState);

  return (
    <TimelineDotRoot
      className={clsx(classes.root, className)}
      ownerState={ownerState}
      ref={ref}
      {...other}
    />
  );
});

TimelineDot.propTypes /* remove-proptypes */ = {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // |     To update them edit the d.ts file and run "yarn proptypes"     |
  // ----------------------------------------------------------------------
  /**
   * The content of the component.
   */
  children: PropTypes.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: PropTypes.object,
  /**
   * @ignore
   */
  className: PropTypes.string,
  /**
   * The dot can have a different colors.
   * @default 'grey'
   */
  color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
    PropTypes.oneOf([
      'error',
      'grey',
      'info',
      'inherit',
      'primary',
      'secondary',
      'success',
      'warning',
    ]),
    PropTypes.string,
  ]),
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: PropTypes.oneOfType([
    PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])),
    PropTypes.func,
    PropTypes.object,
  ]),
  /**
   * The dot can appear filled or outlined.
   * @default 'filled'
   */
  variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([
    PropTypes.oneOf(['filled', 'outlined']),
    PropTypes.string,
  ]),
};

export default TimelineDot;