This document summarizes a MongoDB live coding session presented by Tobias Trelle. It introduces MongoDB concepts like documents, collections, CRUD operations, queries including geospatial queries, replication, sharding, and the Java and Spring Data APIs. It also advertises MongoDB user groups in Dusseldorf and Frankfurt organized by codecentric AG.
This document contains a QTP script for testing attributes on real estate listings. The script:
1. Connects to a database to retrieve listing details for testing.
2. Opens a browser and navigates to a listing to check if its property information includes "Lot size is 100 or more acres".
3. If not found, the test fails and results are appended to an Excel file.
4. The browser is then used to search for listings matching the retrieved criteria to verify attributes are set correctly.
4Developers: Michał Szczepanik- Kotlin - Let’s ketchup itPROIDEA
Niektóre rzeczy trzeba dobrze przyprawić żeby były lepsze ... tak samo jest z pisaniem aplikacji na Androida. Jako programiści zaczynamy mieć czasami dość Javy i chcielibyśmy się przerzucić na coś lepszego i czytelniejszego. Takim rozwiązaniem może okazać się Kotlin. O zaletach języka i o tym jak może ułatwić pracę z Androidem dowiecie się podczas tego wykładu.
The document describes refactoring legacy code for a push notification daemon. It starts with a single long method that handles both pushing notifications to a queue and processing incoming requests over UDP. It goes through a series of refactoring steps like extracting methods, extracting classes, and replacing methods with objects to break the class into separate concerns and make it more extensible and maintainable. This includes creating separate Worker, UDPServer, and PushDaemon classes with clear responsibilities.
Czym się różnie JMS od AMQP? Co to jest queue? Co to jest topic? Jak zlecać zadania w przyszłości używając kolejek? Jak się do tego podpiąć z Javy? Na te i inne pytania postaram się odpowiedzieć na mojej prezentacji.
The document summarizes the current state of coroutines in Kotlin. Coroutines allow writing asynchronous, non-blocking code in a sequential style by suspending execution until operations complete. Key features include launch and async for starting coroutines, channels for communication, actors for message processing, and integration with frameworks like RxJava. Coroutines are ready for production use but still experimental to allow API changes in future versions.
BDD - Behavior Driven Development Webapps mit Groovy Spock und GebChristian Baranowski
The document discusses Behavior Driven Development (BDD) using Groovy, Spock and Geb. It provides an overview of BDD and defines the given-when-then structure. It then demonstrates various Groovy and Spock features for writing BDD tests including classes, methods, collections, closures, assertions and mock objects. Spock allows writing tests in a readable and expressive manner with support for parameterization and different test lifecycle methods.
This document discusses the ql.io open source project, which provides a domain specific language (DSL) for making HTTP requests. The DSL allows HTTP resources to be treated like database tables, enabling CRUD operations on those resources with a SQL-like syntax. Ql.io can be used as an HTTP gateway and allows parallelizing and joining requests. It aims to simplify writing code for making API calls. The document provides examples of using the ql.io DSL and discusses how it can be used as a Node.js module.
This document summarizes a MongoDB live coding session presented by Tobias Trelle. It introduces MongoDB concepts like documents, collections, CRUD operations, queries including geospatial queries, replication, sharding, and the Java and Spring Data APIs. It also advertises MongoDB user groups in Dusseldorf and Frankfurt organized by codecentric AG.
This document contains a QTP script for testing attributes on real estate listings. The script:
1. Connects to a database to retrieve listing details for testing.
2. Opens a browser and navigates to a listing to check if its property information includes "Lot size is 100 or more acres".
3. If not found, the test fails and results are appended to an Excel file.
4. The browser is then used to search for listings matching the retrieved criteria to verify attributes are set correctly.
4Developers: Michał Szczepanik- Kotlin - Let’s ketchup itPROIDEA
Niektóre rzeczy trzeba dobrze przyprawić żeby były lepsze ... tak samo jest z pisaniem aplikacji na Androida. Jako programiści zaczynamy mieć czasami dość Javy i chcielibyśmy się przerzucić na coś lepszego i czytelniejszego. Takim rozwiązaniem może okazać się Kotlin. O zaletach języka i o tym jak może ułatwić pracę z Androidem dowiecie się podczas tego wykładu.
The document describes refactoring legacy code for a push notification daemon. It starts with a single long method that handles both pushing notifications to a queue and processing incoming requests over UDP. It goes through a series of refactoring steps like extracting methods, extracting classes, and replacing methods with objects to break the class into separate concerns and make it more extensible and maintainable. This includes creating separate Worker, UDPServer, and PushDaemon classes with clear responsibilities.
Czym się różnie JMS od AMQP? Co to jest queue? Co to jest topic? Jak zlecać zadania w przyszłości używając kolejek? Jak się do tego podpiąć z Javy? Na te i inne pytania postaram się odpowiedzieć na mojej prezentacji.
The document summarizes the current state of coroutines in Kotlin. Coroutines allow writing asynchronous, non-blocking code in a sequential style by suspending execution until operations complete. Key features include launch and async for starting coroutines, channels for communication, actors for message processing, and integration with frameworks like RxJava. Coroutines are ready for production use but still experimental to allow API changes in future versions.
BDD - Behavior Driven Development Webapps mit Groovy Spock und GebChristian Baranowski
The document discusses Behavior Driven Development (BDD) using Groovy, Spock and Geb. It provides an overview of BDD and defines the given-when-then structure. It then demonstrates various Groovy and Spock features for writing BDD tests including classes, methods, collections, closures, assertions and mock objects. Spock allows writing tests in a readable and expressive manner with support for parameterization and different test lifecycle methods.
This document discusses the ql.io open source project, which provides a domain specific language (DSL) for making HTTP requests. The DSL allows HTTP resources to be treated like database tables, enabling CRUD operations on those resources with a SQL-like syntax. Ql.io can be used as an HTTP gateway and allows parallelizing and joining requests. It aims to simplify writing code for making API calls. The document provides examples of using the ql.io DSL and discusses how it can be used as a Node.js module.
MongoDB is the trusted document store we turn to when we have tough data store problems to solve. For this talk we are going to go a little bit off the path and explore what other roles we can fit MongoDB into. Others have discussed how to turn MongoDB’s capped collections into a publish/subscribe server. We stretch that a little further and turn MongoDB into a full fledged broker with both publish/subscribe and queue semantics, and a the ability to mix them. We will provide code and a running demo of the queue producers and consumers. Next we will turn to coordination services: We will explore the fundamental features and show how to implement them using MongoDB as the storage engine. Again we will show the code and demo the coordination of multiple applications.
Beginning direct3d gameprogrammingcpp02_20160324_jintaeksJinTaek Seo
This document provides an overview of C++11 features for beginning Direct3D game programming. It discusses key additions to the C++ core language in C++11 like rvalue references and move semantics, which improve efficiency by allowing objects to be "moved" rather than copied. It also covers uniform initialization syntax that allows initializing objects in a consistent way. Standard library features like extern templates and initializer lists that were added to C++11 are described. The document provides examples to illustrate concepts like trivial types and how rvalue references work. Overall, it serves as a useful primer on C++11 for someone new to game programming with a focus on important language and library improvements introduced in that version.
Switch case is a type of selection control mechanism that allows the value of a variable to control program flow via branches. It improves clarity over repetitive coding and can optimize execution speed. Examples show switch case being used to output different text based on the value of variables like grades, genders, and numbers. Loops are used to repeat a block of code. They allow simple statements to produce greater results through repetition. Examples demonstrate using loops to repeatedly output text, request passwords, and calculate falling distances over time.
Weaponizing the Windows API with Metasploit's RailgunTheLightcosine
This document provides an overview of Railgun, which allows arbitrary loading of DLLs and access to the entire Windows API through Metasploit payloads. Railgun extends Meterpreter to provide dynamic access to Windows functions. It works by loading DLLs at known paths and calling functions through GetProcAddress. Parameters are passed as strings, DWORDs, or other expected types. Railgun returns results including error codes and OUT parameters. This allows post-exploitation capabilities like decrypting stored passwords or scanning wireless networks by calling Windows APIs from injected payloads.
This document discusses WordNet and how it can be used with NLTK and Python. It provides examples of accessing WordNet synsets and lexical relations. Some key points covered include:
- WordNet is a lexical database that contains words and relationships between words like synonyms, hypernyms, and antonyms.
- The nltk.corpus.wordnet module can be used to access WordNet data in Python.
- Functions like synsets, lemma_names, and lemmas are used to retrieve information about synsets and their members.
- Relationships like hyponyms, hypernyms, meronyms, and entailments connect synsets and can be navigated.
- Path similarity measures
Lenses and Prisms in Swift - Elviro Rocca - Codemotion Rome 2018 Codemotion
The concept of functional Lens has become pretty popular in functional programming circles, and there are already good contributions for applying lenses to other, traditionally imperative/OO contexts. I’d like to offer a more in depth view on why lenses can be useful in Swift, and also talk about an associated concept called Prism. Let’s consider some practical problems and confront an idiomatic/imperative approach to the one based on lenses and prisms.
Poche chiacchiere e tanto codice per cercare rendere la nostra vita di
sviluppatori più divertente.
Parleremo di JAX-RS, le annotazioni, l'MVC che mette a disposizione e
l'integrazione di Jersey con Guice.
Useremo AOP per gestire log, transazioni e con l'aiuto di Infinispan
limiteremo le chamate concorrenti sul nostro cluster.
Working with Databases and Groovy
This document discusses how to work with databases using Groovy. It covers:
- Connecting to databases and using groovy.sql.Sql to execute queries and statements
- Performing reads and writes like inserting, updating, deleting rows
- Calling stored procedures
- Advanced techniques like transactions, batching, pagination
- Using groovy.sql.DataSet to treat tables as collections
It also briefly introduces using MongoDB and Neo4j with Groovy.
This document summarizes information about the TIM Computer Training Centre, a franchise of the CADD Centre network that provides CAD and design training. It offers courses in mechanical, architectural, electrical, and civil engineering design, as well as project management. Courses are tailored to industry needs and provide globally recognized certifications. TIM Computer aims to offer high quality, affordable training with flexible scheduling and placement assistance to help students and professionals gain employable skills.
This document describes two machine learning techniques, particle swarm optimization with support vector machines (PSO-SVM) and recursive feature elimination with support vector machines (RFE-SVM), that were used to classify autism neuroimaging data from the Autism Brain Imaging Data Exchange database. PSO-SVM was used to select discriminative features for classification, while RFE-SVM ranked features by importance. Both techniques aimed to improve classification accuracy and reduce overfitting by selecting optimal feature subsets from the high-dimensional neuroimaging data. The results could help develop brain-based diagnostic criteria for autism.
La Regione Puglia tutela e valorizza gli alberi di ulivo monumentali, anche isolati, in virtù della loro funzione produttiva, di difesa ecologica e idrogeologica nonché quali elementi peculiari e caratterizzanti della storia, della cultura e del paesaggio regionale.
Con questa App, la Regione Puglia – Servizio Ecologia intende, in attuazione della legge regionale 14 del 2007, unica nell’intero panorama europeo nel suo genere, favorire la conoscenza del patrimonio ulivetato regionale, nonché fornire un utile strumento agli addetti ai lavori per la rilevazione in campo e il conseguente inserimento negli elenchi regionali, degli ulivi monumentali ai sensi dell’art. 2 della suddetta legge.
Dr. Susan Detmer - Regional Surveillance and Control Strategies for Influenza...John Blue
Regional Surveillance and Control Strategies for Influenza in Swine: It Takes a Province - Dr. Susan Detmer, from the 2016 Allen D. Leman Swine Conference, September 17-20, 2016, St. Paul, Minnesota, USA.
More presentations at http://www.swinecast.com/2016-leman-swine-conference-material
Dr. Alison Van Eenennaam - The GMO Debate: Twenty Years of Animal Health and ...John Blue
The GMO Debate: Twenty Years of Animal Health and Livestock Feeding Studies - Dr. Alison Van Eenennaam, Cooperative Extension Specialist, Animal Biotechnology and Genomics, Department of Animal Science, University of California, Davis, USA, from the 2016 Allen D. Leman Swine Conference, September 17-20, 2016, St. Paul, Minnesota, USA.
More presentations at http://www.swinecast.com/2016-leman-swine-conference-material
The document discusses the applicant's qualifications and experience for a position at a law firm. It describes their experience working on international deals and cases, demonstrating commercial acumen, strong communication and problem-solving skills. The applicant has experience working in integrated teams and navigating complex matters under tight deadlines. Portions of the document containing identifying details of the applicant and previous employers have been redacted.
오큘러스, HTC Vive, 기어 VR, PS VR, 안드로이드 Daydream 등 모든 최신 VR을 지원하고 있는 언리얼 엔진 4를 사용한 대표적인 VR 타이들과 개발 사례를 알아봅니다. 또한 VR을 좀 더 쉽고 편리하게 개발할 수 있는 언리얼 엔진4만의 기능들을 살펴보고, 향후 업데이트 계획을 공유합니다. VR 외에 언리얼 엔진4 AR 개발에 대해서도 살펴볼 예정입니다.
The document discusses Unity workflow for VR, including precautions for performance and the editor's VR. It provides links to tutorials on Unity and Oculus best practices, as well as designing for VR. It discusses differences between physical movement and eye input, and recommends limiting camera rotation and excessive acceleration in VR. It also addresses rendering performance considerations in Unity like draw calls and batching, culling, garbage collection, and optimizations for mobile like textures and polygons.
MongoDB is the trusted document store we turn to when we have tough data store problems to solve. For this talk we are going to go a little bit off the path and explore what other roles we can fit MongoDB into. Others have discussed how to turn MongoDB’s capped collections into a publish/subscribe server. We stretch that a little further and turn MongoDB into a full fledged broker with both publish/subscribe and queue semantics, and a the ability to mix them. We will provide code and a running demo of the queue producers and consumers. Next we will turn to coordination services: We will explore the fundamental features and show how to implement them using MongoDB as the storage engine. Again we will show the code and demo the coordination of multiple applications.
Beginning direct3d gameprogrammingcpp02_20160324_jintaeksJinTaek Seo
This document provides an overview of C++11 features for beginning Direct3D game programming. It discusses key additions to the C++ core language in C++11 like rvalue references and move semantics, which improve efficiency by allowing objects to be "moved" rather than copied. It also covers uniform initialization syntax that allows initializing objects in a consistent way. Standard library features like extern templates and initializer lists that were added to C++11 are described. The document provides examples to illustrate concepts like trivial types and how rvalue references work. Overall, it serves as a useful primer on C++11 for someone new to game programming with a focus on important language and library improvements introduced in that version.
Switch case is a type of selection control mechanism that allows the value of a variable to control program flow via branches. It improves clarity over repetitive coding and can optimize execution speed. Examples show switch case being used to output different text based on the value of variables like grades, genders, and numbers. Loops are used to repeat a block of code. They allow simple statements to produce greater results through repetition. Examples demonstrate using loops to repeatedly output text, request passwords, and calculate falling distances over time.
Weaponizing the Windows API with Metasploit's RailgunTheLightcosine
This document provides an overview of Railgun, which allows arbitrary loading of DLLs and access to the entire Windows API through Metasploit payloads. Railgun extends Meterpreter to provide dynamic access to Windows functions. It works by loading DLLs at known paths and calling functions through GetProcAddress. Parameters are passed as strings, DWORDs, or other expected types. Railgun returns results including error codes and OUT parameters. This allows post-exploitation capabilities like decrypting stored passwords or scanning wireless networks by calling Windows APIs from injected payloads.
This document discusses WordNet and how it can be used with NLTK and Python. It provides examples of accessing WordNet synsets and lexical relations. Some key points covered include:
- WordNet is a lexical database that contains words and relationships between words like synonyms, hypernyms, and antonyms.
- The nltk.corpus.wordnet module can be used to access WordNet data in Python.
- Functions like synsets, lemma_names, and lemmas are used to retrieve information about synsets and their members.
- Relationships like hyponyms, hypernyms, meronyms, and entailments connect synsets and can be navigated.
- Path similarity measures
Lenses and Prisms in Swift - Elviro Rocca - Codemotion Rome 2018 Codemotion
The concept of functional Lens has become pretty popular in functional programming circles, and there are already good contributions for applying lenses to other, traditionally imperative/OO contexts. I’d like to offer a more in depth view on why lenses can be useful in Swift, and also talk about an associated concept called Prism. Let’s consider some practical problems and confront an idiomatic/imperative approach to the one based on lenses and prisms.
Poche chiacchiere e tanto codice per cercare rendere la nostra vita di
sviluppatori più divertente.
Parleremo di JAX-RS, le annotazioni, l'MVC che mette a disposizione e
l'integrazione di Jersey con Guice.
Useremo AOP per gestire log, transazioni e con l'aiuto di Infinispan
limiteremo le chamate concorrenti sul nostro cluster.
Working with Databases and Groovy
This document discusses how to work with databases using Groovy. It covers:
- Connecting to databases and using groovy.sql.Sql to execute queries and statements
- Performing reads and writes like inserting, updating, deleting rows
- Calling stored procedures
- Advanced techniques like transactions, batching, pagination
- Using groovy.sql.DataSet to treat tables as collections
It also briefly introduces using MongoDB and Neo4j with Groovy.
This document summarizes information about the TIM Computer Training Centre, a franchise of the CADD Centre network that provides CAD and design training. It offers courses in mechanical, architectural, electrical, and civil engineering design, as well as project management. Courses are tailored to industry needs and provide globally recognized certifications. TIM Computer aims to offer high quality, affordable training with flexible scheduling and placement assistance to help students and professionals gain employable skills.
This document describes two machine learning techniques, particle swarm optimization with support vector machines (PSO-SVM) and recursive feature elimination with support vector machines (RFE-SVM), that were used to classify autism neuroimaging data from the Autism Brain Imaging Data Exchange database. PSO-SVM was used to select discriminative features for classification, while RFE-SVM ranked features by importance. Both techniques aimed to improve classification accuracy and reduce overfitting by selecting optimal feature subsets from the high-dimensional neuroimaging data. The results could help develop brain-based diagnostic criteria for autism.
La Regione Puglia tutela e valorizza gli alberi di ulivo monumentali, anche isolati, in virtù della loro funzione produttiva, di difesa ecologica e idrogeologica nonché quali elementi peculiari e caratterizzanti della storia, della cultura e del paesaggio regionale.
Con questa App, la Regione Puglia – Servizio Ecologia intende, in attuazione della legge regionale 14 del 2007, unica nell’intero panorama europeo nel suo genere, favorire la conoscenza del patrimonio ulivetato regionale, nonché fornire un utile strumento agli addetti ai lavori per la rilevazione in campo e il conseguente inserimento negli elenchi regionali, degli ulivi monumentali ai sensi dell’art. 2 della suddetta legge.
Dr. Susan Detmer - Regional Surveillance and Control Strategies for Influenza...John Blue
Regional Surveillance and Control Strategies for Influenza in Swine: It Takes a Province - Dr. Susan Detmer, from the 2016 Allen D. Leman Swine Conference, September 17-20, 2016, St. Paul, Minnesota, USA.
More presentations at http://www.swinecast.com/2016-leman-swine-conference-material
Dr. Alison Van Eenennaam - The GMO Debate: Twenty Years of Animal Health and ...John Blue
The GMO Debate: Twenty Years of Animal Health and Livestock Feeding Studies - Dr. Alison Van Eenennaam, Cooperative Extension Specialist, Animal Biotechnology and Genomics, Department of Animal Science, University of California, Davis, USA, from the 2016 Allen D. Leman Swine Conference, September 17-20, 2016, St. Paul, Minnesota, USA.
More presentations at http://www.swinecast.com/2016-leman-swine-conference-material
The document discusses the applicant's qualifications and experience for a position at a law firm. It describes their experience working on international deals and cases, demonstrating commercial acumen, strong communication and problem-solving skills. The applicant has experience working in integrated teams and navigating complex matters under tight deadlines. Portions of the document containing identifying details of the applicant and previous employers have been redacted.
오큘러스, HTC Vive, 기어 VR, PS VR, 안드로이드 Daydream 등 모든 최신 VR을 지원하고 있는 언리얼 엔진 4를 사용한 대표적인 VR 타이들과 개발 사례를 알아봅니다. 또한 VR을 좀 더 쉽고 편리하게 개발할 수 있는 언리얼 엔진4만의 기능들을 살펴보고, 향후 업데이트 계획을 공유합니다. VR 외에 언리얼 엔진4 AR 개발에 대해서도 살펴볼 예정입니다.
The document discusses Unity workflow for VR, including precautions for performance and the editor's VR. It provides links to tutorials on Unity and Oculus best practices, as well as designing for VR. It discusses differences between physical movement and eye input, and recommends limiting camera rotation and excessive acceleration in VR. It also addresses rendering performance considerations in Unity like draw calls and batching, culling, garbage collection, and optimizations for mobile like textures and polygons.
Dokumen tersebut merangkum outlook ekonomi Indonesia tahun 2017. Pertumbuhan ekonomi global diperkirakan membaik namun masih lemah. Indonesia berhasil mempertahankan stabilitas ekonomi dengan tingkat inflasi, pengangguran dan kemiskinan yang terkendali. Pemerintah terus melaksanakan berbagai kebijakan untuk mendorong investasi dan pertumbuhan melalui percepatan proyek infrastruktur dan deregulasi bisnis.
The document analyzes how the demon nun Valak from The Conjuring 2 creates fear in viewers through its portrayal and use of mise-en-scene elements, camerawork, sound, and editing. Specifically, Valak's black nun costume, white face makeup, possession of a child in the realistic setting of Enfield, London portrayed in low-key lighting and close-ups generate unease. Props like a crooked toy man and moving fire engine, as well as silence before non-diegetic sounds and cuts between Valak and protagonist Lorraine Warren, enhance the fear factor for audiences.
Type safe embedded domain-specific languagesArthur Xavier
Language is everything; it governs our lives: from our thought processes, our communication abilities and our understanding of the world, all the way up to law, politics, logic and programming. All of these domains of human experience are governed by different languages that talk to each other, and so should be your code. Haskell provides all the means necessary—and many more—to easily and safely use embedded small languages that are tailored to specific needs and business domains.
In this series of lectures and workshops, we will explore the whats, whys and hows of embedded domain-specific languages in Haskell, and how language oriented programing can bring type-safety, composability and simplicity to the development of complex applications.
This document provides 39 practice problems and solutions for a C++ exam. The problems cover topics like output of code snippets, conditional statements, loops, functions, and more. Sample inputs and outputs are given for some problems to test code behavior. The goal is to help students master C++ concepts before taking the exam.
This document provides an overview of pointers and dynamic arrays in C++. It discusses pointer variables, memory management, pointer arithmetic, array variables as pointers, functions for manipulating strings like strcpy and strcmp, and advanced pointer notation for multi-dimensional arrays. Code examples are provided to demonstrate concepts like passing pointers to functions, dereferencing pointers, pointer arithmetic on arrays, and using string functions. The overall objective is to introduce pointers and how they enable dynamic memory allocation and manipulation of data structures in C++.
The Ring programming language version 1.9 book - Part 30 of 210Mahmoud Samir Fayed
This document provides information about string manipulation functions in Ring programming language. It discusses string literals, getting string length, converting case, accessing characters, left, right, trim, copy, lines, substr, strcmp, str2list, list2str functions. It also covers date/time functions like clock, timelist, addDays, diffDays. Examples are given to demonstrate the usage of each function.
This document discusses writing a compiler in Go. It provides an overview of the different modules needed for a compiler, including tokenization, lexing, parsing, AST generation, code generation, and a virtual machine. It also demonstrates these concepts by summarizing the development of a Monkey compiler, with modules for tokens, lexer, parser, AST, objects, evaluation, and code generation. Key takeaways are gaining an understanding of how compilers work, learning more about Go, and laying foundations for static analysis tools.
This document discusses Kotlin coroutines and how they can be used with the Spring Framework. It provides an overview of coroutines, explaining concepts like fibers, green threads, and suspendable computations. It also covers using coroutines with Spring features like the @Async annotation and asynchronous MVC return types. The document provides code examples of coroutines concepts like channels, jobs, and yielding in sequences.
The document discusses techniques for writing readable code, including:
- Code should be easy for others to understand by using clear naming conventions, comments only where needed, and simple control flow.
- Surface-level readability can be improved through specific and unambiguous naming, consistent formatting, and avoiding overly long or generic names.
- Loops and logic should read like natural language to make the flow of execution easy to follow. This includes ordering conditional statements positively first and breaking down complex expressions.
- Code can be made more scannable through proper indentation and grouping of related lines together into blocks. Overall the goal is to minimize the time it takes someone new to understand the code.
This document discusses using Codable types in Kitura to build RESTful APIs with routing in Swift. It introduces JSON encoding and decoding using Codable, shows examples of defining Codable model types and implementing GET, POST, and query parameter handlers, and discusses benefits like type safety, code sharing between backend and clients.
This Bash script provides a POP3 email client called pop3ck that allows users to connect to a POP3 server, view message summaries and headers, and read or delete messages. It handles configuration, connection, and interaction with the POP3 protocol. The script defines numerous functions to handle tasks like getting user input, displaying messages and prompts, and managing the connection and message data structures.
C++ Language Basics covers the history of C++, some drawbacks of C, input/output operators, variable declaration, the bool datatype, typecasting, and references. C++ was created in 1979 as an extension of C to support object-oriented programming. It has undergone several updates since then. References allow creating aliases to existing variables, avoiding issues with pointers. Input is handled with cin and output with cout. Variables can be declared anywhere in C++ code unlike in C. The bool datatype represents true and false values.
This document provides 39 practice problems and solutions for a C++ exam. The problems cover topics like output formatting, conditional statements, loops, functions, and more. Each problem is a short code snippet or question, and the solutions are provided at the end. This document is intended to help students practice and test their mastery of C++ concepts before taking the exam.
This document discusses tuning MongoDB performance. It covers tuning queries using the database profiler and explain commands to analyze slow queries. It also covers tuning system configurations like Linux settings, disk I/O, and memory to optimize MongoDB performance. Topics include setting ulimits, IO scheduler, filesystem options, and more. References to MongoDB and Linux tuning documentation are also provided.
Need help getting past an error in C++! I have all my code pasted down.docxJason0x0Scottw
The document provides code for a C++ program that stores notes in a linked list and allows the user to perform operations on the notes. The main issue is that function calls in main are producing errors, as the functions need to be called on a class object rather than directly. The document includes the source code, header file defining the classes and functions, and sample input data.
I have written the code but cannot complete the assignment please help.pdfshreeaadithyaacellso
I have written the code but cannot complete the assignment please help me to complete.
Please don't just copy other s answers as your own.
// Insertion sort
/*
#include <ctime>
#include <iostream>
using namespace std;
void insertionSort(int arr[], int n) {
int i, key, j;
for (i = 1; i < n; i++) {
key = arr[i];
j = i - 1;
// Move elements of arr[0..i-1], that are greater than key, to one position ahead of their current
position
while (j >= 0 && arr[j] > key) {
arr[j + 1] = arr[j];
j = j - 1;
}
arr[j + 1] = key;
}
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int num = sizeof(arr) / sizeof(arr[0]);
clock_t start, end;
double timetaken;
start = clock();
insertionSort(arr, num);
end = clock();
cout << "Sorted array: \n";
for (int i = 0; i < n; i++)
cout << arr[i] << " ";
cout << endl;
timetaken = ((double) (end - start)) / CLOCKS_PER_SEC;
cout << "Time taken : " << fixed << timetaken << "s" << endl;
return 0;
}
*/
// Shell Sort
/*
#include <ctime>
#include <iostream>
using namespace std;
int shellSort(int arr[], int n) {
for (int gap = n/2; gap > 0; gap /= 2) {
for (int i = gap; i < n; i += 1) {
int temp = arr[i];
int j;
for (j = i; j >= gap && arr[j - gap] > temp; j -= gap)
arr[j] = arr[j - gap];
arr[j] = temp;
}
}
return 0;
}
void printArray(int arr[], int n) {
for (int i=0; i<n; i++)
cout << arr[i] << " ";
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int num = sizeof(arr) / sizeof(arr[0]);
clock_t start, end;
double timetaken;
start = clock();
shellSort(arr, num);
end = clock();
cout << "\nArray after sorting: \n";
printArray(arr, n);
cout << endl;
timetaken = (double)(end - start) / CLOCKS_PER_SEC;
cout << "Time taken : " << fixed << timetaken << "s" << endl;
return 0;
}
*/
// MergeSort
/*
#include <ctime>
#include <iostream>
using namespace std;
void merge(int arr[], int l, int m, int r) {
int i, j, k;
int n1 = m - l + 1;
int n2 = r - m;
int L[n1], R[n2];
for (i = 0; i < n1; i++)
L[i] = arr[l + i];
for (j = 0; j < n2; j++)
R[j] = arr[m + 1 + j];
i = 0;
j = 0;
k = l;
while (i < n1 && j < n2) {
if (L[i] <= R[j]) {
arr[k] = L[i];
i++;
}
else {
arr[k] = R[j];
j++;
}
k++;
}
while (i < n1) {
arr[k] = L[i];
i++;
k++;
}
while (j < n2) {
arr[k] = R[j];
j++;
k++;
}
}
void mergeSort(int arr[], int l, int r) {
if (l < r) {
int m = l + (r - l) / 2;
mergeSort(arr, l, m);
mergeSort(arr, m + 1, r);
merge(arr, l, m, r);
}
}
int main() {
int n;
cout << "Enter the size of the array: ";
cin >> n;
int arr[n];
cout << "Enter the elements of the array: ";
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int arr_size = sizeof(arr) / sizeof(arr[0]);
clock_t start;
clock_t end;
double timetaken;
start = clock();
mergeSort(arr, 0, arr_size - 1);
end = clock();
timetaken = (double)(end - start) / CLOCKS_PER_SEC;
.
The Ring programming language version 1.8 book - Part 28 of 202Mahmoud Samir Fayed
This chapter discusses string manipulation functions in Ring. It covers creating and accessing string literals and characters, converting case, trimming whitespace, comparing and searching strings, and converting between strings and lists. Functions covered include len(), upper(), lower(), trim(), copy(), left(), right(), substr(), strcmp(), and str2list(). The chapter also discusses working with dates and times using functions like date(), time(), addDays(), and diffDays().
We have successfully created and continue developing PVS-Studio analyzer for C/C++ languages. Over the time, it became clear that many of the diagnostics that we have implemented are not related to a specific programming language, so we decided to apply our experience to another programming language, namely C#. In this article, we are talking about the analysis of Code Contracts project by Microsoft done by our C# analyzer
This is a c++ binary search program I worked so far but still cant g.pdfkostikjaylonshaewe47
This is a c++ binary search program I worked so far but still cant get it right.
Can anyone help me? Big thanks!!
the client should not be modified
/*
*File: client.cpp
*Author: Yingwu Zhu
*Warning: do not change this file and use it as is.
*Last Modififcation: 10/21/2016
*/
#include
#include
#include
#include
#include
#include \"bst.h\"
using namespace std;
int main(int argc, char* argv[]) {
if (argc != 2) {
cout << \"Format: \" << argv[0] << \" [data file]\" << endl;
return 0;
}
ifstream fin(argv[1]);
int cases;
fin >> cases;
int passed = 0;
for (int i = 1; i <= cases; i++) {
cout << \"Checking test case #\" << i << \" ... \";
BST T;
set S;
int n, x;
fin >> n;
bool ok = true;
vector tmp;
int rem = 0;
for (int j = 0; j < n; j++) {
fin >> x;
T.Insert(x);
S.insert(x);
ok &= (T.Search(x) && T.RecurSearch(x));
if (tmp.empty())
tmp.push_back(x);
if (rand()%10 < 3) {
T.Erase(tmp[0]);
S.erase(tmp[0]);
ok &= (T.Search(tmp[0]) == false);
tmp.pop_back();
rem++;
}
}
if (rem
ok &= (T.MaxElement() == *S.rbegin());
while (!S.empty() && !T.Empty()) {
int x = T.MinElement();
ok &= (x == *S.begin());
T.Erase(x);
S.erase(S.begin());
}
cout << (ok ? \"Passed!\" : \"Failed\") << endl;
passed += ok;
}
cout << passed << \" of \" << cases << \" test cases have passed!\ \";
if (passed == cases)
cout << endl << \"Congratulations! Good to Submit Your Code\ \";
else if ((double)passed/cases >= 0.95)
cout << endl << \"You are almost there, but need to fix some bugs.\ \";
else
cout << endl << \"Your code needs a lot of fixes for submission\ \";
return 0;
}
=====================================================================
=======
//bst.h
#ifndef _BST_H_
#define _BST_H_
#include
using namespace std;
class BST {
private:
class Node {
public:
int data;
Node* left;
Node* right;
};
Node* root; //root node pointer
//you may add your auxiliary functions here!
public:
BST(); //constructor
~BST(); //destructor
bool Empty() const;
void Insert(int val);
int MinElement() const;
int MaxElement() const;
bool Search(int val) const;
bool RecurSearch(int val) const;
void Erase(int val);
};
#endif
=====================================================================
=======
/*
bst.cpp
Subject: Binary Seach Tree
Modification Time:10/26/2016
*/
#include
#include\"bst.h\"
using namespace std;
BST::BST(){
root= NULL;
}
BST::~BST(){
delete root;
delete root->left;
delete root->right;
}
bool BST::Empty() const {
return data;
}
void BST::Insert(int val){
Node* p= new Node;
p->data= val;
Node* cur = root;
if(val < cur->data){
cur = cur -> left;
}
else{
right->next=val;
}
}
int BST::MinElement() const {
Node* cur;
while(cur->left != NULL){
cur = cur->left;
}
return(cur->data);
}
int BST::MaxElement() const{
if(root==NULL){
return 0;
}
if(root->left>root->data){
root->data=root->right;
}
else if(root->right>root->data){
root->data=root->right;
}
return root->data;
}
bool BST:: Search(int val) const{
Node* cur;
cur = root;
while(cur!=NULL){
if(cur->data == val){
return true;
}
else if(cur->data .
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...University of Maribor
Slides from talk presenting:
Aleš Zamuda: Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapter and Networking.
Presentation at IcETRAN 2024 session:
"Inter-Society Networking Panel GRSS/MTT-S/CIS
Panel Session: Promoting Connection and Cooperation"
IEEE Slovenia GRSS
IEEE Serbia and Montenegro MTT-S
IEEE Slovenia CIS
11TH INTERNATIONAL CONFERENCE ON ELECTRICAL, ELECTRONIC AND COMPUTING ENGINEERING
3-6 June 2024, Niš, Serbia
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSIJNSA Journal
The smart irrigation system represents an innovative approach to optimize water usage in agricultural and landscaping practices. The integration of cutting-edge technologies, including sensors, actuators, and data analysis, empowers this system to provide accurate monitoring and control of irrigation processes by leveraging real-time environmental conditions. The main objective of a smart irrigation system is to optimize water efficiency, minimize expenses, and foster the adoption of sustainable water management methods. This paper conducts a systematic risk assessment by exploring the key components/assets and their functionalities in the smart irrigation system. The crucial role of sensors in gathering data on soil moisture, weather patterns, and plant well-being is emphasized in this system. These sensors enable intelligent decision-making in irrigation scheduling and water distribution, leading to enhanced water efficiency and sustainable water management practices. Actuators enable automated control of irrigation devices, ensuring precise and targeted water delivery to plants. Additionally, the paper addresses the potential threat and vulnerabilities associated with smart irrigation systems. It discusses limitations of the system, such as power constraints and computational capabilities, and calculates the potential security risks. The paper suggests possible risk treatment methods for effective secure system operation. In conclusion, the paper emphasizes the significant benefits of implementing smart irrigation systems, including improved water conservation, increased crop yield, and reduced environmental impact. Additionally, based on the security analysis conducted, the paper recommends the implementation of countermeasures and security approaches to address vulnerabilities and ensure the integrity and reliability of the system. By incorporating these measures, smart irrigation technology can revolutionize water management practices in agriculture, promoting sustainability, resource efficiency, and safeguarding against potential security threats.
ACEP Magazine edition 4th launched on 05.06.2024Rahul
This document provides information about the third edition of the magazine "Sthapatya" published by the Association of Civil Engineers (Practicing) Aurangabad. It includes messages from current and past presidents of ACEP, memories and photos from past ACEP events, information on life time achievement awards given by ACEP, and a technical article on concrete maintenance, repairs and strengthening. The document highlights activities of ACEP and provides a technical educational article for members.
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
Introduction- e - waste – definition - sources of e-waste– hazardous substances in e-waste - effects of e-waste on environment and human health- need for e-waste management– e-waste handling rules - waste minimization techniques for managing e-waste – recycling of e-waste - disposal treatment methods of e- waste – mechanism of extraction of precious metal from leaching solution-global Scenario of E-waste – E-waste in India- case studies.
1. Outlook – module 1:
Option Explicit
Public parseLines() As String
Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
Dim bodyText As Variant
Dim subjText As String
Dim intWait As Byte
Const SVOStatus_01 = "CCO: Service Order Status for"
Const SVOStatus_02 = "Service Order Status for"
strID = MyMail.EntryID 'property
Set olNS = Application.GetNamespace("MAPI")
'NameSpace.GetItemFromID Method(Outlook)
'Returns a Microsoft Outlook item identified by the specified entry ID (if valid).
Set msg = olNS.GetItemFromID(strID)
On Error Resume Next
bodyText = ""
Do While bodyText = ""
' Slow the processing down a bit before trying again
For intWait = 1 To 100
DoEvents
Next
' Try again
bodyText = msg.Body
Loop
subjText = msg.Subject
If InStr(1, subjText, SVOStatus_01) > 0 Or InStr(1, subjText, SVOStatus_02) > 0 Then
'Split Function: Returns a zero-based, 1-D array containing a specified number of
substrings
'tokenize each line of the email
parseLines = Split(msg.Body, vbCrLf)
2. Call Send_Mail_With_Signature_Html(True, parseLines)
End If
Set item = Nothing
Set msg = Nothing
Set olNS = Nothing
End Sub
Outlook – module 2:
Option Explicit
Sub composeBody(strbody, SR_num)
Dim template_1, template_2, template_3, RMA_SVO_no As String
Dim i, j, h, PN, SQ, EQ, AQ As Integer
Dim k2, k1 As Byte
Dim returnPNline As Boolean
Dim ShipToEmail(), AcknowledgmentEmail(), AcknowledgmentCCO(), AcknowledgmentContact(),
CustomerEmailinSR() As String
'Note that a reference to "Microsoft Scripting Runtime" is needed in order to get access to
the Dictionary object
'That's if the New syntax is used. CreateObject will work without a reference, as long as
the Microsoft Scripting Runtime
'is installed and available from the References window
Dim myDictionary_parts As Object
Dim myDictionary_qtys As Object
Dim myDictionary_etas As Object
Dim uniquePNs As Variant
Dim uniqueQTYs As Variant
Dim uniqueETAs As Variant
Dim filtered_PN_List() As String
Dim filtered_QTY_List() As String
Dim filtered_ETA_List() As String
Dim PN_text As String
Dim Qty_text As String
Dim ETA_text As String
3. Const c_SRnum = "Service Request"
Const ShipTo = "Ship-to Information"
Const BillTo = "Bill-to Information"
Dim Ship_To As String
Const StartChr = 23
Const Labor = "Labor"
Const NoFieldEngineer = "No Field Engineer"
Const FieldEngineer = "Field Engineer"
Const c_CustomerRefNumber_1 = "Reference Number"
Dim Cust_Rf_Num As String
Const c_CustomerRefNumber_2 = "Help Desk Tracking: "
Const c_ReplacementParts = "Replacement Parts"
Const c_PartETA = "Part(s) ETA"
Dim PartETA() As String
Const Assembly1 = "Assembly 1"
Const LineRef = "Line Ref"
Const c_PartNumber = "Part Number"
Dim PartNumber() As String
Const c_QtyShpd = "Qty Shipped"
Dim QtyShpd() As Byte
Const c_QtyAuth = "Qty Auth"
Dim QtyAuth() As Byte
Const FE_Confirmed_ETA = "FE Confirmed ETA"
Dim FE_ETA As String
Const FieldEngineerInformation = "Field Engineer Information"
Const c_FE_name = "Name:"
4. Dim FE_name() As String
PN = 0
SQ = 0
EQ = 0
AQ = 0
returnPNline = False
FE_ETA = ""
For i = 0 To UBound(parseLines)
' 0. read from Notepad.txt: comPref already verified, contacts and helpdesk
tracking number prepared by Excel macro
' 1. How many parts? -> Qty for each part!
' 2. How many depots? -> How many ETA's for parts do we have?
' 3. FE intervention?
' 4. assembly?
k2 = 1
If InStr(k2, parseLines(i), "RETURN INFORMATION", vbTextCompare) > 0 Then
returnPNline = True
End If
If InStr(k2, parseLines(i), c_SRnum, vbTextCompare) > 0 Then
k1 = InStr(k2, parseLines(i), ":", vbTextCompare)
SR_num = Mid(parseLines(i), k1 + 2)
End If
If InStr(k2, parseLines(i), "RMA/Service Order", vbTextCompare) > 0 Then
k1 = InStr(k2, parseLines(i), ":", vbTextCompare)
RMA_SVO_no = Mid(parseLines(i), k1 + 2)
End If
If InStr(k2, parseLines(i), c_CustomerRefNumber_1, vbTextCompare) > 0 Then
k1 = InStr(k2, parseLines(i), ":", vbTextCompare)
Cust_Rf_Num = Mid(parseLines(i), k1 + 2)
End If
If InStr(k2, parseLines(i), c_PartNumber, vbTextCompare) > 0 Then
k1 = InStr(k2, parseLines(i), ":", vbTextCompare)
If returnPNline = False Then
5. ReDim Preserve PartNumber(PN)
PartNumber(PN) = Mid(parseLines(i), k1 + 2)
PN = PN + 1
End If
End If
' If InStr(k2, parseLines(i), c_QtyShpd, vbTextCompare) > 0 Then
' k1 = InStr(k2, parseLines(i), ":", vbTextCompare)
' ReDim Preserve QtyShpd(SQ)
' QtyShpd(SQ) = Mid(parseLines(i), k1 + 2)
' SQ = SQ + 1
' End If
If InStr(k2, parseLines(i), c_QtyAuth, vbTextCompare) > 0 Then
k1 = InStr(k2, parseLines(i), ":", vbTextCompare)
If returnPNline = False Then
ReDim Preserve QtyAuth(AQ)
QtyAuth(AQ) = Mid(parseLines(i), k1 + 2)
AQ = AQ + 1
End If
End If
If InStr(k2, parseLines(i), c_PartETA, vbTextCompare) > 0 Then
k1 = InStr(k2, parseLines(i), ":", vbTextCompare)
ReDim Preserve PartETA(EQ)
PartETA(EQ) = Mid(parseLines(i), k1 + 2, 17)
EQ = EQ + 1
End If
If InStr(k2, parseLines(i), FE_Confirmed_ETA, vbTextCompare) > 0 Then
k1 = InStr(k2, parseLines(i), ":", vbTextCompare)
FE_ETA = Mid(parseLines(i), k1 + 2, 17)
End If
If InStr(k2, parseLines(i), ShipTo, vbTextCompare) > 0 Then
j = i
Do While parseLines(j) <> BillTo
j = j + 1
Loop
6. h = j - i
j = 0
Ship_To = parseLines(i + 2)
For j = 1 To h - 4 Step 1
Ship_To = Ship_To & "<br>" & parseLines(i + j + 2)
Next j
End If
Next i
'Instantiate a Scripting.Dictionary object
' =========================================
'http://stackoverflow.com/questions/3017852/vba-get-unique-values-from-array
' Set myDictionary_parts = CreateObject("Scripting.Dictionary")
'alternatively: Set myDictionary_parts = New Scripting.Dictionary
' Set myDictionary_qtys = CreateObject("Scripting.Dictionary")
'**********************************************
' For i = LBound(PartNumber) To UBound(PartNumber)
' myDictionary_parts(PartNumber(i)) = 1
' Next i
' i = 0
' For Each uniquePNs In myDictionary_parts.Keys()
'myDictionary.Keys() is a Variant array of the unique values in the uniquePNs array.
'uniquePNs will iterate through each of them.
' ReDim Preserve filtered_PN_List(i)
' filtered_PN_List(i) = uniquePNs
' i = i + 1
' Next uniquePNs
'*********************************************************************
' search for unique ETA's (Estimated Time of Arrival) in a dictionary:
'*********************************************************************
Set myDictionary_etas = CreateObject("Scripting.Dictionary")
For i = LBound(PartETA) To UBound(PartETA)
myDictionary_etas(PartETA(i)) = 1
Next i
7. i = 0
For Each uniqueETAs In myDictionary_etas.Keys()
'myDictionary.Keys() is a Variant array of the unique values in the uniquePNs array.
'uniquePNs will iterate through each of them.
ReDim Preserve filtered_ETA_List(i)
filtered_ETA_List(i) = uniqueETAs
i = i + 1
Next uniqueETAs
'******************************************************************
' now let's take unique ETA's and create ETA line for the template:
'******************************************************************
If Cust_Rf_Num <> "" Then
Cust_Rf_Num = "Customer Reference Number: " & Cust_Rf_Num
End If
For i = 0 To UBound(filtered_ETA_List)
If i = 0 Then
ETA_text = filtered_ETA_List(i)
End If
If i > 0 Then
ETA_text = ETA_text & ", " & filtered_ETA_List(i)
End If
Next i
'******************************************************************
For i = 0 To UBound(PartNumber)
If UBound(PartNumber) = 0 Then
PN_text = PN_text & PartNumber(i)
Qty_text = QtyAuth(i)
End If
If UBound(PartNumber) > 0 Then
If i = 0 Then
PN_text = PartNumber(i)
Qty_text = QtyAuth(i)
8. End If
If i > 0 Then
PN_text = PN_text & ", " & PartNumber(i)
Qty_text = Qty_text & ", " & QtyAuth(i)
End If
End If
Next i
If FE_ETA <> "" Then
If PartNumber(0) <> "" Then
template_1 = "<FONT FACE=""Arial"", SIZE=""-1"">Dear Customer,<br><br>" & _
"I am writing to you regarding RMA " & RMA_SVO_no & ", " & Cust_Rf_Num &
"<br><br>" & _
"I would like to inform you that the requested part: " & PN_text & "
(quantity: " & Qty_text & ") will be onsite on " & ETA_text & " local time.<br><br>" & _
"The shipping address is:<br>" & _
Ship_To & "<br><br>" & _
"The field engineer, XXXXX , will be attending the site on " & FE_ETA & "
local time.<br><br>" & _
"Please do not hesitate to contact me should you need any further
assistance.</FONT><br>"
strbody = template_1
Else
template_3 = "<FONT FACE=""Arial"", SIZE=""-1"">Dear Customer,<br><br>" & _
"I am writing to you regarding RMA " & RMA_SVO_no & ", " & Cust_Rf_Num &
"<br><br>" & _
"The field engineer, XXXXX , will be attending the site on " & FE_ETA & "
local time.<br><br>" & _
"The shipping address is:<br>" & _
Ship_To & "<br><br>" & _
"Please do not hesitate to contact me should you need any further
assistance.</FONT><br>"
strbody = template_3
End If
Else
template_2 = "<FONT FACE=""Arial"", SIZE=""-1"">Dear Customer,<br><br>" & _
9. "I am writing to you regarding RMA " & RMA_SVO_no & ", " & Cust_Rf_Num &
"<br><br>" & _
"I would like to inform you that the requested part: " & PN_text & "
(quantity: " & Qty_text & ") will be onsite on " & ETA_text & " local time.<br><br>" & _
"The shipping address is:<br>" & _
Ship_To & "<br><br>" & _
"Please do not hesitate to contact me should you need any further
assistance.</FONT><br>"
strbody = template_2
End If
End Sub
Outlook – module 3:
Option Explicit
Function GetBoiler(ByVal sFile As String) As String
Dim fso As Object
Dim ts As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2)
GetBoiler = ts.readall
ts.Close
End Function
'===============================================
' SEND MAIL + ATTACH A SIGNATURE TO A MESSAGE
'===============================================
Sub Send_Mail_With_Signature_Html(DisplayMsg As Boolean, parseLines)
Dim OutApp As Object
Dim OutMail As Object
Dim objRecipient As Object
Dim strbody, SR_num As String
Dim SigString As String
Dim Signature As String
Set OutApp = Outlook.Application
Set OutMail = OutApp.CreateItem(olMailItem)
10. OutMail.BodyFormat = olFormatHTML
Call composeBody(strbody, SR_num)
'Change Ales Vymyslicky, Cisco Logistics.htm to the name of your signature
'Environ Function - Environ({envstring | number}) - Returns the String associated with an
operating system environment variable
SigString = Environ("appdata") & "MicrosoftSignaturesAles Vymyslicky, Cisco
Logistics.htm"
If Dir(SigString) <> "" Then
Signature = GetBoiler(SigString)
Else
Signature = ""
End If
On Error Resume Next
With OutMail
.SentOnBehalfOfName = "avymysli@cisco.com"
' Add the To recipient(s) to the message.
Set objRecipient = .Recipients.Add("Nancy Davolio")
objRecipient.Type = olTo
' Add the CC recipient(s) to the message.
Set objRecipient = .Recipients.Add("Michael Suyama")
objRecipient.Type = olCC
' Add the BCC recipient(s) to the message.
' Set objRecipient = .Recipients.Add("Andrew Fuller")
' objRecipient.Type = olBCC
' Set the Subject, Body, and Importance of the message.
.Subject = "SR " & SR_num
'.Body = "This is the body of the message." & vbCrLf & vbCrLf
.HTMLBody = strbody & "<br>" & Signature
.Importance = olImportanceHigh 'High importance
' Resolve each Recipient's name.
11. For Each objRecipient In .Recipients
objRecipient.Resolve
Next
' Should we display the message before sending?
If DisplayMsg Then
.Display
Else
.Save
.Send
End If
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
'================================================
'Where is the Image that I have in my signature ?
'================================================
'When you use the example above and you have a picture in your html signature you will notice
when
'you send the mail with VBA code the picture will not show up in the mail body.
'Problem seems to be the path to the pictures in the HTML code.
'
' Follow the steps below to send a signature with an image:
'
'1: Close Outlook
'
'2: Go to the htm file created by Outlook
'
' Vista and Windows 7 :
'C:UsersAlesAppDataRoamingMicrosoftSignatures
'
' Windows XP:
12. 'C:Documents and SettingsAlesApplication DataMicrosoftSignatures
'
'Note: Ales is the User name
'Note: AppData or Application Data are hidden folders
' (Change the view in Windows explorer so it show hidden files and folders)
'
'
'3: Open the signature file created by the Outlook named "Mysig.htm" with Notepad.
'
'Look for something inside the Mysig.htm file(bottom of the file), like:
'
' src = "Mysig_files/image001.png"
'
' src = "Mysig_files/image002.jpg"
'
' Replace the short path to both files to the full path:
'
'src = "C:UsersAlesAppDataRoamingMicrosoftSignaturesMysig_filesimage001.png"
'
'src = "C:UsersAlesAppDataRoamingMicrosoftSignaturesMysig_filesimage002.jpg"
'
'
'4: Save and close the signature file.
'
'5: Run the macro again to see if you see the picture in your signature
Outlook – module 6:
Option Explicit
Public Sub StartOnPointedItem()
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
Dim bodyText As Variant
Dim subjText As String
Dim intWait As Byte
13. Dim objItem As Object
Dim objMail As Object
Const SVOStatus_01 = "CCO: Service Order Status for"
Const SVOStatus_02 = "Service Order Status for"
Set objItem = GetCurrentItem()
Set msg = objItem
On Error Resume Next
bodyText = msg.Body
If bodyText = "" Then
Do While bodyText = ""
' Slow the processing down a bit before trying again
For intWait = 1 To 100
DoEvents
Next
' Trying again
bodyText = msg.Body
Loop
End If
subjText = msg.Subject
If InStr(1, subjText, SVOStatus_01) > 0 Or InStr(1, subjText, SVOStatus_02) > 0 Then
'Split Function: Returns a zero-based, 1-D array containing a specified number of
substrings
'tokenize each line of the email
parseLines = Split(msg.Body, vbCrLf)
Call Send_Mail_With_Signature_Html(True, parseLines)
End If
Set objItem = Nothing
Set objMail = Nothing
End Sub
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = Application
On Error Resume Next
14. Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
End Select
End Function