Monday, April 19, 2021

Edward Lance Lorilla

Edward Lance Lorilla


【VUEJS】 CRUD browser's local cache

Posted: 19 Apr 2021 03:04 AM PDT

【PYTHON OPENCV】face_recognition library to calculate the 128D descriptor to be used for face recognition

Posted: 18 Apr 2021 09:28 AM PDT

 """

This script makes used of face_recognition library to calculate the 128D descriptor to be used for face recognition. """ # Import required packages:import face_recognitionimport cv2 # Load image:image = cv2.imread("jared_1.jpg") # Convert image from BGR (OpenCV format) to RGB (face_recognition format):image = image[:, :, ::-1] # Calculate the encodings for every face of the image:encodings = face_recognition.face_encodings(image) # Show the first encoding:print(encodings[0])

【FLUTTER ANDROID STUDIO and IOS】wave slider

Posted: 18 Apr 2021 08:58 AM PDT

 import 'package:flutter/material.dart';

import 'package:wave_slider/wave_slider.dart';
void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: SliderDemo(),
);
}
}
class SliderDemo extends StatefulWidget {
@override
_SliderDemoState createState() => _SliderDemoState();
}

class _SliderDemoState extends State<SliderDemo> {
double _dragValue = 0;

@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.brown[50],
appBar: AppBar(
title: Text("Flutter Wave Slider Demo"),
automaticallyImplyLeading: false,
),
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
WaveSlider(
color: Colors.teal,
sliderHeight: 70,
displayTrackball: true,
onChanged: (double dragUpdate) {
setState(() {
_dragValue = dragUpdate * 150;
});
},
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Drag Value',
style: TextStyle(fontSize: 20,
fontWeight: FontWeight.bold,
color: Colors.black),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'$_dragValue',
style: TextStyle(fontSize: 16,
color: Colors.red,),
),
)
],
),
);
}
}

【VISUAL VB.NET】IP Address

Posted: 18 Apr 2021 08:49 AM PDT

Imports SystemImports System.Collections.GenericImports System.ComponentModelImports System.DataImports System.DrawingImports System.LinqImports System.TextImports System.Threading.TasksImports System.Windows.Forms' make sure that using System.Diagnostics; is included Imports System.Diagnostics' make sure that using System.Security.Principal; is included Imports System.Security.Principal ' need namespace System.Net; Imports System.Net' need namespace System.IO; Imports System.IO' need namespace System.Net.Sockets; Imports System.Net.Sockets Public Class Form1 Public Sub New() MyBase.New() InitializeComponent() listBox1.Items.Add(LocalIPAddress().ToString()) label2.Text = GetPublicIP().ToString() End Sub Public Function LocalIPAddress() As String Dim host As IPHostEntry Dim localIP As String = "" host = Dns.GetHostEntry(Dns.GetHostName()) For Each ip As IPAddress In host.AddressList If ip.AddressFamily = AddressFamily.InterNetwork Then localIP = ip.ToString() Exit For End If Next Return localIP End Function Public Function GetPublicIP() As String Dim direction As [String] = "" Dim request As WebRequest = WebRequest.Create("http://checkip.dyndns.org/") Using response As WebResponse = request.GetResponse() Using stream As New StreamReader(response.GetResponseStream()) direction = stream.ReadToEnd() End Using End Using 'Search for the ip in the html Dim first As Integer = direction.IndexOf("Address: ") + 9 Dim last As Integer = direction.LastIndexOf("</body>") direction = direction.Substring(first, last - first) Return direction End Function #Region "basic function for app" Private Sub lblLink_Click_1(sender As Object, e As EventArgs) Handles lblLink.Click Process.Start("www.vclexamples.com") End Sub Protected Overrides Function ProcessCmdKey(ByRef msg As Message, ByVal keyData As Keys) As Boolean If (keyData = Keys.Escape) Then Me.Close() Return True End If Return MyBase.ProcessCmdKey(msg, keyData) End Function#End Region End Class

No comments:

Post a Comment