<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-33481028</id><updated>2012-01-18T20:20:00.440-08:00</updated><title type='text'>Rodrigo Oliveira's Linux Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-33481028.post-5678194748589377870</id><published>2008-08-15T12:33:00.000-07:00</published><updated>2008-12-15T21:25:01.094-08:00</updated><title type='text'>Modem HUAWEI E226 no Slackware Linux (TIM Web)</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://img89.imageshack.us/img89/235/11143438dw8.png"&gt;&lt;img style="cursor: pointer; width: 304px; height: 291px;" src="http://img89.imageshack.us/img89/235/11143438dw8.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Via de regra, as operadoras de telefonia/internet não dão suporte ao Linux/BSDs... Isto é fato, infelizmente. Mas com boa vontade vamos contornando esses problemas... Aqui vão os passos necessários para fazer o modem HUAWEI E226  funcione no Slackware Linux com o serviço (TIM Web).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;1 - &lt;/span&gt;Ao plugar o modem, o módulos módulos &lt;span style="font-weight: bold;"&gt;option&lt;/span&gt; e &lt;span style="font-weight: bold;"&gt;usbserial&lt;/span&gt; já devem estar carregados. Verifique isto com o comando &lt;span style="font-weight: bold;"&gt;lsmod&lt;/span&gt;. Se não estiverem ativados, ative-os com os comandos&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;modprobe &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;usbserial&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;modprobe &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;option&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;Quando o modem for plugado a uma porta USB, o mesmo deve estar associado ao dispositivo &lt;span style="font-weight: bold;"&gt;/dev/ttyUSB0&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Outros dois módulos que devem estar carregados são o &lt;span style="font-weight: bold;"&gt;ppp_generic &lt;/span&gt;e o &lt;span style="font-weight: bold;"&gt;ppp_async,&lt;/span&gt; relativos ao protocolo de comunicação.  Os módulos podem ser carregados da seguinte forma:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;modprobe ppp_generic&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;modprobe ppp_async&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Lembre-se que os módulos podem ser carregados na inicializacão do sistema, descomentando as linhas correspondentes no arquivo &lt;span style="font-weight: bold;"&gt;/etc/rc.d/rc.modules&lt;/span&gt; .&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;2 -&lt;/span&gt; Abra o kppp. Nele, clique em &lt;span style="font-weight: bold;"&gt;Configurar...&lt;/span&gt; Em seguida, na aba &lt;span style="font-weight: bold;"&gt;Modems&lt;/span&gt;, clique em &lt;span style="font-weight: bold;"&gt;Novo&lt;/span&gt;. Configure da seguinte forma:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_0cj4-MqfKFQ/SKXfPSyxc2I/AAAAAAAAABE/B5Z9UJO7Tuo/s1600-h/snapshot1.png"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_0cj4-MqfKFQ/SKXfPSyxc2I/AAAAAAAAABE/B5Z9UJO7Tuo/s320/snapshot1.png" alt="" id="BLOGGER_PHOTO_ID_5234835595723895650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_0cj4-MqfKFQ/SKXgIz1_mFI/AAAAAAAAABU/O0i54E_kT88/s1600-h/snapshot2.png"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_0cj4-MqfKFQ/SKXgIz1_mFI/AAAAAAAAABU/O0i54E_kT88/s400/snapshot2.png" alt="" id="BLOGGER_PHOTO_ID_5234836583848319058" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;Observe que a &lt;span style="font-weight: bold;"&gt;string de inicialização 2&lt;/span&gt; do Modem deve ficar assim:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;AT+CGDCONT=1,"IP","tim.br"&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Este é o segredo!&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;Desmarque a opção &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;E&lt;/span&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="font-weight: bold;"&gt;sperar Tom de Discagem&lt;/span&gt;.&lt;/em&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;3 -&lt;/span&gt;  Crie uma nova conta.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Os dados são os seguintes:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    login: &lt;span style="font-weight: bold;"&gt;tim&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;    &lt;/span&gt;senha: &lt;span style="font-weight: bold;"&gt;tim&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;    telefone: &lt;span style="font-weight: bold;"&gt;*99***1#&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;    autenticação: &lt;span style="font-weight: bold;"&gt;CHAP&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;br /&gt;4 -&lt;/span&gt; Adicione os seguintes DNSs ao seu arquivo &lt;span style="font-weight: bold;"&gt;/etc/resolv.conf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;nameserver 208.67.222.222&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;nameserver 208.67.222.220&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;nameserver 189.40.238.6&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;nameserver 200.149.55.140&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;nameserver 200.202.193.71&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;5 -&lt;/span&gt; Conecte-se e divirta-se!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;O procedimento foi testado no&lt;span style="font-weight: bold;"&gt; Slackware 12.1 e no SLAMD 64 12.0. &lt;/span&gt;Porém, observe que as informações contidas aqui podem ser úteis para outras distribuições do Linux.&lt;br /&gt;&lt;br /&gt;Abraços a todos!&lt;br /&gt;Rodrigo M. S. de Oliveira.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-5678194748589377870?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/5678194748589377870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=5678194748589377870' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/5678194748589377870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/5678194748589377870'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2008/08/huawei-e226-no-slackware-linux-tim-web.html' title='Modem HUAWEI E226 no Slackware Linux (TIM Web)'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_0cj4-MqfKFQ/SKXfPSyxc2I/AAAAAAAAABE/B5Z9UJO7Tuo/s72-c/snapshot1.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-1154966947243322359</id><published>2008-07-31T04:23:00.000-07:00</published><updated>2008-07-31T04:26:55.444-07:00</updated><title type='text'>LANE divulga suas animações na internet</title><content type='html'>O &lt;a href="http://www.lane.ufpa.br"&gt;LANE&lt;/a&gt; - Laboratório de análises numéricas em eletromagnetismo (UFPA), está divulgando vídeos que são resultados de simulações numéricas pelo método das diferenças finitas. As animações podem ser vistas no site &lt;a href="http://www.lane.ufpa.br/videos.htm"&gt;http://www.lane.ufpa.br/videos.htm&lt;/a&gt; .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-1154966947243322359?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/1154966947243322359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=1154966947243322359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/1154966947243322359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/1154966947243322359'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2008/07/lane-divulga-suas-animaes-na-internet.html' title='LANE divulga suas animações na internet'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-2562822113506456896</id><published>2008-01-12T09:01:00.000-08:00</published><updated>2008-01-12T12:10:30.361-08:00</updated><title type='text'>Convertendo vídeos FLV (YouTube) em MPEG (Para ver no DVD Player)</title><content type='html'>Algumas vezes é interessante guardar em um CD vídeos raros que (possivelmente) só se encontram no YouTube. Porém, se for possível ver na sala, no DVD player, melhor ainda. Vamos ver como se faz isso no Linux (ou BSDs).&lt;br /&gt;&lt;br /&gt;Primeiro, é preciso baixar um video do YouTube. Uma forma prática de fazer isso é usando o site &lt;a href="http://www.techcrunch.com/get-youtube-movie/"&gt;YouTube Video Download Tool&lt;/a&gt;. Basta colar o link do YouTube e clicar em "Get Video". Salve o arquivo com a extensão .flv (flash video). Por exemplo, o arquivo poderia se chamar &lt;span style="font-weight: bold;"&gt;video.flv&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Para converter o arquivo para mpeg, uma possibilidade é usar o comando &lt;span style="font-weight: bold;"&gt;ffmpeg&lt;/span&gt;. Bastaria fazer o seguinte:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ffmpeg -i video.flv  -s 320x240 -deinterlace -acodec mp2 -ab 128 -ar 44100 video.mpg&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;O parâmetro&lt;span style="font-weight: bold;"&gt; -s 320x240 &lt;/span&gt;apenas garante que as dimensões do video de saída sejam idênticas às do YouTube (evita distorções).&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Já o &lt;span style="font-weight: bold;"&gt;-deinterlace &lt;/span&gt;garante que o vídeo tenha todas as linhas horizontais em todos os quadros (veja &lt;a href="http://en.wikipedia.org/wiki/Interlace"&gt;interlace&lt;/a&gt;).&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Os parâmetros &lt;span style="font-weight: bold;"&gt; -acodec mp2 -ab 128 -ar 44100 &lt;/span&gt;garantem que o audio será reconhecido em todos os DVD Players, inclusive nos antigos, que não tocavam MP3.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;video.mpg &lt;/span&gt;&lt;span&gt;é o nome do arquivo de saída.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Com isso, tudo funcionou perfeitamente tanto no micro como no DVD Player.&lt;br /&gt;&lt;br /&gt;A seguir disponibilizo um pequeno script em bash para converter uma seqüência de arquivos flv:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 102, 102);"&gt;#!/bin/bash&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;mkdir&lt;/span&gt; mpg&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;for&lt;/span&gt; i &lt;span style="color: rgb(0, 0, 153);"&gt;in&lt;/span&gt; &lt;span style="color: rgb(51, 204, 0);"&gt;$(&lt;/span&gt; &lt;span style="color: rgb(204, 0, 0);"&gt;ls&lt;/span&gt; *.flv &lt;span style="color: rgb(51, 204, 0);"&gt;)&lt;/span&gt;; &lt;span style="color: rgb(0, 0, 153);"&gt;do&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    &lt;span style="color: rgb(153, 0, 0);"&gt;echo&lt;/span&gt; video: &lt;span style="color: rgb(51, 204, 0);"&gt;$i&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    ffmpeg -i &lt;span style="color: rgb(51, 204, 0);"&gt;$i&lt;/span&gt;  -s 320x240 -deinterlace -acodec mp2 -ab 128 -ar 44100  mpg/&lt;span style="color: rgb(51, 204, 0);"&gt;$i&lt;/span&gt;.mpg&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;done&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Quem quiser ver todas as opções do ffmpeg, pode fazê-lo &lt;a href="http://ffmpeg.mplayerhq.hu/documentation.html"&gt;aqui&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Para quem usa o rWindows, sugiro o &lt;a href="http://info.abril.com.br/download/4639.shtml"&gt;VDownloader&lt;/a&gt;, que já vem com o ffmpeg integrado e faz a conversão usando apenas o mouse.&lt;br /&gt;&lt;br /&gt;Mas para quem usa Linux, a linha de comando sempre é a melhor opção ;)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-2562822113506456896?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/2562822113506456896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=2562822113506456896' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/2562822113506456896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/2562822113506456896'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2008/01/convertendo-vdeos-flv-youtube-em-mpeg.html' title='Convertendo vídeos FLV (YouTube) em MPEG (Para ver no DVD Player)'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-7684710695504989179</id><published>2007-04-01T06:37:00.000-07:00</published><updated>2008-05-18T14:13:11.023-07:00</updated><title type='text'>Documentos no padrão ANBT com LaTeX no Slackware</title><content type='html'>Preparei um pacote tgz para o Slackware do &lt;span style="font-style: italic;"&gt;software&lt;/span&gt; &lt;a href="http://abntex.codigolivre.org.br/"&gt;abnTeX&lt;/a&gt; para os que precisam gerar documentos no padrão ABNT de forma rápida e eficiente!  O download pode ser feito &lt;a href="http://www.lane.ufpa.br/rodrigo/tgz/abntex-0.8.2-noarch-1rdg.tgz"&gt;aqui.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A Instalação deve ser feita de forma usual, com o comando &lt;span style="font-weight: bold;"&gt;installpkg abntex-0.8.2-noarch-1rdg.tgz.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Informações sobre o uso do abnTeX podem ser obtidas em seu &lt;a href="http://abntex.codigolivre.org.br/"&gt;site oficial.&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-7684710695504989179?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/7684710695504989179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=7684710695504989179' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/7684710695504989179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/7684710695504989179'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2007/04/documentos-no-padro-anbt-com-latex-no.html' title='Documentos no padrão ANBT com LaTeX no Slackware'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-4786697154716316641</id><published>2007-03-22T18:02:00.000-07:00</published><updated>2008-12-09T15:47:45.437-08:00</updated><title type='text'>Lexmark E120 on Slackware Linux 10.2</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://images.lexmark.com/vgn/files/portal/E120RV_lg.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 151px; height: 122px;" src="http://images.lexmark.com/vgn/files/portal/E120RV_lg.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;E120 is a low cost Laser printer from Lexmark and, fortunately, it works perfectly on Slackware 10.2! This mini-howto is intended to help people to get it working in this system.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;Some aspects must be taken into account:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;1 - The UNIX drivers  contained in the CD and available in the official website will not work (at least for me they did not);&lt;br /&gt;&lt;br /&gt;2 - CUPS can print to E120 using the package Gutenprint 5.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, all you must do is to install Gutenprint, &lt;a href="http://packages.slackware.it/search.php?v=11.0&amp;t=1&amp;amp;q=gutenprint"&gt;which is available in slackware package browser site&lt;/a&gt;, and configure it. Follow the steps (as root):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 - Install it with the command &lt;span style="font-style: italic;"&gt;installpkg gutenprint-5.0.0-i486-2.tgz&lt;br /&gt;&lt;/span&gt;2 - make sure CUPS server is running (use the command pkgtool)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_0cj4-MqfKFQ/RgMrzap66NI/AAAAAAAAAAU/qCxGVaSje8A/s1600-h/cups_pkgtool.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 379px; height: 277px;" src="http://1.bp.blogspot.com/_0cj4-MqfKFQ/RgMrzap66NI/AAAAAAAAAAU/qCxGVaSje8A/s320/cups_pkgtool.jpg" alt="" id="BLOGGER_PHOTO_ID_5044924169913559250" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;3 - Turn the printer E120 on.&lt;br /&gt;&lt;br /&gt;4 - Point a web browser to &lt;a href="http://localhost:631/"&gt;http://localhost:631&lt;/a&gt; . You will see the CUPS administration tool.&lt;br /&gt;&lt;br /&gt;5 - Click on the "Add Printer" button.&lt;br /&gt;&lt;br /&gt;6 - Type a name for you printer (e.g. LexmarkE120) and click on the "Continue" button.&lt;br /&gt;&lt;br /&gt;7 - Choose the device corresponding to your printer. Click on the "Continue" button once more.&lt;br /&gt;&lt;br /&gt;8 - Now choose the proper driver for the printer, which is called "&lt;span style="font-weight: bold;"&gt;Lexmark Optra E&lt;/span&gt;".  Click on "Continue".&lt;br /&gt;&lt;br /&gt;That is it! It works like a charm and it becames available in KDE's Kprinter for straightforward printing! I hope this helps someone!&lt;br /&gt;&lt;br /&gt;(This should work on Slackware 11. It has Gutenprint as part of the system).&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_0cj4-MqfKFQ/RgMuhKp66OI/AAAAAAAAAAc/3N13pofS204/s1600-h/e120_kprinter.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 343px; height: 311px;" src="http://4.bp.blogspot.com/_0cj4-MqfKFQ/RgMuhKp66OI/AAAAAAAAAAc/3N13pofS204/s320/e120_kprinter.jpg" alt="" id="BLOGGER_PHOTO_ID_5044927154915829986" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-4786697154716316641?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/4786697154716316641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=4786697154716316641' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/4786697154716316641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/4786697154716316641'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2007/03/lexmark-e120-on-slackware-linux-102.html' title='Lexmark E120 on Slackware Linux 10.2'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_0cj4-MqfKFQ/RgMrzap66NI/AAAAAAAAAAU/qCxGVaSje8A/s72-c/cups_pkgtool.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-116792277054119119</id><published>2007-01-04T06:51:00.000-08:00</published><updated>2007-01-04T06:59:30.553-08:00</updated><title type='text'>Pendrive no Slackware</title><content type='html'>Várias vezes sou questionado sobre o uso de pendrives (usbkeys) no Slackware. Bom, aqui está o procedimento que uso no Slackware 10.x / 11&lt;br /&gt;&lt;br /&gt;Execute com root o seguinte&lt;br /&gt;&lt;br /&gt;* edite o arquivo &lt;span style="font-weight: bold;"&gt;/etc/fstab&lt;/span&gt; e adicione o seguinte:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;/dev/sda  /mnt/pendrive    vfat auto,users,suid,dev,exec 0 0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;/dev/sda1 /mnt/pendrive1  vfat auto,users,suid,dev,exec 0 0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* Crie as pastas&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mkdir /mnt/pendrive&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mkdir /mnt/pendrive1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;* usar KDE ou o comando mount normalmente.&lt;br /&gt;&lt;br /&gt;Se seu hd for Serial ATA, substituir &lt;span style="font-weight: bold;"&gt;sda&lt;/span&gt; por &lt;span style="font-weight: bold;"&gt;sdb&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Uma outra opção é usar o pacote &lt;span class="title"&gt;update-fstab, que faz tudo de forma automática no KDE quando o pendrive é plugado!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Baixe o &lt;span style="font-style: italic;"&gt;pacote update_fstab-5.0.1-i486-1rdg.tgz&lt;/span&gt; do site&lt;br /&gt;   &lt;a href="http://www.linuxpackages.net/pkg_details.php?id=9235"&gt;http://www.linuxpackages.net/pkg_details.php?id=9235&lt;/a&gt;&lt;br /&gt;e use o comando&lt;br /&gt;   &lt;span style="font-weight: bold;"&gt;installpkg  update_fstab-5.0.1-i486-1rdg.tgz &lt;/span&gt;para instalá-lo.&lt;br /&gt;&lt;br /&gt;Abraço,&lt;br /&gt;Rodrigo.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-116792277054119119?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/116792277054119119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=116792277054119119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/116792277054119119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/116792277054119119'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2007/01/pendrive-no-slackware.html' title='Pendrive no Slackware'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-116067811658722123</id><published>2006-10-12T11:23:00.001-07:00</published><updated>2006-10-12T11:44:12.593-07:00</updated><title type='text'>Gerando numéros reais aleatórios entre 0 e 1 em C/C++</title><content type='html'>&lt;p style="margin-bottom: 0in;"&gt;Recentemente um amigo me perguntou como&lt;br /&gt;gerar numéros reais aleatorios entre 0 e 1 em C. Investigando&lt;br /&gt;o manual de programação do Linux, descobri uma função&lt;br /&gt;random(), em stdlib.h, que gera números inteiros entre 0 e&lt;br /&gt;RAND_MAX (cujo valor está definido nesta biblioteca) [veja man&lt;br /&gt;random]. Assim, me veio a idéia de criar uma simples macro que&lt;br /&gt;transformasse os valores retornado por random() e RAND_MAX em float e&lt;br /&gt;realizasse a divisão random()/RAND_MAX.&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;A seguir está o código de&lt;br /&gt;teste que enviei a ele.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;//----------------------------------&lt;/p&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/p&gt;#include &amp;lt;stdlib.h&amp;gt; // RAND_MAX é definido em stdlib.h&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;#define myrand ((float)(random())/(float)(RAND_MAX) )  //macro myrand: gera numeros float entre 0 e 1&lt;/p&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;int main(){&lt;br /&gt;srandom(time(NULL));  // inicia o gerador de números aleatórios&lt;br /&gt;&lt;/p&gt;int i;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;// gera 10 numeros aleatorios&lt;/p&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;  for(i=1;i &amp;lt;= 10; i++)&lt;br /&gt;printf("%f\n",myrand);&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;}&lt;/p&gt;//----------------------------------&lt;br /&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;Espero que seja útil, pessoal!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-116067811658722123?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/116067811658722123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=116067811658722123' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/116067811658722123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/116067811658722123'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2006/10/gerando-numros-reais-aleatrios-entre-0.html' title='Gerando numéros reais aleatórios entre 0 e 1 em C/C++'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-115764108100138048</id><published>2006-09-07T07:54:00.000-07:00</published><updated>2006-09-15T05:02:49.946-07:00</updated><title type='text'>Visualização de campo escalar com o GNUPLOT</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/820/3677/1600/teste.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/820/3677/320/teste.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;Algumas vezes é necessário visualizar um campo escalar... E o Slackware traz o &lt;i&gt;gnuplot&lt;/i&gt;, que pode ser usado para esta tarefa. Primeiro, gere um arquivo texto com extensão .dat com os dados. Os dados deve ser gravados como exemplificado no programa abaixo (em fortran).&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        &lt;b&gt;program&lt;/b&gt; teste_campo&lt;br /&gt;     &lt;span style="color: rgb(153, 51, 153);"&gt;real&lt;/span&gt; campo,pi&lt;br /&gt;     &lt;span style="color: rgb(153, 51, 153);"&gt;integer&lt;/span&gt; i,j&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        pi&lt;b&gt;=&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(96, 0, 96);"&gt;acos&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;b&gt;-&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;1.0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 96, 96);"&gt;open(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 96, 96);"&gt;file&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;=&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'teste.dat'&lt;/span&gt;&lt;span style="color: rgb(0, 96, 96);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 96, 96);"&gt;rewind(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 96, 96);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        &lt;b&gt;do&lt;/b&gt; i&lt;b&gt;=&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;100&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;         &lt;b&gt;do&lt;/b&gt; j&lt;b&gt;=&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;100&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;            campo=&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;20.0&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;*&lt;/span&gt;&lt;span style="color: rgb(96, 0, 96);"&gt;sin&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;2.0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;b&gt;*&lt;/b&gt;pi&lt;b&gt;*&lt;/b&gt;i&lt;b&gt;/&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;10.0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;b&gt;+&lt;/b&gt;(&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;2.0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;b&gt;*&lt;/b&gt;pi&lt;b&gt;*&lt;/b&gt;j&lt;b&gt;/&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 128);"&gt;10.0&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          &lt;/span&gt;&lt;span style="color: rgb(0, 96, 96);"&gt;write(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 96, 96);"&gt;*)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; i,j,campo&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;         &lt;b&gt;enddo&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;          &lt;/span&gt;&lt;span style="color: rgb(0, 96, 96);"&gt;write(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 96, 96);"&gt;*) &lt;/span&gt;&lt;span style="color: rgb(128, 128, 128);"&gt;!uma linha em branco após gravar cada coluna&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;         &lt;b&gt;enddo&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;         &lt;/span&gt;&lt;span style="color: rgb(0, 96, 96);"&gt;close(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 96, 96);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;        &lt;b&gt;end program&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);font-family:times new roman;font-size:100%;"  &gt;&lt;span style="font-size:100%;"&gt;Depois, chame o gnuplot com o seguinte comando no terminal:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 255);font-family:times new roman;font-size:100%;"  &gt;&lt;b&gt;gnuplot&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:times new roman;font-size:100%;"  &gt;&lt;span style="font-size:100%;"&gt;Um terminal do gnuplot será exibido. Nele, digite os comandos:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 255);font-family:times new roman;font-size:100%;"  &gt;&lt;b&gt;&lt;span style="font-family:monospace;"&gt;s&lt;/span&gt;et pm3d map&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 255);font-family:times new roman;font-size:100%;"  &gt;&lt;b&gt;splot “teste.dat”&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:times new roman;font-size:100%;"  &gt;&lt;span style="font-size:100%;"&gt;Você deve ver a figura mostrada acima!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;Se você quer gravar a figura em um arquivo gif, use os comandos:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 255);font-family:times new roman;font-size:100%;"  &gt;&lt;b&gt;set term gif&lt;br /&gt;set out 'teste.gif'&lt;br /&gt;set pm3d map&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 255);font-family:times new roman;font-size:100%;"  &gt;&lt;b&gt;splot “teste.dat”&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:times new roman;font-size:100%;"  &gt;&lt;span style="font-size:100%;"&gt;É isso aí...&lt;br /&gt;Abaços!&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-115764108100138048?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/115764108100138048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=115764108100138048' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115764108100138048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115764108100138048'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2006/09/visualizao-de-campo-escalar-com-o.html' title='Visualização de campo escalar com o GNUPLOT'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-115755633948096948</id><published>2006-09-06T08:23:00.000-07:00</published><updated>2006-09-06T08:32:39.490-07:00</updated><title type='text'>Programação para dual core (ou multi core) com a LAM MPI</title><content type='html'>&lt;p align="justify"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;Com a disponibilidade de processadores com múltiplos núcleos&lt;br /&gt;de processamento (&lt;i&gt;multicore&lt;/i&gt;), os desenvolvedores de &lt;i&gt;software&lt;/i&gt;&lt;span style="font-style: normal;"&gt;&lt;br /&gt;precisam saber utilizar ferramentas de desenvolvimento (ou mesmo&lt;br /&gt;desenvolvê-las) para o aproveitamento desse recurso. Uma&lt;br /&gt;possibilidade é utilizar a MPI (&lt;i&gt;message passing interface&lt;/i&gt;)&lt;br /&gt;como biblioteca de comunicação. Este artigo traz um&lt;br /&gt;exemplo simples em FORTRAN 77, que calcula o fatorial de 10&lt;br /&gt;utilizando dois processadores. É importante notar que se você&lt;br /&gt;tiver vários computadores em rede (linux, unix...), a MPI pode&lt;br /&gt;ser empregada para usá-los! &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;O primeiro passo é instalar a &lt;/span&gt;&lt;a href="http://www.lam-mpi.org/"&gt;&lt;span style="font-size:85%;"&gt;LAM-MPI&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;p style="font-style: normal;" align="justify"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;Você pode baixar o pacote para o Slackware 10.x &lt;/span&gt;&lt;a href="http://www.lane.ufpa.br/%7Erodrigo/tgz/lam-7.0.2-i686-1.tgz"&gt;&lt;span style="font-size:85%;"&gt;aqui&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;.&lt;br /&gt;A instalação é direta, com o comando &lt;b&gt;&lt;span style="color:#0099ff;"&gt;installpkg&lt;br /&gt;lam-7.0.2-i686-1.tgz&lt;/span&gt;&lt;span style="color:#4700b8;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;span style="color:#000000;"&gt;(como&lt;br /&gt;root)&lt;/span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style="font-style: normal;" align="justify"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;&lt;span style="font-size:85%;"&gt;Depois, salve o código abaixo num novo arquivo texto chamado &lt;span style="color:#0099ff;"&gt;mpitest.f&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;span style="color:#808080;"&gt;&lt;i&gt;ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color:#808080;"&gt;&lt;i&gt;c  Programa com o minimo necessario &lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#808080;"&gt;&lt;i&gt;c  na inplementacao de passagem de informacao&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#808080;"&gt;&lt;i&gt;c  com a MPI&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#808080;"&gt;&lt;i&gt;c&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#808080;"&gt;&lt;i&gt;c   Rodrigo M.S. de Oliveira&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;        &lt;b&gt;program&lt;/b&gt; mpitest&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;b&gt;include&lt;/b&gt; &lt;/span&gt;&lt;span style="color:#dd0000;"&gt;'mpif.h'&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;/span&gt;&lt;span style="color:#800000;"&gt;integer&lt;/span&gt;&lt;span style="color:#000000;"&gt; myrank, ierr, nnodes, status(MPI_STATUS_SIZE), buffpos&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#800000;"&gt;         real&lt;/span&gt;&lt;span style="color:#000000;"&gt; x,y&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;                &lt;b&gt;call&lt;/b&gt; &lt;span style="color:#0099ff;"&gt;MPI_INIT&lt;/span&gt; (ierr)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;                &lt;b&gt;call&lt;/b&gt; &lt;span style="color:#0099ff;"&gt;MPI_COMM_SIZE&lt;/span&gt; (MPI_COMM_WORLD, nnodes, ierr)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;                &lt;b&gt;call&lt;/b&gt; &lt;span style="color:#0099ff;"&gt;MPI_COMM_RANK&lt;/span&gt; (MPI_COMM_WORLD, myrank, ierr)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;b&gt;if&lt;/b&gt;(myrank&lt;/span&gt;&lt;b&gt;&lt;span style="color:#008000;"&gt;.eq.&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#0000ff;"&gt;0&lt;/span&gt;&lt;span style="color:#000000;"&gt;)&lt;b&gt;then&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;          x&lt;b&gt;=&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#800080;"&gt;1.0&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;          &lt;b&gt;do&lt;/b&gt; i&lt;b&gt;=&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000000;"&gt;,&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;5&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;           x&lt;b&gt;=&lt;/b&gt;x&lt;b&gt;*&lt;/b&gt;(i)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;          &lt;b&gt;enddo&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;           &lt;b&gt;call&lt;/b&gt; &lt;span style="color:#0099ff;"&gt;MPI_SEND&lt;/span&gt;(x,&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000000;"&gt;,MPI_REAL,&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000000;"&gt;,&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;99&lt;/span&gt;&lt;span style="color:#000000;"&gt;,MPI_COMM_WORLD,ierr)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;           &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;b&gt;else&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;b&gt;if&lt;/b&gt;(myrank&lt;/span&gt;&lt;b&gt;&lt;span style="color:#008000;"&gt;.eq.&lt;/span&gt;&lt;/b&gt;&lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000000;"&gt;)&lt;b&gt;then&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         y&lt;b&gt;=&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#800080;"&gt;1.0&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;          &lt;b&gt;do&lt;/b&gt; i&lt;b&gt;=&lt;/b&gt;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;6&lt;/span&gt;&lt;span style="color:#000000;"&gt;,&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;10&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;           y&lt;b&gt;=&lt;/b&gt;y&lt;b&gt;*&lt;/b&gt;(i)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;          &lt;b&gt;enddo&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;           &lt;b&gt;call&lt;/b&gt; &lt;span style="color:#0099ff;"&gt;MPI_RECV&lt;/span&gt;(x,&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;1&lt;/span&gt;&lt;span style="color:#000000;"&gt;,MPI_REAL,&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;0&lt;/span&gt;&lt;span style="color:#000000;"&gt;,&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;99&lt;/span&gt;&lt;span style="color:#000000;"&gt;,MPI_COMM_WORLD,status,ierr)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;           &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;           &lt;/span&gt;&lt;span style="color:#006060;"&gt;write(*&lt;/span&gt;&lt;span style="color:#000000;"&gt;,&lt;/span&gt;&lt;span style="color:#006060;"&gt;*)&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#dd0000;"&gt;'10!='&lt;/span&gt;&lt;span style="color:#000000;"&gt;,x&lt;b&gt;*&lt;/b&gt;y&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;b&gt;endif&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;b&gt;endif&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;         &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;                &lt;b&gt;call&lt;/b&gt; &lt;span style="color:#0099ff;"&gt;MPI_FINALIZE &lt;/span&gt;(ierr)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;                &lt;b&gt;stop&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;                &lt;b&gt;end program&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#808080;"&gt;&lt;i&gt;&lt;b&gt;ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;Neste código, as funções em azul claro são da biblioteca MPI e devem ser chamadas com&lt;br /&gt;a instrução &lt;b&gt;call&lt;/b&gt;. As três primeiras,  &lt;span style="font-family:Courier New, monospace;"&gt;&lt;span style="color:#0099ff;"&gt;MPI_INIT,  MPI_COMM_SIZE &lt;span style="font-family:Verdana, sans-serif;"&gt;&lt;span style="color:#000000;"&gt;e&lt;/span&gt;&lt;/span&gt; MPI_COMM_RANK &lt;/span&gt;&lt;/span&gt;sempre&lt;br /&gt;devem estar no programa após as declarações das variaveis. Aliás, declará-las explicitamente&lt;br /&gt;(sem usar o comando implicit) é uma boa idéia.  A variável myrank é utilizada para se&lt;br /&gt;determinar em que processador se está trabalhando (0, 1, 2 ...).&lt;br /&gt;&lt;span style="font-family:Courier New, monospace;"&gt;&lt;span style="color:#0099ff;"&gt;MPI_SEND &lt;span style="font-family:Verdana, sans-serif;"&gt;&lt;span style="color:#000000;"&gt;e&lt;/span&gt;&lt;/span&gt; MPI_RECV &lt;/span&gt;&lt;/span&gt;são, como os nomes sugerem, utilizadas para a  troca de mensagens.&lt;br /&gt;A sintaxe dessas funções é a seguinte: &lt;span style="font-family:Courier New, monospace;"&gt;&lt;span style="color:#0099ff;"&gt;MPI_SEND &lt;span style="color:#000000;"&gt;(&lt;/span&gt;a1,1,a2,a3,a4&lt;/span&gt;,MPI_COMM_WORLD,ierr)&lt;/span&gt;,&lt;br /&gt;na qual &lt;span style="color:#0099ff;"&gt;a1&lt;/span&gt; é o valor a ser enviado, &lt;span style="color:#0099ff;"&gt;a2&lt;/span&gt; é o tipo da variavel &lt;span style="color:#0099ff;"&gt;a1&lt;/span&gt;, &lt;span style="color:#0099ff;"&gt;a3&lt;/span&gt; é o processador de destino e&lt;br /&gt;&lt;span style="color:#0099ff;"&gt;a4&lt;/span&gt; é o código único que identifica a troca de mensagens (a ser controlado pelo programador), &lt;span style="font-family:Courier New, monospace;"&gt;&lt;span style="color:#0099ff;"&gt;&lt;br /&gt;MPI_RECV&lt;/span&gt;(&lt;span style="color:#0099ff;"&gt;a5,1,a2,a6,a4&lt;/span&gt;,MPI_COMM_WORLD,status,ierr)&lt;/span&gt;, onde &lt;span style="color:#0099ff;"&gt;a5&lt;/span&gt; é a variavel de destino,&lt;br /&gt;&lt;span style="color:#0099ff;"&gt;a6&lt;/span&gt; é o processador de onde vem a informação.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;O próximo passo é compilar o código. O segunte comando pode ser usado:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0099ff;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;&lt;b&gt;hf77 mpitest.f -o mpitest -O&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;A topologia da máquina paralela deve ser especificada, pois, como dito anteriormente, a MPI&lt;br /&gt;pode operar com outros micros da rede que tenham MPI (dadas as devidas permissões).&lt;br /&gt;Então, um arquivo texto deve ser criado com a lista de máquinas que vão ser usadas para rodar&lt;br /&gt;o programa. Como vamos aqui usar os dois núcleos do processador local, um arquivo texto &lt;span style="color:#0099ff;"&gt;topologia&lt;br /&gt;&lt;span style="color:#000000;"&gt;deve conter o seguinte&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;&lt;b&gt;localhost&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;&lt;b&gt;localhost&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;São duas vezes mesmo. Se fossem 4 núcleos, localhost apareceria 4 vezes.&lt;br /&gt;&lt;br /&gt;Salvo o arquivo, basta dar o comando&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0099ff;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;&lt;b&gt;lamboot -v topologia&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;para montar a topologia.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;Agora basta rodar o programa com o comando&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0099ff;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;&lt;b&gt;mpirun -np 2  mpitest&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;com o argumento de &lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;np&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;sendo o número de processadores empregados.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;Para desmontar a topologia. basta dar o comando&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0099ff;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;&lt;b&gt;wipe -v topologia&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;Obs: o kernel do sistema deve ser recompilado para suportar múltiplas CPUs (SMP),&lt;br /&gt;de forma que, assim, realmente serão usados os dois núcleos.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:Verdana, sans-serif;"&gt;É isso aí... em breve a versão em C será publicada.&lt;br /&gt;Abraços!&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-115755633948096948?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/115755633948096948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=115755633948096948' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115755633948096948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115755633948096948'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2006/09/programao-para-dual-core-ou-multi-core.html' title='Programação para dual core (ou multi core) com a LAM MPI'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-115729662066919598</id><published>2006-09-03T07:55:00.000-07:00</published><updated>2006-09-03T08:22:54.876-07:00</updated><title type='text'>Implementação e uso de Funções em C</title><content type='html'>Algumas pessoas me perguntam, algumas vezes, como implementar e usar funções e C. Fica aqui registrado um bom exemplo para iniciantes!&lt;br /&gt;&lt;br /&gt;void imprime_array(float *x, int imax){&lt;br /&gt;int i;&lt;br /&gt;for (i=0;i&amp;lt;imax;i++){&lt;br /&gt;printf("x[%d]=%f\n",i,x[i]);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;float triplo(float x){ //primeira versao&lt;/p&gt; return (3.0*x);&lt;br /&gt;}&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;void triplo2(float x, float *x3){ //com ponteiros: varios argumentos podem ser retornados&lt;br /&gt;&lt;/p&gt; *x3=(3.0*x);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;main(){&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt; int i, imax=10;&lt;/p&gt; float x[imax],y;&lt;br /&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt; for (i=0;i&amp;lt;imax;i++){&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt;   x[i] = (float)i;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0in;"&gt; }&lt;/p&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt; imprime_array(x,imax);&lt;/p&gt; y=triplo(2.0);&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt; printf("%f\n",y);&lt;/p&gt; triplo2(3.0,&amp;amp;y);&lt;br /&gt;printf("%f\n",y);&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;}&lt;/p&gt;&lt;br /&gt;&lt;p style="margin-bottom: 0in;"&gt;&lt;br /&gt;&lt;/p&gt;Espero que seja útil pessoal! Abraços!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-115729662066919598?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/115729662066919598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=115729662066919598' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115729662066919598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115729662066919598'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2006/09/implementao-e-uso-de-funes-em-c.html' title='Implementação e uso de Funções em C'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-115693609367154780</id><published>2006-08-30T03:56:00.000-07:00</published><updated>2006-08-30T04:08:13.683-07:00</updated><title type='text'>C and FORTRAN Compilation in Slackware Linux</title><content type='html'>So, you'd like to code in Slackware Linux? Here are some tips for using C and FORTRAN.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;C&lt;/span&gt;&lt;br /&gt;First, you create a source file (extension &lt;span style="color: rgb(255, 0, 0);"&gt;.c&lt;span style="color: rgb(0, 0, 0);"&gt;). You can use &lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;mcedit&lt;/span&gt; in your terminal. Just type&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;    mcedit mycode.c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;You can now start coding. Here is a simple example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;main (){&lt;/span&gt;&lt;br /&gt; &lt;span style="font-weight: bold;"&gt; printf ("ok \n");&lt;/span&gt;&lt;br /&gt; &lt;span style="font-weight: bold;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Press &lt;span style="font-weight: bold;"&gt;F10 &lt;/span&gt;and save your file &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;(mycode.c&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Now compile the program with &lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;gcc&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;    gcc mycode.c -o mycode -O&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Run the created binary with&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;&lt;br /&gt;    ./mycode&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;FORTRAN&lt;/span&gt;&lt;br /&gt; First, you create a source file (extension &lt;span style="color: rgb(255, 0, 0);"&gt;.f&lt;span style="color: rgb(0, 0, 0);"&gt;). You can use &lt;span style="font-style: italic; color: rgb(0, 0, 0);"&gt;mcedit&lt;/span&gt; in your terminal. Just type&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;    mcedit mycode.f&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;You can now start coding. Here is a simple example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;program mycode&lt;br /&gt; write(*,*) "OK"&lt;br /&gt;end program&lt;br /&gt; &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;Press &lt;span style="font-weight: bold;"&gt;F10 &lt;/span&gt;and save your file &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;(mycode.f&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Now compile the program with &lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;g77&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;    g77 mycode.f -o mycode -O&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Run the created binary with&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;&lt;br /&gt;    ./mycode&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;That is it! I hope this is usefull for the beginer users! Have fun!&lt;/span&gt;&lt;span style="color: rgb(51, 102, 255); font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-weight: bold; color: rgb(51, 102, 255);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-115693609367154780?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/115693609367154780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=115693609367154780' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115693609367154780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115693609367154780'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2006/08/c-and-fortran-compilation-in-slackware.html' title='C and FORTRAN Compilation in Slackware Linux'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-115677594269510371</id><published>2006-08-28T07:31:00.000-07:00</published><updated>2006-08-31T10:08:06.310-07:00</updated><title type='text'>Publicações do LANE</title><content type='html'>O &lt;a href="http://www.lane.ufpa.br"&gt;&lt;span style="font-weight: bold;"&gt;LANE&lt;/span&gt;&lt;/a&gt; (Laboratório de Análises Numéricas em Eletromagnetismo - &lt;a href="http://www.ufpa.br"&gt;UFPa&lt;/a&gt;), que trabalha atualmente com a técnica numérica FDTD em diversas aplicações, está disponibilizando suas publicações &lt;span style="font-style: italic;"&gt;online&lt;/span&gt; no endereço &lt;a href="http://www.lane.ufpa.br/publicacoes.html"&gt;http://www.lane.ufpa.br/publicacoes.html.&lt;/a&gt;&lt;br /&gt;A página está em atualização e espera-se disponibilizar o mais breve possível todo o trabalho produzido pelo &lt;a href="http://www.lane.ufpa.br/equipe.html"&gt;grupo&lt;/a&gt; de pesquisa coordenado pelo professor Carlos Leonidas Sobrinho.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-115677594269510371?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/115677594269510371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=115677594269510371' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115677594269510371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115677594269510371'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2006/08/publicaes-do-lane.html' title='Publicações do LANE'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-33481028.post-115677482363775004</id><published>2006-08-28T07:11:00.000-07:00</published><updated>2006-08-28T07:20:23.656-07:00</updated><title type='text'>Primeiro Post</title><content type='html'>Olá! Este é o meu primeiro &lt;span style="font-style: italic;"&gt;blog&lt;/span&gt; e vou tentar criar um espaço bastante útil e interessante para os visitantes! Vou publicar dicas e pacotes sobre o sistema operacional que uso em casa e no laboratório do qual faço parte (&lt;a href="http://www.lane.ufpa.br"&gt;LANE&lt;/a&gt;): &lt;span style="font-weight: bold;"&gt;o fantástico &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://www.slackware.com"&gt;Slackware Linux&lt;/a&gt;. Além disso, vou deixar disponível aqui &lt;span style="font-style: italic;"&gt;posts &lt;/span&gt;sobre outros assuntos de interesse pessoal. Espero que gostem e aproveitem! Por favor, deixem seus comentários sobre os tópicos publicados! Abraços a todos!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/33481028-115677482363775004?l=rodrigomsdeoliveira.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rodrigomsdeoliveira.blogspot.com/feeds/115677482363775004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=33481028&amp;postID=115677482363775004' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115677482363775004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/33481028/posts/default/115677482363775004'/><link rel='alternate' type='text/html' href='http://rodrigomsdeoliveira.blogspot.com/2006/08/primeiro-post.html' title='Primeiro Post'/><author><name>Rodrigo M. S. de Oliveira</name><uri>http://www.blogger.com/profile/06515158118579465354</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
