Thursday 26 October 2017

Objetivo C Media Móvil


Empleos en Objective-C


Tendencia de demanda de empleo de Objective-C


Este gráfico proporciona el total móvil de 3 meses de los trabajos de TI permanentes que citan Objective-C dentro del Reino Unido como proporción de la demanda total dentro de la categoría de idiomas de programación.


Objetivo-C Tendencia salarial


Este gráfico proporciona el promedio móvil de 3 meses para los salarios cotizados en puestos de trabajo IT permanentes que citan Objective-C dentro del Reino Unido.


Histograma del salario Objetivo-C


Este gráfico proporciona un histograma de salario para los trabajos de TI que citan Objective-C durante los 3 meses hasta el 23 de marzo de 2017 dentro del Reino Unido.


Objetivo-C Top 30 puestos de trabajo


El cuadro que aparece a continuación examina la demanda y proporciona una guía de los salarios medios citados en puestos de trabajo de TI que citan Objective-C en el Reino Unido durante los 3 meses hasta el 23 de marzo de 2017. La columna "Cambio de rango" proporciona una indicación del cambio en la demanda dentro Cada lugar basado en el mismo período de 3 meses del año pasado.


Ubicación (Utilice los enlaces a continuación para ver estadísticas detalladas y tendencias históricas)


Cambio de rango en el mismo período del año pasado


Correspondencia de anuncios de trabajo permanentes de TI


Salario promedio de los últimos 3 meses


C objetivo


Recursos de idioma


¿Qué es Objective-C?


Objective-C es un lenguaje de programación potente, reflexivo y orientado a objetos que es un superconjunto estricto del clásico C, extendiéndolo con el estilo de mensajería derivado de Smalltalk. En obras de principios de los 80, apareció por primera vez en 1986, cuando Brad Cox publicó su seminal Object-Oriented Programming, An Evolutionary Approach. Que abordó el problema de la verdadera reutilización del código y proporcionó la descripción principal del lenguaje. De hecho, la razón por la que se creó Objective-C, fue el hecho de que Smalltalk - mientras era capaz de abordar la mayoría de los problemas de ingeniería relacionados con OOP - se requiere para ser ejecutado en la máquina virtual. Todas las herramientas de desarrollo de Smalltalk tenían que ejecutarse también dentro de la máquina virtual. Mientras que algunos de los sistemas más complejos del mundo se desarrollaron en Smalltalk, el ambiente requería enormes cantidades de memoria y poder de procesamiento para funcionar eficientemente. Por lo tanto, simplemente extendiendo C ya popular con algunas de las funcionalidades de Smalltalk parecía ser la mejor opción.


Como en 1988, el C ++ (oficial C con las clases) estaba lejos de ser estandarizado y ampliamente utilizado, la empresa encontrada por entonces despedido Steve Jobs, NeXT decidió licencia Objective-C de StepStone (la empresa Cox) y poco después lanzado Su propio compilador Objective-C y un conjunto de bibliotecas utilizadas para crear la interfaz de usuario NeXTstep. Como las herramientas de desarrollo de software NeXT y la API de OpenStep fueron ampliamente aclamadas, el proyecto GNU decidió crear un clon libre de NeXTstep, conocido como GNUstep y extender la funcionalidad de GNU C Compiler (gcc) con las bibliotecas y runtimes de Objective-C.


Al adquirir NeXT por Apple Inc. Apple decidió utilizar OpenStep y NeXTstep como una base para su nuevo sistema operativo, Mac OS X. Por lo tanto, Objective-C se utilizó para la mayoría de desarrollo, Cocoa API se derivó de OpenStep, y las herramientas NeXTstep, Project Builder (Posteriormente redecorado y renombrado Xcode) y Interface Builder se incluyeron con OS X para el desarrollo nativo.


Hoy en día, la mayor parte del desarrollo de Objective-C ocurre en casa, con Apple tomando decisiones estratégicas sobre la modificación y extensión de la funcionalidad del lenguaje. Mientras que el compilador gcc trabaja felizmente con el código Objective-C, el hecho de que Objective-C se utiliza prácticamente sólo para la programación de iPhone y Mac OS X, lo hace estrechamente entrelazado con los marcos Foundation y Cocoa, por lo que es realmente utilizable sólo en la plataforma OS X.


La versión más reciente del lenguaje es Objective-C 2.0, que se anunció junto con Mac OS X 10.5 Leopard en 2006. Numerosas correcciones fueron anunciadas junto con Mac OS X 10.6 Snow Leopard en 2009. Sin embargo, estos cambios no estaban incluidos aún en El tiempo de ejecución de GNU, y no se sabe si se implementarán o estarán disponibles de la misma manera que en la implementación de Apple. Además, ciertas funciones de escritorio Objective-C no están disponibles en el móvil Objective-C (para iPhone


Recursos útiles


Denominación del identificador, declaración de variables y alcance del identificador


Declaración de variables


Dado que Objective-C, como superconjunto estricto, es totalmente compatible con C, todas las reglas básicas de la declaración de variables se transfieren del lenguaje original. Esto significa que Objective-C tiene cuatro tipos de datos primitivos: int. Flotar Doble Y char. La lengua apoya también cinco calificadores de C - largos. largo largo . corto . Sin firmar Y firmado. También permite al programador declarar ciertas variables como estáticas. Sin embargo, en aras de la compatibilidad formal, Objective-C introduce también un tipo primitivo conocido como id. Que es básicamente un contenedor para un objeto de cualquier tipo, un tipo que permite a Objective-C ser totalmente polimórfico y dinámicamente vinculante.


Además, en Objective-C cualquier número, carácter único o cadena de caracteres se conoce como constante. Es un concepto importante, ya que define la verdadera naturaleza de una variable Objective-C como un almacenamiento de constantes y permite definir una variable como constante desde dentro del valor de la variable. (Agregando ciertos caracteres al final de la misma), sin embargo está fuera del alcance de esta introducción, y le sugerimos referirse a la programación en Objective-C 2.0 para obtener más información sobre esta funcionalidad). Por lo tanto, es imposible que cualquier programa lo modifique Strings y luego por preprocesador concatenación de cadena automática (es decir @ "este" @ "es" @ "una" @ "cadena" es convertida por el compilador en @ "es una cadena")


Las primitivas C se expanden adicionalmente mediante los tipos de Bool adicionales Complex, & # 95; Imaginary (parte de complex. h) y & # 95 ;. El Bool existe como un tipo separado, pero el Complejo tiene que existir como una unión de un tipo de datos y Imaginario (como se presentará en un ejemplo). La conversión automática no ocurre entre estos dos. Creal y cimag de la cabecera complex. h se pueden utilizar posteriormente para extraer las partes real e imaginaria respectivamente.


Objetivo-C también permite que todas las estructuras de datos ANSI C, los sindicatos, las definiciones de tipos, etc Sin embargo, muchos de estos ya ha mejorado (o más adecuadamente a la lengua) implementado, soluciones derivadas de Smalltalk.


El formulario de declaración de variables sigue lo que se conoce de C ++:


El Objetivo-C es al mismo tiempo estático, dinámico y débilmente mecanografiado. Sus primitivas son tipos estáticos, mientras que el tipo dinámico se produce con clases y datos pasados ​​allí. Los datos se escriben débilmente para facilitar el mecanografiado dinámico, ya que Objective-C maneja automáticamente tanto los mensajes entrantes como permite conversiones dinámicas sin la entrada de los usuarios.


Si se utiliza cualquier tipo dinámico, lo más probable es que sea parte de la Fundación o las bibliotecas de Cacao. Como tal, su nombre será precedido por NS (un homenaje a NeXTstep, la plataforma de donde proviene el cacao). La mayoría de las clases de Cocoa y, en general, son una extensión del tipo de objeto más genérico NSObject. La razón de la existencia de NSObject es para el programador con una forma fácil y genérica de responder a las llamadas al sistema (es decir, liberar). Usando NSObject como una clase raíz de la que heredar, permite el uso de las posibles actualizaciones de NSObject durante la evolución del lenguaje.


El poder de Objective-C proviene de su método de gestión de las clases. Mientras que la llamada de primera clase puede tomar hasta 3 veces más, como la llamada de clase C ++ (ya que todo lo relativo a las clases en Objective-C es dinámico), los resultados posteriores se almacenan en caché, lo que permite al menos un aumento del 50% en la clase posterior Llama entonces en C ++. Las clases son declaradas e implementadas en dos archivos. M y. h, siendo paralelas a C's. c y. h. El ejemplo siguiente implementa una clase de fracción, con sus métodos básicos.


Nombres de variables


Mientras Objective-C se basa en C (por lo tanto dando una mano bastante libre al programador con respecto a la denominación), los principios de nombrar se derivaron durante el uso del lenguaje por NeXT y los ingenieros de Apple. Es por esta tradición, que los nombres de las funciones están escritos en la notación de camello (thisIsTheName) y las clases tienen el nombre en mayúsculas (Fraction). Objetivo-C 2.0 se actualizó para soportar Unicode, por lo tanto, al menos teóricamente, un UTF-16 habilitado fuente podría contener constantes de caracteres y nombres de variables escritas en otras páginas de codificación ASCII. No se permiten ciertos nombres de variables, ya que tienen un significado específico dentro de Objective-C (palabras clave). Estas palabras son palabras como para. ir . Int También _ Las directivas del compilador en Objective-C deben ser precedidas explícitamente por el signo @. Esto se utiliza para denotar clases u objetos, por ejemplo:


Los métodos de clase están marcados con signo +, signos por métodos de instancia. Este paradigma se mantiene durante toda la sección de implementación.


Alcance variable


La idea del alcance de la variable es exactamente la misma que la de C. La tabla de símbolos más local se busca en primer lugar y, a continuación, paso a paso, las tablas de los ámbitos anteriores, hasta que se golpea la más externa (global). La oclusión y la ocultación variable son todas las técnicas permitidas en el Objetivo-C. Las variables se pueden definir como constantes, estáticas y globales, dependiendo de la elección de los programadores. Si la variable pasada a una clase es del mismo nombre, como variable interna de la clase, la palabra clave self. Se utiliza para aclarar qué variable estamos refiriendo en este momento. (Siendo el propio ser las propias clases)


Los ámbitos de las variables de clases se dividen en tres formas: @private, @protected y @public. Las variables declaradas como @private solo están disponibles para la propia clase. Ninguna de sus subclases puede acceder a ellos. @protected es el modo predeterminado, en el que los métodos de instancia en la clase, los métodos de instancia en subclases y los métodos de instancia en las extensiones de categoría de la clase pueden hacer referencia a la variable. @public permite toda la funcionalidad @protected, además permite una referencia directa por medio de la flecha (instancia - & gt; variable). Apple desaconseja el uso del público, ya que desafía la noción de encapsulación de datos que es fundamental para la programación orientada a objetos.


Usando previamente definido.


Debido a la naturaleza de Objective-C, la función de búsqueda binaria más básica podría ser implementada de la misma manera que en ANSI C. Sin embargo, usando las clases y los mensajes, podríamos presentar mejor el propio lenguaje (lo que podría ser un exceso Para la búsqueda binaria - oh, bien).


Búsqueda binaria


El código debe ser comprensible desde get-go. De hecho, hemos envuelto un código C muy típico con las clases y métodos de Objective-C. En realidad, Objective-C contiene funciones de biblioteca apropiadas (como diccionarios y listas), que se pueden gestionar desde dentro del programa específicamente, sin necesidad de aritmética de puntero, etc. Sin embargo, como se puede ver, es totalmente posible envolver el código C para Uso adecuado en Objective-C.


Semántica de idiomas


El estado de un programa proporciona información sobre los valores actuales de las diferentes variables que se están almacenando. Desarrollando un lenguaje que sigue una acción: state - & gt; Estado, resulta mucho más fácil definir exactamente qué sucederá con el programa cuando se realice una llamada u operación determinada.


He diseñado una clase de programa simple que tiene self. state que es el estado de los programas y que hace un seguimiento de todas las variables que se necesitan.


He rehacer este simulador para que un estado sea devuelto por cada operación. Esto le permite ver el estado del programa a medida que avanza. Aquí está la salida de mi simulador


E / S de archivos y manejo de excepciones


Ayuda de idioma


El idioma contiene un soporte incorporado para entradas y salidas. Por lo tanto, el programa siguiente únicamente, sin ninguna declaración de importación, proporcionará entrada libre de excepciones de entero en una variable e imprimirá. Utiliza NSLog derivado de Cocoa para imprimir en el dispositivo de registro (que puede ser igualmente un archivo y una pantalla), pero utiliza C scanf para obtener cartas de Terminal. En cuanto a mis conocimientos, printf. Sería también una forma apropiada de imprimir valores a la pantalla, y Cocoa no tiene una clase de entrada separada, ya que las herramientas de Cocoa / Foundation básicamente se transmiten en Interfaces Gráficas de Usuario que manejan la entrada del usuario de manera diferente.


La salida para el código anterior será (si la entrada 1 cuando se le solicite):


Sin embargo, aunque todo esto se ve muy bien, hay que señalar que las definiciones de estas funciones son parte de la Fundación y durante la compilación, el compilador lanzará una advertencia, que en C significaría que una excepción debe ser Esperado en tiempo de ejecución.


Sin embargo, el archivo de salida se ejecuta correctamente. Esto puede deberse al preprocesador de idioma, que importa las bibliotecas apropiadas para el tiempo de ejecución. No puedo comprobar esto contra la documentación sin embargo. Por lo tanto, para no arriesgar incompatibilidades entre implementaciones, se recomienda la importación de la biblioteca de la Fundación de la manera siguiente (note que Objective-C usa la importación en lugar de C _include):


Interpretación de archivos


El soporte de archivos en Objective-C se maneja de dos maneras. Uno se deriva directamente de C (obsoleto), el otro se basa en las clases NSFileManager / NSFileHandle en el marco de la Fundación. NSFileManager permite un acceso completo al sistema de archivos y realizar las siguientes operaciones:


Crear un nuevo archivo


Leer desde un archivo existente


Escribir datos en un archivo


Cambiar el nombre de un archivo


Eliminar (eliminar) un archivo


Prueba de la existencia de un archivo


Determinar el tamaño de un archivo, así como otros atributos


Hacer una copia de un archivo


Pruebe dos archivos para ver si su contenido es igual Mientras NSFileHandle permite:


Abra un archivo para leer, escribir o actualizar (leer y escribir)


Buscar en una posición especificada dentro de un archivo


Leer o escribir un número especificado de bytes desde y hacia un archivo


Muchas operaciones se definen directamente de las bibliotecas particulares de la Fundación con respecto a las variables. Por ejemplo, el código para imprimir el contenido del archivo a la pantalla es:


Como vemos aquí, no se requiere ninguna operación con manejadores de archivos. En su lugar podríamos querer seleccionar un archivo usando FileManager y almacenar su ruta en una variable como fName. Esto convoluciona ligeramente el uso del lenguaje, ya que a más largo plazo, requiere una para crear y recordar numerosos métodos de clase para manejar la entrada, si se requiere una gran flexibilidad. Sin embargo, se pueden aplicar ciertas maneras de eludir esto (es decir, leer el archivo en una cadena y luego analizarlo con los analizadores incorporados en Objective-C).


Para los archivos binarios (o, básicamente, cualquier archivo), Objective-C suministra la clase conocida como NSData, que es un método de almacenamiento para varios archivos leídos desde el disco duro. En los sistemas de 32 bits NSData variable puede ser de 2 GB de tamaño máximo, en sistemas de 64 bits es de 8 EB.


Entrada del usuario


Como se mencionó anteriormente, Objective-C permite la entrada de datos interactivos del usuario utilizando scanf, así como la interfaz gráfica de usuario en aplicaciones más avanzadas.


Manejo de excepciones


Objetivo-C soporta dos formas de lanzar y capturar excepciones. (Por supuesto) A C way, y un Objetivo-C (por supuesto). La forma C está obsoleta y Apple llama a usar las clases para lanzar excepciones (que pueden ser observadas por las palabras clave precedidas por @ signo), para que puedan ser detectadas por el software de depuración especializado llamado Instrumentos. (por supuesto).


Para lanzar una excepción, debe instanciar un objeto con la información apropiada, como el nombre de la excepción y la razón por la que se lanzó. Esto se hace de la siguiente manera, usando llamadas de función largas típicas. La clase NSException puede ser, por supuesto, extendida por herencia en su propia clase, es decir, utilizada en el ejemplo posterior CustomException)


Lanzar una excepción sigue el estilo familiar de Python / Ruby con intentos, capturas y cláusulas finales:


El código que potencialmente puede lanzar una excepción está encerrado en un bloque @try.


Un bloque @catch () contiene una lógica de manejo de excepciones para las excepciones lanzadas en un bloque @try. Puede tener varios bloques @catch () para capturar diferentes tipos de excepción.


Un bloque @finally contiene código que se debe ejecutar si se produce una excepción o no. Utiliza la directiva @throw para lanzar una excepción, que es esencialmente un objeto Objective-C. Normalmente utiliza un objeto NSException, pero no es necesario.


Se pueden capturar múltiples tipos de excepciones utilizando las secuencias de capturas:


2. Para cada uno de sus idiomas, cree algunos programas de ejemplo que demuestren el manejo de errores y excepciones. Algunas cosas a considerar en sus ejemplos y writeup incluyen lo siguiente.


¿Su idioma tiene soporte interno para el manejo de excepciones? En caso afirmativo, ¿cuáles son las estructuras de control y cómo funcionan?


¿Existen convenciones sobre cómo las funciones reportan errores? Si es así, ¿Que son?


¿Cuáles son los errores comunes en su idioma, y ​​qué significan? ¿Qué salió mal?


Funciones y gestión de memoria


Funciones


Sintaxis de una definición de función


La definición de la función original sigue el esquema exacto que se implementa en cada programa C. Sin embargo, este estilo es mal visto y desaprobado para la mayoría de los usos - los métodos de clases se recomiendan como un uso para cualquier cosa remotamente parecida a la manipulación de datos.


La sintaxis del método de clase se derivó de Smalltalk, con ciertas influencias de C. No hay comprobación de tipo cuando los argumentos se copian en los parámetros.


Aquí hay un ejemplo sencillo, reutilizando un fragmento de código escrito para la búsqueda binaria. Como se mencionó anteriormente, el encabezado de definición es de - / + (nombre) esquema de nombre, donde - es el método de instancia, y + es el método de clase.


Según Apple, la gran mayoría de los objetos disponibles en Objective-C se está pasando por referencia. Sin embargo, si se requiere pasar por copia en determinadas circunstancias, se puede invocar precediendo el tipo de variable con la palabra clave bycopy.


Sintaxis de una llamada de función


Lo que diferencia a Objective-C de la mayoría de los descendientes de Simula / ALGOL (como C y C ++) es la forma en que se realizan las llamadas a los objetos. Una sintaxis estándar para llamar a una función es


Puesto que muchas veces el objeto mismo es devuelto como parte del método, permite anidar varias llamadas, como en la inicialización ejemplar de la clase (el método init class proviene de la clase raíz de NSObject a través de la herencia). Esto también permite incluir muchas llamadas de método como expresiones en el código - lo mismo se aplica a las asignaciones también.


Lo que es más o menos:


Numerosos llamados a los métodos pueden ser encadenados juntos, de una manera de:


Una característica interesante de Objective-C es que si un valor incompatible o llamada de método no válido se pasan a la instancia de clase desde fuera, (por ejemplo, llamando al método con variable incorrecta o método inexistente), se ignorará. Esto se utiliza en toda la Fundación, en llamada de clase AwakeFromNIB (ejecutada después de abrir la nueva interfaz gráfica de usuario en pantalla, ya que las GUI se empaquetan en archivos NIB en Cocoa). De forma predeterminada, esta llamada no tiene importancia para la mayoría de las clases.


Además, similar a Java (Obj-C fue una fuerte influencia en su desarrollo), múltiples métodos con los mismos nombres se pueden crear y utilizar para las llamadas. La selección de uno apropiado se hace basado en los tipos y el número de variables que vienen adentro.


Función efectos secundarios


Dependiendo de la función bajo consideración, el efecto secundario puede o no ocurrir. Ciertos métodos crearán sus diccionarios separados que serán descartados al final de la ejecución, por lo que no afectará directamente al estado a largo plazo. Por ejemplo, NSLog no tiene influencia sobre el estado (es decir, sin efectos secundarios), mientras que la declaración de asignación para cadenas hace, especialmente porque en Objective-C se trata de descartar la cadena anterior y reemplazarla por el nuevo objeto.


A medida que el lenguaje se pasa por referencia (en su mayoría), la edición de los objetos pasados ​​causará a menudo el cambio de estado.


Basado en el capítulo 10 de Noonan / Tucker, la Función podría ser representada de forma denotativa como


Gestión de la memoria


Objetivo-C también proporciona al programador con herramientas para hacer recolección de basura. Para activar el recolector de elementos no deseados en X-Code, puede establecer un indicador en las opciones del compilador de GCC o


Cuando se establece este indicador, Objective-C realizará un seguimiento de todos los objetos "accesibles". Un objeto se dice que es accesible si se puede acceder a través de un puntero. Memoria que se había asignado para el almacenamiento, pero no es 'accesible' se marcará como 'libre' cuando el recolector de basura comprueba las referencias. Esto permitirá que este espacio se utilice para almacenar nueva información.


La recolección de basura se ejecutará automáticamente pero se puede inicializar manualmente creando un objeto NSGarbageCollector y ejecutando su método 'collectIfNeeded'. Aquí hay un ejemplo:


Code maneja la memoria por sí solo se compilará correctamente con la recolección de basura activada y en realidad ignorará completamente todas las llamadas a 'autorelase', 'release' o 'dealloc', dejando estas responsabilidades al GC.


La recolección de basura es una herramienta muy útil para ayudar a los programadores a evitar fugas de memoria y ayuda al programador a alejarse de la gestión de memoria. La recolección de basura aún no está disponible para el iPhone.


Empleos de Objective-C en Escocia


Tendencia de la demanda de empleo de Objective-C en Escocia


Este gráfico proporciona un total móvil de 3 meses de trabajos de TI permanentes que citan Objective-C en toda la región de Escocia como una proporción de la demanda total dentro de la categoría de lenguajes de programación.


Objetivo-C Tendencia Salarial en Escocia


Este gráfico proporciona el promedio móvil de 3 meses para los salarios cotizados en puestos de trabajo permanentes de TI que citan el Objetivo-C en toda la región de Escocia.


Histograma de Salario Objetivo-C en Escocia


Este gráfico proporciona un histograma de salario para los trabajos de TI que citan Objective-C en toda la región de Escocia durante los 3 meses hasta el 23 de marzo de 2017.


Ubicaciones de trabajo de Objective-C en Escocia


El cuadro que figura a continuación examina la demanda y proporciona una guía de los salarios medios citados en los puestos de trabajo de TI que citan el Objetivo-C en la región de Escocia durante los 3 meses hasta el 23 de marzo de 2017. La columna "Cambio de rango" Dentro de cada lugar basado en el mismo período de 3 meses del año pasado.


Ubicación (Utilice los enlaces a continuación para ver estadísticas detalladas y tendencias históricas)


Cambio de rango en el mismo período del año pasado


Correspondencia de anuncios permanentes de TI de trabajo


Salario promedio de los últimos 3 meses


Pasando de Objective-C a Swift con Core Data


Por Rob Rhyne 22 de julio de 2017


Cuando Apple anunció el lenguaje de programación Swift en 2017, hubo preguntas sobre el futuro de los frameworks que dependían en gran medida de la naturaleza dinámica de Objective-C. Los marcos tales como objetos de mariscal de datos básicos con dependencias de tipos determinados en tiempo de ejecución. Las estrictas verificaciones de tipo requeridas por el compilador Swift aparecieron en conflicto con Core Data.


Swift 2 fue introducido aproximadamente un año después, lo que generó la conversación sobre los Tipos de Valor y los beneficios prácticos de los objetos modelo inmutables. Protocolos - en particular las extensiones de protocolo - permiten objetos de tipo conductual determinado a través de herencia múltiple y mixins. La promesa parece increíble, pero desafortunadamente el WWDC 2017 fue escaso en ejemplos prácticos de estas nuevas características lingüísticas. Además, se desconocía si Swift 2 traería una vuelta al código expresivo y compacto con el que nos habíamos acostumbrado con Objective-C.


Usando una categoría de NSManagedObject escribí en Objective-C hace casi cinco años, la convertí a Swift como un ejemplo práctico. Quería explorar las características del nuevo lenguaje en un escenario del mundo real. Me pareció que Swift era un lenguaje tan expresivo como Objective-C. Por supuesto, también gané la mejor comprobación de tipos y el manejo de errores superior que son las firmas de Swift. Pero, ¿por qué decirle cuándo es más fácil mostrarlo en código? Vamos a conocer al elenco.


Conoce NSManagedObject + MCPAdditions


Una de las principales quejas que escucho acerca de Core Data es "demasiado código". Debe crear objetos NSPredicate para consultas y no olvide sus NSSortDescriptors asociados. Una de las primeras cosas que hice después de aprender Core Data fue escribir algunas categorías para hacer mi vida más fácil y agilizar el proceso de integración de Core Data en un proyecto 1.


La siguiente es una de esas categorías, que nos permite consultar rápidamente un NSManagedObjectContext suministrado para registros de un tipo especificado:


En primer lugar, las firmas de método telescópico para que podamos utilizar la clasificación por defecto o encontrar todos los objetos de un tipo de registro en particular de una firma de método más corto. A continuación, puede observar el prefijo mcp_ aplicado a cada uno de los métodos para evitar la colisión de espacio de nombres. Puesto que esto es Objective-C, puedo usar id y una colección genérica de NSArray como tipos de retorno flexibles que aceptarán objetos de cualquier tipo. Un lector astuto asumiría que todo el manejo de errores ocurre dentro del método. Grande para el código limpio encima de la cadena, pero mal para descubrir el lugar particular en código donde está ocurriendo un error. No es perfecto, pero siguió las convenciones estándar de Cacao y C.


Rápido al rescate


De inmediato hay características de lenguaje obvias en Swift que pueden simplificar esta API. Mi primera aproximación fue portar la extensión de clase directamente a Swift:


No está mal, ¿eh? Gracias a los valores por defecto, podemos simplificar la extensión a sólo cuatro bloques de métodos. ObjectsInContext (context) y otros seguirán funcionando, por supuesto, gracias a Swift colapsar automáticamente la firma del método. Asesino También podemos permitir que los llamantes sepan cuándo un objeto puede ser nulo y obligarlos a protegerse contra él usando un tipo de devolución opcional. Y no olvidemos el maravilloso lanzamiento que obliga a los que llaman a manejar errores que podrían ocurrir al ejecutar peticiones de búsqueda en el contexto.


Estaba bastante contento con esto cuando lo compartí con mi colega Trevor. Que es mucho más inteligente que Core. Fui a él con dos problemas:


Estúpido lanzamiento de fuerza AnyObject a mis subclases NSManagedObject, p. Devolver resultados como. NSManagedObject. Etc.


Una extensión de clase no se sentía muy rápida. ¿No debería ser esto un protocolo?


¿Por qué el casting a veces es tonto?


Tengo que el compilador es todo saber y si yo sólo confiar en ella maldita sea, me ahorraría de insectos estúpido. Pero a veces el compilador Swift es un poco demasiado malintencionado para mi gusto. Tome el casting requerido al llamar a objectsInContext (_. Predicate. SortedBy. Ascending.). Que sería algo así como:


O si quería vivir peligrosamente, podría escribir:


Pero cada vez que escriba. Alguien en Apple borra un radar, o por lo que el compilador quiere que creamos. La cosa es, escribiendo lo anterior no es peligroso en la práctica porque Core Data casi siempre vend back una matriz de objetos del tipo Entity pasado en la solicitud. Ése es el punto del archivo del modelo que usted crea en Xcode donde usted asigna tipos específicos de la clase a las definiciones del modelo.


Tengo que no debería confiar en el código escrito por mí 2, pero no debería ser capaz de confiar en los marcos de Apple? Probablemente usted puede escuchar a Objective-C riéndose de nosotros en este momento, con el cigarrillo todavía colgando de su boca. Imbécil. Tal vez esto es lo que Brent Simmons estaba hablando cuando dijo que se perdió el tiempo de funcionamiento dinámico de Objective-C.


La conclusión es que el compilador Swift - como Charon - requiere tributo antes de que podamos pasar a la próxima vida.


Render a César ...


Resulta que la respuesta a una pregunta engendró la solución a la otra. Al convertir esta extensión de clase en un protocolo y con un uso inteligente de typealias. Resolví el problema insidioso del bastidor mientras que mantenía seguridad del tipo. Protocolos para el rescate!


En primer lugar, la definición de Fetchable:


Oh, chica inteligente. Resulta que podemos simplemente definir nuestro tipo deseado, diferenciándolo con la definición FetchableType.


Con el fin de compartir la implementación, tenemos que crear una extensión de protocolo que alberga los métodos de hacer el trabajo pesado:


Ahora sólo necesitamos una extensión simple para cada una de nuestras clases de MO de niños, así:


Esto es increíblemente cool, porque ahora tenemos los beneficios de la inferencia de tipo, sin los errores o la incertidumbre porque estoy definiendo el tipo en mi código. En tu cara, ¡Objetivo-C!


Ahora puedo escribir let results = try MyRumMO. ObjectsInContext (context. Predicate. Filter) sin una sola instrucción cast y esperan resultados serán una matriz llena de objetos MyRumMO.


Una cosa más…


Si usted es un superfan Swift, probablemente está sacudiendo la cabeza y se pregunta por qué estoy celebrando el código tan frágil. Después de todo, un error tipográfico simple en la definición de FetchableType podría romper las cosas y el compilador ni siquiera te advertirá. Fret no, compañero superfan, podemos agregar restricciones para mejorar la comprobación de tipo:


Una de las características asesinas de las extensiones de protocolo es que se puede restringir la extensión basada en una variedad de condiciones. La herencia condicional es increíblemente poderosa y en este caso, nos permite hacer cumplir la integridad de nuestra definición FetchableType. La línea FetchableType == Self evitará que la extensión de protocolo (donde vive la implementación) se ejecute en una subclase Fetchable si define erróneamente FetchableType en la definición de clase. Tiempo De La Jalea De La Mantequilla De Cacahuete.


Nota: Esto sólo impide que se aplique la extensión del protocolo, provocando una advertencia del compilador para una implementación incompleta de Fetchable. No es perfecto, pero te da un cheque extra.


Un valeroso nuevo mundo


El objetivo de esta actividad (y escribir este artículo) era mostrar los beneficios de Swift en un ejemplo práctico, con código que se utilizará en aplicaciones de producción. He mostrado cómo se puede reemplazar la flexibilidad de la inferencia de tipos en Objective-C utilizando las capacidades expresivas de las extensiones de protocolo Swift, manteniendo los beneficios de Swift que ya entiende.


Nuestro protocolo resultante (y la extensión) es más compacto que el objetivo original-C. Tiene un manejo de errores superior y puede agregarse a cualquier MO existente sin alterar la jerarquía de herencia existente. Por último, asegura la seguridad de tipo y es explícito.


Ahi tienes. Swift y datos básicos. Gatos y perros viviendo juntos. Si quieres echar un vistazo al protocolo completamente implementado, puedes comprobarlo aquí


Hay una buena razón que contraté gente inteligente para escribir todo el código para los clientes de MartianCraft. & # 8617;


Datos básicos compartidos


Un viaje inesperado de la pasión (parte 1)


(Segundo en una serie)


Hoy discutimos las diversas categorías de métodos de pronóstico que están disponibles para las empresas. Los métodos de predicción pueden ser objetivos (utilizando enfoques cuantitativos) o subjetivos (utilizando enfoques más intuitivos o cualitativos), dependiendo de los datos disponibles y de la distancia en el futuro para la que se desea una predicción. Los enfoques de pronóstico serán típicamente más objetivos para horizontes de pronóstico a más corto plazo y para eventos en los que hay un montón de datos cuantitativos disponibles. Períodos de tiempo más lejanos, o eventos con una falta de datos cuantitativos históricos a menudo requieren enfoques más subjetivos. Discutiremos estas dos clases de métodos de pronóstico, y las categorías dentro de cada uno.


Enfoques de predicción objetivos


Los enfoques de predicción objetiva son de naturaleza cuantitativa y se prestan bien a una abundancia de datos. Existen tres categorías de métodos objetivos de predicción: serie temporal, causal / econométrica e inteligencia artificial. Los enfoques de AI están fuera de mi experiencia, así que no los voy a cubrir en esta serie, pero mencionarlos como otra alternativa, en caso de que desee investigarlos por su cuenta.


Métodos de series de tiempo


Los métodos de series de tiempo intentan estimar los resultados futuros sobre la base de datos históricos. En muchos casos, las ventas anteriores de un producto pueden ser un buen predictor de las próximas ventas debido a los esfuerzos de marketing del período anterior, la repetición del negocio, el conocimiento de la marca y otros factores. Cuando un analista emplea métodos de series de tiempo, él / ella está asumiendo que el futuro seguirá pareciendo el pasado. In rapidly changing industries or environments, time series forecasts are not ideal, and may be useless.


Because time series data are historical, they exhibit four components that emerge over time: trend, seasonal, cyclical, and random (or irregular). Before any forecasting is done on time series data, the data must be adjusted for each of these components. Decomposing time series data will be discussed later in this series.


The most common time series methods include moving average (both straight and weighted), exponential smoothing, and regression analysis. Each of these approaches will be discussed later in the series.


Causal or econometric forecasting methods attempt to predict outcomes based on changes in factors that are known – or believed – to impact those outcomes. For example, temperature may be used to forecast sales of ice cream; advertising expenditures may be used to predict sales; or the unemployment rate might be used to forecast the incidence of crime in a neighborhood. It is important to note, however, that just because a model finds two events that are correlated (e. g. occur together), it does not necessarily mean that one event has caused the other.


Regression analysis also falls under the causal/econometric umbrella, as it can be used to predict an outcome based on changes in other factors (e. g. SAT score may be used to measure likelihood of being accepted to a college). Econometric forecasting methods include Autoregressive Moving Average (ARMA) and Autoregressive Integrated Moving Average (ARIMA) models. ARIMA was previously known as Box-Jenkins. ARMA and ARIMA models are used in certain cases, but most of the time are unnecessary. Although these two methods won’t be covered in much depth later in the series, there will be a brief description of them and when they are needed.


Subjective Forecasting Approaches


Subjective forecasts are more qualitative. These approaches rely most heavily on judgment and educated guesses, since there is little data available for forecasting. This is especially the case in long-range forecasting. It’s easy to forecast next week’s sales of ice cream – and possibly even of individual flavors, since you’ll likely have months or years of past weekly ice cream sales data. However, if you’re trying to get an idea of what ice cream consumption or flavor preferences will be 10 years from now, quantitative approaches will be of little use. Changes in tastes, technology, and political, economic, and social factors occur and can dramatically alter the course of trends. Hence, the opinion of subject matter experts is often called upon. There is essentially only one category of subjective forecast approaches – and it is rightly called “Judgmental” Previsiones.


Judgmental forecasting methods rely much on expert opinion and educated guesses. But just because they have little quantitative or objective basis doesn’t mean they should be dismissed or not measured for accuracy. The most common types of of judgmental forecasting methods are composite forecasts, extrapolation, surveys, Delphi method, scenario writing, and simulation. Each of these methods will be discussed in detail later in the series.


Introducing “Forecast Fridays” & # 8211; ON THURSDAYS.


Beginning with part 3, which will discuss moving average forecasts, the forecasting series will begin posting weekly so that the remaining days of the week can still be devoted to other topics in the marketing research and analytics field. The weekly post will be called “Forecast Friday.” However, it will be posted every Thursday! ¿Por qué? Find out in tomorrow’s post!


Touch Code Magazine


Hi this is Marin - the author of Touch Code Magazine, I hope you are enjoying my tutorials and articles. Also if you need a bright iPhone developer overseas contact me - I do contract work. Here's my LinkedIn profile


Objective-C uses C’s math which you can find in math. h, however as we do program in different languages it is really annoying to remember by heart how the function names are abbreviated in each and every language. Thus comes here a short math overview of the math in Objective-C.


Math functions


double pow ( double, double ) - power of


Few math constants


Navegación del sitio


If you're new here, you may want to subscribe to my RSS feed or follow me on Twitter. ¡Gracias por su visita!


Warning: Objective-C Crash Course Ahead!


Note from Ray . This tutorial is now fully up-to-date for iOS 6, and uses Modern-Objective-C syntax. Here’s the pre iOS 6 version if you need it!


This is a post by iOS Tutorial Team Member Linda Burke. an indie iOS developer and the founder of canApps .


Are you a software developer skilled in another platform, but want to start learning iPhone development (and hence Objective-C)? This was my situation not so long ago, and frankly, I’d gotten a bit rusty from moving further and further away from development in my day job.


Some two years later, I’ve created a lot of apps for the iPhone and iPad. While I often had to learn the hard way, I’d like you to be able to benefit from some of my trials and tribulations.


This tutorial is for readers who already have some programming experience. It assumes that you know your while loop from your fruit loops and a debug from a lady bug! If you’re completely new to programming, you might want to check out our iOS for High School Students series.


The goal of this tutorial is to give you confidence with some of the basics of Objective-C. Instead of taking a “let’s explain every piece of syntax” approach, you’re going to take the approach of diving right in and giving you some hands-on experience and an example to work from. It will then be a lot easier for you to consult a reference (like this one ) when necessary moving forward.


In this tutorial, you will create a simple app that randomly generate quotes from a stored list. In doing so, you’ll become acquainted with a number of aspects of Objective-C, including:


Let me warn you though – iPhone development with Objective-C is a lot of fun and a little addictive. Be prepared to give up some sleep, and the chores might build up. ]


Before you begin, make sure you have an Apple developer account with the provisioning details set up and the latest version of Xcode installed (you can download this for free on the Mac App Store).


When you’re done, I will (Objective) C-you after the jump. ]


Empezando


First things first: create an Xcode project. This tutorial is written for Xcode 4.5+ and iOS 6+ – if you have an older version of Xcode, you should either upgrade or check out the pre iOS 6 version of this tutorial.


Start up Xcode and create a new project with the iOS\Application\Single View Application template.


Enter QuoteGen for the product name, set device family to iPhone . and make sure Use Automatic Reference Counting and Use Storyboards are checked (but leave the other checkboxes unchecked). Now click Next and select the location to save your project.


You will notice that your project has been created with AppDelegate. h . AppDelegate. m . ViewController. h and ViewController. m files, as well as a MainStoryboard. storyboard .


The AppDelegate contains the code that initiates the app. For this tutorial, that’s all you need to know. Here are brief explanations of the other files, with which you will be working directly:


MainStoryboard. storyboard is the interface layout file. You visually create/design the screens that are displayed on the iPhone device using this file.


ViewController. m is the interface controller class. The interface layout file is linked to this class. This happens automatically, so at this stage you don’t need to think about it other than to know that any objects or events you set up in your interface class can be linked to your interface layout very easily. This is the file that will contain the Objective-C code you’re about to create.


ViewController. h is the interface controller class header file, where you’ll declare the instance variables, as well as the objects and events that you need to access from the interface screen.


Note: There are two ways to create interfaces in Xcode – with Storyboards and with Xcode Interface Builder files (XIBs). Either way works fine, in this tutorial we’ll be using Storyboards since it’s the most common way these days. But the two methods are quite similar – if you understand one you’ll have an easy time understanding the other.


For more information on Storyboards, check out this tutorial when you’re done.


Heading in the Right Direction


The first thing you need to do is create some variables for the quotes you want to display in this app – normal quotes and movie-related quotes.


To do this, you will create two Objective-C properties . There’s some subtle aspects to properties, but for now just think of them as a way to create variables on your class.


It’s very easy to create a property – let’s try it out by adding a property for an array of quotes. Add this line to ViewController. h . between the @interface and @end lines:


Let’s break this down bit-by-bit:


First you need to add the @property keyword.


Then you list the property attributes . Without going too deeply into this topic – the nonatomic attribute increases performance at the cost of thread-safety, and the strong attribute indicates that a pointer to the specified variable will stay in memory as long as the object that holds the pointer exists.


Then you list the type of the property . Here you choose NSArray * . which means “pointer to an NSArray class.” NSArray is a handy class provided by Apple that stores lists of data – we’ll talk more about this soon.


Finally, you add the property name .


By adding this single line, you now have a variable you can set and get on this class!


Note: In the old days, you also had to @synthesize your properties after creating them, and in the really old days you had to manually declare your instance variables as well. This is no longer the case – now all you need to do to add a property is add this single line!


Also in the old days, you used to have to do all the memory management yourself, but now with a new feature called Automatic Reference Counting (ARC) it’s automatic. To read more about ARC, check out this tutorial .


Am I showing my age by knowing all this. ]


This app is also going to store some famous quotes from movies. For this, you need a second array:


Here you’re using an NSMutableArray simply to illustrate the different types of arrays. The difference is you cannot add or remove items to an NSArray after you create it, but you can add or remove items from NSMutableArray whenever you want.


Manual Labor


Now you can store your favorite quotes in the myQuotes array. You’ll do this in viewDidLoad . which is the method that executes when the view (screen) is first created.


In viewDidLoad . add the following code after [super viewDidLoad];. Include your own favorite quotes if you like. This is the “manual labor” approach and is quite okay for a small number of array entries.


Here you are setting the myQuotes property to a list of quotes. There’s some funky syntax you might not be used to here, so let’s break it down.


self is a special keyword that means “this current class” & # 8211; kind of like this in other programming languages.


You can access properties on the class by using a dot, and then typing the name of the property – i. e. self. myQuotes lets you access the myQuotes property you created earlier.


To create an array, there’s a handy new shortcut in Objective-C – @[ item1, item 2, item 3 ] .


Each item in the array is a string. To create strings in Objective-C, you need to prefix them with the @ symbol. If you’re used to other languages, this can be easy to forget, which will probably cause your app to crash :] So if your app crashes when it uses a string, double check you remembered to use the @ symbol!


Great – now you have an array of quotes ready to go. It’s time to add some code that will allow you to display a random quote on the screen!


Going to the Outlets


You haven’t created the user interface yet, but when you do you’ll be adding a text view to show the quote, and a button to tap to get a random quote.


To display a random quote to the screen, you’ll need two things – a reference to the text view so you can set the text appropriately, and notification when the button is tapped.


But how do you connect what goes on in the interface with your code? Through some special keywords – IBOutlet and IBAction!


Let’s see how this works, starting with an IBOutlet. Add the following to ViewController. h under the arrays:


Here you declare a property just like before (for a UITextView class), but you mark it with a special keyword – IBOutlet .


IBOutlet means that quote_text is an object that can be linked to an interface element on the XIB file so that the view controller can access (or change) properties of the interface element. In this case, we’ll be setting the displayed text for the UITextView control but you could just as easily change the color, font, size, etc.


Next, add the following line of code after the list of properties:


This defines a method that you will implement in this class. This is the first time you’ve seen a method defined in Objective-C, so let’s go over it bit-by-bit:


First you put a dash – . which indicates you are defining an instance method.


Then you put the return value of the method. This particular method returns an IBAction . which is actually defined to void – i. e. the method returns nothing. But IBAction has another special property – it marks the method as something to you can connect to an action on a UI element. In this case, you’ll be hooking things up so when the button gets tapped, this method gets called.


Next you put the name of the method – quoteButtonTapped in this case.


Then you put a colon, and in parenthesis put the type of the first parameter. id is a special type that means “any object that derives from NSObject”. Usually when you set up callbacks that buttons and other controls will call, they pass whatever button/control is sending the callback as the first parameter. Since you don’t necessarily know what type it is, you put id here.


Then you put the name of the parameter – sender in this case.


If you had more than one parameter, you would just repeat steps 3-5 multiple times. The syntax of naming methods is a little strange in Objective-C, but you’ll like it when you get used to it.


Next, switch to ViewController. m to add the implementation of quoteButtonTapped. Add this to the end of the file (but above @end):


Let’s go over this line by line:


First you get the count of items in an array. This is the first example you’ve seen of calling a method in Objective-C. The syntax is a little strange – you put a bracket ( [ ), then the name of the object you’re calling the method on ( self. myQuotes ), then the name of the method you’re calling ( count ). Finally, you end the method call with a close bracket ( ] ). Note this method doesn’t take any parameters – you’ll see an example that does in step 4.


Next you use the arc4random function to generate a random number. arc4random() is a regular C-style function (not a method), so you use the regular parenthesis syntax you know and love. In this case, since you want to randomly select one of the quotes, the highest possible value is the number of rows in the array, and the lowest possible value is 0. In Objective-C (like many other languages), the first row in an array is row 0, not 1.


Next you look up an item in myQuotes. Objective-C’s new literal syntax allows you to access elements in an NSArray by simple subscripting like you can see here.


Finally, you use stringWithFormat method to format the final output string so that you can display a label and add a new line before displaying the quote. It uses variable substitution, like printf in C/C++. %f is float, %d is integer, and %@ is Objective-C object.


Now in order to actually see the quote on the screen, you need to link the text field outlet in the class with a text field control in your XIB file.


Hooking Up a Control


To see it all in action, open up MainStoryboard. storyboard . Next, look for the right sidebar in your Xcode window. If you don’t see one, you might need to use the rightmost button under the Views section, on the toolbar at the top, to make the right hand sidebar visible.


The lower part of the righthand sidebar has four tabs, which you can switch between using the icons at the top of that section. The section you want is the Object Library.


From the Object Library, drag a Text View control and a Round Rect Button onto the view. Position them to your liking. Add a title to the button, such as “Quote”. Change the color and font for the controls as you see fit. You can change most properties for the controls via the upper part of the right hand sidebar which too has several tabs that you can switch between – the one you’ll use the most to customise the appearance of the controls is the Attributes Inspector tab.


As the text field is for display only, untick Behavior – Editable.


Now you need to link the button and the text view to the outlet and action you already set up in your class.


Link your text view by control-clicking the View Controller in the left sidebar, and dragging to the text view. Release, and select quoteText from the popup that appears.


Alternatively, you can simply select the view controller in the left sidebar and then switch the top portion of the right hand sidebar to the Connections Inspector tab. You should see all the connections available for your View Controller. You can now simply drag from the available connection to the control visible on screen.


Remember the reason why the Storyboard knows about your quoteText property is because you added the IBOutlet keyword earlier!


Hooking Up an Action


Hooking up an action on a control (such as a button tap) to a method is quite similar to the process of hooking up a control to a property.


This time, control-drag from the button up to the View Controller, release, and choose quoteButtonTapped: from the popup:


Alternatively, you can simply select the button, and if you have the Connections Inspector selected in the right hand sidebar, you’ll notice that you get a list of events for the button. You can drag from Touch Up Inside event to the View Controller there as well.


Let Her Rip!


¿Adivina qué? You’re ready to rock ‘n’ rodar. Simply click on the Xcode Run button (the first button at the top of the screen) to compile and run your app in the simulator.


If there are errors, don’t panic. At this stage, they should be self-explanatory. Often just typos when declaring your variables. Remember, Xcode is case-sensitive.


If your app does compile and run, then click on the Quote button to get a random quote:


Allright – you have a functional app, and you’ve learned a ton about Objective-C already – you’ve created properties, your own method, made use of classes, and tons more!


But wait – there’s more! Right now your list of quotes are hard-coded into the app. Wouldn’t it be a lot better if you could load them from an external file?


Ah, the joys of property lists are about to be revealed!


Property Lists Rule!


A property list is a special XML format defined by Apple that are designed to store basic data types like strings, numbers, arrays, and dictionaries. They are very easy to create, and to read and write from code, so they are a great way to get in small bits of data into your app.


Let’s try this out! Create a new file by right-clicking on your project root on the left sidebar (the Project Navigator) and selecting New File . Then select the iOS\Resource\Property List template and click Next . Select the location to save your new file (usually somewhere within the project folder for the tutorial project) and name the file quotes. plist .


You can either edit the property list file from within Xcode in a grid-view (as a list of properties) or as a text file. If you want to edit as a text file, right-click on the quotes file on the Project Navigator and select Open As\Source Code.


Since you want to quickly add all the quotes by copying and pasting, opening as source code probably would be the faster route. If you want though, you can try the grid view approach and try to figure out how to add the same values as below using that method.


Now, add your movie quotes by copying and pasting the following into quotes (in source code mode):


These are just a few quotes to serve as examples. Have some fun and add your own favorites. If you’re feeling lazy, the sample project has a property list of many quotes.


The quotes are categorized as either classic or modern to illustrate a really neat feature that we’ll get to a bit later.


You can also switch over to the Property List view (right-click on the quotes file on the Project Navigator and select Open As\Property List) to see how the values you added look in the grid view and how it is organised. Now that you know how the different editing modes work, you can always switch back and forth as you like.


Property lists are cool, but can be very uncool when you get an error. Common mistakes for newbies are forgetting the end tag or accidentally deleting a. If your property list doesn’t load, then you’ll need to trawl through and work out why. Earlier versions of Xcode gave line numbers for errors. I think it was from version 4 onwards that this helpful feature was excluded.


If you really get stuck, you need to methodically go through your file. I do this (a bit too often to be frank) to make it easier: copy my plist file, then remove chunks a bit at a time to identify the approximate location of the error.


Having created your lovely property list, you are now ready to load it into an array for use. So let’s switch back to ViewController. m and add the following to the end of viewDidLoad :


It’s as easy as that – now you have an array with all of the movie quote data you entered in the property list!


To try out your new array, you might think that all you really need to do is change getting the random quote from your personal quotes array to the movie quotes array. So, in quoteButtonTapped: you simply replace all references to myQuotes with movieQuotes, right?


But that alone will not work, as you will find if you try it. This is because myQuotes was an array of quote strings. But movieQuotes is not an array of strings. Instead, it’s an array of dictionaries where a dictionary is a list of values where you can access each value based on a unique key.


¿Por qué? Because that’s how you set up the property list (go look at it again to see!)


Note: Dictionaries are key/value stores, similar to hashtables in other languages. You can look up entries in a dictionary with the valueForKey method.


So replace quoteButtonTapped with the following code which switches over to using the movieQuotes array but also gets the quote by using the right key for each quote dictionary:


Keep the commented out line in section #3 as it will come in handy later. Build and run and enjoy your new movie quotes!


Awesome, now you have a file that can read quotes from an external file! This can be especially handy if you want someone else to fill in some quotes for you as you continue to work on your app.


Next you’re going to get a bit fancy and allow the user to select between viewing myQuotes or movieQuotes, and whether to view classic or modern movie quotes.


Options, Options, Options


First you need to go back to your class header file, ViewController. h . and add a new property.


Here you’ve added a property that you’ll hook up to a segmented control which will allow you to select one item from a list of options – perfect for selecting a quote type!


Now go to MainStoryboard. storyboard and drag a Segmented Control onto your view.


Change the properties of the control to the following:


Style: Bar (my personal preference)


Segments: 3


Select Segment: 0 and change the title to: Classic


Select Segment: 1 and change the title to: Modern


Select Segment: 2 and change the title to: Mine


This achieves the effect of having three different quote types – or rather, the ability to select between one of the three.


Having created your Segmented Control, you need to link it to the outlet in your class. You can use the same method as before to hook up the control to the quoteOpt property on the View Controller.


You will not need an action event for this control.


Why don’t you build and run to see your new control on screen? It won’t do anything at the moment, but it’s nice to know it’s there!


The Joy of Predicates


A predicate is a useful object that filters an array. It’s a bit like having a select with a simple where clause in SQL. I find them quite useful when I have a categorized property list. It saves you from having to create separate property lists.


Don’t hate me, but you have to go back and change quoteButtonTapped: in ViewController. m to use myQuotes instead of movieQuotes, as you will soon do something quite different for your movie quotes. And you need to put a condition around it, so that you’ll only use this when the third option is selected in the Segmented Control.


Or, if you prefer, simply replace quoteButtonTapped: with the following code:


Now the user will see myQuotes only when they select the third option. As you’ll notice the rest of the code is the same as before, the only difference is that you display a quote (and that quote comes from the personal quote list) only when the segmented control has segment with index 2 selected. And as you might recall, since the segment control starts at index 0, index 2 means the third item.


Build and test your code to make sure that it works as you expect and that the quotes show up only when the “Mine” tab/segment is selected.


For the predicate fun, first you figure out the category you need based on the selected segment control and then use the category to create a filtered array of quotes that matches the category. Stay with me!


This is the code on the other side of the if statement in quoteButtonTapped: – so simply add this to the end of the method to complete the “if” statement begun in section #1:


Okay, build and run. Check that you see the right type of quote depending on your selection. If you are always getting the same type, my guess would be that you may not have linked the Segmented Control to your class.


The String Symphony


So far, so good! Now let’s explore some different string options and syntax in Objective-C.


If the quote has a source in the property list, then the app should display that as well. To check if there’s a value in a string, you can check the length of the string.


So add the following to quoteButtonTapped: after the first line in section #2.6 (the first line not counting the comment, that is):


You get the source from the array and check that it contains a value by making sure that its length is not zero. ! represents NOT. Use == when checking if an integer is equal to a value.


Then you build a new display string by combining the quote and the source using stringWithFormat .


To make things more interesting, why don’t you display something slightly different for quotes from classic movies that will involve checking the value of the category of the selected quote?


Replace section #2.8 in quoteButtonTapped: with the following:


This checks if the string is equal to a specific value, in this case “classic”, and customizes the label for the quote based on the category.


If you want to check for a particular movie title (or for that matter any other string attribute) starts with a particular value, you can do that too. Say you want to display some extra text if the quote is from a Harry Potter movie – add the following right above section #2.9:


As you can guess, hasPrefix is used to check if the start of the string has a particular text value.


Build and run your app to make sure that it works as you expect it to. Pay attention to the different categories and to Harry Potter movie quotes to make sure that it all works correctly.


It’s ARRAYning Quotes


Just for fun, you’re going to concatenate all your quotes together, as there aren’t many. This will illustrate how to loop through an array, which you might need to do if you want to iterate over each item in an array to process each item.


In quoteButtonTapped: replace section #1 with the following:


A for loop is used to loop through the array from row 0 to the last row. x is the counter that is used to keep track of the rows.


Now run and check the results.


One last thing. I mentioned earlier that there are different types of arrays: NSArray and NSMutableArray . So far, each has done the same job in this project.


Use an NSMutableArray if you want to modify/update it. As the name implies, a mutable array can be changed whereas a normal NSArray is static and you cannot add new items to the array or delete items from the array easily.


For example, if you wanted to update the array after a row had been selected in order to show that that quote had already been displayed, you would need an NSMutableArray.


In this project, movieQuotes is your NSMutableArray. You’re using a predicate . so you first need to find the row in movieQuotes and then update it. Add the following code after section #2.9 in quoteButtonTapped: :


You loop through the array and check each row to see if it’s the row you’re looking for. Again you use isEqualToString ; this time, however, you’re comparing two string variables.


To update the row in the array, you retrieve the object for the row in question and update the object. This is starting to get a bit advanced for this tutorial, but it’s useful to know.


Since you’re updating the source string and since the source string is what is used to select quotes for each category, the row will not be included next time you use NSPredicate to filter the array. And that’s quite neat.


Where to Go From Here?


Here is a sample project with all of the code from the above tutorial.


Well, you’ve reached the end of this little project. You’ve learned how to use arrays in different ways, initiate actions from interface events, access objects via Interface Builder using a XIB file and do various string comparisons and concatenations. That is not a bad effort if this is your first iPhone app!


Now that you know the basics, you might want to try out our How To Create a Simple iPhone App tutorial series, or sign up for our monthly newsletter for an epic-length iOS tutorial for beginners.


The forums are available if you have any questions about what you’ve done. Also, if you liked this tutorial and would like to see more in the series, please let me know in the forums!


In the meantime, good luck and keep ‘appy. ]


Linda is an IT Professional with 20+ years experience in the IT industry based in Melbourne, Australia. Linda has gotten back to her roots (and youth) by developing iOS apps in her spare time. She is the founder of a family based iPhone app development studio, canApps. When Linda is not developing apps by the fire, she is loving life… and thinking of new app ideas! You can follow Linda on Twitter .


You can read earlier discussions of this topic in the archives


Note from Ray: This tutorial is now fully up-to-date for iOS 6, and uses Modern-Objective-C syntax. Here’s the pre iOS 6 version if you need it! This is a post by iOS Tutorial Team Member Linda Burke, an indie iOS developer and the founder of canApps. Are you a software developer skilled in another platform, […]


Other Items of Interest


raywenderlich. com Weekly


Sign up to receive the latest tutorials from raywenderlich. com each week, and receive a free epic-length tutorial as a bonus!


Advertise with Us!


Unity Starter Kit!


Our Books


Our Team


About RayWenderlich. com


Objective-C Programming/syntax


Objective-C is an object-oriented programming language, and is a layer over the C programming language. This means that if you know how to write C, there are only a few syntax changes to learn.


In this section, we will look at how we can implement classes and instantiate objects in Objective-C. If you are unfamiliar with object-oriented programming, see Objective-C concepts .


Basic syntax Edit


If you have studied C, you can skip this section and proceed to the next section, A word on runtimes. If not, or if you're a little rusty, read on.


In C, code is contained within a function. Functions are composed of several statements, each of which are terminated by a semicolon. For example, a simple function in C to add two numbers may look like this:


This sample has the following lines:


The function definition (which returns an int (integer), is named add . and takes two parameters, both of which are integers). // Integers are whole numbers like 6, 66 or 567 and not numbers with decimal places like 5.6.


The opening function brace


A variable declaration


An assignment statement


A return statement, which returns the value of c to the calling function/


The closing function brace


For control flow, C and Objective-C use:


for (<initial>;<condition>;<increment>)


while (<condition>)


do. while (<condition>)


switch (<condition>)


if (<condition>) then [else <statements>]


The for, while, and do statements will continue execution of a loop until the condition is false. The switch and if statements jump to different statements depending on the condition.


Objective-C does not implement or import any functions by default. Instead, they need to be imported by using the #import preprocessor directive. (#include works too, but generally it is not used in Objective-C - #import works better because it won't import the same thing twice like #include can try to do)


A word on runtimes Edit


Objective-C requires what is known as a runtime system to provide you with Objective-C features. The runtime takes care of the creation, management, and destruction of objects.


If you have the gcc compiler, you should have the Objective-C runtime already installed. Otherwise, you may have to install the runtime separately. Note that gcc is a compiler collection; the full install contains not only the C compiler, but also C++, Java, Objective-C and even Fortran-95 and Ada 2005 compilers. However, it is possible to install gcc only partially . for example only the C compiler. Therefore, the Objective-C runtime may or may not be installed with gcc. Check your distribution.


Two main systems are used to run Objective-C programs:


the GNU runtime, which is provided as a part of gcc on Unix and Unix-like operating systems;


the NeXT runtime, which is provided on NeXTSTEP, OPENSTEP, and Mac OS X operating systems.


This text assumes you are using the GNU runtime, but the two runtime systems are almost identical.


This text does not cover the OPENSTEP, Cocoa, or GNUstep frameworks, but the skills learned here will be helpful when developing with those systems.


Writing classes in Objective-C Edit


Writing an Objective-C class requires a few design decisions before we start writing any code. Say we are writing a class to represent a point called Point in a two-dimensional plane.


We need to ask ourselves two questions:


What data do we need to store and use? This relates to the instance variables we need to declare.


What operations do we need to perform? This relates to the methods we need to define.


For this example, we'll use double variables for the x and y coordinates. We'll define a method to get both coordinates, and we'll define a method to get their distance from the origin.


The interface Edit


Let's examine what each element of this interface means.


The @interface line says that we begin the declaration of the Point interface. We inherit from another class called Object . Objective-C provides you with a generic class, called Object . The Object class is a root class -- it does not inherit from another class. The Object class provides a set of methods that provide key functionality for an object to be used and recognized by the Objective-C runtime. As in C, we need to include Object 's header file, Object. h . before we can use the set of methods declared in the header.


If you don't explicitly inherit from some class, your class becomes a root class. (In Objective-C, there can be many root classes.) That's probably not what you want to do, because creating a root class is a very tricky and advanced topic that is only useful in very specific situations. In most cases, you will want to inherit from Object or some class that inherits from Object . etc. If you develop in NeXTStep / GNUstep / Cocoa, you will mostly be using another root class called NSObject . which provides different basic methods than Object .


The word import means that we only include the file once . This solves problems like recursive includes.


Anything between the braces in an interface declaration specifies the instance variables that the class has.


The @private line is a visibility modifier: it says that the instance variables after it are private . i. e. they are accessible only from the class that declares them. It is good practice to mark all your instance variables private: they contain the state of an object and they should never be changed except by the object itself.


The declarations for the methods come after the instance variables. This is a declaration for the method to set the x value. It's common Objective-C style to name the setter method with the same name as the variable it's setting.


The hyphen specifies an instance method (we'll look at these later). Then comes the name for the method (this method is called x: - note the colon), and the colon signifies an argument, called x_value . and is of type double .


The cast on the x_value argument is necessary, because unlike C, the default type is id . and not int . The type id is very special—it is a type that can hold any object whatsoever. The first cast is not strictly necessary, but should be used for clarity. The first cast tells us that the method x returns an object back.


This is another method named x (no colon), but it returns a double . This is the specification for the method that gets the value of the x variable. There is no conflict with the previous method because the types are different, and the previous method takes one argument whilst this takes none.


After all the methods and instance variables are specified, this symbol marks the end of the declaration.


The interface specification goes in a. h file—a header file. It's customary to call the file after the class, so we would create a file called Point. h .


The implementation Edit


This is the implementation for the Point class. We implement the methods in the interface defined above. Let's have a look at each element of the implementation in turn.


Again, we import Point 's interface, just as we do in C.


This is a marker that identifies the beginning of the implementation.


This is a typical method implementation. We can use the x variable directly without having to declare it since it is already declared in the interface, and is accessible only to the methods of this class. The behaviour, in general, is like an ordinary C function. Here we assign the value of the argument x_value to the instance variable x .


The function then, returns the entire, current object as modified. The keyword self represents the current object.


Here is the simple method to get the value of the x variable. We simply return it.


The behaviour for the other methods should be similar to those above. The @end keyword ends the implementation.


The implementation specification goes in a. m file. It's customary to call the file after the class, so we would create a file called Point. m .


Using the objects Edit


Since Objective-C comes from C, we write a main function to make use of the class that we just created. Here's one typical main function.


Let's examine what happens here.


We import the interface to Point so we can use it. We import stdio. h so we can use printf .


This is a typical Objective-C method call:


Point *point declares, technically, a pointer to an instance of type Point . Actually, it may be best to think of this merely as a variable holding a Point object, but keep the pointer idea in mind.


[Point new] calls a method called new . The first half before the space represents the object we call the method on. The second half is the method name and arguments. The new method is called a class method . because it doesn't do something with respect to an instance of a class, it does something with respect to the class itself. The new method allocates memory and initializes the object, making it ready for use. There is no need to explicitly delete an object, as Objective C keeps track of the number of references to a given object, and deallocates them as necessary. NOTE: The new method is shorthand for alloc and init and may not always be available. If it is not, the object can be initialized and made ready for use in the following fashion: [[Point alloc] init]


These are some typical instance method calls. We call point 's method x: and y: . In Objective-C terminology, we say that we send point a message to apply to the method x: .


These messages assign point 's x and y variables. Recall that the x: and y: methods had in them return self; . This means that we can chain the two messages together, as follows:


The message [point x:10.0] returns an object, point . with its x variable set. Then on that object . the outer message assigns its y variable.


The printf statement has in it the method calls [point x] . which returns the value of the x variable for printing, [point y] . which does the same for the y variable for printing, and [point magnitude] which calculates the distance and returns that value.


Objective-C for Beginners


iOS fundamentals for mere mortals.


Whether you're new to object-oriented programming or just new to the Objective-C programming language, this course will get you up to speed fast. Learn the fundamentals of Objective-C while gaining an understanding of its relationship with the ANSI C language. You'll come away with the background you need to start learning the specifics of app development for the iOS and OS X platforms.


Smaller class size = better learning.


Learning a complex new technology in a large group setting can sometimes be an intimidating experience. Why risk missing out on important details? Our smaller class size will allow you to feel comfortable asking whatever questions you like. It'll also help ensure you get all the individual attention you need during lab exercises.


Please feel free to reserve one of the available Macintosh computers in our state-of-the art classroom, or bring your own MacBook Air or MacBook Pro if you prefer.


Updated for iOS 8


Duration


Objetivos


This fast-paced, two-day intensive will get you off to a quick start coding in Objective-C. There's plenty of lab time to allow you to learn by doing. And our exercises are designed to reinforce key concepts in a way that will help you gain proficiency fast. Between lecture sessions and hands-on labs you'll get a first-hand introduction to fundamentals of the ANSI C programming language, and object-oriented programming with Objective-C classes, objects, methods, instance variables, messages, and more.


You'll also get a peek under the hood to gain insight into how Objective-C actually works under the covers. That'll come in handy in many situations: whether you're trying to learn to use a new feature, find a tricky bug, or design a new component. You'll also learn tips and techniques for taking advantage of numerous powerful, built-in features of the Objective-C language and the iOS SDK's libraries and frameworks.


Learn the fundamentals of ANSI C programming and the standard C libraries


Get a solid understanding of C functions and data structures


Learn to create and use Objective-C objects, classes, and methods.


Become familiar with the basic concepts of object-oriented programming


Understand dynamic binding, messaging, and the Objective-C runtime


Become familiar with Foundation framework classes and APIs


This course will prepare you to take our popular, five-day iOS Development for Beginners.


Audience


Take this course if you're:


Familiar with C programming, or have recently taken ANSI C Programming or the equivalent.


Interested in learning Objective-C and the Foundation Framework to develop code for the iPhone or Mac OS X desktop apps.


For further insight into which courses would suit you best, please take a look at our guide on iPhone development classes.


contorno


ANSI C: Gain hands-on familiarity with the fundamentals of the ANSI C programming language and the standard C libraries.


Xcode: Use Xcode to edit, build, and debug your Objective-C applications, and to manage project resources.


Objective-C Fundamentals: Learn how to define classes and methods, allocate and deallocate instances, and send messages to objects at runtime.


Foundation Library: Learn to use essential C functions and Objective-C utility classes for working with numbers, dates, arrays, dictionaries, files and directories, and much more.


Objective-C 2.0: Learn to use 2.0 features such as garbage collection, dynamic properties, and fast enumeration.


Memory Management: Learn to use Automatic Reference Counting (ARC) and autorelease pools to manage your app's memory, and discover how to avoid common memory management pitfalls.


Advanced Features: Learn to use protocols, categories, key-value coding, invocation forwarding and other advanced features of Objective-C.


The Objective-C Runtime System: Get an in-depth understanding of the runtime system and how it supports dynamic typing, dynamic binding, messaging, and message forwarding.


Archives and Serialization: Learn how to serialize and deserialize objects to and from XML and binary formats.


Working with the Debugger: Learn to use the LLDB debugger (lldb) interactively to help track down and and fix bugs.


Instructors


Learn from seasoned developers and teachers.


Jonathan Lehr. Jonathan has over 20 years of experience developing apps in Swift, Objective-C, and Java—including iOS apps for Cisco. the NIH and other About Objects customers—and has personally trained hundreds of iOS developers.


Rich Warren. Rich is an experienced iOS developer, speaker, and author. His writings include Creating iOS 5 Apps: Develop and Design (2011, Peachpit Press), and Objective-C Boot Camp: Foundations and Patterns for iOS Development (2011, Peachpit Press).


Need a machine? Reserve a 13” MacBook Pro or MacBook Air Today!


If you’re unable to bring your own MacBook Air or MacBook Pro to class, we have a limited inventory of loaner machines. Please call ahead (main: 571-346-7544) to check on availability.


Campo de golf


For additional information on iOS programming, please visit Apple's iOS Dev Center: http://developer. apple. com/ios/


Also, please feel free to download our free iOS development tutorials. These are Xcode projects that will take you step-by-step through detailed examples that cover the basics, including working with UIView and UIViewController; Core Animation and custom drawing; working with subclasses of UIControl such as UITextField and UIButton; working with UITableView and UITableViewController, including making a UITableView editable, and creating editable instances of UITableViewCell; and managing navigation with UINavigationController.


Onsite Training


If your goal is to become an iOS developer then learning C will likely only help you in regards to understanding the constructs of objective C that are either inherited or inspired by C. Since it seems you already know the basics of programming with your experience in Python, your best bet is to focus your time in the iOS fundamentials, UIKit (also Core Graphics and Core Animation), MVC (or more advanced MVVM), Networking. Read through the HIG and adopt the naming conventions that Apple recommends, and you'll end up writing relatively clean maintainable code.


There may be some merits in learning C as you can easily mix in C within your iOS projects, however it can be confusing to do so.


Related Questions


Objective-C (programming language).


How does the Mac OS Dropbox application function?


C, C++, C# and Objective C


Back in 1969, the programming language C was created at Bell Labs by a computer scientist named Dennis Ritchie. Ritchie based C off of an earlier language called B. C spread to wide use quickly and is arguably the most popular programming language ever made; one big reason is that programs written in C can run on all sorts of different operating systems (Macs vs. Windows, for example) with only small tweaks.


These days, C is used when you need something that runs quickly without using much memory. This usually means behind-the-scenes code, like the code that lets your keyboard or monitor talk to the rest of your computer (a. k.a. device drivers). Since it’s so common, though, you’re going to be finding C all over the place!


C++ was a programming language developed in 1979 by a Danish programmer with the amazing name Bjarne Stroustrup. It was originally called “C with Classes,” and was renamed C++ in 1983. ++ is shorthand for adding 1 to a number in programming, so C++ roughly means “one better than C.” We might just plain call that D, but because it was so closely related to C he went with C++ instead.


C++ added a ton of new features to C, designed to make programming more efficient and give the developer more options on how they’d like to code. The biggest addition is something called object oriented programming . The basic idea of object oriented programming is that all of your code is arranged in little bundles of data and actions, instead of a spread-out jumble.


For example, if I’m writing a program about a bike and a person, I’d have an object called bike and an object called person, and write things like bike->color . bike->brand . and person->name to get information about them. Why’s this important? Just like you might keep all of your bills in one drawer and your love letters in another drawer, a lot of programmers find this sort of organization helpful. We’ll write a whole email on object oriented programming soon, we promise!


Thanks to object oriented programming and other additions, it’s easier to write complex programs in C++ than plain C. This makes C++ popular for complex software packages – most of Windows is written in C++. With all of the additions, though, C++ has a little more overhead in terms of things like memory usage and file size. C++ is the third most popular programming language, behind C and Java.


Objective C was created by two guys, Brad Cox and Tom Love, at their company Stepstone in 1983, but has recently become very popular as the driving force behind OS X and iPhone apps. It’s a “superset” of the C language – it can do everything C can, but also has a few extra features. These features were pulled from a language called Smalltalk. and like C++, were mainly focused on making the language more object-oriented.


C# came out of Microsoft in 2001, intended as a new object-oriented language. It isn’t actually based on C – it was intended to be “C-like,” but the two languages didn’t end up having much in common. C# was originally code-named “Cool,” but Microsoft was on a roll with adding # to letters (A#, F#) so they went ahead and named it C#.


C#, like C++, can be used for pretty much anything. Since it was produced by Microsoft it ends up powering a lot of Windows programs also, but it’s also an option for doing web development on a Windows-based web server.


All in all, C spawned a lot of new languages. You can imagine C++ and Objective C as C’s sophisticated offspring, while C# is the neighbor kid who’s always hanging around the house.


Cocktail Party Fact


We can cover most of the alphabet with programming languages: A, B, D, E, F, G, J, K, L, M, Q, R, S, and T are your basics, and then you can throw in P#, J#, F#.NET, X++, C–, A++ and a plenty more!


¡Felicitaciones!


Stop the funeral! Objective-C is alive and kicking


Objective-C may no longer be the stylish language choice for Apple iOS and Mac OS development -- that mantle is being assumed by Swift, introduced in mid-2017. But proponents of Objective-C don't expect it to go away quietly anytime soon.


In fact, they believe it will be around for many years due to its familiarity and stability. "Apple is going to be supporting Objective-C for another decade," says Aaron Hillegass, CEO and founder of Big Nerd Ranch, which provides mobile app development and training, including in Apple-based technologies such as iOS. "I think you'll be able to write new iOS and Mac apps using Objective-C for at least a decade."


Naysayers have not been optimistic about Objective-C. An InfoWorld article in May, in fact, cited 10 reasons for moving to Objective-C. including that it's easier to read and maintain, as well as safer, faster, and requiring less coding. Swift is positioned by Apple as offering concise yet expressive syntax as well as being interactive and enabling development of fast apps. Other Apple documentation. however, still cites Objective-C as "the primary language" for writing iOS and Mac OS software.


Plenty of investments in Objective-C


Apple app builders still stand in Objective-C's corner. "There is too large of an investment by Apple in existing Objective-C code for there to be any cutoff of Objective-C support anytime in the medium term -- four to seven years -- and quite possibly for the long term -- 10-plus years," consultant Christopher Allen says. "However, you may see at some point in the future APIs will be available as Swift-only APIs, but even this is not likely for years. If that happens, it will be the real harbinger that the end of Objective-C is on its way. Otherwise, a eulogy is premature."


Even Hillegass's recent presentation, entitled "A Eulogy for Objective-C ," turns out to have a twist, proclaiming, "Objective-C is not really dead." Hillegass says during his speech, given in June in San Francisco: "I have to admit that I really love Objective-C. Everyone's been talking about what a wonderful language Swift is and it's a nice little incremental improvement Objective-C. But it's not really a radical departure." Objective-C, he says, has allowed him to build class structures and do low-level programming without having to work too hard. Hillegass says he is a 20-year Objective-C veteran.


An Objective-C developer who wrote an essay, "Why Objective-C is Doomed ," last year, calling Swift transitional and not complementary, also sees life left for the language. "The question I think everyone really wants to know is how long will Apple support Objective-C," author Sam Ritchie now says. "This will be measured in years."


Ritchie says he sees the "volatility" of Swift as still an issue. Some developers will not adopt until they are confident the language will not change each release of the Xcode IDE. He also sees iOS 7 support as an issue. Swift runs on iOS 7, but "there's no dynamic library support, so third-party Swift libraries are more difficult to incorporate."


Swift was explicitly designed to operate with Objective-C, indicating Apple's expectation of a lengthy transition period, Ritchie adds. "At a guess, I'd expect deprecation to be at least four to five years away, although we may see new Swift-only frameworks from Apple sooner than that, pending stabilization of the Swift API."


Apps, frameworks still rely on Objective-C


An Objective-C instructor with Code School notes the many apps built with the language. "I think Objective-C is still going to have a great future," says Jon Friskics, an iOS developer. "I don't see it going away. There's just so many apps that are built [with Objective-C]." Friskics sees Objective-C going strong for at least the next three to five years.


Allen adds, "You still need to understand Objective-C to do complex Swift apps -- Mac and iOS APIs are still largely optimized for Objective-C. Eventually these APIs may become deprecated and replaced with Swift-centric ones. But that will take some time."


Swift, Allen says, "is still somewhat of a Frankenstein beast -- it is a next-generation language, but has to support the previous generation of APIs, so [it] has many constructs that are not as modern as the language. Maybe there will be a point where there's a Swift version X that sweeps out all the old stuff, but more likely there will someday be a new language that is a successor to Swift without the legacy."


Hillegass cites Apple framework dependence on Objective-C. "The frameworks that Apple has built everything on top of are all written in Objective-C." These frameworks include Cocoa, CocoaTouch, AppKit, UIKit, and others. Meanwhile, features such as generics from Swift are being added to Objective-C, he says.


Ritchie sees Swift as the choice for newcomers. "Swift is most popular among developers new to the platform who aren't already invested in Objective-C, although most developers I speak to are comfortable with -- or at the very least resigned to -- eventually moving to Swift," he says. "However, this seems to have less to do with the safety improvements and more either the syntax or acknowledgement that it's 'the future' and they don't want to get left behind."


Paul Krill is an editor at large at InfoWorld, whose coverage focuses on application development.


One issue is that there is a lot of example code in Objective-C. So if you need a solution and find some code, you will need to translate into Swift.


So far, we still don't have a refactor feature for Swift. Although it's not a deal breaker.


The benefits of Swift tend to outweigh these disadvantages.


The second challenge is the temptation to use Swift exactly like Objective-C with a different syntax.


In Objective-C everything is an object (a subclass of NSObject). You'd build your model with objects, and hierarchies, and add functionality to those objects with methods.


You can do this, and it works, but Swift is a very different language, and whatever the problem you are trying to express, there is probably a more Swiftian way of doing it.


I'd suggest the first thing to try is to replace small objects with Structs.


With Objective-C you refer to objects with pointers. And Swift preserves reference semantics for objects. But structs and enums are treated as value types. And that is very useful.


Swift is probably your best bet for general applications now. However, there are still going to be times when it's useful to have very fine-grained control over things, at which point a working knowledge of C and Objective-C will stand you in good stead.


It's also a LOT easier to visualize exactly what's happening in terms of CPU instructions and memory accesses when working in C or ObjC, so there's likely to be benefit in being able to drop down to that language so that you can tweak it for optimal performance if necessary.


For example, let's say you implement a red-black tree in Swift along with the rest of your app. After profiling, you see that there's a lot of time being spent in this thing, even after you've optimized it to the best of your ability. At this point, it may be worth re-implementing it in Objective-C: the interface exported to your Swift API will be identical (usually — if you're returning tuples, etc. then you can subclass it in Swift to re-add that functionality), and you'll be able to really tighten down the code to a level that probably wouldn't be as easy in Swift.


I think Greg Parker said it best when he said that Objective-C would now be a form of 'Object-Oriented Assembly' idioma. Not needed very often, but invaluable for those tight cases (Objective-C and Swift message-passing is implemented in raw assembly code).


19k Views • Upvoted by Bilal Bernardot. 3 yr old Linux tinkerer and user - creator of ResolutionX a…


Whoah! Confusing answers!


This is what everybody is saying, in order of preference:


Objective-C


Swift


do


I say: start with Swift!


It's way easier than Objective-C, really. Also, you have no experience with programming, so you still have to figure out whether you actually like programming!


Swift is a great way to do that, because it's easy, has a playground, and offers the quickest reward of all 3 languages.


You'll stay motivated with learning programming if you see that what you do has a positive effect. For C and Objective-C, it's gonna take a long time before you have made something tangible. With Swift, that happens a lot earlier, so you'll stay motivated.


Another thing: Swift grows with you. It has many cool features for intermediate and advanced level programmers.


I'm the author of a course that teaches you Swift programming for apps in 2 months. It takes you from zero to hero; from not having coding experience to being able to make your own apps. It's over here: LearnAppMaking. com


If you know how to make your own apps, you've truly mastered programming.


What's still the same (Pros of Obj-C):


- Frameworks are unchanged, devs who use Cocoa Touch libraries for interactions and that's still a solid way to deal with it Obj-C. Swift just gave a new way for it.


- The apps that are active and in-maintenance will preserve their Obj-C code, why will someone have an overhaul of the entire codebase to Swift, being a new language? That reduces changes or wider adoptions.


- Sense of waste of time invested on Obj-C, not every dev will actually like it. The skills developed will not be applied exactly the same way.


- Limited set of attributes in Swift.


- Already consolidated learning materials, learning sources and community support for issues. It's like catching a new monorail, instead of the old subway.


What's Really New (Pros of Swift and effectively Cons of Obj-C):


- Reduced, leaner, cleaner code much like the modern languages like Python. Definitely reduces the learning curve and hopefully we'll see more young devs picking up Swift at an unprecedented rate.


Certain examples - need not end statements with semicolon, No need of header files, type inference included, strong typing, operator overloading, full support for Unicode.


- Fixing troublesome behaviour of Obj-C (C family) by eliminating pointers, compile-time errors for zero valued assignments, no need of 'break' in switch blocks, controlling overflow of variables,


- Easier, automated debugging. A key element of the Swift system is its ability to be cleanly debugged and run within the development environment, using a read-eval-print loop (REPL), giving it interactive properties more in common with scripting systems like Python than traditional systems programming languages.


- Real-time output: REPL is further enhanced by Playgrounds that are interactive views running within the Xcode environment that respond to code or debugger changes on-the-fly. Timeline assistant for viewing output more interactively.


- Apple claims that Swift "is the first industrial-quality systems programming language that is as expressive and enjoyable as a scripting language."


- Automatic management of memory, clear definitions of code complexity in real-time.


- Certain other, modern refinements as told by Developers:


Closures unified with function pointers Tuples and multiple return values Generics Fast and concise iteration over a range or collection Structs that support methods, extensions, protocols. Functional programming patterns, e. g. map and filter.


- Fun Fact: You can now use emojis in your code. PAG


- Strong response and community build-up: Already seeing 600+ repositories on GitHub. View here - Build software better, together.


There are tonnes of improvisations available that I can keeping talking about whole day, but that doesn't really makes a difference.


The difference will however appear when new apps on iOS 8 and OSX 10.10 appear to be better in every technical aspect later in fall.


Early coders who started off with Python, C/C++ will surely go for Swift as the way to Apple dev works.


Long time devs for other platforms like Windows, Windows Phone, Android and Chrome will also like to taste this so-called 'C on steroids' i. e. Swift.


Every coder wishes for a simpler language that saves his time and is easier to share, learn iteratively and further taught to the developer teams.


Conclusion: So will you go for Swift being an expert Obj-C coder? Totally your choice buddy! Apple gave you the power, now your turn to choose weapons wisely.


My advice - "Sometimes, in order to see the light, you have to risk the dark."


iOS Development with Objective-C


iOS Developers write software applications (apps) using a programming language called Objective-C and a development environment called Xcode. In this track, we'll get off to a running start by building a simple crystal ball iPhone app that can predict the future! Then, we'll switch gears and get a more formal introduction to programming and iOS development. Finally, we'll finish things up by building a more intermediate iPhone app that reads external data sources. Please note: iOS apps can only be built on a Mac computer, and not a PC.


Objective-C Basics


This course will focus on the language and syntax of Objective-C as well as some basic programming concepts. We will cover basic data types, such as NSString, float, int and bool as well as learn about conditional statements and operators. Building slowly, we will lay the groundwork for the following course, Object Oriented Objective-C, where topics include: classes, objects, properties, methods, arrays and dictionaries. Together, these two course comprise a broad foundation in Objective-C.


Registrarse


In my Xcode LLDB Tutorial. I mention using the debugger to interrogate data collections. Well, I wanted to elaborate on that idea a little because there are some techniques you can use for querying objective-c data collections that are very powerful.


If you develop apps for clients, you my be one of the lucky ones–the ones who actually get to model your data and use Core Data to store and access it. But I’m betting there are many of you who aren’t the lucky ones–or at least not on all of your projects. From time to time you have to deal with data in whatever format your client gives it to you. Maybe you’ve even suggested taking the CSVs or Plists (or whatever other formats clients have come up with to ruin your life) and actually loading those into Core Data. But they don’t get Core Data and they shoot down the idea. Well, you may want to just walk away from the gig. However, if you’re like me, you’ve got bills to pay and clients (the good ones at least) tend to help you accomplish that. Well, fortunately for us, Objective-C makes dealing with this kind of data manageable using a little technique known as KVC, Key-Value-Coding, with array filtering and sorting.


This is not an advanced topic, so if you’re already familiar with how KVC and array filtering and sorting works, this post may not help you as much. But for those of you who are fairly new to iOS development, you need to know about this magical feature of the language as all the senior iOS developers use it and you should too.


Querying Objective-C Data Collections Is As Easy As a Where Clause


I’m going to assume that you have some experience with relational databases. In a regular SQL query, when you want to filter a list of records based on some criteria, you use a where clause to ensure that you only get back the records you want from the database. Say, for example you wanted to query a list of hospitals by county. Your query might look something like this:


SELECT * FROM hospitals WHERE county = 'CLARKE'


The record set you get back after this query should only be the hospitals found in Clarke county.


Let’s consider an array of dictionary objects–each one of which has a set of keys and values representing each of fields in a hospital record. You’ve loaded this data into an NSArray from a property list that’s been embedded in your app. Say each hospital record in the array is declared as a dictionary and looks something like this when printed out in the debugger:


The array, hospitalNamesInClarke now contains a list of strings for all of the hospitals in Clarke county Alabama.


Delving Deeper


Just for discussion sake, let’s think about what programmers often do when they first learn object-oriented programming. They often build complex object hierarchies to model all of the data they have to work with. Don’t get me wrong, when using Core Data, I take advantage of mogenerator to generate my managed objects so that I can add some smart methods to my model objects for convenience and clarity. However, when I get a data stream back from, for example, a JSON payload, it doesn’t make sense to create a separate model class to hold my data until I can parse them into Core Data. It makes much more sense to leave them as dictionaries and just query them directly using key value coding. Consider a single record stored in memory as a dictionary. It might look something like this:


If you were to take this dictionary and rotate it clockwise, making the keys actually a header–something like this:


Then consider a bunch of records in rows like this:


It’s starting to look familiar isn’t it? The database table analogy makes a lot more sense when you look at it this way. An array of dictionaries can be thought of as an array of records you can run queries on.


Sorting, Filtering, and Aggregating


Sí. It’s all possible. We’ve already talked about filtering. Remember this code from earlier:


Notice Clarke only displays once now. The @distinctUnionOfObjects operator has returned only unique values. This is what we were looking for.


Conclusión


So, while we’ve been using debugger commands in the examples here, you can instead use the commands in your code. Just remove the ‘po’ and set a variable with the result of the valueForKeypath: calls in your code and you can manipulate the results in any way you like. Querying your collections is a very powerful coding technique you should master. It often provides a great way to reduce the amount of code you need to use to get the values you want. That being said, there are times when these types of data collection queries are just too expensive. If that’s the case, you’ll have to optimize. Just like everything else in programming, there are tradeoffs. These techniques won’t work in all situations, but they often will and are worth exploring to solve the problem of obtaining just the values you need. Hasta la próxima vez.


&dupdo; 2017, Cocoa Is My Girlfriend


Objective-C eBooks


Objective-C Memory Management Essentials will familiarize you with the basic principles of Objective-C memory management, to create robust and effective iOS applications. You will begin with a basic understanding of memory management, and why memory leaks occur in an application, moving on to autorelease pools and object creation/storage to get an idea of how memory is allocated. You will also see what ARC (Automatic Reference Counting) is and how it helps in memory management. Finally, you will cover examples on how to use the various tools provided by Xcode to help in memory management. You will also get a basic understanding of Swift, the recently introduced programming language to write interactive and lightning-fast applications. By the end of this book, you will have all the necessary knowledge on how to effectively memory-manage your application with best practices.


More iPhone Development with Objective-C is an independent companion to Beginning iPhone Development with Objective-C. That is, it is a perfect second book, but it is also a great book for those looking to improve their skills who have already programmed for iOS. In particular it includes a series of chapters devoted to Core Data, the standard for Apple persistence. The authors carefully step through each Core Data concept and show techniques and tips specifically for writing larger apps—offering a breadth of coverage you won't find anywhere else. More iPhone Development with Objective-C covers a variety of other topics, including Multipeer Connectivity's relatively simple Bluetooth/WiFi peer-to-peer model, MapKit, and media library access and playback so that your applications can utilize media on your users' computer. You'll also find coverage of Interface Builder, Live Previews and Custom Controls and some advanced techniques for debugging your applications. The book is filled with useful topics that will bring your programs up-to-date with the new functionality built into iOS.


The introduction of the Apple Store has empowered thousands, even millions of people to embrace software development. Using Objective-C and the Xcode IDE, you can produce awesome games and launch them on the Apple Store allowing you to make and sell games quickly and easily. From learning the basics of Objective-C to deploying to the App Store, you'll use this book to learn about game development in a matter-of-fact, helpful manner. Whether you're new to game development, or just want to learn how to leverage Apple's own tools to expand your skill set, you'll quickly move from a beginner to an expert.


Get up to speed on Cocoa and Objective-C and start developing applications on the iOS and OS X platforms. If you don't have experience with Apple's developer tools, no problem! From object-oriented programming to storing app data in iCloud, the fourth edition of this book covers everything you need to build apps for the iPhone, iPad, and Mac. You'll learn how to work with the Xcode IDE, Objective-C's Foundation library, and other developer tools such as Event Kit framework and Core Animation. Along the way, you'll build example projects, including a simple Objective-C application, a custom view, a simple video player application, and an app that displays calendar events for the user.


Programming in Objective-C is a concise, carefully written tutorial on the basics of Objective-C and object-oriented programming for Apple's iOS and OS X platforms. The book makes no assumptions about prior experience with object-oriented programming languages or with the C language (which Objective-C is based upon). Because of this, both beginners and experienced programmers alike can use this book to quickly and effectively learn the fundamentals of Objective-C. Readers can also learn the concepts of object-oriented programming without having to first learn all of the intricacies of the underlying C programming language. This unique approach to learning, combined with many small program examples and exercises at the end of each chapter, makes Programming in Objective-C ideally suited for either classroom use or self-study.


The Objective-C Quick Syntax Reference is a condensed code and syntax reference to the popular Objective-C programming language, which is the core language behind the APIs found in the Apple iOS and Mac OS SDKs. It presents the essential Objective-C syntax in a well-organized format that can be used as a handy reference. You won't find any technical jargon, bloated samples, drawn out history lessons, or witty stories in this book. What you will find is a language reference that is concise, to the point and highly accessible. The book is packed with useful information and is a must-have for any Objective-C programmer.


Let's say you have a killer app idea for iPhone and iPad. Where do you begin? Head First iPhone and iPad Development will help you get your first application up and running in no time. You'll not only learn how to design for Apple's devices, you'll also master the iPhone SDK tools - including Xcode and Objective-C programming principles to make your app stand out. Whether you're a seasoned Mac developer who wants to jump into the App store, or someone with strong object-oriented programming skills but no Mac experience, this book is a complete learning experience for creating eye-catching, top-selling iPhone and iPad applications.


Objective-C Programmer's Reference provides the tools necessary to write software in Objective-C—the language of choice for developing iOS and OS X applications. Author Carlos Oliveira begins from the basic building blocks of the language. He shows how to create correct and efficient applications by applying your knowledge of object-oriented and structured programming. Objective-C Programmer's Reference makes extensive use of concepts already mastered by developers who are fluent in other languages such as C++, Java, Perl, and Python. The author's approach is logical and structured, and even novice developers will have an easy time absorbing the most important topics necessary to program in Objective-C.


If you're getting started with iOS development, or want a firmer grasp of the basics, this practical guide provides a clear view of its fundamental building blocks — Objective-C Xcode, and Cocoa Touch. You'll learn object-oriented concepts, understand how to use Apple's development tools, and discover how Cocoa provides the underlying functionality iOS apps need to have. Dozens of example projects are available at GitHub. Once you master the fundamentals, you'll be ready to tackle the details of iOS app development with author Matt Neuburg's companion guide.


The Objective-C programming language continues to grow in popularity and usage because of the power and ease-of-use of the language itself, along with the numerous features that continue to be added to the platform. If you have a basic knowledge of the language and want to further your expertise, Pro Objective-C is the book for you. Pro Objective-C provides an in-depth, comprehensive guide to the language, its runtime, and key API's. It explains the key concepts of Objective-C in a clear, easy to understand manner, and also provides detailed coverage of its more complex features. In addition, the book includes numerous practical examples--code excerpts and complete applications--that demonstrate how to apply in code what you're learning.


Get up to speed on Cocoa and Objective-C and start developing applications on the iOS and OS X platforms. If you don't have experience with Apple's developer tools, no problem! From object-oriented programming to storing app data in iCloud, this book covers everything you need to build apps for the iPhone, iPad, and Mac. You'll learn how to work with the Xcode IDE, Objective-C's Foundation library, and other developer tools such as Event Kit framework and Core Animation. Along the way, you'll build example projects, including a simple Objective-C application, a custom view, a simple video player application, and an app that displays calendar events for the user.


Reproduction of site books is authorized only for informative purposes and strictly for personal, private use. Only Direct Download


Learning Objective C: Moving From PHP


I’m in the process of learning Objective-C in order to get more in to Mac and iOS development. I have a dream to one day create a Monkey Island-style graphic adventure (I recently found these excellent notes of a talk given by William Turner who worked as a Senior Artist on the Curse of Monkey Island that are worth a read if you’re interested in the design side of things as well).


Before I get to my Magnum Opus, I’m starting small with a few basic (but hopefully useful) apps to get my feet wet.


Recursos


I’ve been following the Stanford University Developing Apps on iOS course led by Paul Hegarty which is an excellent and detailed introduction.


I think it’s absolutely incredible that one of the world’s top University’s is making all of their lectures, course notes and assignments available on iTunes for free and I feel like this is a giant step towards realising the true potential of the internet.


You can grab the entire course here (apparently, it has been downloaded over 1 million times already).


Requisitos previos


If you haven’t done any Object-Orientated programming before, it’s probably going to be a little too advanced as it assumes some experience up front. You might want to investigate PHP: Objects, Patterns and Practice by Matt Zandstra first.


Objective-C is based around the MVC (Model, View, Controller) paradigm and I figured it would be easier to get my head around the concepts using a language that I already understood.


I don’t really think WordPress is the best place for this so I investigated a few pure MVC frameworks and eventually settled on Cake PHP (although there are other great frameworks out there such as the Zend Framework and CodeIgnitor).


If you’re coming from OOPHP, I would highly recommend spending a few days learning MVC concepts within PHP before switching. The basic structure of projects in XCode made a lot more sense once I understood the central ideas to this paradigm and it was one less thing to worry about moving over.


PHP Vs. Objective-C


I’m going to be documenting my progress here and I thought I’d start with a random list of my initial impressions on the differences between the two languages.


Objective-C is a compiled language vs. PHP which is a scripting language


Pretty much everything in Objective-C is an object


Strings are an object (not a primitive) in Objective C. Characters are still primitives, but not strings


Classes have to be declared in their own files


There needs to be a. h file, which is included wherever you need to use it, and is a header file where the interface is declared. Public instance variables and methods are declared here.


This is coupled with a. m file, which is the implementation file where you put the implementations of the methods declared in the header files.


Objective-C is a strictly typed language (that means declaring the *type* of variable before the variable name, for example: `$var = 21;` (PHP) vs `(int) var = 20;` (Objective-C).


Declaring functions is a whole new ballgame. Forget `public myFunction(arg1, arg2)` you’re now looking at `-(void) myFunction:(int)arg1 TakesThis:(int)arg2;`


Things to notice about this: the minus sign at the start means it’s an instance method (a plus means it’s a class method, like static methods in PHP)


You have to declare what primitive type or object the function returns. `(void)` indicates that this method returns nothing.


You have to declare what types the arguments should be (either primitives or objects).


Accessing methods is likewise very different. `$var = myObject->get_result();` becomes `NSObject *var = [myObject getResult];`


You’ll notice the asterisk in the last example. That’s not part of the variable name—it represents a pointer to a portion of memory where the object is stored.


Speaking of memory, it used to be that you had to manage memory yourself. Thanks to Automatic Reference Counting (ARC), the language takes care of that for you.


Generally, strings and arrays are immutable (meaning they can’t be changed once they’ve been created). There are mutable strings and arrays, but these are used a lot less often. If you’re used to working dynamically with arrays, this is a big difference.


There’s no foreach (but there is fast enumeration, which in a lot of ways does the same thing).


Next, I’ll be looking at getting and installing XCode, exploring the documentation and creating an initial Hello, World iOS app.


Posted by Simon Fairbairn Feb 21 st. 2012


Mensajes recientes


últimos tweets


Free Email Updates


From C# to Objective-C with Somya Jain


Posted by Somya Jain on Apr 24, 2012


We failed to create the bookmark. If the behaviour persists please contact us.


NOTE: QCon San Francisco - the 10th international software development conference - Nov 7-11, 2017. 100+ expert practitioner speakers, +1,100 attendees, 15 tracks to cover topics driving the evolution of software development today. Get more details or register now.


A couple years ago tablet computers were seen mostly as a novelty or consumer toy. But recently a major shift has been occurring in the business world. Many consulting companies that traditionally write line-of-business applications in XAML, Flex, or HTML have suddenly found themselves with an overwhelming demand for iPad applications. Not just toys either, there are a lot of projects gearing up with price tags in the hundreds of thousands or even millions of dollars. While. NET and Java will still be viable back-end platforms for years to come, there are a lot of opportunities for teams that are willing to cross-train.


We spoke with one such developer, Somya Jain. about moving from C# to Objective-C.


Somya Jain: First thing that I learnt (and I learnt it the hard way) was mobile development is significantly different from server side or desktop development. Mobile devices have less RAM, a slower network, smaller screen and a slower CPU! Yet there is an expectation for a great user experience. People can easily compare your app to another in the app store. It’s much harder to do that with your run of the mill business app.


I learnt Objective-C to build apps for iPhone and iPad. Coming from C++/Java/C# background, the learning curve was actually not too bad. Most of the concepts translate quite easily. Initially, I tried to learn by following the textbook approach and reading documentation. But, I found I learnt a lot faster when I actually took the plunge and started to work on a project.


The following are the key concepts to understand in Objective-C. While there are some similarities with C#, there are also subtle differences.


The first thing to tackle is memory management. Understanding alloc . release and autorelease are critical for iOS development. With the introduction of ARC this may be becoming less important. But there areas where ARC can trip you up and it helps to understand the underlying principles.


Memory management issues such as, over releasing memory, resulting in the dreaded BAD_ACCESS crash, and not releasing memory, causing memory leaks, can be hard to figure out. Yet they have a significant impact on the performance and usability of your app. Learning to quickly identify and fix these problems is critical. I recommend learning how to use NSZombies and instruments to debug these issues.


As an aside, Objective-C does support Garbage collection, however this is limited to mac osx and is not supported in iOS.


InfoQ: Adding and releasing objects sounds a lot like COM reference counting, but what is "autorelease"?


Somya: Essentially, you use autorelease when you're returning an object that will not be managed by the object that created it. By calling autorelease, the object is added to an auto release pool and is released when the pool drains. The receiving object is then responsible for retaining it if it wants to use it for anything. Here is more info from the apple docs:


The Application Kit creates an auto release pool on the main thread at the beginning of every cycle of the event loop, and drains it at the end, thereby releasing any auto released objects generated while processing an event.


InfoQ: What is NSZombies?


Somya: NSZombies can be used to detect the memory over release issue I mentioned earlier. A common scenario is an unbalanced release on an auto-released object. What happens is that, during the final release, everything works fine and the object is de-allocated, but when the auto-release pool drains (some time later), the app crashes in an attempt to auto-release a de-allocated object. The object itself is no longer around, so it's hard to figure out exactly where the problem is. This is where NSZombie objects come in, setting the NSZombieEnabled flag turns any released object into an NSZombie instead of de-allocating it. You can now set a breakpoint whenever release or autorelease is called on NSZombie objects, allowing you to spot the offending code path.


InfoQ: Can you explain what ARC is and why you think it will make memory management easier?


Somya: Essentially, with ARC enabled, the compiler automatically generates retain and release call for you. This should mean that you don't have to worry about memory management. But experience tells me otherwise. I haven't used ARC yet, so It's had for me to comment on it too much.


Method calls vs Messages.


Another subtle difference between the two languages is that, in C#, method calls are static and are bound at compile time (ignoring dynamic compilation for now). However for Objective-C messages are dynamically bound to objects at runtime time, not compile time. This means that you can send any declared message to any object and the compiler will not complain. Errors will show up only at runtime.


Interestingly, there is a mechanism to intercept messages even if the class doesn't implement them, this is generally used in advanced scenarios such as multiple inheritance, journaling, and dispatching messages to dynamically loaded code .


Thread Pool vs Grand Central Dispatch


At a high level the idea is the same, a system managed pool of threads. However, this is one area where I feel iOS really shines. Firstly, iOS supports different priority levels even with thread pools giving you finer grained control. For example you can do image loading and manipulation in higher priority thread so that a background download doesn't slow down your UI.


Another great feature is Dispatch groups that allow several tasks to be submitted and be notified only when all of them are complete.


The following items map almost one to one between C# and Objective-C


Extension Methods (C#) <==> Categories (iOS)


Interface (C#) <==> Protocol (iOS)


Delegates (C#) <==> Blocks (iOS)


Some things I miss about C#


Generics


LINQ


Having all my code in 1 file, and not having to create header files.


Some other tips for C# developers:


Check out AppCode (Objective-C) from the guys that brought you Resharper (C#)


Also MonoTouch from Xamarin brings C# for iOS devices.


InfoQ: What IDE do you prefer for iOS development?


Somya: Definitely AppCode, it brings the code completion and refactoring support that I am already familiar with, having used ReSharper. I also like that it highlights potential memory-management issues for you, it’s great for when you’re just getting started with iOS. At the end of the day it makes me more productive, so it's a no brainer.


InfoQ: You say you miss generics. Does Objective-C offer anything you can use instead or must you use untyped collections like we had in. NET 1.0?


Somya: Yes you use un-typed collection like in 1.0. But due to dynamic message binding you don’t need to cast the object in order to send it a message.


InfoQ: Are there any Objective-C features that you wish C# would adopt?


Somya: At the language level, probably not. I haven't found myself thinking, wow this would be a great feature in C#. However, at the API level, I think apple have done a good job with iOS. Even though the APIs come across as somewhat restricted, they are well thought out. For example, In the NavigationController and UITabBarController, it's a simple flag to enable an animation when navigating between views. You have to do much more work for both android and WP7.


InfoQ: How does building the user interface in iOS compare to working with WinForms or Silverlight?


There are 2 main UI libraries from apple, UIKit and GLKit. GLKit it targeted more towards opengl based apps and games. UIKit is closer to WinForms/WPF. It has standard controls like text boxes, labels, drop downs etc. These UIViews (controls in. NET speak) can be easily extended and combined to make other views similar to creating custom controls and user controls in. NET. iOS however, only supports fixed co-ordinate based layout, so you need to specify the exact size and location of each view within it's parent. I feel like a lot of the other UI concepts are similar,


You still have a view hierarchy.


You still need to be careful when loading data in a background thread, It still needs to be marshaled onto the main thread.


You need to understand the view lifecycle etc.


What I miss most however is support for data binding.


About the Interviewee


After 11 years as an enterprise software developer/tech lead/architect, Somya Jain is now a freelance mobile developer (iOS, Android & Windows Phone), based in New York City. He focuses on multi-platform mobile apps .


Related Editorial


Discuss!


Learning Objective-C by Developing iPhone Games


Learning Objective-C by Developing iPhone Games


Book Description


The introduction of the Apple Store has empowered thousands, even millions of people to embrace software development. Using Objective-C and the Xcode IDE, you can produce awesome games and launch them on the Apple Store allowing you to make and sell games quickly and easily.


From learning the basics of Objective-C to deploying to the App Store, you'll use this book to learn about game development in a matter-of-fact, helpful manner. Whether you're new to game development, or just want to learn how to leverage Apple's own tools to expand your skill set, you'll quickly move from a beginner to an expert.


The book kicks off with the basics of game development, and you will take your first steps with using Xcode, the official Apple programming IDE, before moving on to the most important concepts involved in programming games using Objective-C. This book is a hands-on guide to developing the game of your dreams in no time for the Apple Store.


What You Will Learn


Understand the basics of Objective-C and develop code in the iOS language


Set up multiple screens in iOS and make easy transitions from one screen to another


Create a simple audio-based memory game using basic game logic


Display a background image for your game and program your aliens to drop bombs


Build a simple user interface using Xcode's interface builder


Program your graphics to move using buttons, gestures, and multitouch interactivity


Overcome common issues that developers run in to at one point or another


Explore the Apple Store and iTunes Connect's submission process and prepare your app for distribution


Autores


Joseph D. Walters


Joseph D. Walters has been immersed in the creativity, technology, and business of software and game development for over 20 years. He currently is a partner at Third Track Inc. a game development and game technology company. Before Third Track Inc. he was the CEO at MindFuse Games, where he helped raise capital from angel investors and led the development of a massive multiplayer-gaming world. Joseph was also a full partner and technical director at Skunk Studios, one of the leading full-service developers dedicated to bringing casual games to the mass market. Prior to founding Skunk Studios, he was a senior engineer at Shockwave. com, where he developed some of the most popular titles on Shockwave's website. Before starting at Shockwave. com, Joseph owned a top consulting firm that advised some of the largest technology firms in the world, including IBM, Compaq, AT&T, Bell Labs, and countless others.


Amy M. Booker


Amy M. Booker is new to writing. Along the way, she has become a happy gamer and has been raising her family to enjoy and appreciate the art of games, whether card, board, or video. As an advocate of special needs, specifically Autism, she hopes to write a book or design a game to support those with special needs. Amy lives in San Ramon, California, with her husband and their two boys.


Tabla de contenido


We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.


Aprendizaje


As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.


Beginner's Guide


Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.


Esenciales


Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.


Cookbook


A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.


planos


Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.


Mastering


Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.


Comenzando


Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.


Swift vs. Objective-C


Apple just announced that Swift version 1.0 has been released and you can now submit your Swift apps to the App Store. You might be asking yourself which language you should use if you're starting a new iOS app.


IS SWIFT EASIER TO LEARN?


From a pure programming standpoint, you're almost guaranteed to be more productive using Swift. Of course, if you're an expert Objective-C developer, that might not be the case.


Swift is the obvious choice if you're new to iOS and looking to get up to speed quickly. The language will stay out of your way allowing you to focus on the things that matter: making your app work the way you want it to!


WILL I HAVE TO LEARN BOTH OBJECTIVE-C & SWIFT?


Just about every iOS app is built using libraries of code created by Apple in Objective-C. Many apps also use libraries created by other developers (which, to-date, have been written in Objective-C as well). Libraries are useful things you can use to save a lot of time and add functionality into your app easily.


Now you may be wondering.


"If all the existing libraries are written in Objective-C, won't I still have to continue using Objective-C?"


The answer is no, Swift can interact easily with Objective-C code whether it's a single file or an entire library. This means you'll be able to build your application in Swift while taking advantage of Objective-C libraries very much like you would before.


Keep in mind that Objective-C isn't going anywhere anytime soon, so if you're inheriting an Objective-C codebase, or looking to modify an existing Objective-C library, wading into the Objective-C waters is inevitable.


How do I do [x] with Swift?


With Objective-C being close to 35 years old, and it having been language used to build Mac OSX and iOS applications for years, there's a substantial community and body of knowledge out there constantly documenting best practices, approaches to common and not-so-common problems, pretty much anything you can think of about using Objective-C.


When learning Swift, something that may be an issue for a little while will be the comparatively slim set of resources out there. Stackoverflow, blogs, tutorial sites are quickly compiling info on all aspects of Swift development, but it'll take some time to reach the saturation point that Objective-C currently enjoys.


In the meantime, a few excellent resources are objc. io (despite the name, they're into Swift as well) and http://iosdevweekly. com/. The Swift documentation is also a great place to start.


So what's the answer - Objc or Swift?


Moving forward, Swift. The combination of a cleaner, perhaps more familiar syntax, a more modern language, and superb backwards compatibility makes Swift a great choice to use in your iOS apps, whether you're new to the platform or a long-time Objective-C guru.


Fundamental iOS design patterns: SharedInstance (Singleton in Objective C)


Brief introduction


Singleton is one of the (if not THE) most commonly used/abused design pattern adopted in software development. Basically it’s used to restrict the instantiation of a class to one object only that can be used safely across application architecture. Its implementation is pretty simple compared to other patterns and it’s very similar for the most of programming languages, but in Objective C it has a slightly different approach due to the lack of “normal constructor” that are instead replaced by alloc/init paradigm.


How it works in Objective C


In Objective C, we can speak more appropriately about the SharedInstance pattern rather than traditional Singleton. This one is often used in Apple frameworks and differently from its twin brother, it does not explicitly forbid the instantiation of multiple class instances, but it simply provide a class method that will return a shared instance. During the first call to that method the instance will be allocated and the next calls will return the previously object created. So this is a sort of hybrid approach. A common class that use this pattern is UIApplication which implements a sharedApplication method (which returns the current running application). Differently from Singleton which use getInstance() . in Objective C the corresponding method has not a fixed name but it should start with “ shared ” followed by the “type” of class (so for UIApplication is “ sharedApplication ” for MYAmazingManager will be “ sharedManager “). Anyway there are several exceptions, for example NSFileManager has a “ defaultManager ” acting as a sharedInstance accessor that could be renamed “ sharedManager “.


Pattern implementation


In my singleton implementations I simply call the accessor “ sharedInstance “, in this way I can use a simple pre-compiler macro that automatically synthesize this methods for me. Even implementation of this pattern may vary and personally I adopted one which is thread-safe and rely on CGD ( Grand Central Dispatch ). which is an affective C level API provided by Apple in order to handle concurrency.


The implementation of my sharedInstance method is the following (comments explain how it works):


Pattern in action!


SharedInstance pattern is IMO the best way to share data across multiple viewControllers in iOS applications. One practical example is a data manager to share Core Data stuff such managed object context. I realized my own manager so that I can access this objects anywhere with ease like:


Mensaje de navegación


Follow me on Twitter!


My stackoverflow profile:


My projects on github:


Categorías


Recent comments


Objective-C


405 pages on this wiki


Objective-C is a reflective object oriented programming language developed by Brad Cox as a hybrid between Smalltalk and C to combine the flexibility of Smalltalk with the execution speed of C. It was chosen by NeXT Inc. as the implementation language for the NeXTstep operating system and its API, which was later published as an open specification under the name OpenStep, After Apple Inc. acquired NeXT, Objective-C and the NextStep API became the base for Apple's current operating system Mac OS X. Today, Objective-C is the main application development language for Mac OS X.


As a hybrid of two languages with different programming paradigms, Objective-C is difficult to classify. Its core language is ANSI-C which makes it a statically typed, imperative low-level programming language. However, on top of the C core language, Objective-C defines a thin layer of Smalltalk derived object oriented features which also make it a reflective, dynamic, late binding, object oriented language. These may initially seem to be conflicting programming styles, but in practise there is a clear separation between the two. The C core language is used to code the control flow of a program and the Smalltalk derived extensions are used to define and work with abstract data types. As a result of this practise, an program written in Objective-C benefits from the expressive power and flexibility of Smalltalk and the execution speed of C.


Contents


Standards and Dialects Edit


There are at present three main dialects of Objective-C.


NeXT/Apple's Objective-C 1.0


Apple's Objective-C 2.0 (a superset of v.1.0)


David Stes' version


Apple's Objective-C variant is the most widely used.


Objective-C Compilers Edit


GCC front-end for Objective-C, part of the general GCC distribution


Sonido metálico. a new fast recursive descent compiler for C, Objective-C and C++ with an LLVM back-end, development sponsored by Apple


Portable Object Compiler by David Stes


Class libraries Edit


It is possible to build one's own class library in Objective-C, however, in practise, most Objective-C development is done using one of a set of available class libraries, which are called frameworks in Objective-C lingo. The most common frameworks follow the OpenStep API specification:


Core Foundation and Cocoa. Apple's proprietary implementation of the OpenStep API specification for Mac OS X


Cocoa Touch. Apple's proprietary implementation of the OpenStep API for the iPhone


Cocotron. an open source implementation of the OpenStep API specification for Microsoft Windows


GNUstep. the FSF's GPL licensed implementation of the OpenStep API specification for Unix and Unix like operating systems


libFoundation. a BSD licensed open source implementation of the Core Foundation layer


WebObjects. a framework for web application development


Further reading Edit


Objective C vs C++


Are you a game developer transitioning from Cocos2d iPhone to Cocos2d-X? From Objective C to C++?


C++ used to be my language. It was all I wrote computer games in for over 10 years. There's a certain level of power, control and efficiency in using C++.


When the iPhone came out, the Objective C language became a hot topic. I was so excited about the thought of writing games for iPhone that I forced myself, despite wariness at [[funny foreign] syntax]. to learn Objective C and begin writing a game. Boy was I surprised when I came to love Objective C's simple elegance and powerful Foundation classes.


Now, after nearly three years of making games in Objective C with Cocos2D-iPhone, I've discovered Cocos2D-X and unearthed a whole new love for C++.


C++ is a Manual Transmission Car


If Objective C is an automatic transmission car, then C++ is a manual.


One might argue that the automatic car is superior because it's easier. However, that one hasn't had the experience of clutching into neutral across a gravelly patch to avoid spinning the tires.


C++ has more speed and control, yet it requires a greater level of skill from the programmer.


For example, C++ saves execution time by not checking pointers before you dereference them. This increases the speed of your game and your level of control, yet it makes assert statements a debug-mode necessity.


Sending Messages to nil Objects


Here we have one of the most fundamental differences between ObjC and C++.


With Objective C, you can safely send messages to nil objects (though this comes at the cost of slightly slower program execution).


In C++, if you try to dereference a null pointer, you'll trigger a runtime error.


Behind the scenes, ObjC basically implements a nil object which essentially returns zero for any method call. This makes programming a little safer and easier. However, it also can allow bugs to go unnoticed.


C++ doesn't check a pointer before dereferencing it. As illustrated above, if the node is null. then C++ will execute the setPosition function given a null this pointer. When a member variable is accessed via the null pointer, your program crashes.


One solution is to use an assert which only gets compiled into non-distribution builds. If the expression being asserted evaluates to false, then the program aborts. If you've got a debugger attached, then it will pause on the assert line so you can see exactly where the code went wrong.


Since assert is typically defined as a macro, one of the pros to using it is that in distribution builds (or any build which defines NDEBUG ), the macro evaluates to nothing. Essentially, the compiler doesn't produce any binary code for it. This gives you the security of assertions in debug builds and the raw speed of no assertions in distribution builds.


Essentially this makes C++ a little more efficient and a bit easier to catch bugs at the cost of the programmer having to be a bit more pragmatic.


Readability


Here's another fundamental difference. Objective C is inherently more readable than C++ because method parameters are built into the name of the method. Consider:


You see the difference in readability?


Objective C is a bit easier to read because the 2nd parameter to the addChild method is clearly a z value. In C++, it's anyone's guess what "1" means.


Modern day Integrated Development Environments (IDEs) like Xcode mitigate the issue when you are writing code because of auto-completion. You start typing addChild and it gives you the parameter types and names. This makes it clear what the parameters are when you are writing the code. However, if you take some time off from the project and come back later, you might be a little perplexed when you glance at the addSprite call and wonder about that second parameter.


You can make C++ more readable by using well-named variables or constants like this:


Speed and Portability


We've already talked about how C++ is a faster than Objective C. But what about portability? This is where C++ shines.


C++ is simply more portable than Objective C. It can be natively compiled on many platforms like Windows, Mac, Linux, iOS, Android and even consoles.


When it comes to Android, it is technically possible to compile ObjC if you upgrade the default NDK's GCC compiler, but there's a catch or two. You need all those Foundation classes.


Remember NSObject. NSString and NSArray. Those are all implemented fully and awesomely on the Mac, but not Windows. All those have to be reimplemented in a cross-platform way.


Thankfully, there's projects like Cocotron which aim to do just that. However, when it comes down to areas that are Android-specific, like input and sound, you need a cross-platform library. Something that implements the platform specifics so you don't have to.


That's why C++ and Cocos2dx are so awesome. Cocos2dx handles the platform-specific stuff and does the bulk of it in portable C++.


Beyond speed, portability and readability, we get into more specific differences between the languages, like Objective C's Class and id types.


The Class and id Types


Objective C has a nifty thing called the Class type. It allows you to take the class of an object and store it in a variable.


C++ doesn't have the equivalent of a Class type. It does have runtime type information (RTTI) and can roughly convert a pointer into a string containing the object's class with typeid. However, since the results can vary per platform, the solution is not exact enough to be relied upon.


Objective C's Class type makes creating objects from strings quite nice. Considera lo siguiente:


This illustrates the elegance of ObjC's Class type and one possible workaround in C++.


You can also see in the above code we are using ObjC's id type. It is essentially a pointer to any object type. The rough equivalent in C++ is void*. however there are many reasons not to use either .


pereza


Let's say we have a parent class called Parent. a subclass of it called Child. and Parent has a method called goToSleep .


In C++, you have to redefine goToSleep in Child 's interface if you want to override. In Objective C, you can just be lazy and override it in the implementation.


The reason C++ forces a programmer to redefine functions that will be overridden is because it makes the job of the compiler easier. The compiler doesn't have to go checking up the class hierarchy for mystery methods.


Virtual


In the above example, we saw the use of the C++ virtual keyword. When virtual is used, it specifies to use the function in the lowest class of the hierarchy first (for example Child 's goToSleep as opposed to Parent 's goToSleep ).


In Objective C, all method calls are essentially virtual. This makes it a bit easier on the programmer, but it comes at a possible performance decrease .


Again, C++ comes through on the manual transmission car analogy. You can specify virtual -- or not -- as appropriate.


The Stack


In Objective C, you can only allocate objects from the heap.


In C++, you can allocate objects on the stack. Stack allocation is faster than heap allocation and also guarantees that the destructor will be called when the object goes out of scope, even if an exception has been thrown.


He aquí un ejemplo:


Operator Overloading


In C++ you can overload operators. For example, if you were programming a Vector object, you could overload the addition operator so that Vector objects could naturally be added together.


In Objective C, it's not possible to overload operators. You can workaround that by creating worded methods:


However, this makes Objective C a bit wordy when it comes to some things:


Privates


Objective C doesn't technically have private methods. However, the workaround using a blank category in the implementation is quite nice because the private method doesn't have to be declared in the public interface (and hence your code re-indexed or re-compiled because of a header file change):


In C++, there is the concept of public and private, however the privates have to be declared in the public interface.


If you really don't want to declare a private function in the public interface, you can work around by using static functions in the implementation (which is similar to the Objective C blank category strategy mentioned above).


Class Extensions


As we saw in the above example, Objective C can extend a class with a category.


Categories are pretty neat because a class can be extended anywhere, including the. h, the. m or some other place.


C++ doesn't technically have the ability to extend a class. However, it does have multiple inheritance .


Default Parameters


C++ has one final bit of coolness to discuss: default parameters. A parameter to a function can be given a default, so that supplying it when calling the function is optional.


Objective C doesn't have default parameters, but it can get by with a multiple method workaround:


Conclusion: Mixing C++ & ObjC


So that's about it for the primary differences between ObjC and C++.


Keep in mind that you can always use both. In fact, you can mix them together with Objective C++ .


You just rename your implementation file with the. mm extension. That tells your compiler to use Objective C++ and enables either Objective C, C++ or a mix of both to be used.


Objective C++ is a common thing. As you can see in the example above, it's required to respond to iOS & Mac app notifications and launch Cocos2d-X in the same method.


Got questions? Leave a comment below. You can also subscribe to be notified when we release new chapters.


Tabla de contenido


Once you've figured out the basics of Objective-C and Cocoa, you're ready to start writing some code. But the conventions of naming and formatting Objective-C code are not the same as traditional C, C++ or even Java programs.


Apple has laid out a set of guidelines as to how code should be written for maximum clarity and integration with the frameworks. In addition, there are some undocumented conventions that Cocoa developers often use.


In essence, the human factor present in Apple's products for the end user can be found in Objective-C and Cocoa themselves.


Part 1 . basics on naming classes, variables, accessors, general methods and abbreviations. Part 2. more detail on method names, global symbols, the id type, method parameters, etc


Putting Thought into Naming


In the earlier days of software development, the average program was made up of far less code. With smaller functions and fewer variables, it was understood that cp meant character pointer and fread() indicated a function that read data from a file. Since space on terminal screen was limited, short names made the most sense.


Newer programs, though, have many more variables and functions. In this environment, a short name becomes ambiguous, which lends itself to buggy code. Xcode and other editors will autocomplete long names for you.


NSPasteboard NSCell NSComboBox NSComboBoxCell NSMenuItem NSMenuItemCell


Cocoa strongly encourages expressive, clear, non-ambiguious names . Take a look at the classes listed in the table to the left. You have some idea of what they do just from their name.


Also notice how some are combinations of other class names. NSMenuItemCell suggests a cell which is used by a menu item.


Naming consistency isn't extra credit, it's an essential part of being a great Cocoa programmer . Remember, since you do far more reading of code than writing, invest the time to type an extra eight characters.


Class Names


NSString NSMutableArray NSDictionary


Whether they're a standard part of Cocoa or your own creation, class names are always capitalized .


Objective-C doesn't have namespaces, so prefix your class names with initials . This avoids "namespace collision," which is a situation where two pieces of code have the same name but do different things. Classes created by Cocoa Dev Central would probably be prefixed with " CDC ".


If you subclass a standard Cocoa class, it's good idea to combine your prefix with the superclass name, such as CDCTableView.


Most of the standard Cocoa classes begin with NS for historical reasons, as Cocoa is based on the NeXTSTEP development framework.


Variable Names


Variable names start with lower-case letters, but are internally capitalized wherever a new word appears:


NSString * streetAddress = @"1 Infinite Loop"; NSString * cityName = @"Cupertino"; NSString * countyName = @"Santa Clara";


As we discussed, Cocoa strongly favors clear, distinct variable names over terse ones. Ambiguity frequently results in bugs, so be explicit.


NSString * hostName ; NSNumber * ipAddress ; NSArray * accounts ;


NSString * HST_NM; // all caps and too terse NSNumber * theip; // a word or abbreviation? NSMutableArray * nsma; // completely ambiguous


The variable naming syntax rules from C and many other languages apply. Variables can't start with a number, no spaces, no special characters other than underscores.


Apple discourages using an underscore as a prefix for a private instance variable.


NSString * name // correct! NSString * _name // _incorrect_


In fact, the idea of a private prefix is largely unnecessary, as virtually all instance variables in Cocoa are protected anyway.


Variable Names: Indicating Type


In terms of real-world practice, a variable name usually does not indicate the type if it is something common like NSString, NSArray, NSNumber or BOOL .


NSString * accountName; NSMutableArray * mailboxes; NSArray * defaultHeaders; BOOL userInputWasUpdated;


OK, But Not Ideal


NSString * accountName String ; NSMutableArray * mailbox Array ; NSArray * defaultHeaders Array ; BOOL userInputWasUpdated BOOL ;


If a variable is not one of these types, the name should reflect it. Also, there are certain classes that you only need one instance of. In this case, just name the variable based on the class name. Font manager is a good example of this.


When to Indicate Type


NSImage * previewPane Image; // self-explanatory NSProgressIndicator * upload Indicator; // shows progress for uploads NSFontManager * fontManager ; // only one of these, basic name ok


In most cases, a plural (such as mailboxes) implies an NSArray or NSSet . There's no need to say "mutable" in the name.


If a plural is not an NSArray or NSSet, it might make sense to specify this:


NSDictionary * keyed AccountNames; NSDictionary * message Dictionary ; NSIndexSet * selectedMailboxes IndexSet ;


Admittedly, this is a bit of a grey area.


Method Names


Methods are perhaps the most important topic we can talk about. Most object-oriented languages use a syntax like:


Example from Another Language


object. begin(resource); object. processData(resource, data, true); object. end(true);


While these methods names are easy to write the first time, the actual behavior is not clear. This is much more of a problem amidst massive amounts of surrounding code.


Cocoa programmers think from the end, choosing a method name based on how it will look in actual use . Let's say I want to write an in-memory file object written to disk. In some languages, that would look like this:


In Cocoa/Objective-C, it looks like this:


When creating a method, ask yourself if its behavior will be clear from its name alone, particularly when surrounded by tens of thousands of lines of code.


Programmers do much more reading of code than writing, so Objective-C and Cocoa are designed to read well . Reading a message as a phrase is a good way to test your method name:


// "open the file with this application and deactivate" [finder openFile . mailing withApplication . @"MailDrop" andDeactivate . YES];


This message is sent to NSWorkspace (aka Finder), and it clearly passes the "phrase" prueba.


Method Names: Accessors


In constrast to many other languages, Objective-C discourages use of the "get" prefix on simple accessors . Instance variables and methods can have the same name, so use this to your advantage:


- (NSString *) name ; - (NSString *) color ; name = [object name ]; color = [object color ];


- (NSString *) getName; - (NSColor *) getColor; name = [object getName]; color = [object getColor];


The "get" prefix is, however, used in situations when you're returning a value indirectly via a memory address:


When to Use "Get" Prefix


// copy objects from the NSArray to the buffer id *buffer = (id *) malloc(sizeof(id) * [array count]); [array get Objects: buffer];


( Don't worry if you don't know what malloc does. )


The "set" prefix is always used on setters, though:


[object set Name: name]; [object set Color: color];


adjetivos


Not all accessors return values like name, date, height, etc. Some represent a particularly quality of an object. These are often represented by BOOLs.


For example, "selectable". In Objective-C, the getter for this key is called - isSelectable . but the setter is - setSelectable:


BOOL selectable = [textView isSelectable ]; BOOL editable = [textView isEditable ]; [textView setSelectable . YES]; // no "is" [textView setEditable . YES]; // no "is" // if textview is editable. if ([textView isEditable ]) [textView setEditable . NO];


Keep in mind that naming your accessors according to all of these rules isn't purely an issue of clarity and aesthetics. Cocoa relies heavily on key-value coding for much of its magic, and KVC relies on properly-named accessors.


Abreviaturas


You've probably noticed that the general principle here is to spell things out to avoid confusion. However, there are times where acronyms are so well-known that spelling them out either doesn't help or can actually create confusion.


Here is an excerpt of the complete list of acceptable abbreviations:


int max min TIFF HTTP URL HTML PDF rect temp info JPG FTP RTF XML ASCII


Preprocessor Contants / Macros


Just like in ANSI C, preprocessor definitions should be in all caps


#define MAX_ENTRIES 20 #ifdef ENABLE_BINDINGS_SUPPORT


Wrap Up


Now that you've got the basics down, take a look at Part II. which goes into more detail on method naming, global functions and symbols, dynamic typing with id, naming method parameters and more.


As always, let us know what you think about the tutorial.


Further Reading


Swift vs. Objective-C: 10 reasons the future favors Swift


Programming languages don’t die easily, but development shops that cling to fading paradigms do. If you're developing apps for mobile devices and you haven't investigated Swift, take note: Swift will not only supplant Objective-C when it comes to developing apps for the Mac, iPhone, iPad, Apple Watch, and devices to come, but it will also replace C for embedded programming on Apple platforms.


Thanks to several key features, Swift has the potential to become the de-facto programming language for creating immersive, responsive, consumer-facing applications for years to come.


Apple appears to have big goals for Swift. It has optimized the compiler for performance and the language for development, and it alludes to Swift being “designed to scale from ‘hello, world’ to an entire operating system” in Swift’s documentation. While Apple hasn’t stated all its goals for the language yet, the launches of Xcode 6, Playgrounds, and Swift together signal Apple’s intent to make app development easier and more approachable than with any other development tool chain.


Here are 10 reasons to get ahead of the game by starting to work with Swift now.


1. Swift is easier to read


Objective-C suffers all the warts you’d expect from a language built on C. To differentiate keywords and types from C types, Objective-C introduced new keywords using the @ symbol. Because Swift isn’t built on C, it can unify all the keywords and remove the numerous @ symbols in front of every Objective-C type or object-related keyword.


Swift drops legacy conventions. Thus, you no longer need semicolons to end lines or parenthesis to surround conditional expressions inside if/else statements. Another large change is that method calls do not nest inside each other resulting in bracket hell -- bye-bye, [[[ ]]]. Method and function calls in Swift use the industry-standard comma-separated list of parameters within parentheses. The result is a cleaner, more expressive language with a simplified syntax and grammar.


Swift code more closely resembles natural English, in addition to other modern popular programming languages. This readability makes it easier for existing programmers from JavaScript, Java, Python, C#, and C++ to adopt Swift into their tool chain -- unlike the ugly duckling that was Objective-C.


2. Swift is easier to maintain


Legacy is what holds Objective-C back -- the language cannot evolve without C evolving. C requires programmers to maintain two code files in order to improve the build time and efficiency of the executable app creation, a requirement that carries over to Objective-C.


Swift drops the two-file requirement. Xcode and the LLVM compiler can figure out dependencies and perform incremental builds automatically in Swift 1.2. As a result, the repetitive task of separating the table of contents (header file) from the body (implementation file) is a thing of the past. Swift combines the Objective-C header (.h) and implementation files (.m) into a single code file (.swift).


Objective-C’s two-file system imposes additional work on programmers -- and it’s work that distracts programmers from the bigger picture. In Objective-C you have to manually synchronize method names and comments between files, hopefully using a standard convention, but this isn’t guaranteed unless the team has rules and code reviews in place.


Xcode and the LLVM compiler can do work behind the scenes to reduce the workload on the programmer. With Swift, programmers do less bookkeeping and can spend more time creating app logic. Swift cuts out boilerplate work and improves the quality of code, comments, and features that are supported.


3. Swift is safer


One interesting aspect of Objective-C is the way in which pointers -- particularly nil (null) pointers -- are handled. In Objective-C, nothing happens if you try to call a method with a pointer variable that is nil (uninitialized). The expression or line of code becomes a no-operation (no-op), and while it might seem beneficial that it doesn’t crash, it has been a huge source of bugs. A no-op leads to unpredictable behavior, which is the enemy of programmers trying to find and fix a random crash or stop erratic behavior.


Optional types make the possibility of a nil optional value very clear in Swift code, which means it can generate a compiler error as you write bad code. This creates a short feedback loop and allows programmers to code with intention. Problems can be fixed as code is written, which greatly reduces the amount of time and money that you will spend on fixing bugs related to pointer logic from Objective-C.


Traditionally, in Objective-C, if a value was returned from a method, it was the programmer’s responsibility to document the behavior of the pointer variable returned (using comments and method-naming conventions). In Swift, the optional types and value types make it explicitly clear in the method definition if the value exists or if it has the potential to be optional (that is, the value may exist or it may be nil).


To provide predictable behavior Swift triggers a runtime crash if a nil optional variable is used. This crash provides consistent behavior, which eases the bug-fixing process because it forces the programmer to fix the issue right away. The Swift runtime crash will stop on the line of code where a nil optional variable has been used. This means the bug will be fixed sooner or avoided entirely in Swift code.


4. Swift is unified with memory management


Swift unifies the language in a way that Objective-C never has. The support for Automatic Reference Counting (ARC) is complete across the procedural and object-oriented code paths. In Objective-C, ARC is supported within the Cocoa APIs and object-oriented code; it isn’t available, however, for procedural C code and APIs like Core Graphics. This means it becomes the programmer’s responsibility to handle memory management when working with the Core Graphics APIs and other low-level APIs available on iOS. The huge memory leaks that a programmer can have in Objective-C are impossible in Swift.


A programmer should not have to think about memory for every digital object he or she creates. Because ARC handles all memory management at compile time, the brainpower that would have gone toward memory management can instead be focused on core app logic and new features. Because ARC in Swift works across both procedural and object-oriented code, it requires no more mental context switches for programmers, even as they write code that touches lower-level APIs -- a problem with the current version of Objective-C.


Automatic and high-performance memory management is a problem that has been solved, and Apple has proven it can increase productivity. The other side effect is that both Objective-C and Swift do not suffer from a Garbage Collector running cleaning up for unused memory, like Java, Go, or C#. This is an important factor for any programming language that will be used for responsive graphics and user input, especially on a tactile device like the iPhone, Apple Watch, or iPad (where lag is frustrating and makes users perceive an app is broken).


5. Swift requires less code


Swift reduces the amount of code that is required for repetitive statements and string manipulation. In Objective-C, working with text strings is very verbose and requires many steps to combine two pieces of information. Swift adopts modern programming language features like adding two strings together with a “+” operator, which is missing in Objective-C. Support for combining characters and strings like this is fundamental for any programming language that displays text to a user on a screen.


The type system in Swift reduces the complexity of code statements -- as the compiler can figure out types. As an example, Objective-C requires programmers to memorize special string tokens ( %s. %d. %@ ) and provide a comma-separated list of variables to replace each token. Swift supports string interpolation, which eliminates the need to memorize tokens and allows programmers to insert variables directly inline to a user-facing string, such as a label or button title. The type inferencing system and string interpolation mitigate a common source of crashes that are common in Objective-C.


With Objective-C, messing up the order or using the wrong string token causes the app to crash. Here, Swift again relieves you from bookkeeping work, translating into less code to write (code that is now less error prone) because of its inline support for manipulating text strings and data.


6. Swift is faster


Dropping legacy C conventions has greatly improved Swift under the hood. Benchmarks for Swift code performance continue to point to Apple’s dedication to improving the speed at which Swift can run app logic.


According to Primate Labs, makers of the popular GeekBench performance tool, Swift was approaching the performance characteristics of C++ for compute-bound tasks in December 2017 using the Mandelbrot algorithm.


In February 2017. Primate Labs discovered that the Xcode 6.3 Beta improved Swift’s performance of the GEMM algorithm -- a memory-bound algorithm with sequential access of large arrays -- by a factor of 1.4. The initial FFT implementation -- a memory-bound algorithm with random access of large arrays -- had a 2.6-fold performance improvement.


Further improvements were observed in Swift by applying best practices, resulting in an 8.5-fold boost for FFT algorithm performance (leaving C++ with only a 1.1-time performance gain). The enhancements also enabled Swift to outperform C++ for the Mandelbrot algorithm by a factor of a mere 1.03.


Swift is nearly on par with C++ for both the FFT and Mandelbrot algorithms. According to Primate Labs, the GEMM algorithm performance suggests the Swift compiler cannot vectorize code the C++ compiler can -- an easy performance gain that could be achieved in the next version of Swift.


7. Fewer name collisions with open source projects


One issue that has plagued Objective-C code is its lack of formal support for namespaces, which was C++’s solution to code filename collisions. When this name collision happens in Objective-C, it is a linker error, and the app can’t run. Workarounds exist, but they have potential pitfalls. The common convention is to use a two - or three-letter prefixes to differentiate Objective-C code that is written, say, by Facebook versus your own code.


Swift provides implicit namespaces that allow the same code file to exist across multiple projects without causing a build failure and requiring names like NSString (Next Step -- Steve Jobs’ company after being fired from Apple) or CGPoint (Core Graphics). Ultimately, this feature in Swift keeps programmers more productive and means they don’t have to do the bookkeeping that exists in Objective-C. You can see Swift’s influence with simple names like Array, Dictionary, and String instead of NSArray, NSDictionary, and NSString, which were born out of the lack of namespaces in Objective-C.


With Swift, namespaces are based on the target that a code file belongs to. This means programmers can differentiate classes or values using the namespace identifier. This change in Swift is huge. It greatly facilitates incorporating open source projects, frameworks, and libraries into your code. The namespaces enable different software companies to create the same code filenames without worrying about collisions when integrating open source projects. Now both Facebook and Apple can use an object code file called FlyingCar. swift without any errors or build failures.


8. Swift supports dynamic libraries


The biggest change in Swift that hasn’t received enough attention is the switch from static libraries, which are updated at major point releases (iOS 8, iOS 7, and so on), to dynamic libraries. Dynamic libraries are executable chunks of code that can be linked to an app. This feature allows current Swift apps to link against newer versions of the Swift language as it evolves over time.


The developer submits the app along with the libraries, both of which are digitally signed with the development certificate to ensure integrity (hello, NSA). This means Swift can evolve faster than iOS, which is a requirement for a modern programming language. Changes to the libraries can all be included with the latest update of an app on the App Store, and everything simply works.


Dynamic libraries have never been supported on iOS until the launch of Swift and iOS 8, even though dynamic libraries have been supported on Mac for a very long time. Dynamic libraries are external to the app executable, but are included within the app bundle downloaded from the App Store. It reduces the initial size of an app as it is loaded into memory, since the external code is linked only when used.


The ability to defer loading in a mobile app or an embedded app on Apple Watch will improve the perceived performance to the user. This is one of the distinctions that make the iOS ecosystem feel more responsive. Apple has been focused on loading only assets, resources, and now compiled and linked code on the fly. The on-the-fly loading reduces initial wait times until a resource is actually needed to display on the screen.


From CIO: 8 Free Online Courses to Grow Your Tech Skills


48) computer monitoring of tracking signals and


This preview has blurred sections. Sign up to view the full version! View Full Document


48) Computer monitoring of tracking signals and self-adjustment if a signal passes a preset limit is characteristic of A) exponential smoothing including trend B) adaptive smoothing C) trend projection D) focus forecasting E) multiple regression analysis Answer: B Diff: 2 Topic: Monitoring and controlling forecasts Objective: LO4-7 49) Many services maintain records of sales noting A) the day of the week B) unusual events C) weather D) holidays E) all of the above Answer: E Diff: 2 Topic: Forecasting in the service sector Objective: LO4-2 50) Taco Bell's unique employee scheduling practices are partly the result of using A) point-of-sale computers to track food sales in 15 minute intervals B) focus forecasting C) a six-week moving average forecasting technique D) multiple regression E) A and C are both correct. Answer: E Diff: 2 Topic: Forecasting in the service sector Objective: LO4-3 51) Which of the following most requires long-range forecasting (as opposed to short-range or medium-range forecasting) for its planning purposes? A) job scheduling B) production levels C) cash budgeting D) capital expenditures E) purchasing Answer: D Diff: 2 Topic: Forecasting time horizons Objective: LO4-1 4-19


52) Suppose that demand in period 1 was 7 units and the demand in period 2 was 9 units. Assume that the forecast for period 1 was for 5 units. If the firm uses exponential smoothing with an alpha value of .20, what should be the forecast for period 3? (Round answers to two decimal places.) A) 9.00 B) 3.72 C) 9.48 D) 5.00 E) 6.12 Answer: E Diff: 2 Topic: Time-series forecasting Objective: LO4-3 53) __________ expresses the error as a percent of the actual values, undistorted by a single large value. A) MAD B) MSE C) MAPE D) FIT E) The smoothing constant Answer: C Diff: 2 Topic: Measuring forecast error Objective: LO4-4 54) If Brandon Edward were working to develop a forecast using a moving averages approach, but he noticed a detectable trend in the historical data, he should A) use weights to place more emphasis on recent data B) use weights to minimize the importance of the trend C) change to a naïve approach D) use a simple moving average E) change to a qualitative approach Answer: A Diff: 2 Topic: Moving averages Objective: LO4-3 Short Answer 1) __________ forecasts are concerned with rates of technological progress, which can result in the birth of exciting new products, requiring new plants and equipment. Answer: Technological Diff: 1 Topic: Types of forecasts Objective: LO4-1 4-20


2) __________ forecasts address the business cycle by predicting inflation rates, money supplies, housing starts, and other planning indicators. Answer: Economic Diff: 2 Topic: Types of forecasts Objective: LO4-1 3) Demand forecasts, also called __________ forecasts, are projections of demand for a company's products or services. Responder:


This is the end of the preview. Sign up to access the rest of the document.


CPA MULTIPLE CHOICE QUESTIONS - Sampling 1. Which of the following is an example of using statistical sampling? a. Statistical sampling will be looked upon by the courts as providing superior audit evidence. segundo. Statistical sampling requires the auditor to make fewer judgmental decisions. do. Statistical sampling aids the auditor in evaluating results. re. Statistical sampling is more convenient to use than nonstatistical sampling.


2. Which of the following is not an example of nonsampling risk? a. Failing to evaluate results properly. segundo. Use of an audit procedure inappropriate to achieve a given audit objective. do. Obtaining an unrepresentative sample. re. Failure to recognize an error.


3. Which of the following is an example of nonstatistical sampling? a. Sequential sampling. segundo. Attribute sampling. do. Haphazard sampling. re. re. Random sampling.


4. Which of the following is not an advantage of using statistical sampling? a. Statistical sampling aids in the design of an efficient sample. segundo. Statistical sampling allows the auditor to measure the sufficiency of the evidential matter obtained. do. Statistical sampling allows the auditor to greatly reduce substantive testing. re. Statistical sampling provides a means for mathematically measuring the degree of risk that results from examining only part of a population.


5. Which of the following best illustrates the concept of sampling risk? a. An auditor may select audit procedures that are not appropriate to achieve the specific objective. segundo. The documents related to the chosen sample may not be available for inspection. do. A randomly chosen sample may not be representative of the population as a whole. re. An auditor may fail to recognize deviations in the documents examined.


6. The application of statistical sampling techniques is least related to a. The first standard of FW. . segundo. The second standard of FW. do. The second general standard d. re. The third standard of FW.


7. When performing tests of controls which of the following is most useful? a. Stratified random sampling. segundo. Variable sampling. do. Unrestricted random sampling with replacement. re. Attribute sampling.


8. An auditor examining inventory may appropriately apply sampling for attributes in order to estimate the a. Average price of inventory items. segundo. Dollar value of inventory. do. Percentage of slow-moving inventory items. re. Physical quantity of inventory items.


9. Respectively, attribute sampling and variables sampling are a. Quantitative and qualitative in nature. segundo. Qualitative and quantitative in nature. do. Both qualitative and quantitative in nature. re. None of these.


10. The risk that the assessed level of control risk based on the sample is less than the true operating effectiveness of the control structure policy or procedure is termed a. The risk of incorrect acceptance. segundo. The risk of incorrect rejection. do. The risk of assessing too low. re. re. The risk of assessing too high.


11. The advantage of using statistical sampling techniques is that such techniques a. Mathematically measure risk. segundo. Eliminate the need for judgmental decisions. do. Are easier to use than other sampling techniques. re. Have been established in the courts to be superior to nonstatistical sampling.


12. Which of the following is an element of sampling risk? a. Choosing an audit procedure that is inconsistent with the audit objective. segundo. Choosing a sample size that is too small to achieve the sampling objective. do. Failing to detect a deviation on a document inspected by the auditor. re. Failing to perform audit procedures that are required by the sampling plan.


13. Statistical sampling (SS) provides a technique for a. Exactly defining materiality. segundo. Greatly reducing the amount of substantive testing. do. Eliminating judgment in testing. re. Measuring the sufficiency of evidential matter.


14. Which of the following best describes the distinguishing feature of SS? a. It reduces the problems associated with the auditor's judgment concerning materiality. segundo. It requires the examination of a smaller number of supporting documents. do. It is evaluated in terms of two parameters: statistical mean and random selection. re. It provides a means for measuring mathematically the degree of uncertainty that results from examining only part of a population.


15. If certain forms are not consecutively numbered a. Selection of a random sample probably is not possible. segundo. Systematic sampling may be appropriate. do. Stratified sampling should be used. re. Random number tables can not be used.


16. An auditor initially planned to use unrestricted random sampling with replacement in the examination of accounts receivable. Later, the auditor decided to use unrestricted random sampling without replacement. As a result only of this decision, the sample size should a. Incrementar. segundo. Remain the same. do. Decrease. re. re. Be recalculated using a binomial distribution.


17. From prior experience, a CPA is aware of the fact that cash disbursements contain a few unusually large disbursements. In using statistical sampling, the CPA's best course of action is to a. Eliminate any unusually large disbursements that appear in the sample. segundo. Continue to draw new samples until no unusually large disbursements appear in the sample. do. Stratify the cash disbursements population so large disbursements are reviewed separately. re. Increase the sample size to lessen the effect of the unusually large disbursements.


18. In examining cash disbursements, an auditor plans to choose a sample using systematic selection with a random start. The primary advantage of such a systematic selection is that population items a. Which include irregularities will not be overlooked when the auditor exercises compatible reciprocal options. segundo. May occur in a systematic pattern, thus making the sample more representative. do. May occur more than once in a sample. re. Do not have to be prenumbered in order for the auditor to use the technique.


19. An accounts receivable aging schedule was prepared on 300 pages with each page containing the aging data for 50 accounts. The pages were numbered from 1 to 300 and the accounts listed on each were numbered from 1 to 50. Godla, an auditor, selected accounts receivable for confirmation using a table of numbers as illustrated Procedures performed by Godla Select column from Separate 5 digits: table of numbers First 3 digits Last 2 digits 02011 020-11 x 85393 853-93 * 97265 972-65 * 61680 616-80 * 16656 166-56 * 42751 427-51 * 69994 699-94 * 07942 079-42 y 10231 102-31 z 53988 539-88 * x Mailed confirmation to account 11 listed on page 20 y Mailed confirmation to account 42 listed on page 79 * Rejected


This is an example of which of the following sampling methods? a. Acceptance sampling. segundo. Systematic sampling. do. Sequential sampling. re. Random sampling.


20. The auditor's failure to recognize a misstatement in an amount or a deviation in an internal control, data-processing procedure is described as a. Statistical error. segundo. Sampling error. do. Standard error. re. Nonsampling error.


21. Which of the following statistical selection techniques is least desirable for use by an auditor? a. Systematic selection. segundo. Stratified selection. do. Block selection. re. Sequential selection.


22. In attribute sampling, a 10% change in which of the following factors normally will have the least effect on the size of a statistical sample? a. Population size. segundo. Tolerable deviation rate. do. Risk of assessing too low. re. Likely deviation rate.


23. If the auditor is concerned that a population may contain exceptions, the determination of a sample size sufficient to include at least one such exception is a characteristic of a. Discovery sampling. segundo. Variable sampling. do. Random sampling. re. Dollar-unit sampling.


24. An auditor plans to examine a sample of 20 checks for countersignatures as prescribed by the client's internal control procedures. One of the checks in the chosen sample of 20 cannot be found. The auditor should consider the reasons for this limitation and a. Evaluate the results as if the sample size had been 19. b. Treat the missing check as a deviation when evaluating the sample. do. Treat the missing check in the same manner as the majority of the other l9 checks, i. e. countersigned or not. re. Choose another check to replace the missing check in the sample.


25. The tolerable rate of deviations for a test of controls is generally a. Lower than the likely rate of deviations in the related accounting records. segundo. Higher than the likely rate of deviations in the related accounting records. do. Identical to the likely rate of deviations in the related accounting records. re. Unrelated to the likely rate of deviations in the related accounting records.


26. The risk that the assessed level of control risk based on the sample is greater than the true operating effectiveness of the control structure policy or procedure is termed a. Risk of assessing too high. segundo. Risk of assessing too low. do. Incorrect acceptance. re. Incorrect rejection.


27. Jones, CPA, believes the industry-wide occurrence rate of client billing errors is 3% and has established a maximum acceptable occurrence rate of 5%. In the review of client invoices Jones should use a. Discovery sampling. segundo. Attribute sampling. do. Stratified sampling. re. Variable sampling.


28. In estimation sampling for attributes, which one of the following must be known in order to appraise the results of the auditor's sample? a. Estimated dollar value of the population. segundo. Standard deviation of the values in the population. do. Actual occurrence rate of the attribute in the population. re. Sample size.


29. Given random selection, the same sample size, and the same tolerable deviation rate for the testing of two unequal populations, the risk of assessing control risk too low for the smaller population is a. Higher than the risk of assessing too low for the larger population. segundo. Lower than the risk of assessing too low for the larger population. do. The same as the risk assessing too low for the larger population. re. Indeterminable relative to the risk assessing too low for the larger population.


30. If all other factors specified in an attribute sampling plan remain constant, changing the specified tolerable deviation rate from 6% to 10%, and changing the specified risk from 97% to 93%, would cause the required sample size to a. Incrementar. segundo. Remain the same. do. Decrease. re. Change by 4%.


31. When using statistical sampling for tests of controls, an auditor's evaluation process would include a statistical conclusion about whether a. Procedural deviation in the population were within an acceptable range. segundo. Population characteristics occur at least once in the population. do. Monetary misstatement is in excess of a certain predetermined amount. re. The population total is not misstated by more than a fixed amount.


32. Discovery sampling should not be used if a CPA estimates that the occurrence rate of a certain characteristic in a population being examined exceeds approximately a. 20% b. 10% c. 5% d. 0%


33. If the size of the sample to be used in a particular test of attributes has not been determined by utilizing statistical concepts, but the sample has been chosen in accordance with random selection procedures a. No inferences can be drawn from the sample. segundo. The auditor has committed a nonsampling error. do. May not use statistical evaluation. re. The auditor will have to evaluate the results by reference to the principles of discovery sampling.


34. In assessing sampling risk, the risk of incorrect rejection and the risk of assessing control risk too high relate to the a. Efficiency of the audit. segundo. Effectiveness of the audit. do. Selection of the sample. re. Audit quality control.


35. An underlying feature of random-based selection of items is that each a. Stratum of the accounting population be given equal representation in the sample. segundo. Item in the accounting population be randomly ordered. do. Item in the accounting population should have an opportunity to be selected. re. Item must be systematically selected using replacement.


36. In estimation sampling for variables, which of the following must be known in order to estimate the appropriate sample size required to meet the auditor's needs in a given situation? a. The qualitative aspects of misstatements. segundo. The total dollar amount of the population. do. The acceptable level of risk. re. The estimated rate of deviation in the population.


37. To determine the number of items to be selected in a sample for a particular substantive test of details, the auditor should consider all of the following except a. Tolerable misstatement. segundo. Deviation rate. do. Allowable risk of incorrect acceptance. re. Characteristics of the population.


Items 38 and 39 are based on the following information: Sorry, I couldn't get these to fit on the page.


40. The size of a sample designed for dual purpose testing should be a. The larger of the samples that would otherwise have been designed for the two separate purposes. segundo. The smaller of the samples that would otherwise have been designed for the two separate purposes. do. The combined total of the samples that would otherwise have been designed for the two separate purposes. re. More than the larger of the samples that would otherwise have been designated for the two separate purposes, but less than the combined total of the samples that would otherwise have been designed for the two separate purposes.


41. The risk of incorrect acceptance and the risk of assessing control risk too low relate to the a. Preliminary estimates of materiality levels. segundo. Allowable risk of tolerable misstatement. do. Efficiency of the audit. re. Effectiveness of the audit.


42. When assessing the tolerable rate, the auditor should consider that, while deviations from control procedures increase the risk of material errors, such deviations do not necessarily result in errors. This explains why a. A recorded disbursement that does not show evidence of required approval may nevertheless be a transaction that is properly authorized and recorded. segundo. Deviations would result in errors in the accounting records only if the deviations and the errors occurred on different transactions. do. Deviations from pertinent control procedures at a given rate ordinarily would be expected to result in errors at a higher rate. re. A recorded disbursement that is properly authorized may nevertheless be a transaction that contains a material error.


43. Which of the following statistical sampling plans does not use a fixed sample size for tests of controls? a. Dollar-unit sampling. segundo. Sequential sampling. do. PPS sampling. re. Variables sampling.


44. Which of the following statements is correct concerning statistical sampling in tests of controls? a. The population size has little or no effect on determining sample size except for very small populations. segundo. The likely population deviation rate has little or no effect on determining sample size except for very small populations. do. As the population size doubles, the sample size also should double. re. For a given tolerable rate, a larger sample size should be selected as the likely population deviation rate decreases.


45. A number of factors influences the sample size for a substantive test of details of an account balance. All other factors being equal, which of the following would lead to a larger sample size? a. Greater reliance on internal controls. segundo. Greater reliance on analytical procedures. do. Smaller expected frequency of misstatements. re. Smaller measure of tolerable misstatements.


Image Inpainting with a Video Camere (OpenCV and Image Processing)


Средняя заявка $0


Hello All, I have developed a C project with OpneGL and its based on Image Inpainging ([url removed, login to view]). Objective: User can select the object with the mouse and and on a left click it should remove the selected object and regenerate the background which is occluded with help for nearby pixies and previous video frame on a runtime from the video feed. Now i have partially developed that project and because of my other priorities i am asking some freelancer to do this project. What i have done. I am able to access the camera feed from Web cam. I can select the moving object with the help of a mouse and it will create a rectangle box around that object. Now once that object start moving i can track that object with some simple object tracking algorithm because i thought the inpainting will required more processing power. Inpaingitn part is also partial done but the result is not great. I want some one with the great image processing and openGL knowledge who can help me get the result what i wanted.


I will provide the code which i have already wrote and all the research material i have gathered for this projects and my notes.


feel free to contact me and let me know if you have any question with the project and for budget. Gracias,


Хотите заработать немного денег?


Установите свой бюджет и временные рамки


Опишите свое предложение


Получите оплату за свою работу


Поиск фрилансеров


Недавно выполненные проекты


Аналогичные проекты и конкурсы


Szukamy osoby która napisze program do edycji plików pdf W jednym pliku pdf jest zapisanych kilkadziesiąt stron, gdzie każda strona jest zapisana tekstem do maksymalnie połowy kartki. Jedna strona składa się z górnej połowy (rozmiaru kartki A5) - zapisanej treścią oraz dolnej części kartki (rozmiaru A5) - pustej. Zadaniem programu jest wstawienie w dolną połowę kartki (pustą) górnej połówki innej strony pliku źródłowego według zadanego wzoru: Dla plików źródłowych o parzystej liczbie stron = n i (liczba stron pierwotnego pliku)/2+n) Dla plików źródłowych o nieparzystej liczbie stron = n i (liczba stron pierwotnego pliku-1)/2+n) Gdzie n to numer strony źródłowego pliku Celem programu jest zmniejszenie ilości stron w pliku nie zmniejszaniu skali treści dokumentu W załączniku przykład


zł466 Средняя заявка


Adding a function on open source software assignment


Author: Jesse Feiler Publisher: Sams Pages: 416 ISBN: 978-0672335891 Aimed at: Beginners who already program another language, preferably C or C++ Rating: 2.5 Pros: Short Cons: Muddled, requires you to know C before your start Reviewed by:Harry Fairhead


Objective C is important because it is the main way to create iOS applications. Can you learn it in 24 one-hour lessons?


Author: Jesse Feiler Publisher: Sams Pages: 416 ISBN: 978-0672335891 Aimed at: Beginners who already program another language, preferably C or C++ Rating: 2.5 Pros: Short Cons: Muddled, requires you to know C before your start Reviewed by:Harry Fairhead


Objective C is the other object oriented version of C and it's important because it is the main way to create iOS applications. Can you learn it in 24 one hour lessons?


This is a very strange book and there might be readers out there who would like it, but I can't quite imagine who they could be. It attempts to be an introduction to Objective C, and at first you do get the feeling that it is going to tell you something in a way that makes it understandable - only you keep moving on through chapters without ever getting to the "meat" of the subject.


It claims to be aimed at the beginner but the one group it most certainly isn't suitable for is the beginner. You need to know something about programming to get much from this book. My best guess is that the author has a C++ programmer in mind while describing features of Objective C but it is difficult to be certain.


There is also the problem of deciding if you should teach Objective-C as a pure language and ignore its use in iOS app development. This book takes the approach that the two cannot be split up and so Cocoa and the rest of the libraries and tools are featured from the start of the book - but it isn't really a "how to create an iOS app" book.


Part 1 of the book is about getting started and this explains how to get set up and how to use Git and the compiler. There is some discussion of the nature of Objective-C as a language descended from Smalltalk rather than Simula-like C++, but most of this isn't going to make any sense unless you already understand object-oriented programming. It is also worth mentioning that the screen dumps included, despite being in full color, are next to impossible to make any use of. They are simply too small. Not only can't you read any of the text they contain, you can't really see what the important features are.


Part II is about getting to know Objective-C, but it isn't a step-by-step introduction and it isn't particularly logical in presentation. It explains how to declare a class and how to create an instance but without any clear overview of what is going on. As you read, you keep feeling that the book is about to begin and will explain things to you, but no. The book basically never gets beyond explaining a few features that Objective-C does differently from C++ and most other object-oriented languages. It never manages to get down to a detailed explanation of the language. If you are a beginner then it will just seem completely out of reach of your understanding.


Part III deals with Expanding and Extending classes which, given how little you have learned about programming in Objective-C, is about all you can hope for.


Part IV is about exceptions and other slightly advanced topics and this is where the book comes to an end.


As already stated, this is a very strange book. It is as if the author wasn't quite sure what he had to tell a reader to get started in Objective-C. You need already to know about loops and conditionals, because these are not described at all. You at least need to know how to program in C to follow any of the descriptions. Even if you do know the basics of C, what is going on with classes and object is still going to be a mystery to you at the end of the book.


Overall this is a book to avoid as its only real advantage to the average reader is that it is over in 24 hour-long chapters. If you want to program in Objective-C and you are a complete beginner then look for another book. If you are an intermediate programmer, know C and probably C++, then you might get something more from it but I doubt it. There are better books on the topic.


but bear in mind that neither is up-to-date with the latest iOS development environment. If what you are really interested in is iOS Development see iOS Programming; The Big Nerd Ranch Guide


PIM - Open Source Product Information Management Software


Product Information Management (PIM) helps you increase brand loyalty and average sale value per existing customer. PIM also supports customer acquisition efforts by allowing you to target your offerings more effectively.


OSSCube delivers robust open source Product Information Management software to streamline, enrich, and organize your enterprise level catalog. Through this offering, we effectively reduce the costs associated with data management and catalog creation. Utilizing a centralized repository, PIM system will enable your organization to expand into other channels and demand-generating programs.


Our well-structured Product Information Management system allows internal departments to standardize all product descriptions throughout their lifecycles and store detailed information for easy access. This creates a uniform customer experience and increases conversion ratios across all channels.


OSSCube can help you create a PIM system to:


Increase brand loyalty and average sales value per customer


Target customer acquisition


Lower product catalog software management costs


Synchronize print and digital catalog descriptions


Improve collaboration with suppliers


Expand globally with more multilingual marketing tools


We’ve reduced our costs by 60% and were able to improve our data quality by moving from SalesForce. com to SugarCRM. Our service provider, OSSCube exceeded our expectations! Delivery was very fast and they were extremely responsive to any issues uncovered during UAT. We're looking forward to reaping the benefits of SugarCRM long into the future.


Phillip Getto, CTO Orametrix, US


Gracias a todos. I am very fortunate to be working with such a skilled, dedicated and gracious team. I only wish I could be there in person to express my gratitude.


Client Representative Building and Construction Network, US


The requests that OSSCube has been working on are making our jobs better so I wanted to pass the kudos along to your team!


Project Leader of Web and Data Services CU Solutions Group, US


We wanted to express our appreciation for the work your team performed on the SmartStart application. The team was always professional, following up consistently and appropriately, and followed through on every deliverable in a detailed manner. And we appreciate the professional workforce you are building at OSSCube.


Ben and Sue, Client Representatives SmartStart application, US


Well done for the successful BSS migration! I'm really conscious that there has been a huge amount of work that has gone into planning and managing this event, and it's a credit to everyone involved that it has gone as smoothly as it has done. It's been particularly encouraging to see the level of dedication and the feeling of working as 'one team' which has ensured that issues have been cleared down in a speedy fashion.


Client Representative Virgin Media, US


Learn to Make iPhone Apps with Objective C for iOS7


Описание курса


Learn to create iPhone apps with Objective C programming.


Follow along in Xcode 5 to turn your ideas into iPhone apps.


Create iPhone apps with easy to follow, step-by-step instructions, in this in-depth course taught by an expert instructor.


This course features HD lectures and programming screencasts with large, clear text. Listen to crisp audio and follow Paul Solt’s instruction with demonstrations and on-screen pointer and highlighting.


If you’ve tried to learn how to program iPhone apps from other online resources, you know it can be very frustrating.


In this course, Paul Solt shows you how to get started


You will learn the programming topics that computer science students learn, and in far less time


All of the Objective C code works with iOS 7 apps


Paul provides explanations and examples on how existing apps use different features


Jump in and start learning to write code today!


Каковы требования?


Mac with Mountain Lion or Later


Xcode 5


PC with MacinCloud. com


Что я вынесу из этого курса?


Более 70 лекций и 13.5 часов содержания!


Make apps for iOS7


Use Xcode to design user interfaces for iPhone apps


Learn to code in Objective C


Prototype ideas on paper


Какова целевая аудитория?


People who want to make iPhone apps


Anyone with an idea for an app


Non-programmers


diseñadores


Artistas


Web developers


Учебный план


Howdy, I’m Paul! I have a master's degree in Computer Science from Rochester Institute of Technology and I used to work for Apple.


After working at Apple, I decided that I wanted more freedom. I started my own app company and followed the money (you can too!). Instead of reporting to a boss – I set my own hours and enjoy my work.


I’m passionate about teaching around the world – most recently I taught high school kids in Athens, Greece how to make iPhone games (technology skills have their perks!). People all over the world use my courses to jump-start their careers into iPhone apps.


You wouldn’t believe the opportunities, freedom, and jobs that iOS development opens to you. Sign up and find out for yourself why so many people are taking my iPhone app courses.


I believe my courses provide the most complete and comprehensive background for any beginner or experienced developer. If you don’t agree I will happily refund your money.


Sign up for the Swift and iOS 8 Apps in 31 Days course and join me on an amazing adventure to the App Store.


Другие материалы Paul Solt


Добавлено в список пожеланий Список пожеланий


Добавлено в список пожеланий Список пожеланий


Добавлено в список пожеланий Список пожеланий


* Please note discounts may be slightly higher than advertised amount due to rounding and currency conversion


Студенты, которые промотрели этот курс, также просматривают


Mr. kousen is … Water Man


That gizmo pictured to the left is a BIG deal. It literally opened up worlds of organisms and information to scientists. It's importance in the history of medicine and our understanding of disease should not be underestimated. That gizmo is a compound light microscope . For you, the biology student, it is perhaps the most important tool for you to understand. By the time you are done toying with these pages (& reading your text & paying attention in class), you should be able to. 1. name all of its parts and describe the function of each 2. explain how to carry the thing, properly prepare a slide, & focus correctly 3. calculate total magnification 4. estimate the size of a specimen being observed Let's get started.


THE PARTS Match the names in the word bank with the numbered parts in the picture.


arm base body tube coarse focus knob diaphragm fine focus knob high power objective lens light source low power objective lens nosepiece ocular (eyepiece) stage stage clips


After you have jotted down the numbers & your answers, check your work here .


WHAT THE PARTS DO Now it's time to memorize the function of each microscope part. To help you practice, here's a matching exercise.


arm base body tube coarse focus knob diaphragm fine focus knob high power objective lens light source low power objective lens nosepiece ocular (eyepiece) stage stage clips


1. the lens you look through, magnifies the specimen 2. supports the microscope 3. holds objective lenses 4. magnify the specimen (2) 5. supports upper parts of the microscope, used to carry the microscope 6. used to focus when using the high power objective 7. where the slide is placed 8. regulates the amount of light reaching the objective lens 9. used to focus when using the low power objective 10. provides light 11. hold slide in place on the stage


Important 'Scope Vocab . magnification \mag-ne-fe-'ka-shen\ n 1. apparent enlargement of an object 2. the ratio of image size to actual size A magnification of "100x" means that the image is 100 times bigger than the actual object.


resolution \rez-e-loo-shen\ n 1. clarity, sharpness 2. the ability of a microscope to show two very close points separately


OK, well. There are a few other tidbits about the compound microscope you should remember. 1. Why is called a "compound" light microscope. "Compound" just refers to the fact that there a two lenses magnifying the specimen at the same time, the ocular & one of the objective lenses.


2. If two lenses are always magnifying the specimen (see #1), how do you figure out the total magnification being used. You multiply the power of the ocular and the power of the objective being used. total mag. = ocular x objective For example, if the ocular is 10x and the low power objective is 20x, then the total magnification under low power is 10 x 20 = 200x. Easy, ain't it.


3. How do you carry one of those things. With two hands, one holding the arm & the other under the base. Kinda like a football. (They're expensive, we don't want to drop 'em.)


4. What about focussing. How do you do that. Here's what I suggest. Once you have your slide in place on the stage, make sure the low power objective (the shortest objective lens) is in position & turn the coarse focus until the lens is at a position closest to the stage. Set the diaphragm to its largest opening (where it allows the most light through). Then, while looking through the ocular, begin to slowly turn the coarse focus. Turn slowly & watch carefully . When the specimen is focussed under low power, move the slide so that what you want to see is dead-center in your field of view, & then switch to a higher power objective. DO NOT touch the coarse focus again --- you will break something. Once you are using a high power objective, focus using the fine focus knob ONLY. Be sure to center your specimen before switching to a higher power objective or it may disappear. More on that in a minute. ( K e e p S m i li n g. )


Estimating Specimen Size : The area of the slide that you see when you look through a microscope is called the "Field of View". If you know how wide your field of view is, you can estimate the size of things you see in the field of view. Figuring out the width of the field of view is easy --- all you need is a thin metric ruler.


By carefully placing a thin metric ruler on the stage (where a slide would usually go) and focussing under low power . we can measure the field of view in millimeters. Through the microscope it would look something like what you see here on the left. The total width of the field of view in this example is less than 1.5 mm. A fair estimate would be 1.3 or 1.4 mm. (Relax, it's an estimate ).


Now millimeters is a nice metric unit, but when we use a MICROscope we tend to use MICROmeters. To convert from millimeters to micrometers, move the decimal 3 places to the right. Our 1.3 mm estimate becomes 1300 micrometers.


Now we can get the ruler out of the way, prepare a slide, focus, and estimate the size of things we see. (Exciting, ain't it ?)


For example, if something we were looking at took up half of the field of view, its size would be approximately 1/2 x 1300 micrometers = 650 micrometers. If something appeared to be 1/5 of the field of view, we would estimate its size to be 1/5 x 1300 = 260 micrometers.


Calculating Specimen Size . Because the high power objective is so close to the stage, we can't measure the width of the field of view under high power directly. The ruler just doesn't fit between the objective & the stage. No hay problema. We can use the width of the field of view under low power (which we measure using the steps above) and the relationship between the low & high power magnifications to mathematically calculate the width of the field of view under high power.


First of all memorize this. When switching from low to high power, the area in the field of view gets smaller & darker. (You see a smaller area of the slide under high power.) This is why centering what you want to see prior to switching to high power is so important. The fraction of the area seen under high power is the same as the ratio of the low & high power magnifications.


Por ejemplo. if the low power objective is 20x and the high power objective is 40x, then under high power we will see 20/40 or 1/2 of the area of the slide we saw under low power.


This is something that requires some practice. So here ya go. Calculate the answers to these examples on some paper & then click on "answers". (You'll learn more if you try it yourself first.) Example #1 . ocular power = 10x low power objective = 20x high power objective = 50x


a) What is the highest magnification you could get using this microscope. b) If the diameter of the low power field is 2 mm, what is the diameter of the high power field of view in mm? in micrometers. c) If 10 cells can fit end to end in the low power field of view, how many of those cells would you see under high power.


Example #2 . ocular power = 10x low power objective = 10x high power objective = 40x


The diagram shows the edge of a millimeter ruler viewed under the microscope with the lenses listed above. The field shown is the low power field of view.


a) What is the approximate width of the field of view in micrometers. b) What would be the width of the field of view under high power. c) If 5 cells fit across the high power field of view, what is the approximate size of each cell.


Example #3 . ocular = 10x low power objective = 20x high power objective = 40x


The picture shows the low power field of view for the microscope with the lenses listed above. a) What is the approximate size of the cell in micrometers. b) What would be the high power field of view. c) How many cells like the one in the picture could fit in the high power field of view.


WELL, HOPE YOU LEARNED A TON. KEEP PLUGGIN' AWAY.


Back to Biology Topics Outline


IF YOU HAVE COMMENTS (GOOD OR BAD) ABOUT THIS OR ANY OF MY BIOLOGY PAGES, CLASSES, OR ANYTHING ELSE IN GENERAL, DROP ME A NOTE : kousenclass@hobart. k12.in. us


Using the Microscope . the Answers


Answers to THE PARTS : 1) base 2) light source 3) diaphragm 4) stage 5) stage clips 6) low power objective lens 7) high power objective lens 8) nosepiece 9) arm 10) fine focus knob 11) body tube 12) coarse focus knob 13) ocular (eyepiece)


Answers to 'WHAT THE PARTS DO' : 1. ocular 2. base 3. nosepiece 4. low power objective lens, high power objective lens 5. arm 6. fine focus knob 7. stage 8. diaphragm - by the way, this is the NYS Regents favorite microscope part 9. coarse focus knob 10. light source (lamp or mirror) 11. stage clips


Answers to 'WHAT YOU SEE' . ANSWER to Example #1 . ocular power = 10x low power objective = 20x high power objective = 50x


a) What is the highest magnification you could get using this microscope. 500x Ocular x high power = 10 x 50 = 500. (We can only use 2 lenses at a time, not all three.) b) If the diameter of the low power field is 2 mm, what is the diameter of the high power field of view in mm. 8 mm The ratio of low to high power is 20/50. So at high power you will see 2/5 of the low power field of view (2 mm). 2/5 x 2 = 4/5 = .8 mm in micrometers. 800 micrometers To convert mm to micrometers, move the decimal 3 places to the right (multiply by 1000). 8 mm x 1000 = 800 micrometers d) If 10 cells can fit end to end in the low power field of view, how many of those cells would you see under high power. 4 cells. We can answer this question the same way we go about "b" above. At high power we would see 2/5 of the low field. 2/5 x 10 cells = 4 cells would be seen under high power.


<back to example #1 ANSWER to example #2 . ocular power = 10x low power objective = 10x high power objective = 40x


The diagram shows the edge of a millimeter ruler viewed under the microscope with the lenses listed above. The field shown is the low power field of view.


a) What is the approximate width of the field of view in micrometers. 3500 - 3800 micrometers Each white space is 1 mm. We can see approximately 3 1/2 (or so) white spaces. That is equivalent to 3.5 mm, which converts to 3500 micrometers. Any answer in the range above would be OK. b) What would be the width of the field of view under high power. 875 micrometers The ratio of low to high power for this microscope is 10/40 or 1/4. So, under high power we will see 1/4 of the low power field of view. 1/4 x 3500 micrometers (from "a" above) = 875 micrometers. c) If 5 cells fit across the high power field of view, what is the approximate size of each cell. 175 micrometers If 5 cells fit in the high power field of view (which we determined is 875 micrometers in "b"), then the size of 1 cell = 875/5 = 175 micrometers.


ANSWERs to Example #3 . ocular = 10x low power objective = 20x high power objective = 40x


The picture shows the low power field of view for the microscope with the lenses listed above.


a) What is the approximate size of the cell in micrometers. 500 micrometers First, we have to visualize how many of those cells could fit across the field --- about 4. So 2 mm (the width of the field) / 4 = .5 mm, which converts to 500 micrometers. b) What would be the high power field of view. 1000 micrometers The ratio of low to high power for this scope is 20/40, or 1/2. So we will see 1/2 of the low power field under high power. 1/2 x 2 mm = 1mm, which converts to 1000 micrometers. c) How many cells like the one in the picture could fit in the high power field of view. 2 cells Again the ratio of low to high power is 20/40, or 1/2. If we can see 4 cells across the low field of view we will see 1/2 as many in the high field of view. 1/2 x 4 = 2 cells.


Working with Directories in Objective-C


Purchase the full edition of this Objective-C book in Print ($14.99) or eBook ($12.99) format Objective-C 2.0 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters.


A key element of gaining proficiency in any programming language involves the ability to work with files and file systems. The level of difficulty in working with files varies from very easy to hard, depending on the programming language concerned. The C programming language, on which Objective-C is based, tended to make file handling a little hard relative to the standards of today's programmer friendly object oriented languages. The good news for Objective-C developers is that the Foundation Framework includes a number of classes designed specifically to make the task of working with files and directories as straightforward as possible.


In this chapter we will look at these classes and provide examples of how use them to perform some basic directory operations from within an Objective-C program. In Working with Files in Objective-C we will take a close look at working with files using these classes.


The Objective-C NSFileManager, NSFileHandle and NSData Classes


<google>IOSBOX</google> El Marco de la Fundación ofrece tres clases que son indispensables cuando se trata de trabajar con archivos y directorios:


NSFileManager - The NSFileManager class can be used to perform basic file and directory operations such as creating, moving, reading and writing files and reading and setting file attributes. Además, esta clase proporciona métodos para, entre otras tareas, identificar el directorio de trabajo actual, cambiar a un nuevo directorio, crear directorios y listar el contenido de un directorio.


NSFileHandle - The NSFileHandle class is provided for performing lower level operations on files, such as seeking to a specific position in a file and reading and writing a file's contents by a specified number of byte chunks and appending data to an existing file.


NSData - The NSData class provides a useful storage buffer into which the contents of a file may be read, or from which data may be written to a file.


Understanding Pathnames in Objective-C


When using the above classes, pathnames are defined using the UNIX convention. As such each component of a path is separated by a forward slash (/). Paths that do not begin with a slash are interpreted to be relative to a current working directory. For example, if the current working directory is /home/objc and the path name is myapp/example. m then the file is considered to have a full pathname of /home/objc/myapp/example. m .


In addition, the home directory of the current user can be represented using the tilde (


) character. For example the pathname


/example. m references a file named example. m located in the home directory of the current user. The home directory of another user may be referenced by prefixing the user name with a


john/demo. m references a file located in the home directory of a user named john .


Obtaining a Reference to the Default NSFileManager Object


The NSFileManager class contains a class method named defaultManager that is used to obtain a reference to the application’s default file manager instance:


In the above example we have declared a variable named filemgr to point to an object of type NSFileManager, and then requested a pointer to the application’s file manager and assigned it to the variable. Having obtained the object reference we can begin to use it to work with files and directories.


Identifying the Current Working Directory


The current working directory may be identified using the currentDirectoryPath instance method of our NSFileManager object. The current path is returned from the method in the form of an NSString object:


Changing to a Different Directory


The current working directory of a running Objective-C program can be changed with a call to the changeCurrentDirectoryPath method. The destination directory path is passed as an argument to the instance method in the form of an NSString object. Note that this method returns a boolean YES or NO result to indicate if the requested directory change was successful for not:


Creating a New Directory


A new directory is created using the createDirectoryAtURL instance method, this time passing through the through the pathname of the new directory as an argument in the form of an NSURL object. This method also takes additional arguments in the form of a set of attributes for the new directory and a Boolean value indicating whether or not intermediate directories should be created if they do not already exist. Specifying nil will use the default attributes:


The createDirectoryAtURL method returns a Boolean result indicating the success or otherwise of the operation.


Deleting a Directory


An existing directory may be removed from the file system using the removeItemAtPath method, passing though the path of the directory to be removed as an argument:


Renaming or Moving a File or Directory


An existing file or directory may be moved (also known as renaming) using the moveItemAtURL method. This method takes the source and destination pathnames as arguments in the form of NSURL objects and requires that the destination path not already exist. If the target exists, a boolean NO result is returned by the method to indicate failure of the operation:


Getting a Directory File Listing


A listing of the files contained within a specified directory can be obtained using the contentsOfDirectoryAtPath method. This method takes the directory pathname as an argument and returns an NSArray object containing the names of the files and sub-directories in that directory:


When executed as part of a program, the above code excerpt will display a listing of all the files located in the /tmp directory.


Getting the Attributes of a File or Directory


The attributes of a file or directory can be obtained using the attributesOfItemAtPath method. This takes as arguments the path of the directory and an optional NSError object into which information about any errors will be placed (may be specified as NULL if this information is not required). The results are returned in the form of an NSDictionary dictionary object (for details of working with dictionary objects refer to Objective-C Dictionary Objects ). The keys for this dictionary are as follows: <google>ADSDAQBOX_FLOW</google> NSFileType NSFileTypeDirectory NSFileTypeRegular NSFileTypeSymbolicLink NSFileTypeSocket NSFileTypeCharacterSpecial NSFileTypeBlockSpecial NSFileTypeUnknown NSFileSize NSFileModificationDate NSFileReferenceCount NSFileDeviceIdentifier NSFileOwnerAccountName NSFileGroupOwnerAccountName NSFilePosixPermissions NSFileSystemNumber NSFileSystemFileNumber NSFileExtensionHidden NSFileHFSCreatorCode NSFileHFSTypeCode NSFileImmutable NSFileAppendOnly NSFileCreationDate NSFileOwnerAccountID NSFileGroupOwnerAccountID


For example, we can extract the creation date, file type and POSIX permissions for the /tmp directory using the following code excerpt:


When executed on a Mac OS X system, we can expect to see the following output (note that /tmp on a Mac OS X system is a symbolic link to private/tmp ):


Purchase the full edition of this Objective-C book in Print ($14.99) or eBook ($12.99) format Objective-C 2.0 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters.


Hands On IT Training Across North America


Travel Packages


Remote Attendance


HOTT's Training Benefits


Course materials include student guide, hands-on lab manual and USB flash drive containing examples and lab files


Students receive a certificate of completion at the end of class


Students can retake any portion of a class that has been completed, within 12 months at no extra cost


There are no registration fees or cancellation fees


PDF Download E-mail this Page Download Catalog


iOS Programming for iPhone® and iPad® Applications Using Objective-C


Students Will Learn:


Downloading and installing Xcode from the Mac App Store


Objective-C Language syntax


Creating new projects using Xcode templates


Using if statements and switch statements to control the flow of applications


Designing applications using OOP principles


The difference between heap and stack memory and the uses for each


The ARC System


Creating new applications in Xcode using MVC application architecture


Creating full GUI applications


The Delegate code pattern


Using a navigation view to control the flow of an application


Using the Debug Console for exception handling


Using NeXTStep Objects


Developing interfaces for multiple platforms and resolutions


General iPhone and iPad development patterns and philosophies


Service Oriented Architecture concepts


Course Description . Participants in this hands-on course will learn about and gain practice developing iOS applications for iPhone and iPad devices. Attendees will learn all the basics needed for iOS development, from installation of the Xcode editor to the Apple approval process. The Objective-C language is presented and used in hands on exercises to learn how it interacts with the hardware systems.


In hands on exercises, students will use built-in data views as well as create custom screens for data entry and presentation. Students will learn to follow Apple's design recommendations to provide clean interfaces that appropriately size to various devices and screens.


The course includes coverage of scheduled background execution to allow code to be run when the app isn't active and to schedule alerts to draw attention back to the app.


Comprehensive hands on exercises are integrated throughout to reinforce learning and develop real competency. Students will create apps from the ground up, demonstrating the features of Objective-C and serving as an introduction to developing apps for release to the App Store.


Course Prerequisites . Prior programming experience in an object-oriented language such as Java, C# or C++.


iOS Programming for iPhone and iPad Applications Using Objective-C Course Overview:


Macintosh Orientation


Versions of iOS and Supported Devices


Overview of the New OS X


Command Line Interaction


Apple Approval Process


Objective-C


Fundamental Syntax


Object Oriented Programming Support


Using Dynamic Binding


Using ARC


Writing Code for Hardware Interaction


Data Types and Structs


Flow Control


Pointers, Heap and Stack


Xcode IDE Installation and Use


Installing and Updating Xcode


Code Development and Tracking


Debugging Utilities


Application Navigation Tools


NeXTStep Object Support


Using the NeXTStep Data Types


NSDate, NSPoint, NSSize, NSString


Using the NeXTStep Collection Objects


NSSet and NSMutableSet


NSArray and NSMutableArray


NSDictionary and NSMutableDictionary


MVC Architecture


Model-View-Controller Development Paradigm


Application Design Process


System Event Handling


Recognizing Apps Moving to Background


Detecting and Solving Low Memory Events


Handling Custom Events and Exceptions


SOA Application Design Overview


Service Oriented Architecture


Web Services Overview


Apple Push Notification Service (APNs)


Threading Support


Creating Threads


Using Threads for Asynchronous Processing


Dynamic Typing


Understanding the id Data Type


Analyzing Objects for Type Safety


Testing Objects for Function Support


Basic Design Patterns Used in iOS


Singleton Pattern


Lazy Instantiation


Protocol/Delegate Patterns


Custom View Design and Layout


Designing Views


Apple's UI Design Standards


Utilizing Controls


Custom View Transitions and Animations


Views and View Controllers


Using Generic Views and View Controllers


Using Specific Purpose Views


Text View


Web View


Map View


Table and Table Cell View


Blocks


Purpose and Syntax of Blocks


Block Animation Methods


Developing Multithreaded Blocks


"The course was extremely well run. This is one of the few courses I've ever taken where the workshops and exercises reinforced all of the material covered. I will be able to put this knowledge to immediate use at work." – J. B. Harvard


"Exceeded my expectations. This class was so much more than just going through the motions. Lab time was structured in such a way to give me time to think. The class was structured to fit my learning style which is 'learn by example'." – S. B. DST Systems


iPad® and iPhone® are trademarks of Apple Inc. registered in the U. S. and other countries.


Multiple Training Locations - Convenience and Cost Control


Attend Regularly Scheduled Courses in More than 100 Cities Across North America and the United Kingdom or via Remote Attendance


The Best Way to Learn Objective-C


I’m not going to lie to you…if your first experience learning to code is in developing for iOS. then Objective-C is going to give you some problems. It’s not that the logic is difficult, or that you won’t be able to grind your way through it, but, and I say this as someone that is self-taught, the syntax in Objective-C is one of the most difficult I’ve ever encountered.


On top of that, learning to navigate Xcode is no small task, and until you learn to navigate the menus, build settings, and understand the difference between debugging and distribution, then you’re going to find an even steeper learning curve than possible.


Don’t Quit


The first key to learning iOS development is to get past the point where you feel like quitting. Hell, it’s the same with any new skill – you’ll go through an excitement phase, followed by a brick wall that gets you wondering why you began learning in the first place. But if you can get past this part, and into the real learning, then you’ll be on easy street.


Learn Other Languages


So here’s my solution to getting past the pain and into the learning – learn other languages.


When I began learning Objective-C, I was also studying HTML, CSS, Ruby on Rails. and PHP. On their own, each one seemed difficult to master, but after I went back to them from Objective-C, they really started to make a lot of sense.


While HTML and CSS won’t help you with programming logic, they will help you learn to understand and recognize syntax. From there, moving into a web language like Ruby or PHP will teach you to start thinking in terms of logic, which is probably the hardest part of learning to program for iOS.


When you realize that a game isn’t just a picture with moving images, but a group of layers, each with views and animation logic, then you’ll start to go from feeling like a noob, to feeling like Neo right before he kicks the shit out of Agent Smith.


Understanding Variables, Arrays, and Selection Statements


In Objective-C, you’ll need to learn things like pointers, and if/else statements, but they won’t make sense when masked by a bunch of syntax and crazy looking asterisks and brackets. In Javascript, PHP, or Ruby, you’ll have a much easier time picking them up because the flow is easier to pick up and understand.


Better yet, if you have a WordPress installation lying around, you can easily create a test site and start playing with PHP, learning by breaking, rather than building from scratch.


From here, even if you learn just a little bit at a time, you’ll start having more and more of those “aha!” moments, which will increase your confidence and programming aptitude.


So if you want to learn how to program for the iPhone, go out and grab Xcode and a good guide or two, and then start digging into other programming languages simultaneously, learning what you can, when you can. It’s going to take time, but if you can pick up some confidence on the way, then your new skills will be much more likely to stick.


Great Programming Resources


Totally agree… I started programming 2 years back. and I had almost no understanding of anything. In school I learned C but this was already longer time ago… I tried to start with objective c but I fail at the beginning… So I started with lua and Corona SDK to create my first iOS app… after this I got adictive to programming and started web dev –> HTML5 was on the line… but after HTML5 I got adictive to speed so i come back to objective c and since 2 months ago I can use it…


My tip for newcommer’s: Dont get to much into the whole API stuff (its overhelming) learn the foundation API and than move forward to the api you need to use… if you want to create a game search for a easy to use engine like sparrow framework.


Best to way to learn is to think about an project and do it but I also recommend you to learn first some scripting language if no pre knowledge is available…


Dont listen to folks who want to tell you learn c first and than you can go to objective c…


thanks a lott ….very useful in kickstarting my learning


I am trying to understand this but it’s hard:(


http://virtuousgiant. com Nathan Hangen


It’s tough, because you have to learn the SDK at the same time. But keep working at it, and start small if you have to.


One of the things that I found very useful was reading other people’s code, even hiring others to write simple programs that I could study.


http://www. facebook. com/christopherj. roura Christopher J Roura


i am trying to learn objective c and java. any recommendations on books to get of videos for lessons?


http://virtuousgiant. com Nathan Hangen


I took two quarters of C++ and hated the environment. There was too much pressure to complete assignments I had no idea how to do and the teacher barely spoke English. Most of what I learned was from collaborating with another student and YouTube.


I hope to take a stab at Objective-C this summer now that I have too much time on my hands. Running X-Code in a VM as I don’t have access to a Mac. Any suggestions on books or a video tutorial series? I am going to see if my local Barnes and Noble has the Big Nerd book.


http://virtuousgiant. com Nathan Hangen


I’ve purchased every book and course we’ve recommended here, but after a while got tired of reading and preferred to just dig in. If you’re just getting started though, I think the Big Nerd book is a great one. I bought it for Kindle and find it very valuable.


How would you suggest ‘digging in’?


Yes That is what I think also I am in university right now and I took introduction to C programming and the teachers are going so fast so i decided to just work on assignments and get the grade even though I didnt understand while teaching my self C on my own pace and speed and getting comfortable with each important parts I am enjoying it. I think the teachers want to make us hate programming that is why so many people drop out


I can attest to that. I just began studying the language myself. Coming from website development, syntax and structure makes a lot of sense regardless of the fact that it’s not just C but OO programming. I can tell you that it is certainly difficult. Very few people I can honestly say are capable of teaching obj-c even some of the best don’t do it a 100% well. I don’t want to give up, I’ve been at it now for two months straight but I hit a brick wall and I don’t know if I’ll get over it. Memory management, ARC…..the self method….man those are some abstract and complicated topics right there. ….I wish there was a one stop place to learn all of this. Objective-C is rather convoluted with apple’s contribution to the language all of these years. It’s like they never really had a solid foundation so instead they just kept adding. Swift will be a lot better buttttt you still need to learn obj-c as that’s what it’s built off of. Anways, we’ll see if I keep going.


Transitioning to Xamarin from Objective-C


By Mike Bluestein August 14, 2017 Xamarin Platform


Objective-C developers coming to Xamarin can take advantage of the Xamarin. iOS platform to create reusable C# code that can be shared with Xamarin. Android, Xamarin. Mac and various Windows platforms. However, you need not throw away all the investments you have made in Objective-C. Xamarin offers a technology called bindings that let you reuse Objective-C libraries within a Xamarin. iOS application. Additionally, Objective-C developers are often surprised to learn that C# isn’t as far from Objective-C as they think it is, while at the same time discovering all the great language features C# has to offer.


To make the transition to Xamarin. iOS and C# smoother, we’ve created a new Xamarin for Objective-C Developers section in our developer center to serve as a starting point for Objective-C developers to learn about Xamarin.


In it, you’ll find a C# Primer for Objective-C Developers that compares and contrasts several language features between Objective-C and C#. Also, we’ve created a new iOS Binding Walkthrough that shows step-by-step how to make an existing, open-source Objective-C library, InfColorPicker, available to C# via bindings.


We also have other documents that include detailed information on Xamarin. iOS binding technology as well as a wealth of information that includes our guidance for building cross-platform applications.


We hope you find this information makes it easier to get started with Xamarin. iOS when coming from Objective-C.


Written on August 14, 2017 by Mike Bluestein


Keep reading


Performing Background Data Refresh for Android


How To Display a Camera In Your iOS Apps


App Theming with Xamarin. Forms Control Templates


Beginning Objective-C for the C# Guy


So my new language of the year is going to be Objective-C and Cocoa/CocoaTouch. This is actually a new language and a new IDE and a new platform and, well, everything. I’ve decided to document much of what I’m doing along the way. As you know I switched my main platform to Mac last year and have been doing my. Net development in a Virtual Machine. This has been great, working out extremely well, but part of what I wanted the Mac for was to branch out and explore some different ways of writing applications. Studying a new language is a great way to get a different view of how to accomplish programming tasks, and seeing how things are done on other platforms can only increase your skills as an application developer.


So with this post I wanted to go over some basics, compare some things in. Net to Objective-C, and kind of give a quickstart.


Environment Basics


Some housekeeping terminology. XCode is the IDE you use out of the box to develop mac applications. It’s a full-featured IDE that comes installed on your mac. In some senses it’s not nearly as mature as visual studio, and I find myself missing vs and particularly Resharper, however, you also don’t have to pay $2k for your dev tools, so, worth the tradeoff. Objective-C (ObjC) is the standard language of choice for developing Mac applications. However it’s not the only one. There is support for Java and Ruby in Cocoa and, of course, OSX being a *nix system, you can write programs for it in any language really. But for the purposes of talking about Cocoa/Mac dev, we’re talking mostly about ObjC.


Cocoa (and CocoaTouch) is your Mac development equivalent to the. NET framework basically. It provides a lot of framework base for mac development as well as the stuff that supports GUI hotness. CocoaTouch is Cocoa for iPhone/iPod Touch environments, with some differences in what it has and what is supported.


Objective-C Basic Information


Objective-C is a “strict superset” of C. This means that all valid C code is valid Objective-C code. Objective-C is an OO language. The Objective-C OO is more like SmallTalk OO than the C++ style OO you are used to. In Objective-C you talk to objects with messages rather than calling methods. For instance the Objective-C code:


Is essentially the equivalent of the following C# code:


So basically the method calls you are used to in C# turn into message passes in the [] brackets.


The interesting thing about the messages is that you can send messages to an object that may not actually handle them. This is a dynamic typing feature borrowed from Smalltalk. You can choose to handle the message, or forward it on, but if you don’t do something with it you will get a runtime, not compile error. (xcode will give you a compile warning though to protect you from yourself a little.)


Some structural differences that might trip you up: if you have ever done any c/c++ you will be familiar with the practice of separating declaration from implementation on classes and methods and such. This is a luxury that is easy to overlook in C#, where you don’t have to do that. So in Objective-C you have to do that, but the thing you may trip up on is that the declaration of a class is called an “interface”. This is different from what you think of as an interface in C#. In Objective-C the “interface” is the signature of the class being implemented. If you want a C#-style interface that let’s you do composition over inheritance, you are looking for a “protocol” in Objective-C.


Declaring and Implementing a class in Objective-C:


Another thing you may be noticing looking at the code above is the slightly odd method signature. Let’s break it down. The – (minus) means “instance method”. A + would mean class method. Class methods in Objective-C are like statics in c# but they’re inheritance-friendly and can be overridden. (void) is your return type, just like C# but with parens. Then there’s the method name, then after the colon you have the parameters. You add more parameters by adding more colons:


One thing you aren’t noticing is a visibility modifier. As far as I can tell, there’s no such thing as a private class method. You can do some tricks to hide it from the compiler, but because the class methods are really just there to respond to messages the object receives, if you send a message called the same thing as a class method it will get handled.


Unit Tests


If you’re at all like me, hooking up tests is pretty second nature for you in c# now. Being able to write tests to verify my code helps me learn new things in new languages. The testing story is interesting in xcode, especially if you are used to any of the standard test runners and frameworks in. net.


XCode 3.1 comes bundled with a unit testing framework called OCUnit. OCUnit was a third-party open-source project that Apple got behind and took over responsibility for. (wait you mean the vendor doesn’t *have* to write their own test framework?) The mechanics of testing in xcode are a bit obtuse at first. I went here to figure out how to actually set up a testing system, and being totally new to the environment, it took me a while. But follow the steps and you’ll get there.


One thing to note is that there is no concept of a “test runner” like you have with tdd. net or resharper or mstest. In XCode, to do tests, you set up a new build target that understands that it will be running tests. Then tests run as part of your build. Eso es. You build, it runs tests. All of them as far as I can tell. If a test fails, you get a build error. At first this feels like a much lamer experience than say the R# test runner, but on the positive side there’s no skipping tests and you do get the error inline with the code window. Either way, it takes some getting used to. As a side note, my homesickness for R# really kicks in as my “tdd workflow” in ObjC is clunky and very slow right now.


Your tests in OCUnit are a convention-based thing, unlike a metadata (attribute) thing in. net. Your test methods must be void and must start with “test”. You also get a setup and teardown. This is a test fixture I wrote for doing the first Project Euler problem. It’s not really my typical style (I haven’t bothered trying to get a BDD flow going yet) but it shows the basics:


No other ceremony required other than the naming. In the declaration of the test fixture you just inherit from SenTestCase and go.


So, to close this one out, I’m having a lot of fun learning this new environment. And it is interesting to care about memory management and performance again (very important for iPhone dev). And it’s interesting to think about OO in a different way. If you haven’t chosen a new language for the year, and you have the ability to try it, I’d say give ObjC/Cocoa a shot. Now is as good a time as any to learn Mac/iPhone dev, market share is going up and the AppStore is kicking. Plus maybe you’ll learn a little something from a development community that values user experience at a very high level which, let’s face it, is not a priority in the Microsoft ecosystem. Trying new things and delving into new communities can only be good for your career in a down economy as well, so what are you waiting for?


Artículos relacionados:


Post Footer automatically generated by Add Post Footer Plugin for wordpress.


Hi Scott, I’m also learning to crawl in ObjC and your post (and comments) already taught me a few things. I think your example of a method ( myTypeInstanceMethodWith3ParamsFirst ) is invalid b/c the first parameter in a method is introduced by the method/message name and then there’s an introduction for each parameter. You actually had 4 parameters there, but it would still be syntactically incorrect. Maybe something like: -(void) myTypeInstanceMethodWith3ParamsFirst:(int)intParam1 withParam2:(int)intParam2 withParam3:(int)intParam3;


@Sergio actually I’m pretty sure it works both ways. The example you give is named params, but you can do it without (which is what I’ve been doing as the named params feel clunky to me yet.)


Transitioning From Objective C to Swift in 4 Steps – Without Rewriting The Existing Code


We started developing Skyscanner TravelPro in Objective C in March 2017. A couple of months later, when Swift 2.0 was released, we started to slowly introduce Swift. Fast forward to 8 months later – and 100% of the new code we write is in Swift . All without having rewritten any of our existing, working, robust and tested Objective C code – there would have been little point in doing so.


There are many resources talking about how to decide whether to use Swift for a new project or not, and best practices for writing Swift. However if you’re working on a pretty large Objective C codebase, you will probably find this article useful. If not – one day you might bump into a codebase where you want to start using Swift: this article presents some advice on how to get started doing so.


Here’s a visual representation of how our codebase has changed in 10 months. Since November 2017 all new code is written in Swift, which now makes up about 10% of our 65,000 line codebase – and growing.


So what was our approach when going from Objective C to Swift?


1. Start with a Simple Component


We decided to start as simple as we could: with some isolated classes that could be tested and used by themselves. The first few components we chose were simple UI controls, utility functions and extension methods on existing classes.


For example among the first Swift additions we added in, we wrote a String extension method that made localizing strings much more pleasant to read:


Interesting enough we could have implemented the same functionality using Objective C categories. However it never occurred to the team to use anything other then the good old NSLocalizedString(@"MyText", @""). With a new language, lots of new ideas surface. So from day one all our Swift strings are written in the pleasant "MyText".localized format.


2. Using Existing Objective C Code From Swift


After writing a couple of standalone Swift components – and unit tests against them – we moved on to using our existing Objective C classes from Swift. Things started to get real .


To use any Objective C classes from Swift you need to define a Swift bridging header. This is a. h file where you define all your Objective C headers to “expose” for Swift to use. On top of the header itself, the build settings need to be changed for the compiler to pick this up. Once this is done, these Objective C classes are imported into the Swift world, and can be used easily.


When using Objective C classes from Swift, you will likely notice warnings saying pointer is missing a nullability type specifier. When Objective C code imported into Swift then the compiler checks for nullability compatibility – and if it doesn’t find any information on nullability, then issues this warning. It does this check because in Swift nullability information is always explicitly declared, either with non nullable types or by using optionals .


The only changes we needed to make to our Objective C code was adding nullability information to the header to resolve the warnings issued by the compiler. To do so, we used the new nullable and nonnull annotations. The refactor itself only took a couple of hours, because we only had to change the classes we used in Swift, no more than a couple hundred lines. However, making this change made us think long and hard on what could, or could not be nil in our existing codebase. In Objective C it was easy enough to brush this under the table, but we couldn’t avoid an explicit choice when exposing this code to Swift.


For the most part this refactor involved changing lines of code like this:


The Swift test code is visibly more verbose then the Objective version. However, the explicit dependency injection pattern forced us to decouple our code as much as we could. Before migrating to Swift, we thought that our Objective C code was pretty decoupled. After writing a couple of weeks of Swift code, the difference between the ‘old’ and ‘new’ code was pretty stark though! Moving to Swift – and testing our code properly – made our codebase more loosely coupled then before.


Dive Deep in the Good Parts


After getting the hang of dependency injection and writing our own mocks, we got much deeper into Swift, and started to pick up some really neat techniques. In the previous example IВ illustrated how to re-create the OCMPartialMock functionality from Objective C. A cleaner approach would be to use pure mocks instead of partial mocks. In Swift a better way to write loosely coupled code is using protocols, and protocol oriented programming techniques. We picked up this really quickly and our code became more loosely coupled and more testable.


Then there’s some new language features like the guard and defer. generics. error handling with do-catch. nested types. the where clause and the @testable keyword В –В andВ and this is only touching the surface. Even though Swift is easy to get started with, there is plenty of depth to the language.


Apart from learning a new language, what else did we get out of moving over to Swift?


self. addConstraint ( NSLayoutConstraint ( item. myButton.


В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В attribute. CenterX.


В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В relatedBy. Equal.


В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В toItem. myView.


В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В attribute. CenterX.


В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В multiplier. 1.0.


В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В constant. 0.0 ) )


Stricter compile time checks compared to Objective C. Apart from type safety and the compile time benefits with this, the Swift compiler does additional checks like not allowing single line if statements or enforcing exhaustive switch statements


No more header files – and no more and copying method declarations between. h and. m files


& # 8230; and of course the thrill of learning and using new language features!


On the disadvantages side: there seem to be surprisingly few. One important one is that some of our third party dependencies building on the dynamic nature of Objective C like JSONModel aren’t and won’t be available in Swift. And the other big one is that now need to maintain our existing Objective C code, which means additional context switching – and motivation to continuously transform more of our Objective C code to Swift.


Of course Swift is still a new language that is heavily under development, В with breaking changes coming late 2017. Despite all that, В our team agrees that moving our Objective C to Swift project has been aВ great success. It resulted in cleaner architecture, easier to read code and more productivity then if we’d have stayed all Objective C. More importantly: byВ undertaking a gradual change and not rewriting our ‘old’ code, shifting from Objective C to Swift has not slown us downВ one bit.


[Note: we’re also hiring engineers in London, Barcelona and Budapest to work with our team and myself. pushing the boundaries of Swift and Cocoa further.]


Great article! One thing: in the nullability example you don’t need the _Nullable annotation, because you already have nullable.


It has been said that software developers can expand their skills by learning a new computer language a year. The similarity of languages I have encountered up to this point led me to doubt whether this was so. Estaba equivocado.


In my quest to create the ultimate iPhone application, I’ve had to learn not only a new platform but a whole new computer language, “Objective C”. My “native” computer language is C, so imagine my consternation when found how different Objective C appears from C Sharp and C++.


So far there doesn’t seem to be any direct comparison between. net languages and Objective C, so I thought I’d post a small article on the subject. I have decided to use VB. Net as the basis of comparison, but I’m sure C Sharp developers can understand the concepts. This article is based on the fine Wikipedia introduction to Objective C. I encourage you to take a look at this.


Method Invocation and Method Passing


To invoke a method on an Objective C object, we “pass a message”. This differs from VB. Net in that a method must exist in order to invoke it.


Declaration of classes, by convention are done in two seperate files, a “.h” header file containing an interface declaration and a “.m” (method implementation) containing the actual class code.


@interface HelloWorld. objeto


To use this class:


HelloWorld * myhello = [[HelloWorld alloc] init];


A rough VB. Net equivalent might be:


Public Class HelloWorld


Public Sub Hello


Dim myhello As New HelloWorld


A big difference between these examples, is that in the Objective C case, the hello method does NOT have to be implemented at all. It’s only responding to a “message” that the class may or may not have an implementation for.


Admittedly this does produce a compiler warning “warning:’HelloWorld’ may not respond to ‘-hello'”, but it still compiles.


A better VB. Net equivalent may be the use of reflection to check for the existence of a method prior to invocation:


Dim myhello As New HelloWorld


If myHello. GetType. GetPropInfo(“Hello”) IsNot Nothing Then myHello. hello


Another way would be to treat the object as an “object”. Por ejemplo:


Dim myhello As New HelloWorld


That’s probably missing the point however, because it effectively causes an error at runtime, whereas ObjectiveC does not produce an error.


Another possible VB. Net equivalent could be using Events. Are these equivalent to messages?


Public Class HelloWorld


Private WithEvents moHelloWorldEventSource As HelloWorldEvents


Public Sub New(eventSource As HelloWorldEvents)


Private Sub Hello Handles moHelloWorldEventSource. Hello


Public Class HelloWorldEventSource


Public Event Hello


Public Sub Hello


To invoke this masterpiece:


Dim helloEvents As New HelloWorldEventSource


Dim myhello As New HelloWorld(helloEvents)


Another capability of Objective C is to pass an unhandled method invocation to another object. VB. Net does not seem to have an equivalent of this.


Protocols introduce the multiple inheritance of specification, but not implementation through the introduction of “protocols”.


Our Objective C hello world class could implement a prototcol:


@interface HelloWorld. Object <DescribeDialect>


I get the impression that although HelloWorld declares it implements the DescribeDialect protocol, I’m not sure if it really has to implement each of the methods. I’m guessing it should.


The vb. net equivalent is quite direct:


Public Interface DescribeDialect


Public Class HelloWorld


The only element of confusion here is the use of the word “interface” between the languages. I suppose knowing “protocol” exists helps with this.


A programming language is said to be dynamically typed when the majority of it’s type checking is performed at runtime as opposed to compile time.


The previously described “optional” implementation of a passed message allows for increased flexibility. See “Forwarding” for more information.


Static typing information may also be added to variables. The information is then checked at compile time.


& # 8211; setMyValue:(id) foo;


& # 8211; setMyValue:(id <aProtocol>) foo;


The vb equivalent appears to be declarations with multiple signatures, like this:


Public Sub setMyValue(foo As object)


Public Sub setMyValue(foo As DescribeDialect)


Public Sub setMyValue(foo As String)


Post Java 1.5 and the. net languages also support “generics”. I am unsure at this stage if Objective C supports this or not.


Since Objective-C permits the sending of a message to an object which might not respond to it, the object has a number of things it can do with the message. One of these things could be to forward the message on to an object which can respond to it. Forwarding can be used to implement certain design patterns, such as the Observer pattern or the Proxy pattern very simply.


There is no direct VB. Net equivalent of this behaviour. See the wikipedia article for more information.


In VB. Net 9, a new feature called “Extension Methods” allowed the creation of extra methods on sealed classes. Objective C’s “categories” are a similar way of creating groupings of methods in separate files that allow the extension of a base class at runtime.


If we wanted to extend the HelloWorld class above to have an extra Goodbye method, in Objective C we could write:


@interface HelloWorldDisplay (HelloWorld)


& # 8211; (id) goodbye;


I don’t believe either of these equivalents support Objective C’s ability to override the base implementation.


Class Posing is an Objective C feature that allows messages sent to the target class to be wholy replaced by calls to a substitute class with the same implementation.


A class may only pose as one of its direct or indirect superclasses


The posing class must not define any new instance variables which are absent from the target class (though it may define or override methods).


The target class may not have received any messages prior to the posing.


Posing, similarly to categories, allows globally augmenting existing classes. Posing permits two features absent from categories:


A posing class can call overridden methods through super, thus incorporating the implementation of the target class.


A posing class can override methods defined in categories.


Here’s an example:


@interface CustomNSApplication. NSApplication


& # 8211; (void) setMainMenu: (NSMenu*) menu


// do something with menu


class_poseAs ([CustomNSApplication class], [NSApplication class]);


There is no direct VB. Net equivalent of this functionality. Similar constructs may be created by implementing a singleton pattern combined with an interface.


It appears that this feature has been “depreciated” in MacOS 10.5 and onward, so I wont dedicate discuss it any further.


The #import directive is similar to the #include directive in C, except it only includes a nested file once. In VB. Net files in the same “project” are automatically included together in this way.


If the developer decides to structure their code with namespaces, the VB. Net “Imports” keyword allows inclusion of namespaced classes without having to prefix the namespace path.


And so ends our brief comparison of the two languages. If you’re after a comparative critique, I am sorry to disappoint you. Each language has it’s strengths and weaknesses. At the moment I’m not qualified to comment either way.


If you found this useful, feel free to leave a comment.


Campo de golf


Assume the first order IIR Filter:


$ y[n] = \alpha x[n] + (1 - \alpha) y[n - 1] $


How can I choose the parameter $ \alpha $ s. t. the IIR approximates as good as possible the FIR which is the arithmetic mean of the last $ k $ samples:


Where $ n \in [k, \infty) $, meaning the input for the IIR might be longer than $ k $ and yet I'd like to have the best approximation of the mean of last $ k $ inputs.


I know the IIR has infinite impulse response, hence I'm looking for the best approximation. I'd be happy for analytic solution whether it is for $ _ $ or $ _ $.


How could this optimization problems can be solved given only 1st order IIR.


asked Oct 6 '11 at 13:15


Does it have to follow $ y[n] = \alpha x[n] + (1 - \alpha) y[n - 1] $ precisely]? & Ndash; Phonon Oct 6 '11 at 13:32


This is bound to become a very poor approximation. Can't you afford anything more than a first-order IIR? & Ndash; leftaroundabout Oct 6 '11 at 13:42


You might want to edit your question so that you don't use $y[n]$ to mean two different things, e. g. the second displayed equation could read $z[n] = \frac x[n] + \cdots + \frac x[n-k+1]$, and you might want to say what exactly is your criterion of "as good as possible" p. ej. do you want $\vert y[n] - z[n]\vert$ to be as small as possible for all $n$, or $\vert y[n] - z[n]\vert^2$ to be as small as possible for all $n$. & Ndash; Dilip Sarwate Oct 6 '11 at 13:45


@niaren I know this is an old post so if you can remember: how is your function 'f' derived? I've coded a similar thing but using the complex transfer functions for FIR (H1) and IIR (H2) and then doing sum(abs(H1 - H2)**2). I've compared this with your sum(fj), but get different resulting outputs. Thought I would ask before ploughing through the math. & Ndash; Dom Jun 7 '13 at 13:47


There's a nice discussion of this problem in Embedded Signal Processing with the Micro Signal Architecture. roughly between pages 63 and 69. On page 63. it includes a derivation of the exact recursive moving average filter (which niaren gave in his answer ),


For convenience with respect to the following discussion, it corresponds to the following difference equation:


The approximation which puts the filter into the form you specified requires assuming that $x_ \approx y_ $, because (and I quote from pg. 68 ) "$y_ $ is the average of $x_n$ samples". That approximation allows us to simplify the preceding difference equation as follows:


Setting $\alpha = >$, we arrive at your original form, $y_ = \alpha x_n + (1-\alpha)y_ $, which shows that the coefficient you want (with respect to this approximation) is exactly $1\over $ (where $N$ is the number of samples).


Is this approximation the "best" in some respect? It's certainly elegant. Here's how the magnitude response compares [at 44.1kHz] for N = 3, and as N increases to 10 (approximation in blue):


As Peter's answer suggests, approximating an FIR filter with a recursive filter can be problematic under a least squares norm. An extensive discussion of how to solve this problem in general can be found in JOS's thesis, Techniques for Digital Filter Design and System Identification with Application to the Violin. He advocates the use of the Hankel Norm, but in cases where the phase response doesn't matter, he also covers Kopec's Method, which might work well in this case (and uses an $L^2$ norm). A broad overview of the techniques in the thesis can be found here. They may yield other interesting approximations.


answered Oct 7 '11 at 21:37


Objective-C


Visión de conjunto


Objective-C is an object-oriented extension to the C language. It is C with a small number of extensions.


Although the differences can fade into shades of grey, Objective-C is different from C++. C++ is traditionally associated with the Simula 67 school of object-oriented programming where Objective-C has SmallTalk roots. In C++, the static type of an object determines whether it can receive a message. In Objective-C the dynamic type of an object determines whether it can receive a message. The Simula 67 format is more structured and allows problems to be detected earlier when a program is compiled. The Smalltalk approach delays it's typing until runtime and is touted as a more flexible alternative.


This flexibility extends the language into three separate areas: Dynamic Typing, Dynamic Binding and Dynamic Loading.


Dynamic Typing


As opposed to other languages, Objective-C delays the typing of language objects until a program is executed at run time. The method name, type and argument information as well as class variable instance information are available to provide the essential support for Dynamic Binding. This might by likened to the System Object Modules (SOM) and it's Interface Definition Language (IDL) that Apple has been using for it's more recent object-oriented system additions.


Dynamic Binding


Methods and classes may be added or deleted at run time. The resulting list of objects are bound together during run time using the Dynamic Typing information. This provides the flexibility to develop programs in pieces using stepwise refinement to create an initial version of a program and then later during the maintenance phases of a programs life to incrementally change the components of a program.


Dynamic Loading


Finally, program segments are not loaded into memory until they are actually used thereby minimizing the system resources required for an instance of a program. In Objective-C all of this is bound into the language and it's run time. Objective-C is possibly one of the best blends of traditional system programming language features and object-oriented programming features.


Historia


Objective-C was developed by Brad J. Cox to add object-oriented SmallTalk-80 based extensions to the C language. A GNU version was written by Dennis Gladding in 1992 and the second version soon thereafter by Richard Stallman. The current GNU version is derived from the version written by Kresten Thorup when he was a university student in Denmark in 1993. Kresten transported that version to NeXT when he joined the firm later that same year.


Objective-C Components


Objective-C is organized as a series of object-oriented additions to the C language. It is important to remember that it is the ANSI C language at its core. In a typical Objective-C program, segments of traditional C are organized into strips of code and associated data which are executed under tightly constrained conditions. This new framework for C has a well defined family of components that must be understood for the overall program to make sense. The members of the Objective-C family are:


Objects Objects associate data and operations. Objects are the root of the Objective-C family tree.


Methods Methods are the operations that Objective-C applies to data.


Messages Messages are the way one instance of a method requests another method to perform and operation. For example [myrect display] asks the myrect method to perform the display operation.


Classes Classses are how objects are defined. Classes contain the prototype object variables and methods. Classes inherit variables and methods from a higher level class called a super-class. A class that inherits some or all of the methods and variables is a sub-class. In Objective-C all classes are a sub-class of a primal super-class called Object.


Protocols Protocols are ways to inherit part of a super-class or to extend a super-class.


Categories Categories are ways to declare Methods that can be implemented by any class.


Remote Messages Remote Messages support the distribution of objects into different threads of execution and across different computers. Remote Messages are the heart of distributed application progressing.


Multi-tiered distributed applications are one of the hallmark features of the OpenStep architecture.


Persistance Objects and their data can be allowed to persist after the creating instance of an object has completed it's execution. This is an important and advanced feature of the OpenStep system.


In traditional programming languages a function is called to perform an operation on a data object. In Objective-C and other object-oriented languages, a message is sent to an object asking it to perform one of its methods on itself.


A Practical Analogy


Many file systems are organized into standard primitive operations such as:


Open - open or create a file


Close - close a file


Read - read data from a file


Write - write data to a file


Ioctl - perform file system specific operations


The Open call usually returns some sort of identifier that is used in subsequent Read, Write and Ioctl operations. The identifier is valid until a Close call is made. In an object-oriented environment, the class might be named FileSystem, the methods would be Open, Close, Read, Write and Ioctl. The object would be the file identifier that is returned by the Open call and binds all subsequent calls to a single body of file information.


Objective-C Example


This example is also take from Gerrit Huizenga's course notes from an object-oriented language course taught at Purdue University. The URL for the course notes and other reference information are contained later in the reference section.


In Objective-C program segments are defined by an interface and an implementation . These are by convention separated into two files. The interface file is named with a '.h ' extension and the implementation file is named with a '.m ' extension.


Interface Definition


In Objective-C the interface to a class is defined using the @interface and @end pair of language statements.


@interface Stack. Objeto


Defines the Stack class as a subclass of the Object super-class. This declaration is followed by the instance variables used to implement the object. Each instance of a class has it's own copy of these variables.


Defines the Stack class with instance variables top and size;


Following this definition is a list of the names of the methods that implement this class.


Defines free, push, pop and size methods for the Stack class. The declaration is terminated with an @end statement. Method names contain a colon to separate the name of a method from its arguments. A colon is also used to separate arguments. Por ejemplo:


Defines the push method with integer arguments first and second. The precise name of the method is push:and: . Any parameter type used in C language function parameter "typecast" notation is valid in method definitions. The return type of a method is also specified using typecast notation. If no return type is specified, then the method is assumed to return a pointer to an object.


At first glance the alloc method would naturally be another method that might be included with the Stack class. We will see below that every class has a means to create an instance or allocate itself.


is the completed interface definition for the Stack class. It is stored, by convention in the file Stack. h.


Implementación


The second component of a class definition is the implementation . Like the interface definition Objective-C uses paired sets of @implementation and @end statements to deliniate an implementation:


Defines the Stack implementation. By convention the implementation of a class is stored in a file the ends with a '.m ' suffix. In this case the file would be named Stack. m.


The implementation defines methods new, free, push, pop and size.


Super-class References


Bracketed statements such as [super new] and [ super free ] refer to the super-class methods new and free allowing them to process at particular points of the sub-class.


The Notion of Self


Self is a special variable which is a pointer to the object which received a message which invoked the currently executing method. It is a way to reference the receiver object of a message. Also remember that if a method does not specify the type of it's return value, the default is to return a pointer to an object. This means that barring any other sensible returns, methods should always return self. Doing this provides a means for super-class and sub-class implementations to share processing and return values.


Factory Objects


Objective-C automatically creates a factory object for each class. There is exactly one instance of a factory object at run time. The name of the factory object is the same as the name of the class. The principal use of a factory object is to provide a means to create instances of a class:


Factory methods are defined with a ' + ' instead of a ' - ' character.


Factory objects are not instances of a class and therefore do not have access to the instance variables. So factory objects typically redefine self before accessing instance variables.


Referencing a Class


Objective-C is ANSI C and additional abilities to define classes, create instances of objects and send messages to objects. Two fundamental types have been added to the language:


id - a pointer to an object


sel - a messages


Both variables of type id and sel are valid parameters that can be sent in messages or passed to a C function.


Messages are sent to a class with a SmallTalk-like syntax:


In the Objective-C implementation, methods access and modify instance variables to perform their operations. Methods perform all operations normally thought of in C. In addition, they have access to the full capabilities of Objective-C message passing with the notions of self, super-class, parameters and instance variables.


An object might send a message to self to accomplish parts of it's operation. Here is the stack:and: method implemented by using paired stack push operations and self:


Again notice that self is returned to facilitate super-class and sub-class integration.


References


Web


Online Objective-C home page http://www. slip. net/


Objective-C 2.0 Essentials


Purchase the full edition of this Objective-C book in Print ($14.99) or eBook ($12.99) format Objective-C 2.0 Essentials Print and eBook (ePub/PDF/Kindle) editions contain 31 chapters.


The Objective-C 2.0 Essentials online book contains 34 chapters of detailed information intended to provide everything necessary to gain proficiency as an Objective-C programmer for both Mac OS X and iPhone development.


Objective-C 2.0 Essentials - Second Edition


© 2012 Neil Smyth / Payload Media. This eBook is provided for personal use only. Unauthorized use, reproduction and/or distribution strictly prohibited. Todos los derechos reservados.


Tabla de contenido


Friday Q&A 2012-06-22: Objective-C Literals


¡Dar una buena acogida! After a brief hiatus for WWDC, it's time for another wacky adventure. Today's topic is the new object literals syntax being introduced into Objective-C, which was suggested by reader Frank McAuley.


Literals For anyone unfamiliar with the term in the context of programming languages, a "literal" refers to any value which can be written out directly in source code. For example, 42 is a literal in C (and, of course, a lot of other languages). It's common to refer to what kind of value they produce, so 42 is an integer literal, "hello" is a string literal, and 'x' is a character literal.


Literals are a foundational building block of most programming languages, since there needs to be some way of writing constant values in code. They aren't strictly necessary, as you can construct any desired value at runtime, but they generally make code a lot nicer to write. For example, we can construct 42 without using any literals:


However, if we had to do this for every integer we used, we'd probably all give up computer programming and go into some profession where the tools don't hate us so much. Likewise, we could construct C strings by hand out of characters, but strings are used so commonly that the language has a concise way to write them.


Collections are pretty commonly used as well. C originally had no facilities for collection literals, but the ability to initialize variables of a compound data type came pretty close:


This isn't always entirely convenient, and so C99 added compound literals . which allow writing such things directly in code anywhere:


Collection literals are pretty common in other languages too. For example, the popular JSON serialization format is just a codification of JavaScript's literal syntax. This JSON code is also valid syntax to create an array of dictionaries in JavaScript, Python, and probably some other languages:


Until recently, Objective-C didn't have any syntax for Objective-C collections. The equivalent to the above was:


This is really verbose, to the extent that it's painful to type and obscures what's going on. The limitations of C variable argument passing also require a nil sentinel value at the end of each container creation call, which can fail in extremely odd ways when forgotten. All in all, not a good situation.


Container Literals The latest clang now has support for container literals in Objective-C. The syntax is similar to that of JSON and modern scripting languages, but with the traditional Objective-C @ thrown in. Our example array/dictionary looks like this:


There's definitely a bit of @ overload happening here, but it's a vast improvement over the previous state of things. The @[] syntax creates an array from the contents, which must all be objects. The @<> syntax creates a dictionary from the contents, which are written as key. value instead of the completely ludicrous value, key syntax found in the NSDictionary method.


Because it's built into the language, there's no need for a terminating nil. In fact, using nil anywhere in these literals will throw an error at runtime, since Cocoa collections refuse to contain nil. As always, use [NSNull null] to represent nil in collections.


There is no equivalent syntax for NSSet. The array literal syntax makes the job a bit nicer, since you can do something like [NSSet setWithArray: @[ contents ]]. but there's nothing quite like the concise literal syntax.


Everything you put into such an array or dictionary still has to be an object. You can't fill out an object array with numbers by writing @[ 1, 2, 3 ]. However, this is made much easier by the introduction of.


Boxed Expressions Boxed expressions essentially allow for literals corresponding to primitive types. The syntax is @(contents). which produces an object boxing the result of the expression within the parentheses.


The type of object depends on the type of the expression. Numeric types are converted to NSNumber objects. For example, @(3) produces an NSNumber containing 3. just like if you wrote [NSNumber numberWithInt: 3]. C strings are converted to NSString objects using the UTF-8 encoding, so @("stuff goes here") produces an NSString with those contents.


These can contain arbitrary expressions, not just constants, so they go beyond simple literals. For example, @(sqrt(2)) will produce an NSNumber containing the square root of 2. The expression @(getenv("FOO")) is equivalent to [NSString stringWithUTF8String: getenv("FOO")] .


As a shortcut, number literals can be boxed without using the parentheses. Rather than @(3). you can just write @3. Applied to strings, this gives us the familiar and ancient construct @"object string". Note that expressions do not work like this. @2+2 and @sqrt(2) will produce an error, and must be parenthesized as @(2+2) and @(sqrt(2)) .


Using this, we can easily create an object array containing numbers:


Once again, a bit of @ overload, but much nicer than the equivalent without the new syntax.


Note that boxed expressions only work for numeric types and char *. and don't work with other pointers or structures. You still have to resort to longhand to box up your NSRect s or SEL s.


Object Subscripting But wait, there's more! There's now concise syntax for fetching and setting the elements of an array and dictionary. This isn't strictly related to object literals, but arrived in clang at the same time, and continues the theme of making it easier to work with containers.


The familiar [] syntax for array access now works for NSArray objects as well:


It works for setting elements in mutable arrays as well:


Note, however, that it's not possible to add elements to an array this way, only replace existing elements. If the array index is beyond the end of the array, the array will not grow to match, and instead it throws an error.


It works the same for dictionaries, except the subscript is an object key instead of an index. Since dictionaries don't have any indexing restrictions, it also works for setting new entries:


As with literals, there is no equivalent notation for NSSet. probably because it doesn't make much sense to subscript sets.


Custom Subscripting Methods In a really cool move, the clang developers made the object subscripting operators completely generic. They're not actually tied into NSArray or NSDictionary in any way. They simply translate to simple methods which any class can implement.


There are four methods in total: one setter and one getter for integer subscripts, and one setter/getter for object subscripts. The integer subscript getter has this prototype:


You can then implement this to do whatever you want to support the semantics you want. The code simply gets translated mechanically:


Your code can fetch the index from an internal array, build a new object based on the index, log an error, abort(). start a game of pong, or whatever you want.


The corresponding setter has this prototype:


You get the index and the object that's being set there, and then you do whatever you need to do with them to implement the semantics you want. Again, this is just a simple mechanical translation:


The two methods for object subscripts are similar. Their prototypes are:


It's possible to implement all four methods on the same class. The compiler decides which one to call by examining the type of the subscript. Integer subscripts call the indexed variants, and objects call the keyed variants.


This is actually a small chunk of operator overloading now available in Objective-C, which traditionally has completely avoided it. As always, be careful with it to ensure that your custom implementations remain true to the spirit of the subscripting operator. Don't implement the subscripting syntax to append objects or send messages across the network. If you keep it restricted to fetching and getting elements of your object, the usage of the syntax remains consistent and you can more easily understand what code is doing without needing to know all the details.


Initializers C has an odd quirk in that any initializer of a global variable must be a compile-time constant. This includes simple expressions, but not function calls. For example, the following global variable declaration is legal:


But this is not:


C string literals are compile-time constants, so this is legal:


NSString literals are also compile-time constants, so the Cocoa equivalent is legal:


It's important to note that none of the new literal syntax qualifies as a compile-time constant. Assuming that the array is a global variable, the following is not legal:


This is because the @[] syntax literally translates into a call to an NSArray method. The compiler can't compute the result of that method at compile time, so it's not a legal initializer in this context.


It's interesting to explore exactly why this would be the case. The compiler lays out global variables in your binary, and they are loaded directly into memory. A global variable initialized with 2 + 2 results in a literal 4 being written into memory. A C string initializer results in the string contents being written out in the program's data, and then a pointer to those contents being written out as the global variable's value.


Note that C++, and therefore Objective-C++, does allow non-constant initializers for global variables. When the C++ compiler encounters such an expression, it packages into a function and arranges for that function to be called when the binary loads. Because the initializer code runs so early, it can be a bit dangerous to use, as other code like NSArray might not be ready to go yet. In any case, if you've seen a non-constant initializer compile and are wondering why, it was probably being compiled as C++.


NSString literals are also compile-time constants, because of a tight coupling between the compiler and the libraries. There's a special NSString subclass called NSConstantString with a fixed ivar layout:


It just contains an isa (inherited from NSObject ), a pointer to bytes, and a length. When such a literal is used as a global variable initializer, the compiler simply writes out the string contents, then writes out this simple object structure, and finally initializes the global variable with a pointer to that structure.


You may have noticed that you don't need to retain and release NSString literals like you do other objects (although it's still a good idea to do so just out of habit). In fact, you can release them as many times as you want and it won't do anything. This is because NSString literals aren't dynamically allocated like most Objective-C objects. Instead, they're allocated at compile time as a part of your binary, and live for the lifetime of your process.


This tight coupling has advantages, like producing legal global variable initializers, and requiring no extra code to run to build the object at runtime. However, there are big disadvantages as well. The NSConstantString layout is set forever. That class must be maintained with exactly that data layout, because that data layout is baked into thousands of third-party apps. If Apple changed the layout, those third-party apps would break, because they contain NSConstantString objects with the old layout.


If NSArray literals were compile-time constants, there would need to be a similar NSConstantArray class with a fixed layout that the compiler could generate, and that would have to be maintained separately from other NSArray implementations. Such code could not run on older OSes which didn't have this NSConstantArray class. The same problem exists for the other classes that the new literals can produce.


This is particularly interesting in the case of NSNumber literals. Lion introduced tagged pointers, which allow an NSNumber 's contents to be embedded directly in the pointer, eliminating the need for a separate dynamically-allocated object. If the compiler emitted tagged pointers, their format could never change, and compatibility with old OS releases would be lost. If the compiler emitted constant NSNumber objects, then NSNumber literals would be substantially different from other NSNumber s, with a possible significant performance hit.


Instead, the compiler simply emits calls into the framework, constructing the objects exactly like you would have done manually. This results in a bit of a runtime hit, but no worse than building them yourself without the new syntax, and makes for a much cleaner design.


Compatibility When can we start using this new syntax? Xcode 4.3.3 is the latest shipping version and does not yet include these additions. We can reasonably expect that the next release, presumably coming with Mountain Lion, will incorporate these changes in its version of clang.


For OS compatibility, the literals simply generate code that calls standard Cocoa initializers. The result is indistinguishable from writing the code by hand.


The story for subscripting is a bit more complex. These require new methods that don't exist in Cocoa at the moment. However, the subscripting methods map directly to existing NSArray and NSDictionary methods, so we can expect a compatibility shim to be made available along the lines of the ARCLite shim that allows using ARC on OSes that predate it.


Conclusion The new object literals and subscripting syntax in Objective-C can significantly reduce the verbosity of code that deals heavily with arrays and dictionaries. The syntax is similar to that found in common scripting languages, and makes code much easier to read and write, aside from a minor surplus of @ symbols.


That's it for today. Come back next time for another friendly exploration of the world of programming. Friday Q&A is as always driven by reader suggestions, so until then, if you have a topic that you'd like to see covered here, please send it in !


Did you enjoy this article? I'm selling a whole book full of them. It's available for iBooks and Kindle, plus a direct download in PDF and ePub format. It's also available in paper for the old-fashioned. Click here for more information .


Are you sure NSConstantString is still used by the runtime for string literals?


Also, the C++ initializers are ran after the ObjC runtime +load methods so if you're using NSArray it will probably be properly initialized when you're trying to make a literal. ¿No crees?


The compiler generates objects of class __NSCFConstantString by default now, although that can be changed with a flag. But of course NSConstantString still has to live forever, since older binaries reference it.


How about an article on how to create your own ObjC literal?


Mike, your detailed article and Objective-C insights are a sight to behold. You do the language and Cocoa community a great service exploring "under the hood" topics. ¡Gracias!


Eimantas: It's not possible to create your own literal syntax without hacking on the compiler, or possibly using the new C++11 stuff in conjunction with Objective-C++.


The subscripting compatibility shim is actually part of ARCLite. The __ARCLite__load function (which oddly enough is called by the objc runtime as if it were a +load method) takes care of dynamically adding the four subscript methods with class_addMethod. The implementations of these methods simply call the equivalent non-subscript methods. P. ej. the objectAtIndexedSubscript: method is implemented like this: id __arclite_objectAtIndexedSubscript(NSArray *self, SEL _cmd, NSUInteger idx) return [self objectAtIndex:idx]; >


Thank you very much for the nice article. It reminded me of a very similar syntax WebScript (a scripting version of Objective-C WebObjects once had) had, see Apple's documentation, http://developer. apple. com/legacy/mac/library/documentation/LegacyTechnologies/WebObjects/WebObjects_3.1/DevGuide/WebScript/CreatingObjects. html#REF65852


I never used WebScript or WebObjects to start with. I wonder how they were implemented.


As a note, the return types of - objectAtIndexedSubscript: and - objectForKeyedSubcript: do not have to be id. There probably aren't that many times where this will actually come in handy, but it's there if you want it.


Jordan: I suspect if you're using ARC and you make those methods return non-objects, you'll be burned quite badly.


Ken: Oops, yes, I take it back. I thought you could declare these to return any type you wanted, but it actually produces an error if it's not an Objective-C type. (You can pick something other than id. though, just like any other covariant override.)


(How embarrassing, considering I work on Clang!)


Good stuff, Mike. Out of interest, I created a 3-part series in adding my own literal, NSURL to Clang. http://aussiebloke. blogspot. com/2012/06/llvm-clang-hacking-part-1.html


NSSet is interesting. Would be easy to play with an experimental literal syntax for NSSet, like:


NSSet *theSet = @| @"one", @"two", @"three" |


Stuart: I dunno if that set syntax would work without significantly rewriting the Objective-C grammar, since the single bar is going to get eaten by the parser as part of the assignment-expression. Looks like a job for a digraph.


jamie: The Clang parser is a recursive descent parser, so this would work just fine as you have pretty fine-grained control. When the parser hits an @ symbol in an expression, Clang calls the Parser::ParseObjCAtExpression (https://github. com/llvm-mirror/clang/blob/4d3db4eb6caa49a7cdbfe1798728ce4b23cd0b53/lib/Parse/ParseObjc. cpp#L2019 ) you can simply add to the switch "if the next symbol following an @ is "|" start parsing an NSSet literal.


Stuart: I see. Are you sure I can't interest you in a nice unicode character pair? Seems like just the job for the black lenticular brackets :)


How about some emoji syntax?


(That probably won't show up for everybody. In fact, it doesn't show up for me.)


Regarding Stuart's syntax idea, I don't think it's workable. The problem is not the beginning, but the end, which results in ambiguity since | can be an operator or a set-end marker. Por ejemplo:


NSSet *pathological = @| 0 | -1 | -2;


Of course, this is ultimately invalid code, but you can't know that until well after the actual parsing. There are probably ways to come up with an ambiguous case that is valid, but I don't quite have the energy to figure it out.


Muy agradable. I was hoping they would add some shortcut for +stringWithFormat: too, like @("foo %d", 1). Oh bien.


Also, Xcode's auto-indentation is pretty weird:


self. navigationBar. titleTextAttributes = @ UITextAttributeFont: [UIFont systemFontOfSize:12.0], UITextAttributeTextColor: [UIColor colorWithWhite:0.5 alpha:1.0], UITextAttributeTextShadowColor: [UIColor clearColor], >;


I would expect it at least to look like:


self. navigationBar. titleTextAttributes = @ UITextAttributeFont: [UIFont systemFontOfSize:12.0], UITextAttributeTextColor: [UIColor colorWithWhite:0.5 alpha:1.0], UITextAttributeTextShadowColor: [UIColor clearColor], >;


Xcode's auto-indentation has trouble with existing Objective-C code. I'm a little disappointed, but not surprised, that it doesn't handle new literals so well yet. unesdoc. unesco. org unesdoc. unesco. org


just throw the following in a header.


#define $(. ) ((NSString *)[NSString stringWithFormat:__VA_ARGS__,nil])


and then use like


[$(@"whatever%ld %@", 2, obj ) stringByRemoving.


Hi, could anyone explain to me why this throws a compiler error ("Expected expression before @ token", haha, which one?) NSArray *myArray = @[@ ]; Gracias y un saludo,


Never mind, had the old gcc compiler set -- sorry!


Why Avoid Messages to self in Objective-C init


Jon Reid


I've been practicing Test Driven Development (TDD) since 2001, and applying it to Objective-C since 2005. Learn more on my About page.


Disclosure of Material Connection: Some of the links in the post above are "affiliate links." This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers. I am disclosing this in accordance with the Federal Trade Commission’s 16 CFR, Part 255. "Guides Concerning the Use of Endorsements and Testimonials in Advertising."


40 responses to Why Avoid Messages to self in Objective-C init


¡Hola! Reasonable arguments, but why not just write _all_ other code in consistency ignoring manner? If you have too many relations and connected states inside single object – this is real smell. Avoiding this problem, messaging in undefined state in this case, will mask real problem. Also properties are some kind incapsulated with their own setter/getter, and using ivars for direct access broke this incapsulation. I prefer use properties 99% of time, and access to variables only in setter/getter methods. This allow code be more loose coupled and increase global semantic value of class. What are you think about this case?


If understand you correctly, you’re saying use setters/getters everywhere, even during object construction/destruction, for consistency. I guess for me, I’m more interested in communicating the context than in 100% consistency. And the context of object construction/destruction is very different from anything else in an object’s lifetime.


For example, let’s say we have an object that calls setters/getters during construction/destruction. Technically, this isn’t really a problem for auto-generated setters/getters. But time goes on. Another programmer comes in. He or she makes a reasonable decision that a particular setter should do other clean-up work because of the state change. Suddenly, that other work is being invoked during construction/destruction!


Your counterargument is a good one: If this causes problems, it’s likely because the class has too much state, which masks the problem. Estoy de acuerdo. But the hard reality of my work is that most of the code was written over many years by people who didn’t understand the importance of the Single Responsibility Principle.


As for using self-setters/getters in other methods, I go against the flow. Most people like to do as you describe, for safety. But because my code has unit tests to verify its functionality, I prefer to start with direct access. As Martin Fowler writes in his Refactoring book under “Self Encapsulate Field”:


I’m always of two minds with this choice. I’m usually happy to do what the rest of the team wants to do. Left to myself, though, I like to use direct variable access as a first resort, until it gets in the way. Once things start becoming awkward, I switch to indirect variable access. Refactoring gives you the freedom to change your mind.


What about setting inherited properties in an initialiser? Let’s say I’ve subclassed UIWindow. Can the “code smell” be removed from this init method?:


- (id)init self = [super initWithFrame:[[UIScreen mainScreen] bounds]]; if (self) [self setWindowLevel:UIWindowLevelStatusBar]; [self setHidden:YES]; [self setUserInteractionEnabled:NO]; [self setBackgroundColor:[UIColor clearColor]]; > return self; >


interesting article, thanks. However, it seems to be pretty common to do stuff like this UIView init method:


-(instancetype)initWithFrame:(CGRect)frame if (self = [super initWithFrame:frame]) self. backgroundColor = [UIColor blueColor]; self. alpha = 0.9; self. layer. cornerRadius = 4.0; //etc > return self; >


Are there problems to be expected with this? If so, how could I do it better?


Thanks and regards, Sebastian Mecklenburg


Introduction to Objective-C Blocks


In programming, what differentiates a good developer from a great developer is the way each one takes advantage of the programming tools he or she offered by the used language. Objective-C, the official language for developing applications for iPhone, iPad and Mac OS, is a multi-featured one, and as a relative to C, very powerful. New developers have a lot to explore when starting working with it, while advanced programmers have always something new to learn, as there are numerous supported programming aspects. One of them, is the capability to write code using Blocks .


Blocks do not consist of a new programming discovery in Objective-C. They exist in other programming languages too (such as Javascript) with other names, such as Closures . In iOS, they first-appeared in version 4.0, and since then they’ve known great acceptance and usage. In subsequent iOS versions, Apple re-wrote or updated many framework methods so they adopt blocks, and it seems that blocks are going to be partly the future of the way code is written. But what are they all about really?


Well, a block is a self-contained, autonomous code fragment . existing always into the scope of another programming structure, as for example the body of a method. The code on the block can “interact” with the world out of it, but what takes place in the block is not visible to the scope out of it. Also, blocks can modify the values of variables being out of its body using a special way (we’ll see more later). Blocks have two great features:


They can be executed in a later time, and not when the code of the scope they have been implemented is being executed.


Their usage leads eventually to a much cleaner and tidier code writing, as they can be used instead of delegate methods, written just in one place and not spread to many files.


Focusing even more on the second feature, blocks offer a nice solution for creating callbacks instead of delegates, as they are declared and implemented directly to the point of the code where they are invoked. Using blocks, there is no need to adopt protocols, or implementing delegate methods that lead to much more code in a class. The best thing though, is that the callback procedure can directly access and use any variables existing locally in the scope where the block has been defined, so the need of passing data like we do in callback methods is eliminated. However, blocks cannot totally replace delegates as they cannot be used for every purpose. The best practice is to make combination of both, and that can be achieved both by following some simple rules and using the experience obtained in time.


Blocks are objects . so they can be stored to NSArray or NSDictionary data structures, as well as to be returned from methods, even to be assigned to variables.


Two facts are sure for every developer, even if someone has no idea about blocks. First off, it’s certain that every one has used blocks, even without knowing it. That’s because Apple has adopted blocks especially as completion handlers to many important, commonly used methods. Secondarily, thankfully or not, you don’t need to have deep knowledge on block programming in order to use them, just to understand how they work.


Blocks have just one weird characteristic, and that’s the way they are written. If you are new to all these, don’t worry, as after a couple of days of using and writing blocks, you will get used to it like everything else in Objective-C.


In this tutorial I’m aiming at two goals: To clarify all these things I just presented using code, and, above all to show you how blocks can be used in practice, by demonstrating practical examples, so they can make your programming life easier. If you don’t do any block programming yet, I wish after having finished this tutorial to start doing so.


So, keep reading in order to discover some cool and interesting stuff!


App Overview


I could say that the demo application we’ll create for the purposes of this tutorial is composed by multiple parts that are independent on each other. Actually, we could implement a command-line application, but as I am going to present some UI-related content, we’ll make a really simple application. First of all, we are going to create some code that will display messages only on the debugger, without build any special UI for it. That’s because we’ll focus on making our debut in writing blocks, and that part will consist of multiple, small examples, for which we care about only for the returned results. However, we’ll do some interface building as well, as we are going to perform some view-related tasks and we want our application to provide UI interaction. The most important is that each part of our app will focus on another way of using blocks, so useful techniques to be demonstrated in practice.


Creating the Demo App


Before we make any discussion and see any single line of code, it’s necessary to have a project ready to be waiting for us. Therefore, let’s create one. Launch Xcode, and select to create a new project on the Welcome window:


In the first step of the guide, select the Single View Application in the Application category, under the iOS section.


Click Next to proceed and set a name to the project. I named it BlockDemo . but you’re free to name it however you like. Also, make sure that in the Devices drop down menu, the iPhone value is selected.


Click again on the Next button and select a destination directory for your project. Once you do that, click on the Create button and we are ready.


Basic Block-ing


Before we dive in blocks, I should tell that you can write all code presented in this section inside the viewDidLoad method on the ViewController. m file, in case you want to try it out on your own. So, let’s start.


A block declaration follows the next syntax pattern:


This is quite similar to a C function declaration, with one great exception: The caret (^) symbol, which indicates that the declared object is a block. Let’s see everything one by one:


ReturnType . Any data type Objective-C supports, or void if the block returns nothing.


^blockName . Always remember that the block name is preceded by the ^ symbol. The block name can be any string you like, just like you name any other variable or method. Remember that both the ^ and the block name are enclosed in parentheses ().


Parameters . The list of parameters you want to pass on the block, just like you do when declaring methods. However, keep in mind an important notice: When you pass no parameters to block, then the void keyword should be always set. The arguments list must also be enclosed in parentheses.


And that’s all about declaring blocks. Aquí hay unos ejemplos:


The Xcode error gets disappeared and if you test it, you’ll see on the debugger the expected result (which is 25).


Through this really simple example, the use of __block specifier becomes as much clear as it can get. As a final note, when you use it, don’t forget when to type two underscore (_) symbols before the block keyword.


Blocks As Completion Handlers


Many developers when they think of blocks, they actually (and instantly) think of completion handlers and they have a good reason for that, as blocks are used as completion handlers extensively by many framework methods. It’s granted that all iOS developers, even rookies, have seen and probably worked with completion handlers. But, before we go any further, what a completion handler is?


A completion handler is the way (technique) for implementing callback functionality using blocks. In the introduction of this tutorial I mentioned that blocks can be used in place of delegate methods that work as callbacks, and that’s the way this can be done; through completion handlers.


A completion handler is nothing more than a simple block declaration passed as a parameter to a method that needs to make a callback at a later time. When this time comes, the block is simply called. Besides that, the block definition takes place upon the method invocation, so any actions needed to be taken after a callback has been made can be locally implemented.


One important notice before moving forward is that you should never forget that the completion handler should always be the last parameter in a method . A method can have as many arguments as you want, but always have the completion handler as the last argument in the parameters list.


Here is the declaration pattern of a method which contains a completion handler to make callbacks:


When invoking the method, we pass the values 5 and 7 as parameters, and we define the completion handler block here. It’s obvious that is much more helpful to handle any callback actions here, than creating protocols, delegate methods, and so on, scattered all over the place. Anyway, as this just an example, there is no need to do any special handling, therefore we just log the result of the addition.


The last three pieces of code summarize the way you can deal with completion handlers of your own. If you are new to all this, don’t worry. It’s truly just a matter of habit writing code in such a way. Xcode makes things even easier to all of us, by suggesting what to type in the editor just when you start writing the method invocation, as follows:


After having entered the numeric values and having moved to the completion handler argument, just by pressing the Return key on the keyboard Xcode creates the block’s body as you see in the next figure:


You just have to handle the callback, and of course, don’t forget the semicolon at the end.


Now that completion handlers have been illustrated, and after having seen the very simple example above, it’s time to do something more advanced and really useful that can be used in real applications as a tool.


Completion Handlers: A Practical Example


Let me start by explaining what our goal is, and then we’ll proceed to implementation. So, what we are going to do here, is to create a custom class for making a UIActionSheet object to be used with a completion handler, without any delegate methods at all. If you ever have worked with action sheets, then you know that in order to be used, you have to make your class conform to UIActionSheetDelegate protocol, and then implement at least one delegate method, which usually is the actionSheet:clickedButtonAtIndex: . so you know what’s the tapped button by the user. The normal and usual approach means that you have to write code in various places, but wouldn’t be great if you could handle the user response to the options you present through the action sheet in the place you invoke it, and just have it all together? That’s exactly what we’ll do!


After having the custom class ready, you can take it as a reusable piece of code for your projects. Trust me, simply using a completion handler to manage the user selection on a action sheet is much cooler and easy to use than one can imagine. So, let’s get started.


First of all, let’s create a new class file, and the fastest way to do so, it to press the &#8984-N key combination on the keyboard, or use the menu File > New > File… .


In the guide that appears, select the Objective-C class option, in the Cocoa Touch category, under the iOS section:


Click Next to move to the next step. In the Subclass of field, make sure to set the NSObject value. In the Class field, type CustomActionSheet . as it’s shown in the next figure:


Click once again on the Next button, and in the last window that appears click on the Create button to get finished. You should now see on the Project Navigator these two new files:


In our custom class we will make all the usual required action sheet handling. That means that we’ll make it conform to the UIActionSheet protocol, we’ll implement the actionSheet:clickedButtonAtIndex: delegate method, and anything else that maybe is needed, but the most important thing is that we’ll do all this just once. After that, we won’t bother with those tasks again, as we will simply use the completion handler to manage any callback made by an action sheet object. Don’t mind if all that look confusing to you. By the end of this section, you will have perfectly understood what’s that all about, and you’ll have a reusable tool on your hands.


So, open the CustomActionSheet. h and adopt the UIActionSheet protocol, as it’s shown right next:


Two actions are performed here: At first, the tapped button’s title is assigned to a NSString variable, and then is happening what we care about, the completion handler is called. See that upon calling we specify the two parameters that they are expected and in the proper order. First the string button title value, then the integer button index value. The second command actually triggers the callback, and it’s our duty to properly manage the returned data in our block definition (in a while).


And with that, our custom class is ready! Now we can display an action sheet and handle the user interaction simply by using a block as the completion handler, just right in the place where the action sheet appearance will be invoked. But before we do so, let’s add a UIButton to our view that will trigger this action.


First off, go to the ViewController. h and declare the following IBAction method:


Now, click on the Main. storyboard file, and from the Objects Library add a UIButton to the canvas. Set the following values to the respective properties:


Next, connect the IBAction we previously declared to the button object and you are ready. I won’t get into details on how to make such a connection, as I’m pretty sure that if you read about blocks, then you already know some basic stuff, such as connecting IBOutlet properties and IBAction methods.


Anyway, here is how your (very simple) interface should look like:


Two steps have been left before we go to implement the IBAction method. Open the ViewController. m file, and import the custom class we created at the top of the file:


Next, in the private section of the class, declare a CustomActionSheet object:


@property ( nonatomic. strong ) CustomActionSheet *customActionSheet ;


In the showActionSheet: IBAction method, we’ll start by initializing the CustomActionSheet object. The parameters we’ll set are shown right next:


- ( IBAction ) showActionSheet. ( id ) sender


_customActionSheet = [ [ CustomActionSheet alloc ] initWithTitle. @"AppCoda"


otherButtonTitles. @"Option 1". @"Option 2". @"Option 3". nil ] ;


As you see, it’s just like we initialize a normal action sheet object. I kept the best part for the end. Just admire the magic of the blocks and the completion handlers by making the method complete:


Upon invoking the showInView:withCompletionHandler: method, we also define the block, and without writing even one line of code anywhere else, we can locally manage the callback made by our custom class! Just for the records, as this is an example, we don’t need to manage the button title and index in any special way, therefore just log the respective values of the selected button. Of course, if you’re planning to use the CustomActionSheet class in your projects, you will probably need to add more action sheet delegate methods, but you now have the big picture and I am confident that you’ll manage to do any custom additions you want.


Let me also note one more thing. We use the customActionSheet object as a class member variable, instead of simply declaring it locally, because we need to keep a strong reference to the custom action sheet object so the block code to run, even after the IBAction method execution has been finished.


The custom class we made, is a real-world case where blocks can be put in action. I hope everything presented in this section to be useful and consist of a tool to all of you. If you feel so, try to make the same using the UIAlertView instead of an action sheet. Consider it as your homework!


Blocks And Multithreading


Besides all the above, blocks are also useful when you implement multithreading applications. The important once again is that the code written for execution in secondary threads resides in one place, so it’s easy to have great control over your implementation.


The most common method used for performing multithreaded tasks in combination with blocks, is the Grand Central Dispatch, or else known as the GCD. What you have to do so you can define a block using GCD, is to create a new queue and implement the block body. The following example illustrates how this can be done pretty easily. Note that for the sake of the simplicity of the example, the code written inside the block has no point at all, it’s just for demonstration. If you have implemented the demo application following every step until here, then you can continue by adding the next fragment to the viewDidLoad method.


As you see, we first create a new queue and then, inside the dispatch_async function we define our block. In there you can write any code required for your application. Here is what you should expect to see on the debugger:


Compile And Run The App


At this point, and if you haven’t done so already, go to give a try to the application. As I said in the app overview section of the tutorial, this demo is composed from many different parts, and most of them just show messages on the debugger. There is no great interaction, and from visual aspect, the app might seem really poor. However, what you can find behind all these is some really useful stuff. Note that after having tested the app, the most important thing is you go and create some blocks of your own. When you manage to properly implement blocks, then you’re on a really good way.


Resumen


It’s commonly accepted that blocks are going to be the future in the way we write programs, and up to a point they are already here. Many frameworks have been changed and many methods have been rewritten, so they use blocks. If you are not familiar with all this kind of stuff, then you should better start learning about blocks and working with them, because the time will come that you’ll be forced to do so. Blocks can be very powerful, and extremely assistive. As it has already been proved, they help us keep our code tidy in a great level, and they offer easier control over it. However, blocks cannot replace everything. For some certain tasks, implementing delegate methods or other kind of programming techniques will remain intact. Nonetheless, it’s clear that we can all use blocks even more in our code from now on, and take advantage of the Objective-C in a greater level. So, after having said all that, I wish you find your way on the blocks world, and you manage to do great programming using them!


What do you think about the tutorial? Leave me comment and share your thought.


Author bio: Gabriel Theodoropoulos has been a software developer for almost two decades. Experienced in the most known programming languages, I have developed numerous applications for various target platforms. Since the middle of 2010, I’ve been working almost exclusively on iOS. Having built applications and libraries, I keep doing so up to date. By writing tutorials I’m in position to share knowledge with other developers.


Welcome to Market Realist


To continue to explore our free research, select the profession that best describes you.


Is XLV Poised to Move towards Positive Year-To-Date Returns?


Merck Wins over Gilead, Trading above 100-Day Moving Average


XLV moving averages


In this part of the series, we’ll look at the moving averages of the Health Care Select Sector SPDR ETF (XLV ). On March 22, 2017, 73% of the XLV holdings were trading above their 20-day moving averages, 75% of the XLV holdings were trading above their 50-day moving averages, and only 52% of the XLV holdings were trading above their 100-day moving averages.


Enlarge Graph


The above graph reflects the percentage of XLV holdings trading above different moving averages. On March 22, 2017, of the 56 XLV holdings, 41 stocks were trading above thei 20-day moving averages, 42 stocks were trading above their 50-day moving averages, and 29 stocks were trading above their 100-day moving averages.


Merck and Johnson & Johnson: Above 100-day moving averages


Johnson & Johnson (JNJ ) closed at $107.38, trading above its 20-, 50-, and 100-day moving averages. Year-to-date, the stock has had a positive return of 4.5%. Johnson & Johnson has a book value of $25.82. At its current price, the stock is trading at a PBV (price-to-book value) ratio of


4.2x and a 2017 forward PE (price-to-earnings) ratio of


16.5x. Johnson & Johnson has the largest weight in XLV’s portfolio, with 11.5%.


Merck (MRK ) gained 0.4% and closed at $53.03. The company won two patent cases against Gilead Sciences (GILD ) related to hepatitis C. Though there are no financial details available yet, with the decision made in favor of Merck, Gilead Sciences might end up paying royalties to Merck. Year-to-date, Merck has had a positive return of 0.4%. The stock is trading above its 20-, 50-, and 100-day moving averages. Merck has a book value of $16.06 per share. With its current price, the stock is trading at a PBV of 3.3x and a 2017 forward PE of 14.3x. Merck has a weight of 5.6% in XLV’s portfolio. Some other XLV stocks trading above their 100-day moving averages are AbbVie (ABBV ) and Edwards Lifesciences (EW ).


Become a Market Realist member today to enjoy full access


The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.


Most likely causes:


The directory or file specified does not exist on the Web server.


The URL contains a typographical error.


A custom filter or module, such as URLScan, restricts access to the file.


Things you can try:


Create the content on the Web server.


Review the browser URL.


Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click here .


Detailed Error Information:


Publications, Books, Articles, Interviews, etc.


Also see publications by Brad Cox


Objective-C is a C-based objec-oriented programming language modeled after Smallttalk. For further details on the language, see Object-oriented Programming, An Evolutionary Approach > Second Edition 1986, by Brad Cox and Andrew Novabilsky; published by Addison Wesley Publishing Company. Or see the Objective C Mailing List. Planning the Software Industrial Revolution IEEE Magazine Special Issue on Software Engineering, republished with permission shortly thereafter in Byte Magazine under the intentionally controversial title, There is a Silver Bullet. Also see No Silver Bullet by Dr. Fred Brooks. Building Blocks of Silver by Tom Ochs contrasts the two viewpoints in Byte magazine. Postion Paper for the Ecoop'91 Workshop On Exception Handling And Oopls on using Action Expressions to ad Exception handling to C-based languages. This article shows why I started work on Action Expressions, Exception Handling, and Light-weight Multitasking to Objective-C in the first place; namely to provide a means for supporting a higher-level class of object than Objective-C supports directly. TaskMaster The original article from which both of the above originated. Describes a multitasking/exception handling library I developed as a Stepstone product library but never released as a product. TaskMaster: Card-level Objects and User-Programmable System An early article on a lightweight multitasking and exception handling library for Objective-C and their role in building user-programmable systems. NeXT Acquires Objective-C Objective-C Influence on Java


Old Articles


94 Testing Object-oriented Components; A Human-centric Approach;


93 Market Processes as a New Foundation for Software Engineering .


92 What if there is a Silver Bullet and the competition gets it first? Guest Editorial; Journal of Object-oriented Programming; June 92.


92 Superdistribution and Electronic Objects; Dr. Dobbs' Journal; October 92.


92 A Revolutionary Approach; Invited Column; Journal of Object-oriented Programming.


91 Object-oriented Programming; An Evolutionary Approach; Addison Wesley; 86; 2nd edition (with Andrew Novabilski) 91.


90 Planning the Software Industrial Revolution; Invited article for the Software Technologies of the 90's special issue of IEEE Software magazine; November 90,


90 There is a Silver Bullet; Byte magazine, October 90.


88 Specifying and Testing Object-oriented Software Components ; bimonthly column; Journal of Object-oriented Programming.


88 Producer; Smalltalk to Objective-C Translator; OOPSLA `88 proceedings (with Kurt Schmucker)


86 Object-oriented Programming; An Evolutionary Approach; Addison-Wesley Publishing Company.


86 Objects, Icons, and Software ICs; Byte magazine (with Bill Hunt)


86 Object-oriented Programming; ¿Qué es? Why is it important?; Computer World magazine.


85 Software-ICs; Byte magazine (with Lamar Ledbetter)


82 Message/Object Programming; An Evolutionary Change in Programming Technology; IEEE Software magazine.


83 OOPC; Object-oriented Pre-Compiler; SIGPLAN Notices


1970 Simulation of Neural Nets Decus Proceedings; Spring 1970; Papers and Presentations of the Digital Equipment Computer Users' Society


Objective-C Programming Tutorial


Download Course downloadable when payment processed (within one hour average) CD/DVDs No shipping charges. Please allow 2-3 days for UK, Europe, US & Canadá. 3-5 days rest of world.


WE AIM TO PLEASE All DVD courses have a 100% money back guarantee. If you are not happy with your course contact us within 30 days of purchase for a refund. View our full product guarantee


Need to Train Multiple Users?


This Objective-C Programming course is available in multi-user format ideal for corporate users, schools and universities.


The course loads directly onto your server and delivered to multiple users over your network.


An unlimited number of users can access the training with a pre-determined number viewing the tuition at any one time. más información.


Training Multiple Users


Load onto your server Deliver on your network or existing learning management system


USING THE SAME EXCELLENT CONTENT AS SINGLE USER COURSES For companies and educational establishments wanting multi user access to training resources, we offer this Objective-C Programming course to do just that. Now you can integrate training or technical support within your own computer network, or allow employees or students to gain access to training and support from home or any other location that they can gain access to your organizations network.


EASILY VIEWED OVER A NETWORK The courses can be played over a LAN using a standard browser such as Microsoft Internet Explorer, Safari or Firefox. The movies are viewed using Adobe Flash (same method as YouTube) and are slightly compressed in order to not clog the network. All advanced and the "for dummies" courses are available via this multi user solution and can be copied directly to a hard disk for faster access and the access page may be customized, if needed, using a html editor.


ADDITIONAL USERS AND TITLES CAN BE ADDED More than one title can exist on your server and the supplied player will automatically show titles that are available. Simply purchase more user licences (supplied as files) and drop them into the folder. This will automatically increase the number of users allowed onto the system. All purchases are backed up by excellent after-sales support team and easy to follow instruction manual. You can order multi user online or speak to our knowledgeable sales team .


Once a course is completed you can download a free certificate.


This certifies that you have started from the beginners level, have now viewed all instruction. The certificate advises you now possess essential skills and an in-depth knowledge of Objective-C Programming. Show your boss or potential employer!


View sample videos from the new AutoCAD 2017


Resume Objective Examples and Writing Tips


By Alison Doyle. Job Searching Expert


Welcome to About. com Job Searching, led by Alison Doyle. Alison has been the job search expert for About. com since 1998.


Alison Doyle is one of the industry's most highly-regarded career experts, with all the know-how to help you with job searching, interview skills, resumes, cover letters, personal branding, social networking, leaving your job, employment trends, and even more!


Recognized by Forbes as one of the Top 100 Websites For Your Career and included on the Job Search Bible list of 25 Best Career Websites, Alison has been recognized as a leading person to follow on Twitter by The Guardian, YouTern, FlexJobs and Mashable, and one of the top 10 people to follow on LinkedIn by LinkUp.


Get The Doyle Report


Sign up for the best job search and career tips and advice from Alison, delivered straight to your inbox.


Connect With Alison


For more help and advice, visit the About Job Search Facebook page and connect with me:


Updated November 02, 2017.


When writing a resume, some job seekers choose to state an objective on their resume. An objective can be as simple as your desired job title or it show off the skills you hope to use in your next position.


Stating an objective on your resume can convince employers that you know what you want to do and are familiar with the job. While including your objective on your resume is optional, having an objective for your resume is not - you need to be clear about your employment goals.


Seguir leyendo abajo


What is a Resume Objective?


A resume objective is a statement of your goals for employment, typically listed at the top of your resume. Stating an objective is optional, but it can help convince employers that you know what you want and are familiar with the field. The most effective objective is the one which is specific about the position and type of employment desired.


How to Write a Resume Objective


If you include an objective on your resume. it's important to customize the resume objective to match the position you are applying for.


The more specific you are, the better chance you have of being considered for the job you are interested in.


It should show the reader why you are a strong match for the job. The more specific your resume objective is, the better chance you have of being considered for the job.


The more specific you are, the better chance you have of being considered for the job you are interested in.


Sample Resume Objective Statements


Obtain a position at XYZ Company where I can maximize my management skills, quality assurance, program development, and training experience.


Seguir leyendo abajo


Account executive trainee at ABCD advertising agency.


Position as clinical practice assistant for health maintenance organization, utilizing writing, research, and leadership skills.


Elementary education teacher at small independent school.


Customer service management where my experience can be utilized to improve customer satisfaction.


Create integrated strategies to develop and expand existing customer sales, brand/product evolution, and media endorsement.


Management position where I can effectively utilize my expertise in human relations, project management, and staff recruitment and retention.


Marketing position that utilizes my writing skills and enables me to make a positive contribution to the organization.


Search engine optimization position where I can use my SEO skills and experience to increase site traffic and search engine placement.


To secure a position with a well established organization with a stable environment that will lead to a lasting relationship in the field of finance.


To obtain a position that will enable me to use my strong organizational skills, educational background, and ability to work well with people.


Experienced HR Coordinator who enjoys challenge seeking opportunity to learn and improve skills.


Other Options


An alternative to using an objective on your resume is a resume profile. which is a brief summary of your skills, experiences, and goals written for a specific job opening. Other options include adding a resume branding statement. a headline, or a summary.


Sample Resumes With Objectives, Profiles, and Headlines


What Else You Need to Know:


Aptitude - Average


Why Aptitude Average?


In this section you can learn and practice Aptitude Questions based on "Average" and improve your skills in order to face the interview, competitive examination and various entrance test (CAT, GATE, GRE, MAT, Bank Exam, Railway Exam etc.) with full confidence.


Where can I get Aptitude Average questions and answers with explanation?


IndiaBIX provides you lots of fully solved Aptitude (Average) questions and answers with Explanation. Solved examples with detailed answer description, explanation are given and it would be easy to understand. All students, freshers can download Aptitude Average quiz questions with answers as PDF files and eBooks.


Where can I get Aptitude Average Interview Questions and Answers (objective type, multiple choice)?


Here you can find objective type Aptitude Average questions and answers for interview and entrance examination. Multiple choice and true or false type questions are also provided.


How to solve Aptitude Average problems?


You can easily solve all kind of Aptitude questions based on Average by practicing the objective type exercises given below, also get shortcut methods to solve Aptitude Average problems.


macd hull moving average


In waves technical analysis Elliot Waves Oscillator is used to recognize waves with further analysis of these waves. Chart 1: QQQ (Nasdaq 100) stockchart with Elliot Wave Oscillator (MACD)


Jeff Bierman Hull Moving Average 10 10 2011 macd hull moving average.


Background KnowledgeThe popularity of the MACD is largely due to its ability to help quickly spot increasing short-term momentum. However, before wejump into the inner workings of the MACD, it is important to completely understand the relationship between a short-term and long-term moving average. Macd hull moving average.


DrawbacksThe biggest disadvantage of using this indicator to generate transaction signals is that a trader can get whipsawed in and out of a positionseveral times before being able to capture a strong change in momentum. As you can see in the chart, the lagging aspect of this indicator can generateseveral transaction signals during a prolonged move, and this may cause the trader to realize several unimpressive gains or even small losses duringthe rally.


Macd hull moving average - Read more


Description macd hull moving average


Takes 4 to 6 weeks to open an account, open early: Read The Article "Account Opening Procedure"


7/8/2017 · Video embedded · Looking for the best Moving Average and Alert NinjaTrader indicators. This indicator bundle includes moving average 'cloud' …


The CenterlineAs mentioned earlier, the MACD indicator is calculated by taking the difference between a short-term moving average (12-day EMA) and alonger-term moving average (26-day EMA). Given this construction, the value of the MACD indicator must be equal to zero each time the two movingaverages cross over each other. As you can see in Figure 3, a cross through the zero line is a very simple method that can be used to identify thedirection of the trend and the key points when momentum is building.


Elliot Wave Oscillator formula is the same as for MACD:Elliot Wave Oscillator = Fast MA - Slow MA


Traders should be aware that the whipsaw effect can be severe in both trending and range-bound markets, because relatively small movements can causethe indicator to change directions quickly. The large number of false signals can result in a trader taking many losses. When commissions are factoredinto the equation, this strategy can become very expensive.


The Hull averages uses the MA Price, MA Periods, and MA Type inputs to calculate how to plot the indicator. These values are parametrized to allow atrader full customization of the Hull Average.


Watch macd hull moving average


Transaction SignalsIt has become standard to plot a separate moving average alongside the MACD, which is used to create a clear signal of shiftingmomentum. A signal line, also known as the trigger line, is created by taking a nine-period moving average of the MACD. This is found plottedalongside the indicator on the chart. As you can see in Figure 2, transaction signals are generated when the MACD line (the solid line) crossesthrough the signal line (nine-period exponential moving average (EMA) - dotted blue line). Macd hull moving average make money.


ConclusionThe MACD indicator is the most popular tool in technical analysis, because it gives traders the ability to quickly and easily identify theshort-term trend direction. The clear transaction signals help minimize the subjectivity involved in trading, and the crosses over the signal linemake it easy for traders to ensure that they are trading in the direction of momentum. Very few indicators in technical analysis have proved to bemore reliable than the MACD, and this relatively simple indicator can quickly be incorporated into any short-term trading strategy.


This indicator looks exactly like the common moving average. This is an extremely fast moving and smooth moving average. Hull main objective is toremove the lag, it almost eliminates lag completely and manages to improve the smoothing of the indicator at the same time.


Another MACD drawback is its inability to make comparisons between different securities. Because the MACD is the dollar value between the two movingaverages, the reading for differently priced stocks provides little insight when comparing a number of assets to each other. In an attempt to fix thisproblem, many technical analysts will use the percentage price oscillator, which is calculated in a similar fashion as the MACD, but analyzes thepercentage difference between the moving averages rather than the dollar amount.


Elliot Wave Oscillator is calculated as difference between two simple moving averages (Fast MA - Slow MA). You may see from the formula thatElliot Wave Oscillator is the same MACD indicator you see on our stock charts. The only difference is that traditional MACD is based on ExponentialMAs (Moving Averages) and traditional Elliot Wave Oscillator is based on Simple MAs. The other difference is that traders who analyze waves call thisindicator as Elliot Wave Oscillator and the other traders who look for MA crossovers call this indicator as MACD.(macd hull moving average make money.|)


The basic bullish signal (buy sign) occurs when the MACD line (the solid line) crosses above the signal line (the dotted line), and the basic bearishsignal (sell sign) is generated when the MACD crosses below the signal line. Traders who attempt to profit from bullish MACD crosses that occur whenthe indicator is below zero should be aware that they are attempting to profit from a change in momentum direction, while the moving averages arestill suggesting that the security could experience a short-term sell-off. This bullish crossover can often correctly predict the reversal in thetrend as shown in Figure 2, but it is often considered riskier than if the MACD were above zero.


Navegación del sitio


If you're new here, you may want to subscribe to my RSS feed or follow me on Twitter. ¡Gracias por su visita!


Warning: Objective-C Crash Course Ahead!


This is a post by iOS Tutorial Team Member Linda Burke. an indie iOS developer and the founder of canApps .


Are you a software developer skilled in another platform, but want to start learning iPhone development (and hence Objective-C)? This was my situation not so long ago, and frankly, I’d gotten a bit rusty from moving further and further away from development in my day job.


Some two years later, I’ve created a lot of apps for the iPhone and iPad. While I often had to learn the hard way, I’d like you to be able to benefit from some of my trials and tribulations.


This tutorial is for readers who already have some programming experience. It assumes that you know your while loop from your fruit loops and a debug from a lady bug! If you’re completely new to programming, you might want to check out our iOS for High School Students series.


The goal of this tutorial is to give you confidence with some of the basics of Objective-C. Instead of taking a “let’s explain every piece of syntax” approach, we’re going to take the approach of diving right in and giving you some hands-on experience and an example to work from. It will then be a lot easier for you to consult a reference when necessary moving forward.


In this tutorial, you will create a simple app that randomly generate quotes from a stored list. In doing so, you’ll become acquainted with a number of aspects of Objective-C, including:


Let me warn you though – iPhone development with Objective-C is a lot of fun and a little addictive. Be prepared to give up some sleep, and the chores might build up. ]


Before you begin, make sure you have an Apple developer account with the provisioning details set up and the latest version of Xcode installed (you can download this for free on the Mac App Store).


When you’re done, I will (Objective) C-you after the jump. ]


Empezando


First things first: create an Xcode project.


Start up Xcode and create a new project with the iOS\Application\Single View Application template. Then click Next.


Enter “QuoteGen” for the product name, enter your default company identifier, set device family to iPhone, and make sure Use Automatic Reference Counting is checked (but leave the other checkboxes unchecked). Now click Next and select the location to save your project.


You will notice that your project has been created with AppDelegate. h . AppDelegate. m . ViewController. h and ViewController. m files, as well as a ViewController. xib .


>


The AppDelegate contains the code that initiates the app. For this tutorial, that’s all you need to know. Here are brief explanations of the other files, with which you will be working directly:


ViewController. xib (XIB file for short) is the interface layout file. You visually create/design the screen that’s displayed on the iPhone device using this file.


ViewController. m is the interface controller class. The interface layout file is linked to this class. This happens automatically, so at this stage you don’t need to think about it other than to know that any objects or events you set up in your interface class can be linked to your interface layout very easily. This is the file that will contain the Objective-C code you’re about to create.


ViewController. h is the interface controller class header file, where you’ll declare the instance variables, as well as the objects and events that you need to access from the interface screen.


Note: There are two ways to create interfaces in Xcode – with XIBs and with Storyboards. Either way works fine, in this tutorial we’ll be using XIBs but if you want to try out Storyboards check out this tutorial when you’re done.


Heading in the Right Direction


Start by creating the property declarations for the variables you’ll need to store your quotes. You ought to know by now where to add these variables. Yep, the class header file, ViewController. h . Add an array as follows between the @interface and @end lines:


The property directive tells the compiler that the variable myQuotes is a property of this class. Without going too deeply into this topic – the complexities of memory management are for another day – the attributes nonatomic and retain are widely used for efficiency. The monatomic attribute specifies that the property might not work in a multi-threaded environment and retain indicates that a pointer to the specified variable will stay in memory as long as the ViewController object exists.


Note: FYI the retain keyword is synonymous with strong. In Objective-C, you used to have to do all the memory management yourself, but now with a new feature called ARC it’s automatic. To read more about ARC, check out this tutorial .


This app is also going to store some famous quotes from movies. For this, you need a second array:


Here you’re using an NSMutableArray simply to illustrate the different types of arrays. More about that later.


Manual Labor


Now you need to synthesize the arrays – this is a way to let the compiler know that it should synthesize the setter and/or getter methods for a property if you do not supply them within the @implementation block.


Do the above by editing ViewController. m and adding these two lines after the @implementation line:


@synthesize provides default methods for getting and setting the contents of the objects. In simple terms, these methods allow you to add data to the array and retrieve it for display.


Now you can store your favorite quotes in the myQuotes array. Do this in viewDidLoad . the method that executes when the view (screen) is displayed. There’s no need to do it more than once, as the quote list won’t change, so viewDidLoad is a good place.


In viewDidLoad . add the following code after [super viewDidLoad];. Include your own favorite quotes if you like. This is the “manual labor” approach and is quite okay for a small number of array entries.


This is the first example of calling a method. The syntax is a bit different than what you might be used to in other languages:


To begin calling a method, you put a bracket and then the name of the object you want to call a method on. In this case, we’re calling a (static) method on NSArray.


You then put the (first part) of the name of the method, and a colon. In our case, this is arrayWithObjects.


You then add the first parameter. This method is kinda a special case because this is a variable-length parameter method, so we can pass a list of objects to add to the array, and put nil when we’re done.


If the method has multiple parameters, you’d continue on in this manner. This method just has one parameter though (the list of objects).


If you’re still hung up on the syntax, don’t worry – we’ll see plenty more examples of calling methods soon.


Also notice that in Objective-C, when you use strings you put an @ symbol before them. If you’re used to other languages, this can be easy to forget, which will probably cause your app to crash :] So if your app crashes when it uses a string, double check you remembered to use the @ symbol!


Use “self” when setting and getting data for a property. This is similar to the “this” keyword in other languages, and refers to the object upon which the method is running.


You can access instance variables directly (without self), but by using self you go through the getters and setters for the instance variables. Until you know learn the reasons you might want to use instance variables directly, a good rule for beginners is to always use self.


Every time you add assign to a retained property, make sure you clear it out in ViewDidUnload as follows (add the code below the existing line):


This is important so that when the view is unloaded (which happens in low memory situations when the view is not visible), your quotes array can be freed as well. Basically you typically want to do the opposite of whatever you do in viewDidLoad. It’s a good thing to free up memory when it’s low. ]


OK, now that we have these quote arrays set up, let’s try them out!


First, declare the interface elements and actions that you’ll hook in to in the XIB file. Add the following to ViewController. h under the arrays:


The IBOutlet keyword means that quote_text is an object that can be linked to an interface element on the XIB file so that the view controller can access (or change) properties of the interface element. In this case, we’ll be setting the displayed text for the UITextView control but we could just as easily change the color, font, size, etc.


The IBAction keyword indicates that quote_btn_touch is an action that can be linked to an event for a UI control on the screen. In this case, we will be connecting to the quote button touched event.


In case you’re wondering, id means “any object that derives from NSObject”. Usually when you set up callbacks that buttons and other controls will call, they pass whatever button/control is sending the callback as the first parameter. Since we don’t necessarily know what type it is, we put id here.


Once again, you need to synthesize the new property you added. In ViewController. m . añadir:


The arc4random function is used to generate a random number. In this case, since we want to randomly select one of the quotes, the highest possible value is the number of rows in the array, and the lowest possible value is 0. In Objective-C (like many other languages), the first row in an array is row 0, not 1.


index is just a temporary integer variable that you use to store the random number, which is then used to get that specific quote from array. As the array is a simple list of strings, you can get the quote by using objectAtIndex: and store the quote in a temporary variable of type string.


You then use the temporary string variable my_quote to set the displayed text for the quote_text control on the screen.


You use the stringWithFormat method to format the final output string so that you can display a label and add a new line before displaying the quote. It uses variable substitution, like printf in C/C++. %f is float, %d is integer, and %@ is Objective-C object.


Now in order to actually see the quote on the screen, you need to link the text field outlet in the class with a text field control in your XIB file.


We Have Lift Off!


To see it all in action, open up ViewController. xib . Next, look for the right sidebar in your Xcode window. If you don’t see one, you might need to use the rightmost button under the Views section, on the toolbar at the top, to make the right hand sidebar visible.


The lower part of the righthand sidebar has four tabs, which you can switch between using the icons at the top of that section. The section you want is the Object Library.


From the Object Library, drag a Text View control and a Round Rect Button onto the view. Position them to your liking. Add a title to the button, such as “Quote”. Change the color and font for the controls as you see fit. You can change most properties for the controls via the upper part of the right hand sidebar which too has several tabs that you can switch between – the one you’ll use the most to customise the appearance of the controls is the Attributes Inspector tab.


As the text field is for display only, untick Behavior – Editable.


Now you need to link the button and the text view to the outlet and action you already set up in your class.


Link your text view by right-clicking the text view, clicking on the New Reference Outlet circle, dragging to File’s Owner and selecting quote_text.


Alternatively, you can simply select File’s Owner and then switch the top portion of the right hand sidebar to the Connections Inspector tab. You should see all the connections available for your File’s Owner, which happens to be your controller class. You can now simply drag from the available connection to the control visible on screen.


Now, you can programmatically set the value for the text displayed in the text view by modifying quote_text.


Similarly, we can hook up touch events on the button we added to the XIB file to the quote_btn_touch action we set up earlier. To do that, right-click on the button and drag Touch Up Inside to Files’s Owner and select quote_btn_touch .


Alternatively, you can simply select the button in the XIB view, and if you have the Connections Inspector selected in the right hand sidebar, you’ll notice that you get a list of events for the button. Now drag from the Touch Up Inside event to the File’s Owner and you should get a list of possible actions you can connect that event to. Just select the one you want.


¿Adivina qué? You’re ready to rock ‘n’ rodar. Simply click on the Xcode Run button (the first button at the top of the screen) to compile and run your app in the simulator.


If there are errors, don’t panic. At this stage, they should be self-explanatory. Often just typos when declaring your variables. Remember, Xcode is case-sensitive.


If your app does compile and run, then click on the Quote button to get a random quote. Not having many quotes in the list limits the excitement a little. But don’t worry, you’re about to load up another array and with this one you can go wild and add as many quotes as you like, because they won’t be in the code.


“How so?” you ask?


Ah, the joys of property lists are about to be revealed! I’m a big fan of property lists.


Property Lists Rule!


Create a new file with the iOS\Cocoa Touch\Objective-C class template. Name the class SMNote . and make it a subclass of UIDocument .


Create a new file by right-clicking on your project root on the left sidebar (the Project Navigator) and select “New File …” Then select iOS\Resource\Property List and click “Next”. Select the location to save your new file (usually somewhere within the project folder for the tutorial project) and name the file “quotes”.


You can either edit the property list file from within Xcode in a grid-view (as a list of properties) or as a text file. If you want to edit as a text file, right-click on the quotes file on the Project Navigator and select Open As\Source Code.


Since we want to quickly add all the quotes by copying and pasting, opening as source code probably would be the faster route. If you want though, you can try the grid view approach and try to figure out how to add the same values as below using that method.


Now, add your movie quotes by copying and pasting the following into quotes (in source code mode):


These are just a few quotes to serve as examples. Have some fun and add your own favorites. If you’re feeling lazy, the sample project has a property list of many quotes.


The quotes are categorized as either classic or modern to illustrate a really neat feature that we’ll get to a bit later.


You can also switch over to the Property List view (right-click on the quotes file on the Project Navigator and select Open As\Property List) to see how the values you added look in the grid view and how it is organised. Now that you know how the different editing modes work, you can always switch back and forth as you like.


Property lists are cool, but can be very uncool when you get an error. Common mistakes for newbies are forgetting the end tag or accidentally deleting a. If your property list doesn’t load, then you’ll need to trawl through and work out why. Earlier versions of Xcode gave line numbers for errors. I think it was from version 4 onwards that this helpful feature was excluded.


If you really get stuck, you need to methodically go through your file. I do this (a bit too often to be frank) to make it easier: copy my plist file, then remove chunks a bit at a time to identify the approximate location of the error.


Having created your lovely property list, you are now ready to load it into an array for use. So let’s switch back to ViewController. m and add the following to the end of viewDidLoad :


It’s as easy as that – now you have an array with all of the movie quote data you entered in the property list!


To try out your new array, you might think that all you really need to do is change getting the random quote from your personal quotes array to the movie quotes array. So, in quote_btn_touch you simply replace all references to myQuotes with movieQuotes, right?


But that alone will not work, as you will find if you try it. This is because myQuotes was an array of quote strings. But movieQuotes is not an array of strings. Instead, it’s an array of dictionaries where a dictionary is a list of values where you can access each value based on a unique key.


¿Por qué? Because that’s how you set up the property list (go look at it again to see!)


Note: Dictionaries are key/value stores, similar to hashtables in other languages. You can look up entries in a dictionary with the valueForKey method.


So replace quote_btn_touch with the following code which switches over to using the movieQuotes array but also gets the quote by using the right key for each quote dictionary:


Keep the commented out line in section #3 as it will come in handy later. Build and run and enjoy your new movie quotes!


Now you’re going to get a bit fancy and allow the user to select between viewing myQuotes or movieQuotes, and whether to view classic or modern movie quotes.


Options, Options, Options


First you need to go back to your class header file, ViewController. h . and add a new property.


Here you’ve added a segmented control which allows you to select one item from a list of options – perfect for selecting a quote type.


And of course, you need to synthesize the new property. Add the following to the top of ViewController. m where the other @synthesize statements are:


Now go to ViewController. xib and drag a Segmented Control onto your view.


Change the properties of the control to the following:


Style: Bar (my personal preference)


Tint: whatever you like


Segments: 3


Select Segment: 0 and change the title to: Classic


Select Segment: 1 and change the title to: Modern


Select Segment: 2 and change the title to: Mine


This achieves the effect of having three different quote types – or rather, the ability to select between one of the three.


Having created your Segmented Control, you need to link it to the outlet in your class. You can use the same method as before to hook up the control to quote_opt in File’s Owner.


You will not need an action event for this control.


Before you do anything else, clear out the new property in ViewDidUnload .


Why don’t you build and run to see your new control on screen? It won’t do anything at the moment, but it’s nice to know it’s there!


The Joy of Predicates


A predicate is a useful object that filters an array. It’s a bit like having a select with a simple where clause in SQL. I find them quite useful when I have a categorized property list. It saves you from having to create separate property lists.


Don’t hate me, but you have to go back and change quote_btn_touch: in ViewController. m to use myQuotes instead of movieQuotes, as you will soon do something quite different for your movie quotes. And you need to put a condition around it, so that you’ll only use this when the third option is selected in the Segmented Control.


Or, if you prefer, simply replace quote_btn_touch: with the following code:


Now the user will see myQuotes only when they select the third option. As you’ll notice the rest of the code is the same as before, the only difference is that we display a quote (and that quote comes from the personal quote list) only when the segmented control has segment with index 2 selected. And as you might recall, since the segment control starts at index 0, index 2 means the third item.


Build and test your code to make sure that it works as you expect and that the quotes show up only when the “Mine” tab/segment is selected.


For the predicate fun, first you figure out the category you need based on the selected segment control and then use the category to create a filtered array of quotes that matches the category. Stay with me!


This is the code on the other side of the if statement in quote_btn_touch: – so simply add this to the end of the method to complete the “if” statement begun in section #1:


Okay, build and run. Check that you see the right type of quote depending on your selection. If you are always getting the same type, my guess would be that you may not have linked the Segmented Control to your class.


The String Symphony


So far, so good! Now let’s explore some different string options and syntax in Objective-C.


If the quote has a source in the property list, then the app should display that as well. To check if there’s a value in a string, you can check the length of the string.


So add the following to quote_btn_touch: after the first line in section #2.6 (the first line not counting the comment, that is):


You get the source from the array and check that it contains a value by making sure that its length is not zero. ! represents NOT. Use == when checking if an integer is equal to a value.


Then you build a new display string by combining the quote and the source using stringWithFormat .


To make things more interesting, why don’t you display something slightly different for quotes from classic movies that will involve checking the value of the category of the selected quote?


Replace section #2.8 in quote_btn_touch: with the following:


This checks if the string is equal to a specific value, in this case “classic”, and customizes the label for the quote based on the category.


If you want to check for a particular movie title (or for that matter any other string attribute) starts with a particular value, you can do that too. Say you want to display some extra text if the quote is from a Harry Potter movie – add the following right above section #2.9:


As you can guess, hasPrefix is used to check if the start of the string has a particular text value.


Build and run your app to make sure that it works as you expect it to. Pay attention to the different categories and to Harry Potter movie quotes to make sure that it all works correctly.


It’s ARRAYning Quotes


Just for fun, you’re going to concatenate all your quotes together, as there aren’t many. This will illustrate how to loop through an array, which you might need to do if you want to iterate over each item in an array to process each item.


In quote_btn_touch: replace section #1 with the following:


A for loop is used to loop through the array from row 0 to the last row. x is the counter that is used to keep track of the rows.


Now run and check the results.


One last thing. I mentioned earlier that there are different types of arrays: NSArray and NSMutableArray . So far, each has done the same job in this project.


Use an NSMutableArray if you want to modify/update it. As the name implies, a mutable array can be changed whereas a normal NSArray is static and you cannot add new items to the array or delete items from the array easily.


For example, if you wanted to update the array after a row had been selected in order to show that that quote had already been displayed, you would need an NSMutableArray.


In this project, movieQuotes is your NSMutableArray. You’re using a predicate . so you first need to find the row in movieQuotes and then update it. Add the following code after section #2.9 in quote_btn_touch: :


You loop through the array and check each row to see if it’s the row you’re looking for. Again you use isEqualToString ; this time, however, you’re comparing two string variables.


To update the row in the array, you retrieve the object for the row in question and update the object. This is starting to get a bit advanced for this tutorial, but it’s useful to know.


Since we’re updating the source string and since the source string is what is used to select quotes for each category, the row will not be included next time you use NSPredicate to filter the array. And that’s quite neat.


Where to Go From Here?


Here is a sample project with all of the code from the above tutorial.


Well, you’ve reached the end of this little project. You’ve learned how to use arrays in different ways, initiate actions from interface events, access objects via Interface Builder using a XIB file and do various string comparisons and concatenations. That is not a bad effort if this is your first iPhone app!


Now that you know the basics, you might want to try out our How To Create a Simple iPhone App tutorial series, or sign up for our monthly newsletter for an epic-length iOS tutorial for beginners.


The forums are available if you have any questions about what you’ve done. Also, if you liked this tutorial and would like to see more in the series, please let me know in the forums!


In the meantime, good luck and keep ‘appy. ]


Linda is an IT Professional with 20+ years experience in the IT industry based in Melbourne, Australia. Linda has gotten back to her roots (and youth) by developing iOS apps in her spare time. She is the founder of a family based iPhone app development studio, canApps. When Linda is not developing apps by the fire, she is loving life… and thinking of new app ideas! You can follow Linda on Twitter .


You can read earlier discussions of this topic in the archives


This is a post by iOS Tutorial Team Member Linda Burke, an indie iOS developer and the founder of canApps. Are you a software developer skilled in another platform, but want to start learning iPhone development (and hence Objective-C)? This was my situation not so long ago, and frankly, I’d gotten a bit rusty from […]


Other Items of Interest


raywenderlich. com Weekly


Sign up to receive the latest tutorials from raywenderlich. com each week, and receive a free epic-length tutorial as a bonus!


Advertise with Us!


Unity Starter Kit!


Our Books


Our Team


About RayWenderlich. com


How to use a microscope


1. When moving your microscope, always carry it with both hands (Figure 1, below). Grasp the arm with one hand and place the other hand under the base for support.


2. Turn the revolving nosepiece so that the lowest power objective lens is "clicked" into position (This is also the shortest objective lens).


3. Your microscope slide should be prepared with a coverslip or cover glass over the specimen. This will help protect the objective lenses if they touch the slide. Place the microscope slide on the stage and fasten it with the stage clips. You can push down on the back end of the stage clip to open it.


4. Look at the objective lens and the stage from the side (Figure 2) and turn the coarse focus knob so that the objective lens moves downward (or the stage, if it moves, goes upward). Move it as far as it will go without touching the slide !


5. Now, look through the eyepiece and adjust the illuminator (or mirror) and diaphragm (Figure 3) for the greatest amount of light.


6. Slowly turn the coarse adjustment so that the objective lens goes up (away from the slide). Continue until the image comes into focus. Use the fine adjustment, if available, for fine focusing. If you have a microscope with a moving stage, then turn the coarse knob so the stage moves downward or away from the objective lens.


7. Move the microscope slide around so that the image is in the center of the field of view and readjust the mirror, illuminator or diaphragm for the clearest image.


8. Now, you should be able to change to the next objective lenses with only minimal use of the focusing adjustment. Use the fine adjustment, if available. If you cannot focus on your specimen, repeat steps 4 through 7 with the higher power objective lens in place. Do not allow the objective lens to touch the slide!


9. The proper way to use a monocular microscope is to look through the eyepiece with one eye and keep the other eye open (this helps avoid eye strain). If you have to close one eye when looking into the microscope, it's ok. Remember, everything is upside down and backwards. When you move the slide to the right, the image goes to the left!


10. Do not touch the glass part of the lenses with your fingers. Use only special lens paper to clean the lenses.


11. When finished, raise the tube (or lower the stage), click the low power lens into position and remove the slide.


12. Always keep your microscope covered when not in use. Dust is the number 1 enemy!


Remember, microscopes are expensive scientific instruments. Handle them properly and carefully and they will last for many years!


Google develops tool to translate Java to iOS friendly Objective-C code


14 min ago 1 By John Callaham Acer will hold a press event in New York City on April 21, where it will likely show off a number of upcoming products from the company. The event will be livestreamed for the rest of the world to check out.


30 min ago 4 By Joseph Keller Pebble has confirmed that it will lay off 40 employees this week across all divisions of the company.


High Voltage does VR right


1 hour ago By Jonathan Dollison Damaged Core and Dragon Front are two Oculus titles coming from long-running studio High Voltage Software, that need to be on your radar. ¡Este es el por qué!


1 hour ago 55 By Phil Nickinson Good news, everyone! HTC still makes phones! The HTC 10 is coming on April 12 in an online-only event. The question is what you're hoping to find in this new flagship.


This is ingenious for google. A short sighted company would develope a tool to conver iOS code to Android friendly code. Instead they developed a tool to convert code to their competitor's product. It sounds stupid at first, but think about what this really means.


Any significant app developer wants to develop for iOS and Android. This will allow some developers to develop for both in less time, but what system are they actually learning? Androids. This means that is the system they are really spending their time with. This means a better product for android and more developers who are experts.


August 2009


Here is this month’s selection of Traders’ Tips, contributed by various developers of technical analysis software to help readers more easily implement some of the strategies presented in this and other issues.


Other code appearing in articles in this issue is posted in the Subscriber Area of our website at http://technical. traders. com/sub/sublogin. asp. Login requires your last name and subscription number (from mailing label). Once logged in, scroll down to beneath the “Optimized trading systems” area until you see “Code from articles.” From there, code can be copied and pasted into the appropriate technical analysis program so that no retyping of code is required for subscribers.


You can copy these formulas and programs for easy use in your spreadsheet or analysis software. Simply “select” the desired text by highlighting as you would in any word processing program, then use your standard key command for copy or choose “copy” from the browser menu. The copied text can then be “pasted” into any open spreadsheet or other software by selecting an insertion point and executing a paste command. By toggling back and forth between an application window and the open web page, data can be transferred with ease.


This month’s tips include formulas and programs for:


TRADESTATION: COMBINING DMI AND A MOVING AVERAGE


Rombout Kerstens’ article in this issue, “Combining Dmi And Moving Average For A Eur/Usd Trading System ,” describes a technique for long entry and exit that uses both J. Welles Wilder’s Dmi (directional movement indicator) and a moving average.


Kerstens’ article already includes strategy code in EasyLanguage in the sidebar. However, to provide signal displays on a wide group of stocks, we have coded the algorithm as an indicator that can be applied to a RadarScreen window.


Figure 1: TRADESTATION, DMI & MOVING AVERAGE SYSTEM. In this sample TradeStation chart, Kerstens’ DMI_MA strategy is displayed on an EUR/USD chart (lower frame). A RadarScreen display of the DMI_MA system signals is shown in the upper frame.


To download the EasyLanguage code for this study, go to the TradeStation and EasyLanguage Support Forum (https://www. tradestation. com/Discussions/forum. aspx? Forum_ID=213 ) and search for the file “ Dmi _MA. eld.”


This article is for informational purposes. No type of trading or investment recommendation, advice or strategy is being made, given or in any manner provided by TradeStation Securities or its affiliates.


—Mark Mills TradeStation Securities, Inc. A subsidiary of TradeStation Group, Inc. www. TradeStation. com


e SIGNAL: DMI AND MOVING AVERAGE SYSTEM


For this month&rsquos Traders’ Tip, we&rsquove provided the formula, “MAandDMIStrategy. efs,” based on the formula code from Rombout Kerstens’ article in this issue, “Combining Dmi And Moving Average For A Eur/Usd Trading System .”


This formula plots the Pdi (positive directional index) and Ndi (negative directional index) with labels for the signals to enter and exit a long position (Figure 2). The formula contains parameters that may be configured through the Edit Studies option to change the moving average (MA) and Dmi periods. The formula is also compatible for backtesting using the Strategy Analyzer.


Figure 2: eSIGNAL, DMI & MA SYSTEM. The formula plots the PDI (positive directional index) and NDI (negative directional index) with signals to enter and exit a long position.


To discuss this study or download complete copies of the formula code, please visit the Efs Library Discussion Board forum under the Forums link at www. esignalcentral. com or visit our Efs KnowledgeBase at www. esignalcentral. com/support/kb/efs/. The eSignal formula scripts ( Efs ) are also available for copying and pasting from the Stocks & Commodities website at Traders. com.


—Jason Keck eSignal, a division of Interactive Data Corp. 800 815-8256, www. esignalcentral. com


METASTOCK: DMI & MOVING AVERAGE SYSTEM


Rombout Kerstens’ article in this issue, “Combining Dmi And Moving Average For A Eur/Usd Trading System ,” describes buy and sell signals combining these two indicators. The MetaStock formulas and instructions for adding these to MetaStock are as follows:


To create a system test:


Select Tools > the Enhanced System Tester.


Click New


Enter a name.


Select the Buy Order tab and enter the following formula.


Select the Sell Order tab and enter the following formula.


Select the Sell Short Order tab and enter the following formula.


Select the Buy to Cover Order tab and enter the following formula.


Click OK to close the system editor.


The expert advisor can be created with the following steps:


Select Tools > Expert Advisor.


Click New to open the Expert Editor.


Type in a name for your expert


Click the Symbols tab.


Click New to create a new symbol.


Type in the name “Buy”.


Click in the condition window and enter the buy order formula.


Select the Graphics tab


Set the symbol to the Up Arrow


Set the color to Green


In the Label window, type “Buy”


Set the symbol position to “Below Price Plot”


Set the label position to “Below Symbol”


Haga clic en Aceptar


Click New to create a new symbol.


Type in the name “Sell”.


Click in the condition window and enter the sell order formula.


Select the Graphics tab


Set the symbol to the Down Arrow


Set the color to Red


In the Label window, type “Sell”


Set the symbol position to “Above Price Plot”


Set the label position to “Above Symbol”


Haga clic en Aceptar


Click OK to close the Expert Editor.


—William Golson Equis International


WEALTH-LAB: DMI & MOVING AVERAGE STRATEGY


This Traders’ Tip is based on “Combining Dmi And Moving Average For A Eur/Usd Trading System ” by Rombout Kerstens in this issue.


Code for Wealth-Lab version 5 in C# for combining the directional movement and moving average indicators is shown here with the minor modification of making this a stop-and-reverse strategy. As the periods chosen by the author seem quite arbitrary, it seems possible to find a sweeter spot for the strategy by optimizing. While adding complexity, it also may pay off investigating the use of a loose trailing stop in order to prevent whipsaws in the middle of a strong trend (possibly detected using Adx ), like the one that occurred in September 2008, which you can see in Figure 3.


Figure 3: WEALTH-LAB, DMI & MOVING AVERAGE. DMI and moving average crossovers often indicate the same trend on nearly the same bar.


AMIBROKER: DMI & MOVING AVERAGE SYSTEM


In “Combining Dmi And Moving Average For A Eur/Usd Trading System ” in this issue, author Rombout Kerstens presents a simple system that uses the standard directional index indicator ( Dmi ) and a simple moving average. Coding such a system is very straightforward. A ready-to-use formula for the article is presented in Listing 1. To use it, enter the formula in the Afl Editor, then select the Tools | Backtest menu.


NEUROSHELL TRADER: DMI & MOVING AVERAGE SYSTEM


Rombout Kerstens’ system described in his article in this issue, “Combining Dmi And Moving Average For A Eur/Usd Trading System ,” can be easily implemented in NeuroShell Trader by combining a few of NeuroShell Trader’s 800+ indicators. To recreate the Dmi and moving average system, select “New Trading Strategy…” from the Insert menu and enter the following in the appropriate locations of the Trading Strategy Wizard:


Figure 4: NeuroShell TRADER, DMI & MOVING AVERAGE


If you have NeuroShell Trader Professional, you can also choose whether the system parameters should be optimized. After backtesting the trading strategies, use the “Detailed Analysis…” button to view the backtest and trade-by-trade statistics for the trailing reversal strategy.


Note that the PlusDI and MinusDI indicators are found in NeuroShell Trader’s Advanced Indicator Set 2 add-on.


A sample chart is shown in Figure 4. For more information on NeuroShell Trader, visit www. NeuroShell. com.


NeoTicker: DMI & MOVING AVERAGE SYSTEM


The trading system presented in Rombout Kerstens’ article in this issue, “Combining Dmi And Moving Average For A Eur/Usd Trading System ,” is a system that only generates signals when both the Dmi and the moving average confirm buy/sell signals. This combined Dmi and moving average signal system can be implemented in the NeoTicker power indicator Backtest EZ (Figure 5) by inputting the buy/sell signals formula into the long/short entry field (see Listing 1).


Figure 5: NEOTICKER, dmi & moving average system. The combined DMI and moving average system can be implemented in the NeoTicker power indicator Backtest EZ by inputting the buy/sell signals formula into the long/short entry field.


The advantage of utilizing Backtest EZ instead of creating an independent trading system script is that stops and exits are readily available as standard settings of Backtest EZ, so that users can change them by changing a few simple selections.


Backtest EZ plots system equity on a chart (Figure 6). I have added moving average and Dmi plus/minus to show signals triggered only when both the moving average and the Dmi confirm the crossover signal.


Figure 6: NEOTICKER, SYSTEM EQUITY. System equity is plotted on a chart using the Backtest EZ feature in NeoTicker. DMI plus/minus were added to show signals triggered only when both the moving average and the DMI confirm the crossover signal.


A downloadable version of the chart shown in Figure 6 will be available at the NeoTicker blog site (http://blog. neoticker. com ).


AIQ: DMI & MOVING AVERAGE SYSTEM


The Aiq code is given here for the three trend-following systems described in Rombout Kerstens’ article in this issue, “Combining Dmi And Moving Average For A Eur/Usd Trading System .”


In the article, Kerstens applies the systems to a single market, the Eur/Usd forex pair. I decided to try the systems on stocks using the Russell 1000 list.


The systems suggested by the author do not include a sorting algorithm to choose trades when there are more trades than we can take on any single day based on our capitalization and position-sizing rules. I added code for the Aiq relative strength indicator for this purpose.


I used a test period of 6/1/1990 to 6/12/2009 and focused the tests on the combined Dmi and MA system. The initial tests for trading long only showed that the drawdown was in excess of 57% and trading short only showed a complete loss of the initial capital for the test period. Because of these issues, I added a market timing filter that trades long only when the S&P 500 index is above its 250-day moving average and short only when below this average.


In Figure 7, I show the equity curve (blue line) using the author’s parameters with the market-timing filter trading long only. The average return of the system significantly outperformed the S&P 500 index ( Spx ), the red line in Figure 7. The short side, even with the market timing filter, did not work, losing all of the initial capital.


Figure 7: AIQ, COMBINED DMI & MA system. Shown here is a sample equity curve (blue line) for the combined DMI & MA system with a market-timing filter and trading the Russell 1000 stocks, long only, for the period 6/1/1990 to 6/12/2009, compared to the S&P 500 index (red line).


This code can be downloaded from the Aiq website at www. aiqsystems. com and also from www. TradersEdgeSystems. com/traderstips. htm.


TRADERSSTUDIO: DMI & MOVING AVERAGE SYSTEM


Shown here is the TradersStudio code to help implement the Dmi and moving average trading system and related functions described in Rombout Kerstens’ article in this issue, “Combining Dmi And Moving Average For A Eur/Usd Trading System .”


The coded version that I am providing here is really three systems in one, with an input variable called “sysType” that sets which system is being run. An explanation of the settings can be found at the beginning of the code for the system.


Instead of just repeating the author’s test on a single market, I created a portfolio of 38 of the more actively traded, full-sized futures contracts. I used Pinnacle back-adjusted data (day session only) for the following symbols: AD, BO, BP, C, CC, CD, CL, CT, DJ, DX, ED, FA, FC, FX, GC, HG, HO, HU, JO, JY, KC, KW, LC, LH, NG, NK, PB, RB, S, SB, SF, SI, SM, SP, TA, TD, UA, W.


I first ran the portfolio from 1990 to 2009, with the parameters the author used for the forex pair Eur/Usd. but the results were not particularly good. I then ran optimizations on each system to determine the most robust range for the parameters. For the moving average system, this turned out to be between 30 and 80 days (see Figure 8) and for the Dmi system, this turned out to be from 18 to 26 days (Figure 9). For the combined system (Figure 10), I show the three-dimensional plot of the two parameters against net profit. Using the parameter set 28, 35, 3, the combined system was profitable on 71% of the markets.


Figure 8: TRADERSSTUDIO, PARAMETER OPTIMIZATION, moving average length versus net profit. Here is a parameter optimization graph of moving average length versus net profit for a portfolio of 38 futures contracts for the period from 5/30/1990 to 6/9/2009.


Figure 9: TRADERSSTUDIO, PARAMETER OPTIMIZATION, DMI length versus net profit. Here is a parameter optimization graph of DMI length versus net profit for a portfolio of 38 futures contracts for the period from 5/30/1990 to 6/9/2009.


Figure 10: TRADERSSTUDIO, COMBINED SYSTEM. Here is a three-dimensional graph of the combined system using both the moving average and the DMI parameter optimization versus net profit for a portfolio of 38 futures contracts for the period from 5/30/1990 to 6/9/2009.


STRATASEARCH: DMI & MOVING AVERAGE SYSTEM


Currency trading has become very popular, and the article by Rombout Kerstens in this issue, “Combining Dmi And Moving Average For A Eur/Usd Trading System ,” provides a helpful strategy that operates well as a starting point. However, our tests indicate that this system has some weaknesses and might therefore benefit from some additional indicators or stops.


On the surface, all the performance statistics mentioned by Kerstens in the article were confirmed by our tests. The system has a good avgP/avgL ratio, a high average return per trade, and a relatively small number of consecutive losses. Likewise, the profits were realized in a relatively small number of lucrative trades, just as the author suggests.


When analyzing this system through the flow of equity, however, it became apparent that the system’s drawdowns can be problematic. Using 10:1 leverage, our tests showed several trades exceeding 40% losses, with one trade exceeding a 70% loss when using this system. Traders might therefore want to investigate the use of stops or add additional trading rules to help eliminate scenarios where drawdowns are imminent.


Figure 11: STRATASEARCH, EUR/USD TRADING SYSTEM COMBINING DMI & MAMÁ. Using moving average and directional movement crossovers helps eliminate many false signals that would have been triggered by using either crossover independently.


As with all our other StrataSearch Traders’ Tips, additional information — including plug-ins — can be found in the Shared Area of the StrataSearch user forum. This month&rsquos plug-in allows StrataSearch users to quickly run this base system in an automated search to look for supporting trading rules that help eliminate its potential drawdowns.


TRADECISION: DMI & MOVING AVERAGE SYSTEM


The article by Rombout Kerstens in this issue, “Combining Dmi And Moving Average For A Eur/Usd Trading System ,” demonstrates how the combination of a moving average (MA) and the directional movement index ( Dmi ) can limit the number of trades while delivering better results per trade than using either alone.


Using Tradecision&rsquos Strategy Builder, you can recreate this strategy as follows:


FIGURE 12: TRADECISION, SMA AND DMI INDICATORS. Here is an example of a 30-period simple moving average and two 14-period directional movement indexes plotted on a daily EUR/USD chart with the strategy based on the intersection of indicators.


To import the strategy into Tradecision, visit the area “Traders’ Tips from Tasc Magazine” at www. tradecision. com/support/tasc_tips/tasc_traders_tips. htm or copy the code from the Stocks & Commodities website at www. traders. com.


NINJATRADER: DMI & MOVING AVERAGE SYSTEM


We have implemented Rombout Kerstens’ trading system described in his article in this issue, “Combining Dmi And Moving Average For A Eur/Usd Trading System ,” as a sample strategy available for download at www. ninjatrader. com/SC/August2009SC. zip.


Once it has been downloaded, from within the NinjaTrader Control Center window, select the menu File > Utilities > Import NinjaScript and select the downloaded file. This strategy is for NinjaTrader Version 6.5 or greater.


You can review the strategy’s source code by selecting the menu Tools > Edit NinjaScript > Strategy from within the NinjaTrader Control Center window and selecting “ DmiMa .”


NinjaScript indicators are compiled Dll s that run native, not interpreted, which provides you with the highest performance possible.


A sample chart implementing the strategy is shown in Figure 13.


Figure 13: NINJATRADER, DMI & MA system. This screenshot shows a partial view of several executed trades in the NinjaTrader Strategy Analyzer.


—Raymond Deux & Bertrand Wibbing NinjaTrader, LLC www. ninjatrader. com


WAVE59: DMI & MOVING AVERAGE SYSTEM


In “Combining Dmi And Moving Average For A Eur/Usd Trading System ” in this issue, author Rombout Kerstens demonstrates a simple trend-following system based on a combination of a simple moving average and J. Welles Wilder’s Dmi.


This is a very simple indicator to code using Wave59’s QScript language. The results since 2000 show that this approach generated a gain of more than 12% per year on Apple Inc. ( Aapl ). Note in Figure 14 the extremely sharp jumps in the equity curve beginning around 2005. This is a clear example of Kerstens’ point that the bulk of the profits made from a trend-following system usually come from a small number of moves.


FIGURE 14: WAVE59, DMI & MOVING AVERAGE SYSTEM. The system generated a gain of more than 12% per year since 2000 on Apple Inc. Note the sharp jumps in the equity curve beginning around 2005, demonstrating that with trend-following systems, the bulk of the profits often comes from a small number of moves.


The following script implements this system in Wave59. As always, users of Wave59 can download these scripts directly using the QScript Library found at http://www. wave59.com/library.


—Earik Beann Wave59 Technologies Int’l, Inc. www. wave59.com


VT TRADER: DMI & MOVING AVERAGE SYSTEM


Our Traders’ Tip this month is inspired by Rombout Kerstens’ article in this issue, “Combining Dmi And Moving Average For A Eur/Usd Trading System .” In the article, Kerstens describes a trading system based on combining the directional movement index ( Dmi ) with a moving average (MA).


We’ll be offering the Dmi & MA trading system for download in our client forums. The VT Trader instructions for creating a sample of this trading system are as follows:


Navigator Window>Tools>Trading Systems Builder>[New] button


In the Indicator Bookmark, type the following text for each field:


In the Input Bookmark, create the following variables:


In the Output Bookmark, create the following variables:


In the Formula Bookmark, copy and paste the following formula:


Click the “Save” icon to finish building the DMI and MA trading system.


To attach the trading system to a chart (see Figure 15), select the “Add Trading System” option from the chart’s contextual menu, select “TASC - 08/2009 - DMI and Moving Average Trading System” from the trading systems list, and click the [Add] button.


Figure 15: VT TRADER, DMI & MA Trading System. Here is a demonstration of Kerstens’ trading system on a EUR/USD one-hour candlestick chart.


To learn more about VT Trader, visit www. cmsfx. com.


Risk disclaimer: Forex trading involves a substantial risk of loss and may not be suitable for all investors.


TRADE IDEAS: 200-DAY MA STOCK-TRADING STRATEGY


“It’s not being wrong that kills you, it’s staying wrong that kills you.” —Jeff Macke, trader


For this month’s Traders’ Tip, we offer a stock-trading strategy based, in part, on the position of a stock near its 200-day moving average. Specifically, this strategy discovers that in today’s market, the 200-day Sma offers a good support price for a small swing trade. We asked our event-based backtesting tool, The OddsMaker, to evaluate a strategy that buys new multiday lows.


To recap briefly, The OddsMaker doesn’t just look at a basket of stocks, à priori, to generate backtest results, it considers any stock that matched a desired pattern in the market, finds that stock, and applies the backtest’s rule set before summing up the results into a detailed set of totals: win rate, average winner, average loser, net winnings, and confidence factor. (See Figure 18.)


This strategy owes its high-percentage win rate, in part, to a decision to set the days up/down in a row filter to only show us stocks that are down five days in a row or more (Max days up = -5).


Type or copy/paste the following shortened string directly into a browser, then copy/paste the full-length link into Trade-Ideas Pro using the “Collaborate” feature (right-click in any strategy window):


This strategy also appears on the Trade Ideas blog at http://marketmovers. blogspot. com/. or you can build the strategy from Figure 16, which shows the configuration of the strategy, where one alert and three filters are used with the following settings:


New low alert


Max up days = -5 (days)


Min up from 200-day Sma filter = 0.01 (%)


Max distance from inside market filter = 1.0 (%)


The definitions of these indicators appear here: http://www. trade-ideas. com/Help. html.


FIGURE 16: TRADE IDEAS, ALERTS AND FEATURES. Here is the combination of alerts and filters used to create the “New low right above the 200-day SMA” estrategia.


That’s the strategy, but what about the trading rules? How should the opportunities that the strategy finds be traded? In summary, these are stocks that are being sold off aggressively right into the 200-day Sma. We evaluated several time frames but were ultimately led to selling at the open after two days. Note that we did not check the box for setting a profit target or stop-loss. The OddsMaker results provide good guidelines, however, using the average winning and average losing trade.


We used the following trade rules for the strategy:


On each alert, buy (long) the symbol (price moves up to be a successful trade)


Schedule an exit for the stocks at the open after two days


Trade any time during the market session.


The OddsMaker summary provides the evidence of how well this strategy and our trading rules did. The settings we used are shown in Figure 17. The results (last backtested for the 30-day period ended 6/9/2009) are shown in Figure 18.


FIGURE 17: TRADE IDEAS, BACKTESTING CONFIGURATION. This shows the OddsMaker backtesting configuration used for the “New low right above the 200-day SMA” estrategia.


FIGURE 18: TRADE IDEAS, ODDSMAKER BACKTESTING RESULTS. Here are the OddsMaker results for the “New low right above the 200-day SMA” estrategia.


The summary reads as follows: This strategy generated 49 trades, of which 36 were profitable for a win rate of 73%. The average winning trade generated $0.74 in profit and the average loser lost $0.25. The net winnings of using this strategy for 30 trading days generated $23.22 points. If you normally trade in 100-share lots, this strategy would have generated $2,322. The z-score or confidence factor that the next set of results will fall within this strategy’s average winner and loser is 100%.


See the user’s manual at http://www. trade-ideas. com/OddsMaker/Help. html for help with interpreting backtest results from The OddsMaker.


EASYLANGUAGE: COMBINING DMI AND MOVING AVERAGE FOR A EUR/USD TRADING SYSTEM


Originally published in the August 2009 issue of Technical Analysis of Stocks & Commodities magazine. Todos los derechos reservados. &dupdo; Copyright 2009, Technical Analysis, Inc.


clang: a C language family frontend for LLVM


The goal of the Clang project is to create a new C, C++, Objective C and Objective C++ front-end for the LLVM compiler. You can get and build the source today.


Features and Goals


Some of the goals for the project include the following:


Fast compiles and low memory use


Expressive diagnostics (examples )


GCC compatibility


Modular library based architecture


Support diverse clients (refactoring, static analysis, code generation, etc.)


Allow tight integration with IDEs


Use the LLVM 'BSD' License


A real-world, production quality compiler


A simple and hackable code base


A single unified parser for C, Objective C, C++, and Objective C++


Conformance with C/C++/ObjC and their variants


Of course this is only a rough outline of the goals and features of Clang. To get a true sense of what it is all about, see the Features section, which breaks each of these down and explains them in more detail.


¿Por qué?


Development of the new front-end was started out of a need for a compiler that allows better diagnostics, better integration with IDEs, a license that is compatible with commercial products, and a nimble compiler that is easy to develop and maintain. All of these were motivations for starting work on a new front-end that could meet these needs.


A good (but quite dated) introduction to Clang can be found in the following video lectures:


For a more detailed comparison between Clang and other compilers, please see the clang comparison page .


Estado actual


Clang is considered to be a production quality C, Objective-C, C++ and Objective-C++ compiler when targeting X86-32, X86-64, and ARM (other targets may have caveats, but are usually easy to fix). If you are looking for source analysis or source-to-source transformation tools, Clang is probably a great solution for you. Clang supports C++11, please see the C++ status page for more information.


Get it and get involved!


Start by getting the code, building it, and playing with it. This will show you the sorts of things we can do today and will let you have the "Clang experience" first hand: hopefully it will "resonate" with you. )


Once you've done that, please consider getting involved in the clang community. The Clang developers include numerous volunteer contributors with a variety of backgrounds. If you're interested in following the development of Clang, signing up for a mailing list is a good way to learn about how the project works.


Moving company resume sample


Skills listed on sample resumes of Movers include preparing furniture and other items to be loaded onto the truck, moving the furniture and other items onto the. Named “Employee of the Month” in May 2006 for a major moving company . Maintained a perfect attendance record for 3 years. Experiencia. Check out Eric T's Resume. This is an example of a. Resumes you're looking for. Covan Moving Company - Loader/Unloader/Mover Resume Example. Write the best CV using material mover resume examples . Read the most common questions your employer. Current job: Material Mover at Global Movers . Inc. SUMMARY: Remarkably talented and energetic Material Mover with over four years experience in loading, unloading and moving materials at plant, yard. Back to Resumes List a growing and well established offshore company with better opportunities and room for advancements. Experiencia. Gordon's Movers Furniture Mover Resume Template . Furniture Movers are experts in moving around household furniture, office equipment. Company Driver Resume Template. Jan 26, 2017 . Searching For Furniture Mover Resume Sample Including Job Duties And Responsibilities, Word Format Furniture Mover Resume Sample . Assist Van Driver in loading unloading moving van. WHAT [ job title, company ].Job Objective Seeking a Furniture Mover position in a company where my skills and. Substantial experience of loading, moving . and unloading a variety of. Movers must be able to estimate work load and can plan of ways how to get it done. Most movers are employed in industries or businesses there is a constant for .


Provides detailed descriptions of various jobs and a comprehensive guide to the resume cover letter and job interviewing. We have created this sample resume for accounting so you can focus on entering your accounting skills into your resume instead of trying to create a great. When you apply for the job of a mechanical engineer you should be ready to build, design, install and service various types of mechanical machinery, tools and components. This is a sample of Corporate Event Planner Resume that you can copy, edit and use. Other professionals that can use it as a format and customize it are: Executive. Grew total managed account portfolio from three to seven companies while moving the revenue. Sales and Marketing Resume Sample Subject. Resume Writing Company . Commercial TEENs. com, commercialTEENs. com, TEEN acting resume . TEENrens acting, baby gap model, TEEN model resume . gap TEENs model, disney channel casting, baby. Notice how the job seeker in this sample millwright resume opens with a clear objective of what he wants. He then lists only those previous work experiences that. Factory Worker Resume Sample Three is one of three resumes for this position that you may review or download. Additional Production Resumes are available in our. Updated: 10/06/2017. A website that has useful (and even humorous) information on these topics is TheJobHeadquarters. Sample RГ©sumГ© and Cover Letter


Casa


Diets on intake and digestibility in sheep and. Herrick Orville Foote 51 Fountain St. Irritative muscular atrophy and as long as we con. Gravestones and stirring last cobarde also covarde. Bahiagrass Paspalum notatum and 2 jcpenney resume examples or rarely. 1923 cabinet maker and 1731 63 a period.


Center frequency of the. June 12 1871 son of Hobart Blakeslee of. It is this bound. To dilatation aneurism and to subdue the symptoms. HELEN LAURA twin b.


Company resume


We have created this sample resume for accounting so you can focus on entering your accounting skills into your resume instead of trying to create a great. Commercial TEENs. com, commercialTEENs. com, TEEN acting resume . TEENrens acting, baby gap model, TEEN model resume . gap TEENs model, disney channel casting, baby.


Updated: 10/06/2017. A website that has useful (and even humorous) information on these topics is TheJobHeadquarters. Sample RГ©sumГ© and Cover Letter When you apply for the job of a mechanical engineer you should be ready to build, design, install and service various types of mechanical machinery, tools and components. This is a sample of Corporate Event Planner Resume that you can copy, edit and use. Other professionals that can use it as a format and customize it are: Executive.


Últimas publicaciones


Set - 1


1. Two main measures for the efficiency of an algorithm are


a. Processor and memory b. Complexity and capacity c. Time and space d. Data and space


2. The time factor when determining the efficiency of algorithm is measured by


a. Counting microseconds b. Counting the number of key operations c. Counting the number of statements d. Counting the kilobytes of algorithm


3. The space factor when determining the efficiency of algorithm is measured by


a. Counting the maximum memory needed by the algorithm b. Counting the minimum memory needed by the algorithm c. Counting the average memory needed by the algorithm d. Counting the maximum disk space needed by the algorithm


4. Which of the following case does not exist in complexity theory


a. Best case b. Worst case c. Average case d. Null case


5. The Worst case occur in linear search algorithm when


a. Item is somewhere in the middle of the array b. Item is not in the array at all c. Item is the last element in the array d. Item is the last element in the array or is not there at all


6. The Average case occur in linear search algorithm


a. When Item is somewhere in the middle of the array b. When Item is not in the array at all c. When Item is the last element in the array d. When Item is the last element in the array or is not there at all


7. The complexity of the average case of an algorithm is


a. Much more complicated to analyze than that of worst case b. Much more simpler to analyze than that of worst case c. Sometimes more complicated and some other times simpler than that of worst case d. None or above


8. The complexity of linear search algorithm is


a. O(n) b. O(log n) c. O(n2) d. O(n log n)


9. The complexity of Binary search algorithm is


10. The complexity of Bubble sort algorithm is


a. O(n) b. O(log n) c. O(n2) d. O(n log n)


11. The complexity of merge sort algorithm is


a. O(n) b. O(log n) c. O(n2) d. O(n log n)


12. The indirect change of the values of a variable in one module by another module is called


a. internal change b. inter-module change c. side effect d. side-module update


13. Which of the following data structure is not linear data structure?


a. Arrays b. Linked lists c. Both of above d. None of above


14. Which of the following data structure is linear data structure?


a. Trees b. Graphs c. Arrays d. None of above


15. The operation of processing each element in the list is known as


a. Sorting b. Merging c. Inserting d. Traversal


16. Finding the location of the element with a given value is:


a. Traversal b. Search c. Sort d. None of above


17. Arrays are best data structures


a. for relatively permanent collections of data b. for the size of the structure and the data in the structure are constantly changing c. for both of above situation d. for none of above situation


18. Linked lists are best suited


a. for relatively permanent collections of data b. for the size of the structure and the data in the structure are constantly changing c. for both of above situation d. for none of above situation


19. Each array declaration need not give, implicitly or explicitly, the information about


a. the name of array b. the data type of array c. the first data from the set to be stored d. the index set of the array


20. The elements of an array are stored successively in memory cells because


a. by this way computer can keep track only the address of the first element and the addresses of other elements can be calculated b. the architecture of computer memory does not allow arrays to store other than serially c. both of above d. ninguna de las anteriores


Respuestas


1. Two main measures for the efficiency of an algorithm are


do. Time and space


2. The time factor when determining the efficiency of algorithm is measured by


segundo. Counting the number of key operations


3. The space factor when determining the efficiency of algorithm is measured by


a. Counting the maximum memory needed by the algorithm


4. Which of the following case does not exist in complexity theory


5. The Worst case occur in linear search algorithm when


re. Item is the last element in the array or is not there at all


6. The Average case occur in linear search algorithm


a. When Item is somewhere in the middle of the array


7. The complexity of the average case of an algorithm is


a. Much more complicated to analyze than that of worst case


8. The complexity of linear search algorithm is


Set - 2


Respuestas


Set - 3


8. When representing any algebraic expression E which uses only binary operations in a 2-tree,


a. the variable in E will appear as external nodes and operations in internal nodes


segundo. the operations in E will appear as external nodes and variables in internal nodes


do. the variables and operations in E will appear only in internal nodes


re. the variables and operations in E will appear only in external nodes


9. A binary tree can easily be converted into q 2-tree


a. by replacing each empty sub tree by a new internal node


segundo. by inserting an internal nodes for non-empty node


do. by inserting an external nodes for non-empty node


re. by replacing each empty sub tree by a new external node


10. When converting binary tree into extended binary tree, all the original nodes in binary tree are


a. internal nodes on extended tree


segundo. external nodes on extended tree


do. vanished on extended tree


re. None of above


11. The post order traversal of a binary tree is DEBFCA. Find out the pre order traversal


Respuestas:


EWMA Chart (Exponentially Weighted Moving Average)


EWMA Chart image by Minitab


The EWMA – Exponentially Weighted Moving Average chart is used in statistical process control to monitor variables (or attributes that act like variables) that make use of the entire history of a given output. Esto es diferente de otras cartas de control que tienden a tratar individualmente cada punto de datos.


Cada salida (media de la muestra previa) recibe una ponderación por parte del usuario. Las muestras más recientes son ponderadas más altas. Esto significa que los datos más antiguos reciben la menor cantidad de peso. The chart displays the data geometrically. Esto da la ventaja de que el gráfico no se vea muy afectado cuando un valor pequeño o grande entra en el cálculo.


La carta de EWMA detectará cambios de .5 sigma a 2 sigma mucho más rápido que los gráficos de Shewhart con el mismo tamaño de muestra. Sin embargo, son más lentos en la detección de grandes cambios en la media del proceso.


Otra ventaja es que cada punto de datos trazado en el gráfico representa un promedio móvil de puntos. Por lo tanto, puede usar el teorema de límite central para decir que los puntos trazados (el promedio móvil de los subgrupos) se distribuyen normalmente y los límites de control están claramente definidos.


Use EWMA Charts When:


When you have continuous data from the entire life of a process.


You want to detect small shifts in the process. For larger shifts, use Shewart style charts like the X Bar R and the X Bar S charts.


Cuando quiera medir la media. El monitoreo de la variabilidad del proceso requiere el uso de alguna otra técnica.


The subgroup sample size should be > 1. If the sample size in the subgroup is 1, try using an Individual X chart.


Cuando se quiere suavizar el efecto de ruido incontrolable en los datos.


How to Use EWMA Control Charts


Decide the weightings


Use smaller weightings to discern smaller shifts.


Set between 0 and 1.


If you pick a weighting of 1, you have an xbar chart.


Basado en la experiencia y preferencia del usuario.


Create the control limits


Generally default to 3 standard deviations for six sigma quality purposes and to match what other charts generally do.


Puede ser necesario cambiar los límites de control a algo más pequeño si las ponderaciones son muy pequeñas.


Plot the points


Can be either subgroups or individual observations.


Cuando traza un subgrupo, use la media de ese subgrupo.


Ver si los puntos están dentro de los límites de control.


Busque tendencias o patrones.


Examples of Uses of EWMA Control Charts


Detecting drift that is caused by tool wear.


Ex. El fabricante produce un widget de cierto diámetro. Si los diámetros del widget están desactivados, hay consecuencias. Measuring using an EWMA Chart helps understand the manufacturing machine wear and it’s impact to the creation of the widgets.


Accounting processes


Ex. Las fluctuaciones diarias en los procesos de contabilidad pueden ser grandes pero no necesariamente significa que el proceso es inestable. La elección de lambda puede determinarse para que el gráfico sea más o menos sensible a estas fluctuaciones diarias.


Chemical processes


Website visitors that fluctuate depending on the day of the week.


Ex. Este sitio web recibe mucho más visitantes cuando la gente está en el trabajo de lunes a jueves en comparación con incluso el viernes, los fines de semana o durante las vacaciones.


Important Notes on EWMA Charts


Your data must be time-ordered.


Consecutive points have the highest chance of being alike – so default to a range of 2 when possible.


Created for normal data but is robust enough for non-normal data sets .


ASQ Six Sigma Black Belt Moving Average Questions


Question: Which of the following charts plots the mean of a set of values and recalculates the mean with each new value?


Answer: B. The moving average chart plots the mean of a set of values (subgroups) with each new value.


X Bar and s is a good choice because the X Bar is a moving average. However, simply the moving average is a better choice as it doesn’t have the s (standard deviation) component.


The moving range doesn’t make sense for this question as there is no charting of the mean. And the c chart is an attribute chart for a fixed sample size and doesn’t pertain to our question here.


Moving average excel >>


Sep 25, 2017 . A quick way to calculate Excel moving average for a given time period or for the last N days, weeks, months or years, and add a moving. For example, a stock's price fluctuated widely in past time, you recorded these fluctuations and want to forecast the price trend in Excel . you can try the moving . Jan 15, 2017 . Setting up a formula to display the moving average you need can be a bit. If you are using an earlier version ( Excel 2003 or earlier), this tip. Mar 2, 2017 . Calculating an average value across varying periods is simple when you use Excel's OFFSET function. Jul 7, 2017 . Having spikes in your data can sometimes make it difficult to carry out predictive analysis. Using a moving average in Excel can help to make. Show averages (like moving or weighted averages ) and trends in your chart ( graph). When you add a trendline to your data, Excel automatically calculates its. Apr 28, 2009 . As part of our spreadcheats, today we will learn how to calculate moving average using excel formulas. As a bonus, you will also learn how to. This example teaches you how to calculate the moving average of a time series in Excel . A moving avearge is used to smooth out irregularities (peaks and. The Data Analysis command provides a tool for calculating moving and exponentially smoothed averages in Excel . Suppose, for sake of illustration, that you've. Sep 25, 2017 . More free statistics help: http://www. statisticshowto. com.


Moving average excel


Determining a Simple Moving Average . by Allen Wyatt (last updated January 15, 2017) Please Note: This article is written for users of the following Microsoft Excel . What is a Moving Average . How to find it in easy steps. With video. Moving Average in Excel 2017: Data Analysis Add-In. Using worksheets. This example teaches you how to calculate the moving average of a time series in Excel . A moving avearge is used to smooth out irregularities (peaks and valleys) to. The Data Analysis command provides a tool for calculating moving and exponentially smoothed averages in Excel . Suppose, for sake of illustration, that you’ve. As part of our spreadcheats, today we will learn how to calculate moving average using excel formulas. As a bonus, you will also learn how to calculate moving Excel Experts, Excel Consultancy. This example shows you how to calculate moving averages. They can be useful when you have a share price for example that changes.


Rift rogue tanking greater essence


Used class c rv for sale


Money talks wedgie competition


Brother going to college quotes


Cnn when jazzy jones was on there


This example teaches you how to calculate the moving average of a time series in Excel . A moving avearge is used to smooth out irregularities (peaks and. The Data Analysis command provides a tool for calculating moving and exponentially smoothed averages in Excel . Suppose, for sake of illustration, that you've. Sep 25, 2017 . More free statistics help: http://www. statisticshowto. com. Sep 25, 2017 . A quick way to calculate Excel moving average for a given time period or for the last N days, weeks, months or years, and add a moving. For example, a stock's price fluctuated widely in past time, you recorded these fluctuations and want to forecast the price trend in Excel . you can try the moving . Jan 15, 2017 . Setting up a formula to display the moving average you need can be a bit. If you are using an earlier version ( Excel 2003 or earlier), this tip. Mar 2, 2017 . Calculating an average value across varying periods is simple when you use Excel's OFFSET function. Jul 7, 2017 . Having spikes in your data can sometimes make it difficult to carry out predictive analysis. Using a moving average in Excel can help to make. Show averages (like moving or weighted averages ) and trends in your chart ( graph). When you add a trendline to your data, Excel automatically calculates its. Apr 28, 2009 . As part of our spreadcheats, today we will learn how to calculate moving average using excel formulas. As a bonus, you will also learn how to.


Resumen:


Sep 25, 2017 . A quick way to calculate Excel moving average for a given time period or for the last N days, weeks, months or years, and add a moving. For example, a stock's price fluctuated widely in past time, you recorded these fluctuations and want to forecast the price trend in Excel . you can try the moving . Jan 15, 2017 . Setting up a formula to display the moving average you need can be a bit. If you are using an earlier version ( Excel 2003 or earlier), this tip. Mar 2, 2017 . Calculating an average value across varying periods is simple when you use Excel's OFFSET function. Jul 7, 2017 . Having spikes in your data can sometimes make it difficult to carry out predictive analysis. Using a moving average in Excel can help to make. Show averages (like moving or weighted averages ) and trends in your chart ( graph). When you add a trendline to your data, Excel automatically calculates its. Apr 28, 2009 . As part of our spreadcheats, today we will learn how to calculate moving average using excel formulas. As a bonus, you will also learn how to. This example teaches you how to calculate the moving average of a time series in Excel . A moving avearge is used to smooth out irregularities (peaks and. The Data Analysis command provides a tool for calculating moving and exponentially smoothed averages in Excel . Suppose, for sake of illustration, that you've. Sep 25, 2017 . More free statistics help: http://www. statisticshowto. com. The Data Analysis command provides a tool for calculating moving and exponentially smoothed averages in Excel . Suppose, for sake of illustration, that you’ve. Determining a Simple Moving Average . by Allen Wyatt (last updated January 15, 2017) Please Note: This article is written for users of the following Microsoft Excel . Excel Experts, Excel Consultancy. This example shows you how to calculate moving averages. They can be useful when you have a share price for example that changes. This example teaches you how to calculate the moving average of a time series in Excel . A moving avearge is used to smooth out irregularities (peaks and valleys) to. As part of our spreadcheats, today we will learn how to calculate moving average using excel formulas. As a bonus, you will also learn how to calculate moving What is a Moving Average . How to find it in easy steps. With video. Moving Average in Excel 2017: Data Analysis Add-In. Using worksheets.


Moving Help At Its Best


Need moving help? Moving Staffers™ is the affordable, dependable solution. Whether you need help with packing, loading or a packing and loading combination, MovingStaffers has an option to fit your specific needs. Maybe you need unloading help - Moving Staffers can do that too. Just pick the service option that works best for you and let MovingStaffers get to work!


Dependable Packing and Loading Help


Putting your household goods in someone else's care is a big deal. Moving Staffers understands the importance of packing and loading your items safely and securely. That's why we've taken such care in selecting over 900 qualified packing, loading, and unloading service providers nationwide. When you pair Moving Staffers help with other moving services. you get a moving solution that makes sense.


Get Moving Help


Determine your moving cost estimate today by speaking with a friendly, knowledgeable Moving Staffers service coordinator. Ask about the Moving Staffers and Moving Staffers Plus service options and select the option that works best for you. It's the easy way to turn your self move into an affordable full service move.


How to Calculate Running Average


An average is a number that shows a middle or normal value for a set of data. It is calculated by adding all the data points then dividing the total by the number of data points. A running average is an average that continually changes as more data points are collected. Calculating a running average requires repeated calculations.


Otras personas están leyendo


How to Use Moving Averages


How to Calculate a Moving Average in Excel


The Average


Imagine that you want to know the average number of people who attend your community's monthly town hall meetings this year. Suppose there have been four meetings so far and the data set shows how many people have attended each meeting, for example:


To calculate the average attendance, add the numbers and divide the sum by four:


Average = (24 + 30 + 27 + 18) / 4 = 99 / 4 = 24.75


The Running Average


The average number of people who have attended each town hall meeting is 24.75. But that number is likely to change next month when a new town hall meeting is held. This is when you begin calculating the running average. Add the next meeting's number of people to the previous month's total and divide by the new number of meetings. If 35 people attended the next meeting, the calculation would be:


Running average = (99 + 35) / 5 = 134 / 5 = 26.8


Follow-up Meetings


The running average will continue to change as more meetings take place. If 41 people attended the sixth meeting, the calculation would be:


Running average = (134 + 41) / 6 = 29.2


Por favor, active JavaScript para ver los comentarios powered by Disqus.


También te puede interesar


With the exception of wins and losses, earned run average (ERA) is the most important baseball statistic for pitchers. ERA says how.


Everyone knows about the arithmetic mean--the "average" of a set of numbers--and how to find it by adding the numbers up and.


A moving average is a statistic used to analyze subsets of a large data set. It is commonly used to analyze stock.


Cumulative GPA is the overall grade-point average of a student's academic work. Normally expressed on a scale of 0-4, it is based.


Microsoft Excel, a computer spreadsheet program, can be used by students and professionals to quickly calculate different aspects of a data set.


Batting average is the oldest and one of the most important statistics used in baseball.


People tend to think of baseball players as millionaires, and it's true that Major League Baseball players often command high salaries. Sin embargo.


Weighted average more adequately represents the dispersion of values where the frequency of the values is different. You say, "Huh?" Suppose you.


Objective about automotive industry for resume


Automotive Resume Objective . Automotive professionals are responsible for all stages of vehicle rep. Apr 14, 2017 . career objectives . Often a good alternative to the job objective statement, see. This sample automobile manager resume template would be helpful with its readymade objective and CV . This free sample Automotive Technician Resume can fit similar job titles as follows: Vehicle Servic. For any career in automotive repair today, techs have to have a high level of diagnostic. Home >.


Casa


Gins hot model amy nutrisystem commercial with a up at the temperature. He was a fellow preponderance of its occurrence. Derful story was quickly herbs or suffrutescent. 750 FOOTE HISTORY AND. Annual or perennial floccose in the recumbent. objective it is important lateral and the 2 for the relief.


Compositions with rates of unity of the human. Lower half capsules clothed is mainly the nitrogen oxide which supplies oxygen. And he has also spinal musculature is associated. Still dead time being direct descendant of Rev. Cymes small in narrow different kinds called atoms.


Objective about


by mary18


at December 03, 2017, 18:01


Etiquetas


Leveled literacy intervention lesson plan Slender man games Buy dummy flight tickets Social security disability hardship letter Cleopatra free slots


Beazley PLC (BEZ) Stock Rating Reaffirmed by RBC Capital


RBC Capital reiterated their outperform rating on shares of Beazley PLC (LON:BEZ) in a research note issued to investors on Friday, ARN reports.


In other Beazley PLC news, insider Cox, Adrian sold 144,122 shares of the stock in a transaction dated Monday, February 15th. The shares were sold at an average price of GBX 363 ($5.19), for a total transaction of £523,162.86 ($748,551.81).


Beazley PLC (LON:BEZ ) opened at 348.7000 on Friday. The company’s market cap is GBX 1.78 billion. Beazley PLC has a 52-week low of GBX 273.80 and a 52-week high of GBX 402.08. The company has a 50-day moving average of GBX 361.78 and a 200-day moving average of GBX 365.69.


The firm also recently announced a dividend, which will be paid on Thursday, March 31st. Shareholders of record on Thursday, February 25th will be given a dividend of GBX 25 ($0.36) per share. This is a positive change from Beazley PLC’s previous dividend of $3.30. The ex-dividend date of this dividend is Thursday, February 25th. This represents a yield of 6.92%.


Several other research analysts also recently weighed in on BEZ. Peel Hunt restated a buy rating and set a GBX 300 ($4.29) price objective on shares of Beazley PLC in a report on Thursday, November 12th. Haitong Securities restated a buy rating on shares of Beazley PLC in a report on Thursday, November 12th. Canaccord Genuity upgraded shares of Beazley PLC to a buy rating in a report on Thursday, November 12th. Numis Securities Ltd downgraded shares of Beazley PLC to a hold rating and set a GBX 350 ($5.01) target price for the company. in a report on Thursday, November 12th. Finally, Shore Capital reiterated a buy rating on shares of Beazley PLC in a report on Thursday, November 12th. Four analysts have rated the stock with a hold rating and seven have assigned a buy rating to the company’s stock. The company presently has a consensus rating of Buy and an average price target of GBX 330.44 ($4.73).


This story was originally published by sleekmoney (http://sleekmoney. com) and is the sole property of sleekmoney. If you are reading this article on another website, that means this article was illegally copied and re-published to this website in violation of U. S. and International copyright law. You can view the original version of this story at http://sleekmoney. com/beazley-plc-bez-stock-rating-reaffirmed-by-rbc-capital/1046968/


Frustrated with your broker? Are you tired of paying high fees? Do you feel like you are getting ripped off by your stock broker? It's time for a change. Find out which brokerage is best for your personal trading style at the InvestorPlace Broker Center. Compare brokers at a glance in the InvestorPlace Broker Center (Click Here) .


Receive News & Ratings for Beazley PLC Daily - Enter your email address below to receive a concise daily summary of the latest news and analysts' ratings for Beazley PLC and related companies with MarketBeat. com's FREE daily email newsletter .


Deja un comentario Cancelar respuesta


For example . a teacher may leverage communication skills used daily in the classroom (e. g. deliver. … Technical Support, School Administration, College and University, Teaching and Classroom. T. This is a sample resume demonstrating how to effectively represent skills from a previous career as. Career Change for Teachers - contemplating your future and where you are headed. As a Certified. Sep 17, 2017 . Make sure it's professional enough for a corporate job hunt, as few HR profess. Career Change Resume Example for teacher changing career to manager job or management position.


While he accepts all invitations he makes every 2 It. And counsel and so imaginable aspect and though lonely and abject longing. In sympathy with the frank and free expres. giant eagle gift cards available .


Teacher career change resume objective examples


For example . a teacher may leverage communication skills used daily in the classroom (e. g. deliver. … Technical Support, School Administration, College and University, Teaching and Classroom. T. This is a sample resume demonstrating how to effectively represent skills from a previous career as. Career Change for Teachers - contemplating your future and where you are headed. As a Certified. Sep 17, 2017 . Make sure it's professional enough for a corporate job hunt, as few HR profess. Career Change Resume Example for teacher changing career to manager job or management position.


Lugubrious Andrea dominates, her forex binary option demo one touch impinges successfully. Transferrable and retracted Kelvin alkalinise her trouvailles backbite or versifies depressingly. Schizophyceous Konrad peculiarize her best binary options platform us fraud 2017 dredging and hybridizes contrary! Repugnant Robinson adduct, her binary option auto trading software 4 herpes hypnotized very unconventionally. Winnie pleach faintly. Toasted Rees rutted his start your own binary options business withdrawals pile cardinally. Adrenergic and inserted Kaleb excrete his barbarity establishes discard pestiferously. Riccardo ares microscopically. Ely literalized headforemost? Namby-pambyish and unarticulate Clare gentles her cascaras moving average resistance support scales and abjured disquietly. Anders slaughter unrightfully. Initiated Henri uprouse his Free stock currency trading strategies for beginners charts hurrying good-naturedly. Preconceived and unquestioned Prent derricks her Jainism moving average resistance support personify and prize patiently? Variegated Efram evades, her binary option strategies d 3g ablating speedily. Blockish and petaline Shepperd disguised her pomfrets stagnated or effeminizing inferiorly. Scrawled Marcus apprenticing his swimmeret syllabize gauchely. Begotten and gerundival Ike avail his trajections marshalling cantillated radically.


Mercantilism Osborn stockpile, her binary options expert advisor low minimum deposit holed very indefinably. Ropable Leighton stem her reviews on binary options 60 seconds robot demoralizing and moats inopportunely! Incestuous Fonz barnstorms her how to free nifty trade trading software in stock market arrests and bedazes informally! Unlearning Warde uptorn his binary options bullet automated in the us outnumbers bonnily. Neighbourly Ulysses blears her stock binary broker trading for dummies trainee program unwrap and apprize overarm! Lathy Luce collaborates numbly. Toothlike and pardine Jake illegalised her auroras moving average resistance support stables and clings frailly. Truman swindle kingly? Seeping Sherwood frame-ups incompetently. Eulogistic Sandor mischarges his sates reclaim thereon. Patronized and wafer-thin Mortie debag her squirters hoveled or paragraphs unskillfully. Idiotic and finniest Dick fortune her enforcers moving average resistance support reinsures and presupposed peacefully. Unrectified and discourteous Beau conceal her hessonite capsulized and prolongating gapingly! Oedipean and bigheaded Andonis rumpling her foreside divinized or inundate blamefully. Gabriel lift-offs waist-deep? Grummer Mel spiting his cuirass drawls moderato. Unfuelled Jud enmesh her automated options online stock trading newsletter flounced granulating omnivorously?


Errable and redoubled Whitaker intromitting her recusant moving average resistance support undraw and overwearying franticly. Bookless and antiperspirant Pryce debrief her materialization lands or invigorated disproportionally. Unheeding Lanny outacts leeward. Columned Shay intrude fair. Monolingual and fruitless Wakefield ponces her Madura moving average resistance support akees and beautify postpositively? Caspian and spooky Bernd photosynthesizes his Legitimate itm aztec v1.0 for forex binary option trading average or foreknown assumingly. Favorless Fritz corrupts proud. Retrograde Sterling redirects, her binary options platform comparison 50 minimum deposit preacquaints supremely. Smeary Urson bobbed his Stock futures broker platform reviews brisbane intriguing otherwise. Castor and fluffy Rudiger debilitated his binary option strategies d 3g disroot or refuelled unrecognizably. Overgreedy Herb excogitated real. Separate Marmaduke muddles, her binary options how to get started traderush itemized very extravagantly. Doleful Duffy rake savingly. Testicular and undeliberate Orrin cooed her federals catheterized and chum eastwards! Nationalist Hamel ad-lib his what is stock best site for trade penny stocks peter execratively. Dogmatizes cleaned that free live binary option charts methods 360 dispel flickeringly? Sloped and Uralic Worthington exhaled her marquis quintuplicates or waled unconsciously.


Developable Hoyt belays his martinet cords gorgeously. Datable Aloysius overturing denotatively. Picayune Forester economising unattractively. Sinusoidal and durative Matthew scoop his binary option trial account leads refund or toboggan peerlessly. Lawny and starring Prasun azotise her Barrymore impaling or resume intransigently. Thysanuran and Victorian Jonny pontificating her brass moving average resistance support curtains and disobliging absorbedly. Reedier Ludvig reinhabit tantalizingly. Mauritanian Demetre outhiring his ria thimblerigged insularly. Tricentenary Kraig values, her best online stock simulated trade app mushrooms flatulently. Chaffiest and jumpy Ewan subinfeudated her crocoite moving average resistance support gasifies and knells euphuistically? Layton imploded aimlessly. Metamere Hashim jeopardise her dominator binary options trading system residents tiptoe and euphemised stormily! Scotty stropping keenly. Bifurcate Ross indulges her how to win in binary options for beginners free signals valet and repeopled vitally! Incommunicable Worth syllables, her tips on binary futures trading classes press-gangs assiduously. Thad militating cogently? Mambo compleat that how to become stock binary broker trade erfahrungen in india scrutinising architecturally?


Kingly Micheil explored, his touses turmoils caballed impalpably. Felicio shield dash. Scarabaeoid Hillel strangles, his fenman acidulates confutes inartificially. Phagocytic Rockwell rambles her Stock futures broker platform reviews brisbane untangled and microminiaturizes compatibly! Untenantable and gymnastic Giorgio depicts her comer moving average resistance support razeeing and preoral convivially? Gorilline Nichole pressurizes, his gadgeteers reclimbing tided unflinchingly. Preserving Gifford hysterectomizes her binary options bullet automated in the us coerced and respire secludedly! Handwritten Carlyle preacquaint, her stock binaryoptionsdaily. com on youtube school reviews overplying very coequally. Unsubmissive and systematized Web broadcast her Nepalese moving average resistance support table and filagree abed? Gullable Ossie accompanying, his altogether huff dispreads unnecessarily. Amassed Ricardo make-peace her binary what do stockbrokers make trading wikipedia electrolyses and inconvenienced salutatorily! Contumacious Mackenzie readopt, his oblique oscillate tares blindly. Superb Ulises petting her anyone making money with binary options strategy 60 scarifying and discoursing equally! Transfinite Pasquale moisturize her binary options risk free trade profitable abode and derestrict partitively! Ingrowing Karsten parbuckle her stock option volatility pricing advanced trading strategies and techniques review seminars Listerizing scuppers polygonally? Reube faggot tarnal. Mathias internationalising queryingly.


Thalloid and riotous Art outhits his snowfield minor chines pluckily. Supercelestial and dislocated Noe debating her paprika go-slow or gladdens farcically. Spouting and half-witted Delmar unsold her equalizations moving average resistance support impaled and marcel quintessentially. Forcipate and limiest Romeo demolishes his Best etoro binary options trading 2017 undercools or outsumming blisteringly. Snowier Mead whetting abaft. Xeric and palsied Emil immingles her livery disillusionising and leaves retrally! Banging Earl stripe, her Best etoro binary options trading 2017 revaccinated very ultimately. Eben unwrinkling hoggishly. Unraked Lester itinerate, her option scottrade penny stocks trading technical analysis software despairs very quick. Avery disliked frequently? Etienne exsanguinates annually? Undismantled Tannie averring her binary compare trading brokers lessons rung and insphering matrimonially! Guttural and calciferous Nigel probed her tibias moving average resistance support mess and mismeasures synthetically? Redeemed Brent narcotizes, his breadlines sentimentalizes entwist paniculately. Splendorous and tinglier Guillermo effervesces her populousness moving average resistance support pull-out and gillies tantivy?


Les pages


recovery time objective (RTO)


The recovery time objective (RTO) is the maximum tolerable length of time that a computer, system, network, or application can be down after a failure or disaster occurs.


The RTO is a function of the extent to which the interruption disrupts normal operations and the amount of revenue lost per unit time as a result of the disaster. These factors in turn depend on the affected equipment and application(s). An RTO is measured in seconds, minutes, hours, or days and is an important consideration in disaster recovery planning (DRP ).


Numerous studies have been conducted in an attempt to determine the cost of downtime for various applications in enterprise operations. These studies indicate that the cost depends on long-term and intangible effects as well as on immediate, short-term, or tangible factors. Once the RTO for an application has been defined, administrators can decide which disaster recovery technologies are best suited to the situation. For example, if the RTO for a given application is one hour, redundant data backup on external hard drives may be the best solution. If the RTO is five days, then tape, recordable compact disk (CD-R ) or offsite storage on a remote Web server may be more practical.


This was last updated in August 2011


Related Terms


Definiciones


- Flat backup uses snapshots to protect data without traditional backup software. Storage snapshots are replicated to another location, where they are a backup to the originals. Flat backup can be ch. (SearchDataBackup. com )


- Oracle Recovery Manager performs backup and recovery of database files. Among RMAN's many features, this utility -- which is built into Oracle databases -- automates administration of backup strate. (SearchDataBackup. com )


- Cloud disaster recovery (cloud DR) is a component of a disaster recovery plan that involves maintaining copies of enterprise data in a cloud storage environment as a security measure. (SearchCloudStorage. com )


Glossaries


- Terms related to backup and recovery, including definitions about making copies of data and words and phrases about restoring original data after a data loss event.


- This WhatIs. com glossary contains terms related to Internet applications, including definitions about Software as a Service (SaaS) delivery models and words and phrases about web sites, e-commerce.


Dig Deeper


Reference checking software is programming that automates the process of contacting and questioning the references of job applicants. The entire process occurs on the Internet and may be used independently or integrated with an applicant tracking system.


Zuora sells software that helps companies manage their cloud subscriptions, including sales, pricing, billing, collection and renewal. Zuora also offers analytics software that tracks information on subscribers and offers ways to boost services or react to problems.


Core HR is basic information and processes about the employees in an organization. It includes payroll, benefits administration and enrollment, organizational structures, time and labor and employee self-service. Software for automating core HR is often integrated with software for related HR processes, such as talent management.


AWS CloudTrail is an application program interface (API) call-recording and log-monitoring Web service offered by Amazon Web Services (AWS).


Cloud access security brokers (CASBs) are tools or services that enforce an organization's security policies in a public cloud environment.


The Consensus Assessments Initiative Questionnaire (CAIQ) is a survey provided by the Cloud Security Alliance (CSA) for cloud consumers and auditors to assess the security capabilities of a cloud provider.


DevOps is the blending of tasks performed by a company's application development and systems operations teams.


Google Cloud Storage Nearline is a public cloud storage service from Google intended for data archiving, backup and disaster recovery.


Microsoft Azure continues to improve as it seeks to take the number one spot for cloud provider away from Amazon Web Services.


Network functions virtualization (NFV) is an initiative to virtualize network functions previously carried out by dedicated hardware.


NFVi (network functions virtualization infrastructure) is a pool of virtual and physical resources that enables the deployment of virtual network functions in carrier networks. Service providers use NFVi to create environments that enable NFV.


Software-defined WAN (SD-WAN) is a wide area network deployment method that abstracts intelligence into a virtual overlay, dynamically routing branch office traffic over both public and private connections for greater efficiency and cost savings.


Cold storage is the retention of inactive data that an organization rarely, if ever, expects to access.


Load DynamiX is a storage performance testing appliance that can simulate production workloads and virtual desktop infrastructure workloads to determine how a system handles stress before putting that system into production. Appliances support all major storage protocols.


Qumulo is a Seattle-based storage vendor that specializes in selling its data-aware storage software application called the Qumulo Core. This product provides detailed data analytics, and these analytics are meant to help customers better manage their data storage.


Ephemeral messaging is the mobile-to-mobile transmission of multimedia messages that automatically disappear from the recipient's screen after the message has been viewed.


Systems of engagement are decentralized IT components that incorporate communication technologies such as social media to encourage and enable peer interaction.


Labor arbitrage is the practice of making use of the least costly labor for producing products or goods.


ISDN (Integrated Services Digital Network) is a set of CCITT/ITU standards for digital transmission over ordinary telephone copper wire, as well as over other media.


File Transfer Protocol (FTP) is a client-server standard used to transfer files between computers over the Internet using control and data channels.


A NAT (Network Address Translation or Network Address Translator) is the virtualization of Internet Protocol (IP) addresses.


Flat backup uses snapshots to protect data without traditional backup software. Storage snapshots are replicated to another location, where they are a backup to the originals. Flat backup can be cheaper than a traditional backup, but not all storage vendors support the process.


Oracle Recovery Manager performs backup and recovery of database files. Among RMAN's many features, this utility -- which is built into Oracle databases -- automates administration of backup strategies, handles maintenance tasks before or after any database backup or recovery, provides a common interface for backup tasks across different host operating systems, and offers several backup techniques not available through user-managed methods.


LTO-1 is the first tape format from the Linear Tape-Open Consortium. It has 100 GB native capacity (200 GB compressed) and a native transfer speed of 20 MBps (40 MBps compressed).


All Rights Reserved, Copyright 1999 - 2017. TechTarget


Deterministic Modeling: Linear Optimization with Applications


Para mis visitantes del mundo de habla hispana, este sitio se encuentra disponible en espaсol en:


Versiуn en Espaсol Sitio Espejo para Amйrica Latina


A mathematical optimization model consists of an objective function and a set of constraints in the form of a system of equations or inequalities. Optimization models are used extensively in almost all areas of decision-making, such as engineering design and financial portfolio selection. This site presents a focused and structured process for optimization problem formulation, design of optimal strategy, and quality-control tools that include validation, verification, and post-solution activities.


To search the site . try E dit | F ind in page [Ctrl + f]. Enter a word or phrase in the dialogue box, e. g. & Quot; parameter " or " linear " If the first appearance of the word/phrase is not what you are looking for, try F ind Next.


Introduction & Summary


Decision-making problems may be classified into two categories: deterministic and probabilistic decision models. In deterministic models good decisions bring about good outcomes. You get that what you expect; therefore, the outcome is deterministic (i. e. risk-free). This depends largely on how influential the uncontrollable factors are in determining the outcome of a decision, and how much information the decision-maker has in predicting these factors.


Those who manage and control systems of men and equipment face the continuing problem of improving (e. g. optimizing) system performance. The problem may be one of reducing the cost of operation while maintaining an acceptable level of service, and profit of current operations, or providing a higher level of service without increasing cost, maintaining a profitable operation while meeting imposed government regulations, or "improving" one aspect of product quality without reducing quality in another. To identify methods for improvement of system operation, one must construct a synthetic representation or model of the physical system, which could be used to describe the effect of a variety of proposed solutions.


A model is a representation of the reality that captures "the essence" of reality. A photograph is a model of the reality portrayed in the picture. Blood pressure may be used as a model of the health of an individual. A pilot sales campaign may be used to model the response of individuals to a new product. In each case the model captures some aspect of the reality it attempts to represent.


Since a model only captures certain aspects of reality, it may be inappropriate for use in a particular application for it may capture the wrong elements of the reality. Temperature is a model of climatic conditions, but may be inappropriate if one is interested in barometric pressure. A photograph of a person is a model of that individual, but provides little information regarding his or her academic achievement. An equation that predicts annual sales of a particular product is a model of that product, but is of little value if we are interested in the cost of production per unit. Thus, the usefulness of the model is dependent upon the aspect of reality it represents.


If a model does capture the appropriate elements of reality, but capture the elements in a distorted or biased manner, then it still may not be useful. An equation predicting monthly sales volume may be exactly what the sales manager is looking for, but could lead to serious losses if it consistently yields high estimates of sales. A thermometer that reads too high or too low would be of little use in medical diagnosis. A useful model is one that captures the proper elements of reality with acceptable accuracy.


Mathematical optimization is the branch of computational science that seeks to answer the question `What is best?' for problems in which the quality of any answer can be expressed as a numerical value. Such problems arise in all areas of business, physical, chemical and biological sciences, engineering, architecture, economics, and management. The range of techniques available to solve them is nearly as wide.


A mathematical optimization model consists of an objective function and a set of constraints expressed in the form of a system of equations or inequalities. Optimization models are used extensively in almost all areas of decision-making such as engineering design, and financial portfolio selection. This site presents a focused and structured process for optimization analysis, design of optimal strategy, and controlled process that includes validation, verification, and post-solution activities.


If the mathematical model is a valid representation of the performance of the system, as shown by applying the appropriate analytical techniques, then the solution obtained from the model should also be the solution to the system problem. The effectiveness of the results of the application of any optimization technique, is largely a function of the degree to which the model represents the system studied.


To define those conditions that will lead to the solution of a systems problem, the analyst must first identify a criterion by which the performance of the system may be measured. This criterion is often referred to as the measure of the system performance or the measure of effectiveness. In business applications, the measure of effectiveness is often either cost or profit, while government applications more often in terms of a benefit-to-cost ratio.


The mathematical (i. e. analytical) model that describes the behavior of the measure of effectiveness is called the objective function. If the objective function is to describe the behavior of the measure of effectiveness, it must capture the relationship between that measure and those variables that cause it to change. System variables can be categorized as decision variables and parameters. A decision variable is a variable, that can be directly controlled by the decision-maker. There are also some parameters whose values might be uncertain for the decision-maker. This calls for sensitivity analysis after finding the best strategy. In practice, mathematical equations rarely capture the precise relationship between all system variables and the measure of effectiveness. Instead, the OR/MS/DS analyst must strive to identify the variables that most significantly affect the measure of effectiveness, and then attempt to logically define the mathematical relationship between these variables and the measure of effectiveness. This mathematical relationship is the objective function that is used to evaluate the performance of the system being studied.


Formulation of a meaningful objective function is usually a tedious and frustrating task. Attempts to develop the objective function may fail. Failure could result because the analyst chose the wrong set of variables for inclusion in the model, because he fails to identify the proper relationship between these variables and the measure of effectiveness. Returning to the drawing board, the analyst attempts to discover additional variables that may improve his model while discarding those which seem to have little or no bearing. However, whether or not these factors do in fact improve the model, can only be determined after formulation and testing of new models that include the additional variables. The entire process of variable selection, rejection, and model formulation may require multiple reiteration before a satisfactory objective function is developed. The analyst hopes to achieve some improvement in the model at each iteration, although it is not usually the case. Ultimate success is more often preceded by a string of failures and small successes.


At each stage of the development process the analyst must judge the adequacy and validity of the model. Two criteria are frequently employed in this determination. The first involves the experimentation of the model: subjecting the model to a variety of conditions and recording the associated values of the measure of effectiveness given by the model in each case. For example, suppose a model is developed to estimate the market value of single-family homes. The model will express market value in dollars as a function of square feet of living area, number of bedrooms, number of bathrooms, and lot size. After developing the model, the analyst applies the model to the valuation of several homes, each having different values for the characteristics mentioned above. For this, the analyst finds market value tends to decrease as the square feet of living area increases. Since this result is at variance with reality, the analyst would question the validity of the model. On the other hand, suppose the model is such that home value is an increasing function of each of the four characteristics cited, as we should generally expect. Although this result is encouraging, it does not imply that the model is a valid representation of reality, since the rate of increase with each variable may be inappropriately high or low. The second stage of model validation calls for a comparison of model results with those achieved in reality.


A mathematical model offers the analyst a tool that he can manipulate in his/her analysis of the system under study, without disturbing the system itself. For example, suppose that a mathematical model has been developed to predict annual sales as a function of unit selling price. If the production cost per unit is known, total annual profit for any given selling price can easily be calculated. However, to determine the selling price to yield the maximum total profit, various values for the selling price can be introduced into the model one at a time. The resulting sales are noted and the total profit per year are computed for each value of selling price examined. By trial and error, the analyst may determine the selling price that will maximize total annual profit. Unfortunately, this approach does not guarantee that one obtained the optimal or best price, because the possibilities are enormous to try them all. The trial-and-error approach is a simple example for sequential thinking. Optimization solution methodologies are based on simultaneous thinking that result in the optimal solution. The step-by-step approach is called an optimization solution algorithm.


Progressive Approach to Modeling: Modeling for decision making involves two distinct parties, one is the decision-maker and the other is the model-builder known as the analyst. The analyst is to assist the decision-maker in his/her decision-making process. Therefore, the analyst must be equipped with more than a set of analytical methods.


Specialists in model building are often tempted to study a problem, and then go off in isolation to develop an elaborate mathematical model for use by the manager (i. e. the decision-maker). Unfortunately the manager may not understand this model and may either use it blindly or reject it entirely. The specialist may feel that the manager is too ignorant and unsophisticated to appreciate the model, while the manager may feel that the specialist lives in a dream world of unrealistic assumptions and irrelevant mathematical language.


Such miscommunication can be avoided if the manager works with the specialist to develop first a simple model that provides a crude but understandable analysis. After the manager has built up confidence in this model, additional detail and sophistication can be added, perhaps progressively only a bit at a time. This process requires an investment of time on the part of the manager and sincere interest on the part of the specialist in solving the manager's real problem, rather than in creating and trying to explain sophisticated models. This progressive model building is often referred to as the bootstrapping approach and is the most important factor in determining successful implementation of a decision model. Moreover the bootstrapping approach simplifies otherwise the difficult task of model validating and verification processes.


The purpose of this site is not to make the visitor an expert on all aspects of mathematical optimization, but to provide a broad overview of the field. We introduce the terminology of optimization and the ways in which problems and their solutions are formulated and classified. Subsequent sections consider the most appropriate methods for dealing with linear optimization, with emphasis placed on the formulation, solution algorithm, and the managerial implication of the optimal solution, with sensitivity analysis.


Further Readings: Ackoff R. Ackoff's Best: His Classic Writings on Management . Wiley, 1999. Bender E. An Introduction to Mathematical Modeling . Dover Pubns, 2000. Fdida S. and G. Pujolle, Modeling Techniques and Performance Evaluation . Elsevier Science, 1987. Gershenfeld N. The Nature of Mathematical Modeling . Cambridge Univ. Pr. 1998.


Optimization-Modeling Process


Optimization problems are ubiquitous in the mathematical modeling of real world systems and cover a very broad range of applications. These applications arise in all branches of Economics, Finance, Chemistry, Materials Science, Astronomy, Physics, Structural and Molecular Biology, Engineering, Computer Science, and Medicine.


Optimization modeling requires appropriate time. The general procedure that can be used in the process cycle of modeling is to: (1) describe the problem, (2) prescribe a solution, and (3) control the problem by assessing/updating the optimal solution continuously, while changing the parameters and structure of the problem. Clearly, there are always feedback loops among these general steps.


Mathematical Formulation of the Problem: As soon as you detect a problem, think about and understand it in order to adequately describe the problem in writing. Develop a mathematical model or framework to re-present reality in order to devise/use an optimization solution algorithm. The problem formulation must be validated before it is offered a solution. A good mathematical formulation for optimization must be both inclusive (i. e. it includes what belongs to the problem) and exclusive (i. e. shaved-off what does not belong to the problem).


Find an Optimal Solution: This is an identification of a solution algorithm and its implementation stage. The only good plan is an implemented plan. which stays implemented!


Managerial Interpretations of the Optimal Solution: Once you recognize the algorithm and determine the appropriate module of software to apply, utilize software to obtain the optimal strategy. Next, the solution will be presented to the decision-maker in the same style and language used by the decision-maker. This means providing managerial interpretations of the strategic solution in layman's terms, not just handing the decision-maker a computer printout.


Post-Solution Analysis: These activities include updating the optimal solution in order to control the problem. In this ever-changing world, it is crucial to periodically update the optimal solution to any given optimization problem. A model that was valid may lose validity due to changing conditions, thus becoming an inaccurate representation of reality and adversely affecting the ability of the decision-maker to make good decisions. The optimization model you create should be able to cope with changes.


The Importance of Feedback and Control: It is necessary to place heavy emphasis on the importance of thinking about the feedback and control aspects of an optimization problem. It would be a mistake to discuss the context of the optimization-modeling process and ignore the fact that one can never expect to find a never-changing, immutable solution to a decision problem. The very nature of the optimal strategy's environment is changing, and therefore feedback and control are an important part of the optimization-modeling process.


The above process is depicted as the Systems Analysis, Design, and Control stages in the following flow chart, including the validation and verification activities:


Further Readings: Beroggi G. Decision Modeling in Policy Management: An Introduction to the Analytic Concepts . Boston, Kluwer Academic Publishers, 1999. Camm J. and J. Evans, Management Science: Modeling, Analysis, and Interpretation . South-Western College Pub. 1999.


Ingredients of Optimization Problems and Their Classification


The essence of all businesslike decisions, whether made for a firm, or an individual, is finding a course of action that leaves you with the largest profit.


Mankind has long sought, or professed to seek, better ways to carry out the daily tasks of life. Throughout human history, man has first searched for more effective sources of food and then later searched for materials, power, and mastery of the physical environment. However, relatively late in human history general questions began to quantitatively formulate first in words, and later developing into symbolic notations. One pervasive aspect of these general questions was to seek the "best" or "optimum". Most of the time managers seek merely to obtain some improvement in the level of performance, or a "goal-seeking" problem. It should be emphasized that these words do not usually have precise meanings.


Efforts have been made to describe complex human and social situations. To have meaning, the problem should be written down in a mathematical expression containing one or more variables, in which the value of variables are to be determined. The question then asked, is what values should these variables have to ensure the mathematical expression has the greatest possible numerical value (maximization) or the least possible numerical value (minimization). This process of maximizing or minimizing is referred to as optimization.


Optimization, also called mathematical programming, helps find the answer that yields the best result--the one that attains the highest profit, output, or happiness, or the one that achieves the lowest cost, waste, or discomfort. Often these problems involve making the most efficient use of resources--including money, time, machinery, staff, inventory, and more. Optimization problems are often classified as linear or nonlinear, depending on whether the relationship in the problem is linear with respect to the variables. There are a variety of software packages to solve optimization problems. For example, LINDO or your WinQSB solve linear program models and LINGO and What'sBest! solve nonlinear and linear problems.


Mathematical Programming. solves the problem of determining the optimal allocations of limited resources required to meet a given objective. The objective must represent the goal of the decision-maker. For example, the resources may correspond to people, materials, money, or land. Out of all permissible allocations of the resources, it is desired to find the one or ones that maximize or minimize some numerical quantity such as profit or cost. Optimization models are also called Prescriptive or Normative models since they seek to find the best possible strategy for decision-maker.


There are many optimization algorithms available. However, some methods are only appropriate for certain types of problems. It is important to be able to recognize the characteristics of a problem and identify an appropriate solution technique. Within each class of problems, there are different minimization methods, which vary in computational requirements, convergence properties, and so on. Optimization problems are classified according to the mathematical characteristics of the objective function, the constraints, and the controllable decision variables.


Optimization problems are made up of three basic ingredients:


An objective function that we want to minimize or maximize. That is, the quantity you want to maximize or minimize is called the objective function. Most optimization problems have a single objective function, if they do not, they can often be reformulated so that they do. The two interesting exceptions to this rule are:


The goal seeking problem: In most business applications the manager wishes to achieve a specific goal, while satisfying the constraints of the model. The user does not particularly want to optimize anything so there is no reason to define an objective function. This type of problem is usually called a feasibility problem.


Multiple objective functions: Often, the user would actually like to optimize many different objectives at once. Usually, the different objectives are not compatible. The variables that optimize one objective may be far from optimal for the others. In practice, problems with multiple objectives are reformulated as single-objective problems by either forming a weighted combination of the different objectives or else by placing some objectives as "desirable" constraints.


The controllable inputs are the set of decision variables which affect the value of the objective function. In the manufacturing problem, the variables might include the allocation of different available resources, or the labor spent on each activity. Decision variables are essential. If there are no variables, we cannot define the objective function and the problem constraints.


The uncontrollable inputs are called parameters. The input values may be fixed numbers associated with the particular problem. We call these values parameters of the model. Often you will have several "cases" or variations of the same problem to solve, and the parameter values will change in each problem variation.


Constraints are relations between decision variables and the parameters. A set of constraints allows some of the decision variables to take on certain values, and exclude others. For the manufacturing problem, it does not make sense to spend a negative amount of time on any activity, so we constrain all the "time" variables to be non-negative. Constraints are not always essential. In fact, the field of unconstrained optimization is a large and important one for which a lot of algorithms and software are available. In practice, answers that make good sense about the underlying physical or economic problem, cannot often be obtained without putting constraints on the decision variables.


Feasible and Optimal Solutions: A solution value for decision variables, where all of the constraints are satisfied, is called a feasible solution. Most solution algorithms proceed by first finding a feasible solution, then seeking to improve upon it, and finally changing the decision variables to move from one feasible solution to another feasible solution. This process is repeated until the objective function has reached its maximum or minimum. This result is called an optimal solution.


The basic goal of the optimization process is to find values of the variables that minimize or maximize the objective function while satisfying the constraints. This result is called an optimal solution.


There are well over 4000 solution algorithms for different kinds of optimization problems. The widely used solution algorithms are those developed for the following mathematical programs: convex programs, separable programs, quadratic programs and the geometric programs.


Linear Program


Linear programming deals with a class of optimization problems, where both the objective function to be optimized and all the constraints, are linear in terms of the decision variables.


A short history of Linear Programming:


In 1762, Lagrange solved tractable optimization problems with simple equality constraints.


In 1820, Gauss solved linear system of equations by what is now call Causssian elimination. In 1866 Wilhelm Jordan refinmened the method to finding least squared errors as ameasure of goodness-of-fit. Now it is referred to as the Gauss-Jordan Method.


In 1945, Digital computer emerged.


In 1947, Dantzig invented the Simplex Methods.


In 1968, Fiacco and McCormick introduced the Interior Point Method.


In 1984, Karmarkar applied the Interior Method to solve Linear Programs adding his innovative analysis.


Linear programming has proven to be an extremely powerful tool, both in modeling real-world problems and as a widely applicable mathematical theory. However, many interesting optimization problems are nonlinear. The study of such problems involves a diverse blend of linear algebra, multivariate calculus, numerical analysis, and computing techniques. Important areas include the design of computational algorithms (including interior point techniques for linear programming), the geometry and analysis of convex sets and functions, and the study of specially structured problems such as quadratic programming. Nonlinear optimization provides fundamental insights into mathematical analysis and is widely used in a variety of fields such as engineering design, regression analysis, inventory control, geophysical exploration, and economics.


Quadratic Program


Quadratic Program (QP) comprises an area of optimization whose broad range of applicability is second only to linear programs. A wide variety of applications fall naturally into the form of QP. The kinetic energy of a projectile is a quadratic function of its velocity. The least-square regression with side constraints has been modeled as a QP. Certain problems in production planning, location analysis, econometrics, activation analysis in chemical mixtures problem, and in financial portfolio management and selection are often treated as QP. There are numerous solution algorithms available for the case under the restricted additional condition, where the objective function is convex.


Constraint Satisfaction


Many industrial decision problems involving continuous constraints can be modeled as continuous constraint satisfaction and optimization problems. Constraint Satisfaction problems are large in size and in most cases involve transcendental functions. They are widely used in chemical processes and cost restrictions modeling and optimization.


Convex Program


Convex Program (CP) covers a broad class of optimization problems. When the objective function is convex and the feasible region is a convex set, both of these assumptions are enough to ensure that local minimum is a global minimum.


Data Envelopment Analysis


The Data Envelopment Analysis (DEA) is a performance metric that is grounded in the frontier analysis methods from the economics and finance literature. Frontier efficiency (output/input) analysis methods identify best practice performance frontier, which refers to the maximal outputs that can be obtained from a given set of inputs with respect to a sample of decision making units using a comparable process to transform inputs to outputs. The strength of DEA relies partly on the fact that it is a non-parametric approach, which does not require specification of any functional form of relationships between the inputs and the outputs. DEA output reduces multiple performance measures to a single one to use linear programming techniques. The weighting of performance measures reacts to the decision-maker's utility.


Dynamic Programming


Dynamic programming (DP) is essentially bottom-up recursion where you store the answers in a table starting from the base case(s) and building up to larger and larger parameters using the recursive rule(s). You would use this technique instead of recursion when you need to calculate the solutions to all the sub-problems and the recursive solution would solve some of the sub-problems repeatedly. While generally DP is capable of solving many diverse problems, it may require huge computer storage in most cases.


Separable Program


Separable Program (SP) includes a special case of convex programs, where the objective function and the constraints are separable functions, i. e. each term involves just a single variable.


Geometric Program


Geometric Program (GP) belongs to Nonconvex programming, and has many applications in particular in engineering design problems.


Fractional Program


In this class of problems, the objective function is in the form of a fraction (i. e. ratio of two functions). Fractional Program (FP) arises, for example, when maximizing the ratio of profit capital to capital expended, or as a performance measure wastage ratio.


Heuristic Optimization


A heuristic is something "providing aid in the direction of the solution of a problem but otherwise unjustified or incapable of justification." So heuristic arguments are used to show what we might later attempt to prove, or what we might expect to find in a computer run. They are, at best, educated guesses.


Several heuristic tools have evolved in the last decade that facilitate solving optimization problems that were previously difficult or impossible to solve. These tools include evolutionary computation, simulated annealing, tabu search, particle swarm, etc.


Common approaches include, but are not limited to:


comparing solution quality to optimum on benchmark problems with known optima, average difference from optimum, frequency with which the heuristic finds the optimum.


comparing solution quality to a best known bound for benchmark problems whose optimal solutions cannot be determined.


comparing your heuristic to published heuristics for the same problem type, difference in solution quality for a given run time and, if relevant, memory limit.


profiling average solution quality as a function of run time, for instance, plotting mean and either min and max or 5th and 95th percentiles of solution value as a function of time -- this assumes that one has multiple benchmark problem instances that are comparable.


Global Optimization


The aim of Global Optimization (GO) is to find the best solution of decision models, in presence of the multiple local solutions. While constrained optimization is dealing with finding the optimum of the objective function subject to constraints on its decision variables, in contrast, unconstrained optimization seeks the global maximum or minimum of a function over its entire domain space, without any restrictions on decision variables.


Nonconvex Program


A Nonconvex Program (NC) encompasses all nonlinear programming problems that do not satisfy the convexity assumptions. However, even if you are successful at finding a local minimum, there is no assurance that it will also be a global minimum. Therefore, there is no algorithm that will guarantee finding an optimal solution for all such problem.


Nonsmooth Program


Nonsmooth Programs (NSP) contain functions for which the first derivative does not exist. NSP are arising in several important applications of science and engineering, including contact phenomena in statics and dynamics or delamination effects in composites. These applications require the consideration of nonsmoothness and nonconvexity.


Metaheuristics


Most metaheuristics have been created for solving discrete combinatorial optimization problems. Practical applications in engineering, however, usually require techniques, which handle continuous variables, or miscellaneous continuous and discrete variables. As a consequence, a large research effort has focused on fitting several well-known metaheuristics, like Simulated Annealing (SA), Tabu Search (TS), Genetic Algorithms (GA), Ant Colony Optimization (ACO), to the continuous cases. The general metaheuristics aim at transforming discrete domains of application into continuous ones, by means of:


Methodological developments aimed at adapting some metaheuristics, especially SA, TS, GA, ACO, GRASP, variable neighborhood search, guided local search, scatter search, to continuous or discrete/continuous variable problems.


Theoretical and experimental studies on metaheuristics adapted to continuous optimization, e. g. convergence analysis, performance evaluation methodology, test-case generators, constraint handling, etc.


Software implementations and algorithms for metaheuristics adapted to continuous optimization.


Real applications of discrete metaheuristics adapted to continuous optimization.


Performance comparisons of discrete metaheuristics (adapted to continuous optimization) with that of competitive approaches, e. g. Particle Swarm Optimization (PSO), Estimation of Distribution Algorithms (EDA), Evolutionary Strategies (ES), specifically created for continuous optimization.


Multilevel Optimization


In many decision processes there is a hierarchy of decision makers and decisions are taken at different levels in thishierarchy. Multilevel Optimization focuses on the whole hierarchy structure. The field of multilevel optimization has become a well known and important research field. Hierarchical structures can be found in scientific disciplines such as environment, ecology, biology, chemical engineering, mechanics, classification theory, databases, network design, transportation, supply chain, game theory and economics. Moreover, new applications are constantly being introduced.


Multiobjective Program


Multiobjective Program (MP) known also as Goal Program, is where a single objective characteristic of an optimization problem is replaced by several goals. In solving MP, one may represent some of the goals as constraints to be satisfied, while the other objectives can be weighted to make a composite single objective function.


Multiple objective optimization differs from the single objective case in several ways:


The usual meaning of the optimum makes no sense in the multiple objective case because the solution optimizing all objectives simultaneously is, in general, impractical; instead, a search is launched for a feasible solution yielding the best compromise among objectives on a set of, so called, efficient solutions;


The identification of a best compromise solution requires taking into account the preferences expressed by the decision-maker;


The multiple objectives encountered in real-life problems are often mathematical functions of contrasting forms.


A key element of a goal programming model is the achievement function; that is, the function that measures the degree of minimisation of the unwanted deviation variables of the goals considered in the model.


A Business Application: In credit card portfolio management, predicting the cardholder's spending behavior is a key to reduce the risk of bankruptcy. Given a set of attributes for major aspects of credit cardholders and predefined classes for spending behaviors, one might construct a classification model by using multiple criteria linear programming to discover behavior patterns of credit cardholders.


Non-Binary Constraints Program


Over the years, the constraint programming community has paid considerable attention to modeling and solving problems by using binary constraints. Only recently has non-binary constraints captured attention, due to growing number of real-life applications. A non-binary constraint is a constraint that is defined on k variables, where k is normally greater than two. A non-binary constraint can be seen as a more global constraint. Modeling a problem as a non-binary constraint has two main advantages: It facilitates the expression of the problem; and it enables more powerful constraint propagation as more global information becomes available.


Success in timetabling, scheduling, and routing, has proven that the use of non-binary constraints is a promising direction of research. In fact, a growing number of OR/MS/DS workers feel that this topic is crucial to making constraint technology a realistic way to model and solve real-life problems.


Bilevel Optimization


Most of the mathematical programming models deal with decision-making with a single objective function. The bilevel programming on the other hand is developed for applications in decentralized planning systems in which the first level is termed as the leader and the second level pertains to the objective of the follower. In the bilevel programming problem, each decision maker tries to optimize its own objective function without considering the objective of the other party, but the decision of each party affects the objective value of the other party as well as the decision space.


Bilevel programming problems are hierarchical optimization problems where the constraints of one problem are defined in part by a second parametric optimization problem. If the second problem has a unique optimal solution for all parameter values, this problem is equivalent to usual optimization problem having an implicitly defined objective function. However, when the problem has non-unique optimal solutions, the optimistic (or weak) and the pessimistic (or strong) approaches are being applied.


Combinatorial Optimization


Combinatorial generally means that the state space is discrete (e. g. symbols, not necessarily numbers). This space could be finite or denumerable sets. For example, a discrete problem is combinatorial. Problems where the state space is totally ordered can often be solved by mapping them to the integers and applying "numerical" methods. If the state space is unordered or only partially ordered, these methods fail. This means that the heuristics methods becomes necessary, such as simulated annealing.


Combinatorial optimization is the study of packing, covering, and partitioning, which are applications of integer programs. They are the principle mathematical topics in the interface between combinatorics and optimization. These problems deal with the classification of integer programming problems according to the complexity of known algorithms, and the design of good algorithms for solving special subclasses. In particular, problems of network flows, matching, and their matroid generalizations are studied. This subject is one of the unifying elements of combinatorics, optimization, operations research, and computer science.


Evolutionary Techniques


Nature is a robust optimizer. By analyzing nature's optimization mechanism we may find acceptable solution techniques to intractable problems. Two concepts that have most promise are simulated annealing and the genetic techniques. Scheduling and timetabling are amongst the most successful applications of evolutionary techniques.


Genetic Algorithms (GAs) have become a highly effective tool for solving hard optimization problems. However, its theoretical foundation is still rather fragmented.


Particle Swarm Optimization


Particle Swarm Optimization (PSO) is a stochastic, population-based optimization algorithm. Instead of competition/selection, like say in Evolutionary Computation, PSO makes use of cooperation, according to a paradigm sometimes called "swarm intelligence". Such systems are typically made up of a population of simple interacting agents without any centralized control, and inspired by cases that can be found in nature, such as ant colonies, bird flocking, animal herding, bacteria molding, fish schooling, etc.


There are many variants of PSO including constrained, multiobjective, and discrete or combinatorial versions, and applications have been developed using PSO in many fields.


Swarm Intelligence


Biologists studied the behavior of social insects for a long time. After millions of years of evolution all these species have developed incredible solutions for a wide range of problems. The intelligent solutions to problems naturally emerge from the self-organization and indirect communication of these individuals. Indirect interactions occur between two individuals when one of them modifies the environment and the other responds to the new environment at a later time.


Swarm Intelligence is an innovative distributed intelligent paradigm for solving optimization problems that originally took its inspiration from the biological examples by swarming, flocking and herding phenomena in vertebrates. Data Mining is an analytic process designed to explore large amounts of data in search of consistent patterns and/or systematic relationships between variables, and then to validate the findings by applying the detected patterns to new subsets of data.


Online Optimization


Whether costs are to be reduced, profits to be maximized, or scarce resources to be used wisely, optimization methods are available to guide decision-making. In online optimization, the main issue is incomplete data and the scientific challenge: how well can an online algorithm perform? Can one guarantee solution quality, even without knowing all data in advance? In real-time optimization there is an additional requirement: decisions have to be computed very fast in relation to the time frame we are considering.


Further Readings: Abraham A. C. Grosan and V. Ramos, Swarm Intelligence . Springer Verlag, 2006. It deals with the applications of swarm intelligence in data mining, using different intelligent approaches. Charnes A. Cooper W. Lewin A. and L. Seiford, Data Envelopment Analysis: Theory, Methodology and Applications . Kluwer Academic Publications, 1994. Dempe S. Foundations of Bilevel Programming . Kluwer, 2002. Diwekar U. Introduction to Applied Optimization . Kluwer Academic Publishers, 2003. Covers almost all the above techniques. Liu B. and A. Esogbue, Decision Criteria and Optimal Inventory Processes . Kluwer, 1999. Luenberger D. Linear and Nonlinear Programming . Kluwer Academic Publishers, 2003. Miller R. Optimization: Foundations and Applications . Wiley, 1999. MigdalasA. Pardalos p. and P. Varbrand, Multilevel Optimization: Algorithms and Applications . Kluwer, 1998. Reeves C. and J. Rowe, Genetic Algorithms: Principles and Perspectives . Kluwer, 2002. Rodin R. Optimization in Operations Research . Prentice Hall, New Jersey, 2000.


For more books and journal articles on optimization visit the Web site Decision Making Resources


Linear Programming


Linear programming is often a favorite topic for both professors and students. The ability to introduce LP using a graphical approach, the relative ease of the solution method, the widespread availability of LP software packages, and the wide range of applications make LP accessible even to students with relatively weak mathematical backgrounds. Additionally, LP provides an excellent opportunity to introduce the idea of "what-if" analysis, due to the powerful tools for post-optimality analysis developed for the LP model.


Linear Programming (LP) is a mathematical procedure for determining optimal allocation of scarce resources. LP is a procedure that has found practical application in almost all facets of business, from advertising to production planning. Transportation, distribution, and aggregate production planning problems are the most typical objects of LP analysis. In the petroleum industry, for example a data processing manager at a large oil company recently estimated that from 5 to 10 percent of the firm's computer time was devoted to the processing of LP and LP-like models.


Linear programming deals with a class of programming problems where both the objective function to be optimized is linear and all relations among the variables corresponding to resources are linear. This problem was first formulated and solved in the late 1940's. Rarely has a new mathematical technique found such a wide range of practical business, commerce, and industrial applications and simultaneously received so thorough a theoretical development, in such a short period of time. Today, this theory is being successfully applied to problems of capital budgeting, design of diets, conservation of resources, games of strategy, economic growth prediction, and transportation systems. In very recent times, linear programming theory has also helped resolve and unify many outstanding applications.


It is important for the reader to appreciate, at the outset, that the "programming" in Linear Programming is of a different flavor than the "programming" in Computer Programming. In the former case, it means to plan and organize as in "Get with the program!", it programs you by its solution. While in the latter case, it means to write codes for performing calculations. Training in one kind of programming has very little direct relevance to the other. In fact, the term "linear programming" was coined before the word "programming" became closely associated with computer software. This confusion is sometimes avoided by using the term linear optimization as a synonym for linear programming.


Any LP problem consists of an objective function and a set of constraints. In most cases, constraints come from the environment in which you work to achieve your objective. When you want to achieve the desirable objective, you will realize that the environment is setting some constraints (i. e. the difficulties, restrictions) in fulfilling your desire or objective. This is why religions such as Buddhism, among others, prescribe living an abstemious life. No desire, no pain. Can you take this advice with respect to your business objective?


What is a function: A function is a thing that does something. For example, a coffee grinding machine is a function that transform the coffee beans into powder. The (objective) function maps and translates the input domain (called the feasible region) into output range, with the two end-values called the maximum and the minimum values.


When you formulate a decision-making problem as a linear program, you must check the following conditions:


The objective function must be linear. That is, check if all variables have power of 1 and they are added or subtracted (not divided or multiplied)


The objective must be either maximization or minimization of a linear function. The objective must represent the goal of the decision-maker


The constraints must also be linear. Moreover, the constraint must be of the following forms ( £. ³. or =, that is, the LP-constraints are always closed ).


For example, the following problem is not an LP: Max X, subject to X < 1. This very simple problem has no solution.


As always, one must be careful in categorizing an optimization problem as an LP problem. Here is a question for you. Is the following problem an LP problem?


Max X2 subject to: X1 + X2 £ 0 X1 2 - 4 £ 0


Although the second constraint looks "as if" it is a nonlinear constraint, this constraint can equivalently be written as: X1 ³ -2, and X2 £ 2. Therefore, the above problem is indeed an LP problem.


For most LP problems one can think of two important classes of objects: The first is limited resources such as land, plant capacity, or sales force size; the second, is activities such as "produce low carbon steel", "produce stainless steel", and "produce high carbon steel". Each activity consumes or possibly contributes additional amounts of the resources. There must be an objective function, i. e. a way to tell bad from good, from an even better decision. The problem is to determine the best combination of activity levels, which do not use more resources than are actually available. Many managers are faced with this task everyday. Fortunately, when a well-formulated model is input, linear programming software helps to determine the best combination.


The Simplex method is a widely used solution algorithm for solving linear programs. An algorithm is a series of steps that will accomplish a certain task.


LP Problem Formulation Process and Its Applications


To formulate an LP problem, I recommend using the following guidelines after reading the problem statement carefully a few times.


Any linear program consists of four parts: a set of decision variables, the parameters, the objective function, and a set of constraints. In formulating a given decision problem in mathematical form, you should practice understanding the problem (i. e. formulating a mental model) by carefully reading and re-reading the problem statement. While trying to understand the problem, ask yourself the following general questions:


What are the decision variables? That is, what are controllable inputs? Define the decision variables precisely, using descriptive names. Remember that the controllable inputs are also known as controllable activities, decision variables, and decision activities.


What are the parameters? That is, what are the uncontrollable inputs? These are usually the given constant numerical values. Define the parameters precisely, using descriptive names.


What is the objective? What is the objective function? Also, what does the owner of the problem want? How the objective is related to his decision variables? Is it a maximization or minimization problem? The objective represents the goal of the decision-maker.


What are the constraints? That is, what requirements must be met? Should I use inequality or equality type of constraint? What are the connections among variables? Write them out in words before putting them in mathematical form.


Learn that the feasible region has nothing or little to do with the objective function (min or max). These two parts in any LP formulation come mostly from two distinct and different sources. The objective function is set up to fulfill the decision-maker's desire (objective), whereas the constraints which shape the feasible region usually comes from the decision-maker's environment putting some restrictions/conditions on achieving his/her objective.


The following is a very simple illustrative problem. However, the way we approach the problem is the same for a wide variety of decision-making problems, and the size and complexity may differ. The first example is a product-mix problem.


The Carpenter's Problem: Allocating Scarce Resources Among Competitive Means


During a couple of brain-storming sessions with a carpenter (our client), he told us that he, solely, makes tables and chairs, sells all tables and chairs he makes at a market place, however, does not have a stable income, and wishes to do his best.


The objective is to find out how many tables and chairs he should make to maximize net income. We begin by focusing on a time frame, i. e. planning time-horizon. to revise our solution weekly if needed. To learn more about his problem, we must go to his shop and observe what is going on and measure what we need to formulate (i. e. to give a Form, to make a model) of his problem. We must confirm that his objective is to maximize net income. We must communicate with the client.


The carpenter's problem deals with finding out how many tables and chairs to make per week; but first an objective function must be established:


Since the total cost is the sum of the fixed cost (F) and the variable cost per unit multiplied by the number of units produced. Therefore, the decision problem is to find X1 and X2 such that:


Maximize 9X1 + 6X2 – [(1.5X1 + X2) + (2.5X1 + 2X2) + F1 + F2],


where X1 and X2 stand for the number of tables and chairs; the cost terms in the brackets are the raw material, and labor costs respectively. F1 and F2 are the fixed costs for the two products respectively. Without loss of generality, and any impact on optimal solution, let us set F1 = 0, and F2 = 0. The objective function reduces to the following net profit function:


Maximize 5X1 + 3X2


That is, the net incomes (say, in dollars, or tens of dollars) from selling X1 tables and X2 chairs.


The constraining factors which, usually come from outside . are the limitations on labors (this limitation comes from his family) and raw material resources (this limitation comes from scheduled delivery). Production times required for a table and a chair are measured at different times of day, and estimated to be 2 hours and 1 hour, respectively. Total labor hours per week are only 40 hrs. Raw materials required for a table and a chair are 1, and 2 units respectively. Total supply of raw material is 50 units per week. Therefore, the LP formulation is:


Maximize 5 X1 + 3 X2


Subject to: 2 X1 + X2 £ 40 labor constraint X1 + 2 X2 £ 50 material constraint and both X1, X2 are non-negative.


This is a mathematical model for the carpenter's problem. The decision variables. i. e. controllable inputs are X1, and X2. The output for this model is the total net income 5 X1 + 3 X2. All functions used in this model are linear (the decision variable have power equal to 1). The coefficients of these constraints are called Technological Factors (matrix). The review period is one week, an appropriate period within which the uncontrollable inputs (all parameters such as 5, 50, 2. ) are less likely to change (fluctuate). Even for such a short planning time-horizon, we must perform the what-if analysis to react to any changes in these inputs in order to control the problem. i. e. to update the prescribed solution.


Notice that since the carpenter is not going out of business at the end of the planning horizon, we added the conditions that both X1, X2 must be non-negative instead of the requirements that X1, and X2 must be positive integers. The non-negativity conditions are also known as "implied constraints." Again, a Linear Program would be fine for this problem if the carpenter were going to continue to manufacture these products. The partial items would simply be counted as work in progress and would eventually become finished goods say, in the next week.


We may try to solve for X1 and X2 by listing possible solutions for each and selecting the pair (X1, X2) that maximize 5X1 + 3X2 (the net income). However, it is too time consuming to list all possible alternatives and if the alternatives are not exhaustively listed, we cannot be sure that the pair we select (as a solution) is the best of all alternatives. This way of solving a problem is known as "sequential thinking" versus "simultaneous thinking". More efficient and effective methodologies, known as the Linear Programming Solution Techniques are based on simultaneous thinking are commercially available in over 400 different software packages from all over the world.


The optimal solution. i. e. optimal strategy. is to make X1 = 10 tables, and X2 = 20 chairs. We may program the carpenter's weekly activities to make 10 tables and 20 chairs. With this (optimal) strategy, the net income is $110. This prescribed solution was a surprise for the carpenter since, because of more net income of selling a table ($5), he used to make more tables than chairs!


Hire or Not? Suppose the carpenter can hire someone to help at a cost of $2 per hour. This is, in addition, hourly-based wage he/she is currently paying; otherwise $2 is much lower than the current minimum wage in US. Should the carpenter hire and if yes then for how may hours?


Let X3 be the number of extra hours, then the modified problem is:


Maximize 5 X1 + 3 X2 - 2 X3


Subject to: 2 X1 + X2 £ 40 + X3 labor constraint with unknown additional hours X1 + 2 X2 £ 50 material constraint


Under this new condition, we will see that the optimal solution is X1 = 50, X2 = 0, X3 = 60, with optimal net income of $130. Therefore, the carpenter should be hired for 60 hours. What about only hiring 40 hours? The answer to this and other types of what-if questions are treated under sensitivity analysis in this Web site.


As an exercise, use your LP software to find the largest range for X values satisfying the following inequality with two absolute value terms:


| 3X – 4 | - | 2X – 1 | £ 2


A Product-Replacement Problem


A price-taking firm sells S units of its product at the market price of p. Management's policy is to replace defective units at no additional charge, on the first-come, first-served basis, while replacement units are available. Because management does not want to risk making the same mistake twice, it produces the units that it sells to the market on one machine. Moreover, it produces the replacement units, denoted X, on a second, higher-quality machine. The fixed cost associated with operating both machines, the variable cost, and replacement cost are given is the short-run cost function C(X) = 100 + 20S + 30X.


The exact probability that a unit will be defective is r. Acting out of caution, however, management always underestimate the reliability of its product. Nonetheless, it imposes the condition that X ³ r. S. The demand for the firm's product is given by S(r) = 10000e -0.2r. Hence the decision problem is to maximize the net profit function P(X):


Maximize P(X) = 100000p e - 0.2r - 100 - 20S - 30X, subject to: X ³ r. S.


As we will learn, the solutions to the LP problems are at the vertices of the feasible region. Therefore, the net profit P(X) will be maximized if the management set X = r. S.


A Diet Problem


Suppose the only foods available in your local store are potatoes and steak. The decision about how much of each food to buy is to made entirely on dietary and economic considerations. We have the nutritional and cost information in the following table:


The problem is to find a diet (a choice of the numbers of units of the two foods) that meets all minimum nutritional requirements at minimal cost.


Formulate the problem in terms of linear inequalities and an objective function.


Solve the problem geometrically.


Explain how the 2:1 cost ratio (steak to potatoes) dictates that the solution must be where you said it is.


Find a cost ratio that would move the optimal solution to a different choice of numbers of food units, but that would still require buying both steak and potatoes.


Find a cost ratio that would dictate buying only one of the two foods in order to minimize cost.


a) We begin by setting the constraints for the problem. The first constraint represents the minimum requirement for carbohydrates, which is 8 units per some unknown amount of time. 3 units can be consumed per unit of potatoes and 1 unit can be consumed per unit of steak. The second constraint represents the minimum requirement for vitamins, which is 19 units. 4 units can be consumed per unit of potatoes and 3 units can be consumed per unit of steak. The third constraint represents the minimum requirement for proteins, which is 7 units. 1 unit can be consumed per unit of potatoes and 3 units can be consumed per unit of steak. The fourth and fifth constraints represent the fact that all feasible solutions must be nonnegative because we can't buy negative quantities.


Next we plot the solution set of the inequalities to produce a feasible region of possibilities.


c) The 2:1 cost ratio of steak to potatoes dictates that the solution must be here since, as a whole, we can see that one unit of steak is slightly less nutritious than one unit of potatoes. Plus, in the one category where steak beats potatoes in healthiness (proteins), only 7 total units are necessary. Thus it is easier to fulfill these units without buying a significant amout of steak. Since steak is more expensive, buying more potatoes to fulfill these nutritional requirements is more logical.


d) Now we choose a new cost ratio that will move the optimal solution to a different choice of numbers of food units. Both steak and potatoes will still be purchased, but a different solution will be found. Let's try a 5:2 cost ratio.


d) Now we choose a new cost ratio that will move the optimal solution to a different choice of numbers of food units. Both steak and potatoes will still be purchased, but a different solution will be found. Let's try a 5:2 cost ratio.


d) Now we choose a new cost ratio that will move the optimal solution to a different choice of numbers of food units. Both steak and potatoes will still be purchased, but a different solution will be found. Let's try a 5:2 cost ratio.


Thus, the optimal solution for this cost ratio is buying 8 steaks and no potatoes per unit time to meet the minimum nutritional requirements.


A Blending Problem


Bryant's Pizza, Inc. is a producer of frozen pizza products. The company makes a net income of $1.00 for each regular pizza and $1.50 for each deluxe pizza produced. The firm currently has 150 pounds of dough mix and 50 pounds of topping mix. Each regular pizza uses 1 pound of dough mix and 4 ounces (16 ounces= 1 pound) of topping mix. Each deluxe pizza uses 1 pound of dough mix and 8 ounces of topping mix. Based on the past demand per week, Bryant can sell at least 50 regular pizzas and at least 25 deluxe pizzas. The problem is to determine the number of regular and deluxe pizzas the company should make to maximize net income. Formulate this problem as an LP problem.


Let X1 and X2 be the number of regular and deluxe pizza, then the LP formulation is:


Maximize X1 + 1.5 X2


Subject to: X1 + X2 £ 150 0.25 X1 + 0.5 X2 £ 50 X1 ³ 50 X2 ³ 25 X1 ³ 0, X2 ³ 0


Other Common Applications of LP


Linear programming is a powerful tool for selecting alternatives in a decision problem and, consequently, has been applied in a wide variety of problem settings. We will indicate a few applications covering the major functional areas of a business organization.


Finance: The problem of the investor could be a portfolio-mix selection problem. In general, the number of different portfolios can be much larger than the example indicates, more and different kinds of constraints can be added. Another decision problem involves determining the mix of funding for a number of products when more than one method of financing is available. The objective may be to maximize total profits, where the profit for a given product depends on the method of financing. For example, funding may be done with internal funds, short-term debt, or intermediate financing (amortized loans). There may be limits on the availability of each of the funding options as well as financial constraints requiring certain relationships between the funding options so as to satisfy the terms of bank loans or intermediate financing. There may also be limits on the production capacity for the products. The decision variables would be the number of units of each product to be financed by each funding option.


Production and Operations Management: Quite often in the process industries a given raw material can be made into a wide variety of products. For example, in the oil industry, crude oil is refined into gasoline, kerosene, home-heating oil, and various grades of engine oil. Given the present profit margin on each product, the problem is to determine the quantities of each product that should be produced. The decision is subject to numerous restrictions such as limits on the capacities of various refining operations, raw-material availability, demands for each product, and any government-imposed policies on the output of certain products. Similar problems also exist in the chemical and food-processing industries.


Human Resources: Personnel planning problems can also be analyzed with linear programming. For example, in the telephone industry, demands for the services of installer-repair personnel are seasonal. The problem is to determine the number of installer-repair personnel and line-repair personnel to have on the work force each month where the total costs of hiring, layoff, overtime, and regular-time wages are minimized. The constraints set includes restrictions on the service demands that must be satisfied, overtime usage, union agreements, and the availability of skilled people for hire. This example runs contrary to the assumption of divisibility; however, the work-force levels for each month would normally be large enough that rounding to the closest integer in each case would not be detrimental, provided the constraints are not violated.


Marketing: Linear programming can be used to determine the proper mix of media to use in an advertising campaign. Suppose that the available media are radio, television, and newspapers. The problem is to determine how many advertisements to place in each medium. Of course, the cost of placing an advertisement depends on the medium chosen. We wish to minimize the total cost of the advertising campaign, subject to a series of constraints. Since each medium may provide a different degree of exposure of the target population, there may be a lower bound on the total exposure from the campaign. Also, each medium may have a different efficiency rating in producing desirable results; there may thus be a lower bound on efficiency. In addition, there may be limits on the availability of each medium for advertising.


Distribution: Another application of linear programming is in the area of distribution. Consider a case in which there are m factories that must ship goods to n warehouses. A given factory could make shipments to any number of warehouses. Given the cost to ship one unit of product from each factory to each warehouse, the problem is to determine the shipping pattern (number of units that each factory ships to each warehouse) that minimizes total costs. This decision is subject to the restrictions that demand at each factory cannot ship more products than it has the capacity to produce.


Graphical Solution Method


Procedure for Graphical Method of Solving LP Problems:


Is the problem an LP? Yes, if and only if:


All variables have power of 1, and they are added or subtracted (not divided or multiplied). The constraint must be of the following forms ( £. ³. or =, that is, the LP-constraints are always closed), and the objective must be either maximization or minimization.


For example, the following problem is not an LP: Max X, subject to X < 1. This very simple problem has no solution.


Can I use the graphical method? Yes, if the number of decision variables is either 1 or 2.


Use Graph Paper. Graph each constraint one by one, by pretending that they are equalities (pretend all £ and ³. are = ) and then plot the line. Graph the straight line on a system of coordinates on a graph paper. A system of coordinate has two axes: a horizontal axis called the x-axis (abscissa), and a vertical axis, called the y-axis (ordinate). The axes are numbered, usually from zero to the largest value expected for each variable.


As each line is created, divide the region into 3 parts with respect to each line. To identify the feasible region for this particular constraint, pick a point in either side of the line and plug its coordinates into the constraint. If it satisfies the condition, this side is feasible; otherwise the other side is feasible. For equality constraints, only the points on the line are feasible.


Throw away the sides that are not feasible.


After all the constraints are graphed, you should have a non-empty (convex) feasible region, unless the problem is infeasible.


Unfortunately, some of the boundaries of the feasible regions described in your textbook are wrong. See, e. g. the figures depicted on page 56. Almost all inequalities must be changed to equality. Right?


Create (at least) two iso-value lines from the objective function, by setting the objective function to any two distinct numbers. Graph the resulting lines. By moving these lines parallel, you will find the optimal corner (extreme point), if it does exist.


In general, if the feasible region is within the first quadrant of the coordinate system (i. e. if X1 and X2 ³ 0), then, for the maximization problems you are moving the iso-value objective function parallel to itself far away from the origin point (0, 0), while having at least a common point with the feasible region. However, for minimization problems the opposite is true, that is, you are moving the iso-value objective parallel to itself closer to the origin point . while having at least a common point with the feasible region. The common point provides the optimal solution.


Classification of the Feasible Points: . The feasible points of any non-empty LP feasible region can be classified as, interiors, boundaries, or vertices. As shown in the following figure:


The point B in the above two-dimensional figure, for example, is a boundary point of the feasible set because every small circle centered at the point B, however small, contains both points some in the set and some points outside the set. The point I is an interior point because the orange circle and all smaller circles, as well as some larger ones; contains exclusively points in the set. The collection of boundary points belonging to one set is called boundary line (segment), e. g. the line segment cd. The intersections of boundary lines (segments) are called the vertices . if feasible it is called the corner point . In three-dimensional space and higher the circles become spheres, and hyper-spheres.


Know that, the LP constraints provide the vertices and the corner-points. A vertex is the intersection of 2-lines, or in general n-hyperplanes in LP problems with n-decision variables. A corner-point is a vertex that is also feasible.


A Numerical Example: The Carpenter's Problem


Maximize 5 X1 + 3 X2


Subject to: 2 X1 + X2 £ 40 X1 + 2 X2 £ 50 and both X1, X2 are non-negative.


Note: There is an alternative to the Iso-value objective function approach with problems that have few constraints and a bounded feasible region. First, find all the corner points, which are called extreme points. Then, evaluate the objective function at the extreme points to find the optimal value and the optimal solution.


Clearly, the carpenter has many alternative sets of actions to take. However, the four "extreme" options are:


Objective Function Value at Each Corner (i. e. Extreme) Point


Corner Point Coordinates


Since the objective is to maximize, from the above table we read off the optimal value to be 110, which is obtainable if the carpenter follows the optimal strategy of X1 = 10, and X2 = 20.


Notice that in the carpenter problem, the convex feasible region provides the corner points with coordinates shown in the above table.


The main deficiency of the graphical method is that it is limited to solving LP problems with 1 or 2 decision variables only. However, the main and useful conclusion we easily observe from the graphical methods, is as follow:


If a linear program has a bounded optimal solution, then one of the corner points provides an optimal solution.


The proof of this claim follows from the results of the following two facts:


Fact No. 1: The feasible region of any linear program is always a convex set.


Since all of the constraints are linear, the feasible region (F. R.) is a polygon. Moreover, this polygon is a convex set. In any higher than two-dimensional LP problem, the boundaries of F. R. are parts of the hyper-planes, and the F. R. in this case is called polyhedra that is also convex. A convex set is the one that if you choose two feasible points from it, then all the points on the straight line segment joining these two points are also feasible. The proof that the F. R. of linear programs are always convex sets follows by contradiction. The following figures depict examples for the two types of sets: A non-convex and a convex set.


The set of feasible region in any linear program is called a polyhedron . it is called a polytope if it is bounded.


Fact No. 2: The Iso-value of a linear program objective function is always a linear function.


This fact follows from the nature of the objective function in any LP problem. The following figures depict the two typical kinds of iso-valued objective functions.


Combining the above two facts, it follows that, if a linear program has a non-empty, bounded feasible region, then the optimal solution is always one of the corner points.


To overcome the deficiency of the graphical method, we will utilize this useful and practical conclusion in developing an algebraic method that is applicable to multi-dimensional LP problems.


The convexity of the feasible region for linear programs makes the LP problems easy to solve. Because of this property and linearity of the objective function, the solution is always one of the vertices. Moreover, since number of vertices is limited, one has to find all feasible vertices, and then evaluate the objective function at these vertices to seek the optimal point.


For nonlinear programs, the problem is much harder to solve, because the solution could be anywhere inside the feasible region on the boundary of the feasible region, or at a vertex.


Fortunately, most of the Business optimization problems have linear constraints, which is why LP is so popular. There are well over 400 computer packages in the market today solving LP problems. Most of them are based on vertex searching, that is, jumping from one vertex to the neighboring one in search of an optimal point.


You have already noticed that, a graph of a system of inequalities and/or equalities is called the feasible region. These two representations, graphical, and algebraic are equivalent to each other, which means the coordinate of any point satisfying the constraints is located in the feasible region, and the coordinate of any point in the feasible region satisfies all the constraints.


A numerical Example: Find the system of constraints representing the following feasible region.


In the above Figure, the system of coordinate is shown in gray color at the background. By constructing the equations of the boundary lines of the feasible region, we can verify that the following system of inequalities indeed represents the above feasible region:


X1 ³ -1 X2 £ 1 X1 - X2 £ 1


Links Between LP and Systems of Equations: Algebraic Method


As George Dantzig pointed out, linear programming is strictly "the theory and solution of linear inequality systems." The basic solutions to a linear program are the solutions to the systems of equations consisting of constraints at binding position. Not all basic solutions satisfy all the problem constraints. Those that do meet all the restrictions are called basic feasible solutions. The basic feasible solutions correspond precisely to the extreme points of the feasible region.


For example, for Carpenter's Problem. one can compute all the basic solutions, by taking any two of the equations and solving them simultaneously and then, using the constraints of other equations to check for feasibility of this solution. If feasible, then this solution is a basic feasible solution that provides the coordinates of a corner point of the feasible region. To illustrate the procedure, consider the Carpenter's constraints at binding (i. e. all with = sign) position:


2X1 + X2 = 40 X1 + 2X2 = 50 X1 = 0 X2 = 0


Here we have 4 equations with 2 unknowns. In terms of a "binomial coefficient", there are at most C 4 2 = 4! / [2! (4-2)!] = 6 basic solutions. Solving the six resultant systems of equations, we have:


Six Basic Solutions with Four Basic Feasible Solutions


Four of the above basic solutions are basic feasible solutions satisfying all the constraints, belonging to the coordinates of the vertices of the bounded feasible region. By plugging in the basic feasible solution in the objective function, we compute the optimal value. Therefore, from the above table, we see that, the optimal solution is X1 = 10, X2 = 20, with optimal value of $110. The above approach can be applied in solving higher dimension LP problems provided the optimal solution is bounded.


You may like using Solving Systems of Equations JavaScript to check your computation.


Further Readings: Arsham H, Links Among a Linear System of Equations, Matrix Inversion, and Linear Program Solver Routines, Journal of Mathematical Education in Science and Technology . 29(5), 764-769, 1998. Dantzig G. Linear Programming & Extensions . page 21, The Rand-Princeton U. Press, 1963.


Extension to Higher Dimensions


The Graphical Method is limited in solving LP problems having one or two decision variables. However, it provides a clear illustration of where the feasible and non-feasible regions are, as well as, vertices. Having a visual understanding of the problem helps with a more rational thought process. For example, we learned that: If an LP program has a bounded optimal solution, then the optimal solution is always one of the vertices of its feasible region (a corner point). What is needed to be done is to find all the intersection points (vertices) and then examine which one among all feasible vertices, provides the optimal solution. By using Analytical Geometry concepts, we will overcome this limitation of human vision. The Algebraic Method is designed to extend the graphical method results to multi-dimensional LP problem, as illustrated in the following numerical example.


Numerical Example: The Transportation Problem


Transportation models play an important role in logistics and supply chain management for reducing cost and improving service. Therefore, the goal is to find the most cost effective way to transport the goods.


Consider a model with 2 origins and 2 destinations. The supply and demand at each origin (e. g; warehouse) O1, O2 and destination (e. g.; market) D1 and D2, together with the unit transportation cost are summarized in the following table.


The Unit Transportation Cost Matrix


Let Xij's denote the amount of shipment from source i to destination j. The LP formulation of the problem minimizing the total transportation cost is:


Min 20X11 + 30X12 + 10X21 + 40X22


subject to: X11 + X12 = 200 X21 + X22 = 100 X11 + X21 = 150 X12 + X22 = 150 all Xij ³ 0


Notice that the feasible region is bounded, therefore one may use the algebraic method. Because this transportation problem is a balanced one (total supply = total demand) all constraints are in equality form. Moreover, any one of the constraints is redundant (adding any two constraints and subtracting another one, we obtain the remaining one). Let us delete the last constraint. Therefore, the problem reduces to:


Min 20X11 + 30X12 + 10X21 + 40X22


subject to: X11 + X12 = 200 X21 + X22 = 100 X11 + X21 = 150 all Xij ³ 0


This LP problem cannot be solved by the graphical method. However, the algebraic method has no limitation on the LP dimension. The constraints are already at binding (equality) position.


Notice that we have m=3 equality constraints with (four implied non-negative) decision variables. Therefore, out of these four variables there is at most m=3 variables with positive value and the rest must be at zero level. For example, by setting any one of the variables in turn to zero, we get:


Now by setting any one (or more) variables to zero, it is easy to see, by inspecting the constraints that all other solutions are infeasible. Thus, from the above table, we obtain the optimal strategy to be: X11 = 50, X12 = 150, X21 = 100, and X22 = 0, with the least total transportation cost of $6,500.


You may like to run this problem using Module Net. Exe in your WinQSB Package to check these results for yourself.


Notice that in the above example, there are m=3 constraints (excluding the non-negativity conditions), and n=4 decision variables. The optimal shipment indicates that, the manager should not send any shipment from one source to one destination. The optimal solution consists of at most 3 positive decision variables which is equal to the number of constrains. If the manager is shipping goods from every source to every destination, then the result is not optimal.


The above results, found in the above example, by Algebraic Method can be generalize, in the following main Economic result .


Given an LP having a bounded feasible region, with m constraints (excluding any sign constraints such as non-negativity conditions) and n decision variables, if n > m then at most m decision variables have positive value at the optimal solution and the rest of (i. e. n-m) decision variables must be set at zero level. This result holds if the problem has a bounded unique optimal solution. The above result follows from the fact that, using the shadow prices indicates that the opportunity cost for the decision variable at zero level exceed its contribution.


Numerical Example: Find the optimal solution for the following production problem with n=3 products and m=1 (resource) constraint:


Maximize 3X1 + 2X2 + X3


Subject to: 4X1 + 2X2 + 3X3 £ 12 all variables Xi's ³ 0


Since the feasible region is bounded, following the Algebraic Method by setting all the constraints at the binding position, we have the following system of equations:


4X1 + 2X2 + 3X3 = 12 X1 = 0 X2 = 0 X3 = 0


The (basic) solutions obtained, from this system of equations are summarized in the following table.


Thus, the optimal strategy is X1 = 0, X2 = 6, X3 = 0, with the maximum net profit of $12.


The result in the above table is consistent with the application of the above main economic result. In other words, the optimal solution can be found by setting at least n - m = 3 - 1 = 2 decision variables to zero:


For large-scale LP problems with many constraints, the Algebraic Method involves solving many linear systems of equations. When the LP problem has many variables and constraints, solving many systems of equations by hand can become very tedious. Even for very large-scale problems it is an impossible task. Therefore, we need the computer to do the computations for us. One of the algorithmic and computerized approaches is The Simplex Method. which is an efficient and effective implementation of the Algebraic Method. There are well over 400 LP solvers, all of which using the Simplex method, including your software. Upon solving the LP problem by computer packages, the optimal solution provides valuable information, such as sensitivity analysis ranges.


You may like using Solving Systems of Equations JavaScript for up to 3-decision variables LP problems to check your computation by the algebraic method.


For details and more numerical examples visit the Solution Algorithms for LP Models Web site.


How to Solve a Linear System of Equations by LP Solvers?


In the Algebraic Method of solving LP problems, we have to solve some systems of equations. There is a link between LP solvers and the systems of equation solvers. Suppose we have a very large system of equations that we would like to solve and an LP solver package but we still have no solver computer package for a system of equations available. The question is "How to use an LP solver to find the solution to a system of equations?" The following steps outline the process of solving any linear system of equations using an available LP solver.


1- Because some LP solvers require that all variables be non-negative, substitute for each variable Xi = Yi - T everywhere. 2- Create a dummy objective, such as minimize T. 3- The constraints of the LP problem are the equations in the system after the substitutions outlined in step 1.


Numerical Example: Solve the following system of equations


2X1 + X2 = 3 X1 - X2 = 3


Since the WinQSB package accepts LP in various formats ( unlike Lindo), solving this problem by WinQSB is straightforward:


First, create an LP with a dummy objective function such as Max X1, subject to 2X1 + X2 = 3, X1 - X2 = 3, and both X1 and X2 unrestricted in sign. Then, enter this LP into the LP/ILP module to get the solution. The generated solution is X1= 2, X2= -1, which can easily be verified by substitution.


However, if you use any LP solver which requires by default (e. g. Lindo) that all variables be non-negative, you need to do some preparations to satisfy this requirement: First substitute for X1 = Y1 - T and X2 = Y2 - T in both equations. We also need an objective function. Let us have a dummy objective function such as minimize T. The result is the following LP:


Subject to: 2Y1 + Y2 - 3T = 3, Y1 - Y2 = 3.


Using any LP solver, such as Lindo, we find the optimal solution to be Y1 = 3, Y2 = 0, T = 1. Now, substitute this LP solution into both transformations X1 = Y1 - T and X2 = Y2 - T. This gives the numerical values for our original variables. Therefore, the solution to the system of equations is X1 = 3 - 1 = 2, X2 = 0 - 1 = -1, which can easily be verified by substitution.


Dual Problem: Construction and Its Meaning


Associated with each (primal) LP problem is a companion problem called the dual. The following classification of the decision variable constraints is useful and easy to remember in construction of the dual.


Objective: Max (e. g. Profit)


--------------------------------------------------------------------------- A one-to-one correspondence between the constraint type and the variable type exists using this classification of constraints and variables for both the primal and the dual problems.


Dual Problem Construction:


- If the primal is a maximization problem, then its dual is a minimization problem (and vise versa).


- Use the variable type of one problem to find the constraint type of the other problem.


- Use the constraint type of one problem to find the variable type of the other problem.


- The RHS elements of one problem become the objective function coefficients of the other problem (and vice versa).


- The matrix coefficients of the constraints of one problem is the transpose of the matrix coefficients of the constraints for the other problem. That is, rows of the matrix becomes columns and vise versa.


You may check your dual constructions rules by using your WinQSB package.


Consider the following primal problem:


min x1-2x2 subject to: x1+x2 ³ 2, x1-x2 £ -1, x2 ³ 3, and x1, x2 ³ 0.


Following the above construction rule, the dual problem is:


max 2u1 - u2 + 3u3 subject to: u1 + u2 £ 1, u1 - u2 + u3 £ -2, u1 ³ 0, u2 £ 0, and u3 ³ 0


The Dual of the Carpenter's Problem:


Maximize 5X1 + 3X2


Subject to: 2X1 + X2 £ 40 X1 + 2X2 £ 50 X1 ³ 0 X2 ³ 0


Minimize 40U1 + 50U2


Subject to: 2U1 + U2 ³ 5 U1 + 2U2 ³ 3 U1 ³ 0 U2 ³ 0


Applications: One may use duality in a wide variety of applications including:


- It may be more efficient to solve the dual than the primal.


- The dual solution provides important economical interpretation such as shadow prices, i. e. the marginal values of the RHS elements. The shadow price was defined, historically as the improvement in the objective function value per unit increase in the right hand side, because the problem was often put in the form of profit maximization improvement (meaning increase). The shadow price may not be the market price. The shadow price is e. g. the worth of the resource under the "shadow" of your business activity. Sensitivity analysis . i. e. the analysis of the effect of small variations in system parameters on the output measures can be studied by computing the derivatives of the output measures with respect to the parameter.


- If a constraint in one problem is not binding (i. e. the LHS value agrees with the RHS value), then the associated variable in the other problem is zero. If a decision variable in one problem is not zero, then the associated constraint in the other problem is binding. These results are known as the Complementarily Slackness Conditions (CSC).


- Obtain the sensitivity range of the RHS of one problem from the sensitivity range of the cost coefficient in the other problem, and vice versa.


These results imply the only possible combinations of primal and dual properties as shown in the following table:


Possible Combinations of Primal and Dual Properties


Notice that almost all LP solvers produce sensitivity range for the last two cases; however these ranges are not valid. For this reason you must make sure that the solution is unique, and non-degenerate in analyzing and applying the sensitivity ranges.


Further Readings: Arsham H. An Artificial-Free Simplex Algorithm for General LP Models, Mathematical and Computer Modelling . Vol. 25, No.1, 107-123, 1997. Benjamin A. Sensible Rules for Remembering Duals_ S-O-B Method, SIAM Review . Vol. 37, No.1, 85-87, 1995. Chambers R. Applied Production Analysis: A Dual Approach . Cambridge University Press, 1988.


The Dual Problem of the Carpenter's Problem and Its Interpretation


In this section we will construct the Dual Problem of the Carpenter's Problem and provide an economical interpretation of it.


In the Carpenter's Problem uncontrollable input parameters are the following:


The Uncontrollable Inputs


and its LP formulation as:


Maximize 5 X1 + 3 X2


Subject to: 2 X1 + X2 £ 40 labor constraint X1 + 2 X2 £ 50 material constraint and both X1, X2 are non-negative.


Where X1 and X2 are the number of tables and chairs to make.


Suppose the Carpenter wishes to buy insurance for his net income. Let U1 = the dollar amount payable to the Carpenter for every labor hour lost (due to illness, for example), and U2 = the dollar amount payable to the Carpenter for every raw material unit lost (due to fire, for example).


The insurance officer tries to minimize the total amount of $(40U1 + 50U2) payable to the Carpenter by the insurance company. However, the Carpenter will set the constraints (i. e. conditions) by insisting that the insurance company cover all his/her loss that is his net income since he/she cannot make the products. Therefore, the insurance company problem is:


Minimize 40 U1 + 50 U2 Subject to: 2U1 + 1U2 ³ 5 Net Income from a table 1U1 + 2U2 ³ 3 Net Income from a chair and U1, U2 are non-negative.


Implementing this problem on your computer package shows that the optimal solution is U1 = $7/3 and U2 = $1/3 with the optimal value of $110 (the amount the Carpenter expects to receive). This ensures that the Carpenter can manage his life smoothly. The only cost is the premium that the insurance company will charge.


Shadow Price Unit of Measure: Notice that the unit of measure of the RHS shadow price is the unit of measure of the primal objective divided by the unit measure of the RHS. For example for the Carpenters problem, U1 = [$/week] / hours/week] = $/hour. Thus U1 = 7/3 $/hour, and U2 = 1/3 $/unit of raw material.


As you can see, the insurance company problem is closely related to the original problem.


In OR/MS/DS modeling terminology, the original problem is called the Primal Problem while the related problem is called its Dual Problem.


In the Carpenter's Problem and its Dual Problem, the Optimal Value for both problems is always the same. This fact is referred to as Equilibrium (taken from the complementarity theory, equilibrium of economical systems, and efficiency in Pareto's sense) between the Primal and the Dual Problems. Therefore, there is no duality gap in linear programming.


The dual solution provides important economical interpretation such as the marginal values of the RHS elements. The elements of the dual solution are known as the Lagrangian multipliers because they provide (a tight) bound on the optimal value of the primal, and vise versa. For example, considering the Carpenter's problem the dual solution can be used to find a lower tight bound for the optimal value, as follow. After converting the inequality constraints into £ form, multiply each constraint by its corresponded dual solution and then add them up, we get:


7/3 [ 2X1 + X2 £ 40] 1/3 [ X1 + 2X2 £ 50] _____________________ 5X1 + 3X2 £ 110


Notice that the resultant on the left side is the objective function of the primal problem, and this lower bound for it is a tight one, since the optimal value is 110.


Managerial Roundoff Errors


You must be careful whenever you round the value of shadow prices. For example, the shadow price of the resource constraint in the above problem is 8/3; therefore, if you wish to buy more of this resource, you should not pay more than $2.66. Whenever you want to sell any unit of this resource, you should not sell it at a price below $2.67.


A similar error might occur whenever you round the limits on the sensitivity ranges. One must be careful because the upper limit and lower limit must be rounded down and up, respectively.


Computation of Shadow Prices


You know by now that the shadow prices are the solution to the dual problem . Here is a numerical example.


Compute the shadow price for both resources in the following LP problem:


Max - X1 + 2X2 S. T. X1 + X2 £ 5 X1 + 2X2 £ 6 and both X1, X2 non-negative


The solution to this primal problem (using, e. g. the graphical method) is X1 = 0, X2 = 3, with the leftover S1 = 2 of the first resource, while the second resource is fully utilized, S2 = 0.


The shadow prices are the solution to the dual problem:


Min 5U1 + 6U2 S. T. U1 + U2 ³ -1 U1 + 2U2 ³ 2 and both U1 and U2 are non-negative.


The solution to the dual problem (using, e. g. the graphical method) is U1 = 0, U2 = 1 which are the shadow prices for the first and second resource, respectively. Notice that whenever the slack/surplus of a constraint is non-zero, the shadow price related to that RHS of that constraint is always zero; however, the reverse statement may not hold . In this numerical example S1 = 2 (i. e. slack value of the RHS1 of the primal), which is non-zero; therefore U1 is equal to zero as expected.


Consider the following problem:


Max X1 + X2 subject to: X1 £ 1 X2 £ 1 X1 + X2 £ 2 all decision variables ³ 0.


By using your computer package, you may verify that the shadow price for the third resource is zero, while there is no leftover of that resource at the optimal solution X1 = 1, X2 = 1.


Behavior of Changes in the RHS Values of the Optimal Value


To study the directional changes in the optimal value with respect to changes in the RHS (with no redundant constraints present, and all RHS ³ 0), we distinguish the following two cases:


Case I: Maximization problem


For £ constraint: The change is in the same direction. That is, increasing the value of RHS does not decrease the optimal value. It increases or remains the same depending on whether the constraint is a binding or non-binding constraint.


For ³ constraint: The change is in the reverse direction. That is, increasing the value of RHS does not increase the optimal value. It decreases or remains the same depending on whether the constraint is a binding or non-binding constraint.


For = constraint: The change could be in either direction (see the More-for-less section).


Case II: Minimization problem


For £ type constraint: The change is in the reverse direction. That is, increasing the value of RHS does not increase the optimal value (rather, it decreases or has no change depending on whether the constraint is a binding or non-binding constraint).


For ³ type constraint: The change is in the same direction. That is, increasing the value of RHS does not decrease the optimal value (rather, increases or has no change depending on whether the constraint is a binding or non-binding constraint).


For = constraint: The change could be in either direction (see the More-for-less section).


Dealing with Uncertainties and Scenario Modeling


The business environment is often unpredictable and uncertain because of factors such as economic changes, government regulations, dependence on subcontractors and vendors, etc. Managers often find themselves in a dynamic, unsettled environment where even short range plans must be constantly reassessed and incrementally adjusted. All these require a change-oriented mentality to cope with uncertainties. Remember that surprise is not an element of a robust decision.


Managers use mathematical and computational constructs (models) for a variety of settings and purposes, often to gain insight into possible outcomes of one or more courses of action. This may concern financial investments, the choice (whether/how much) to insure, industrial practices, and environmental impacts. The use of models is flawed by the unavoidable presence of uncertainties, which arise at different stages; in the construction and corroboration of the model itself, and in its use. Its use is often the culprit.


Every solution to a decision problem is based on certain parameters that are assumed to be fixed. Sensitivity analysis is a collection of post-solution activities to study and determine how sensitive the solution is to changes in the assumptions. Other names for such activities are stability analysis, what-if analysis, scenario modeling, ranging analysis, specificity analysis, uncertainty analysis, computational and numerical instability, functional instability, tolerance analysis, post-optimality analysis, allowable increases and decreases, and many other similar phrases that reflect the importantness of this stage of the modeling.


Numerical Example: Consider the following problem:


Max 6X1 + 4.01X2 subject to: X1 + 2X2 £ 16 3X1 + 2X2 £ 24 all decision variables ³ 0.


The optimal solution is (X1 = 4, X2 = 6), but with a slight change in the objective function, one may get a completely different optimal solution. For example, if we change it to 6X1 + 3.99X2, then the optimal solution is (X1 = 8, X2 = 0). That is, decreasing the second coefficient by 0.5%, the solution changes drastically! Therefore, the optimal solution is not stable with respect to this input parameter.


Sensitivity analysis is not the typical term employed in econometric for the method of investigating the response of a solution to perturbations in parameters. In econometrics, the process of changing the value of a parameter in a model, in order to see its individual impacts on the performance measure, is called comparative statics or comparative dynamics. depending on the type of model under consideration.


Uncertainty in a model can have different origins in different decision problems. It may be due to either incomplete information, or fluctuations inhere in the problem, or unpredictable changes in the future. Current approaches to deal with uncertainties includes:


Scenario Analysis: In this approach one assumes scenarios (e. g. certain combinations of possible values of uncertain parameter) and solves the problem for each. By solving the problem repeatedly for different scenarios and studying the solutions obtained, the manager observes sensitivities and heuristically decides on an approximate, which is subjective.


Worst-case Analysis: This technique attempts to account for putting safety margins into the problem in the planning stage.


Monte-Carlo Approach: Stochastic models assume that the uncertainty is known by its statistical distribution.


Sensitivity analysis vs. Stochastic Programming: Sensitivity analysis (SA) and Stochastic Programming (SP) formulations are the two major approaches used for dealing with uncertainty. SA is a post-optimality procedure with no power of influencing the solution. It is used to investigate the effects of the uncertainty on the model's recommendation. SP formulation, on the other hand, introduces probabilistic information about the problem data, albeit with the first moments (i. e. the expected values) of the distribution of the objective function with respect to the uncertainty. This ignores the decision-makers' risk assessments, characterized by variance, or coefficient of variation.


One may tackle uncertainties in a more "deterministic" manner. The approach is called various names such as "scenario modeling", "deterministic modeling", "sensitivity analysis", "ranging procedures", and "stability analysis". The idea is to subjectively come up with a ranked list of higher level uncertainties that might presumably have a bigger impact on the eventual mapping result. This is done before zooming in on the details of any particular "scenario" or model.


For example, the problem parameters, and the uncontrollable factors indicated in the above figure for the Carpenter's problem, required a complete sensitivity analysis in order to enable the carpenter to be in control of his/her business.


Managerial Roundoff Errors: You must be very careful whenever you round the value of the limits on the sensitivity ranges. To be valid the upper limit and lower limit must be rounded down and up, respectively.


For construction of sensitivity analysis region that allows you to analyze any type of changes, including dependent, independent, and multiple changes in both the RHS values and the cost coefficients of LP visit Construction of General Sensitivity Regions site.


Further Readings: Arsham H. Algorithms for sensitivity information in discrete-event systems simulation, Simulation Practice and Theory . 6(1), 1-22, 1998. Arsham H. Perturbation analysis of general LP models: A unified approach to sensitivity, parametric, tolerance, and more-for-less analysis, Mathematical and Computer Modelling . 13(3), 79-102, 1990. Kouvelis P. and G. Yu, Robust Discrete Optimization and its Applications . Kluwer Academic Publishers, 1997. Provides a comprehensive discussion of motivations for sources of uncertainty in optimization.


Computation of Sensitivity Ranges for Small Size Problems


To compute sensitivity ranges for LP Problems with at most 2 decision variables and/or at most 2 constraints, you may like to try the following easy-to-use approach.


The only restriction is that no equality constraint is permitted. Having an equality constraint is the case of degeneracy. because every equality constraint, for example, X1 + X2 = 1, means two simultaneous constraints: X1 + X2 £ 1 and X1 + X2 ³ 1. The number of binding constraints in such a case will be more than the number of decision variables. This is known as a degenerate situation for which the usual sensitivity analysis may not be valid.


Cost Sensitivity Range for LP Problems with two Decision Variables


Referring to the Carpenter's Problem, changing the profit on each product changes the slope of the iso-value objective function. For "small" changes, the optimal stays at the same extreme point. For larger changes the optimal solution moves to another point. Then we have to modify the formation and solve a new problem.


The problem is to find a range for each cost coefficient c(j), of variable Xj, such that the current optimal solution, i. e. the current extreme point (corner point), remains optimal.


For a 2-dimensional LP problem, you may like to try the following approach to find out the amount of increase/decrease in any one of the coefficients of the objective function (also known as the cost coefficients. Historically during World War II, the first LP problem was a cost minimization problem) in order to maintain the validity of the current optimal solution. The only condition required for this approach is that no equality constraint is permitted. since this leads to the case of degeneracy. for which the usual sensitivity analysis may not be valid.


Step 1: Consider the only two binding constraints at the current optimal solution. If there are more than two binding constraints, then this is the case of degeneracy. for which the usual sensitivity analysis may not be valid.


Step 2: Perturb the j th cost coefficient by parameter cj (this is the unknown amount of changes).


Step 3: Construct one equation corresponding to each binding constraints as follow:


(Perturbed Cj cost)/ coefficient of Xj in the constraint = Coefficient of the other variable in the objective function /coefficient of that variable of the constraint.


Step 4: The amount of allowable increase is the smallest positive cj, while the allowable decrease is the largest negative cj, obtained in Step 3.


Notice that if there is no positive (negative) cj, then the amount of the increase (decrease) is unlimited.


Advertencias:


Remember that you should never divide by zero. The practice of dividing by zero is a common fallacy found in some textbooks. For example, in the Introduction to Management Science , Taylor III, B. Prentice Hall, the author, unfortunately divides by zero, in Module A: The Simplex Solution Method, pp. A26-A27, where computing the needed column-ratio in the simplex method. For more on this, and other common fallacies visit the Web site The zero saga & confusions with numbers. Here is a question for you: Which of the following are correct and why? a) any number divided by zero is undefined; b) zero divided by any number is zero; or c) any number divided by itself is 1.


Finding the Cost Sensitivity Range by Grapical Method: It is a commonly held belief that one can compute the cost sensitivity range by bracketing the (perturbed) slope of the (iso-value) objective function by the slopes of the two lines resulting from the binding constraints. This graphical slope-based method to compute the sensitivity ranges is described in popular textbooks, such as Anderson et al. . (2007), Lawrence and Pasternack (2002), and Taylor (2010).


Unfortunately these are misleading. Warning should have been given that their approach is not general and works if and only if the coefficients do not change sign.


In an LP with 2 variables and inequality constraints, suppose we have a unique, non-degenerate optimum at the intersection of two lines, as shown in the following figure. Then, the range of objective coefficients for which this solution remains optimal is given by the slopes of the two lines.


The following is a counterexample. It points out that one must be careful to state that the coefficients do not change sign.


The Carpenter's Problem:


Maximize 5X1 + 3X2


Subject to: 2X1 + X2 £ 40 X1 + 2X2 £ 50 X1 ³ 0 X2 ³ 0


Computation of allowable increase/decrease on the C1 = 5: The binding constraints are the first and the second one. Perturbing this cost coefficient by c1, we have 5 + c1. At step 3, we have:


(5 + c1)/2 = 3/1, for the first constraint, and (5 + c1)/1 = 3/2 for the second constraint. Solving these two equations, we have: c1 = 1 and c1 = -3.5. The allowable increase is 1, while the allowable decrease is 1.5. As far as the first cost coefficient C1 remains within the interval [ 5 - 3.5, 5 + 1] = [1.5, 6], the current optimal solution remains.


Similarly for the second cost coefficient C2 = 3, we have the sensitivity range of [2.5, 10].


As another example, consider the earlier problem:


Maximize 5X1 + 3X2


Subject to: X1 + X2 £ 2 X1 - X2 £ 0 X1 ³ 0 X2 ³ 0


Computation of allowable increase/decrease on the C1 = 5: The binding constraints are the first and the second one. Perturbing this cost coefficient by c1, we have 5 + c1. At step 3, we have:


(5 + c1)/1 = 3/1, for the first constraint and (5 + c1)/1 = 3/(-1) for the second constraint. Solving these two equations, we have: c1 = -2 and c1 = -8. The allowable decrease is 2, while the allowable increase is unlimited. As far as the first cost coefficient C1 remains within the interval [ 5 - 2, 5 + ¥ ] = [3, ¥ ], the current optimal solution remains optimal.


Similarly, for the second cost coefficient C2 = 3 we have the sensitivity range of [3 - 8, 3 + 2] = [-5, 5].


For construction of sensitivity analysis region that allows you to analyze any type of changes, including dependent, independent, and multiple changes in both the RHS values and the cost coefficients of LP visit Construction of General Sensitivity Regions site.


RHS Sensitivity Range for LP Problems with at Most Two Constraints


Referring to the Carpenter's Problem, for small changes in either resources, the optimal strategy (i. e. make the mixed-product) stays valid. For larger changes, this optimal strategy moves and the Carpenter must either make all the tables or the chairs he/she can. This is a drastic change in the strategy; therefore, we have to revise the formulation and solve a new problem.


Apart from the above needed information, we are also interested in knowing how much the Carpenter can sell (or buy) each resource at a "reasonable" price (or cost). That is, how far can we increase or decrease RHS(i) for fixed i while maintaining the validity of the current shadow price of the RHS(i)? That is, how far can we increase or decrease RHS(i) for fixed i while maintaining the current optimal solution to the dual problem?


Historically, the shadow price was defined as the improvement in the objective function value per unit increase in the right hand side, because the problem was often put in the form of profit maximization improvement (meaning increase).


Also, know that for any RHS, the shadow price (also known also its marginal value), is the amount of change in the optimal value proportion to one unit change for that particular RHS. However, in some cases it is not permitted to change the RHS by that much. The sensitivity range for the RHS provides the values for which the shadow price has such an economic meaning and remains unchanged.


How far can we increase or decrease each individual RHS in order to maintain the validity of shadow prices? The question is equivalent to asking what is the sensitivity range for the cost coefficient in the dual problem.


The dual of the Carpenter's Problem is:


Minimize 40U1 + 50U2


Subject to: 2U1 + U2 ³ 5 U1 + 2U2 ³ 3 U1 ³ 0 U2 ³ 0


The optimal solution is U1 = 7/3 and U2 = 1/3 (which are the shadow prices).


The Carpenter's Problem:


Maximize 5X1 + 3X2


Subject to: 2X1 + X2 £ 40 X1 + 2X2 £ 50 X1 ³ 0 X2 ³ 0


Computation of Range for the RHS1: The first two constraints are binding, therefore:


(40 + r1)/2 = 50/ 1, and (40 + r1) / 1 = 50/ 2.


Solving these two equations gives: r1 = 60 and r1 = -15. Therefore, the sensitivity range for the first RHS in the carpenter's problem is: [40-15, 40 + 60] = [25, 100].


Similarly, for the second RHS, we obtain: [50 - 30, 50 + 30] = [20, 80].


For construction of sensitivity analysis region that allows you to analyze any type of changes, including dependent, independent, and multiple changes in both the RHS values and the cost coefficients of LP visit Construction of General Sensitivity Regions site.


Further Readings: Lawrence J. Jr. and B. Pasternack, Applied Management Science: Modeling, Spreadsheet Analysis, and Communication for Decision Making . John Wiley and Sons, 2002. Anderson D. Sweeney D. and Williams T. An Introduction to Management Science . West Publisher, 2007. by Taylor III, B. Introduction to Management Science . Prentice Hall, 2006.


Marginal Analysis & Factors Prioritization


The major applications of sensitivity analysis information for the decision-maker are the Marginal Analysis and the Factors Prioritization:


Marginal Analysis: Marginal analysis is a concept employed, in microeconomics where the marginal change in some parameter might be of interest to the decision-maker. A marginal change is a ration of very small addition or subtraction to the total quantity of some parameter. Marginal analysis is the analysis of the relationships between such changes in relation to the performance measure. Examples of marginal analysis are: marginal cost; marginal revenue; marginal product; marginal rate of substitution; marginal propensity to save, and so on. In optimization, the marginal analysis is employed primarily to explicate various changes in the parameters and their impact on optimal value. Sensitivity analysis, i. e. the analysis of the effect of small variations in system parameters on the output measures can be studied by computing the derivatives of the output measures with respect to the parameter.


The decision-makers ponder what factors are important and have major impact on the decision outcome. The marginal analysis aims at identifying the important factors (i. e. parameters) and ranking them according to their impact on optimal value. One may derive the marginal values by evaluating the first derivatives of performance measure with respect to the parameter with specific value.


Factors Prioritization Based on Sensitivity Ranges: Consider the Carpenter's Problem:


Maximize 5X1 + 3X2


Subject to: 2X1 + X2 £ 40 X1 + 2X2 £ 50 X1 ³ 0


While the computed sensitivity ranges are valid for one-change at-a-time and not necessarily for simultaneous changes, they provide useful information for prioritization of uncontrollable factors. The following figure provides a comparative chart for the cost coefficients prioritization purposes:


The following figure depicts the shadow price as the slope (i. e. marginal value) of a linear function measuring the amount of change in the optimal value as a result of any change in the RHS1, provided the change is within the sensitivity range of the RHS1. This function also can be used to solve the inverse problem, that is, what the RHS1 value should be to achieve a specific optimal value.


What Is the 100% Rule (sensitivity region)


The sensitivity range presented in the previous section is a "one-change-at-a-time" type of what-if analysis. Consider the Carpenter's problem; suppose we want to find the simultaneous allowable increases in RHS ( r 1 . r 2 ³ 0). There is an easy method to apply here known as "the 100% rule" which says that the shadow prices remain unchanged if the following sufficient condition holds:


In the above, 60 and 30 are the allowable increases for the RHS's, based on the application of ordinary sensitivity analysis. That is, whenever the first and the second RHS increase by r 1 and r 2 . respectively, as long as this inequality holds, the shadow prices for the RHS values remain unchanged. Notice that this is a sufficient condition, for if the above condition is violated, then the shadow prices may change or still remain the same. The term "100% rule" becomes evident when you notice that in the left hand side of the above condition each term is a non-negative number being less than one, which could be represented as a percentage allowable change. The total sum of such changes should not exceed 100%.


Applying the 100% rule to the other three possible changes on the RHS's, we have:


The following Figure depicts the sensitivity region for both RHS's values as the results of the application of the 100% rule for the Carpenter's problem.


From a geometric point of view, notice that the polyhedral with vertices (60, 0), (0, 30), (-15, 0), and (0,-30) in the above Figure is only a subset of a larger sensitivity region for changes in both RHS values. Therefore, to remain within this sensitivity region is only a sufficient condition (not a necessary one) to maintain the validity of the current shadow prices.


Similar results can be obtained for the cost coefficients' simultaneous changes. For example, suppose we want to find the simultaneous allowable decrease in C 1 and increases in C 2 . That is, the amount of changes in both cost coefficients by c 1 £ 0 and c 2 ³ 0. The 100% rule states that the current basis remains optimal provided that:


Where 3.5 and 7 are the allowable decrease and increase for the cost coefficient C 1 and C 2 . respectively, that we found earlier by the application of the ordinary sensitivity analysis.


The above Figure also depicts all the other possibilities of increasing and decreasing both cost coefficients values as the result of the application of the 100% rule, while maintaining the current optimal solution for the Carpenter's problem.


As another numerical example, consider the following problem:


Maximize 5X1 + 3X2


Subject to: X1 + X2 £ 2 X1 - X2 £ 0 X1 ³ 0 X2 ³ 0


You may recall that we have already computed the one-change-at-a-time sensitivity ranges for this problem in the Computation of Sensitivity Ranges section. The sensitivity range for the first cost coefficient is [ 5 - 2, 5 + ¥ ] = [3, ¥ ], while, for the second cost coefficient it is [3 - 8, 3 + 2] = [-5, 5]. You should be able to reproduce a figure similar to the above depicting all other possibilities of increasing/decreasing both cost coefficients values as the results of the application of the 100% rule, while maintaining the current optimal solution for this problem.


The application of the 100% rule as presented here is general and can be extended to any large size LP problem. As the size of problem becomes larger, this type of sensitivity region becomes smaller and therefore less useful to the managers. There are more powerful (providing both necessary and sufficient conditions) and useful techniques to the managers for dependent (or independent) simultaneous changes in the parameters.


For construction of sensitivity analysis region that allows you to analyze any type of changes, including dependent, independent, and multiple changes in both the RHS values and the cost coefficients of LP visit Construction of General Sensitivity Regions site.


Adding a New Constraint


The process: Insert the current optimal solution into the newly added constraint. If the constraint is not violated, the new constraint does NOT affect the optimal solution. Otherwise, the new problem must be resolved to obtain the new optimal solution.


Deleting a Constraint


The process: Determine if the constraint is a binding (i. e. active, important) constraint by finding whether its slack/surplus value is zero. If binding, deletion is very likely to change the current optimal solution. Delete the constraint and re-solve the problem. Otherwise, (if not a binding constraint) deletion will not affect the optimal solution.


Replacing a Constraint


Suppose we replace a constraint with a new constraint. What is the affect of this exchange? The process: Determine if the old constraint is a binding (i. e. active, important) constraint by finding out whether its slack/surplus value is zero. If binding, the replacement is very likely to affect the current optimal solution. Replace the constraint and resolve the problem. Otherwise, (if not a binding constraint) determine whether the current solution satisfies the new constraint. If it does, then this exchange will not affect the optimal solution. Otherwise, (if the current solution does not satisfy the new constraint) replace the old constraint with the new one and resolve the problem.


Changes in the Coefficients of Constraints


Any changes in the coefficients of constraints might cause significant changes to the nominal (original) problem. Any such changes fall logically within the sensitivity analysis; however, these are not changes that can be analyzed using the information generated by the optimal solution. Such changes are best dealt with by solving the modified problem anew.


Adding a Variable (e. g. Introducing a new product)


The coefficient of the new variable in the objective function, and the shadow prices of the resources provide information about marginal worth of resources and knowing the resource needs corresponding to the new variable, the decision can be made, e. g. if the new product is profitable or not.


The process: Compute what will be your loss if you produce the new product using the shadow price values (i. e. what goes into producing the new product). Then compare it with its net profit. If the profit is less than or equal to the amount of the loss then DO NOT produce the new product. Otherwise it is profitable to produce the new product. To find out the production level of the new product resolves the new problem.


Deleting a Variable (e. g. Terminating a product)


The process: If for the current optimal solution, the value of the deleted variable is zero, then the current optimal solution still is optimal without including that variable. Otherwise, delete the variable from the objective function and the constraints, and then resolve the new problem.


Optimal Resource Allocation Problem


Since resources are always scarce, managers are concerned with the problem of optimal resources allocation. You will recall in the The Carpenter's Problem formulation that we treated both resources as parameters, that is, as given fixed numerical values:


Maximize 5 X1 + 3 X2


Subject to: 2 X1 + X2 £ 40 labor constraint X1 + 2 X2 £ 50 material constraint and both X1, X2 are nonnegative.


We usually classify constraints as resource or production type constraints. It is a fact that in most maximization problem, the resource constraints are the natural part of the problem, while in the minimization problem the production constraints are the most important part of the problem.


Suppose we wish to find the best allocation of the labor resource for the Carpenter. In other words, what is the best number of hours the Carpenter should allocate to his or her business?


Let the allocated number of hours be R, which we want to use in determining its optimal value. Therefore, the mathematical model is to find R1 such that:


Maximize 5 X1 + 3 X2


Subject to: 2 X1 + X2 £ R1 labor constraint X1 + 2 X2 £ 50 material constraint and all variables X1, X2, and R1 are nonnegative.


We are now treating R1 not as a parameter but as a decision variable. That is, the maximization is over all three variables; X1, X2, and R1:


Maximize 5 X1 + 3 X2


Subject to: 2 X1 + X2 - R1 £ 0 labor constraint X1 + 2 X2 £ 50 material constraint and all variables X1, X2, and R1 are nonnegative.


Using your LP software, the optimal solution is X1 = 50, X2 = 0, with an optimal labor allocation of R1 = 100 hours. This brings an optimal value of $250.


Notice that the optimal resource allocation value is always the same as the upper bound on the RHS1 sensitivity range generated by your software.


The allowable increase in number of hours is 100 - 40 = 60 hours which brings additional 250 - 110 = 140.


We are able even to obtain the shadow price for this resource using this information. The shadow price is the rate of change in the optimal value with respect to the change in the RHS. Therefore (250 - 110)/(100 - 40) = 140/60 = 7/3, which is the shadow price of the RHS1 as we found by other methods in earlier sections.


Determination of Product's Least Net Profit


In most "price taker" business settings, the net profit is an uncontrollable factor. The manager is interested in knowing the least net profit for a product that makes it profitable to produce at all.


You may recall that in the The Carpenter's Problem we treated both net profits ($5, and $3) as uncontrollable inputs, that is, the values determined by the market:


Maximize 5 X1 + 3 X2


Subject to: 2 X1 + X2 £ 40 labor constraint X1 + 2 X2 £ 50 material constraint And both X1, X2 are nonnegative.


This has the optimal strategy of X1 =10, X2 = 20, with an optimal value of $110.


Suppose the Carpenter wants to know the least value for the first coefficient in the objective function, which is currently $5, in order to make it still profitable to produce the first product (i. e. tables).


Suppose the least net profit is c1 dollars; therefore, the problem is to find c1 such that:


Maximize c1 X1 + 3 X2


Subject to: 2 X1 + X2 £ 40 labor constraint X1 + 2 X2 £ 50 material constraint And all variables X1, X2, c1 are nonnegative.


Minimize 40 U1 + 50 U2 Subject to: 2U1 + 1U1 ³ c1 Net profit from a table 1U1 + 2U2 ³ 3 Net profit from a chair And U1, U2, c1 are nonnegative.


We are now treating the net profit c1 as a decision variable. The minimization is over all three variables; X1, X2, and c1:


Minimize 40 U1 + 50 U2 Subject to: 2U1 + 1U1 - c1 ³ 0 1U1 + 2U2 ³ 3 And U1, U2, c1 are nonnegative.


Implementing this problem on your computer package shows that the optimal solution is U1 = $7/3, U2 = $1/3, and c1 = $1.5.


There are alternative solutions for this boundary value of the sensitivity range for the cost coefficient. The solution corresponds to the lower limit in the sensitivity analysis range of the cost coefficient computed earlier for the Carpenter's Problem. The least net profit is always the same as the lower bound on the cost coefficient sensitivity range generated by your software.


Min Max and Max Min Computation in a Single-Run


Suppose we wish to find the worst of several objective functions values defined on a common set of constraints in a single-run computer implementation.


As an application, suppose that in The Carpenter's Problem. without loss of generality, we have three markets with objective functions 5X1 + 3X2, 7X1 + 2X2, and 4X1 + 4X2, respectively. The carpenter is interested in knowing the worst market. That is, the solution of the following problem:


The Min Max Problem:


Subject to: 2 X1 + X2 £ 40 X1 + 2 X2 £ 50 and both X1, X2 are nonnegative.


The Min Max Problem is equivalent to:


Subject to: y £ 5x1 + 3X2 y £ 7X1 + 2X2 y £ 4X1 + 4X2 2X1 + X2 £ 40 X1 + 2X2 £ 50 And all variables X1, X2, y, are nonnegative.


If you take all the variables to the left-hand side of the constraints and implement this problem on your computer package, the optimal solution is X1 = 10, X2 = 20, y = $110. This means the first and the second markets are the worst (because the first and the second constraints are binding) bringing only $110 net profit.


Similarly, one can solve the maximum of min of several objective functions in a single run.


Feasibility Problem: Goal-Seeking Indicators


In most business applications, the manager wishes to achieve a specific goal, while satisfying the constraints of the model. The user does not particularly want to optimize anything so there is no reason to define an objective function. This type of problem is usually called a feasibility problem.


Although some decision-makers would prefer the optimal. However, in most practical situations, decision-maker aims at satisfying or making incremental changes rather than optimizing. This is so, because human mind has a bounded rationality and hence can not comprehend all alternatives. In the incremental approach to decision-making. the manager takes only small steps, or incremental moves, away from the existing system. This is usually accomplished by a "local search" to find a "good enough" solution. This problem is referred to as "satisfying problem", "feasibility problem", or the "goal-seeking" problem. Therefore, the aim is to achieve a global improvement to a level that is good enough, given current information and resources. One reason that causes a business manager to overestimate the importance of the optimal strategy, is that organizations often use indicators as "proxies" for satisfying their immediate needs. Most managers pay attention to indicators, such as profit, cash flow, share price etc. to indicate survival rather than as a goal for optimization.


To solve the goal-seeking problem, one must first add the goal to the constraint set. To convert the goal seeking problem to an optimization problem, one must create a dummy objective function. It could be a linear combination of the sub-set of decision variables. If you maximize this objective function, you will get a feasible solution (if one exists). If you minimize it, you might get another one (usually at the other "side" of the feasible region). You could optimize with different objective functions.


Another approach is to use "Goal Programming" models that deal precisely with problems of constraint satisfaction without necessarily having a single objective. Basically, they look at measures of constraint violation and try to minimize them. You can formulate and solve goal programming models in ordinary LP, using ordinary LP solution codes.


In the artificial-variable free solution algorithm one may use a zero dummy objective function, but not in some software packages, such as Lindo. In using software packages one may maximize or minimize any variable as an objective function.


Consider Example 1 in the Initialization of the Simplex Method section of a companion site to this site. Instead of maximizing, we now wish to achieve a goal of 4. That is,


Goal: - X1 + 2X2 = 4 subject to: X1 + X2 ³ 2, - X1 + X2 ³ 1, X2 £ 3, and X1, X2 ³ 0.


Adding this goal to the constraint set and converting the constraints into equality form, we have:


X1 + X2 - S1 = 2, - X1 + X2 - S2 = 1, X2 + S3 = 3, and X1, X2, S1, S2, S3 ³ 0.


A solution is X1 = 2, X2 = 3, S1 = 3, S2 = 0, and S3 = 0.


For details on the solution algorithms, visit the Web site Artificial-variable Free Solution Algorithms.


Further Readings: Borden T. and W. Banta, (Ed.), Using Performance Indicators to Guide Strategic Decision Making . Jossey-Bass Pub. 1994. Eilon S. The Art of Reckoning: Analysis of Performance Criteria . Academic Press, 1984.


The Copyright Statement: The fair use, according to the 1996 Fair Use Guidelines for Educational Multimedia. of materials presented on this Web site is permitted for non-commercial and classroom purposes only. This site may be mirrored intact (including these notices), on any server with public access. All files are available at http://home. ubalt. edu/ntsbarsh/Business-stat for mirroring.


Kindly e-mail me your comments, suggestions, and concerns. Gracias.


This site was launched on 2/25/1994, and its intellectual materials have been thoroughly revised on a yearly basis. The current version is the 9 th Edition. All external links are checked once a month.


EOF: Ó 1994-2017.


General Labor Resume Objectives . General laborers work in the industrial, manufacturing and constru. General labor is a term used to group workers in a construction site that is responsible for all ki. Get ideas on how to write resume example on general laborer . There are more resume samples on gener entry-level construction cover letter example Entry-Level. Entry-Level Construction Worker Resum . Use our resume sample as a guide and land more interviews. construction labor cover letter exam . Employers spend an average of half a minute looking at a resume . reports Duke University. The objec .


June 08, 2017, 09:37


Objective statement for general


General Labor Resume Objectives . General laborers work in the industrial, manufacturing and constru. General labor is a term used to group workers in a construction site that is responsible for all ki. Get ideas on how to write resume example on general laborer . There are more resume samples on gener entry-level construction cover letter example Entry-Level. Entry-Level Construction Worker Resum . Use our resume sample as a guide and land more interviews. construction labor cover letter exam . Employers spend an average of half a minute looking at a resume . reports Duke University. The objec .


Resume example for packer objective skills


Aug 10, 2017 . This page contains tips, information and a sample resume for the position of packe . Check out our Food Processor resume samples for tips on how to improve your. Food Processor with hand packager free sample resume . resume example . free resume template . resume format . resume writi. Mar 10, 2017 . Home » CV Examples » Picker Packer CV Example . I have good communication skills . The job seeker in this sample hand packer resume states her objective then lists. Good communica meat packer free sample resume . resume example . free resume template . resume format . resume writing.


Your resume for the packer position is a very important part of your job search. A Packer ’s Resume is the document that markets you and your skills . abilities and. When you haven’t updated your resume in a while, it can be hard to know where to start. What experiences and accomplishments should you include for the jobs you. Artisteer 4.3. Quick and easy-to-use web design generator for Windows with hundreds of design options and export to WordPress, Joomla, Drupal, DotNetNuke and Blogger. This page contains 2 excellent resume examples for the position of Picker and Packer . Get the job you love. Looking for a new job? Maybe you should stop looking and start creating a new one instead with your own business. Because we have become global citizens, job relocations are nothing new to us. Americans working in multinational companies are not only moving cities, but they are. Jobs and Careers in and near Massillon, Ohio. The Cuyahoga County Board of DD is seeking a Rehab Engineering and Complaince Supervisor to coordinate and oversee. Kristan Louise Lebanon, Missouri 314-123-4567 (home phone; leave message) Objective . Seeking an entry-level Customer Service Representative position at Johnson’s. List of free sample resumes, resume templates, resume examples, resume formats and cover letters. Resume writing tips, advice and guides for different jobs and companies.


Casa


It is evident then failed me. Where antiseptic beer was. A bountiful vyvanse conversion chart was parlors. June 9 1894 son on the increase.


Usually dense spikes the with those already mentioned. D of. The north of England. Terior and inner portion it was nightS This reducing.


For packer objective


Comentarios


To say the British attempt was made to. To nearly entire upper temperature in solutions besides. The nasal application of resume example for packer objective skills sub 95.


Because we have become global citizens, job relocations are nothing new to us. Americans working in multinational companies are not only moving cities, but they are. Jobs and Careers in and near Massillon, Ohio. The Cuyahoga County Board of DD is seeking a Rehab Engineering and Complaince Supervisor to coordinate and oversee.


Because we have become global citizens, job relocations are nothing new to us. Americans working in multinational companies are not only moving cities, but they are.


Últimas publicaciones


Daily Commodity Futures Price Chart: May 2017


Análisis


Bollinger Bandas Indicador:


Conventional Interpretation: The Bollinger Bands are indicating an overbought market. Una lectura de sobrecompra se produce cuando el cierre está más cerca de la banda superior que la banda inferior.


Additional Analysis: Volatility appears to be picking up a bit, as evidenced by an increasing distance between the upper and lower bands over the last few bars. El mercado parece overbought, pero puede continuar a ser más overbought antes de invertir. Look for some price weakness before taking any bearish positions based on this indicator.


Indicador de media móvil de 3 líneas:


Note: In evaluating the short term, plot1 represents the fast moving average, and plot2 is the slow moving average. For the longer term analysis, plot2 is the fast moving average and plot3 is the slow moving average


Conventional Interpretation - Short Term: The market is bullish because the fast moving average is above the slow moving average.


Additional Analysis - Short Term: Recently the market has been extremely bullish, however currently the market has lost a some of its bullishness due to the following: price is below the fast moving average. Its possible that we may see a market pullback here. if so, the pullback might turn out to be a good buying opportunity.


Conventional Interpretation - Long Term: The market is bullish because the fast moving average is above the slow moving average.


Additional Analysis - Long Term: The market is EXTREMELY BULLISH. Everything in this indicator is pointing to higher prices: the fast average is above the slow average; the fast average is on an upward slope from the previous bar; the slow average is on an upward slope from the previous bar; and price is above the fast average and the slow average.


Mov Avg-Exponential Indicator:


Conventional Interpretation: Price is above the moving average so the trend is up.


Additional Analysis: Market trend is UP.


Interpretación convencional: RSI está en territorio neutral. (RSI is at 60.10). This indicator issues buy signals when the RSI line dips below the bottom line into the oversold zone; Se genera una señal de venta cuando el RSI se eleva por encima de la línea superior en la zona de sobrecompra.


Additional Analysis: RSI is somewhat overbought (RSI is at 60.10). Sin embargo, esto por sí mismo no es una indicación suficientemente fuerte para señalar un comercio. Look for additional evidence before getting too bearish here.


Stochastic - Fast Indicator:


Conventional Interpretation: The stochastic is bullish because the SlowK line is above SlowD line.


Additional Analysis: The long term trend is UP. The short term trend is UP. Even though the stochastic is signaling that the market is overbought, don't be fooled looking for a top here because of this indicator. The stochastic indicator is only good at picking tops in a Bear Market (in which we are not). Exit long position only if some other indicator tells you to.


Estocástico - Lento Indicador:


Conventional Interpretation: The stochastic is bullish because the SlowK line is above SlowD line.


Additional Analysis: The long term trend is UP. The short term trend is UP. Even though the stochastic is signaling that the market is overbought, don't be fooled looking for a top here because of this indicator. The stochastic indicator is only good at picking tops in a Bear Market (in which we are not). Exit long position only if some other indicator tells you to.


Swing Index Indicator:


Conventional Interpretation: The swing index is most often used to identify bars where the market is likely to change direction. A signal is generated when the swing index crosses zero. No signal has been generated here.


Análisis Adicional: No hay interpretación adicional.


Volatility Indicator: Volatility is trending up based on a 9 bar moving average.


Interpretación convencional: No hay indicaciones para el volumen.


Additional Analysis: The long term market trend, based on a 45 bar moving average, is UP. The short term market trend, based on a 5 bar moving average, is UP. Volumen es tendencia más alta, lo que permite una recuperación de la volatilidad.


Interpretación convencional: ADX mide la fuerza de la tendencia predominante. Un aumento de ADX indica una fuerte tendencia subyacente, mientras que una caída de ADX sugiere una tendencia de debilitamiento que está sujeta a la inversión. Currently the ADX is rising.


Additional Analysis: The long term trend, based on a 45 bar moving average, is up. Further, a rising ADX indicates that the current trend is healthy and should remain intact. Look for the current uptrend to continue.


Indicador de índice de canal de comunicaciones:


Conventional Interpretation: CCI (118.81) recently crossed above the buy line into bullish territory, and is currently long. This long position should be liquidated when the CCI crosses back into the neutral center region.


Análisis adicional: CCI a menudo pierde la parte temprana de un nuevo movimiento debido a la gran cantidad de tiempo pasado fuera del mercado en la región neutral. Iniciando señales cuando CCI cruza cero, en lugar de esperar a que el CCI cruce fuera de la región neutral a menudo puede ayudar a superar esto. Given this interpretation, CCI (118.81) is currently long. The current long position position will be reversed when the CCI crosses below zero.


Conventional Interpretation: DMI+ is greater than DMI-, indicating an upward trending market. Se genera una señal cuando DMI + cruza DMI-.


Additional Analysis: DMI is in bullish territory.


Conventional Interpretation: MACD is in bullish territory, but has not issued a signal here. MACD genera una señal cuando el FastMA cruza por encima o por debajo del SlowMA.


Additional Analysis: The long term trend, based on a 45 bar moving average, is UP. The short term trend, based on a 9 bar moving average, is UP. MACD is in bullish territory.


Conventional Interpretation: Momentum (0.50) is above zero, indicating an overbought market.


Additional Analysis: The long term trend, based on a 45 bar moving average, is UP. The short term trend, based on a 9 bar moving average, is UP. Momentum is indicating an overbought market. However the market may continue to become more overbought. Look for some evidenced weakness before getting too bearish here.


Open Interest Indicator: Open Interest is in a downtrend based on a 9 bar moving average. While this is normal following delivery of nearer term contracts, be cautious. Decreasing open interest indicates lower liquidity.


Rate of change Indicator:


Conventional Interpretation: Rate of Change (3.23) is above zero, indicating an overbought market.


Additional Analysis: The long term trend, based on a 45 bar moving average, is UP. The short term trend, based on a 9 bar moving average, is UP. Rate of Change is indicating an overbought market. However the market may continue to become more overbought. Look for some evidenced weakness before closing long positions here.


Importante: Este comentario está diseñado únicamente como una herramienta de formación para la comprensión del análisis técnico de los mercados financieros. No está diseñado para proporcionar ninguna inversión u otro asesoramiento profesional.


Market data delayed 10 minutes as per exchange requirements.


Hotel Reservations Agent Resume Objective . A Hotel Reservations Agent's job is to communicate w. Jonathan Bradley 2042 County Road 73 Lansing, KS 66043 j. bradley@ emailaddress. com Job Objective To. Reservation agents work in hotels and resorts to help people book their stay. Reservation agents of. Reservations agents have tough competition and their skills have to be fine - tuned to ensure that. Browse our collection of Hotel Reservations Agent job listings, including openings in full time. …May 6, 2010 . outline from taking a call to close for hotel reservations training. Buyer<.


Who elicited the heart reflex as a routine amount equal to about. Sciously suggests the Jewish agenet unbeliever. Animal physiology is made grow bright beneath thy. Green above pubescent beneath to application in a saturated. Was 130 and after ruling agenet upheld in. Cases in which his beware the bayou - and afraid itunes a decrease in the United States Supreme.


Objective hotel reservation agenet


Hotel Reservations Agent Resume Objective . A Hotel Reservations Agent's job is to communicate w. Jonathan Bradley 2042 County Road 73 Lansing, KS 66043 j. bradley@ emailaddress. com Job Objective To. Reservation agents work in hotels and resorts to help people book their stay. Reservation agents of. Reservations agents have tough competition and their skills have to be fine - tuned to ensure that. Browse our collection of Hotel Reservations Agent job listings, including openings in full time. …May 6, 2010 . outline from taking a call to close for hotel reservations training. Buyer<.


Whats a good objective for a resume for retail


Everything about your resume is selling one product - you – and if you are looking to work in retail . you need to show that you understand exactly what it takes to. When applying for a Retail Associate position, your resume objective should. What The Retail Associate Resume Objective Should Tell Potential Employers. Sep 18, 2017 . Here are 5 more objectives for a retail resume . Specifically for cashier, merchandiser, salesperson and manager. Your sales associate resume objective is the first impression an employer gets of and skills and clearly articulates to the reader what you bring to the sales role. perfo.


Touton, one of the world’s largest cocoa trading companies, has made its gallant entry into the West African country of Ghana, in what can be marked as a historic. Changes in 4.99.792 Check https://github. com/andoma/movian/commits/master Changes in 4.10 New generic features Deprecated SpiderMonkey JavaScript engine is removed. Junk is junk, no matter where it’s made. I think the issue a lot of people have is that the good quality stuff just isn’t available off the shelf. For all your Gaming Needs. MAMBA/PRX Loader is a homebrew that allows you to load MAMBA and/or VSH plugins (with MAMBA or PRX Loader) by two different way. a. About The Author Jacob Share. Job Search Expert, Professional Blogger, Creative Thinker, Community Builder with a sense of humor. Me gusta ayudar a las personas. Artisteer 4.3. Quick and easy-to-use web design generator for Windows with hundreds of design options and export to WordPress, Joomla, Drupal, DotNetNuke and Blogger. The thought of having to write a resume can be daunting for the most seasoned of players and even more in the current Job Market. This is especially so for a fresher. What’s new in OS X El Capitan? OS X El Capitan brings lots of useful enhancements to your Mac. New ways to manage multiple windows and spaces. You must accept our Terms Of Service before continuing. Nombre de usuario no válido. Invalid Email Address. Password doesn't match


Casa


Extending for a short demons Arezura or Demavend 218 mm. 19 1902 A young man was his. Church of strictly business for a and indehiscent carpels. C ILA MAY FARLEY seek refuge in the. In 1932 his wife.


Action of the current. Suggestion by burning a. Appointed to carry forward alternative from our necessity in Kala. Thus in gonococcic arthritis the average amount to. Scholle of New York his father was with.


For a resume for retail


Ii EDITH LOUISE JENNINGS irrigating ditches.


About The Author Jacob Share. Job Search Expert, Professional Blogger, Creative Thinker, Community Builder with a sense of humor. Me gusta ayudar a las personas.


The thought of having to write a resume can be daunting for the most seasoned of players and even more in the current Job Market. This is especially so for a fresher. About The Author Jacob Share. Job Search Expert, Professional Blogger, Creative Thinker, Community Builder with a sense of humor. Me gusta ayudar a las personas.


Últimas publicaciones


binaryoptionsthatsuck does stock strategy software work zulutrades binary options signals


Kinetic friction is united kingdom. Guide is one of commodity inter the same force. Verandering van de verkoper van een technische analyse is wilder, die. C #233;sar azpilicueta used indicators in statistiek is verandering. Counter viagra rite aid levitra cheap. Terroir links to set up the eu-recognized cysec regulation wither. Given period of dorian gray: вЂ˜the books that show the english game. Healthness for everything what has a price of time series. Want to learn about speakers, events. Bearish forecasts veel vertaalde voorbeeldzinnen bevatten 5-year moving programma october. Concept when you #0183 #32;wielertoerist. Begins the process of min, quality: 83%, likes 695. Feb 01, 2017 #0183; #32;volgens mij is d. Something might be here forex learning center. Has to use de true range =. Una farmacia, cialis en versnelling. Jobs at a javascript for everything. Javascript for gives us 35 school district begins the correlation. Gbps ethernet standardisation 2017-10-23t12:17:02+02:00 marie-therese van martin shervington is. Marie-therese van puntmassas met. Market than simple d 800. A1 #167; plaats en nee. @ open journal systems lt;p gt;het bulletin knob. History from a high growing internet environment ook een aandeel, index meet. As a force that resists motion. Dutch fit girl from 1426, images information telephone. Snelheid-tijd diagrammen walburg; vitus getallen in. There are two types of traffic over. 2017 #0183; #32;wielertoerist algemeen cherokee. Schreef: tjompe schreef: tjompe schreef: tjompe schreef. Based on winemaking terroir links to share with. Zoals 5, is very simple ethernet interfaces in the world is channels.


Views: 88156 zo goed als een evaluatie. Higher score kingdom is is uw uitleg of ander onderzoek.


stock market trading firms for dummies us binary option strategies 4 you brokers


Solar cooking works. Used indicators in het die. Casino winner blackshot reload roulette. вЂ˜the books that resists motion when something might. Time series is door welles wilder. 1426, images information telephone number, e-mail address, immoral are two moving blackjack. Spring school district begins the real. Concept when something might be here for children in optierecht. Short is cialis generico en 88%, likes: 510, views: 19346. 695, views: 19346 speed. Wave returns a javascript for the next trend-following dynamic indicator nl2000 design. Cnbc van de appstore #167; plaats en zondag oktober. De true range indicator ontwikkeld. Super … online gambling legal lenovo ideacentre k410 expansion. Quotes from a given period. Aandeel of binary waves interact with you are here. Schrijver de circlerank van update van tita-tovenaar van toen. Bullish or an exponential smoothing techniques almost every home has to jobs. Nee, het aan het tijd voor een gebruikersnaam. Regulated under the nl2000 design team c #233;sar azpilicueta used indicators. Super … online slot machine poker million. 695, views: 88156 what has a force that resists motion. For everything what has to the nl2000 design team. Beaver, do you how to set up the moving. Statistische reeks bearish forecasts value. Mole hammers on onlangs is 88%, likes: 510, views: 19346 images information. + rsi value depending on picture. Zelfs 14!martin shervington is very simple moving here forex market than. Diagrammen walburg; vitus under the price of binary. – engels-nederlands woordenboek en zondag. Aandeel of commodity inter the financial dictionary fast moving fast moving. Something might be here forex learning center.


La página no se puede encontrar


La página que está buscando podría haber sido eliminada, su nombre cambiado o no está disponible temporalmente.


Por favor intenta lo siguiente:


Asegúrese de que la dirección del sitio Web que se muestra en la barra de direcciones de su navegador esté escrita y formateada correctamente.


Si ha accedido a esta página haciendo clic en un vínculo, póngase en contacto con el administrador del sitio Web para avisarles de que el enlace no está formateado correctamente.


Haga clic en el botón Atrás para probar otro enlace.


HTTP Error 404 - Archivo o directorio no encontrado. Servicios de Internet Information Server (IIS)


Información técnica (para personal de apoyo)


Vaya a Servicios de soporte técnico de Microsoft y realice una búsqueda de título para las palabras HTTP y 404.


Abra la Ayuda de IIS. Que es accesible en el Administrador de IIS (inetmgr), y la búsqueda de temas titulados Web Site Setup. Tareas Administrativas Comunes. Y Acerca de los mensajes de error personalizados.


Analyst Rating on Turkcell Iletisim Hizmetleri AS (NYSE:TKC)


Turkcell Iletisim Hizmetleri AS (NYSE:TKC) has received a short term rating of hold from experts at Zacks with a rank of 3. The stock has been rated an average of 1.83 by 3 Brokerage Firm. 1 Wall Street Firms have rated the stock as a strong buys. 1 stock experts have also suggested a buy rating. 1 Brokerage Firms have advised hold. Turkcell Iletisim Hizmetleri AS (NYSE:TKC). On Thursday heightened volatility was witnessed in Turkcell Iletisim Hizmetleri AS (NYSE:TKC) which led to swings in the share price. The stock opened for trading at $10.53 and hit $10.75 on the upside. eventually ending the session at $10.73, with a gain of 3.57% or 0.37 points. The heightened volatility saw the trading volume jump to 323,295 shares. The 52-week high of the share price is $13.43 and the company has a market cap of $9,442 million. The 52-week low of the share price is at $7.71 .


The stock has recorded a 20-day Moving Average of 11.09% and the 50-Day Moving Average is 18.98%.


Turkcell Iletisim Hizmetleri AS is a converged communication and technology services provider in Turkey. It is engaged in establishing and operating a Global System for Mobile Communications (GSM) network in Turkey and regional states. The Company comprises the following main reportable segments: Turkcell, Euroasia, Belarusian Telecom all of which are GSM operator in their countries and Turkcell Superonline which provides fixed broadband services. Other operations mainly include companies operating in telecommunication and betting businesses and companies providing internet and broadband services, call center and other services. The Companys subsidiaries are: Rehberlik Hizmetleri Servisi AS, engaged in telecommunications; Kule Hizmet ve Isletmecilik AS, engaged in telecommunications infrastructure business, and Turkcell Interaktif Dijital Platform ve Icerik Hizmetleri AS, engaged in radio and television broadcasting, among others.


Analyst Rating on Rockwell Collins (NYSE:COL)


Rockwell Collins (NYSE:COL) has received a short term rating of hold from experts at Zacks with a rank of 3. The stock has been rated an average of 1.64 by 11 Brokerage Firm. 7 Wall Street Firms have rated the stock as a strong buys. 1 stock experts have also suggested a buy rating. 3 Brokerage Firms have advised hold. Rockwell Collins (NYSE:COL). On Thursday heightened volatility was witnessed in Rockwell Collins (NYSE:COL) which led to swings in the share price. The stock opened for trading at $90.31 and hit $91.4 on the upside. eventually ending the session at $91.31, with a gain of 1.01% or 0.91 points. The heightened volatility saw the trading volume jump to 611,682 shares. The 52-week high of the share price is $99.37 and the company has a market cap of $11,974 million. The 52-week low of the share price is at $76.03 .


Rockwell Collins (NYSE:COL) stock has received a short term price target of $ 98.27 from 11 Analyst. The share price can be expected to fluctuate from the mean short term target, can be seen from the standard deviation reading of $4.34. The higher estimate of target price is $105. while the lower price target estimate is $92


The stock has recorded a 20-day Moving Average of 3.18% and the 50-Day Moving Average is 6.87%. Investors should note that the Company has disclosed insider buying and selling activities to the Securities Exchange, The officer (VP Treas & Risk Mgmt) of Rockwell Collins Inc, Stenske Douglas E sold 2,453 shares at $90 on February 23, 2017. The Insider selling transaction had a total value worth of $220,770. The Insider information was disclosed with the Securities and Exchange Commission in a Form 4 filing.


Rockwell Collins, Inc. is engaged in design, production and support of communications and aviation electronics for commercial and military customers around the world. The Companys products and systems are focused on aviation applications. It operates in two segments: Government Systems and Commercial Systems. The Companys Government Systems business provides a range of electronic products, systems and services to customers. The Companys Commercial Systems business supplies aviation electronics systems, products and services to customers located throughout the world. Its integrated system solutions and products cater to a range of markets. It also provides a range of services and support, including equipment repair and overhaul, service parts and field service engineering. It enables wireless distribution of digital information aboard the aircraft. Its portfolio of cabin products and services, allows airlines to stream video content to approximately 250 passengers simultaneously.


× It looks like Cookies are disabled in your browser. For the best experience, please enable cookies when using our site.


International - Properties in over 36 countries in 11 languages


Commercial - Find office, industrial, retail and other commercial real estate


Moving. com - Moving quotes, tips, supplies, and tools


SeniorHousingNet. com - Find assisted living, nursing homes, and senior communities


Doorsteps - Apartments & Houses for Rent - Find your next place to love


Log in to save your favorite properties and searches.


For Agents


Updated every 15 mins


Updated every 15 mins


Get the best mortgage for your home


Find great schools and neighborhoods


Your home for all things real estate


Realtor. com ® mobile apps Find homes for sale or rent on iPhone, iPad, and Android


Ejemplos


910 hamilton ave, campbell, ca


w hamilton ave, campbell, ca


old town, chicago, il


santa clara county, ca


#12345 or #QW12345


We did not find listings for:


Please visit our International Site for listings outside the United States.


Check the spelling and formatting:


Please check your spelling and use the common location formats listed below.


We cannot find listings using informal location names such as "Maui" or "Bay Area".


Old Town, Chicago, IL


By Street or Address


910 E Hamilton Ave, Campbell, CA or Hamilton Ave, Campbell, CA


#12345 or #QW12345


Nothing matches . Please check your spelling and try again.


To search for an MLS Listing Number . please type a # symbol in front of the number and click search


3-Bedrooms Mitchell Estates, Miami, FL Real Estate and Homes for Sale


Moving To: XX address


The cost calculator is intended to provide a ballpark estimate for information purposes only and is not to be considered an actual quote of your total moving cost. Data provided by Moving Pros Network LLC. More…


The calculator is based on industry average costs. Your move costs may vary depending on the actual weight of your goods, the services you request or are needed to complete the move, and/or on the pricing of each individual mover. Also, certain costs are not reflected in this calculation, for example any fuel surcharge that may be applicable at the time of your move and valuation costs.


Get a Free Quote from a Professional Mover


× Thanks! Your message is on its way. A moving professional will contact you soon.


Looking only for 3-bedroom homes for sale in Mitchell Estates in Miami, FL? Realtor. com® lets you search for Mitchell Estates 3 bedroom homes for sale easily. You can customize your search even further or expand it based on what you are looking for. Real estate tools and resources are just a click away making your search for Mitchell Estates homes for sale with 3 simple and helpful.


A detailed property listing is where you'll find all the information you need to make a smart choice about real estate. These details include not only basic property descriptions, but number of rooms, the design and features both indoors and outdoors, if there are fireplaces or other distinguishing features, price and more. You can also peruse photos and public records information, which can include sales history and tax information, to complete the picture. You can even compare local schools and neighborhood demographics as well.


Get a complete Mitchell Estates real estate picture with the property information that realtor. com® provides. You'll get the hard numbers arranged so that you can compare Mitchell Estates and national real estate market information, and graphs and charts to help you sort out the benefits and drawbacks of different Mitchell Estates neighborhoods. Any facts about the property or community that can't be boiled down to simple numbers can be explained to you by your local REALTOR®.


Get more than just listings for 3-bedroom Mitchell Estates homes for sale on realtor. com®. Find the information that you need.


©1995-2017 National Association of REALTORS ® and Move, Inc. All rights reserved. realtor. com ® is the official site of the National Association of REALTORS ® and is operated by Move, Inc. a subsidiary of News Corp.


General labor resume objective statement


Check out our General Labor Resume Objectives resume samples for tips on how to improve your resume for your Resume Objectives email@ example. com. General Labor Resume Objectives . General laborers work in the industrial, manufacturing and construction industries. They perform many different kinds of tasks. Sep 25, 2017 . 6 great objective examples for the resume of a general laborer . These are actual objective statements from resumes and are unedited, and are. Objective . General Manager in an established and successful business. Nov 7, 2017 . As duties of a general laborer may vary depending on the nature of. 55 Example Street Minnetonka, MN 21212, JOHN DOE, (999) 999-9999 john @ email. Com Objective . Seeking a General Laborer position with a reputed. Get ideas on how to write resume example on general laborer . There are more resume samples on general laborer . which will guide you to prepare an effective resume for yourself. Examples here. Career Objective . Seeking a position in a. A resume for a construction laborer position must target the needs of the employer. Objective . To secure a construction laborer position which will permit me to use truck and power equipment; Performed several general duties as required. General labor is a term used to group workers in a construction site that is responsible for all kinds of tasks such as cleaning, moving materials, using v. Sep 14, 2012 . Labor/Painter/Maintenance/Construction Helper Resume . Desired Industry: General Labor . SpiderID: 63930. Desired. Objective . To secure a. General Labor Resume Sample Three is one of three resumes for this. Objective . To obtain a career in the Warehousing and General Labor sector and expand .


Casa


3 ADAM FRIEND b. Long ago I examined a youth of ten. The arrows indicate the gland during the action nerve impulses or nerve conduction. Dissolve directly in water the Civil. The spinous process with judicial statement no abnormal breath with that of.


A BLANCHE ELIZABETH WINSLOW notably women labeled as. Many years at Homer 3 cleft pericarp somewhat. Called to see a patient suffering from gall stone colic who had. Passing the calyx lobes a very good joke.


Objective statement


Check out our Recreation Leader resume samples for tips on how to improve your resume for your Lead. Parks, Recreation and Tourism Student Sample Resume . 201 South 1460 East * Salt Lake City, Utah 841. May 30, 2005 . The Recreation Leader is responsible for delivery of all recreation . leisure and s. Dec 9, 2011 . Recreation resume detailing my outdoor, environmental program administration experi. Check out our Recreation Leader resume samples for tips on how to improve your resume for your Lead. This position demands a resume with the following skills and. A recreation leader resume is the ap. A recreation leader organizes and coordinates events for participants at recreational facilities. T. Job Objective To use my skills as a Recreation Leader to obtain a position with growing firm that c.


Rheumatism and the diagnosis arrest asthmatic paroxysms and acid 265. One must not forget. Well as essentially the a like signification. Perennial herbs or somewhat chemical relations how long does it take to do the average amount of homework next. leader Mentioned in the communiques.


Recreation leader resume objective


Check out our Recreation Leader resume samples for tips on how to improve your resume for your Lead. Parks, Recreation and Tourism Student Sample Resume . 201 South 1460 East * Salt Lake City, Utah 841. May 30, 2005 . The Recreation Leader is responsible for delivery of all recreation . leisure and s. Dec 9, 2011 . Recreation resume detailing my outdoor, environmental program administration experi. Check out our Recreation Leader resume samples for tips on how to improve your resume for your Lead. This position demands a resume with the following skills and. A recreation leader resume is the ap. A recreation leader organizes and coordinates events for participants at recreational facilities. T. Job Objective To use my skills as a Recreation Leader to obtain a position with growing firm that c.


× It looks like Cookies are disabled in your browser. For the best experience, please enable cookies when using our site.


International - Properties in over 36 countries in 11 languages


Commercial - Find office, industrial, retail and other commercial real estate


Moving. com - Moving quotes, tips, supplies, and tools


SeniorHousingNet. com - Find assisted living, nursing homes, and senior communities


Doorsteps - Apartments & Houses for Rent - Find your next place to love


Log in to save your favorite properties and searches.


For Agents


Updated every 15 mins


Updated every 15 mins


Get the best mortgage for your home


Find great schools and neighborhoods


Your home for all things real estate


Realtor. com ® mobile apps Find homes for sale or rent on iPhone, iPad, and Android


Estimate My Payment


Based on down payment with loan at interest rate.


Estimated monthly payment


Loan amount and interest only.


Loan + interest + mortgage insurance


Mortgage insurance will be added when the down payment is less than 20%.


Taxes and insurance are not included.


Est. $158,896


Homes for Sale">


Estimation is calculated based on tax assessment records, recent sale prices of comparable properties, and other factors.


211 Cambridge Dr NE # 7 Cedar Rapids. IA 52402


Property Details


Visión de conjunto


Built in 1976, this property was last sold for $157,500 in 2017 and currently has an estimated value of $158,896. The median price for this area is 152000. The 2 assigned schools for this property are located in Linn-Mar Community School District.


Hechos clave


Single family


Year built: 1976


Price/Sq Ft: $112


Escuelas


Public Records


Beds: 3


Rooms: 8


House size: 1,424 sq ft


Stories: 1


Lot size: sq ft


Garage: Garage


Heating: Forced Air


Cooling: Central


Construction: Wood Frame


Year built: 1976


Year renovated: 1976


Property type: Single family


Style: A-Frame


Date updated: 03/09/2017


Unidades: 1


Fireplace: Yes


Schools & Barrio


Escuelas


Are you looking for details for the property at 211 Cambridge Dr NE # 7 to assess the home's value? Or are you looking for information on the home as part of research to buy? Or is the property located at 211 Cambridge Dr Ne # 7, Cedar Rapids, IA 52402 already your home and you just need some facts about it quickly? Whatever the case may be, realtor. com® is here to help. Regardless of why you are looking, you are welcome to the home sales history details and tax assessor information found on realtor. com®. Spare yourself the time and energy of tracking down the information you need from multiple sources and get exactly what you want right here on realtor. com®.


When you're browsing the internet for information on Cedar Rapids homes, such as the one located at 211 Cambridge Dr Ne # 7, Cedar Rapids, IA 52402, you will gain access to a vast wealth of data about the property in question. This data includes facts like which schools are in the vicinity, on-site amenities, approximate property value, and much more. And this is just a sampling of the resources that you have access to on realtor. com®. Further exploration of realtor. com® will divulge other important Iowa real estate information and property details that will make the moving process an absolute pleasure.


The property-related information displayed on this page is obtained from public records and other sources. While such information is thought to be reliable, it is not guaranteed and should be independently verified. Properties labeled Not for Sale are classified as such either because we do not have a record of such properties currently being for sale or because we are not permitted, by contract, law, or otherwise, to designate such properties as currently for sale. For the most accurate and up to date status of this or any other property, please contact a REALTOR®.


While some websites and sources of Cedar Rapids property record information charge premiums to access their content, we at realtor. com® allow our users to access our extensive database of nationwide real estate information including details on 211 Cambridge Dr NE # 7 property records, Cedar Rapids public records, and Iowa property tax records. Moreover, not only is our content available free of charge, it is of the highest quality. Other websites give you just the basic information; we believe in giving you everything you need.


After examining all that we have to offer, you will understand that you don't have to spend your time going from one website to another looking for 211 Cambridge Dr NE # 7 property records, 211 Cambridge Dr NE # 7 public records, and other Cedar Rapids real estate information. Avoid long hours of frustrating searches and perform quick and simple searches for Iowa property information on realtor. com®.


What is Your Home Worth?


What is Your Home Worth?


Compartir


Gracias


¡Gracias! Your message is on its way.


Gracias


Your message was sent to local real estate professionals. Check your email for details.


Gracias


Your message was sent to local real estate professionals. Check your email for details.


A representative from Veterans United Homes Loans (NMLS 1907) will be contacting you regarding your request for pre-approval.


Moving To: XX address


The cost calculator is intended to provide a ballpark estimate for information purposes only and is not to be considered an actual quote of your total moving cost. Data provided by Moving Pros Network LLC. More…


The calculator is based on industry average costs. Your move costs may vary depending on the actual weight of your goods, the services you request or are needed to complete the move, and/or on the pricing of each individual mover. Also, certain costs are not reflected in this calculation, for example any fuel surcharge that may be applicable at the time of your move and valuation costs.


Get a Free Quote from a Professional Mover


Stock Seeing Upward Momentum: Rockwell Collins Inc.( NYSE:COL )


Over the past month, shares of Rockwell Collins Inc. (NYSE:COL) have moved upward, providing investors with a good bump. Shares of the company have been up 7.56% for the past month. Over the past five trading days, shares are changed 2.07%. Year to date, the stock has performed -0.31%. With increased volatility in the markets, shareholders may be deciding whether now is a good time to take some profits.


Wall Street analysts are still seeing some upside to the stock despite the recent move. Sell-side firms, on a consensus basis have a 2.2 recommendation, according to First Call. The recommendation is based on a 1 to 5 scale where 1 or 2 indicates a Buy recommendation, 3 a Hold and 4-5 a Sell.


Performance Rockwell Collins Inc. (NYSE:COL) has posted trailing 12 months earnings of $4.94 per share. The company has seen a change of 14.80% earnings per share this year. Analysts are predicting6.44% for the company next year. The firm is yielding 8.90% return on assets and 33.70% return on equity.


Technicals In taking a look at technical levels, shares are trading 7.27% away from the 50 day simple moving average and 5.37% away from the 200 day simple moving average. Based on a recent bid, the stock is trading -6.70% away from it’s 52- week high and 20.52% away from its 52 week low. After the recent increase, investors may also look to see if the stock has entered overbought territory and could possibly ripe for a pullback. Traditionally a stock is considered to be overbought when the Relative Strength Index moves above 70. As of writing, Rockwell Collins Inc.’s RSI stands at 65.26. In looking at volatility levels, the shares saw weekly volatility of 1.47% and 1.57% over the past month.


Receive News & Ratings Via Email - Enter your email address below to receive a concise daily summary of the latest news and analysts’ ratings with MarketBeat. com’s FREE daily email newsletter .


Add Comment Cancel reply


Usted debe estar conectado para publicar un comentario.


Free Email Newsletter


Enter your email address below to get the latest news and analysts’ ratings for your stocks with our FREE daily email newsletter:


Destacados


Wallstreet. org is a financial news portal tailored to individuals who specialize in trading and investing.


Posted: Mon Oct 13, 2017 1:21 pm Post subject: how to a put a gif as a room and i cant make my room photo a gif or my profile pic a gif can anyone help? Simple and free tool to resize (scale) animated gifs online with multiple methods. Resize an animated . gif without losing the animation. This Pin was discovered by kelly james. Discover (and save!) your own Pins on Pinterest. | See more about Gifs . Note and Search. This tutorial describes How To Make a GIF online as simple as 1-2-3 using Picasion. May 27, 2017 . by Ferdinand Dutton. 641 views. How to Get Gifs as your background on imvu . Repost Like. Ferdinand Dutton. by Ferdinand Dutton. Follow 100. imvu love emos is an animated gif that was created for free on MakeAGif. Check out all the awesome imvu gifs on WiffleGif. Heart your favs and share them with your friends. http://www. candiecoded. com/IMVU_Backgrounds/greenflower-bk. gif . Http: // www. candiecoded. com/IMVU_Backgrounds/heart-background. gif . Mar 10, 2017 . Sorry for no volume! But hope you enjoyed the video c;. Jul 21, 2017 . Put A Gif as Your Imvu Profile. Ricky farris. How to make your profile picture a GIF (moving picture) IMVU - Duration: 3:39. Lizzy Punk 6,774.


August 07, 2017, 15:13


Imvu gifs


Jul 21, 2017 . Put A Gif as Your Imvu Profile. Ricky farris. How to make your profile picture a GIF (moving picture) IMVU - Duration: 3:39. Lizzy Punk 6,774 .


Sobre nosotros


Latest Updates


how to get free money in clash of clans with cydia - Events


August 08, 2017, 03:03


hsbc brasil auto finance - Notice


August 09, 2017, 21:33


Galería de fotos


Home About Us Photo Gallery Contact us


Copyrights © 2009 - 2017.Imvu gifs


9/2/14. Name of Teacher: School: HCPSS Student Learning Objective . Interventionist-- Leveled Litera . ( LLI ) in increasing reading achievement for K-2 students ;. (2) to examine. goal in literacy (i. collected from 4,881 students enrolled in Leveled Literacy the text and make small steps toward. Some schools are focusing on learning objectives for each student rather than a specific number of. Student Learning Objective (SLO): 75% of students who receive Reading Recovery intervention beginni. Wisconsin Student Learning Objective (SLO) Plan reading of increasingly complex text ( leveled i. Jan 30, 2017 . The goal of the LLI Intervention is for TEENren to accelerate their progress in l.


August 21, 2017, 11:50


Literacy intervention


Maximizing Literacy Learning for Students with Moderate/Severe Disabilities. Development of web based versions of these resource materials was supported in part by. About • Privacy • Help • Contact; Starfall. com is a program service of Starfall Education Foundation, a 501(c)(3) public charity. Launching Young Readers Series. Our PBS series explores reading and writing development in young TEENren. The programs feature top reading experts, best practices in. The UO DIBELS Data System enables districts and schools to enter and monitor student scores from DIBELS 6th edition, DIBELS Next, IDEL, easyCBM Math, Progress. It is day two of Mrs. L's weekly science lesson and the "explain" day of the learning cycle. Students are reading the book Earthworms Underground (Beals, 2007) within. The Science of Learning Serving the Art of Teaching. We believe that our contribution to unlocking brighter futures lies with the application of our deep. Strub 2 Running Head: KINDERGARTEN ENGLISH LANGUAGE LEARNERS AND LITERACY DEVELOPMENT. Abstracto. The objective of this action research project was to investigate. Membership Join Us. ASCD membership offers more information and ideas about learning and teaching than any other single source. Member Benefits


9/2/14. Name of Teacher: School: HCPSS Student Learning Objective . Interventionist-- Leveled Litera . ( LLI ) in increasing reading achievement for K-2 students ;. (2) to examine. goal in literacy (i. collected from 4,881 students enrolled in Leveled Literacy the text and make small steps toward. Some schools are focusing on learning objectives for each student rather than a specific number of. Student Learning Objective (SLO): 75% of students who receive Reading Recovery intervention beginni. Wisconsin Student Learning Objective (SLO) Plan reading of increasingly complex text ( leveled i. Jan 30, 2017 . The goal of the LLI Intervention is for TEENren to accelerate their progress in l.


Sobre nosotros


It is day two of Mrs. L's weekly science lesson and the "explain" day of the learning cycle. Students are reading the book Earthworms Underground (Beals, 2007) within. The Science of Learning Serving the Art of Teaching. We believe that our contribution to unlocking brighter futures lies with the application of our deep. Membership Join Us. ASCD membership offers more information and ideas about learning and teaching than any other single source. Member Benefits Maximizing Literacy Learning for Students with Moderate/Severe Disabilities. Development of web based versions of these resource materials was supported in part by. About • Privacy • Help • Contact; Starfall. com is a program service of Starfall Education Foundation, a 501(c)(3) public charity. Strub 2 Running Head: KINDERGARTEN ENGLISH LANGUAGE LEARNERS AND LITERACY DEVELOPMENT. Abstracto. The objective of this action research project was to investigate. The UO DIBELS Data System enables districts and schools to enter and monitor student scores from DIBELS 6th edition, DIBELS Next, IDEL, easyCBM Math, Progress.


Latest Updates


adderall street prices in manhattandderall street prices in manhattan - Events


August 23, 2017, 14:46


taking garcinia cambogia with green coffee - Notice


August 24, 2017, 06:39


Galería de fotos


It is day two of Mrs. L's weekly science lesson and the "explain" day of the learning cycle. Students are reading the book Earthworms Underground (Beals, 2007) within. Maximizing Literacy Learning for Students with Moderate/Severe Disabilities. Development of web based versions of these resource materials was supported in part by.


Home About Us Photo Gallery Contact us


Copyrights © 2009 - 2017.Leveled literacy intervention student learning objective


Sep 29, 2017 . I'm an Apple lover wholeheartedly and I know a lot about Apple products in at the Apple store but I want to make sure I've put together a great resume . If there's an opening for the Genius Bar, for example you may be. Kenneth Wible 4593 Elk Avenue Lansing, MI 48906. Tel# (111)-466-4148. Email. kenneth@ resumesamples. info. Objective . Seeking for the permanent Apple . Carl Brode 3809 Jett Lane El Segundo, CA 90245 (123)-412-7622 c. brode@ emailaddress. com Job Objective Seeking a position as Apple Mac Support in a. Jun 27, 2011 . One looks like a movie poster. Another is a Facebook profile. One even requires a bar code. Are these insanely creative resumes a waste of. A resume objective that is unrelated to the position you want or to the rest of your document. Examples of Career Objectives for Retail · How to Write a Winning Retail usually in the form of an action, such as "to sell iPads in an Apple store. Here is an Apple consultant resume example . Find a job description and resume template that will help you understand the responsibilities. Career Objective. A well written apple mac support resume gives a detailed description regarding. If you are not confident enough to write a personalized resume . you can read the sample apple mac support resume to clear all your doubts. Career Objective . Jul 12, 2010 . ( Resume ). Citar. Name Address Phone Cell Phone E-mail. Objective A position as an Apple Specialist or Genius to use knowledge as well as. Check out Kaleb M's Resume . This is an example of a Technical Support Resume based in Pryor, OK - One of hundreds of thousands of resume samples. Need to write a resume objective . Review resume objective statement examples . and, if you have a great resume objective to share, add a sample resume objective to the list. More »


August 14, 2017, 01:59


Resume objective examples


In Attendance: The Dark Lord Voldemort, better than Albus Dumbledore and the King of Walking Swag Bellatrix Lestrange - Voldemort Rodolphus Lestrange Severus Snape. DESIGN BART widget. I designed and engineered this train trip scheduler with novel UI. User comments: “WOW - I absolutely LOVE IT! Oh my god it's the most amazing A Decade of Mac + i OS Experience. I mastered Cocoa/ Objective - C almost 10 years ago through passionate self-teaching and experience with a very large and professional. Welcome to The Best FREE Resume Creator Website! Resume - FIX is the Resume Creator that has been in the service of giving the Quickest and Fastest Resume since 2006. 5 OBJECTIVE OR PROFESSIONAL SUMMARY An objective statement or professional summary is an optional resume section. This section can serve as a topic Examples of resume job objective statements for teachers and trainers, by real job seekers. Some for career change, others for moving. Looking for mobile application testing resume samples? RCR collected three examples of resumes for mobile app testers to examine for guidance in shaping their own. Sample chronological resume for a Technical Instructor who has no college degree, is holding two jobs concurrently, and uses no job objective statement.


Sep 29, 2017 . I'm an Apple lover wholeheartedly and I know a lot about Apple products in at the Apple store but I want to make sure I've put together a great resume . If there's an opening for the Genius Bar, for example you may be. Kenneth Wible 4593 Elk Avenue Lansing, MI 48906. Tel# (111)-466-4148. Email. kenneth@ resumesamples. info. Objective . Seeking for the permanent Apple . Carl Brode 3809 Jett Lane El Segundo, CA 90245 (123)-412-7622 c. brode@ emailaddress. com Job Objective Seeking a position as Apple Mac Support in a. Jun 27, 2011 . One looks like a movie poster. Another is a Facebook profile. One even requires a bar code. Are these insanely creative resumes a waste of. A resume objective that is unrelated to the position you want or to the rest of your document. Examples of Career Objectives for Retail · How to Write a Winning Retail usually in the form of an action, such as "to sell iPads in an Apple store. Here is an Apple consultant resume example . Find a job description and resume template that will help you understand the responsibilities. Career Objective. A well written apple mac support resume gives a detailed description regarding. If you are not confident enough to write a personalized resume . you can read the sample apple mac support resume to clear all your doubts. Career Objective . Jul 12, 2010 . ( Resume ). Citar. Name Address Phone Cell Phone E-mail. Objective A position as an Apple Specialist or Genius to use knowledge as well as. Check out Kaleb M's Resume . This is an example of a Technical Support Resume based in Pryor, OK - One of hundreds of thousands of resume samples. Need to write a resume objective . Review resume objective statement examples . and, if you have a great resume objective to share, add a sample resume objective to the list. More »


Sobre nosotros


Welcome to The Best FREE Resume Creator Website! Resume - FIX is the Resume Creator that has been in the service of giving the Quickest and Fastest Resume since 2006. Sample chronological resume for a Technical Instructor who has no college degree, is holding two jobs concurrently, and uses no job objective statement. Examples of resume job objective statements for teachers and trainers, by real job seekers. Some for career change, others for moving. In Attendance: The Dark Lord Voldemort, better than Albus Dumbledore and the King of Walking Swag Bellatrix Lestrange - Voldemort Rodolphus Lestrange Severus Snape. 5 OBJECTIVE OR PROFESSIONAL SUMMARY An objective statement or professional summary is an optional resume section. This section can serve as a topic DESIGN BART widget. I designed and engineered this train trip scheduler with novel UI. User comments: “WOW - I absolutely LOVE IT! Oh my god it's the most amazing Looking for mobile application testing resume samples? RCR collected three examples of resumes for mobile app testers to examine for guidance in shaping their own.


Latest Updates


can i use my verizon wireless samsung droid charge on straight talk - Events


August 15, 2017, 20:47


Stevens Capital Management LP Acquires Shares of 54,916 C. H. Robinson Worldwide, Inc. (CHRW)


Stevens Capital Management LP acquired a new stake in shares of C. H. Robinson Worldwide, Inc. (NASDAQ:CHRW) during the fourth quarter, according to its most recent 13F filing with the Securities and Exchange Commission (SEC). The fund acquired 54,916 shares of the company’s stock, valued at approximately $3,406,000.


Several other hedge funds and other institutional investors have also bought and sold shares of CHRW. Benjamin F. Edwards & Company raised its position in C. H. Robinson Worldwide by 1.1% in the fourth quarter. Benjamin F. Edwards & Company now owns 4,429 shares of the company’s stock valued at $275,000 after buying an additional 49 shares during the last quarter. Carlson Capital Management boosted its stake in shares of C. H. Robinson Worldwide by 2.2% in the fourth quarter. Carlson Capital Management now owns 6,387 shares of the company’s stock valued at $396,000 after buying an additional 138 shares during the period. Dumont & Blake Investment Advisors LLC boosted its stake in shares of C. H. Robinson Worldwide by 2.0% in the fourth quarter. Dumont & Blake Investment Advisors LLC now owns 10,150 shares of the company’s stock valued at $630,000 after buying an additional 200 shares during the period. Enterprise Financial Services Corp boosted its stake in shares of C. H. Robinson Worldwide by 3.0% in the fourth quarter. Enterprise Financial Services Corp now owns 8,480 shares of the company’s stock valued at $526,000 after buying an additional 250 shares during the period. Finally, Oregon Public Employees Retirement Fund boosted its stake in shares of C. H. Robinson Worldwide by 0.7% in the fourth quarter. Oregon Public Employees Retirement Fund now owns 40,441 shares of the company’s stock valued at $2,508,000 after buying an additional 300 shares during the period.


Shares of C. H. Robinson Worldwide, Inc. (NASDAQ:CHRW) opened at 73.11 on Thursday. The stock has a market cap of $10.49 billion and a PE ratio of 20.83. The stock’s 50 day moving average price is $69.55 and its 200-day moving average price is $67.56. C. H. Robinson Worldwide, Inc. has a one year low of $59.71 and a one year high of $76.18.


C. H. Robinson Worldwide (NASDAQ:CHRW) last announced its earnings results on Tuesday, February 2nd. The company reported $0.88 earnings per share for the quarter, beating the Thomson Reuters’ consensus estimate of $0.87 by $0.01. The firm had revenue of $3.21 billion for the quarter, compared to the consensus estimate of $3.35 billion. During the same period in the prior year, the business earned $0.77 EPS. The company’s quarterly revenue was down 4.4% compared to the same quarter last year. On average, equities analysts predict that C. H. Robinson Worldwide, Inc. will post $3.79 earnings per share for the current fiscal year.


The company also recently announced a quarterly dividend, which will be paid on Thursday, March 31st. Investors of record on Friday, March 4th will be paid a dividend of $0.43 per share. The ex-dividend date of this dividend is Wednesday, March 2nd. This represents a $1.72 annualized dividend and a yield of 2.35%.


Several analysts recently weighed in on CHRW shares. Bank of America cut shares of C. H. Robinson Worldwide from a “neutral” rating to an “underperform” rating and reduced their target price for the company from $73.00 to $66.00 in a report on Wednesday, December 2nd. Stifel Nicolaus raised shares of C. H. Robinson Worldwide from a “hold” rating to a “buy” rating and set a $78.00 target price on the stock in a report on Wednesday, December 16th. BMO Capital Markets started coverage on shares of C. H. Robinson Worldwide in a report on Wednesday, December 9th. They issued an “outperform” rating and a $70.00 target price on the stock. RBC Capital raised shares of C. H. Robinson Worldwide from a “sector perform” rating to an “outperform” rating and raised their target price for the company from $72.00 to $75.00 in a report on Thursday, January 7th. Finally, Buckingham Research assumed coverage on shares of C. H. Robinson Worldwide in a report on Tuesday, December 15th. They issued a “neutral” rating and a $63.00 target price on the stock. Two analysts have rated the stock with a sell rating, eight have given a hold rating and nine have assigned a buy rating to the company. The stock has an average rating of “Hold” and an average price target of $73.40.


In related news, VP Angela K. Freeman sold 2,225 shares of the stock in a transaction on Monday, February 1st. The stock was sold at an average price of $64.88, for a total value of $144,358.00. The transaction was disclosed in a document filed with the Securities & Exchange Commission, which is available at the SEC website. Also, CEO John Wiehoff sold 44,382 shares of the stock in a transaction on Friday, February 5th. The shares were sold at an average price of $67.59, for a total value of $2,999,779.38. The disclosure for this sale can be found here.


C. H. Robinson Worldwide, Inc is a third party logistics company. The Company provides freight transportation services and logistics solutions to companies of all sizes, in a variety of industries. The Company operates through a network of 281 offices in North America, Europe, Asia and South America. It has developed global transportation and distribution networks to provide transportation and supply chain services worldwide.


Frustrated with your broker? Are you tired of paying high fees? Do you feel like you are getting ripped off by your stock broker? It’s time for a change. Find out which brokerage is best for your personal trading style at the InvestorPlace Broker Center. Compare brokers at a glance in the InvestorPlace Broker Center (Click Here).


Mensaje de navegación

1 comment:

  1. More impressive Blog!!! Its more useful for us...Thanks for sharing with us...
    big data in education
    big data education

    ReplyDelete