Inteligência Artificial para leigos

Segundo o portal HypeScience, o termo “Inteligência Artificial” foi criado em 1956,  durante um encontro dos cientistas Allen Newell, Herbert Simon, Marvin Minsky, Oliver Selfridge e John McCarthy.

O principal conceito de inteligência artificial, hoje inteligência distribuída, está nas pesquisas de ciência da computação que buscam métodos ou dispositivos computacionais para multiplicar a capacidade racional do ser humano. Estes estudos visam impulsionar computadores a realizarem tarefas similares às que os humanos fazem.

Você sabe quais os principais campos de estudo deste tipo de inteligência?

– Linguagem natural: aborda o conjunto de técnicas que objetivam o reconhecimento e a geração de linguagens escritas ou faladas. São aplicadas em dispositivos para tradução, controle por voz e outros.

– Automação e robótica: estudo mais conhecido, composto pelo conjunto de recursos tecnológicos utilizado para criar robôs autônomos.

– Sistemas perceptivos: possui o intuito de criar sistemas de reconhecimento visual, sonoro ou de texturas para potencializar a percepção sensorial dos seres humanos. São aplicados nos campos de diagnóstico médico e qualidade industrial (testes de produtos, entre outros).

– Sistemas especialistas: capturam o conhecimento humano em domínios delimitados, como cálculos, diagnósticos médicos, identificação de compostos químicos, etc. Podem ser personalizados para apoiarem decisões em diferentes setores com raciocínios baseados em casos anteriores.

– Algoritmos genéticos: proporcionam o desenvolvimento de técnicas para solucionar problemas de princípios evolutivos, como mutação, reprodução e seleção natural. Permitem um cálculo com grande número de variáveis e podem ser aplicados inclusive para a construção de aviões e automóveis.

– Agentes inteligentes: caracterizam o conjunto de softwares autônomos que atuam em redes ou em paralelo a um software principal. São criados com o objetivo de realizar  tarefas previsíveis, específicas e repetitivas. Normalmente, esta tecnologia é aplicada em e-mails e buscadores da internet.

– Redes neuronais: simulações dos padrões de processamento do cérebro humano, como aprendizagem. São desenvolvidos sem uma pré-programação especifica, permitindo que as redes “aprendam” com um determinado ambiente de treinamento. Existem redes do tipo que permitem interagir com elas na internet, como o Cleverbot. Este robô virtual aprende com as conversas que tem com humanos.

Fonte: HypeScience

http://www.comunitexto.com.br/inteligencia-artificial-para-leigos/#.VzEgurorLH5

Convert simple HelloWorld.c (C) in Assembly(AT&T)

Convert simple HelloWorld.c (C) in Assembly(AT&T)

C:

#gcc helloworld.c -o helloworld

/* Hello World program */
#include<stdio.h>
main()
{
printf(“Hello World”);
}

Assembly (AT&T)

#gcc -O3 -S -masm=intel -mtune=native -fverbose-asm helloworld.c

Assembly:

