FTD2XX.jl: Wrapper for FTDI FTD2XX Library

FTD2XX.jl

FTD2XX.jl is a thin wrapper for FTDI's D2XX driver.

Installation

FTD2XX.jl is currently unregistered. It can be installed using Pkg.clone.

Pkg.clone("https://github.com/cstook/FTD2XX.jl.git")

The julia documentation section on installing unregistered packages provides more information.

UART quick start

The UART may be accessed as type IOftuart <: IO

get information about devices

device_infomation_list = ft_getdeviceinfolist()

open a device.

io = open(FT_SerialNumber("FTXRNZUJ"),9600,8,1,"n") # open by serial number

or

io = open(FT_Description("C232HM-EDHSL-0"),9600,8,1,"n") # open by description

or

io = open(FT_Location(0x000001a2),9600,8,1,"n") # open by location

or

io = open(FT_DeviceIndex(0),9600,8,1,"n") # open by device index

or

uartconfig = UARTConfiguration(9600,8,1,"n",
                               readtimeout = 1000,        # in milliseconds
                               writetimeout = 1000,        # in milliseconds
                               flowcontrol = "none",    # none, rts_cts, dtr_dsr, xon_xoff
                               xon = 0x11,
                               xoff = 0x13)
io = open(FT_DeviceIndex(0),uartconfig)

use all the normal IO functions

write(io, 0x55)
byteread = read(io, UInt8)

close the device

close(io)

Documentation

API for this wrapper

FTDI website

D2XX Programmer's Guide (from FTDI)

OS Compatibility

FTD2XX.jl is compatible with windows, linux, and osx. See FTDI's installation guides for instructions on installing drivers for your operating system. Drivers are assumed to be installed in the default locations.

Additional Information for Linux

To Do

I2C as an array.

SPI, JTAG as readdata = writeread(datatowrite)

Download Details:

Author: cstook
Source Code: https://github.com/cstook/FTD2XX.jl 
License: View license

#julia #wrapper 

What is GEEK

Buddha Community

FTD2XX.jl: Wrapper for FTDI FTD2XX Library

FTD2XX.jl: Wrapper for FTDI FTD2XX Library

FTD2XX.jl

FTD2XX.jl is a thin wrapper for FTDI's D2XX driver.

Installation

FTD2XX.jl is currently unregistered. It can be installed using Pkg.clone.

Pkg.clone("https://github.com/cstook/FTD2XX.jl.git")

The julia documentation section on installing unregistered packages provides more information.

UART quick start

The UART may be accessed as type IOftuart <: IO

get information about devices

device_infomation_list = ft_getdeviceinfolist()

open a device.

io = open(FT_SerialNumber("FTXRNZUJ"),9600,8,1,"n") # open by serial number

or

io = open(FT_Description("C232HM-EDHSL-0"),9600,8,1,"n") # open by description

or

io = open(FT_Location(0x000001a2),9600,8,1,"n") # open by location

or

io = open(FT_DeviceIndex(0),9600,8,1,"n") # open by device index

or

uartconfig = UARTConfiguration(9600,8,1,"n",
                               readtimeout = 1000,        # in milliseconds
                               writetimeout = 1000,        # in milliseconds
                               flowcontrol = "none",    # none, rts_cts, dtr_dsr, xon_xoff
                               xon = 0x11,
                               xoff = 0x13)
io = open(FT_DeviceIndex(0),uartconfig)

use all the normal IO functions

write(io, 0x55)
byteread = read(io, UInt8)

close the device

close(io)

Documentation

API for this wrapper

FTDI website

D2XX Programmer's Guide (from FTDI)

OS Compatibility

FTD2XX.jl is compatible with windows, linux, and osx. See FTDI's installation guides for instructions on installing drivers for your operating system. Drivers are assumed to be installed in the default locations.

Additional Information for Linux

To Do

I2C as an array.

SPI, JTAG as readdata = writeread(datatowrite)

Download Details:

Author: cstook
Source Code: https://github.com/cstook/FTD2XX.jl 
License: View license

#julia #wrapper 

Create Password Protected Webpage Using PHP, HTML And CSS

In this tutorial we will show you how to create password protected webpage using PHP, HTML and CSS.
In this user have to write correct password to see the webpage content without password user will not be able to see the webpage content.

To Create Password Protected webpage It Takes Only Two Steps:-

  1. Make a PHP file and define markup
  2. Make a CSS file and define styling

Step 1. Make a PHP file and define markup

We make a PHP file and save it with a name password.php

<?php
session_start();

if(isset($_POST['submit_pass']) && $_POST['pass'])
{
 $pass=$_POST['pass'];
 if($pass=="123")
 {
  $_SESSION['password']=$pass;
 }
 else
 {
  $error="Incorrect Pssword";
 }
}

if(isset($_POST['page_logout']))
{
 unset($_SESSION['password']);
}
?>

<html>
<head>
<link rel="stylesheet" type="text/css" href="password_style.css">
</head>
<body>
<div id="wrapper">

<?php
if($_SESSION['password']=="123")
{
 ?>
 <h1>Create Password Protected Webpage Using PHP, HTML And CSS</h1>
 <form method="post" action="" id="logout_form">
  <input type="submit" name="page_logout" value="LOGOUT">
 </form>
 <?php
}
else
{
 ?>
 <form method="post" action="" id="login_form">
  <h1>LOGIN TO PROCEED</h1>
  <input type="password" name="pass" placeholder="*******">
  <input type="submit" name="submit_pass" value="DO SUBMIT">
  <p>"Password : 123"</p>
  <p><font style="color:red;"><?php echo $error;?></font></p>
 </form>
 <?php	
}
?>

</div>
</body>
</html>

In this step we first check if user logged in or not by checking session variable if the user is not logged in we display login form and if user is logged in we display webpage content with logout button.

We use two isset() condition to do login or logout.In first condition we simply get the password and check if the password is '123' if yes we put the password in session variable and then display the webpage.

In second condition we simply unset the session variable which stores password value. You may also like simple http authentication using PHP .

Step 2. Make a CSS file and define styling

We make a CSS file and save it with a name password_style.css

body
{
 margin:0 auto;
 padding:0px;
 text-align:center;
 width:100%;
 font-family: "Myriad Pro","Helvetica Neue",Helvetica,Arial,Sans-Serif;
 background-color:#8A4B08;
}
#wrapper
{
 margin:0 auto;
 padding:0px;
 text-align:center;
 width:995px;
}
#wrapper h1
{
 margin-top:50px;
 font-size:45px;
 color:white;
}
#wrapper p
{
 font-size:16px;
}
#logout_form input[type="submit"]
{
 width:250px;
 margin-top:10px;
 height:40px;
 font-size:16px;
 background:none;
 border:2px solid white;
 color:white;
}
#login_form
{
 margin-top:200px;
 background-color:white;
 width:350px;
 margin-left:310px;
 padding:20px;
 box-sizing:border-box;
 box-shadow:0px 0px 10px 0px #3B240B;
}
#login_form h1
{
 margin:0px;
 font-size:25px;
 color:#8A4B08;
}
#login_form input[type="password"]
{
 width:250px;
 margin-top:10px;
 height:40px;
 padding-left:10px;
 font-size:16px;
}
#login_form input[type="submit"]
{
 width:250px;
 margin-top:10px;
 height:40px;
 font-size:16px;
 background-color:#8A4B08;
 border:none;
 box-shadow:0px 4px 0px 0px #61380B;
 color:white;
 border-radius:3px;
}
#login_form p
{
 margin:0px;
 margin-top:15px;
 color:#8A4B08;
 font-size:17px;
 font-weight:bold;
}
Brandon  Adams

Brandon Adams

1625629740

What is a Library? Using Libraries in Code Tutorial | C Library Examples

In this tutorial, we’ll be talking about what a library is and how they are useful. We will be looking at some examples in C, including the C Standard I/O Library and the C Standard Math Library, but these concepts can be applied to many different languages. Thank you for watching and happy coding!

Need some new tech gadgets or a new charger? Buy from my Amazon Storefront https://www.amazon.com/shop/blondiebytes

Also check out…
What is a Framework? https://youtu.be/HXqBlAywTjU
What is a JSON Object? https://youtu.be/nlYiOcMNzyQ
What is an API? https://youtu.be/T74OdSCBJfw
What are API Keys? https://youtu.be/1yFggyk--Zo
Using APIs with Postman https://youtu.be/0LFKxiATLNQ

Check out my courses on LinkedIn Learning!
REFERRAL CODE: https://linkedin-learning.pxf.io/blondiebytes
https://www.linkedin.com/learning/instructors/kathryn-hodge

Support me on Patreon!
https://www.patreon.com/blondiebytes

Check out my Python Basics course on Highbrow!
https://gohighbrow.com/portfolio/python-basics/

Check out behind-the-scenes and more tech tips on my Instagram!
https://instagram.com/blondiebytes/

Free HACKATHON MODE playlist:
https://open.spotify.com/user/12124758083/playlist/6cuse5033woPHT2wf9NdDa?si=VFe9mYuGSP6SUoj8JBYuwg

MY FAVORITE THINGS:
Stitch Fix Invite Code: https://www.stitchfix.com/referral/10013108?sod=w&som=c
FabFitFun Invite Code: http://xo.fff.me/h9-GH
Uber Invite Code: kathrynh1277ue
Postmates Invite Code: 7373F
SoulCycle Invite Code: https://www.soul-cycle.com/r/WY3DlxF0/
Rent The Runway: https://rtr.app.link/e/rfHlXRUZuO

Want to BINGE?? Check out these playlists…

Quick Code Tutorials: https://www.youtube.com/watch?v=4K4QhIAfGKY&index=1&list=PLcLMSci1ZoPu9ryGJvDDuunVMjwKhDpkB

Command Line: https://www.youtube.com/watch?v=Jm8-UFf8IMg&index=1&list=PLcLMSci1ZoPvbvAIn_tuSzMgF1c7VVJ6e

