This document contains code for a music player application with the following key features:
1. It allows users to log in and provides a main menu with options to play music, view requests, view utilities, and exit.
2. The request section allows searching a database to retrieve song information and play the selected song. It also updates the request status in the database.
3. The code includes functions for playing, pausing, stopping music, shuffling songs, and updating the music progress bar.
SOFTWARE EDUCATIVO PARA LOS ESTUDIANTES DE EDUCACIÓN PRIMARIA EN LA E.B.N “MAESTRO MARCOS PEREIRA OLIVARES”, SECTOR LA SALINA DEL SUR, DE LOS PUERTOS DE ALTAGRACIA, MUNICIPIO MIRANDA ESTADO ZULIA
This document contains source code for an educational software program called "Aprendo Jugando" created in Visual Basic.NET 2010. It includes code for various screens and activities within the program, such as a welcome screen, main menu, language and literacy activities screen, listening and matching alphabet activity, and a hangman game. The code handles loading and transitioning between screens, playing audio files, and user interactions like button clicks.
The document summarizes improvements that could be made to a BeatBox program. It suggests:
1) Adding a dialog to ask the user if they want to save the current pattern before loading a new one from another user.
2) Adding error handling for when a command line argument is not passed to specify the user name, either using a default or prompting the user to rerun the program with an argument.
3) Adding features to randomly generate patterns or load preset foundation patterns that the user can build on, like jazz, rock, or reggae patterns.
The document discusses Kotlin collections and aggregate operations on collections. It explains that Kotlin collections can be mutable or immutable, and by default collections are immutable unless specified as mutable. It then covers various aggregate operations that can be performed on collections like any, all, count, fold, foldRight, forEach, max, min, none etc and provides code examples for each operation.
Stanfy MadCode Meetup #9: Functional Programming 101 with SwiftStanfy
This time Alexander Voronov (@aleks_voronov), iOS Developer at Stanfy talked about Functional Programming 101 with Swift
Key points:
- Why do we need Functional Programming?
- The power of Swift
- Functors, Applicatives and Monads
- Pipes & Railways
- Functional Swift in real life
Links Mentioned:
- Functors, Applicatives and Monads in Pictures: http://adit.io/posts/2013-04-17-funct...
- Railway Oriented Programming: http://fsharpforfunandprofit.com/post...
- Functional Programming in Swift (Objc.io): http://www.objc.io/books/fpinswift/
- Moya: https://github.com/Moya/Moya
- Argo: https://github.com/thoughtbot/Argo
- Swiftz: https://github.com/typelift/Swiftz
- RxSwift: https://github.com/ReactiveX/RxSwift
- ReactiveCocoa-3.0: https://github.com/ReactiveCocoa/Reac...
- Haskell: https://www.haskell.org
- F#: http://fsharp.org
- Erlang: http://www.erlang.org
- Elm: http://elm-lang.org
Watch video from the presentation (rus): https://youtu.be/w6zyGylS4Wk
Join our MadCode group on FB(rus): https://www.facebook.com/MadCodeMeetup/
Find more videos from MadCode Meetups (rus): https://www.youtube.com/playlist?list=PLrplqd3YJvBvUygFkx4Xvx1p3zyiCgB9Q
Async code on kotlin: rx java or/and coroutines - Kotlin Night TurinFabio Collini
It’s never easy to write async code but luckily there are many libraries to manage asynchronicity without adding too much complexity. In the last years RxJava and the other ReactiveX libraries have been very popular but lately there is a new way to manage async code in Kotlin: the coroutines. In this talk we’ll pros and cons of there two approaches and how to leverage them to simplify asynchronous code on Android.
Do they solve the same problem? Can we use them together? Which one can be used to write functional code? How can we use them effectively in Android development?
Spoiler alert: They are both great!
In this talk we’ll see how to solve common problems using RxJava or Coroutines, starting from basic concepts (for example the Retrofit support and how to cancel a task) to some more advanced (like threading, error management and how to combine multiple tasks).
All example of the talk are available on this repository:
https://github.com/fabioCollini/RxJavaVsCoroutines
From Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf MilanFabio Collini
Kotlin is a first-class language for Android development since Google I/O 2017. And it’s here to stay!
Thanks to Android Studio it’s really easy to introduce Kotlin in an existing project, the configuration is trivial and then we can convert Java classes to Kotlin using a Alt+Shift+Cmd+K. But the new syntax is the just beginning, using Kotlin we can improve our code making it more readable and simpler to write.
In this talk we’ll see how to use some Kotlin features (for example data classes, collections, coroutines and delegates) to simplify Android development comparing the code with the equivalent “modern” Java code. It’s not fair to compare Kotlin code with plain Java 6 code so the Java examples will use lambdas and some external libraries like RxJava and AutoValue.
The document discusses how monads can be used to prevent bugs and handle side effects like missing data in code. It provides examples of using Optional to represent missing values and chaining operations with flatMap to avoid nested if-checks. Monads allow sequencing computations in a declarative way while handling problems in the data or failures transparently.
SOFTWARE EDUCATIVO PARA LOS ESTUDIANTES DE EDUCACIÓN PRIMARIA EN LA E.B.N “MAESTRO MARCOS PEREIRA OLIVARES”, SECTOR LA SALINA DEL SUR, DE LOS PUERTOS DE ALTAGRACIA, MUNICIPIO MIRANDA ESTADO ZULIA
This document contains source code for an educational software program called "Aprendo Jugando" created in Visual Basic.NET 2010. It includes code for various screens and activities within the program, such as a welcome screen, main menu, language and literacy activities screen, listening and matching alphabet activity, and a hangman game. The code handles loading and transitioning between screens, playing audio files, and user interactions like button clicks.
The document summarizes improvements that could be made to a BeatBox program. It suggests:
1) Adding a dialog to ask the user if they want to save the current pattern before loading a new one from another user.
2) Adding error handling for when a command line argument is not passed to specify the user name, either using a default or prompting the user to rerun the program with an argument.
3) Adding features to randomly generate patterns or load preset foundation patterns that the user can build on, like jazz, rock, or reggae patterns.
The document discusses Kotlin collections and aggregate operations on collections. It explains that Kotlin collections can be mutable or immutable, and by default collections are immutable unless specified as mutable. It then covers various aggregate operations that can be performed on collections like any, all, count, fold, foldRight, forEach, max, min, none etc and provides code examples for each operation.
Stanfy MadCode Meetup #9: Functional Programming 101 with SwiftStanfy
This time Alexander Voronov (@aleks_voronov), iOS Developer at Stanfy talked about Functional Programming 101 with Swift
Key points:
- Why do we need Functional Programming?
- The power of Swift
- Functors, Applicatives and Monads
- Pipes & Railways
- Functional Swift in real life
Links Mentioned:
- Functors, Applicatives and Monads in Pictures: http://adit.io/posts/2013-04-17-funct...
- Railway Oriented Programming: http://fsharpforfunandprofit.com/post...
- Functional Programming in Swift (Objc.io): http://www.objc.io/books/fpinswift/
- Moya: https://github.com/Moya/Moya
- Argo: https://github.com/thoughtbot/Argo
- Swiftz: https://github.com/typelift/Swiftz
- RxSwift: https://github.com/ReactiveX/RxSwift
- ReactiveCocoa-3.0: https://github.com/ReactiveCocoa/Reac...
- Haskell: https://www.haskell.org
- F#: http://fsharp.org
- Erlang: http://www.erlang.org
- Elm: http://elm-lang.org
Watch video from the presentation (rus): https://youtu.be/w6zyGylS4Wk
Join our MadCode group on FB(rus): https://www.facebook.com/MadCodeMeetup/
Find more videos from MadCode Meetups (rus): https://www.youtube.com/playlist?list=PLrplqd3YJvBvUygFkx4Xvx1p3zyiCgB9Q
Async code on kotlin: rx java or/and coroutines - Kotlin Night TurinFabio Collini
It’s never easy to write async code but luckily there are many libraries to manage asynchronicity without adding too much complexity. In the last years RxJava and the other ReactiveX libraries have been very popular but lately there is a new way to manage async code in Kotlin: the coroutines. In this talk we’ll pros and cons of there two approaches and how to leverage them to simplify asynchronous code on Android.
Do they solve the same problem? Can we use them together? Which one can be used to write functional code? How can we use them effectively in Android development?
Spoiler alert: They are both great!
In this talk we’ll see how to solve common problems using RxJava or Coroutines, starting from basic concepts (for example the Retrofit support and how to cancel a task) to some more advanced (like threading, error management and how to combine multiple tasks).
All example of the talk are available on this repository:
https://github.com/fabioCollini/RxJavaVsCoroutines
From Java to Kotlin beyond alt+shift+cmd+k - Kotlin Community Conf MilanFabio Collini
Kotlin is a first-class language for Android development since Google I/O 2017. And it’s here to stay!
Thanks to Android Studio it’s really easy to introduce Kotlin in an existing project, the configuration is trivial and then we can convert Java classes to Kotlin using a Alt+Shift+Cmd+K. But the new syntax is the just beginning, using Kotlin we can improve our code making it more readable and simpler to write.
In this talk we’ll see how to use some Kotlin features (for example data classes, collections, coroutines and delegates) to simplify Android development comparing the code with the equivalent “modern” Java code. It’s not fair to compare Kotlin code with plain Java 6 code so the Java examples will use lambdas and some external libraries like RxJava and AutoValue.
The document discusses how monads can be used to prevent bugs and handle side effects like missing data in code. It provides examples of using Optional to represent missing values and chaining operations with flatMap to avoid nested if-checks. Monads allow sequencing computations in a declarative way while handling problems in the data or failures transparently.
The document discusses features of the Kotlin programming language. It provides examples of how Kotlin simplifies object-oriented programming tasks like data classes and property access compared to Java. Data classes in Kotlin can auto-generate getters, setters, equals(), hashCode() and toString() methods. Kotlin also allows functional-style programming with properties like immutable state and avoiding null references.
The document discusses Scala as a potential replacement for Java on the JVM. It provides quotes from several influential Java developers who express their view that Scala is the most capable replacement for Java currently available on the JVM, and the momentum behind Scala is growing. The document also briefly outlines an agenda for introducing Scala, covering basic syntax, patterns, functions, classes and traits.
The document provides an introduction to Python including:
- Starting the Python interpreter and basic calculations
- Variables, expressions, statements, functions, modules, comments
- Strings, lists, tuples, dictionaries
- Common list, string, and dictionary methods
It covers the basic Python syntax and many common data structures and their associated methods in less than 3 sentences.
The document provides an introduction to Python including:
- Starting the Python interpreter and basic calculations
- Variables, expressions, statements, functions, modules, comments
- Strings, lists, tuples, dictionaries
- Common list, string, and dictionary methods
It covers the basic Python syntax and many common data structures and their associated methods in less than 3 sentences.
From java to kotlin beyond alt+shift+cmd+k - Droidcon italyFabio Collini
Kotlin is a first-class language for Android development since Google I/O 2017. And it’s here to stay!
Thanks to Android Studio it’s really easy to introduce Kotlin in an existing project, the configuration is trivial and then we can convert Java classes to Kotlin using a Alt+Shift+Cmd+K. But the new syntax is the just beginning, using Kotlin we can improve our code making it more readable and simpler to write.
In this talk we’ll see how to use some Kotlin features (for example data classes, collections, coroutines and delegates) to simplify Android development comparing the code with the equivalent “modern” Java code. It’s not fair to compare Kotlin code with plain Java 6 code so the Java examples will use lambdas and some external libraries like RxJava and AutoValue.
The document outlines an agenda for a Clojure meetup, including introductions to Clojure, incremental development with Clojure, Emacs and SLIME, Clojure STM, and a talk on optimization titled "Eratosthenes' Sieve: An Adventure in Optimization". It then provides examples of Clojure literals, collections, functions, macros, and interoperability with Java.
The Ring programming language version 1.6 book - Part 48 of 189Mahmoud Samir Fayed
The document discusses using the Allegro game programming library in Ring applications. It shows how to load the Allegro library, perform basic drawing and animation, and handle input. An example program is given that uses Allegro to draw a bouncing rectangle on the screen that can be moved with keyboard keys or mouse clicks. The program animates the rectangle, checks for input events, and redraws the display continuously in a loop.
The Ring programming language version 1.7 book - Part 35 of 196Mahmoud Samir Fayed
The document contains documentation for the Ring programming language. It describes a Ring class that stores information about objects, including their name, symbol, and position. For each object, it lists these attributes. It also contains descriptions of using self and this to reference attributes and methods from within classes.
The document summarizes various functions in the Kotlin standard library including let, with, apply, run, also, takeIf, takeUnless, use, and repeat. It provides code examples to demonstrate how each function works and what it is commonly used for. let, with, apply, and also allow passing a receiver object to a lambda and accessing it as "it". takeIf and takeUnless return the receiver if a predicate is true or false, respectively. use automatically closes resources. repeat runs an action a specified number of times.
Kotlin provides a lot of features out of the box even though those are not supported by JVM. Have you ever wondered how Kotlin does it? If yes, then this presentation is for you.
Kotlin compiler tweaks our code in such a way that, JVM can execute it. this deck goes through lots of Kotlin features and explains how it looks at runtime for JVM compatibility. Of course we are not going to look into bytecode, instead we will look into the decompiled version of the bytecode generated by Kotlin compiler.
NOTE: This was presented at DevFest Kolkata 2019.
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...PROIDEA
Contact
FUNCTIONAL PROGRAMING AND EVENT SOURCING - A PAIR MADE IN HEAVEN - EXTENDED, 2 HOURS LONG BRAINWASH
TL;DR: This is talk is a solid introduction to two (supposedly) different topics: FP & ES. I will cover both the theory and the practice. We will emerage ES+FP application starting from ES+OO one.
While reading blogs or attending conferences, you might have heard about Event Sourcing. But didn't you get this feeling, that while there is a lot of theory out there, it is really hard to see a hands-on example? And even if you find some, those are always orbiting around Object Oriented concepts?
Greg Young once said "When we talk about Event Sourcing, current state is a left-fold of previous behaviours. Nothing new to Functional Programmers". If Functional Programming is such a natural concept for event sourced systems, shouldn't they fit together on a single codebase?
In this talk we will quickly introduce Event Sourcing (but without going into details), we will introduce some functional concepts as well (like State monad). Armoured with that knowledge we will try to transform sample ES application (OO-style, tightly coupled with framework) to frameworkless, FP-style solution).
Talk is targeted for beginner and intermediate audience. Examples will be in Scala but nothing fancy - normal syntax.
This talk is an extended version of a presentation "Event Sourcing & Functional Programming - a pair made in heaven". It is enriched with content of presentations: "Monads - asking the right question" and "It's all been done before - The Hitchhiker's Guide to Time Travel".
Stop Guessing and Start Measuring - Benchmarking in Practice (Lambdadays)Tobias Pfeiffer
“What’s the fastest way of doing this?” - you might ask yourself during development. Sure, you can guess - but how do you know? How long would that function take with a million elements? Is that tail-recursive function always faster?
Benchmarking is here to give you the answers, but there are many pitfalls in setting up a good benchmark and analyzing the results. This talk will guide you through, introduce best practices, and surprise you with some results along the way. You didn’t think that the order of arguments could influence its performance...or did you?
Closure, Higher-order function in SwiftSeongGyu Jo
This document discusses closures and higher-order functions in Swift. It provides examples of using closures as parameters, including sorting an array by passing a closure. It also gives examples of common higher-order functions like map, filter and reduce. Map transforms elements by applying a closure, filter filters elements by a closure condition, and reduce combines elements using a closure.
A Skeptics guide to functional style javascriptjonathanfmills
The document discusses functional programming concepts like pure functions, higher order functions, currying, and monads and how they can be applied in JavaScript. It provides examples of transforming iterative array methods like map, filter, and reduce into functional style code using pure functions. While functional programming aims to avoid side effects, the document notes that side effects cannot be fully avoided in JavaScript and functional style is more of a mindset of keeping pieces small and interactions simple.
Kotlin is a statically typed language that runs on the JVM, Android and browsers. It was developed by JetBrains and had its first stable release in February 2016. Some key features of Kotlin include null safety, lambdas, extension functions, and delegation which allow avoiding null checks and reducing boilerplate code compared to Java. It also integrates well with Android by reducing the need for findViewById and providing libraries like Anko that simplify common tasks. Performance tests have shown Kotlin to be as fast as Java.
Ciklum net sat12112011-alexander fomin-expressions and all, all, allCiklum Ukraine
The document discusses expressions in C# and LINQ. It provides examples of expression trees representing lambda expressions and method calls. It also describes using expressions to implement reflection at compile time and build an IQueryable provider by compiling expressions to IL.
Analysis of Fatal Utah Avalanches with Python. From Scraping, Analysis, to In...Matt Harrison
I gave this presentation at Code Camp. As a data scientist and backcountry skier, I was interested in looking at fatal avalanche data. This covers scraping the data, analysis with Python, pandas and IPython Notebook. The final result is an infographic
How to Become a Tree Hugger: Random Forests and Predictive Modeling for Devel...Matt Harrison
Python makes data science easy. In this deck we walk through a complete example of creating and evaluating a predictive model using Decision Trees and Random Forests. All of the code is included in the slides.
Elixir -Tolerância a Falhas para Adultos - GDG CampinasFabio Akita
Tolerância a Falhas para Adultos is a document about Elixir and distributed processing in 3 sentences or less:
It discusses concepts in Elixir like processes, message passing, and supervision trees to provide fault tolerance. It also covers distributing processing using libraries like Flow to partition and process large datasets across multiple nodes. The document provides an overview of key Elixir concepts for building distributed and fault tolerant applications.
This document discusses tuples in Python. It begins with definitions of tuples, noting that they are ordered, indexed and immutable sequences. It then provides examples of creating tuples using parentheses or not, and explains that a single element tuple requires a trailing comma. The document discusses tuple operations like slicing, comparison, assignment and using tuples as function return values or dictionary keys. It also covers built-in tuple methods and functions.
Sistem inferensi fuzzy metode Tsukamoto digunakan untuk memprediksi tingkat kompetensi profesional guru berdasarkan delapan komponen utama meliputi kualifikasi akademik, pendidikan dan pelatihan, pengalaman mengajar, perencanaan pembelajaran, prestasi akademik, karya pengembangan profesi, keikutsertaan forum ilmiah, dan penghargaan bidang pendidikan.
The document discusses features of the Kotlin programming language. It provides examples of how Kotlin simplifies object-oriented programming tasks like data classes and property access compared to Java. Data classes in Kotlin can auto-generate getters, setters, equals(), hashCode() and toString() methods. Kotlin also allows functional-style programming with properties like immutable state and avoiding null references.
The document discusses Scala as a potential replacement for Java on the JVM. It provides quotes from several influential Java developers who express their view that Scala is the most capable replacement for Java currently available on the JVM, and the momentum behind Scala is growing. The document also briefly outlines an agenda for introducing Scala, covering basic syntax, patterns, functions, classes and traits.
The document provides an introduction to Python including:
- Starting the Python interpreter and basic calculations
- Variables, expressions, statements, functions, modules, comments
- Strings, lists, tuples, dictionaries
- Common list, string, and dictionary methods
It covers the basic Python syntax and many common data structures and their associated methods in less than 3 sentences.
The document provides an introduction to Python including:
- Starting the Python interpreter and basic calculations
- Variables, expressions, statements, functions, modules, comments
- Strings, lists, tuples, dictionaries
- Common list, string, and dictionary methods
It covers the basic Python syntax and many common data structures and their associated methods in less than 3 sentences.
From java to kotlin beyond alt+shift+cmd+k - Droidcon italyFabio Collini
Kotlin is a first-class language for Android development since Google I/O 2017. And it’s here to stay!
Thanks to Android Studio it’s really easy to introduce Kotlin in an existing project, the configuration is trivial and then we can convert Java classes to Kotlin using a Alt+Shift+Cmd+K. But the new syntax is the just beginning, using Kotlin we can improve our code making it more readable and simpler to write.
In this talk we’ll see how to use some Kotlin features (for example data classes, collections, coroutines and delegates) to simplify Android development comparing the code with the equivalent “modern” Java code. It’s not fair to compare Kotlin code with plain Java 6 code so the Java examples will use lambdas and some external libraries like RxJava and AutoValue.
The document outlines an agenda for a Clojure meetup, including introductions to Clojure, incremental development with Clojure, Emacs and SLIME, Clojure STM, and a talk on optimization titled "Eratosthenes' Sieve: An Adventure in Optimization". It then provides examples of Clojure literals, collections, functions, macros, and interoperability with Java.
The Ring programming language version 1.6 book - Part 48 of 189Mahmoud Samir Fayed
The document discusses using the Allegro game programming library in Ring applications. It shows how to load the Allegro library, perform basic drawing and animation, and handle input. An example program is given that uses Allegro to draw a bouncing rectangle on the screen that can be moved with keyboard keys or mouse clicks. The program animates the rectangle, checks for input events, and redraws the display continuously in a loop.
The Ring programming language version 1.7 book - Part 35 of 196Mahmoud Samir Fayed
The document contains documentation for the Ring programming language. It describes a Ring class that stores information about objects, including their name, symbol, and position. For each object, it lists these attributes. It also contains descriptions of using self and this to reference attributes and methods from within classes.
The document summarizes various functions in the Kotlin standard library including let, with, apply, run, also, takeIf, takeUnless, use, and repeat. It provides code examples to demonstrate how each function works and what it is commonly used for. let, with, apply, and also allow passing a receiver object to a lambda and accessing it as "it". takeIf and takeUnless return the receiver if a predicate is true or false, respectively. use automatically closes resources. repeat runs an action a specified number of times.
Kotlin provides a lot of features out of the box even though those are not supported by JVM. Have you ever wondered how Kotlin does it? If yes, then this presentation is for you.
Kotlin compiler tweaks our code in such a way that, JVM can execute it. this deck goes through lots of Kotlin features and explains how it looks at runtime for JVM compatibility. Of course we are not going to look into bytecode, instead we will look into the decompiled version of the bytecode generated by Kotlin compiler.
NOTE: This was presented at DevFest Kolkata 2019.
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...PROIDEA
Contact
FUNCTIONAL PROGRAMING AND EVENT SOURCING - A PAIR MADE IN HEAVEN - EXTENDED, 2 HOURS LONG BRAINWASH
TL;DR: This is talk is a solid introduction to two (supposedly) different topics: FP & ES. I will cover both the theory and the practice. We will emerage ES+FP application starting from ES+OO one.
While reading blogs or attending conferences, you might have heard about Event Sourcing. But didn't you get this feeling, that while there is a lot of theory out there, it is really hard to see a hands-on example? And even if you find some, those are always orbiting around Object Oriented concepts?
Greg Young once said "When we talk about Event Sourcing, current state is a left-fold of previous behaviours. Nothing new to Functional Programmers". If Functional Programming is such a natural concept for event sourced systems, shouldn't they fit together on a single codebase?
In this talk we will quickly introduce Event Sourcing (but without going into details), we will introduce some functional concepts as well (like State monad). Armoured with that knowledge we will try to transform sample ES application (OO-style, tightly coupled with framework) to frameworkless, FP-style solution).
Talk is targeted for beginner and intermediate audience. Examples will be in Scala but nothing fancy - normal syntax.
This talk is an extended version of a presentation "Event Sourcing & Functional Programming - a pair made in heaven". It is enriched with content of presentations: "Monads - asking the right question" and "It's all been done before - The Hitchhiker's Guide to Time Travel".
Stop Guessing and Start Measuring - Benchmarking in Practice (Lambdadays)Tobias Pfeiffer
“What’s the fastest way of doing this?” - you might ask yourself during development. Sure, you can guess - but how do you know? How long would that function take with a million elements? Is that tail-recursive function always faster?
Benchmarking is here to give you the answers, but there are many pitfalls in setting up a good benchmark and analyzing the results. This talk will guide you through, introduce best practices, and surprise you with some results along the way. You didn’t think that the order of arguments could influence its performance...or did you?
Closure, Higher-order function in SwiftSeongGyu Jo
This document discusses closures and higher-order functions in Swift. It provides examples of using closures as parameters, including sorting an array by passing a closure. It also gives examples of common higher-order functions like map, filter and reduce. Map transforms elements by applying a closure, filter filters elements by a closure condition, and reduce combines elements using a closure.
A Skeptics guide to functional style javascriptjonathanfmills
The document discusses functional programming concepts like pure functions, higher order functions, currying, and monads and how they can be applied in JavaScript. It provides examples of transforming iterative array methods like map, filter, and reduce into functional style code using pure functions. While functional programming aims to avoid side effects, the document notes that side effects cannot be fully avoided in JavaScript and functional style is more of a mindset of keeping pieces small and interactions simple.
Kotlin is a statically typed language that runs on the JVM, Android and browsers. It was developed by JetBrains and had its first stable release in February 2016. Some key features of Kotlin include null safety, lambdas, extension functions, and delegation which allow avoiding null checks and reducing boilerplate code compared to Java. It also integrates well with Android by reducing the need for findViewById and providing libraries like Anko that simplify common tasks. Performance tests have shown Kotlin to be as fast as Java.
Ciklum net sat12112011-alexander fomin-expressions and all, all, allCiklum Ukraine
The document discusses expressions in C# and LINQ. It provides examples of expression trees representing lambda expressions and method calls. It also describes using expressions to implement reflection at compile time and build an IQueryable provider by compiling expressions to IL.
Analysis of Fatal Utah Avalanches with Python. From Scraping, Analysis, to In...Matt Harrison
I gave this presentation at Code Camp. As a data scientist and backcountry skier, I was interested in looking at fatal avalanche data. This covers scraping the data, analysis with Python, pandas and IPython Notebook. The final result is an infographic
How to Become a Tree Hugger: Random Forests and Predictive Modeling for Devel...Matt Harrison
Python makes data science easy. In this deck we walk through a complete example of creating and evaluating a predictive model using Decision Trees and Random Forests. All of the code is included in the slides.
Elixir -Tolerância a Falhas para Adultos - GDG CampinasFabio Akita
Tolerância a Falhas para Adultos is a document about Elixir and distributed processing in 3 sentences or less:
It discusses concepts in Elixir like processes, message passing, and supervision trees to provide fault tolerance. It also covers distributing processing using libraries like Flow to partition and process large datasets across multiple nodes. The document provides an overview of key Elixir concepts for building distributed and fault tolerant applications.
This document discusses tuples in Python. It begins with definitions of tuples, noting that they are ordered, indexed and immutable sequences. It then provides examples of creating tuples using parentheses or not, and explains that a single element tuple requires a trailing comma. The document discusses tuple operations like slicing, comparison, assignment and using tuples as function return values or dictionary keys. It also covers built-in tuple methods and functions.
Sistem inferensi fuzzy metode Tsukamoto digunakan untuk memprediksi tingkat kompetensi profesional guru berdasarkan delapan komponen utama meliputi kualifikasi akademik, pendidikan dan pelatihan, pengalaman mengajar, perencanaan pembelajaran, prestasi akademik, karya pengembangan profesi, keikutsertaan forum ilmiah, dan penghargaan bidang pendidikan.
This document contains source code for password login authentication, a menu form, and a point of sales (POS) form. The password code authenticates the user login and hides/shows forms. The menu form changes the window caption and contains click events to show other forms. The POS form contains recordsets to manage data in various tables, includes buttons to add/edit/delete records, and refreshes lists on form load.
The document contains code snippets in Visual Basic for various programming tasks like:
1. Copying text from one text box to another
2. Clearing text from text boxes
3. Summarizing a number and reversing it
4. Calculating factorial of a number
5. Checking if a number is prime
6. Swapping numbers by value and reference
7. Checking case of a string and converting case
This document provides code examples for common controls in programming languages:
1) It shows how to make a label transparent and how to set buttons to respond to enter and escape keys.
2) There is an example of loading text into a textbox and searching for a substring within the text.
3) Code is presented for setting the value of option buttons and loading an image into a picture box.
4) Finally, it demonstrates changing the caption of a frame with a button click event.
This document contains code for two programs:
1. A program to calculate the sum and average of numbers entered by the user without using an array. It uses labels, textboxes, buttons, and listboxes.
2. A stopwatch program with lap timing functionality. It uses three timers - one to increment the time, one to decrement, and one to blink the display. Buttons are included to start, pause, reset, and add laps to a listbox.
The document contains code snippets from multiple Visual Basic .NET programs related to calculating areas and perimeters of shapes, building a basic calculator application, and generating invoices. The code defines classes and subroutines to calculate geometric values and perform arithmetic operations when buttons are clicked. Variables are used to store user input from text boxes and display output.
Gambas is a free programming language derived from Basic. It distributes under the GNU GPL license. It allows creating forms with command buttons, text boxes, and many other controls and linking them to databases. Gambas is a simple programming language for free platforms (such as GNU/Linux and BSD). This example allows us to perform a subtraction. It takes numbers as input, performs the subtraction, and prints the result.
Gambas is a free programming language derived from Basic. It distributes under the GNU GPL license. It allows creating forms with command buttons, text boxes, and many other controls and linking them to databases. Gambas is a simple programming language for free platforms (such as GNU/Linux and BSD). This example allows us to perform a subtraction. It takes numbers as input, performs the subtraction, and prints the result.
Gambas is a free programming language derived from Basic. It distributes under the GNU GPL license. It allows creating forms with command buttons, text boxes, and many other controls and linking them to databases. Gambas is a simple programming language for free platforms (such as GNU/Linux and BSD). This example allows us to perform a subtraction. It takes numbers as input, performs the subtraction, and prints the result.
The document contains code snippets in the Visual Basic programming language for creating loops and arrays. The code examples demonstrate how to use for loops to iterate through a range of numbers, check for multiples or even/odd numbers, and decrement from a starting number. Arrays are initialized to store string values corresponding to numbers or months, which are then accessed and displayed based on a user selection or input.
The document contains 13 programs with Visual Basic code and output descriptions. The programs cover topics like printing series, simple calculations, timers, controls like checkboxes and option buttons, font styling, puzzles, and menus. Each program contains the code, input, and output sections to demonstrate the programming concepts.
The document describes a calculator program created in GAMBAS. It defines variables to store numbers and operations, and includes subroutines for each button that appends numbers or performs calculations on the numbers stored in the variables when the equal button is pressed. The subroutines also convert numbers between binary, octal, and hexadecimal representations.
This document contains code for managing a student database. It includes code for a search button that finds student records by ID, an insert button that adds new records to the database, and a delete button that removes existing records. Each button click triggers a database query and validation checks to ensure data integrity. Field values are updated and user interfaces are enabled or disabled based on the database operation.
This document contains code for several different programs written in Gambas including:
1. A billing program that allows a user to add items, quantities, and prices to a grid and calculates subtotals.
2. A basic calculator program that includes number buttons, arithmetic operators, and functions like square root.
3. A program that calculates the percentages of different products in a total.
4. A program that draws circles on a form and allows changing the radius size.
5. A screen saver program that draws random shapes on a form with changing colors.
The document contains code for several programs:
1. A billing program that allows adding items to a grid and calculates totals.
2. A calculator program with buttons for numbers and operations.
3. A program that calculates percentages of different products in a total.
4. A program that draws circles in an area and changes the radius on button clicks.
5. A screensaver program that draws random shapes on a timer in an area.
6. A digital clock program.
The document describes the code for a calculator program written in GAMBAS. It defines public variables to store operation numbers and values. It includes subroutines for each button click that append numbers or operate on values. The main operation subroutine uses a switch statement to perform calculations like addition, subtraction, multiplication, division, etc. based on the operation number stored. Additional subroutines convert values to binary, octal and hexadecimal formats.
The document describes the code for a calculator program written in GAMBAS. It defines public variables to store calculator operations and values. It includes subroutines for each button click that append numbers or operate on values. The main operation subroutine uses a switch statement to perform the calculation based on the operation selected and stores the result.
The document provides information about various Corona display, audio, physics, and storyboard APIs:
1) It summarizes the display.newText, display.newImage, display.newRect, display.newCircle, and display.newGroup functions for creating and manipulating display objects.
2) It covers the basics of touch handling using object:addEventListener and provides an example listener function.
3) It describes timer functions like timer.performWithDelay, timer.pause, and timer.resume for delayed execution of functions.
4) It gives an overview of the audio API and provides an example of loading and playing sounds.
5) It introduces the Corona physics module and
The document contains 12 code examples demonstrating various functions in VB.NET including:
1) Displaying a message when a button is clicked
2) Showing a message box on button click
3) Accepting input and displaying a sum
4) Performing math operations on input values
5) Checking if a number is positive, negative, or zero
6) Finding the maximum and minimum of three numbers
7) Calculating simple and compound interest
8) Creating a student marksheet
9) Building a digital clock using a timer
10) Displaying prime numbers between ranges
11) Collecting and displaying user information
12) Adding names between listboxes and removing selected names
This document provides code examples for programming different visual basic controls including labels, command buttons, text boxes, option buttons, picture boxes, and frames. It shows how to make a label transparent, set command buttons to respond to enter and escape keys, add and format text in a text box, respond to clicks on option buttons with messages, load an image into a picture box, and change the caption of a frame.
1. LAMPIRAN A-1
LISTING PROGRAM
1. Login
Option Explicit
Dim rsUser As Recordset
Private Sub cboUser_Click()
txtPass.Locked = False
txtPass.SetFocus
End Sub
Private Sub cmdCancel_Click()
End
End Sub
Private Sub cmdOK_Click()
On Error Resume Next
Set rsCari = New ADODB.Recordset
rsCari.Open "Select * from tUser where UserId='" & cboUser.Text &
"' and Passwd='" & txtPass.Text & "'", CN, adOpenDynamic,
adLockOptimistic
If rsCari.EOF = True Then
MsgBox "Password salah"
txtPass = ""
cboUser = ""
cboUser.SetFocus
Else
Me.Hide
frmUtama.Show
End If
End Sub
Private Sub Form_Activate()
txtPass = ""
cboUser = ""
cboUser.SetFocus
End Sub
Private Sub Form_Load()
Koneksi
Set rsUser = New ADODB.Recordset
rsUser.Open "Select * from tUser order by UserId asc", CN,
adOpenDynamic, adLockOptimistic
Do Until rsUser.EOF = True
cboUser.AddItem rsUser.Fields("UserId")
rsUser.MoveNext
Loop
End Sub
Private Sub txtPass_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdOk.Enabled = True
cmdOk.SetFocus
End If
End Sub
Private Sub cboUser_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtPass.Locked = False
txtPass.SetFocus
End If
End Sub
2. LAMPIRAN A-2
2. Menu Utama
Private Sub cmdAbout_Click()
frmAbout.Show
End Sub
Private Sub cmdQuit_Click()
End
End Sub
Private Sub cmdReq_Click()
MainForm.Show
End Sub
Private Sub cmdUtil_Click()
frmMenuADM.Show
End Sub
Private Sub Form_Activate()
Timer1.Enabled = True
End Sub
3.Request
Dim rsLagu As Recordset
Dim KdLagu As String
Dim IDRequest As Integer
Private Sub cmdQuit_Click()
If InTray = True Then
Call TrayModule.DeleteIcon(MainForm)
End If
Unload Me
Unload AddForm
End Sub
Private Sub cmdStart_Click()
cmdStart.Enabled = False
Call Start
End Sub
Sub Start()
Set rsCari = New ADODB.Recordset
rsCari.Open "Select * from tDatarequest where stPutar = '1' order
by idrequest asc", CN, 1, 2
If Not rsCari.EOF Then
KdLagu = rsCari!KdLagu
lblKdLagu = KdLagu
IDRequest = rsCari!IDRequest
Set rsLagu = New ADODB.Recordset
rsLagu.Open "Select * from tLagu where KdLagu='" &
KdLagu & "'", CN, 1, 2
If Not rsLagu.EOF Then
lblNmFile.Caption = rsLagu!NmFile
lblNmLagu.Caption = rsLagu!Nmlagu
If Music.ListCount > 0 Then
Module1.MusicClick
End If
Else
3. LAMPIRAN A-3
lblNmFile.Caption = ""
End If
Set rsLagu = Nothing
Else
KdLagu = ""
End If
Set rsCari = Nothing
Set rsCari = New ADODB.Recordset
rsCari.Open "Update tDatarequest SET stPutar= '*' where
idrequest=" & IDRequest & "", CN, 1, 2
Set rsCari = Nothing
End Sub
Private Sub Command1_Click()
AddForm.Show
End Sub
Private Sub Command2_Click()
On Error GoTo skip
Dim Selected As Integer
MusicName = Music.Text
Selected = Music.ListIndex
Music.RemoveItem (Selected)
PathList.RemoveItem (Selected)
Module1.SaveFile
Play2action.Enabled = True
Timer1.Enabled = False
leftlabel.Caption = "0"
Playaction.Enabled = True
pauseaction.Enabled = False
pausebutton.Enabled = False
stopbutton.Enabled = False
stopaction.Enabled = False
Exit Sub
End Sub
Private Sub deleteaction_Click()
On Error GoTo skip
MusicName = Music.Text
Music.RemoveItem (Music.ListIndex)
WindowsMediaPlayer1.Controls.Stop
playbutton.Enabled = True
Playaction.Enabled = True
Play2action.Enabled = True
Exit Sub
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If InTray = True Then
If X = TrayModule.WM_RBUTTONDOWN Then
PopupMenu TrayMenu
ElseIf X = TrayModule.WM_LBUTTONDBLCLK Then
If InTray = True Then
MainForm.Show
Call TrayModule.DeleteIcon(MainForm)
End If
End If
End If
End Sub
4. LAMPIRAN A-4
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X
As Single, Y As Single)
Label1.ToolTipText = Music.ListCount & " uploaded songs"
End Sub
Private Sub grid_Click()
Dim i As Integer
i = grid.Row
KdLagu = grid.TextMatrix(i, 4)
lblKdLagu = KdLagu
Set rsCari = New ADODB.Recordset
rsCari.Open "Select * from tLagu where KdLagu='" & KdLagu & "'",
CN, 1, 2
If Not rsCari.EOF Then
lblNmFile.Caption = rsCari!NmFile
lblNmLagu.Caption = rsCari!Nmlagu
If Music.ListCount > 0 Then
Module1.MusicClick
End If
Else
lblNmFile.Caption = ""
End If
End Sub
Private Sub Music_Click()
If Music.ListCount > 0 Then
Module1.MusicClick
End If
End Sub
Private Sub Music_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If Button = 1 Then
Module1.MusicClick
ElseIf Button = 2 Then
PopupMenu musicmenu
End If
End Sub
Private Sub Music_MouseMove(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Music.ToolTipText = MusicName
End Sub
Private Sub NextAction_Click()
Call TrayNext_Click
End Sub
Private Sub OrderAction_Click()
Dim MusicName As String
Dim MusicPath As String
Dim i, j, k As Integer
Dim Index1, Index2 As Integer
Dim Letter1, Letter2 As String
Dim OldCaption As String
OldCaption = Me.Caption
Me.Caption = "Ordering..."
5. LAMPIRAN A-5
If Music.ListCount >= 2 Then
i = Music.ListCount - 2
Do While i > -1
j = 1
Compare:
Letter1 = UCase(Mid(Music.List(i), j, 1))
Letter2 = UCase(Mid(Music.List(i + 1), j, 1))
If Letter2 < Letter1 Then
Switch:
Index1 = i
Index2 = i + 1
MusicName = Music.List(Index1)
MusicPath = PathList.List(Index1)
Music.RemoveItem Index1
PathList.RemoveItem Index1
Music.AddItem MusicName, Index2
PathList.AddItem MusicPath, Index2
If i <> Music.ListCount - 2 Then
i = i + 2
End If
ElseIf Letter2 = Letter1 Then
If j >= Len(Music.List(i + 1)) And j < Len(Music.List(i))
Then
GoTo Switch
ElseIf j >= Len(Music.List(i)) Then
GoTo Cont
Else
j = j + 1
GoTo Compare
End If
End If
Cont:
i = i - 1
Loop
End If
Me.Caption = OldCaption
End Sub
Private Sub Play2action_Click()
Module1.Play
End Sub
Private Sub playbutton_Click()
playbutton.Enabled = True
Module1.Play
End Sub
Private Sub pausebutton_Click()
Module1.Pause
End Sub
Private Sub playmenu_Click()
If Music.ListCount > 0 Then
NextAction.Enabled = True
BackAction.Enabled = True
End If
End Sub
6. LAMPIRAN A-6
Private Sub SendToTray_Click()
If InTray = False Then
Me.Hide
Call TrayModule.AddIcon(MainForm, currentlyplaying)
End If
End Sub
Private Sub ShowAction_Click()
If InTray = True Then
MainForm.Show
Call TrayModule.DeleteIcon(MainForm)
End If
End Sub
Private Sub ShuffleAction_Click()
Dim Songs As Integer
Dim i As Integer
Dim NewPos As Integer
Dim Name1 As String
Dim Name2 As String
Dim Path1, Path2 As String
Dim Taken() As Integer
Randomize
Songs = Music.ListCount
ReDim Taken(Songs) As Integer
i = 0
Do While i < Songs
Taken(i) = 0
i = i + 1
Loop
i = 0
Do While i < Songs
If Taken(i) = 0 Then
NewPos = (Rnd * (Songs - 2)) + 1
Taken(i) = 1
Taken(NewPos) = 1
Name1 = Music.List(i)
Path1 = PathList.List(i)
Name2 = Music.List(NewPos)
Path2 = PathList.List(NewPos)
Music.List(i) = Name2
PathList.List(i) = Path2
Music.List(NewPos) = Name1
PathList.List(NewPos) = Path1
End If
i = i + 1
Loop
Music.Refresh
End Sub
Private Sub Slider1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 39 Or KeyCode = 37 Then
On Error GoTo skip
moving = True
End If
Exit Sub
skip:
End Sub
7. LAMPIRAN A-7
Private Sub Slider1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = 39 Or KeyCode = 37 Then
On Error GoTo skip
WindowsMediaPlayer1.Controls.currentPosition = Slider1.Value
leftlabel.Caption = Slider1.Value
moving = False
End If
Exit Sub
skip:
End Sub
Private Sub Slider1_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
On Error GoTo skip
If Button = 1 Then
moving = True
PButton = 1
Else
PButton = 2
End If
Exit Sub
skip:
End Sub
Private Sub Slider1_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
On Error GoTo skip
If PButton = 1 Then
WindowsMediaPlayer1.Controls.currentPosition = Slider1.Value
leftlabel.Caption = Slider1.Value
moving = False
End If
Exit Sub
skip:
End Sub
Private Sub stopbutton_Click()
Module1.StopSong
playbutton.Enabled = True
End Sub
Private Sub Cover_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
If Button = 2 Then
PopupMenu playmenu
End If
End Sub
Sub Segar()
Set rsCari = New ADODB.Recordset
rsCari.Open "Select * from tDataRequest order by IdRequest asc",
CN, 1, 2
Adodc1.Refresh
grid.Refresh
grid.ColWidth(0) = 0
grid.ColWidth(1) = 1000
grid.ColWidth(2) = 1000
grid.ColWidth(3) = 1200
grid.ColWidth(4) = 1200
grid.TextMatrix(0, 0) = ""
grid.TextMatrix(0, 1) = "Id Req"
8. LAMPIRAN A-8
grid.TextMatrix(0, 2) = "Id SMS"
grid.TextMatrix(0, 3) = "Tgl Req"
grid.TextMatrix(0, 4) = "Kode Lagu"
Set rsCari = Nothing
End Sub
Private Sub Form_Activate()
Call Segar
End Sub
Private Sub Form_Load()
Koneksi
Dim FR As Integer
Dim FullName As String
Dim i As Integer
Dim DirName As String
FR = FreeFile
Music.Clear
PathList.Clear
VolumeControl.Value = WindowsMediaPlayer1.Settings.Volume
leftlabel.Caption = "-1"
moving = False
autoloading = True
If DirName <> "" Then
Do While Not EOF(FR)
Input #FR, FullName
PathList.AddItem FullName
MusicName = FullName
i = InStr(1, MusicName, "", vbTextCompare)
Do While i > 0
MusicName = Mid(MusicName, i + 1)
i = InStr(1, MusicName, "", vbTextCompare)
Loop
MainForm.Music.AddItem MusicName
Loop
Close #FR
exitloop:
autoloading = False
currentlyplaying = ""
Call OrderAction_Click
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
If InTray = True Then
Call TrayModule.DeleteIcon(MainForm)
End If
Unload Me
Unload AddForm
End Sub
Private Sub minaction_Click()
MainForm.WindowState = 1
Unload AddForm
End Sub
Private Sub pauseaction_Click()
Module1.Pause
End Sub
9. LAMPIRAN A-9
Private Sub playaction_Click()
Module1.Play
End Sub
Private Sub quitaction_Click()
Unload Me
Unload AddForm
End Sub
Private Sub Stopaction_Click()
Module1.StopSong
End Sub
Private Sub Timer1_Timer()
leftlabel.Caption = leftlabel.Caption + 1
If leftlabel.Caption >= WindowsMediaPlayer1.currentMedia.duration And
WindowsMediaPlayer1.currentMedia.duration > 0 Then
On Error GoTo restart
Music.ListIndex = Music.ListIndex + 1
leftlabel.Caption = "0"
End If
Timer1.Enabled = False
Timer1.Enabled = True
If moving = False Then
Timer2.Enabled = True
Slider1.Value = WindowsMediaPlayer1.Controls.currentPosition
End If
Module1.ConvertMinuets (Slider1.Value)
Dim temp As String
temp = CTime
Module1.ConvertMinuets (WindowsMediaPlayer1.currentMedia.duration)
Slider1.ToolTipText = temp & "/" & CTime
Exit Sub
restart: Music.ListIndex = 0
leftlabel.Caption = "0"
End Sub
Private Sub Timer2_Timer()
On Error GoTo atempt
currentduration = WindowsMediaPlayer1.currentMedia.duration
Slider1.Max = currentduration
Timer2.Enabled = False
Exit Sub
atempt: currentduration = WindowsMediaPlayer1.currentMedia.duration
If currentduration > 0 Then Slider1.Max = currentduration
Timer2.Enabled = False
End Sub
Private Sub TrayBack_Click()
On Error GoTo 1
If Music.ListIndex > 0 Then
Music.ListIndex = Music.ListIndex - 1
Else
GoTo 1
End If
Exit Sub
1: Music.ListIndex = Music.ListCount - 1
End Sub
10. LAMPIRAN A-10
Private Sub TrayExit_Click()
Unload Me
Unload AddForm
End Sub
Private Sub TrayMenu_Click()
If playbutton.Enabled = True Then
TrayPlay.Enabled = True
Else
TrayPlay.Enabled = False
End If
If pausebutton.Enabled = True Then
TrayPause.Enabled = True
Else
TrayPause.Enabled = False
End If
If stopbutton.Enabled = True Then
TrayStop.Enabled = True
Else
TrayStop.Enabled = False
End If
If Music.ListCount > 0 Then
TrayNext.Enabled = True
TrayBack.Enabled = True
Else
TrayNext.Enabled = False
TrayBack.Enabled = False
End If
End Sub
Private Sub TrayNext_Click()
On Error GoTo 1
Music.ListIndex = Music.ListIndex + 1
Exit Sub
1: Music.ListIndex = 0
End Sub
Private Sub TrayPause_Click()
Module1.Pause
End Sub
Private Sub TrayPlay_Click()
Module1.Play
End Sub
Private Sub TrayStop_Click()
Module1.StopSong
End Sub
Private Sub Unload2action_Click()
On Error GoTo skip
Dim i
For i = 0 To Music.ListCount - 1
If Music.Selected(i) Then
Music.RemoveItem (i)
WindowsMediaPlayer1.Controls.Stop
Timer1.Enabled = False
11. LAMPIRAN A-11
playbutton.Enabled = True
Playaction.Enabled = True
Play2action.Enabled = False
leftlabel.Caption = "0"
stopbutton.Enabled = False
stopaction.Enabled = False
pausebutton.Enabled = False
pauseaction.Enabled = False
End If
Next i
Exit Sub
skip:
End Sub
Private Sub unloadaction_Click()
Music.Clear
Timer1.Enabled = False
WindowsMediaPlayer1.Controls.Stop
leftlabel.Caption = "0"
playbutton.Enabled = False
Playaction.Enabled = False
Play2action.Enabled = False
stopbutton.Enabled = False
stopaction.Enabled = False
pausebutton.Enabled = False
pauseaction.Enabled = False
Me.Caption = "J34 Media Player"
End Sub
Private Sub VolumeControl_Change()
WindowsMediaPlayer1.Settings.Volume = VolumeControl.Value
End Sub
Private Sub VolumeControl_MouseMove(Button As Integer, Shift As
Integer, X As Single, Y As Single)
VolumeControl.ToolTipText = VolumeControl.Value
End Sub
Private Sub WindowsMediaPlayer1_MouseDown(ByVal nButton As Integer,
ByVal nShiftState As Integer, ByVal fX As Long, ByVal fY As Long)
If nButton = 2 Then
PopupMenu playmenu
End If
End Sub
4. Menu Utility
Private Sub cmdLagu_Click()
frmLagu.Show
End Sub
Private Sub cmdUser_Click()
frmUser.Show
End Sub
Private Sub cmdKeluar_Click()
Me.Hide
Unload Me
frmUtama.Show
End Sub
12. LAMPIRAN A-12
Private Sub Form_Unload(Cancel As Integer)
Me.Hide
Unload Me
frmUtama.Show
End Sub
5. Data Lagu
Option Explicit
Dim rsKata As Recordset
Sub Segar()
Set rsCari = New ADODB.Recordset
rsCari.Open "Select * from tLagu order by KdLagu asc", CN, 1, 2
Adodc1.Refresh
grid.Refresh
grid.ColWidth(0) = 0
grid.ColWidth(1) = 1000
grid.ColWidth(2) = 4000
grid.ColWidth(3) = 7000
grid.TextMatrix(0, 0) = ""
grid.TextMatrix(0, 1) = "Kode"
grid.TextMatrix(0, 2) = "Nama Lagu"
grid.TextMatrix(0, 3) = "Nama File"
End Sub
Private Sub cmdBatal_Click()
mati
bersih
tambah = False
Cari = False
ubah = False
cmdTambah.Enabled = True
cmdCari.Enabled = True
cmdRubah.Visible = True
cmdRubah.Enabled = False
cmdUpdate.Visible = False
cmdHapus.Enabled = False
cmdBatal.Enabled = True
cmdTambah.Visible = True
cmdTambah.Enabled = True
cmdSave.Visible = False
cmdTambah.SetFocus
End Sub
Private Sub cmdBrowse_Click()
On Error Resume Next
cmdBrowse.Enabled = False
With CommonDialog1
.FileName = "*.mp3"
.Filter = "mp3"
.DialogTitle = "Pilih File Lagu"
.ShowOpen
txtNama = .FileTitle
txtNmFile.Text = .FileName 'Left(.FileTitle, Len(.FileTitle) - 4)
End With
If tambah = True Then
cmdSave.Visible = True
cmdTambah.Visible = False
End If
End Sub
13. LAMPIRAN A-13
Private Sub cmdCari_Click()
Cari = True
tambah = False
ubah = False
cmdTambah.Enabled = False
cmdCari.Enabled = False
txtKode.Locked = False
txtKode.SetFocus
End Sub
Private Sub cmdHapus_Click()
rsCari.Delete
Set rsCari = Nothing
MsgBox "Data sudah dihapus"
mati
bersih
Segar
cmdHapus.Enabled = False
cmdRubah.Visible = True
cmdUpdate.Visible = False
cmdRubah.Enabled = False
cmdTambah.Visible = True
cmdTambah.Enabled = True
cmdCari.Enabled = True
cmdTambah.SetFocus
End Sub
Private Sub cmdKeluar_Click()
Unload Me
End Sub
Private Sub cmdRubah_Click()
ubah = True
Cari = False
tambah = False
cmdBrowse.Enabled = True
cmdRubah.Visible = False
cmdUpdate.Visible = True
cmdHapus.Enabled = False
txtNama.Locked = False
txtNama.SetFocus
End Sub
Private Sub cmdSave_Click()
cmdSave.Visible = False
cmdTambah.Visible = True
Call Save
Call bersih
Call mati
Call Segar
cmdTambah.SetFocus
End Sub
Private Sub cmdTambah_Click()
tambah = True
Cari = False
ubah = False
cmdBrowse.Enabled = True
cmdTambah.Enabled = False
cmdSave.Visible = True
14. LAMPIRAN A-14
cmdCari.Enabled = False
txtKode.Locked = False
txtKode.SetFocus
End Sub
Private Sub cmdUpdate_Click()
Set rsUbah = New ADODB.Recordset
rsUbah.Open "Update tLagu set NmFile='" & txtNmFile.Text &
"',NmLagu='" & txtNama.Text & "'where KdLagu='" & txtKode.Text & "'",
CN, adOpenDynamic, adLockOptimistic
ubah = False
mati
bersih
Segar
MsgBox "Data Lagu sudah di Update"
cmdUpdate.Visible = False
cmdHapus.Enabled = False
cmdRubah.Visible = True
cmdRubah.Enabled = False
cmdCari.Enabled = True
cmdTambah.Visible = True
cmdTambah.Enabled = True
cmdTambah.SetFocus
End Sub
Sub Simpan()
Set rsSimpan = New ADODB.Recordset
rsSimpan.Open "tLagu", CN, adOpenDynamic, adLockOptimistic
rsSimpan.AddNew
rsSimpan!KdLagu = txtKode.Text
rsSimpan!Nmlagu = txtNama.Text
rsSimpan!NmFile = txtNmFile.Text
rsSimpan!UserID = frmLogON.cboUser.Text
rsSimpan.Update
End Sub
Private Sub Form_Activate()
mati
bersih
grid.ColWidth(0) = 0
grid.ColWidth(1) = 1000
grid.ColWidth(2) = 4000
grid.ColWidth(3) = 7000
grid.TextMatrix(0, 0) = ""
grid.TextMatrix(0, 1) = "Kode"
grid.TextMatrix(0, 2) = "Nama Lagu"
grid.TextMatrix(0, 3) = "Nama File"
cmdCari.Enabled = True
cmdTambah.Enabled = True
cmdRubah.Enabled = False
cmdUpdate.Visible = False
cmdSave.Visible = False
cmdHapus.Enabled = False
cmdBatal.Enabled = True
cmdBrowse.Enabled = False
cmdTambah.SetFocus
End Sub
Private Sub Form_Load()
Koneksi
End Sub
15. LAMPIRAN A-15
Sub mati()
txtKode.Locked = True
txtNama.Locked = True
txtNmFile.Locked = True
End Sub
Sub bersih()
txtKode = ""
txtNama = ""
txtNmFile = ""
End Sub
Sub Save()
If txtKode.Text <> "" Then
Set rsCari = New ADODB.Recordset
rsCari.Open "Select * from tLagu where kdLagu='" &
txtKode.Text & "'", CN, 1, 3
If tambah = True Then
If rsCari.EOF = True Then
'txtNama.Text = CommonDialog1.FileName
X = MsgBox("Mau disimpan ?", vbYesNo)
If X = vbYes Then
Simpan
mati
Segar
bersih
tambah = False
MsgBox "Data sudah di Simpan"
cmdTambah.Enabled = True
cmdCari.Enabled = True
cmdRubah.Enabled = False
cmdTambah.SetFocus
Else
mati
bersih
tambah = False
cmdTambah.Enabled = True
cmdCari.Enabled = True
cmdRubah.Enabled = False
cmdTambah.SetFocus
End If
Else
MsgBox "Data sudah ada"
txtKode = ""
txtNama = ""
cmdBrowse.Enabled = True
cmdBrowse.SetFocus
End If
End If
End If
End Sub
Private Sub txtKode_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If Cari = True Then
Set rsCari = New ADODB.Recordset
rsCari.Open "Select * from tLagu where Kata='" & txtKode.Text
& "'", CN, 1, 3
If Not rsCari.EOF = True Then
txtNama.Text = rsCari!NmFileSuara
16. LAMPIRAN A-16
cmdRubah.Enabled = True
cmdHapus.Enabled = True
cmdRubah.SetFocus
Else
MsgBox "Data tidak ada"
txtKode.Text = ""
txtKode.SetFocus
End If
End If
End If
End Sub
Private Sub txtKode_Change()
If Len(txtKode) < 5 Then
Exit Sub
Else
Set rsCari = New ADODB.Recordset
rsCari.Open "select * from tLagu where kdLagu='" &
txtKode.Text & "'", CN, 1, 2
If tambah = True Then
If Not rsCari.EOF Then
MsgBox "Kode sudah ada"
txtKode = ""
txtKode.SetFocus
Else
txtNama.Locked = False
txtNama.SetFocus
End If
ElseIf Cari = True Then
If rsCari.EOF Then
MsgBox "Kode tidak ada"
txtKode = ""
txtKode.SetFocus
Else
txtNama = rsCari!Nmlagu
txtNmFile = rsCari!NmFile
cmdRubah.Enabled = True
cmdHapus.Enabled = True
cmdRubah.SetFocus
End If
End If
End If
End Sub
Private Sub txtNama_Change()
If ubah = True Then
cmdRubah.Visible = False
cmdHapus.Enabled = False
cmdUpdate.Visible = True
End If
End Sub
Private Sub txtNama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdBrowse.Enabled = True
cmdBrowse.SetFocus
End If
End Sub
17. LAMPIRAN A-17
6. Data User
Option Explicit
Dim rsPasswd As Recordset
Private Sub cmdBatal_Click()
txtUserID.Text = ""
txtPasswd.Text = ""
ubah = False
tambah = False
Cari = False
cmdRubah.Enabled = False
cmdHapus.Enabled = False
cmdCari.Enabled = True
cmdTambah.Enabled = True
cmdTambah.SetFocus
End Sub
Private Sub cmdCari_Click()
Cari = True
cmdTambah.Enabled = False
cmdCari.Enabled = False
txtUserID.Locked = False
txtUserID.SetFocus
End Sub
Private Sub cmdHapus_Click()
rsCari.Delete
mati
bersih
MsgBox "User sudah di hapus ..."
cmdRubah.Visible = True
cmdUpdate.Visible = False
cmdRubah.Enabled = False
cmdHapus.Enabled = False
cmdCari.Enabled = True
cmdSave.Visible = False
cmdTambah.Visible = True
cmdTambah.Enabled = True
cmdTambah.SetFocus
End Sub
Private Sub cmdKeluar_Click()
Unload Me
End Sub
Private Sub cmdRubah_Click()
ubah = True
cmdRubah.Visible = False
cmdHapus.Enabled = False
cmdUpdate.Visible = True
txtPasswd.Locked = False
txtPasswd.SetFocus
End Sub
Private Sub cmdSave_Click()
If tambah = True Then
Call Save
End If
End Sub
18. LAMPIRAN A-18
Private Sub cmdTambah_Click()
tambah = True
cmdTambah.Visible = False
cmdSave.Visible = True
cmdCari.Enabled = False
cmdCari.Enabled = False
txtUserID.Locked = False
txtUserID.SetFocus
End Sub
Private Sub cmdUpdate_Click()
If ubah = True Then
Set rsUbah = New ADODB.Recordset
rsUbah.Open "Update tUser Set Passwd ='" & txtPasswd.Text &
"' where UserID ='" & txtUserID.Text & "'", CN, adOpenDynamic,
adLockOptimistic
MsgBox "Data sudah Ubah"
ubah = False
mati
bersih
cmdRubah.Visible = True
cmdUpdate.Visible = False
cmdRubah.Enabled = False
cmdHapus.Enabled = False
cmdCari.Enabled = True
cmdSave.Visible = False
cmdTambah.Visible = True
cmdTambah.Enabled = True
cmdTambah.SetFocus
End If
End Sub
Private Sub Form_Activate()
txtUserID.Locked = True
txtPasswd.Text = ""
txtUserID.Text = ""
ubah = False
tambah = False
Cari = False
cmdRubah.Visible = True
cmdRubah.Enabled = False
cmdUpdate.Visible = False
cmdHapus.Enabled = False
cmdCari.Enabled = True
cmdTambah.Visible = True
cmdSave.Visible = False
cmdTambah.Enabled = True
cmdTambah.SetFocus
End Sub
Sub mati()
txtUserID.Locked = True
txtPasswd.Locked = True
End Sub
Sub bersih()
txtUserID.Text = ""
txtPasswd.Text = ""
End Sub
19. LAMPIRAN A-19
Private Sub Form_Load()
Koneksi
End Sub
Private Sub txtpasswd_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If tambah = True Then
cmdSave.Visible = True
cmdTambah.Visible = False
cmdSave.SetFocus
ElseIf ubah = True Then
cmdRubah.Enabled = True
cmdRubah.SetFocus
End If
End If
End Sub
Sub Save()
Set rsPasswd = New ADODB.Recordset
rsPasswd.Open "Select * from tUser where UserID='" &
txtUserID.Text & "' and Passwd='" & txtPasswd.Text & "'", CN,
adOpenDynamic, adLockOptimistic
If tambah = True Then
If rsPasswd.EOF = True Then
Set rsSimpan = New ADODB.Recordset
rsSimpan.Open "select * from tUser", CN,
adOpenDynamic, adLockOptimistic
rsSimpan.AddNew
rsSimpan.Fields("UserID") = txtUserID.Text
rsSimpan.Fields("Passwd") = txtPasswd.Text
rsSimpan.Update
mati
bersih
MsgBox "Data sudah tersimpan"
tambah = False
cmdRubah.Visible = True
cmdUpdate.Visible = False
cmdRubah.Enabled = False
cmdHapus.Enabled = False
cmdCari.Enabled = True
cmdSave.Visible = False
cmdTambah.Visible = True
cmdTambah.Enabled = True
cmdTambah.SetFocus
Else
MsgBox "User sudah ada ..."
txtPasswd.Text = ""
txtUserID.Text = ""
txtUserID.SetFocus
End If
End If
End Sub
Private Sub txtUserId_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
If tambah = True Then
Set rsCari = New ADODB.Recordset
rsCari.Open "Select * from tUser where UserID='" &
txtUserID.Text & "'", CN, adOpenDynamic, adLockOptimistic
20. LAMPIRAN A-20
If rsCari.EOF = True Then
txtPasswd.Locked = False
txtPasswd.SetFocus
Else
MsgBox "User sudah ada ..."
txtUserID.Text = ""
txtPasswd.Text = ""
txtUserID.SetFocus
End If
ElseIf Cari = True Then
Set rsCari = New ADODB.Recordset
rsCari.Open "Select * from tUser where UserID='" &
txtUserID.Text & "'", CN, adOpenDynamic, adLockOptimistic
If rsCari.EOF = True Then
MsgBox "User belum ada ..."
txtUserID.Text = ""
txtUserID.SetFocus
Else
txtPasswd.Text = rsCari.Fields("Passwd")
cmdRubah.Enabled = True
cmdHapus.Enabled = True
cmdRubah.SetFocus
End If
End If
End If
End Sub
7.About
Private Sub cmdKeluar_Click()
Unload frmAbout
End Sub
8. Module-1(modPlayer)
Option Explicit
Private Const BIF_STATUSTEXT = &H4&
Private Const BIF_RETURNONLYFSDIRS = 1
Private Const BIF_DONTGOBELOWDOMAIN = 2
Private Const MAX_PATH = 260
Private Const WM_USER = &H400
Private Const BFFM_INITIALIZED = 1
Private Const BFFM_SELCHANGED = 2
Private Const BFFM_SETSTATUSTEXT = (WM_USER + 100)
Private Const BFFM_SETSELECTION = (WM_USER + 102)
Private Declare Function SendMessage Lib "user32" Alias
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam
As Long, ByVal lParam As String) As Long
Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As
BrowseInfo) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal
pidList As Long, ByVal lpBuffer As String) As Long
Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA"
(ByVal lpString1 As String, ByVal lpString2 As String) As Long
21. LAMPIRAN A-21
Private Type BrowseInfo
hWndOwner As Long
pIDLRoot As Long
pszDisplayName As Long
lpszTitle As Long
ulFlags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
End Type
Private m_CurrentDirectory As String
Public Function BrowseForFolder(owner As Form, Title As String,
StartDir As String) As String
Dim lpIDList As Long
Dim szTitle As String
Dim sBuffer As String
Dim tBrowseInfo As BrowseInfo
m_CurrentDirectory = StartDir & vbNullChar
szTitle = Title
With tBrowseInfo
.hWndOwner = owner.hwnd
.lpszTitle = lstrcat(szTitle, "")
.ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN +
BIF_STATUSTEXT
.lpfnCallback = GetAddressofFunction(AddressOf _
BrowseCallbackProc) 'get address of function.
End With
lpIDList = SHBrowseForFolder(tBrowseInfo)
If (lpIDList) Then
sBuffer = Space(MAX_PATH)
SHGetPathFromIDList lpIDList, sBuffer
sBuffer = Left(sBuffer, InStr(sBuffer, vbNullChar) - 1)
BrowseForFolder = sBuffer
Else
BrowseForFolder = ""
End If
End Function
Private Function BrowseCallbackProc(ByVal hwnd As Long, ByVal uMsg As
Long, ByVal lp As Long, ByVal pData As Long) As Long
Dim lpIDList As Long
Dim ret As Long
Dim sBuffer As String
On Error Resume Next
Select Case uMsg
Case BFFM_INITIALIZED
Call SendMessage(hwnd, BFFM_SETSELECTION, 1,_
m_CurrentDirectory)
Case BFFM_SELCHANGED
sBuffer = Space(MAX_PATH)
ret = SHGetPathFromIDList(lp, sBuffer)
If ret = 1 Then
Call SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, sBuffer)
End If
End Select
22. LAMPIRAN A-22
BrowseCallbackProc = 0
End Function
Private Function GetAddressofFunction(add As Long) As Long
GetAddressofFunction = add
End Function
9. Module-2 (ModRequest)
Option Explicit
Global CN As Connection
Public tambah As Boolean
Public Cari As Boolean
Public ubah As Boolean
Public X As String
Public rsSimpan As Recordset
Public rsSimpan1 As Recordset
Public rsCari As Recordset
Public rsUbah As Recordset
Public rsHapus As Recordset
Public rsStatus As Recordset
Public rsUpdate As Recordset
Public rsSegar As Recordset
Global Const SND_ASYNC = &H1, SND_NOSTOP = &H10
Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As
Integer
Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Declare Function mciSendString Lib "winmm.dll" Alias
"mciSendStringA" _
(ByVal lpstrCommand As
String, _
ByVal lpstrReturnString
As String, _
ByVal uReturnLength As
Long, _
ByVal hwndCallback As
Long) As Long
Public Sub Koneksi()
Set CN = New ADODB.Connection
CN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
& App.Path & "dbSMSRequest.mdb;Persist Security Info=False"
CN.Open
End Sub
10. Module-3 (Module1)
Option Explicit
Public location As String
Public MusicName As String
Public moving As Boolean
Public currentduration As Integer
Public autoloading As Boolean
Public currentlyplaying As String
Public PButton As Single
Public CTime As String
Public Activated As Boolean
23. LAMPIRAN A-23
Public Sub SaveFile()
Dim FR As Integer
Dim Line As String
Dim i As Integer
Dim Max As Integer
FR = FreeFile
i = 0
Max = MainForm.Music.ListCount
Open App.Path & "Uploaded Music.J34" For Output As #FR
Do While i < Max
Print #FR, MainForm.PathList.List(i)
i = i + 1
Loop
Close #FR
End Sub
Public Function ReadFile() As String
On Error GoTo BlankFile
Dim FR As Integer
Dim FileContents As String
Dim FileLine
FR = FreeFile
Do While Not EOF(FR)
Line Input #FR, FileLine
FileContents = FileContents & vbNewLine & FileLine
Loop
Close #FR
ReadFile = FileContents
Exit Function
BlankFile:
ReadFile = ""
End Function
Public Sub ConvertMinuets(ByVal Sec As Integer)
If Sec Mod 60 = 0 Then
CTime = Sec 60
Else
CTime = Sec 60 & " " & Sec Mod 60
End If
End Sub
Public Sub Play()
MainForm.WindowsMediaPlayer1.Controls.Play
Dim mlength As Integer
Dim mstring As String
mlength = Len(MusicName)
mstring = Right(MusicName, 3)
If mstring = ".wm" Then
MusicName = VBA.Strings.Left(MusicName, mlength - 3)
Else
mstring = Right(MusicName, 4)
If mstring = ".mp3" Or mstring = ".asf" Or mstring = ".wma" Or
mstring = ".wav" Or mstring = ".snd" Then
MusicName = VBA.Strings.Left(MusicName, mlength - 4)
End If
End If
If (currentlyplaying = "") = False Then MusicName = currentlyplaying
MainForm.Caption = MusicName
If InTray = False Then MainForm.pausebutton.SetFocus
End Sub
24. LAMPIRAN A-24
Public Sub Pause()
MainForm.WindowsMediaPlayer1.Controls.Pause
End Sub
Public Sub StopSong()
MainForm.WindowsMediaPlayer1.Controls.Stop
End Sub
Public Sub MusicClick()
Dim mlength As Integer
Dim mstring As String
MusicName = MainForm.Music.Text
MainForm.PathList.List(MainForm.Music.ListIndex)
MainForm.WindowsMediaPlayer1.URL = MainForm.lblNmFile
MainForm.Caption = ""
mlength = Len(MusicName)
mstring = Right(MusicName, 3)
If mstring = ".wm" Then
MusicName = VBA.Strings.Left(MusicName, mlength - 3)
Else
mstring = Right(MusicName, 4)
If mstring = ".mp3" Or mstring = ".asf" Or mstring = ".wma" Or
mstring = ".wav" Or mstring = ".snd" Then
MusicName = VBA.Strings.Left(MusicName, mlength - 4)
End If
End If
MainForm.Caption = MusicName
MainForm.WindowsMediaPlayer1.Controls.Play
currentduration = MainForm.WindowsMediaPlayer1.currentMedia.duration
MainForm.Timer1.Enabled = False
MainForm.Timer1.Enabled = True
MainForm.leftlabel.Caption = "0"
MainForm.playbutton.Enabled = False
MainForm.pausebutton.Enabled = True
MainForm.stopbutton.Enabled = True
currentlyplaying = MusicName
If InTray = True Then
Call ModifyIcon(MainForm, currentlyplaying)
End If
End Sub
11. Module-4 (TrayModule)
Public Declare Function Shell_NotifyIconA Lib "shell32.dll" (ByVal
dwMessage As Long, lpData As NOTIFYICONDATA) As Integer
Const NIM_ADD = &H0
Const NIM_MODIFY = &H1
Const NIM_DELETE = &H2
Const NIF_MESSAGE = &H1
Const NIF_ICON = &H2
Const NIF_TIP = &H4
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_LBUTTONDBLCLK = &H203
25. LAMPIRAN A-25
Public Type NOTIFYICONDATA
cbSize As Long
hwnd As Long
uID As Long
uFlags As Long
uCallbackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Public InTray As Boolean
Public Sub AddIcon(TargetForm As Form, ToolTip As String)
Dim AddIconData As NOTIFYICONDATA
With AddIconData
.cbSize = Len(AddIconData)
.hIcon = TargetForm.Icon
.hwnd = TargetForm.hwnd
.szTip = ToolTip & vbNullChar
.uCallbackMessage = WM_LBUTTONDOWN
.uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
.uID = vbNull
End With
Call Shell_NotifyIconA(NIM_ADD, AddIconData)
InTray = True
End Sub
Public Sub ModifyIcon(TargetForm As Form, ToolTip As String)
Dim AddIconData As NOTIFYICONDATA
With AddIconData
.cbSize = Len(AddIconData)
.hIcon = TargetForm.Icon
.hwnd = TargetForm.hwnd
.szTip = ToolTip & vbNullChar
.uCallbackMessage = WM_LBUTTONDOWN
.uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
.uID = vbNull
End With
Call Shell_NotifyIconA(NIM_MODIFY, AddIconData)
InTray = True
End Sub
Public Sub DeleteIcon(TargetForm As Form)
Dim AddIconData As NOTIFYICONDATA
With AddIconData
.cbSize = Len(AddIconData)
.hIcon = vbNull
.hwnd = TargetForm.hwnd
.szTip = "" & vbNullChar
.uCallbackMessage = vbNull
.uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
.uID = vbNull
End With
Call Shell_NotifyIconA(NIM_DELETE, AddIconData)
InTray = False
End Sub