.file “helloworld.c”
.intel_syntax noprefix
# GNU C11 (GCC) version 5.1.1 20150618 (Red Hat 5.1.1-4) (x86_64-redhat-linux)
# compiled by GNU C version 5.1.1 20150618 (Red Hat 5.1.1-4), GMP version 6.0.0, MPFR version 3.1.2, MPC version 1.0.2
# warning: MPFR header version 3.1.2 differs from library version 3.1.3.
# GGC heuristics: –param ggc-min-expand=100 –param ggc-min-heapsize=131072
# options passed: helloworld.c –param l1-cache-size=32
# –param l1-cache-line-size=64 –param l2-cache-size=4096 -mtune=haswell
# -masm=intel -march=x86-64 -O3 -fverbose-asm
# options enabled: -faggressive-loop-optimizations -falign-labels
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
# -fcaller-saves -fchkp-check-incomplete-type -fchkp-check-read
# -fchkp-check-write -fchkp-instrument-calls -fchkp-narrow-bounds
# -fchkp-optimize -fchkp-store-bounds -fchkp-use-static-bounds
# -fchkp-use-static-const-bounds -fchkp-use-wrappers
# -fcombine-stack-adjustments -fcommon -fcompare-elim -fcprop-registers
# -fcrossjumping -fcse-follow-jumps -fdefer-pop
# -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
# -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse
# -fgcse-after-reload -fgcse-lm -fgnu-runtime -fgnu-unique
# -fguess-branch-probability -fhoist-adjacent-loads -fident -fif-conversion
# -fif-conversion2 -findirect-inlining -finline -finline-atomics
# -finline-functions -finline-functions-called-once
# -finline-small-functions -fipa-cp -fipa-cp-alignment -fipa-cp-clone
# -fipa-icf -fipa-icf-functions -fipa-icf-variables -fipa-profile
# -fipa-pure-const -fipa-ra -fipa-reference -fipa-sra -fira-hoist-pressure
# -fira-share-save-slots -fira-share-spill-slots
# -fisolate-erroneous-paths-dereference -fivopts -fkeep-static-consts
# -fleading-underscore -flifetime-dse -flra-remat -flto-odr-type-merging
# -fmath-errno -fmerge-constants -fmerge-debug-strings
# -fmove-loop-invariants -fomit-frame-pointer -foptimize-sibling-calls
# -foptimize-strlen -fpartial-inlining -fpeephole -fpeephole2
# -fpredictive-commoning -fprefetch-loop-arrays -free -freg-struct-return
# -freorder-blocks -freorder-blocks-and-partition -freorder-functions
# -frerun-cse-after-loop -fsched-critical-path-heuristic
# -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock
# -fsched-last-insn-heuristic -fsched-rank-heuristic -fsched-spec
# -fsched-spec-insn-heuristic -fsched-stalled-insns-dep -fschedule-fusion
# -fschedule-insns2 -fsemantic-interposition -fshow-column -fshrink-wrap
# -fsigned-zeros -fsplit-ivs-in-unroller -fsplit-wide-types -fssa-phiopt
# -fstdarg-opt -fstrict-aliasing -fstrict-overflow
# -fstrict-volatile-bitfields -fsync-libcalls -fthread-jumps
# -ftoplevel-reorder -ftrapping-math -ftree-bit-ccp -ftree-builtin-call-dce
# -ftree-ccp -ftree-ch -ftree-coalesce-vars -ftree-copy-prop
# -ftree-copyrename -ftree-cselim -ftree-dce -ftree-dominator-opts
# -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-distribute-patterns
# -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon
# -ftree-loop-optimize -ftree-loop-vectorize -ftree-parallelize-loops=
# -ftree-partial-pre -ftree-phiprop -ftree-pre -ftree-pta -ftree-reassoc
# -ftree-scev-cprop -ftree-sink -ftree-slp-vectorize -ftree-slsr -ftree-sra
# -ftree-switch-conversion -ftree-tail-merge -ftree-ter -ftree-vrp
# -funit-at-a-time -funswitch-loops -funwind-tables -fverbose-asm
# -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387
# -malign-stringops -mfancy-math-387 -mfp-ret-in-387 -mfxsr -mglibc
# -mieee-fp -mlong-double-80 -mmmx -mno-sse4 -mpush-args -mred-zone -msse
# -msse2 -mtls-direct-seg-refs -mvzeroupper

.section .rodata.str1.1,”aMS”,@progbits,1
.LC0:
.string “Hello World”
.section .text.unlikely,”ax”,@progbits
.LCOLDB1:
.section .text.startup,”ax”,@progbits
.LHOTB1:
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
sub rsp, 8 #,
.cfi_def_cfa_offset 16
mov edi, OFFSET FLAT:.LC0 #,
xor eax, eax #
call printf #
xor eax, eax #
add rsp, 8 #,
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.section .text.unlikely
.LCOLDE1:
.section .text.startup
.LHOTE1:
.ident “GCC: (GNU) 5.1.1 20150618 (Red Hat 5.1.1-4)”
.section .note.GNU-stack,””,@progbits

@firebitsbr

OpenBSD Tentando porting do Virtualbox (draft)

Ontem (23-06-2012), tentei pela primeira vez (mas era um desejo de uns 5 anos atrás), o porting do código-fonte do virtualbox para OpenBSD, tornando mais um host de virtualização.