30 Days of Code: https://www.youtube.com/watch?v=K5WxmFfIWbo&index=2&list=PLcLMSci1ZoPs6jV0O3LBJwChjRon3lE1F

Intermediate Web Dev Tutorials: https://www.youtube.com/watch?v=LFa9fnQGb3g&index=1&list=PLcLMSci1ZoPubx8doMzttR2ROIl4uzQbK

GitHub | https://github.com/blondiebytes

Twitter | https://twitter.com/blondiebytes

LinkedIn | https://www.linkedin.com/in/blondiebytes

#blondiebytes #c library #code tutorial #library

LibHealpix.jl: A Julia Wrapper Of The Healpix Library

LibHealpix.jl

LibHealpix.jl is a Julia wrapper of the Healpix library.

The Healpix library defines a pixelization of the sphere that is equal-area (each pixel covers the same area as every other pixel) and isolatitude (pixels are arranged along rings of constant latitude). Healpix was born from the need to rapidly compute angular power spectra for Cosmic Microwave Background experiments (ie. WMAP and Planck) and is widely used in astronomy and astrophysics.

Installation

Pkg.add("LibHealpix")

Examples

OVRO-LWA Sky Map

Dust Map

Halpha Map

Documentation: http://mweastwood.info/LibHealpix.jl/stable/

Download Details:

Author: mweastwood
Source Code: https://github.com/mweastwood/LibHealpix.jl 
License: View license

#julia #wrapper #astronomy 

PETSc.jl: Julia Wrappers for Petsc Library

PETSc

This package provides a high level interface for PETSc, enabling the use of PETSc as an AbstractArray. A low level interface is also available in the submodule PETSc.C.

This package requires the MPI.jl package be installed. Once it is installed you should be able to run both Julia and Petsc in parallel using MPI for all communication. The testing verifies that PETSc can be used both serially and in parallel.

To use the package, simply put using PETSc at the top of your Julia source file. The module exports the names of all the functions, as well as the PETSc data type aliases and constants such as PETSC_DECIDE.

In general, it is possible to run PETSc in parallel. To do so with 4 processors, do:

mpirun -np 4 julia ./name_of_file

Note that this launches 4 independent Julia processes. They are not aware of each other using Julia's built-in parallelism, and MPI is used for all communications.

To run in serial, do:

julia ./name_of_file

Even when running serially, the MPI.jl package must be installed.

An example of using a Krylov subspace method to solve a linear system is in test/test_ksp.jl, which solves a simple system with a Krylov subspace method and compares the result with a direct solve using Julia's backslash operator. This works in serial and in parallel. It requires some variables declared at the top of runtests.jl to work.

To do:

  • Make the script for building PETSc more flexible, e.g. allowing more configuration options like building BLAS or LAPCK, while ensure it remains completely autonomous (needed for Travis testing)
  • Wrap more KSP functions

Status

Vector

The AbstractArray for PetscVec is implemented. Some additional PETSc BLAS functions are wrapped as well.

Matrix

The AbstractArray interface for PetscMat is implemented. Preallocation is supported through optional keyword arguments to the matrix constructor or the setpreallocation function. It possible to set multiple values in the matrix without intermediate assembly using the assemble function or by setting the Mat object field assembling to false and calling setindex repeatedly.

KSP

Just enough KSP functions are implimented to do a GMRES solve. Adding more functionality is the current priority.

Directory Structure

/src : source files. PETSc.jl is the main file containing initialization, with the functions for each type of Petsc object in its own file. All constants are declared in petsc_constants.jl.

/src/generated: auto generated wrappers from Clang.jl. Not directly useful, but easy to modify to make useful

/test : contains runtest.jl, which does some setup and runs all tests on all three version of Petsc currently supported. Tests for each type of Petsc object (mirroring the files in /src) are contained in separate files.

/deps : builds Petsc if needed. See description below

Building PETSc

Building the package will build build the 3 versions of PETSc in the /deps directory, and writes the file lib_locations.jl to the /src/generated directory to tell the package the location of the libraries. Note that this builds the debug versions of PETSc, which are recommended to use for all development. If you wish to do high performance computations, you should build the optimized versions of the library. See the PETSc website for details.

Installing MPI.jl

This package requires MPI.jl, although it is not listed in the REQUIRE file because that would download the release version of MPI.jl, which does not work. Instead, you must use the master branch. After you have an MPI implementation installed, Pkg.build("Petsc") will install it and then PETSc, according to the description above. If you wish to install it manually, do:

  Pkg.clone("MPI")
  Pkg.build("MPI")

Auto Generation Notes

PETSc uses preprocessor variables to decide what code to include when compiling the library. Clang does not know what preprocessor variables were defined at compile time, so it does not correctly detect the typealiases PetscScalar, PetscReal, etc. To correctly autogenerate wrappers, the proper variables must be passed to Clang with the -D switch. Note that users will not need to generate their own wrappers because they have already been generated and commit to the repo.

Download Details:

Author: Stevengj
Source Code: https://github.com/stevengj/PETSc.jl 
License: View license

#julia #wrapper