INSTALLING JEDI FOR DELPHI XE5

Learn step by step how to install the "JEDI" in RAD Studio Delphi XE5

How to use Sublime Text Editor to Develop in Python

Learn how to use Sublime Text Editor to compile Python projects: Setup, Setup, and Setup

Python: A Biblioteca Math

Understand more about the project, Business Developer!

terça-feira, 28 de agosto de 2018

Python: A Biblioteca math


Para a explicação da biblioteca "math", 
utilizarei o Sublime Text Editor 3 e a versão do Phyton 3, 
na plataforma Windows.

A biblioteca "math" contém várias funções matemáticas que podemos utilizar.
Para utilizarmos esta biblioteca vamos a seguinte linha de comando:
import math

1 - Para arredondarmos um valor real para o inteiro mais próximo e acima, utilizamos o método: ceil
exemplo(s) matemáticos:

                                         round(6.01) = 7
                                         round(6.75) = 7
                                         round(6.89) = 7


2 - Para remover o sinal de positivo ou negativo do valor, deixando apenas o valor: fabs

3 - Para calcular o fatorial de um valor x, utilizaremos o método: factorial
exemplo(s) matemático(s): 

                                           fatorial de 3 = 3! = 3 * 2 * 1 = 6
                                           fatorial de 7 = 7! = 7 * 6 * 5 * 4 * 3 * 2 * 1 = 5040
                                           fatorial de 5 = 5! = 5 * 4 * 3 * 2 * 1 = 120




4 - Para deixar somente a parte inteira de um valor, truncaremos o valor real para inteiro, utilizaremos o método: floor
exemplo(s) matemáticos: 

                                        trunc(8.789546321) = 8
                                        trunc(189.7410) = 189
                                        trunc(753.1596) = 753


5 - Para calcular a potenciação ou exponenciação de um valor, utilizaremos o método: exp
exemplo(s) matemáticos:

base: 2.718281828459045
expoentes: 2 , 3 ,1
potências: 7.38905609893065 , 20.085536923187668 , 2.718281828459045

                                  2.718281828459045 ²  = 7.38905609893065
                                  2.718281828459045 ³  = 20.085536923187668
                                  2.718281828459045 ¹  = 2.718281828459045


6 - Para calcular o logaritmo de um valor, utilizaremos o método: log
exemplo(s) matemáticos: log3 9 = x

loga b = x → log3 9 = x
a = 3 = base
b = 9 = logaritmando
x = logaritmo
Como loga b = x ↔ ax = b, então:
log3 9 = x ↔ 3x = 9
3x = 9 → Fatore o logaritmando 9. A fatoração é: 9 = 3 . 3 = 32
3X = 32 → Como a base é o número 3 e temos uma igualdade, podemos então igualar os expoentes para encontrar o valor de x.
x = 2.
Substituindo x por 2 no log, temos:
log3 9 = x → log3 9 = 2

Em Python, a constante e, de valor: 2.718281828459045, é a base, e o valor de x,
em math.log(x), onde x é o logaritmando, e o resultado é o logaritmo.



7 - Para calcular o logaritmo de um valor, passando o logaritmando e a sua base como parâmetro, utilizaremos o método: log(logaritmando, base)
exemplo(s) matemáticos: 

                                        log(9, 3) = log de 9 na base 3 = 2, pois 3 * 3 = 9
                                        log(81, 9) = log de 81 na base 9 = 2, pois 9 * 9 = 81
                                        log(64, 8) = log de 64 na base 8 = 2, pois 8 * 8 = 64



8 - Para calcular o logaritmo de um 2 e 10, passando o logaritmando e a sua base como parâmetro, utilizaremos os métodos: log2(x) e log10(x)
exemplo(s) matemáticos:

                                      log2(4) = log de 4 na base 2 = 2, pois 2 * 2 = 4
                                      log2(16) = log de 16 na base 2 = 4, pois 2 * 2 * 2 * 2 = 4
                                      log10(1000) = log de 1000 na base 10 = 3, pois 10 * 10 * 10 = 1000


9 - Para calcularmos também a exponenciação de um valor, utilizaremos o método: pow
exemplo(s) matemáticos:

                                        3 elevado a 3 = 3³ = 3 * 3 * 3 = 27


10 - Para calcularmos a raiz quadrada de um valor, utilizaremos o método: sqrt
exemplos(s) matemáticos:

                                         a raiz quadrada de 16 = 4, pois x² = 16, onde x é 4
                                         a raiz quadrada de 25 = 5, pois x² = 25, onde x é 5
                                         a raiz quadrada de 64 = 8, pois x² = 64, onde x é 8


11 - Para calcularmos as relações existentes entre os ângulos e os triângulos, utilizaremos três métodos: cos(cosseno), sin(seno), tan(tangente)
exemplo(s) matemáticos: 
                                        cosseno = cateto adjacente / hipotenusa
                                        seno = cateto oposto / hipotenusa
                                        tangente = cateto oposto / cateto adjacente (sin / cos)


12 - Valores das constantes e e pi que vimos neste estudo sobre a biblioteca math, do Python:

segunda-feira, 27 de agosto de 2018

Errors in Delphi # 1: [ FireDAC ] [ Phys ] -330 . Não é possível gerar consulta de atualização. Atualizar tabela indefinida.

Erros no Delphi # 1: [FireDAC] [Phys] -330. Não é possível gerar consulta de atualização. Atualizar tabela indefinida.

Se você especificar um alias na consulta para um campo, a propriedade de origem será definida para o alias e não para o campo real. O componente CNPack, ele muda todos os campos de alias para os campos reais e funciona, mas isso ainda é um grande problema no componente FireDac, porque ele não reconhece os campos de alias, deixa a esperança de que será corrigido no futuro como especificar para cada consulta, qual tabela deve ser atualizada e quais campos são distribuídos, apenas se você estiver migrando de um grande projeto.

Como usar o editor Sublime Text para desenvolver em Python


Depois de instalar o Python e instalar o Sublime Text:

