Quick introduction to Spring Framework. Following are the topics I have included in this presentations:
1. Introduction to Software Framework
2. What is Spring Framework?
3. Spring Framework History
4. Spring Framework Architecture
5. Why Spring?
6. Spring Framework Ecosystem
Maven is a build tool that helps manage Java projects and automates common tasks like compiling code, running tests, and managing dependencies. It uses a Project Object Model (POM) XML file to store build configuration which defines project dependencies, plugins, and other metadata. Maven standardizes project layout, builds, documentation, and the release process.
This document provides an introduction and overview of using SoapUI for testing web services. It begins with background on XML, SOAP, REST, and WSDL. It then demonstrates how to create a SoapUI project from a WSDL, view and submit sample requests and responses, validate requests, and create multiple test cases. The document provides guidance on project structure, endpoints, properties, and navigating the SoapUI interface. Finally, it includes an exercise to create test cases for a weather web service.
The document discusses Spring Boot, a framework from the Spring Team that aims to ease the bootstrapping and development of new Spring applications. Spring Boot allows applications to start quickly with very little Spring configuration. It provides some sensible defaults to help developers get started quickly on new projects.
This document contains information about the sys/net/sec admin Yashar Esmaildokht, including their contact information and websites. It then provides a brief overview of the open-source automation tool Ansible, describing its main features and uses for configuration management, application deployment, and cloud provisioning. Requirements and versions of Ansible are listed. The document concludes with examples of Ansible concepts including playbooks, tasks, modules, variables, and host inventory organization.
Quick introduction to Spring Framework. Following are the topics I have included in this presentations:
1. Introduction to Software Framework
2. What is Spring Framework?
3. Spring Framework History
4. Spring Framework Architecture
5. Why Spring?
6. Spring Framework Ecosystem
Maven is a build tool that helps manage Java projects and automates common tasks like compiling code, running tests, and managing dependencies. It uses a Project Object Model (POM) XML file to store build configuration which defines project dependencies, plugins, and other metadata. Maven standardizes project layout, builds, documentation, and the release process.
This document provides an introduction and overview of using SoapUI for testing web services. It begins with background on XML, SOAP, REST, and WSDL. It then demonstrates how to create a SoapUI project from a WSDL, view and submit sample requests and responses, validate requests, and create multiple test cases. The document provides guidance on project structure, endpoints, properties, and navigating the SoapUI interface. Finally, it includes an exercise to create test cases for a weather web service.
The document discusses Spring Boot, a framework from the Spring Team that aims to ease the bootstrapping and development of new Spring applications. Spring Boot allows applications to start quickly with very little Spring configuration. It provides some sensible defaults to help developers get started quickly on new projects.
This document contains information about the sys/net/sec admin Yashar Esmaildokht, including their contact information and websites. It then provides a brief overview of the open-source automation tool Ansible, describing its main features and uses for configuration management, application deployment, and cloud provisioning. Requirements and versions of Ansible are listed. The document concludes with examples of Ansible concepts including playbooks, tasks, modules, variables, and host inventory organization.
A quick introduction about everything that's new in Java 11. Includes API changes, language changes and new tools in the JDK.
Demo's for this presentation can be found here: https://github.com/MichelSchudel/java11demo
Everything you need to know about GraalVM Native ImageAlina Yurenko
GraalVM Native Image allows compiling Java programs into standalone native executables. It performs static analysis to identify all reachable code from the entry point. This results in instant startup times, low memory footprints, and is well-suited for cloud deployments. Native Image builds applications ahead-of-time during the build process, resulting in optimized machine code and no just-in-time compilation overhead at runtime. Reflection must be configured explicitly. Native Images provide benefits such as reduced memory usage compared to the JVM and increased security due to the static nature of the compiled application.
Bytecode Manipulation with a Java Agent and Byte BuddyKoichi Sakata
Oracle Code One 2018, Birds of a Feather (BOF) Session
Bytecode Manipulation with a Java Agent and Byte Buddy
[BOF5314]
Tuesday, Oct 23, 07:30 PM - 08:15 PM | Moscone West - Room 2005
Have you ever manipulated Java bytecode? There are several bytecode engineering libraries, and Byte Buddy is one of the easiest, and you can also use Java agents, which are related to the Instrumentation class in the java.lang.instrument API. Instrumentation is the addition of bytecode to methods. Because the changes are purely additive, a Java agent does not modify application state or behavior. With Byte Buddy and a Java agent, we can add behaviors to existing classes. This session explains what Java agents and the instrumentation API are, introduces Byte Buddy, and presents sample code that uses a Java agent and Byte Buddy to modify behavior. The presentation will be useful for those who want to start manipulating Java bytecode with Byte Buddy.
The document provides an overview of new features in Java 9, including:
- The introduction of a module system that divides the JDK into smaller modules, allowing applications to only use necessary modules.
- Private methods can now be defined in interfaces to avoid redundant code.
- Multi-release JAR files allow libraries to support multiple Java versions.
- Various commands are described to work with the new module system, such as listing modules, describing modules, compiling modular code, and creating a custom JRE with only required modules.
The document introduces RxJava, a library for composing asynchronous and event-based programs using observable sequences for the Java Virtual Machine. It discusses the problems with asynchronous programming, provides an overview of reactive programming and reactive extensions, and describes RxJava's core types like Observable and Observer. It also covers key concepts like operators, schedulers, subjects, and dealing with backpressure in RxJava.
This document discusses Spring Boot, an open source framework for building microservices and web applications. It provides scaffolding to help build Spring-based services more quickly. The author chose Spring Boot for a project because it integrates well with other frameworks like Jersey and allows building services quickly. Key Spring Boot components discussed include REST frameworks, embedded servers, logging frameworks, security, and metrics. The author outlines their Spring Boot stack and package structure. They discuss using Spring Data for persistence, Swagger for API documentation, and helper libraries like Lombok. The document also covers testing approaches using REST Assured and Spring Integration.
Java performance tuning involves diagnosing and addressing issues like slow application performance and out of memory errors. The document discusses Java performance problems and their solutions, tuning tips, and monitoring tools. Some tips include tuning JVM parameters like heap size, garbage collection settings, and enabling parallel garbage collection for multi-processor systems. Tools mentioned include JConsole, VisualVM, JProfiler, and others for monitoring memory usage, thread activity, and garbage collection.
The document discusses Java compilation and the Java Virtual Machine. It explains that Java code is first compiled to bytecode, then just-in-time compiled by the JVM to native machine code using multiple compilers. The JVM uses a technique called tiered compilation that starts with simple compilation and progresses to more optimized compilation. Tiered compilation aims to provide both fast startup and high performance.
Chapter 1. java programming language overviewJong Soon Bok
This document provides an overview of the Java programming language and environment. It discusses what Java is, its uses as both a programming language and platform, and the key components of the Java platform including the JRE and JDK. It also covers downloading and installing the JDK, configuring the environment, and creating a simple "Hello World" Java program. The document includes many screenshots to illustrate the various steps and configurations.
Projects In Laravel : Learn Laravel Building 10 ProjectsSam Dias
Projects In Laravel : Learn Laravel Building 10 Projects
Learn Laravel 5, top PHP framework, including how to install Laravel 5 framework & fundamentals in this Laravel 5 tutorial. This is why you need something to help you learn a technology quickly and easily! Our course does exactly that!
https://www.eduonix.com/courses/Web-Development/projects-in-laravel-learn-laravel-building-10-projects
This document discusses how the Java Virtual Machine (JVM) can support multiple languages. It describes how language features can be emulated on the JVM through additional layers of indirection. It outlines key features added in JDK 7 like invokedynamic bytecode and method handles to better support dynamic languages on the JVM by reducing overhead from emulation. The document argues that the JVM should optimize for non-Java language features to benefit both Java and other languages running on the platform.
Spring Boot is a framework for creating stand-alone, production-grade Spring based applications that can be "just run". It aims to provide a radically faster and widely accessible starting experience for developing Spring applications. Spring Boot applications can be started using java -jar or traditional WAR deployments and require very little Spring configuration. The document then discusses system requirements, development environment, creating a simple Hello World application, using Spring Boot Admin to monitor applications, configuring databases, Spring Data JPA, REST controllers, caching with EhCache, building web applications with Thymeleaf, and project structure.
This document discusses the Spring framework. It defines framework as software that provides predefined support for application development. Spring is described as an open source, lightweight application framework that uses inversion of control (IOC) and dependency injection (DI). The document outlines the different versions and modules of Spring, including core, DAO, ORM, context, AOP, and web modules. It also discusses Spring architecture, the types of frameworks (invasive and non-invasive), and the resources needed to develop a Spring application.
O documento fornece um resumo sobre o framework Spring, descrevendo:
1) Por que foi criado o Spring para substituir o EJB do Java EE, tornando o desenvolvimento Java mais leve e flexível;
2) Os principais conceitos do Spring como injeção de dependência e gerenciamento de beans;
3) As principais partes do framework Spring e projetos relacionados como Spring Boot, Spring MVC e Spring Data.
1. The document outlines the steps to set up an ODI Agent in Oracle Data Integrator 11g, including editing the odiparams.bat file to set the repository connection information, generating an encrypted password string, and specifying details when creating a new physical agent in the topology.
2. It also describes how to create a corresponding logical agent mapped to the physical agent, and how to start the agent from the command line and test the connection.
3. The key steps are to configure the repository connection details in odiparams.bat, create a new physical agent specifying its name and other properties, then create a linked logical agent to represent it in the logical architecture.
Java 10 contains several new features including local variable type inference using the var keyword, time-based release versioning, improved support for Docker containers, and various library enhancements. It focuses on improving performance and usability. Some notable changes include local variable type inference for concise code, parallel full GC for the G1 collector to reduce latency, and application data sharing to improve startup times.
A house with a solid foundation has to be built on the Rock. God has long been referred to as the Rock. Jesus said that those who hear His words and do them are like building a house on the Rock.
Pastor Elio Marrocco's "Have The Solid Rock Foundation - Philosophers" sermon at New Life Christian Church on January 18, 2013. You can learn more about New Life Christian Church here: http://www.newlifecc.ca
A quick introduction about everything that's new in Java 11. Includes API changes, language changes and new tools in the JDK.
Demo's for this presentation can be found here: https://github.com/MichelSchudel/java11demo
Everything you need to know about GraalVM Native ImageAlina Yurenko
GraalVM Native Image allows compiling Java programs into standalone native executables. It performs static analysis to identify all reachable code from the entry point. This results in instant startup times, low memory footprints, and is well-suited for cloud deployments. Native Image builds applications ahead-of-time during the build process, resulting in optimized machine code and no just-in-time compilation overhead at runtime. Reflection must be configured explicitly. Native Images provide benefits such as reduced memory usage compared to the JVM and increased security due to the static nature of the compiled application.
Bytecode Manipulation with a Java Agent and Byte BuddyKoichi Sakata
Oracle Code One 2018, Birds of a Feather (BOF) Session
Bytecode Manipulation with a Java Agent and Byte Buddy
[BOF5314]
Tuesday, Oct 23, 07:30 PM - 08:15 PM | Moscone West - Room 2005
Have you ever manipulated Java bytecode? There are several bytecode engineering libraries, and Byte Buddy is one of the easiest, and you can also use Java agents, which are related to the Instrumentation class in the java.lang.instrument API. Instrumentation is the addition of bytecode to methods. Because the changes are purely additive, a Java agent does not modify application state or behavior. With Byte Buddy and a Java agent, we can add behaviors to existing classes. This session explains what Java agents and the instrumentation API are, introduces Byte Buddy, and presents sample code that uses a Java agent and Byte Buddy to modify behavior. The presentation will be useful for those who want to start manipulating Java bytecode with Byte Buddy.
The document provides an overview of new features in Java 9, including:
- The introduction of a module system that divides the JDK into smaller modules, allowing applications to only use necessary modules.
- Private methods can now be defined in interfaces to avoid redundant code.
- Multi-release JAR files allow libraries to support multiple Java versions.
- Various commands are described to work with the new module system, such as listing modules, describing modules, compiling modular code, and creating a custom JRE with only required modules.
The document introduces RxJava, a library for composing asynchronous and event-based programs using observable sequences for the Java Virtual Machine. It discusses the problems with asynchronous programming, provides an overview of reactive programming and reactive extensions, and describes RxJava's core types like Observable and Observer. It also covers key concepts like operators, schedulers, subjects, and dealing with backpressure in RxJava.
This document discusses Spring Boot, an open source framework for building microservices and web applications. It provides scaffolding to help build Spring-based services more quickly. The author chose Spring Boot for a project because it integrates well with other frameworks like Jersey and allows building services quickly. Key Spring Boot components discussed include REST frameworks, embedded servers, logging frameworks, security, and metrics. The author outlines their Spring Boot stack and package structure. They discuss using Spring Data for persistence, Swagger for API documentation, and helper libraries like Lombok. The document also covers testing approaches using REST Assured and Spring Integration.
Java performance tuning involves diagnosing and addressing issues like slow application performance and out of memory errors. The document discusses Java performance problems and their solutions, tuning tips, and monitoring tools. Some tips include tuning JVM parameters like heap size, garbage collection settings, and enabling parallel garbage collection for multi-processor systems. Tools mentioned include JConsole, VisualVM, JProfiler, and others for monitoring memory usage, thread activity, and garbage collection.
The document discusses Java compilation and the Java Virtual Machine. It explains that Java code is first compiled to bytecode, then just-in-time compiled by the JVM to native machine code using multiple compilers. The JVM uses a technique called tiered compilation that starts with simple compilation and progresses to more optimized compilation. Tiered compilation aims to provide both fast startup and high performance.
Chapter 1. java programming language overviewJong Soon Bok
This document provides an overview of the Java programming language and environment. It discusses what Java is, its uses as both a programming language and platform, and the key components of the Java platform including the JRE and JDK. It also covers downloading and installing the JDK, configuring the environment, and creating a simple "Hello World" Java program. The document includes many screenshots to illustrate the various steps and configurations.
Projects In Laravel : Learn Laravel Building 10 ProjectsSam Dias
Projects In Laravel : Learn Laravel Building 10 Projects
Learn Laravel 5, top PHP framework, including how to install Laravel 5 framework & fundamentals in this Laravel 5 tutorial. This is why you need something to help you learn a technology quickly and easily! Our course does exactly that!
https://www.eduonix.com/courses/Web-Development/projects-in-laravel-learn-laravel-building-10-projects
This document discusses how the Java Virtual Machine (JVM) can support multiple languages. It describes how language features can be emulated on the JVM through additional layers of indirection. It outlines key features added in JDK 7 like invokedynamic bytecode and method handles to better support dynamic languages on the JVM by reducing overhead from emulation. The document argues that the JVM should optimize for non-Java language features to benefit both Java and other languages running on the platform.
Spring Boot is a framework for creating stand-alone, production-grade Spring based applications that can be "just run". It aims to provide a radically faster and widely accessible starting experience for developing Spring applications. Spring Boot applications can be started using java -jar or traditional WAR deployments and require very little Spring configuration. The document then discusses system requirements, development environment, creating a simple Hello World application, using Spring Boot Admin to monitor applications, configuring databases, Spring Data JPA, REST controllers, caching with EhCache, building web applications with Thymeleaf, and project structure.
This document discusses the Spring framework. It defines framework as software that provides predefined support for application development. Spring is described as an open source, lightweight application framework that uses inversion of control (IOC) and dependency injection (DI). The document outlines the different versions and modules of Spring, including core, DAO, ORM, context, AOP, and web modules. It also discusses Spring architecture, the types of frameworks (invasive and non-invasive), and the resources needed to develop a Spring application.
O documento fornece um resumo sobre o framework Spring, descrevendo:
1) Por que foi criado o Spring para substituir o EJB do Java EE, tornando o desenvolvimento Java mais leve e flexível;
2) Os principais conceitos do Spring como injeção de dependência e gerenciamento de beans;
3) As principais partes do framework Spring e projetos relacionados como Spring Boot, Spring MVC e Spring Data.
1. The document outlines the steps to set up an ODI Agent in Oracle Data Integrator 11g, including editing the odiparams.bat file to set the repository connection information, generating an encrypted password string, and specifying details when creating a new physical agent in the topology.
2. It also describes how to create a corresponding logical agent mapped to the physical agent, and how to start the agent from the command line and test the connection.
3. The key steps are to configure the repository connection details in odiparams.bat, create a new physical agent specifying its name and other properties, then create a linked logical agent to represent it in the logical architecture.
Java 10 contains several new features including local variable type inference using the var keyword, time-based release versioning, improved support for Docker containers, and various library enhancements. It focuses on improving performance and usability. Some notable changes include local variable type inference for concise code, parallel full GC for the G1 collector to reduce latency, and application data sharing to improve startup times.
A house with a solid foundation has to be built on the Rock. God has long been referred to as the Rock. Jesus said that those who hear His words and do them are like building a house on the Rock.
Pastor Elio Marrocco's "Have The Solid Rock Foundation - Philosophers" sermon at New Life Christian Church on January 18, 2013. You can learn more about New Life Christian Church here: http://www.newlifecc.ca
04/17/16 Sermon
Pastor Seth Gatchell
Pacific Church of Irvine
www.pacificchurch.com
4th message in a series entitled, "Stories to be Shaped by," based on the parables of Jesus Christ.
This is the second lesson in a series based on the Book of Hebrews chapter 6 verses 1 and 2, the elementary teachings of Christian faith.
The solid foundation is built upon the Rock. What (or who) is that Rock?
Sachpazis Foundation Pad with Two Columns Analysis & Design According to EC2 ...Dr.Costas Sachpazis
This document provides analysis and design calculations for the foundation of a pad supporting two columns according to Eurocode standards. It includes details of the foundation geometry and applied loads, as well as soil properties and calculations of bearing capacity, settlement, sliding resistance, and overturning to check if code requirements are satisfied. Diagrams and input parameters are provided over 13 pages of calculations and output.
1. Norton University Lesson 4 Subject ៖ VB.Net for Beginner
Academic year: 2014-2015 Page 1 Lecturer: Msc OU Bundeth
មេម ៀនទី ៤៖ Collection និង Generic
1 Array
Array គឺជាបណ្ុុំនន Character/String ដែលវាខុសគ្នាដែលលខ Index ។
2.1 Array One Dimension
Array Declaration:
Dim ArrayName(number) as DataType
Ex: Dim arr() as String={“A”,”C”,”D”,”B”}
Or Dim arr(3) as String
arr(0)=“A”
Arr(1)=“C”
arr(2)=“D”
arr(3)=“B”
Ex: For i as integer=0 to arr.length-1
MessageBox.Show(arr(i))
Next
Or For Each s As String in arr
MessageBox.Show(s)
Next
- Lbound : វាមាននាទីសុំរាប់ Return នូវ Index ែុំបូងរបស់ Array ។
- Ubound មាននាទីសុំរាប់ Return មកវិញនូវធាែុចុងលរោយរបស់ Array។
- Resized មាននាទីសុំរាប់ពរងីកធាែុរបស់ Array
- Reverse មាននាទីសុំរាប់រែលប់ធាែុរបស់ Array ។
- Sort មាននាទីសុំរាប់ែលរមៀបធាែុរបស់ Array ពីែូចលៅធុំ ។
Ex: Dim str() as String={“AB”,”AD”,”BA”,”ED”}
Array.Sort(str)
str.Reverse()
For i as integer =0 to Ubound(str)
MsgBox(str(i))
Next
- Redim and ReDim Preserve
+ ReDim
Ex: Dim str() as String={“AB”,”AD”,”BA”,”ED”}
ReDim str(1)
str(0)=“A”
str(1)=“B”
For Each s as String in str
MessageBox.Show(s)
Next
+ ReDim Preserve
Ex: Dim str() as String={“AB”,”AD”,”BA”,”ED”}
2. Norton University Lesson 4 Subject ៖ VB.Net for Beginner
Academic year: 2014-2015 Page 2 Lecturer: Msc OU Bundeth
ReDim Preseve str(1)
For Each s as String in str
MessageBox.Show(s)
Next
- Length ជា Properties ដែលវាអាច Return មកវិញនូវធាែុដែលចុំនួនដែល Array លនាោះមាន
2.2 Array Two Dimension
Array Declaration:
Dim ArrayName(,) as DataType={{,},{,},{,}}
- GetUpperBound មាននាទីសុំរាប់ទាញយក Indexចុងលរោយរបស់ Array លៅតាម Diamension ដែលកុំណែ់ ។
- Length មាន Return នូវ ចុំនួន Element ទាុំងអស់ ។
Ex:
Dim arr( , ) as String ={{“ID”,”Name”,”Phone”},{“001”,”Dara”,”099251675”}, {“002”,”Sok”,”017251675”}}
Dim result as String=“”
For i as integer=0 to arr.GetUpperbound(0)
Dim str as String=“”
For j as integer=0 to arr.GetUpperBound(1)
str += arr(I,j) + vbtab
Next
result += str + vbcrlf
Next
MessageBox.Show(result)
2. Collection
2.1 ArrayList
ArrayList អនុញ្ញាែ្ិលអាយអាករកាទុកធាែុជាលរចើនវាមានលកខណៈែូចលៅនឹង Array ដែរ ។ វាលអាយលយើងអាច បដនែមធាែុលៅ ោន់ទីតាុំងណាមួយក៏បានដែរល ើយអាកក៏អាច Remove ធាែុណាមួយលចញពីវាក៏បាន ។ ArrayList គឺជា Dynamic Structure ដែល អាចលុប បញ្ចូល … ។
លែើមបីបលងកើែ ArrayList ជាែុំបូងលយើងរែូវបលងកើែ Instance របស់វាលៅថា Object របស់ Class Array List ជាមុនសិនលទើបលរបើ Method និង Properties របស់វាបានលោយសារវាជា Instance Class ។
Syntax: Dim ArrayName as New ArrayList(number)
- រលបៀបរបោស និង បដនែមធាែុចូល ArrayList
Ex: Dim arrlist As New ArrayList(3)
arrlist.Add("A")
arrlist.Add("B")
arrlist.Add("C")
For Each s As String In arrlist
MessageBox.Show(s)
Next
- រលបៀបបដនែមធាែុលៅចលនាលោះ Index ណាមួយ
Ex1: Dim arrlist As New ArrayList(3)
arrlist.Add("A")
arrlist.Add("B")
3. Norton University Lesson 4 Subject ៖ VB.Net for Beginner
Academic year: 2014-2015 Page 3 Lecturer: Msc OU Bundeth
arrlist.Add("C")
arrlist.Insert(2, "E")
For Each s As String In arrlist
MessageBox.Show(s)
Next
Ex2: Dim arrlist As New ArrayList(3)
arrlist.Add("A")
arrlist.Add("E")
arrlist.Add("F")
Dim arr() As String = {"B", "C", "D"}
arrlist.InsertRange(1, arr)
For Each s As String In arrlist
MessageBox.Show(s)
Next
- រលបៀបលុបធាែុណាមួយលចញពី ArrayList
Ex: Dim arrlist As New ArrayList(3)
arrlist.Add("A")
arrlist.Add("E")
arrlist.Add("F")
Dim arr() As String = {"B", "C", "D"}
arrlist.InsertRange(1, arr)
arrlist.RemoveAt(3)
For Each s As String In arrlist
MessageBox.Show(s)
Next
- រលបៀប Sort ArrayList លែើមបី Sort ArrayList លោយលរបើរបាស់ Method Sort ។
ArrayList.Sort()
- រលបៀបរែលប់ Element របស់ ArrayList លែើមបី Sort ArrayListលោយលរបើរបាស់ Method Reverse ។
ArrayList.Reverse()
2.2 Hash Table
Hash Table មានលកខណៈែូចលៅនឹង ArrayList ដែរ ប ុដន្វាអនុញ្ញាែ្ិលអាយលយើងអាច Access ធាែុលោយលរបើ របាស់ Key រាល់ធាែុនីមួយៗ រែូវដែមានែុំនល (Value) និង key ។ែនមលលនោះរកាទុកែូចលៅនឹង ArrayList ដែរដែរគ្នន់ ដែ Index ជា Key វិញ មានន័យថាវាអាចជា String បាន ។
Syntax:
Dim HashtableName as New HashTable
Ex:
Dim htable As New Hashtable
htable.Add("Pen", "is the kind equivment of use in office")
htable.Add("Apple", "is the kind of friut")
htable.Add("Book", "is the paper that they compile it in a group of meaning")
For Each s As String In htable.Keys
4. Norton University Lesson 4 Subject ៖ VB.Net for Beginner
Academic year: 2014-2015 Page 4 Lecturer: Msc OU Bundeth
MessageBox.Show(“Key is ”+s+” Value is”+htable(s))
Next
ខាងលរោមលនោះជាោរ sort data លៅកាុង Hash Table ៖
Try
Dim htable As New Hashtable
htable.Add("b", "bbb")
htable.Add("y", "yyy")
htable.Add("a", "aaa")
Dim arrkey(htable.Count - 1) As String
Dim keys As ICollection = htable.Keys
keys.CopyTo(arrkey, 0)
Array.Sort(arrkey)
For Each s As String In arrkey
MessageBox.Show("Key is " + s + " Values is " + htable(s))
Next
Catch ex As Exception
MessageBox.Show((ex.Message))
End Try
3. Generic
3.1 List
អវីលៅជា List?
Listលៅកាុង VB.NET គឺជា Class ដែលសែិែលៅកាុង namespace System.Collection.Generic ។ List គឺជា dynamic arrays មានមុខងារែូចនឹង Array ដែរ ប ុដន្វាមានសមែែភាពលលើស array លោយអាចឱ្យលយើងបដនែម ឬ បនែយ element ល ើយមាន methods លរចើនជាងដែលលធវើឱ្យលយើងងាយរសួលកាុងោរលធវើោរជាមួយវា ។
ខាងលរោមលនោះជារូបបងាាញពី List របលភទ string List<string>
រចនា
លគ ទុំព័រ
កមមវិធីកុុំពយូទ ័រ
Game
ែបណា្ញ
ោរបលងកើែ
លែើមបីអាចលរបើ List បានែុំបូងអាករែូវរបោស object របស់ List លនាោះសិន Type របស់ List លនោះអាចជា Data Type (int, string, double) ឬ element លផេងលទៀែែូចជា Label, TextBox ។ល។
ខាងលរោមលនោះជាកូែសរមាប់របោស List។
Imports System.Collections.Generic
...
Dim skill As New List(Of Integer)
មុននឹងលរបើ List<T> លយើងរែូវ using System.Collections.Generic; ជាមុនសិន លទើបលយើងអាចលរបើកូែ List<T> បាន ។ បនាាប់មកខ្ុុំរបោស object មួយល្មោះ animal ជា List របលភទ string ដែលមានន័យថា object animal អាចរកាទុកែនមលដែលមានរបលភទជា string ។
5. Norton University Lesson 4 Subject ៖ VB.Net for Beginner
Academic year: 2014-2015 Page 5 Lecturer: Msc OU Bundeth
ឥឡូវសូមគិែពីកូែខាងលរោមលនោះ
Dim skill As New List(Of Label)
ោក់ែនមលចូល List
List ដែលលយើងបានបលងកើែខាងលលើគឺជា object ទលទមួយដែលមិនទាន់មានធាែុ ឬ ែនមលអវីលទ ។ លែើមបីរកាទុកែនមលកាុង List លយើងរែូវលរបើ method Add
skill.Add(“រចនា”) skill.Add(“លគ ទុំព័រ”) skill.Add(“កមមវិធីកុុំពយូទ ័រ”) skill.Add(“Game”) skill.Add(“ែបណា្ញ”)
លោយសារដែ List ដែលលយើងបលងកើែមានរបលភទជា string (List)ែូចលនោះ parameter របស់ method Add ក៏រែូវដែជា string ផងដែរ ។ ខាងលរោមលនោះជាោរបលងកើែ List របលភទជា int ៖
Dim number As New List(Of Integer)
number.Add(10)
number.Add(7)
List លធវើោរបានលអជាង និង ងាយរសួលលរបើជាង array លោយលយើងមិនបាច់របាប់ពីចុំនួន element ដែលលយើង ចង់ោក់លនាោះលទ ល ើយលយើងអាចបដនែមែនមលបានមិនកុំណែ់ ។ ោរលរបើ method Add លនាោះវានឹងបដនែមធាែុលៅដផាកខាង លរោយនន List ។ របសិនលបើអាកចង់បដនែមធាែុលៅ index ទី ១ ឬ index លផេងលទៀែលនាោះ អាកអាចលរបើ method Insert ។
skill.Insert(1, “ជួសជុលកុុំពយូទ ័រ”)
កូែខាងលលើលនោះនឹងោក់ធាែុមួយដែលមានែនមល “ជួសជុលកុុំពយូទ ័រ” លៅ index ទី ១ នន List skill ។
ទាញែនមលមកលរបើ និង ដកែនមលរបស់ List
សរមាប់ោរទាញែនមលពី List មិនលរបើ ឬ ដកគឺែូចនឹង array ដែរ លោយលយើងចាប់តាម index របស់ធាែុល ើយែនមល ណាដែល Add មុនលគសែិែលៅ index 0 ល ើយ Add ទី២ សែិែលៅ index 1 ។
skill(1) = “បលងកើែលគ ទុំព័រ” skill(2) = “បលងកើែកមមវិធីកុុំពយូទ ័រ” MsgBox(“ខ្ុុំចង់ោលយជាអាក” & skill(1) & “ និង អាក” & skill(2))
លុបែនមលលចញពី List<T>
លយើងអាចលុបធាែុណាក៏បានដែរ លោយលរបើ method Remove ឬ RemoveAt ។
method Remove ែរមូវឱ្យលយើងបញ្ញាក់ធាែុដែលចង់លុប
skill.Remove(“Game”)
ឯ method RemoveAt ែរមូវឱ្យលយើងបញ្ញាក់ index ននធាែុដែលចង់លុប
skill.RemoveAt(3)
បនាាប់ពីលុបរួច ធាែុ “ែបណា្ញ” នឹងធាលក់មកលៅ index ទី ៣ ។
លលើសពីលនោះ List មាននូវ methods ជាលរចើនលទៀែសរមាប់លុបែូចជា ៖ RemoveRange និង Clear ។
6. Norton University Lesson 4 Subject ៖ VB.Net for Beginner
Academic year: 2014-2015 Page 6 Lecturer: Msc OU Bundeth
skill.RemoveRange(1, 2)
កូែខាងលលើគឺលុបចាប់ពី index ទី ១ ល ើយលុប ២ ធាែុ (លនោះមានន័យថាលុប index ទី ១ និង ទី ២)
skill.Clear() „ លុបធាែុទាុំងអស់
ោរលរបើ List និង ផលរបលោជន៍
តាមរយៈអែែបទ និង កូែខាងលលើលោកអាកអាចបលងកើែ និង លរបើ List បានល ើយ ។ List ផ្ល់ឱ្យលោកអាកនូវ methods និង properties មួយចុំនួនលទៀែែូចជា Count, Contains, Reverse និង Sort ដែលនឹងជួយ សរមួលោរលរបើ List របស់ លោកអាក ។
- Count ជា properties សរមាប់រាប់ចុំនួនធាែុដែលមានកាុង List
Message.Show(“លយើងមានជុំនាញចុំនួន ” + skill.Count)
- Contains ជា method សរមាប់រកលមើលថាលែើ List មានែនមលដែលបានកុំណែ់ឬអែ់
If skill.Contains(“ែបណា្ញ”) Then
Message.Show(“អាកអាចសិកាជុំនាញលនោះបាន ។”)
End If
- Sort ជា method សរមាប់ែុំលរៀបធាែុកាុង List តាមែនមលពីែូចលៅធុំ
skill.Sort()
លោកអាកក៏អាចកុំណែ់របលភទជាលរចើនននោរែុំលរៀបលនោះលោយលរបើ Comparison ដែលខ្ុុំនឹងមិនបងាាញកាុងអែែបទលនោះលទ ។
លរៅពី methods ខាងលលើលនោះក៏មាននូវ methods ជាលរចើនលទៀែ ដែខ្ុុំសូមមិនបងាាញលនាោះលទ លររោះវាមានករមិែ លរៅ ។ លោយសារដែ List មានធាែុជាលរចើនលៅកាុងលនាោះ ែូចលនោះលយើងរែូវលរបើ Loop របសិនលបើលយើងចង់លធវើោរជាមួយ ធាែុទាុំងអស់ ។ ឧទា រណ៍របសិនលបើលយើងចង់បដនែមរកយ “អាក” លៅពីមុខែនមលននធាែុទាុំងអស់ ល ើយបងាាញវា
For i As Integer=1 To skill.Count
MessgeBox.Show(“អាក” & skill(i))
Next
កូែ for loop ខាងលលើលនោះងាយរសួលយល់សរមាប់អាក Programming ទូលៅ ប ុដន្វាមានលកខណៈយឺែជាងរបដ ល ២ែង លបើលរបៀបលធៀបជាមួយោរលរបើ foreach (សូមលមើលកូែ foreach ខាងលរោម)
For Each s In skill
MessgeBox.Show(“អាក” & s)
Next
ឥឡូវសាកចាប់លផ្ើមលរបើ List<T> ជុំនួស array កមមវិធីដែលអាកបលងកើែនឹងរែូវោរ memory ែិច ល ើយោរសរលសរកូែរបស់អាក នឹងងាយជាងមុន ។
3.2 Dictionary
អវីលៅជា Dictionary?
Dictionary គឺជា Class មួយដែលសែិែលៅកាុង namespace System.Collections.Generic; ។ Dictionary គឺវាមាន លកខណៈរសលែៀងលៅនឹងលៅនឹង List ដែរ ដែវាខុសគ្នាដែ Keys និង Index ចុំលរោះ List លយើងលរបើលលខសរមាប់លធវើជា Index ចុំដណកឯ Dictionary វាលរបើ Keys លធវើជា Index ែូចលនោះវាអាចផាុកបានែនមលជា String ក៏បាន ជាែនមលលលខ ឬ Object ក៏បាន។
អែែរបលោជន៍ននោរលរបើ Dictionary
Dictionary ផ្ល់ឱ្យលោកអាកនូវ methods និង properties មួយចុំនួនលទៀែ ែូចជា ៖ ContainsKey, ContainsValue, Remove, Keys, Values ល ើយវាក៏មានែួនាទីោ ង សុំខាន់ កាុងោរលរបើសរមាប់បលងកើែ Dictionary លោយសារវាមាន Key និង Value រសាប់មិនដែ ប ុលណាណោះវាមាន method រួចជាលរសច កាុងោរដសវងរកនូវ Key និង Value ណាមួយ ។ ខាងលរោមលនោះជារូបបងាាញពី Dictionary របលភទជា String, String