Quando saiu o primeiro porting do Virtualbox para FreeBSD, achei que viria para OpenBSD, também.

FreeBSD build instructions
https://www.virtualbox.org/wiki/FreeBSD%20build%20instructions
http://dgz.dyndns.org/mediawiki/index.php/%28OBSD%29_HOWTO_Install_VMWARE_tools_on_a_OpenBSD_system
http://www.h-i-r.net/2009/11/virtualbox-full-screen-resolution-for.html

The FreeBSD build instructions are being worked on as the FreeBSD port advances.

If you like to help out with the FreeBSD port, please join the #vbox-dev irc channel or drop a mail on the development mailing list.

Current state: It works quite stable by now for FreeBSD 7.x and 8-CURRENT. There is a port in the FreeBSD ports tree too.
Prerequisites

You need:

[OK]    GCC 3.2.3 or later (except for the GCC 4.0.x series)
=> The default GCC should be fine.

[OK]    Yasm 0.6.2 or later
=> /usr/ports/devel/yasm

[NOK]    -> Freebsd
as86 (real mode assembler, usually part of the dev86 or bin86 package)
=> /usr/ports/devel/dev86

[NOK] -> Freebsd
bcc (Bruce Evans C Compiler; often part of the dev86 package)
=> /usr/ports/devel/dev86 (same as above)

[NOK]
IASL (Intel ACPI compiler)
=> The one installed into /usr/sbin/iasl should be fine.

[OK]
xsltproc (libxslt, XML style sheet processor)
=> /usr/ports/textproc/libxslt

[OK]
libxml2
=> /usr/ports/textproc/libxml2

[NOK]    -> Freebsd
libXcursor (required to support color mouse pointers in guest)
=> Probably installed, if not try /usr/ports/x11/libXcursor.

[OK]
libpng
=> /usr/ports/graphics/png

[OK]
libIDL
=> /usr/ports/devel/libIDL

[OK]
libSDL
=> /usr/ports/devel/sdl12

[OK]
mkisofs (required only for additions which aren’t supported yet)
=> /usr/ports/sysutils/cdrtools

[NOK] -> Freebsd
kBuild (The one provided with the VirtualBox sources doesn’t with FreeBSD 8-CURRENT)
=> /usr/ports/devel/kBuild

[OK]
curl
=> /usr/ports/ftp/curl

[NOK]    -> Freebsd
libXmu
=> /usr/ports/x11-toolkits/libXmu

Qt 4.4.x
[OK]
=> /usr/ports/x11-toolkits/qt4-gui

=> /usr/ports/net/qt4-network
=> /usr/ports/devel/qt4-moc
=> /usr/ports/net/qt4-uic
=> /usr/ports/net/qt4-rcc
=> /usr/ports/net/qt4-linguist ; or configure –disable-qt

Building VirtualBox

Change to the root directory of the sources and execute the configure script:

./configure –disable-hardening

If it finds everything it needs, it will create a file called ‘AutoConfig.kmk’ containing paths to the various tools on your system. Also, it will create an environment setup script called env.sh. This step only has to be done once (if something changes in your build tool setup, you might have to repeat it but keep in mind that both output files will be overwritten).

The switch –disable-hardening should not be used for building packages for redistribution or for production use.

Whenever you want to build VirtualBox, you have to open a shell and source the generated environment setup script ‘env.sh’, i.e. do

source ./env.sh

To build a release package, type

kmk all

This produces the required binaries in out/freebsd.x86/release/bin/. If you want to build a debug version, type

kmk BUILD_TYPE=debug

In case you have more than one CPU core, kmk will automatically do a parallel build.

Running your build

You can run VirtualBox directly from the build target directory (out/freebsd.x86/release/bin/).

You have to load the kernel driver first using kldload ./vboxdrv.ko as root. Make sure you give yourself read and write access to /dev/vboxdrv.

If you made a hardened build, make sure that the setuid stubs have the correct permissions:

for f in VirtualBox VBoxHeadless VBoxSDL VBoxBFE VBoxNetDHCP VBoxNetAdpCtl; do
chown root.root $f
chmod 4511 $f
done

Finally, you can start one of the frontends, e.g.

LD_LIBRARY_PATH=. ./VirtualBox