Para utilizar o Sublime Text com o Python, é necessário, fazer algumas configurações.
Para configurar o Sublime para rodar o Python faça os seguintes passos:
1 - Abra o Sublime Text
2 - Vá no menu, Tools > Build System > New Build System
3 - Cole o seguinte código:
{
    "cmd": ["/home/maquiavel/anaconda3/bin/python27", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python"
}
4 - No seguinte caminho: "/home/maquiavel/anaconda3/bin/python27", 
substitua para o diretório que estiver instalado o executável do Phyton 
na sua máquina.

5 - Dentro da pasta de instalação do sublime, tem uma sub pasta chamada: Packages,
salve o arquivo dentro desta pasta.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Em caso de erros depois desta configuração, analise os seguintes erros:

'python' não é reconhecido como um comando interno
ou externo, um programa operável ou um arquivo em lotes.

Se o erro acima aparecer, teremos que fazer um ajuste nas variáveis de ambiente do windows
e adicionar o caminho da pasta do instalador do Python na variável PATH.

1 - Vá para o Painel de Controle ou Sistemas 
e clique em "Configurações Avançadas do Sistema"
2 - Em Propriedades, na guia "Avançado", clique em "Variáveis de ambiente"
3 - Na variável PATH, clique em Edit e logo em seguida abrirá outra janela
4 - Nesta nova janela clique em "Novo", e coloque o caminho do executável de onde o Python está instalado.

5 - Depois desta configuração, abra o programa Sublime Text e 
verifique executar o seguinte comando: print('Hello Word!') 

How to use Sublime Text Editor to Develop in Python


After installing Python and installing Sublime Text:

To use Sublime Text with Python, it is necessary to make some settings.
To configure Sublime to run Python, do the following steps:
1 - Open Sublime Text
2 - Go to the menu, Tools> Build System> New Build System
3 - Paste the following code:
{
    "cmd": ["/ home / machiavell / anaconda3 / bin / python27", "-u", "$ file"
    "file_regex": "^ [] * File \" (... *?) \ ", line ([0-9] *)",
    "selector": "source.python"
}
4 - In the following path: "/ home / machiavell / anaconda3 / bin / python27",
replace to the directory that is installed the Phyton executable
on your machine.

5 - Inside the installation folder of the sublime, has a sub folder called: Packages,
save the file inside this folder.

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
In case of errors after this configuration, analyze the following errors:

'python' is not recognized as an internal command
or external, an operable program or a batch file.

If the above error appears, we will have to make an adjustment on the windows environment variables
and add the path of the Python installer folder to the PATH variable.

1 - Go to the control panel or systems and click , 
Advanced System Settings (Configurações avançadas do sistema)

2 - Under Properties, under the "Advanced" tab, click "Environment Variables"
3 - In the PATH variable, click on Edit and then open another window
4 - In this new window click on "New", and place the path of the executable from where Python is installed
5 - After this configuration, open the Sublime Text program and verify execute the following command: print ('Hello Word!')

quinta-feira, 28 de julho de 2016

Errors in Delphi # 1: [ FireDAC ] [ Phys ] -330 . Can not generate update query . Update table undefined .

"Well i figured out what was the issue, it seems that if you specify a alias in the query for a field the Origin property will be set to the alias and not the real field i downloaded CNPack a must have for a delphi developer also its free, ran the component selector and changed all my aliased fields to their real fields and it works, but this is still a big issue in FireDac component because it doesnt recognize the aliased fields, lets hope it will be fixed in the future as to specify for every query what table it should update and what fields that just allot of work if you are migrating from a big project."

quarta-feira, 3 de setembro de 2014

Installing JEDI for Delphi XE5

>>About
The JEDI Visual Component Library (JVCL) consists of a large collection (currently ca 500) visual and non-visual components which can be instantly reused in your Delphi, Kylix and C++ Builder projects. 

The library is built upon code donated from the JEDI community. It is reformatted to achieve a common look-and-feel, tested, documented and merged into the library. The library is grouped into several categories such as Enhanced Standard, Visual, Non-Visual, Data Aware and many, many more. The library is released to the public under the terms of the Mozilla Public License (MPL) and as such can be freely used in both freeware, shareware, open source and commercial projects. 

Source code files included in the JVCL have a header which explicitly states the license (as is required). However, unless noted otherwise, all files, including those without an MPL header, are subject to the MPL license.

>>Install
For we install JEDI component in Delphi XE5, need to download the full file JVCL JEDI VCL for Delphi site, follow the link below: (http://jvcl.delphi-jedi.org/) 

By accessing the website link as asked above, the page redirected to (Menu > News), which contains the releases of the updated component. As the release in May 2014, will use the JVCL 3:48 to XE5 platform. In this version of JVCL topic that we install, is the SourceForge link to the respective installation package of the library. Check out the image below:

Clicking the encapsulated SourceForge immediately redirected to the following page:



As highlighted green box, you will click on it to download the JVCL3.48 version. Check out the image below:

Once you have downloaded. We will create a folder called "JEDI" in the root directory of your machine, and let her unzip the downloaded file. Check out the following images below:

In my case, the root directory of my machine is "C". Check out the image below:

Check below as was unpacking the file in my root directory:

P.S: Because I have already installed the component before you will see the pastes already uncompressed.

After unzipping the files process. Let's follow the step-by-step installation of the component itself. The installation should be made as follows and in the following order: The "JCL" folder should be installed first and then the "JVCL" folder. Check out the images below:

.. Within the "JCL" folder, there is a 'Install' file which should be executed As this is done, the installation screen will appear JEDI JCL Check out the images below:

Inside the installer, we have 4 tabs. The first tab, "Testing JCL 2.6 Build 5178", which is the description of what the component will be installed, with all its updates, manuals, support settings, ... etc.. The second tab, "MPL 1.1 License," where is located the license to use this component. For, despite being open source, the JEDI it is maintained by a community that values ​​its tool and safe kill. And the next two tabs, the tabs are respectively the facilities of JCL for XE5 XE5 32-bit and 64-bit. All two tabs will already be configured (checked) by default installation, you only need to check that accepts the installation license and agree to the rules. Check out some pictures of step-by-step instructions below:

After checking, you can click the "Install" button, preferably in the first tab so it can install all the tabs according to their order of installation instalação.Durante there appear some questions, like: "Are you sure to install all selected features ? ", and you can confirm the button" Yes ". Another question that will appear during the installation: "Do you want to keep JCL expert settings?" You also confirm the "Yes" button. If any questions appear as random, "The JCL HPP files fail to compile, continue anyway?" Can also confirm the "Yes" button. After all this process, the final will be shown a message: "Installation Finished". Check out the images below:

Once installation of the JCL, proceed to the second step, the installation of "JVCL". The "JVCL" folder has a file titled, "Install", you will open and he will submit the application for the installation of all the component design. Check out the following images:
Soon the last image above, we see the executable from 3:48 JVCL installation, selecting a new installation or upgrade from an older version, in our case, will be a new version. We click on the "Next" button to proceed with the installation. In the next tab, appears selected, the two architectures RAD Studio XE5 for both 32-bit and 64-bit, after this, just click "Next." On the next screen will be the final confirmation for the installation design JEDI component, running their packages, generating map files and recording this. Clicking "Next" will take you to a nearby tab, where it shows you as the palettes of all JEDI library by clicking "Next", will be placed will be listed the ways of installation, immediately after this, you will click on "Install" and will be confirming the complete installation of this package. And that is done you will click "Finish".

To take the course, open RAD Studio Delphi XE5 and make sure the JEDI is being loaded at startup of the IDE, after initializing a new application and test putting some of its components within a form and run, if all goes well. The installation was successful.


# Share