Edward Lance Lorilla |
- 【VUE JS】Upload and Preview PDF
- 【VISUAL VB NET】Internet Properties
- 【FLUTTER ANDROID STUDIO and IOS】Remove all multiple checked checkbox items
- 【VISUAL VB NET】Safely Remove Hardware
- 【PYTHON OPENCV】Saving a linear regression model using SavedModelBuilder in TensorFlow
- 【VISUAL VB NET】Total Physical Memory
- 【GAMEMAKER】Player Directions
- 【VISUAL VB NET】Threads
- 【FLUTTER ANDROID STUDIO and IOS】circular menu
- 【FLUTTER ANDROID STUDIO and IOS】Dinner Chooser
- 【JAVASCRIPT】Integration Stripe checking out with the payment request API
- 【JAVASCRIPT】draw graph an equation or graphing calculator
- 【VISUAL VB NET】System Font
- 【PYTHON OPENCV】Testing a linear regression model using TensorFlow
- 【GAMEMAKER】Get Color
- 【PYTHON OPENCV】Training a linear regression model using TensorFlow
- 【VISUAL VB NET】Source Code from URL or website
- 【VISUAL VB NET】Delete or Clear Cookies
- 【FLUTTER ANDROID STUDIO and IOS】checked and unchecked all checkbox
- 【GAMEMAKER】Bomb
- 【FLUTTER ANDROID STUDIO and IOS】filter an array object by checking multiple values
- 【FLUTTER ANDROID STUDIO and IOS】Snapshot like AR face filter
- 【PYTHON OPENCV】Basic Operations example using TensorFlow library creating scopes
- 【VISUAL VB NET】Shell About Dialog
- 【JAVASCRIPT】seamless carousel
【VUE JS】Upload and Preview PDF Posted: 10 May 2021 09:16 AM PDT |
【VISUAL VB NET】Internet Properties Posted: 10 May 2021 09:13 AM PDT Public Class Form1 Dim cmdProcess As Process = New Process() Dim fileArgs As String Dim path As String = "C:\Windows\System32\" Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click fileArgs = "Shell32.dll,Control_RunDLL Inetcpl.cpl,,6" cmdProcess.StartInfo.Arguments = fileArgs cmdProcess.StartInfo.WorkingDirectory = path cmdProcess.StartInfo.FileName = "RunDll32.exe" cmdProcess.Start() cmdProcess.WaitForExit() Me.Show() End SubEnd Class |
【FLUTTER ANDROID STUDIO and IOS】Remove all multiple checked checkbox items Posted: 10 May 2021 09:11 AM PDT import "package:flutter/material.dart";void main() => runApp(MyApp());
|
【VISUAL VB NET】Safely Remove Hardware Posted: 10 May 2021 09:09 AM PDT Public Class Form1 Dim cmdProcess As Process = New Process() Dim fileArgs As String Dim path As String = "C:\Windows\System32\" Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click fileArgs = "Shell32.dll,Control_RunDLL HotPlug.dll" cmdProcess.StartInfo.Arguments = fileArgs cmdProcess.StartInfo.WorkingDirectory = path cmdProcess.StartInfo.FileName = "RunDll32.exe" cmdProcess.Start() cmdProcess.WaitForExit() Me.Show() End SubEnd Class |
【PYTHON OPENCV】Saving a linear regression model using SavedModelBuilder in TensorFlow Posted: 10 May 2021 09:06 AM PDT """ Saving a linear regression model using SavedModelBuilder in TensorFlow """ # Import required packages: import numpy as np import tensorflow.compat.v1 as tf tf.disable_v2_behavior() from tensorflow.python.saved_model import signature_constants from tensorflow.python.saved_model import signature_def_utils def export_model(): """Exports the model""" trained_checkpoint_prefix = 'linear_regression' loaded_graph = tf.Graph() with tf.Session(graph=loaded_graph) as sess: sess.run(tf.global_variables_initializer()) # Restore from checkpoint: loader = tf.train.import_meta_graph(trained_checkpoint_prefix + '.meta') loader.restore(sess, trained_checkpoint_prefix) # Add signature: graph = tf.get_default_graph() inputs = tf.saved_model.utils.build_tensor_info(graph.get_tensor_by_name('X:0')) outputs = tf.saved_model.utils.build_tensor_info(graph.get_tensor_by_name('y_model:0')) signature = signature_def_utils.build_signature_def(inputs={'X': inputs}, outputs={'y_model': outputs}, method_name=signature_constants.PREDICT_METHOD_NAME) signature_map = {signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY: signature} # Export model: builder = tf.saved_model.builder.SavedModelBuilder('./model') builder.add_meta_graph_and_variables(sess, signature_def_map=signature_map,tags=[tf.saved_model.tag_constants.SERVING]) builder.save() # Export the model: export_model() # Define 'M' more points to get the predictions using the trained model: new_x = np.linspace(50 + 1, 50 + 10, 3) with tf.Session(graph=tf.Graph()) as sess: tf.saved_model.loader.load(sess, [tf.saved_model.tag_constants.SERVING], './my_model') graph = tf.get_default_graph() x = graph.get_tensor_by_name('X:0') model = graph.get_tensor_by_name('y_model:0') print(sess.run(model, {x: new_x})) |
【VISUAL VB NET】Total Physical Memory Posted: 10 May 2021 09:04 AM PDT Public Class Form1 Private Shared Function GetTotalPhysicalMemory() As ULong Return New Microsoft.VisualBasic.Devices.ComputerInfo().TotalPhysicalMemory End Function Private Shared Function ConvertBytesToMegabytes(bytes As Long) As Long Return (bytes \ 1024) \ 1024 End Function Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click MessageBox.Show(ConvertBytesToMegabytes(CLng(GetTotalPhysicalMemory())).ToString() & " MB") End SubEnd Class |
Posted: 10 May 2021 09:02 AM PDT Information about object: objPlayer Sprite: sprStand Solid: false Visible: true Depth: 0 Persistent: false Parent: Children: Mask: No Physics Object Create Event: set variable ShotTimer to 0 set variable BulletType to 6 Step Event: execute code: set variable ShotTimer relative to -1 Collision Event with object objBullet2: play sound sound0; looping: false create instance of object objExplode at relative position (0,0) for all objRestartRoom: set variable restart to true destroy the instance Keyboard Event for <Alt> Key: if expression ShotTimer<0 is true create instance of object objOtherBullet at relative position (0,0) set variable ShotTimer to 5 Keyboard Event for <Space> Key: if expression ShotTimer<0 is true create instance of object objBullet at relative position (0,0) set variable ShotTimer to 25 Key Press Event for X-key Key: set Alarm 0 to 30 Information about object: objPlayer2 |
Posted: 09 May 2021 08:52 AM PDT Imports System.Threading Public Class Form1 Public Sub first_thread_procedure() Thread.Sleep(500) MessageBox.Show("Hello from first thread :) ... ") End Sub Public Sub second_thread_procedure() Thread.Sleep(1000) MessageBox.Show("Hello from second thread :) ... ") End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim first_thread As New Thread(New ThreadStart(AddressOf first_thread_procedure)) Dim second_thread As New Thread(New ThreadStart(AddressOf second_thread_procedure)) first_thread.Start() second_thread.Start() first_thread.Join() End SubEnd Class |
【FLUTTER ANDROID STUDIO and IOS】circular menu Posted: 09 May 2021 08:51 AM PDT import 'package:flutter/material.dart'; import 'package:circular_menu/circular_menu.dart'; |
【FLUTTER ANDROID STUDIO and IOS】Dinner Chooser Posted: 09 May 2021 08:50 AM PDT import 'package:flutter/material.dart'; |
【JAVASCRIPT】Integration Stripe checking out with the payment request API Posted: 09 May 2021 08:47 AM PDT |
【JAVASCRIPT】draw graph an equation or graphing calculator Posted: 09 May 2021 08:46 AM PDT |
Posted: 09 May 2021 08:45 AM PDT Imports System Imports 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 Imports System.Runtime.InteropServices Public Class Form1 <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)> _ Public Class LOGFONT Public lfHeight As Integer = 0 Public lfWidth As Integer = 0 Public lfEscapement As Integer = 0 Public lfOrientation As Integer = 0 Public lfWeight As Integer = 0 Public lfItalic As Byte = 0 Public lfUnderline As Byte = 0 Public lfStrikeOut As Byte = 0 Public lfCharSet As Byte = 0 Public lfOutPrecision As Byte = 0 Public lfClipPrecision As Byte = 0 Public lfQuality As Byte = 0 Public lfPitchAndFamily As Byte = 0 <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=32)> _ Public lfFaceName As String = String.Empty End Class Public Sub New() MyBase.New() InitializeComponent() End Sub Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click For Each font As FontFamily In FontFamily.Families listBox1.Items.Add(font.Name) Next End SubEnd Class |
【PYTHON OPENCV】Testing a linear regression model using TensorFlow Posted: 09 May 2021 08:43 AM PDT """ Testing a linear regression model using TensorFlow """ # Import required packages:import numpy as npimport tensorflow as tfimport matplotlib.pyplot as plt # Number of points:N = 50 # Make random numbers predictable:np.random.seed(101)tf.set_random_seed(101) # Generate random data composed by 50 (N = 50) points:x = np.linspace(0, N, N)y = 3 * np.linspace(0, N, N) + np.random.uniform(-10, 10, N) # Number of points to predict:M = 3 # Define 'M' more points to get the predictions using the trained model:new_x = np.linspace(N + 1, N + 10, M) # Restore the model.# First step when loading a model is to load the graph from '.meta':tf.reset_default_graph()imported_meta = tf.train.import_meta_graph("linear_regression.meta") # The second step when loading a model is to load the values of the variables:# Note that values only exist within a sessionwith tf.Session() as sess: imported_meta.restore(sess, './linear_regression') # Run the model to get the values of the variables W, b and new prediction values: W_estimated = sess.run('W:0') b_estimated = sess.run('b:0') new_predictions = sess.run(['y_model:0'], {'X:0': new_x}) # Reshape for proper visualization:new_predictions = np.reshape(new_predictions, (M, -1)) # Calculate the predictions:predictions = W_estimated * x + b_estimated # Create the dimensions of the figure and set title:fig = plt.figure(figsize=(12, 5))plt.suptitle("Linear regression using TensorFlow", fontsize=14, fontweight='bold')fig.patch.set_facecolor('silver') # Plot training data:plt.subplot(1, 3, 1)plt.plot(x, y, 'ro', label='Original data')plt.xlabel('x')plt.ylabel('y')plt.title("Training Data")plt.legend() # Plot results:plt.subplot(1, 3, 2)plt.plot(x, y, 'ro', label='Original data')plt.plot(x, predictions, label='Fitted line')plt.xlabel('x')plt.ylabel('y')plt.title('Linear Regression Result')plt.legend() # Plot new predicted data:plt.subplot(1, 3, 3)plt.plot(x, y, 'ro', label='Original data')plt.plot(x, predictions, label='Fitted line')plt.plot(new_x, new_predictions, 'bo', label='New predicted data')plt.xlabel('x')plt.ylabel('y')plt.title('Predicting new points')plt.legend() # Show the Figure:plt.show() |
Posted: 09 May 2021 08:40 AM PDT Information about object: objController Sprite: sprController Solid: false Visible: true Depth: 0 Persistent: false Parent: Children: Mask: No Physics Object Create Event: set variable Color to 0 Step Event: execute code: Draw Event: execute code: Information about object: objColorBar |
【PYTHON OPENCV】Training a linear regression model using TensorFlow Posted: 08 May 2021 09:42 AM PDT """ Training a linear regression model using TensorFlow """ # Import required packages:import numpy as npimport tensorflow as tfimport matplotlib.pyplot as plt # Path to the folder that we want to save the logs for Tensorboard:logs_path = "./logs"# Number of points:N = 50 # Make random numbers predictable:np.random.seed(101)tf.set_random_seed(101) # Generate random data composed by 50 (N = 50) points:x = np.linspace(0, N, N)y = 3 * np.linspace(0, N, N) + np.random.uniform(-10, 10, N) # You can check the shape of the created training data:print(x.shape)print(y.shape) # Create the placeholders in order to feed our training examples into the optimizer while training:X = tf.placeholder("float", name='X')Y = tf.placeholder("float", name='Y') # Declare two trainable TensorFlow Variables for the Weights and Bias# We are going to initialize them randomly. Another way can be to set '0.0':W = tf.Variable(np.random.randn(), name="W")b = tf.Variable(np.random.randn(), name="b") # Define the hyperparameters of the model:learning_rate = 0.01training_epochs = 1000 # This will be used to show results after every 25 epochs:disp_step = 100 # Construct a linear model:y_model = tf.add(tf.multiply(X, W), b, name="y_model") # Define cost function, in this case, the Mean squared error# (Note that other cost functions can be defined)cost = tf.reduce_sum(tf.pow(y_model - Y, 2)) / (2 * N) # Create the gradient descent optimizer that is going to minimize the cost function modifying the# values of the variables W and b:optimizer = tf.train.GradientDescentOptimizer(learning_rate).minimize(cost) # Initialize all variables:init = tf.global_variables_initializer() # Create a Saver object:saver = tf.train.Saver() # Start the training procedure inside a TensorFlow Session:with tf.Session() as sess: # Run the initializer: sess.run(init) # Uncomment if you want to see the created graph # summary_writer = tf.summary.FileWriter(logs_path, sess.graph) # Iterate over all defined epochs: for epoch in range(training_epochs): # Feed each training data point into the optimizer: for (_x, _y) in zip(x, y): sess.run(optimizer, feed_dict={X: _x, Y: _y}) # Display the results every 'display_step' epochs: if (epoch + 1) % disp_step == 0: # Calculate the actual cost, W and b: c = sess.run(cost, feed_dict={X: x, Y: y}) w_est = sess.run(W) b_est = sess.run(b) print("epoch {}: cost = {} W = {} b = {}".format(epoch + 1, c, w_est, b_est)) # Save the final model saver.save(sess, './linear_regression') # Storing necessary values to be used outside the session training_cost = sess.run(cost, feed_dict={X: x, Y: y}) weight = sess.run(W) bias = sess.run(b) print("Training finished!") # Calculate the predictions:predictions = weight * x + bias # Create the dimensions of the figure and set title:fig = plt.figure(figsize=(8, 5))plt.suptitle("Linear regression using TensorFlow", fontsize=14, fontweight='bold')fig.patch.set_facecolor('silver') # Plot training data:plt.subplot(1, 2, 1)plt.plot(x, y, 'ro', label='Original data')plt.xlabel('x')plt.ylabel('y')plt.title("Training Data") # Plot results:plt.subplot(1, 2, 2)plt.plot(x, y, 'ro', label='Original data')plt.plot(x, predictions, label='Fitted line')plt.xlabel('x')plt.ylabel('y')plt.title('Linear Regression Result')plt.legend() # Show the Figure:plt.show() |
【VISUAL VB NET】Source Code from URL or website Posted: 08 May 2021 09:40 AM PDT Imports System Imports 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 ' make sure that using System.Net; is included Imports System.Net ' make sure that using System.IO; is included Imports System.IO Public Class Form1 Public Sub New() MyBase.New() InitializeComponent() End Sub Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click Dim Url As String = textBox2.Text Dim Request As HttpWebRequest = DirectCast(WebRequest.Create(Url), HttpWebRequest) Dim Response As HttpWebResponse = DirectCast(Request.GetResponse(), HttpWebResponse) Dim Stream As New StreamReader(Response.GetResponseStream()) richTextBox1.Text = Stream.ReadToEnd() Stream.Close() End SubEnd Class |
【VISUAL VB NET】Delete or Clear Cookies Posted: 08 May 2021 09:38 AM PDT Public Class Form1 Dim ans As String Dim cmdProcess As Process = New Process() Dim fileArgs As String Dim path As String = "C:\Windows\System32\" Private Sub Form1_Load(sender As Object, e As EventArgs) End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ans = CStr(MsgBox("Are you sure you want to delete these files?", MsgBoxStyle.YesNo, "Ready to Delete Files?")) If CDbl(ans) = vbYes Then fileArgs = "InetCpl.cpl,ClearMyTracksByProcess 8" cmdProcess.StartInfo.Arguments = fileArgs cmdProcess.StartInfo.WorkingDirectory = path cmdProcess.StartInfo.FileName = "RunDll32.exe" cmdProcess.Start() cmdProcess.WaitForExit() Me.Show() Else MessageBox.Show("Process Cancelled!") Exit Sub End If End SubEnd Class |
【FLUTTER ANDROID STUDIO and IOS】checked and unchecked all checkbox Posted: 08 May 2021 09:37 AM PDT import "package:flutter/material.dart"; void main() => runApp(MyApp()); |
Posted: 07 May 2021 09:10 AM PDT Information about object: objPlayer Sprite: sprStand Solid: false Visible: true Depth: -10 Persistent: false Parent: Children: Mask: sprStand No Physics Object Create Event: set variable sprite to sprStand set variable BombNumber to 0 set variable DetonateNumber to 0 set variable ShotTimer to 0 Step Event: execute code: set variable ShotTimer relative to -1 Keyboard Event for <Space> Key: execute code: Keyboard Event for D-key Key: execute code: } Sprite: sprBomb Solid: false Visible: true Depth: 0 Persistent: false Parent: Children: Mask: No Physics Object Sprite: sprExplode Solid: false Visible: true Depth: 0 Persistent: false Parent: Children: Mask: No Physics Object Collision Event with object objBomb: for other object: change the instance into object objExplode, not performing events Other Event: Animation End: destroy the instance Sprite: sprDud Solid: false Visible: true Depth: 0 Persistent: false Parent: Children: Mask: No Physics Object Other Event: Animation End: destroy the instance |
【FLUTTER ANDROID STUDIO and IOS】filter an array object by checking multiple values Posted: 07 May 2021 09:07 AM PDT
|
【FLUTTER ANDROID STUDIO and IOS】Snapshot like AR face filter Posted: 07 May 2021 09:04 AM PDT import 'package:flutter/material.dart'; import 'package:camera_deep_ar/camera_deep_ar.dart';
|
【PYTHON OPENCV】Basic Operations example using TensorFlow library creating scopes Posted: 07 May 2021 09:03 AM PDT """ Basic Operations example using TensorFlow library creating scopes """ # Import required packages:import tensorflow as tf # Path to the folder that we want to save the logs for Tensorboard:logs_path = "./logs" # Define placeholders:X_1 = tf.placeholder(tf.int16, name="X_1")X_2 = tf.placeholder(tf.int16, name="X_2") # Define two operations encapsulating the operations into a scope making# the Tensorboard's Graph visualization more convenient:with tf.name_scope('Operations'): addition = tf.add(X_1, X_2, name="my_addition") multiply = tf.multiply(X_1, X_2, name="my_multiplication") # Start the session and run the operations with different inputs:with tf.Session() as sess: summary_writer = tf.summary.FileWriter(logs_path, sess.graph) # Perform some multiplications: print("2 x 3 = {}".format(sess.run(multiply, feed_dict={X_1: 2, X_2: 3}))) print("[2, 3] x [3, 4] = {}".format(sess.run(multiply, feed_dict={X_1: [2, 3], X_2: [3, 4]}))) # Perform some additions: print("2 + 3 = {}".format(sess.run(addition, feed_dict={X_1: 2, X_2: 3}))) print("[2, 3] + [3, 4] = {}".format(sess.run(addition, feed_dict={X_1: [2, 3], X_2: [3, 4]}))) |
【VISUAL VB NET】Shell About Dialog Posted: 07 May 2021 08:48 AM PDT Imports System Imports 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 ' make sure that using System.Runtime.InteropServices; is included Imports System.Runtime.InteropServices' make sure that using System.Reflection; is included Imports System.Reflection Public Class Form1 <DllImport("shell32.dll")> _ Private Shared Function ShellAbout(hWnd As IntPtr, szApp As String, szOtherStuff As String, hIcon As IntPtr) As Integer End Function Public Sub New() MyBase.New() InitializeComponent() End Sub Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click ShellAbout(Me.Handle, "AppName " & Assembly.GetExecutingAssembly().GetName().Version.ToString(), "", IntPtr.Zero) End SubEnd Class |
Posted: 07 May 2021 08:46 AM PDT |
You are subscribed to email updates from Edward Lance Lorilla. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment