The MIDAS Journal is an Open Access on-line publication covering different domains from Visualization to Image processing.
The unique characteristics of the MIDAS Journal include:
-Open-access to articles and reviews
-Open peer-review that invites discussion between reviewers and authors
-Support for continuous revision of articles, code, and reviews
http://www.midasjournal.org/
27 de abr. de 2010
28 de mar. de 2010
Intalando e configurando o Stardict com dicionarios do Babylon no Ubuntu 9.10
...
1 - Baixar os dicionário do Babylon (Pt/En e En/Pt) nos links:
http://go2.wordpress.com/?id=725X1342&site=joaoolavo.wordpress.com&url=http%3A%2F%2Finfo.babylon.com%2Fglossaries%2F38C%2FBabylon_English_Portuguese.BGL
e
http://go2.wordpress.com/?id=725X1342&site=joaoolavo.wordpress.com&url=http%3A%2F%2Finfo.babylon.com%2Fglossaries%2F38C%2FBabylon_English_Portuguese.BGL
ou, pelo terminal:
Os arquivos virão no formato .exe, que nada mais é que um arquivo compactado como o ZIP ou RAR. Basta clicar com o botão direito nos arquivos, extrair o conteúdo deles e os dicionários BGL aparecerão.
2 - Instalar o conversor de formatos dos dicionários
$ sudo apt-get install dictconv
3 - Convertendo os dicionários para o formato do Stardict
Se você obtiver uma saída como abaixo obteve sucesso!
Com isso serão gerados 3 arquivos:
* Babylon_English_Portuguese.dict
* Babylon_English_Portuguese.idx
* Babylon_English_Portuguese.ifo
4 - Instalação
Agora, precisamos finalmente comprimir o dicionário com o dictzip, que foi instalado quando instalamos o stardict-tools. Vamos lá:
#sudo dictzip Babylon_English_Portuguese.dict
E agora movemos nosso mais novo dicionário para o diretório do stardict no sistema como root:
Se iniciarmos agora o Stardict ele já estará carregando nosso novo dicionário.
Fontes:
http://joaoolavo.wordpress.com/2007/12/26/dicionarios-do-babylon-rodando-no-linux/
http://www.vivaolinux.com.br/artigo/Configurando-o-Stardict-com-dicionario-do-Babylon?pagina=3
1 - Baixar os dicionário do Babylon (Pt/En e En/Pt) nos links:
http://go2.wordpress.com/?id=725X1342&site=joaoolavo.wordpress.com&url=http%3A%2F%2Finfo.babylon.com%2Fglossaries%2F38C%2FBabylon_English_Portuguese.BGL
e
http://go2.wordpress.com/?id=725X1342&site=joaoolavo.wordpress.com&url=http%3A%2F%2Finfo.babylon.com%2Fglossaries%2F38C%2FBabylon_English_Portuguese.BGL
ou, pelo terminal:
#wget http://info.babylon.com/glossaries/38C/Babylon_English_Portuguese.BGL
#wget http://info.babylon.com/glossaries/4EA/Babylon_Portuguese_English_dic.BGL
#wget http://info.babylon.com/glossaries/4EA/Babylon_Portuguese_English_dic.BGL
Os arquivos virão no formato .exe, que nada mais é que um arquivo compactado como o ZIP ou RAR. Basta clicar com o botão direito nos arquivos, extrair o conteúdo deles e os dicionários BGL aparecerão.
2 - Instalar o conversor de formatos dos dicionários
$ sudo apt-get install dictconv
3 - Convertendo os dicionários para o formato do Stardict
#sudo ./dictconv Babylon_English_Portuguese.BGL -o Babylon_English_Portuguese.ifo
Se você obtiver uma saída como abaixo obteve sucesso!
Results
File: Babylon_English_Portuguese.ifo
Title: Babylon English-Portuguese
Author: Babylon Ltd.
Email: linguistic-support@babylon.com
Version:
License:
Description: This comprehensive English-Portuguese dictionary
contains words, phrases, abbreviations & acronyms. It includes
terms from a vast variety of subjects, such as Medicine,
Electronics, Zoology, Business, Computers, Religion, etc., and
features both the American and British forms of spelling.
Original Language: English
Destination Language: Portuguese
Headwords: 144759
Words: 144759
File: Babylon_English_Portuguese.ifo
Title: Babylon English-Portuguese
Author: Babylon Ltd.
Email: linguistic-support@babylon.com
Version:
License:
Description: This comprehensive English-Portuguese dictionary
contains words, phrases, abbreviations & acronyms. It includes
terms from a vast variety of subjects, such as Medicine,
Electronics, Zoology, Business, Computers, Religion, etc., and
features both the American and British forms of spelling.
Original Language: English
Destination Language: Portuguese
Headwords: 144759
Words: 144759
Com isso serão gerados 3 arquivos:
* Babylon_English_Portuguese.dict
* Babylon_English_Portuguese.idx
* Babylon_English_Portuguese.ifo
4 - Instalação
Agora, precisamos finalmente comprimir o dicionário com o dictzip, que foi instalado quando instalamos o stardict-tools. Vamos lá:
#sudo dictzip Babylon_English_Portuguese.dict
E agora movemos nosso mais novo dicionário para o diretório do stardict no sistema como root:
#sudo rm Babylon_English_Portuguese.BGL
# mv Babylon_English_Portuguese.* /usr/share/stardict/dic/
# mv Babylon_English_Portuguese.* /usr/share/stardict/dic/
Se iniciarmos agora o Stardict ele já estará carregando nosso novo dicionário.
Fontes:
http://joaoolavo.wordpress.com/2007/12/26/dicionarios-do-babylon-rodando-no-linux/
http://www.vivaolinux.com.br/artigo/Configurando-o-Stardict-com-dicionario-do-Babylon?pagina=3
1 de mar. de 2010
Tela preta no Youtube usando o Ubuntu
Se o seu Ubuntu está com o plugin do Flash Player "acanalhado", só aparece uma tela preta quando você vai assistir um vídeo, experimente os comandos abaixo
Funciona como mágica!
Fonte: http://ubuntuforums.org/showthread.php?s=5b9eca584f1c3e2a8c7446eb56b2381d&t=854891&page=2
sudo apt-get remove swfdec-mozilla sudo apt-get remove mozilla-plugin-gnash sudo apt-get remove adobe-flashplugin sudo apt-get remove flashplugin-nonfree sudo apt-get install flashplugin-nonfree
Funciona como mágica!
Fonte: http://ubuntuforums.org/showthread.php?s=5b9eca584f1c3e2a8c7446eb56b2381d&t=854891&page=2
Marcadores:
Configuração,
Configurações,
Linux,
Ubuntu 9.04
24 de nov. de 2009
Como acessar e controlar computador remotamente com o Ubuntu
Meu problema era o seguinte, eu queria acessar minha máquina ubuntu via VNC, tentei através do "Area de trabalho remota" e também com o "Terminal Server" e o resultado sempre era o mesmo, eu conseguia acessar e me conectar no computador remoto mas não conseguia controlar o computador pois alterações ocorriam mas a tela não atualizava, ou seja, conectava mas ficava sem feedback, travado na primeira imagem recebida. Após muito pesquisar a solução recebi uma dica através de um forum: http://www.vivaolinux.com.br/topico/vivaolinux/Area-de-trabalho-remota-conecta-mas-nao-controla/
e a solução é simplesmente executar este comando no computador a ser acessado:
metacity --replace
Ele troca o gerenciador/decorador de janelas Compiz nativo do ubuntu pelo Metacity que permite este tipo de conexão com atualização remota.
Espero ter ajudado alguem não perder horas da sua vida pra descobrir algo tão simples de resolver.
Abraço
e a solução é simplesmente executar este comando no computador a ser acessado:
metacity --replace
Ele troca o gerenciador/decorador de janelas Compiz nativo do ubuntu pelo Metacity que permite este tipo de conexão com atualização remota.
Espero ter ajudado alguem não perder horas da sua vida pra descobrir algo tão simples de resolver.
Abraço
7 de out. de 2009
Exmplo OSG+PhysX
//--------------------------
//Autor: Tiago buriol
//---------------------------
// C++ includes
#include < stdio.h >
#include < sys/time.h >
// OSG includes
#include < osgViewer/Viewer >
#include < osg/Geometry >
#include < osgGA/TrackballManipulator >
#include < osg/Vec3d >
#include < osg/PositionAttitudeTransform >
#include < osg/ShapeDrawable >
// PhysX include
#include "NxPhysics.h"
// Declaracao de variaveis globais para o PhysX
static NxPhysicsSDK* gPhysicsSDK = NULL;
static NxScene* gScene = NULL;
NxActor* box = NULL;
// Inicializa o Physx e define alguns parametros
static bool InitNx()
{
// Inicializa o PhysX SDK
NxPhysicsSDKDesc desc;
gPhysicsSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION);
if (!gPhysicsSDK) return false;
gPhysicsSDK->setParameter(NX_SKIN_WIDTH, 0.001);
// Cria uma cena
NxSceneDesc sceneDesc;
//sceneDesc.simType = NX_SIMULATION_HW;
sceneDesc.simType = NX_SIMULATION_SW;
sceneDesc.gravity = NxVec3(0.0f, -9.81f, 0.0f);
gScene = gPhysicsSDK->createScene(sceneDesc);
// Set default material
NxMaterial* defaultMaterial = gScene->getMaterialFromIndex(0);
defaultMaterial->setRestitution(0.2f);
defaultMaterial->setStaticFriction(0.01f);
defaultMaterial->setDynamicFriction(0.01f);
// Create ground plane
NxPlaneShapeDesc planeDesc;
//planeDesc.skinWidth = 0.01f;
NxActorDesc actorDesc;
actorDesc.shapes.pushBack(&planeDesc);
actorDesc.globalPose.t = NxVec3(0.0, 0.0, 0.0);
gScene->createActor(actorDesc);
// Add a single-shape actor to the scene
NxActorDesc boxActorDesc;
NxBodyDesc boxBodyDesc;
// The actor has one shape, a box, 1m on a side
NxBoxShapeDesc boxDesc;
boxDesc.dimensions.set(1.0, 1.0, 1.0);
//boxDesc.skinWidth = 0.01f;
boxActorDesc.shapes.pushBack(&boxDesc);
boxActorDesc.body = & boxBodyDesc;
boxActorDesc.density = 5.0f;
boxActorDesc.globalPose.M.fromQuat(NxQuat(30.0, NxVec3(1, 0, 0)));
boxActorDesc.globalPose.t = NxVec3(0,5.0,0);
box = gScene->createActor(boxActorDesc);
//printf("altura %f\n",box->getGlobalPosition().y);
return true;
}
int main(int argc, char** argv)
{
double delta_t;
struct timeval tv1, tv2;
// Cria o visualizador
osgViewer::Viewer viewer;
osg::ref_ptr root = new osg::Group;
osg::Sphere* unitSphere = new osg::Sphere(osg::Vec3(0,0,0), 1.0);
osg::ShapeDrawable* unitSphereDrawable = new osg::ShapeDrawable(unitSphere);
unitSphereDrawable->setColor(osg::Vec4(1, 0, 0, 1));
osg::Geode* unitSphereGeode = new osg::Geode();
unitSphereGeode->addDrawable(unitSphereDrawable);
osg::PositionAttitudeTransform* unitSpherePAT = new osg::PositionAttitudeTransform();
unitSpherePAT->setPosition(osg::Vec3(2.0,0.0,1.0));
unitSpherePAT->addChild(unitSphereGeode);
// Cria o cubo a ser renderizado
osg::Box* unitBox = new osg::Box(osg::Vec3(0,0,-0.5), 1.0, 1.0, 1.0);
osg::ShapeDrawable* unitBoxDrawable = new osg::ShapeDrawable(unitBox);
unitBoxDrawable->setColor(osg::Vec4(1, 1, 0, 1));
osg::Geode* unitBoxGeode = new osg::Geode();
unitBoxGeode->addDrawable(unitBoxDrawable);
osg::PositionAttitudeTransform* unitBoxPAT = new osg::PositionAttitudeTransform();
unitBoxPAT->addChild(unitBoxGeode);
// Desenha um plano
osg::Vec3 coords[] = { osg::Vec3(-3.0, 3.0, -0.01),
osg::Vec3(3.0, 3.0, -0.01),
osg::Vec3(3.0, -3.0, -0.01),
osg::Vec3(-3.0, -3.0, -0.01)
};
osg::Vec3Array* vertices = new osg::Vec3Array(4,coords);
osg::Geometry* planeGeometry = new osg::Geometry();
planeGeometry->setVertexArray(vertices);
planeGeometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4));
osg::Vec4Array* colors = new osg::Vec4Array;
colors->push_back(osg::Vec4(0.8f,0.8f,1.0f,1.0f));
planeGeometry->setColorArray(colors);
planeGeometry->setColorBinding(osg::Geometry::BIND_OVERALL);
osg::Vec3Array *shared_normals = new osg::Vec3Array;
shared_normals->push_back(osg::Vec3(0.0f,-1.0f,0.0f));
// use the shared normal array.
planeGeometry->setNormalArray(shared_normals);
planeGeometry->setNormalBinding(osg::Geometry::BIND_OVERALL);
osg::Geode* planeGeode = new osg::Geode();
planeGeode->addDrawable(planeGeometry);
root->addChild(unitSpherePAT);
root->addChild(unitBoxPAT);
root->addChild(planeGeode);
viewer.setSceneData(root.get());
viewer.setUpViewInWindow(0, 0, 800, 600);
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
viewer.realize();
// Initialize physics scene and start the application main loop if scene was created
if (InitNx())
delta_t = 0.001;
// Loop principal da simulacao
while (!viewer.done()) {
// Pega o tempo inicial
gettimeofday(&tv1, NULL);
// Realiza um passo da simulacao para um intervalo de tempo igual a delta_t
gScene->simulate((NxReal)delta_t);
gScene->flushStream();
gScene->fetchResults(NX_RIGID_BODY_FINISHED, false);
// Sincroniza as posicao e rotacao dos cubos simulado e renderizado
unitBoxPAT->setAttitude(osg::Quat(box->getGlobalOrientationQuat().x,
box->getGlobalOrientationQuat().z,
box->getGlobalOrientationQuat().y,
box->getGlobalOrientationQuat().w) );
unitBoxPAT->setPosition(osg::Vec3d(box->getGlobalPosition().x,
box->getGlobalPosition().z,
box->getGlobalPosition().y) );
// Atualiza o frame
viewer.frame();
// Pega o tempo final e calcula o tempo entre um frame e outro
gettimeofday(&tv2, NULL);
delta_t = (tv2.tv_usec - tv1.tv_usec)*0.000001;
}
return 0;
}
//Autor: Tiago buriol
//---------------------------
// C++ includes
#include < stdio.h >
#include < sys/time.h >
// OSG includes
#include < osgViewer/Viewer >
#include < osg/Geometry >
#include < osgGA/TrackballManipulator >
#include < osg/Vec3d >
#include < osg/PositionAttitudeTransform >
#include < osg/ShapeDrawable >
// PhysX include
#include "NxPhysics.h"
// Declaracao de variaveis globais para o PhysX
static NxPhysicsSDK* gPhysicsSDK = NULL;
static NxScene* gScene = NULL;
NxActor* box = NULL;
// Inicializa o Physx e define alguns parametros
static bool InitNx()
{
// Inicializa o PhysX SDK
NxPhysicsSDKDesc desc;
gPhysicsSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION);
if (!gPhysicsSDK) return false;
gPhysicsSDK->setParameter(NX_SKIN_WIDTH, 0.001);
// Cria uma cena
NxSceneDesc sceneDesc;
//sceneDesc.simType = NX_SIMULATION_HW;
sceneDesc.simType = NX_SIMULATION_SW;
sceneDesc.gravity = NxVec3(0.0f, -9.81f, 0.0f);
gScene = gPhysicsSDK->createScene(sceneDesc);
// Set default material
NxMaterial* defaultMaterial = gScene->getMaterialFromIndex(0);
defaultMaterial->setRestitution(0.2f);
defaultMaterial->setStaticFriction(0.01f);
defaultMaterial->setDynamicFriction(0.01f);
// Create ground plane
NxPlaneShapeDesc planeDesc;
//planeDesc.skinWidth = 0.01f;
NxActorDesc actorDesc;
actorDesc.shapes.pushBack(&planeDesc);
actorDesc.globalPose.t = NxVec3(0.0, 0.0, 0.0);
gScene->createActor(actorDesc);
// Add a single-shape actor to the scene
NxActorDesc boxActorDesc;
NxBodyDesc boxBodyDesc;
// The actor has one shape, a box, 1m on a side
NxBoxShapeDesc boxDesc;
boxDesc.dimensions.set(1.0, 1.0, 1.0);
//boxDesc.skinWidth = 0.01f;
boxActorDesc.shapes.pushBack(&boxDesc);
boxActorDesc.body = & boxBodyDesc;
boxActorDesc.density = 5.0f;
boxActorDesc.globalPose.M.fromQuat(NxQuat(30.0, NxVec3(1, 0, 0)));
boxActorDesc.globalPose.t = NxVec3(0,5.0,0);
box = gScene->createActor(boxActorDesc);
//printf("altura %f\n",box->getGlobalPosition().y);
return true;
}
int main(int argc, char** argv)
{
double delta_t;
struct timeval tv1, tv2;
// Cria o visualizador
osgViewer::Viewer viewer;
osg::ref_ptr
osg::Sphere* unitSphere = new osg::Sphere(osg::Vec3(0,0,0), 1.0);
osg::ShapeDrawable* unitSphereDrawable = new osg::ShapeDrawable(unitSphere);
unitSphereDrawable->setColor(osg::Vec4(1, 0, 0, 1));
osg::Geode* unitSphereGeode = new osg::Geode();
unitSphereGeode->addDrawable(unitSphereDrawable);
osg::PositionAttitudeTransform* unitSpherePAT = new osg::PositionAttitudeTransform();
unitSpherePAT->setPosition(osg::Vec3(2.0,0.0,1.0));
unitSpherePAT->addChild(unitSphereGeode);
// Cria o cubo a ser renderizado
osg::Box* unitBox = new osg::Box(osg::Vec3(0,0,-0.5), 1.0, 1.0, 1.0);
osg::ShapeDrawable* unitBoxDrawable = new osg::ShapeDrawable(unitBox);
unitBoxDrawable->setColor(osg::Vec4(1, 1, 0, 1));
osg::Geode* unitBoxGeode = new osg::Geode();
unitBoxGeode->addDrawable(unitBoxDrawable);
osg::PositionAttitudeTransform* unitBoxPAT = new osg::PositionAttitudeTransform();
unitBoxPAT->addChild(unitBoxGeode);
// Desenha um plano
osg::Vec3 coords[] = { osg::Vec3(-3.0, 3.0, -0.01),
osg::Vec3(3.0, 3.0, -0.01),
osg::Vec3(3.0, -3.0, -0.01),
osg::Vec3(-3.0, -3.0, -0.01)
};
osg::Vec3Array* vertices = new osg::Vec3Array(4,coords);
osg::Geometry* planeGeometry = new osg::Geometry();
planeGeometry->setVertexArray(vertices);
planeGeometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,4));
osg::Vec4Array* colors = new osg::Vec4Array;
colors->push_back(osg::Vec4(0.8f,0.8f,1.0f,1.0f));
planeGeometry->setColorArray(colors);
planeGeometry->setColorBinding(osg::Geometry::BIND_OVERALL);
osg::Vec3Array *shared_normals = new osg::Vec3Array;
shared_normals->push_back(osg::Vec3(0.0f,-1.0f,0.0f));
// use the shared normal array.
planeGeometry->setNormalArray(shared_normals);
planeGeometry->setNormalBinding(osg::Geometry::BIND_OVERALL);
osg::Geode* planeGeode = new osg::Geode();
planeGeode->addDrawable(planeGeometry);
root->addChild(unitSpherePAT);
root->addChild(unitBoxPAT);
root->addChild(planeGeode);
viewer.setSceneData(root.get());
viewer.setUpViewInWindow(0, 0, 800, 600);
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
viewer.realize();
// Initialize physics scene and start the application main loop if scene was created
if (InitNx())
delta_t = 0.001;
// Loop principal da simulacao
while (!viewer.done()) {
// Pega o tempo inicial
gettimeofday(&tv1, NULL);
// Realiza um passo da simulacao para um intervalo de tempo igual a delta_t
gScene->simulate((NxReal)delta_t);
gScene->flushStream();
gScene->fetchResults(NX_RIGID_BODY_FINISHED, false);
// Sincroniza as posicao e rotacao dos cubos simulado e renderizado
unitBoxPAT->setAttitude(osg::Quat(box->getGlobalOrientationQuat().x,
box->getGlobalOrientationQuat().z,
box->getGlobalOrientationQuat().y,
box->getGlobalOrientationQuat().w) );
unitBoxPAT->setPosition(osg::Vec3d(box->getGlobalPosition().x,
box->getGlobalPosition().z,
box->getGlobalPosition().y) );
// Atualiza o frame
viewer.frame();
// Pega o tempo final e calcula o tempo entre um frame e outro
gettimeofday(&tv2, NULL);
delta_t = (tv2.tv_usec - tv1.tv_usec)*0.000001;
}
return 0;
}
Assinar:
Postagens (Atom)