Using HttpWatch Plug-in with Selenium Automation in JavaSandeep Tol
This article will give the developers and testers to use Java programming for capturing IE browser HTTP logs using HTTP Watch Plug-in (V10) , in Selenium scripts
HTTP Watch comes with inbuilt API support to integrate with selenium scripts written in C# or PHP scripts . Refer http://apihelp.httpwatch.com/#Automation%20Overview.html
But unfortunately they don’t have API written for JAVA. There are no samples or articles available to use Httpwtach with Java interface.
Using this article you would learn how HttpWatch plug-in which component can be easily interfaced with Java code and then executed via selenium script.
The solution is to use Java COM bridge and invoke HTTP Watch plugin API from Java based selenium scripts.
Managing Web Infrastructure Systems with Windows PowerShell 2.0 Demo ScriptMicrosoft TechNet
This session will explore how Windows Powershell v2.0 can automate administrative tasks to manage critical web infrastructure systems in the data center. The session will include topics on how to monitor and manage Windows Server 2008 systems. We will discuss how to use Windows Powershell cmdlets and WMI to retrieve local and remote information and execute tasks that can be performed on a daily basis. Then we will focus on how Windows Powershell can make it easier for IT Professionals to manage Active Directory to administer network accounts and publish shared folders. Next, we will explore how Windows Powershell Snap-in for IIS can be used to efficiently manage web servers in a web farm to decrease administrative overhead. Then we will show you how Windows Powershell snap-in included in SQL Server 2008 can make it easier for IT Professionals to administer backend databases.
Chicago alm user group git demo script and notesDave Burnison
Presentation materials from the 6/25/2014 Chicago ALM User Group meeting - Git and Visual Studio Integration.
Git, Visual Studio, Team Foundation Server
Selenium Automation in Java Using HttpWatch Plug-in Sandeep Tol
This article will give the developers and testers who use Java selenium script for Browser Simulations and automation for IE browser to capture HTTP logs using HTTPWatch Plug-in
HTTP Watch comes with inbuilt API support to integrate with selenium scripts written in C# or PHP scripts . But unfortunately they don’t have Support for JAVA.
The solution given here is to use Java COM bridge and invoke HTTP Watch plugin API from Java based selenium scripts.
Using this article you would learn how HttpWatch plug-in which component can be easily interfaced with Java code and then executed via selenium script.
Architecting the Future: Abstractions and Metadata - KCDCDaniel Barker
Kubernetes and Docker are two of the top open source projects, and they’re built around abstractions and metadata. These two concepts are the key to architecting in the future. Come with me as I dig a little deeper into these concepts within k8s and Docker and provide some examples from my own work.
Using HttpWatch Plug-in with Selenium Automation in JavaSandeep Tol
This article will give the developers and testers to use Java programming for capturing IE browser HTTP logs using HTTP Watch Plug-in (V10) , in Selenium scripts
HTTP Watch comes with inbuilt API support to integrate with selenium scripts written in C# or PHP scripts . Refer http://apihelp.httpwatch.com/#Automation%20Overview.html
But unfortunately they don’t have API written for JAVA. There are no samples or articles available to use Httpwtach with Java interface.
Using this article you would learn how HttpWatch plug-in which component can be easily interfaced with Java code and then executed via selenium script.
The solution is to use Java COM bridge and invoke HTTP Watch plugin API from Java based selenium scripts.
Managing Web Infrastructure Systems with Windows PowerShell 2.0 Demo ScriptMicrosoft TechNet
This session will explore how Windows Powershell v2.0 can automate administrative tasks to manage critical web infrastructure systems in the data center. The session will include topics on how to monitor and manage Windows Server 2008 systems. We will discuss how to use Windows Powershell cmdlets and WMI to retrieve local and remote information and execute tasks that can be performed on a daily basis. Then we will focus on how Windows Powershell can make it easier for IT Professionals to manage Active Directory to administer network accounts and publish shared folders. Next, we will explore how Windows Powershell Snap-in for IIS can be used to efficiently manage web servers in a web farm to decrease administrative overhead. Then we will show you how Windows Powershell snap-in included in SQL Server 2008 can make it easier for IT Professionals to administer backend databases.
Chicago alm user group git demo script and notesDave Burnison
Presentation materials from the 6/25/2014 Chicago ALM User Group meeting - Git and Visual Studio Integration.
Git, Visual Studio, Team Foundation Server
Selenium Automation in Java Using HttpWatch Plug-in Sandeep Tol
This article will give the developers and testers who use Java selenium script for Browser Simulations and automation for IE browser to capture HTTP logs using HTTPWatch Plug-in
HTTP Watch comes with inbuilt API support to integrate with selenium scripts written in C# or PHP scripts . But unfortunately they don’t have Support for JAVA.
The solution given here is to use Java COM bridge and invoke HTTP Watch plugin API from Java based selenium scripts.
Using this article you would learn how HttpWatch plug-in which component can be easily interfaced with Java code and then executed via selenium script.
Architecting the Future: Abstractions and Metadata - KCDCDaniel Barker
Kubernetes and Docker are two of the top open source projects, and they’re built around abstractions and metadata. These two concepts are the key to architecting in the future. Come with me as I dig a little deeper into these concepts within k8s and Docker and provide some examples from my own work.
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsAndrey Karpov
We continue making the use of PVS-Studio more convenient. Our analyzer is now available in Chocolatey, the package manager for Windows. We believe this will make it easier to deploy PVS-Studio, particularly in cloud services. So right off the bat, we also checked the source code of the same Chocolatey. Azure DevOps took on the role of the CI system.
Architecting the Future: Abstractions and Metadata - BSidesKCDaniel Barker
Kubernetes and Docker are two of the top open source projects, and they’re built around abstractions and metadata. These two concepts are the key to architecting in the future. Come with me as I dig a little deeper into these concepts within k8s and Docker and provide some examples from my own work.
Orangescrum Mobile API Add on User ManualOrangescrum
Orangescrum Mobile API add-on user manual will help you to install the Mobile API add-on & guide you about the features of Mobile API.
With the Mobile API Orangescrum open source (community) users can generate a code to use the iOS & Android Mobile APP .
For more information about the Mobile API & APP, please visit: http://www.orangescrum.org/add-on/mobileapi
Explore the Mobile API demo at: http://newui.orangescrum.org/
Complete steps to Integrate Push Notification for Your Cocos2dx App with Push...ShepHertz
Integrating push notification for ios and android in cocos2dx is always a big challenge for developers. So, this blog will walk you through step-by-step integration process by taking the examples from the sample.
Das Entwickeln und Gestalten von einer UI ist für sich allein genommen bereits eine große Herausforderung. Ganz zu schweigen von der Aufgabe die UI-Tests zu automatisieren. Wurde beides erfolgreich gemeistert, kommen allerdings die nächsten Fragen:
* Sollen wir auch die PDF-Auftragsbestätigung im Test validieren?
> Natürlich sollten wir!
* Ist der Rich-Client auch zu testen?
> Ja, wieso denn auch nicht!
* Wo sollen die Tests ausgeführt werden?
> Natürlich im Docker-Container und im Kubernetes-Cluster!
* Können wir die Tests auf ein anderes Framework migrieren?
> Was bringt uns das? Wir wollen die bestehenden Tests doch weiterverwenden!
Diese Fragen sind den Einen oder Anderen bestimmt nicht neu, aber was tun? Es wurde bereits viel Aufwand und Mühe in die Pflege der umfangreichen Selenium-Testsuiten gesteckt! Daher möchte man diese nur ungern verwerfen, nur um neue Anforderungen umzusetzen. Der Talk zeigt hierfür eine Lösung auf, die mit geringen Aufwand die bestehenden Selenium-Tests einfach erweitert. Die Open-Source-Erweiterung "Sakuli Se" bietet eine umfangreiche API, die es ermöglicht Rich-Clients, PDF-Inhalte oder auch Flash-Anwendungen ebenso leicht wie ein HTML-Button im selben Ausführungskontext zu testen. An Praxisbeispielen wird ebenso demonstriert wie durch vorgefertigte Dockerimages die Testausführung skalierbar bis in Cloud-Umgebung, wie Kubernetes oder OpenShift, aufgebaut werden kann.
Orangescrum In App Chat Add-on User ManualOrangescrum
The In-App chat add-on will help you to install the add-on & guide you about the features of chat add-on.
It's a real-time chat widget built for the Orangescrum Community Version. It offers fully secure, single or multi-user chat with private messaging, chat invitations and more.
Explore chat add-on details at: http://www.orangescrum.org/add-on/chat
OSLC4j-FMI is intended as an OSLC adapter for publishing FMUs (Functional Mockup Units) that follow OSLC Standard. This version of the library supports FMI 1.0 and FMI 2.0. See http://www.fmi-standard.org
Orangescrum Client management Add on User ManualOrangescrum
This client management add-on will help you to install the add-on & guide about the features of Orangescrum.
This add-on is specifically built to enable better client engagement and collaboration for your business.
To buy the ad-on, please visit: http://www.orangescrum.org/add-on/clientmanagement
Explore the demo at: http://newui.orangescrum.org/
See: http://www.oop-konferenz.de/oop2017/konferenz/konferenzprogramm/sessiondetails/action/detail/session/do-54/title/containerized-end-2-end-testing-automate-it.html
Setting up unit- and integration tests are tasks which developers have learned to deal. But testing UIs from the perspective of an end user is mostly still a challenge. The key question usually to answer is: How it is possible to make these end-2-end tests stable, scalable and reproducible? The upcoming container technologies bring the hope of managing and automating your UI tests as easily as your container deployment. A live demo will show how it is possible to test and monitor a web- or a rich-client application in a containerized Linux UI.
Target Audience: Architects, Developers, Tester, DevOps, Monitoring Teams
Prerequisites: none
Level: Practicing
Extended Abstract
The end-2-end test example will be demonstrated by the open source tools "Docker" and "Sakuli". The demo shows how to do a blackbox UI test of a complex application, which is build on purpose of the current microservice pattern. The results will be interpreted and visualized in the Jenkins CI build pipeline and we will take a look into the UI activity of the testing container during the test execution.
In an alternative scenario the previous build end-2-end tests will be executed with the objective to forward there results to a monitoring system like OMD Nagios. This use case makes it possible to continuously measure the runtime of different test execution steps and create alerts on broken thresholds. This approach enables a new perspective of monitoring. It is now possible to check constantly if the functionality of an application, like the user login or the search engine is up and running - not just the sever healthy state.
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsAndrey Karpov
Static code analysis is most effective when changing a project, as errors are always more difficult to fix in the future than at an early stage. We continue expanding the options for using PVS-Studio in continuous development systems. This time, we'll show you how to configure pull request analysis using self-hosted agents in Microsoft Azure DevOps, using the example of the Minetest game.
Microsoft has traditionally been a laggard in the JavaScript space, making such developers question whether their war cries were being heard aloud. Fortunately, the situation is rapidly improving since the release of Visual Studio Code. Code is a free, lightweight, cross-platform code editor which is sure to change your perception of Microsoft.
This presentation will demonstrate how to utilize popular JavaScript tooling within the editor. The focus will be placed on the first-class support for debuggers, linters, transpilers, and task runners.
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsAndrey Karpov
We continue making the use of PVS-Studio more convenient. Our analyzer is now available in Chocolatey, the package manager for Windows. We believe this will make it easier to deploy PVS-Studio, particularly in cloud services. So right off the bat, we also checked the source code of the same Chocolatey. Azure DevOps took on the role of the CI system.
Architecting the Future: Abstractions and Metadata - BSidesKCDaniel Barker
Kubernetes and Docker are two of the top open source projects, and they’re built around abstractions and metadata. These two concepts are the key to architecting in the future. Come with me as I dig a little deeper into these concepts within k8s and Docker and provide some examples from my own work.
Orangescrum Mobile API Add on User ManualOrangescrum
Orangescrum Mobile API add-on user manual will help you to install the Mobile API add-on & guide you about the features of Mobile API.
With the Mobile API Orangescrum open source (community) users can generate a code to use the iOS & Android Mobile APP .
For more information about the Mobile API & APP, please visit: http://www.orangescrum.org/add-on/mobileapi
Explore the Mobile API demo at: http://newui.orangescrum.org/
Complete steps to Integrate Push Notification for Your Cocos2dx App with Push...ShepHertz
Integrating push notification for ios and android in cocos2dx is always a big challenge for developers. So, this blog will walk you through step-by-step integration process by taking the examples from the sample.
Das Entwickeln und Gestalten von einer UI ist für sich allein genommen bereits eine große Herausforderung. Ganz zu schweigen von der Aufgabe die UI-Tests zu automatisieren. Wurde beides erfolgreich gemeistert, kommen allerdings die nächsten Fragen:
* Sollen wir auch die PDF-Auftragsbestätigung im Test validieren?
> Natürlich sollten wir!
* Ist der Rich-Client auch zu testen?
> Ja, wieso denn auch nicht!
* Wo sollen die Tests ausgeführt werden?
> Natürlich im Docker-Container und im Kubernetes-Cluster!
* Können wir die Tests auf ein anderes Framework migrieren?
> Was bringt uns das? Wir wollen die bestehenden Tests doch weiterverwenden!
Diese Fragen sind den Einen oder Anderen bestimmt nicht neu, aber was tun? Es wurde bereits viel Aufwand und Mühe in die Pflege der umfangreichen Selenium-Testsuiten gesteckt! Daher möchte man diese nur ungern verwerfen, nur um neue Anforderungen umzusetzen. Der Talk zeigt hierfür eine Lösung auf, die mit geringen Aufwand die bestehenden Selenium-Tests einfach erweitert. Die Open-Source-Erweiterung "Sakuli Se" bietet eine umfangreiche API, die es ermöglicht Rich-Clients, PDF-Inhalte oder auch Flash-Anwendungen ebenso leicht wie ein HTML-Button im selben Ausführungskontext zu testen. An Praxisbeispielen wird ebenso demonstriert wie durch vorgefertigte Dockerimages die Testausführung skalierbar bis in Cloud-Umgebung, wie Kubernetes oder OpenShift, aufgebaut werden kann.
Orangescrum In App Chat Add-on User ManualOrangescrum
The In-App chat add-on will help you to install the add-on & guide you about the features of chat add-on.
It's a real-time chat widget built for the Orangescrum Community Version. It offers fully secure, single or multi-user chat with private messaging, chat invitations and more.
Explore chat add-on details at: http://www.orangescrum.org/add-on/chat
OSLC4j-FMI is intended as an OSLC adapter for publishing FMUs (Functional Mockup Units) that follow OSLC Standard. This version of the library supports FMI 1.0 and FMI 2.0. See http://www.fmi-standard.org
Orangescrum Client management Add on User ManualOrangescrum
This client management add-on will help you to install the add-on & guide about the features of Orangescrum.
This add-on is specifically built to enable better client engagement and collaboration for your business.
To buy the ad-on, please visit: http://www.orangescrum.org/add-on/clientmanagement
Explore the demo at: http://newui.orangescrum.org/
See: http://www.oop-konferenz.de/oop2017/konferenz/konferenzprogramm/sessiondetails/action/detail/session/do-54/title/containerized-end-2-end-testing-automate-it.html
Setting up unit- and integration tests are tasks which developers have learned to deal. But testing UIs from the perspective of an end user is mostly still a challenge. The key question usually to answer is: How it is possible to make these end-2-end tests stable, scalable and reproducible? The upcoming container technologies bring the hope of managing and automating your UI tests as easily as your container deployment. A live demo will show how it is possible to test and monitor a web- or a rich-client application in a containerized Linux UI.
Target Audience: Architects, Developers, Tester, DevOps, Monitoring Teams
Prerequisites: none
Level: Practicing
Extended Abstract
The end-2-end test example will be demonstrated by the open source tools "Docker" and "Sakuli". The demo shows how to do a blackbox UI test of a complex application, which is build on purpose of the current microservice pattern. The results will be interpreted and visualized in the Jenkins CI build pipeline and we will take a look into the UI activity of the testing container during the test execution.
In an alternative scenario the previous build end-2-end tests will be executed with the objective to forward there results to a monitoring system like OMD Nagios. This use case makes it possible to continuously measure the runtime of different test execution steps and create alerts on broken thresholds. This approach enables a new perspective of monitoring. It is now possible to check constantly if the functionality of an application, like the user login or the search engine is up and running - not just the sever healthy state.
PVS-Studio: analyzing pull requests in Azure DevOps using self-hosted agentsAndrey Karpov
Static code analysis is most effective when changing a project, as errors are always more difficult to fix in the future than at an early stage. We continue expanding the options for using PVS-Studio in continuous development systems. This time, we'll show you how to configure pull request analysis using self-hosted agents in Microsoft Azure DevOps, using the example of the Minetest game.
Microsoft has traditionally been a laggard in the JavaScript space, making such developers question whether their war cries were being heard aloud. Fortunately, the situation is rapidly improving since the release of Visual Studio Code. Code is a free, lightweight, cross-platform code editor which is sure to change your perception of Microsoft.
This presentation will demonstrate how to utilize popular JavaScript tooling within the editor. The focus will be placed on the first-class support for debuggers, linters, transpilers, and task runners.
Apigility – Lightning Fast API Development - OSSCamp 2014 OSSCube
Apigility - The world's easiest way to create high-quality APIs.
Apigility is an API Builder, designed to simplify
creating and maintaining useful, easy to consume, and
well structured APIs. Regardless of your experience in
API building, with Apigility you can build APIs that
enable mobile apps, developer communities, and any
other consumer controlled access to your applications.
With third party clients connecting to your service you may find that the assumptions or opinions of a typical rails application are not robust enough. We'll run through some key considerations when building an API that will be consumed by a mobile app.
Eclipse OMR: a modern, open-source toolkit for building language runtimesDev_Events
Daryl Maier, Compiler Development Performance, IBM
Cloud, @0xdaryl
Java runtime technology has benefited from hundreds
of person years of development investment over the
last 20 years, resulting in a highly capable, high
performance and scalable dynamic language with a
vibrant developer ecosystem. The recently created OMR incubator project at Eclipse
(https://github.com/eclipse/omr) aims to expand access to high quality runtime technology for other
dynamic languages through an ongoing effort to restructure the core components of the J9 Java Virtual
Machine. Rather than building new languages on top of Java, however, this project aims to unlock the
inner workings of the JVM without imposing Java semantics to create a platform for building highly
capable language runtimes. This talk will introduce developers to the Eclipse OMR project: what it is, the
runtime technology that has been contributed so far, promising projects that leverage this technology,
active areas of development, and how developers can get involved.
Eclipse MicroProfile: Accelerating the adoption of Java MicroservicesDev_Events
Emily Jiang, WebSphere Application Server, CDI Development Lead, IBM Cloud @emilyfhjiang
While there are likely a dozen or more Java-based microservice / cloud native initiatives in the industry,
Eclipse MicroProfile provides a platform for Java developers to collaborate and innovate on areas of
common interest. This BOF will give a short overview of MicroProfile and how it plans to optimize
microservices for Enterprise Java, followed by a short Q&A to answer any clarifying questions, and the
remainder of the time spent on collaborating to prioritize features for the next release.
While MicroProfile's first release is founded in Java EE (CDI + JSON-P + JAX-RS), it is not intended to
remain a subset of Java EE 7 (or 8). The intent is to collaborate and innovate as a community in the
context of a microservices architecture across the 5 (and growing) MicroProfile implementations today.
The end goal of MicroProfile is to feed the Java Community Process (JCP) with JSR submissions backed
by well-thought-out concepts and even implementations that developers and enterprises can rely on.
Come collaborate with your fellow MicroProfilers to move Enterprise Java microservices forward.
From Science Fiction to Science Fact: How AI Will Change Our Approach to Buil...Dev_Events
Rama Akkiraju, Distinguished Engineer, Master Inventor, IBM Watson User Technologies
IBM Watson and Cloud Platform
We have entered a new period of computing history — a cognitive era. For decades, science fiction visionaries have shared their renditions of intelligent machines and computers that could learn and function as humans. Intelligent machines have moved beyond the lore of science fiction; today, they are a reality thanks to breakthroughs in AI and machine learning. So how will this impact and change the apps that we build and how we leverage new and existing data?
In this interactive session, we’ll explore those questions and:
• Discuss where AI currently is and where the technology is going
• Show how pioneering apps and developers around the world are already using it
• Provide access to sample code and applications which you and your teams can use to understand and explore cognitive computing for yourself
Introduction to Blockchain and HyperledgerDev_Events
Nitesh Thakrar, IT Software Architect,
IBM @niteshpthakrar and Benjamin Fuentes, Software
Architect and Developer, IBM, @benji_fuentes
This workshop will be in 3 stages:
1. A brief presentation on Blockchain and why
Hyperledger
2. A demo use case to explain the architecture and the code behind the demo
3. Finally, the attendees will create their own blockchain application on the cloud. The hands-on
will also invite them to use the appropriate APIs and event update a smart contract.Majority of
the time will be in doing the hands-on (step 3) so that the attendees are able to continue
developing their application after the event.Requirements: Attendees will need to bring their
laptops and be able to connect to wifi.
Using GPUs to Achieve Massive Parallelism in Java 8Dev_Events
Adam Roberts, IBM Spark Team Lead – Runtimes, IBM Cloud
Graphic processing units (GPUs) are not limited to traditional scene rendering tasks. They can play a
huge role in accelerating applications that have a large number of parallelizable tasks.
Learn how Java can exploit the power of GPUs to optimize high-performance enterprise and technical
computing applications such as big data and analytics workloads, through both explicit GPU
programming and letting the Java JIT compiler transparently off-load work to the GPU.
This presentation covers the principles and considerations for GPU programming from Java and looks at
the software stack and developer tools available. After this talk you will be ready to extract the full
power of GPUs from your own application. We will present a demo showing GPU acceleration and
discuss what is coming in the future.
Lean and Easy IoT Applications with OSGi and Eclipse ConciergeDev_Events
Jan Rellemeyer, Research Staff Member, IBM Research, @rellermeyer
Modularization of software is key to handling the inherent complexity of distributed applications like for
the Internet of Things (IoT) and provide a flexible environment to evolve applications and manage their
deployment effectively. OSGi is a popular framework for dynamic modules for the Java language. Eclipse
Concierge provides a clean, small and lightweight implementation of the OSGi core framework
specification, specifically tailored to embedded systems and IoT.
Eclipse JDT Embraces Java 9 – An Insider’s ViewDev_Events
Manoj Palat, IBM Cloud and Sasikanth Bharadwaj, Developer, Eclipse JDT Core
Eclipse Java Development Tooling or JDT has its own Java compiler at its core, aptly called the JDT Core
consisting of the Java compiler and various tools including java model, search infrastructure, content
assist, Abstract Syntax Tree Tools etc. Java 9 is the latest entry in the Java world bringing along-with it a
“module” of changes – so to speak. Any change in the language standards affects JDT directly. While
some of the earlier language specification changes affected only the compiler, Java 9, in contrast, has a
direct impact on user who uses Eclipse IDE for creating and managing Java Projects. Java 9 introduces
the concept of “Modules” which affects JDT from the compiler level to the project dependency layer
affecting a normal user. Support for this feature will be dealt with, in detail, in this talk.
Sam Roberts, Team Lead, StrongLoop and API Connect, IBM @octetcloud and Michael Dawson, Software
Developer, IBM @mhdawson1
You’ll have some captive Node.js/V8 collaborators, and you can ask them anything! Confused about the
LTS plans, wondering what is happening in the Node workgroups, want to know what is really going to
happen with Webworkers, what’s the future of Promises in Node.js? Wondering how to debug your
production failures? Ask us anything, and we’ll try and answer!
Robert Dickerson, Software Developer, IBM-Swift, @rfdickerson
Of course its allowed - just matters how you do it. In this part of the workshop we’ll start with
serverless: New cloud programming models enabled by serverless architectures are emerging, allowing
developers to focus more sharply on creating their applications and less on managing their
infrastructure. The OpenWhisk project started by IBM and now part of Apache provides an open source
platform to enable these cloud native, event-driven applications. In this talk, we will provide an
overview of serverless architectures, introduce the OpenWhisk programming model, and then show
how to deploy an OpenWhisk application on IBM Bluemix OpenWhisk.
Then we’ll get Swift! It’s not only a language you turn to to build your iOS application, but it can also be
the language you can use to build your backend. This part of the workshop will use a text-based
adventure game called "GameOn" as an example for building a Server-side Swift App.
Topics include:
• How to create a web service using the IBM Kitura web framework • How to integrate the Watson SDK
for Swift into your application • How to dockerize your Swift application and deploy it to Bluemix
Being serverless and Swift... Is that allowed? Dev_Events
Animesh Singh, STSM - IBM Cloud Platform, @AnimeshSingh
Of course its allowed - just matters how you do it. In this part of the workshop we’ll start with
serverless: New cloud programming models enabled by serverless architectures are emerging, allowing
developers to focus more sharply on creating their applications and less on managing their
infrastructure. The OpenWhisk project started by IBM and now part of Apache provides an open source
platform to enable these cloud native, event-driven applications. In this talk, we will provide an
overview of serverless architectures, introduce the OpenWhisk programming model, and then show
how to deploy an OpenWhisk application on IBM Bluemix OpenWhisk.
Then we’ll get Swift! It’s not only a language you turn to to build your iOS application, but it can also be
the language you can use to build your backend. This part of the workshop will use a text-based
adventure game called "GameOn" as an example for building a Server-side Swift App.
Topics include:
• How to create a web service using the IBM Kitura web framework • How to integrate the Watson SDK
for Swift into your application • How to dockerize your Swift application and deploy it to Bluemix
Secrets of building a debuggable runtime: Learn how language implementors sol...Dev_Events
Bjørn Vårdal, J9VM Software Developer, IBM, @bvaardal
New language runtimes appear all the time, but most of them die young. Failure can be attributed to
different reasons, but an important factor is that lack of support can limit the community’s and
industry’s willingness to adopt the new language.
Quicker development and improved serviceability allows emerging languages to overcome this obstacle.
By building on the proven technology available in Eclipse OMR, language developers can get more than
performance and stability; you also get tools that help you quickly debug your language runtime,
allowing you to provide competitive serviceability.
From this presentation, you will learn how to enable Eclipse OMR’s mature debugging features in your
language runtime, and also how Eclipse OMR can assist with development and debugging
Tools in Action: Transforming everyday objects with the power of deeplearning...Dev_Events
Marek Sadowski, Developer Advocate, IBM, @blumareks
With cognitive computing, we are now able to interact with everyday objects in ways that were deemed
impossible. In this session, we will demonstrate the power of cognitive Internet of Things and the Cloud
platform to securely connect and manage devices, analyze data, and apply cognitive services to add
human-like interaction.
Leveraging cognitive services for sentiment, tone, and visual analysis invoked from IoT/robotics
platforms and Voice UI interface we will show how you can quickly and securely turn a simple idea into
reality by transforming a regular robot vacuum into a cognitive-enabled smart device.
Servers are killing your productivity. Rather than building better software for your users, you end up constantly distracted by maintaining computers. Wasn't the "cloud" supposed to fix this? It sounded so promising until we realized it was just renting VMs in someone else's datacenter. We couldn't escape "servers". Until now...
In this session, developers will learn how to build microservices without servers, using modern “serverless” cloud platforms. We’ll look at common challenges (and solutions) to building applications using “serverless” stacks. Exploring emerging “serverless” design patterns will give developers the knowledge to build application architectures using these new platforms.
Presented by Jonathan Kaufman, Developer Advocate for IBM Emerging Technology currently residing in Cambridge, MA.
Create and Manage APIs with API Connect, Swagger and BluemixDev_Events
Presented by - Raghavan “Rags” Srinivas, Architect, IBM
Enabling other developers and organizations to use your APIs through their own applications and services provides a compelling system for innovation and monetization. The Swagger spec (v2.0), recently donated to the Open API Initiative (OAI), is part of an open source project for better creation and documentation of APIs. Companies are empowering developers via these initiatives to leverage the data and build apps around it. This hands-on session helps you get started with creating APIs for consumption by developers in a well-documented, secure, and easy-to-manage form.
Serverless architectures are one of the hottest trends in cloud computing this year, and for good reason. There are several technical capabilities and business factors coming together to make this approach compelling from both an application development and deployment cost perspective. The new OpenWhisk project provides an open source platform to enable these cloud-native, event-driven applications.
This talk will lay out the technical and business drivers behind the rise of serverless architectures, provide an introduction to the OpenWhisk open source project (and describe how it differs from other services like AWS Lambda), and give a demonstration showing how to start developing with this new cloud computing model using the OpenWhisk implementation available on IBM Bluemix.
Lightning talk and lab presented by IBM Cloud Software Engineer, Andrew Bodine.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Welocme to ViralQR, your best QR code generator.ViralQR
Welcome to ViralQR, your best QR code generator available on the market!
At ViralQR, we design static and dynamic QR codes. Our mission is to make business operations easier and customer engagement more powerful through the use of QR technology. Be it a small-scale business or a huge enterprise, our easy-to-use platform provides multiple choices that can be tailored according to your company's branding and marketing strategies.
Our Vision
We are here to make the process of creating QR codes easy and smooth, thus enhancing customer interaction and making business more fluid. We very strongly believe in the ability of QR codes to change the world for businesses in their interaction with customers and are set on making that technology accessible and usable far and wide.
Our Achievements
Ever since its inception, we have successfully served many clients by offering QR codes in their marketing, service delivery, and collection of feedback across various industries. Our platform has been recognized for its ease of use and amazing features, which helped a business to make QR codes.
Our Services
At ViralQR, here is a comprehensive suite of services that caters to your very needs:
Static QR Codes: Create free static QR codes. These QR codes are able to store significant information such as URLs, vCards, plain text, emails and SMS, Wi-Fi credentials, and Bitcoin addresses.
Dynamic QR codes: These also have all the advanced features but are subscription-based. They can directly link to PDF files, images, micro-landing pages, social accounts, review forms, business pages, and applications. In addition, they can be branded with CTAs, frames, patterns, colors, and logos to enhance your branding.
Pricing and Packages
Additionally, there is a 14-day free offer to ViralQR, which is an exceptional opportunity for new users to take a feel of this platform. One can easily subscribe from there and experience the full dynamic of using QR codes. The subscription plans are not only meant for business; they are priced very flexibly so that literally every business could afford to benefit from our service.
Why choose us?
ViralQR will provide services for marketing, advertising, catering, retail, and the like. The QR codes can be posted on fliers, packaging, merchandise, and banners, as well as to substitute for cash and cards in a restaurant or coffee shop. With QR codes integrated into your business, improve customer engagement and streamline operations.
Comprehensive Analytics
Subscribers of ViralQR receive detailed analytics and tracking tools in light of having a view of the core values of QR code performance. Our analytics dashboard shows aggregate views and unique views, as well as detailed information about each impression, including time, device, browser, and estimated location by city and country.
So, thank you for choosing ViralQR; we have an offer of nothing but the best in terms of QR code services to meet business diversity!
1. remkohdev 9/25/2016
Creating Sentiment Line Chart for the News with Watson, Python, and D3js
remkohde.com/2016/09/25/creating-sentiment-line-chart-for-the-news-with-watson-python-and-d3js/
Requirements:
You must have Python installed. Check to see if you have Python installed from the commandline:
python --version
Table of Contents:
1. Create a Starterapp
2. Git Clone and Setup
3. Create Additional Folders and Files
4. Commit and Push Changes to Repository, Build and Deploy
5. Create an AlchemyAPI service
6. Create a Cloudant NoSQL service
7. Add the Basic Workflow for Request-Response
8. Get News using AlchemyAPI
9. Create Helper Functions
10. Save Responses in Cloudant
11. Parse Response for D3js
12. Draw the Line Chart in D3js
You can import AlchemyAPI requests into Postman with this Postman collection.
The source code for the application can be viewed or cloned from Github.
1. Create a Starterapp
1. Go to Catalog > Boilerplates
2. Click the ‘Python Flask’ starterapp
3. For name enter -newssentiment
4. Go to Overview
5. Under ‘Continuous Integration’ click ‘Add GIT Repo and Pipeline’ to add a DevOps platform, select ‘Populate the repo with the starterapp packageand
enable Build & Deploy pipeline’ > Click Continue > Click ‘CLOSE’.
6. Click ‘EDIT CODE’.
7. The very first time you login to the ‘DevOps’ environment you will need to pick a username for the ‘DevOps’ environment.
8. In the left menu of icons, click the top folder icon, and click ‘Git URL’ to copy the Git repository url.
9. If you prefer to edit in the online editor in Bluemix, click ‘EDIT CODE’ button and then click the second pencil icon in the left menu of icons.
10. I will continue to work on localhost instead.
2. Git Clone and Setup
1. To work on your localhost, from the commandline clone the remote repository from bluemix DevOps to your localhos:
git clone https://hub.jazz.net/git/<username>/remkohdev-newssentiment
cd remkohdev-newssentiment
2. Setup the virtualenv and activate virtualenv:
virtualenv venv
. venv/bin/activate
3. install Python3
virtualenv -p python3 venv
4. Install flask package into the right runtime, i.e. ‘python3.5’ thus using ‘pip3.5’:
pip3.5 install flask
5. Run Flask as follows with ‘python3.5’:
export FLASK_APP=welcome.py
python3.5 -m flask run
Open a browser and go to http://localhost:5000. You should see the following startup app.
1/29
2. 3. Create additional folders and files
Open the editor:
1. Open the ‘Procfile’ and verify the startup command to ‘web: python welcome.py’,
2. To create a new folder in the online editor, click: File > New > Folder from the top menu ‘templates’,
3. Create the following folders:
‘~/templates’
‘~/static/js’
‘~/static/js/d3js’
‘~/static/js/jquery’
‘~/static/js/jquery-validation’
‘~/mymodule’ , a module folder to hold custom packages.
4. To create a new file in the online editor, click: File > New > File,
5. Create the following files:
‘~/.gitignore’,
‘~/.cfignore’,
‘~/templates/index.html’,
‘~/templates/report.html’,
‘~/mymodule/myalchemyapi.py’,
‘~/mymodule/mycloudant.py’,
‘~/mymodule/__init__.py’ , to make the ‘~/mymodule’ folder a Python module you have to create an empty file named ‘__init__.py’.
6. I am using version 3 of D3js, though recently version 4 was published. Download and unzip ‘https://github.com/d3/d3/releases/download/v3.5.17/d3.zip’
to the ‘~/static/js/d3js’ folder.
In the online editor, you can import libraries via the import feature. Select the ‘~/static/js/d3js’ folder, then from the top menu, click File > Import > HTTP,
paste ‘https://github.com/d3/d3/releases/download/v3.5.17/d3.zip’ and click ‘Submit’,
7. Also download and install JQuery and JQuery-Validation.
Download ‘https://code.jquery.com/jquery-3.1.1.min.js’ to the ‘~/static/js/jquery’ folder.
In the online editor, select the ‘~/static/js/jquery’ folder, then from the top menu, click File > Import > HTTP, paste ‘https://code.jquery.com/jquery-
3.1.1.min.js’ and click ‘Submit’,
Download and unzip ‘https://github.com/jzaefferer/jquery-validation/releases/download/1.15.1/jquery-validation-1.15.1.zip’ to the
‘~/static/js/jquery-validation’ folder.
Select the ‘~/static/js/jquery-validation’ folder, then from the top menu, click File > Import > HTTP, paste ‘https://github.com/jzaefferer/jquery-
validation/releases/download/1.15.1/jquery-validation-1.15.1.zip’ and click ‘Submit’.
4. Commit and Push Changes to Repository, Build and Deploy
From localhost using git:
2/29
3. 1. Add the following directories to ‘~/.gitignore’ and ‘~/.cfignore’
venv/
__pycache__/
2. Verify the files that have changed
git status
You should see
.gitignore
mymodule/
static/js/
templates/
3. Add the files to the git index
git add *
4. Commit the files for push to the remote master branch
git commit -m "setup"
5. And push the files to the remote master
git push
From localhost using the CloudFoundry cli:
1. Make the changes to ‘~/.gitignore’ and ‘~/.cfignore’ as above,
2. Make sure the cf cli is installed or install it from ‘https://github.com/cloudfoundry/cli/releases’,
3. Connect to Bluemix
cf api https://api.ng.bluemix.net
You will be asked to login with your Bluemix username (registration email) and password, and select a space.
4. Push changes to Bluemix
cf push
From the online editor:
1. In the left menu of icons, click the third Git icon,
2. In the right commit message box, type ‘init1’ and click ‘Commit’,
3. In the left, in the ‘Outgoing’ section, make sure the commits appear and click ‘Push’,
4. Go to the top right ‘BUILD & DEPLOY’, the default Build stage and Deploy stage should be triggered,
5. If an error occurs, from the commandline on your localhost, use ‘cf login’ and ‘cf logs –recent -newssentiment’ to find detailed log output,
6. Alternatively to using the online Git, you can use in the online editor next to the application status box, the play button to ‘Deploy the App from the
Workspace’.
5. Create an AlchemyAPI service
1. Go back to the application overview page,
2. In ‘Connections’ in the ‘new-console’, click ‘Connect New’, or in classic ‘console’, click ‘ADD A SERVICE OR API’,
3. This takes you to the Catalog, select the ‘Watson’ category, search and click AlchemyAPI,
4. In ‘Service Name’ enter ‘-newssentiment-AlchemyAPI’, make sure in the left under ‘Connect to’ the application you created is selected, select the ‘Free’
plan and click ‘CREATE’, and ‘RESTAGE’.
5. In the ‘new-console’, go to ‘Runtime’ and ‘Environment Variables’, in classic console go to ‘Environment Variables’. Under ‘VCAP_SERVICES’ you will
find the credentials of the services or connections, with these you can access the AlchemyAPI.
6. Create a Cloudant NoSQL service
1. Go back to the application overview page again,
2. In ‘Connections’ in the ‘new-console’, click ‘Connect New’, or in classic console, click ‘ADD A SERVICE OR API’,
3. This takes you to the Catalog again, select the ‘Data and Analytics’ category, and click ‘Cloudant NoSQL DB’,
4. In ‘Service Name’ enter ‘-newssentiment-Cloudant’, make sure in the left under ‘Connect to’ the application you created is selected, select the free ‘Lite’
plan and click ‘CREATE’, and ‘RESTAGE’,
7. Add the Basic Workflow for Request-Response
Now we are ready to code and connect all the pieces.
I will:
1. Change the ‘index.html’ and ‘report.html’ pages,
3/29
4. 2. Change code for the ‘/’ route, and create a ‘/search’ route.
In your editor, open the ‘welcome.py’ file,
look for the line ‘@app.route(‘/’)’ around line 20, and change the return value to return render_template('index.html')
At the top of the file add the ‘render_template’, ‘Response’ and ‘request’ packages to the import from flask’,
from flask import Flask, jsonify, render_template, Response, request
Remove the code for the routes ‘/myapp’, ‘/api/people’, ‘/api/people/‘.
Add the ‘/search’ route to the ‘welcome.py’ file, so that your ‘welcome.py’ code now looks as follows:
import os
from flask import Flask, jsonify, render_template, Response, request
app = Flask(__name__)
@app.route('/')
def Welcome():
#return app.send_static_file('index.html')
return render_template('index.html')
@app.route('/search')
def Search(startdate=None, enddate=None, searchterm=None, count=None):
startdate = request.args.get('startdate', '7daysago')
enddate = request.args.get('enddate', 'today')
searchterm = request.args.get('searchterm')
count = request.args.get('count')
response = {
'startdate' : startdate,
'enddate' : enddate,
'searchterm' : searchterm,
'count' : count
}
return render_template('report.html',
response=response)
port = os.getenv('PORT', '5000')
if __name__ == "__main__":
app.run(host='0.0.0.0', port=int(port))
4/29
5. view raw newssentiment_flask_server_routes.html hosted with by GitHub
Add the following code to the ‘~/templates/index.html’ file
<html>
<head>
<title>My News Sentiment</title>
<link href="{{ url_for('static', filename='stylesheets/style.css') }}">
<style type="text/css">
5/29
8. view raw newssentiment_flask_index.html hosted with by GitHub
Add the following code to the ‘~/templates/report.html’ file
<html>
<head>
<title>News Sentiment Response</title>
<link href="{{ url_for('static', filename='stylesheets/style.css') }}"></link>
<style type="text/css">
8/29
10. view raw newssentiment_flask_report.html hosted with by GitHub
In the online editor, deploy the app from the workspace. On localhost, restart the application
python3.5 -m flask run
and in your browser go to http://127.0.0.1:5000/.
Index.html
10/29
11. Report.html
8. Get News using AlchemyAPI
So far, the application allows a user to enter input information to do a news search, but the server just returns the input information.
Let’s take a look at the options for the AlchemyAPI News service.
Open a new browser tab and go to the AlchemyAPI Query Builder tool,
In ‘Search articles over’ select for startdate ‘August 1, 2016’ and for enddate select ‘September 16, 2016’, and click ‘Apply’,
Enter a ‘where’ search term, change ‘is mentioned’ to ‘anywhere’, change ‘and the Sentiment is’ to ‘Any’, select an appropriate Taxonomy, change ‘in the
article’ to ‘body’,
In the Return section to the right, select all fields to enrich the search results with all NLP analytics, and ‘Run Query’,
Now, let’s add the Watson AlchemyAPI News service, so that the search form actually will return real news results.
1. I am using a package called ‘http.client’, which is a Python3 package, so I have to change the Python version value in the ‘runtime.txt’ file to ‘python-
3.5.1’,
2. Add the following ‘import’ statement at the top of ‘welcome.py’ to import the custom packages of the ‘mymodule’ module we created earlier,
implementing the interaction with the AlchemyAPI and Cloudant services.
from mymodule import myalchemyapi, mycloudant
import json
3. In the ‘~/mymodule/myalchemyapi’ package, add a function ‘GetNews()’ as follows:
import http.client
import csv
apikey = "<your-apikey>"
def GetNews(searchterm=None, outputMode="json", startdate=None, enddate=None, count="5", returnfields="enriched.url.url"):
conn = http.client.HTTPSConnection("gateway-a.watsonplatform.net")
headers = {
11/29
13. view raw newssentiment_flask_f2f_getnews1.html hosted with by GitHub
4. Go to the application ‘Environment Variables’ page and in the ‘VCAP_SERVICES’ look for the ‘alchemy_api’ node, and copy the ‘apikey’ value in the
‘credentials’ node. Go back to the ‘~/mymodule/myalchemyapi’ file and paste the value in place of ‘’
apikey = ""
5. In the ‘welcome.py’ file, change the ‘Search’ function, as follows:
@app.route('/search')
def Search(startdate=None, enddate=None, searchterm=None, count=None):
startdateStr = request.args.get('startdate')
enddateStr = request.args.get('enddate')
13/29
14. searchterm = request.args.get('searchterm')
count = request.args.get('count')
# format the correct start and end formats
startdate = myalchemyapi.FormatDate(startdateStr)
enddate = myalchemyapi.FormatDate(enddateStr)
# GetNews with Sentiment
returnfields = 'enriched.url.url%2Cenriched.url.title%2Cenriched.url.publicationDate.date%2Cenriched.url.docSentiment.score'
articles = myalchemyapi.GetNews(searchterm=searchterm, returnfields=returnfields, startdate=startdate, enddate=enddate, count=count)
# prepare for d3js, calculate the average sentiment per day
uniqueSentimentList = myalchemyapi.ParseNews(articles, startdateStr, enddateStr)
response = {
'news' : uniqueSentimentList,
'startdate' : startdateStr,
'enddate' : enddateStr,
'searchterm' : searchterm
}
return render_template('report.html', response=response)
14/29
15. view raw newssentiment_flask_routes_search2 hosted with by GitHub
Some comments to the new ‘welcome.py’ code:
I added two helper functions ‘myalchemyapi.FormatDate(startdateStr)’ and ‘myalchemyapi.ParseNews(articles, startdateStr)’, so we need to add these
still to the ‘mymodule/myalchemyapi.py’ package. I will do that in the next step.
The AlchemyAPI GetNews API is more than just a News Search. The API combines news search with Watson NLP analytics in a single call. The real
power comes from the input parameters of the API that add complex configuration options that can include multiple NLP analytics to filter search results.
In the ‘returnfields’ input parameter, I set the ‘return’ parameter for the API, which defines what data and meta-data from the search results I want to
retrieve. There is a full list of Return values in the API documentation, the full list is accessible in this Google spreadsheet with currently 419 options. For
now, I am only going to retrieve 3 fields: title, publication date and the sentiment score of the overall document.
The sentiment score add for each search result a Sentiment Analysis API call. This will add the following return field:
"docSentiment": {
"score": -0.112443998
}
15/29
16. 9. Create Helper Functions
Now, I will create the two helper methods ‘myalchemyapi.FormatDate(startdateStr)’ and ‘myalchemyapi.ParseNews(articles, startdateStr)’.
1. First, add the following code to the ‘mymodule/myalchemyapi.py’ package:
import http.client
import csv
from datetime import datetime
import json
from mymodule import mycloudant
apikey = ""
def GetNews(searchterm=None, outputMode="json", startdate=None, enddate=None, count="5", returnfields="enriched.url.url"):
conn = http.client.HTTPSConnection("gateway-a.watsonplatform.net")
headers = {
'content-type': "application/json"
}
endpoint = ('/calls/data/GetNews?
outputMode={0}&start={1}&end={2}&count={3}&q.enriched.url.enrichedTitle.keywords.keyword.text={4}&return={5}&apikey={6}').format(outputMode,
startdate, enddate, count, searchterm, returnfields, apikey)
print("==GetNews API. endpoint: %s", endpoint)
conn.request("GET", endpoint, headers=headers)
res = conn.getresponse()
logMsg = ("GetNews API. response: status[{0}], msg[{1}], reason[{2}]").format(res.status, res.msg, res.reason)
print(logMsg)
# HTTPResponse.read returns bytes[]
data = res.read()
responseStr = data.decode("utf-8")
return responseStr
'''
1. the GetNews Alchemy API takes date formats in UTC timezone in seconds,
it also has convenience methods, in the form of 'now-1M' for the last month,
'now-1d' for yesterday, so I here convert any datetime to 'now-{0}d',
so that start and end could be e.g. 'now-30d' to 'now-0d'.
'''
def FormatDate(dateStr=None):
now = datetime.now()
16/29
17. date1 = datetime.strptime(dateStr, '%Y-%m-%d')
delta1 = now-date1
date1 = ("now-{0}d").format(delta1.days)
return date1
'''
1. d3js takes an array of assiociative arrays as input, for convenience
I prepare that arrayon the server.
2. I create an array of unique days to be visualized in d3js and
have to order the set, cause d3js create a graph by drawing a line from
point to point, and i want to prevent the line to go back and forth,
creating a very messy graph.
'''
def ParseNews(articles=None, startdate1=None, enddate1=None):
#print(("=====Articles: {0}").format(articles))
status1 = ""
startdate1 = datetime.strptime(startdate1, '%Y-%m-%d')
enddate1 = datetime.strptime(enddate1, '%Y-%m-%d')
if (articles==None or articles==""):
logMsg = "GetNews API Error: no response. "
print(logMsg)
return logMsg
else:
logMsg = ("GetNews API response: {0}").format(articles)
#print(logMsg)
articlesJson = json.loads(articles)
status1 = articlesJson['status']
if status1=='ERROR':
statusInfo = articlesJson['statusInfo']
logMsg = ('GetNews API Error. StatusInfo: {0}').format(statusInfo)
print(logMsg)
return logMsg
elif status1=='OK':
logMsg = "GetNews API status: OK"
#print(logMsg)
17/29
18. # Here everything is OK
mycloudant.SaveNews(articles)
sentimentList = []
docs = articlesJson['result']['docs']
for doc in docs:
enrichedURL = doc['source']['enriched']['url']
# Get publicationDate
publicationDate = enrichedURL['publicationDate']['date']
sentiment = enrichedURL['docSentiment']['score']
# construct data array for d3js, append row
sentimentRow = {"publicationDate": publicationDate, "sentiment": sentiment}
sentimentList.append(sentimentRow)
#get unique publicationDates
uniqueSentimentList=[]
uniqueDates = set()
for dic in sentimentList:
pubdate1 = dic['publicationDate']
pubdate1 = datetime.strptime(pubdate1, '%Y%m%dT%H%M%S')
# make sure publicationdates are within range
if (startdate1 < pubdate1) and (pubdate1 < enddate1):
# set times for all dates to zero for Ymd comparison
pubdate1 = pubdate1.replace(hour=0, minute=0, second=0)
# only add the date if new date
if pubdate1 not in uniqueDates:
uniqueDates.add(pubdate1)
uniqueDates = sorted(uniqueDates)
# loop through the uniqueDates and calculate averages for duplicates by date
i1 = 0
for uniqueDate in uniqueDates:
i1+=1
sentiments = 0
i=0
for row in sentimentList:
rowDate = datetime.strptime(row['publicationDate'], '%Y%m%dT%H%M%S')
18/29
19. # set times for all dates to zero for Ymd comparison
rowDate = rowDate.replace(hour=0, minute=0, second=0)
if rowDate==uniqueDate:
i+=1
sentiments += row['sentiment']
avgSentiment = sentiments/i
shortUniqueDate = ("{0}-{1}-{2}").format(uniqueDate.strftime("%Y"), uniqueDate.strftime("%m"), uniqueDate.strftime("%d"))
uniqueSentimentRow = {"publicationDate": shortUniqueDate, "sentiment": avgSentiment}
uniqueSentimentList.append(uniqueSentimentRow)
return uniqueSentimentList
19/29
20. view raw newssentiment_flask_alchemyapi.py hosted with by GitHub
10. Save Responses in Cloudant
I want to save all search results. First, I have to create a database in cloudant to store all search results.
1. In the ‘new-console’ go to ‘All Items’ or in the classic console in the application overview page, under ‘Services’, click the ‘Cloudant NoSQL’ service, and
click the green ‘LAUNCH’ button,
2. In the left menu, click ‘Databases’,
3. In the top right of the page, click ‘Create Dababase’, enter ‘newssentiment’ and click ‘Create’.
Next configure the Python application to use Cloudant to save the search results. I am using the Python Cloudant package.
1. In your IDE, open the ‘~/mymodule/mycloudant.py’ file and add the following code:
20/29
22. view raw newssentiment_flask_mycloudantdb.py hosted with by GitHub
In the application overview page, go to the ‘Environment Variables’ page and in the ‘VCAP_SERVICES’ look for the ‘cloudantNoSQLDB’ service. Copy
the credentials and configure the Cloudant credentials in the ‘~/mymodule/mycloudant.py’ file.
username = "<cloudant_username>"
password = "<cloudant_password>"
cloudantURL = "<cloudant_url>"
For the cloudantURL, use the format ‘.cloudant.com’ without ‘username:password@’.
2. The code in the ‘~/mymodule/mycloudant.py’ file, imports the Cloudant package from the ‘cloudant.client’ module, which is not yet installed:
from cloudant.client import Cloudant
22/29
23. 3. To install the ‘Cloudant’ package for python3.5, from the commandline in the root of your project, run:
pip3.5 install cloudant
and make sure it gets installed in the ‘venv/lib/python3.5/site-packages/’.
Note the installation results:
Installing collected packages: requests, cloudant
Successfully installed cloudant-2.1.1 requests-2.11.1
4. Edit the file ‘requirements.txt’ to include the correct package version:
Flask==0.10.1
cloudant==2.1.1
Bluemix uses the ‘requirements.txt’ file to install dependencies, instead of running from a ‘virtualenv’ environment like I do on localhost.
5. Add the following line in the ‘mymodule/myalchemyapi.py’ package in the ‘ParseNews()’ function around line 70 before parsing the ‘result’:
# Here everything is OK
mycloudant.SaveNews(articles)
sentimentList = []
docs = articlesJson['result']['docs']
for doc in docs:
Report.html with AlchemyAPI GetNews API results.
11. Parse Response for D3js
The ‘def ParseNews(articles=None, startdate1=None):’ method in the ‘mymodule/myalchemyapi.py’ package, parses the JSON document from the
AlchemyAPI to a format that is used by D3js to load and draw the graph. D3js has its own functions to transform data, but I prefer to do it on the server.
The D3js format for the sentiment data is as follows:
[
{"publicationDate": publicationDate, "sentiment": sentiment},
{"publicationDate": publicationDate, "sentiment": sentiment}
]
The ‘ParseNews()’ method creates the correct format, but there are also multiple results per day. For a better display in the D3js graph, I average multiple
scores for a single day, and sort the results ascending by date, so D3js will draw a logical line forward in time. The result is a list of unique dates with average
sentiment per day.
12. Draw the Line Chart in D3js
I used Mike Bostock’s Line Chart as the base graph for the Sentiment by Day chart.
Add the following code to the ‘~/templates/report.html’ page.
<html>
<head>
<title>News Sentiment Response</title>
<link href="{{ url_for('static', filename='stylesheets/style.css') }}"></link>
<style type="text/css">
23/29
27. // create a row for each object in the data
var rows = tbody.selectAll('tr')
.data(data)
.enter()
.append('tr');
// create a cell in each row for each column
var cells = rows.selectAll('td')
.data(function (row) {
return columns.map(function (column) {
val = row[column];
if(row[column] instanceof Date){
val = row[column].getFullYear()+"-"+
(row[column].getMonth()+1)+"-"+row[column].getDate();
}
return {column: column, value: val};
});
})
.enter()
.append('td')
.text(function (d) { return d.value; });
return table;
}
var table = tabulate(data, ['publicationDate', 'sentiment']);
</script>
</body>
</html>
27/29
28. view raw newssentiment_flask_report_d3js.html hosted with by GitHub
To select elements and create new HTML elements, you can use d3 as follows:
var body = d3.select("body");
body.append("h1")
.text("News Sentiment for '"+respSearchTerm+"'");
D3js lets you define and nest functions, e.g.
var formatDate = d3.time.format("%Y-%m-%d");
var x = d3.time.scale().range([0, width]);
var y = d3.scale.linear().range([height, 0]);
var xAxis = d3.svg.axis().scale(x).orient("bottom");
var line = d3.svg.line()
.x(function(d) { return x(d.publicationDate); })
.y(function(d) { return y(d.sentiment); });
28/29
29. data.forEach(function(d){
d.publicationDate = formatDate.parse(d.publicationDate);
d.sentiment = parseFloat(d.sentiment);
});
In this example, I have passed the data a Response object from the Flask server, and parse the values to be of Object type date based on the strftime()
function using the d3js function d3.time.format(), and the sentiment to be a floating Number with the default JavaScript function.
Similarly, when I draw the line with the function ‘d3.svg.line()’ I can set the x and y coordinates by a custom callback function, which itself calls the previously
defined functions x and y which use a range() function. D3js uses a lot of these type of nested functions.
In this part:
svg.append("path")
.datum(data)
.attr("class", "line")
.attr("d", line);
D3js binds the data object to the svg object and in the attribute the ‘line’ function is called, which sets the x and y coordinates respectively by applying
‘d.publicationDate’ and ‘d.sentiment’ (see above).
Similarly, it draws an x-axis and y-axis as follows:
svg.append("g")
.attr("class", "y axis")
.call(yAxis)
.append("text")
.attr("transform", "rotate(-90)")
.attr("y", 6)
.attr("dy", ".71em")
.style("text-anchor", "end")
.text("Sentiment");
29/29