Crossing the Bridge: Connecting Rails and your Front-end FrameworkDaniel Spector
1. The document discusses integrating front-end frameworks like Angular, Ember, and React with Rails by constructing JSON APIs, preloading data to avoid loading screens, and server-side rendering for SEO and performance.
2. It provides code examples for building a TODO application with each framework, including using ngResource and factories in Angular, Ember conventions like Ember Data, and building isolated React components.
3. Server-side rendering is highlighted as the future for isomorphic JavaScript, providing benefits like prerendering on initial page load.
Building a friendly .NET SDK to connect to SpaceMaarten Balliauw
Space is a team tool that integrates chats, meetings, git hosting, automation, and more. It has an HTTP API to integrate third party apps and workflows, but it's massive! And slightly opinionated.
In this session, we will see how we built the .NET SDK for Space, and how we make that massive API more digestible. We will see how we used code generation, and incrementally made the API feel more like a real .NET SDK.
The document discusses the mobl programming language for building mobile web applications. Mobl is a statically-typed language that compiles to HTML and JavaScript. It aims to provide features for building reactive user interfaces and uses techniques like continuation-passing style and observables to support asynchronous programming in a synchronous-looking way. The document provides examples of coding common mobile app patterns like data binding, network requests, and user input handling in mobl.
Amazon Web Services and the AWS SDK for PHP continue to put more power into the hands of PHP developers to build robust and scalable web applications. With version 2 of the SDK, developers now have an even more powerful library for interacting with AWS built on top of existing open source software like the Guzzle HTTP framework and the Symfony 2 Event Dispatcher. In this session you will learn about Amazon Web Services, how to use the AWS SDK for PHP, and how you can easily deploy and scale your applications to the cloud with AWS services, including AWS Elastic Beanstalk.
This is an adaptation of the presentation given at the SpringOne 2008 conference in Hollywood, FL. It contains some updates on project status, and also information about the recently published book "Spring Python 1.1"
This slideshow is licensed under a Creative Commons Attribution 3.0 United States License.
Writing HTML5 Web Apps using Backbone.js and GAERon Reiter
A walkthrough of how to write a complete HTML5 web app (both front end and back end) using Google App Engine (Python), Backbone.js, Require.js, underscore.js and jQuery.
Just recently on October 10th, Google announced a change in name of API.AI into DialogFlow. There are a couple of new features following this change. Regardless of what has been changed, in this post we are going to share a simple way of how to integrate your agents that is created using DialogFlow into any Qiscus chat SDK application.
Play 2.0 is a web framework for Java and Scala that is designed to be productive, asynchronous, and reactive. Some key features include being full stack, high-productive, asynchronous and reactive, stateless, HTTP-centric, typesafe, scalable, and open source. Play 2.0 aims to be fun and fast to develop with by enabling features like hot code reloading, browser error reporting, and easy deployment to platforms like Heroku. It also focuses on being asynchronous and reactive through support for WebSockets, Comet, HTTP streaming responses, and composable streams.
GraphQL is a query language and execution engine that was created by Facebook in 2012 and became an open standard in 2015. It provides improvements over REST such as allowing queries to retrieve multiple resources with one endpoint. Symfony implementations of GraphQL include the GraphQLBundle and OverblogGraphQLBundle which allow defining types, fields, resolvers, and security rules in YAML configuration files. Security features include limiting query depth and complexity as well as controlling access to fields.
- GraphQL is a query language and execution engine that allows clients to request specific data from an API rather than retrieve predefined resources. It was created by Facebook in 2012 and became an open standard in 2015.
- GraphQL provides improvements over REST APIs such as allowing clients to request specific data in one endpoint using queries rather than making multiple requests to different endpoints.
- Symfony implementations of GraphQL include the GraphQLBundle which allows defining types, fields, and resolvers in YAML configuration and connecting them to Symfony services and repositories.
- Security measures for GraphQL APIs include limiting query depth and complexity, field access control, and marking fields as deprecated.
Designing REST API automation tests in KotlinDmitriy Sobko
The document discusses designing REST API automation tests in Kotlin. It covers microservices architecture, REST APIs, backend testing principles, the Kotlin programming language, Cucumber BDD framework, Spring Boot framework, and how to combine these tools for testing. The goals are to create tests that are stable, resistant to code changes, fast, extensible, and easily supported.
Apache Sling is a web application framework which eases development of content centric applications. Sling is based on REST principles and uses a JCR content repository (JSR-170/JSR-283) for storage. Based on the JSR 223 specification (Scripting for the Java Platform) it integrates various scripting languages as OSGi bundles.
Scala is a scalable programming language for the JVM which is fully interoperable with Java. It is designed to express common programming patterns in a concise, elegant, and type safe way. Scala smoothly bridges the gap between object oriented and functional paradigms. Despite being strongly typed, Scala has the touch and feel of a genuine scripting language. It has the ability to infer types of expressions rather than relying on the programmer to explicitly declare them. Scala thus combines the best of the two worlds: flexible scripting and strong tool support e.g. documentation, safe refactoring and fail fast compilation. Its flexible syntax lets programmers easily define their own internal DSLs, effectively extending the language without leaving it.
Groovy is a dynamic language for the Java Virtual Machine that simplifies programming through features like closures, properties, and built-in support for lists, maps, ranges, and regular expressions. The latest version 1.5 adds support for Java 5 features like annotations and generics to leverage frameworks that use them. Groovy can be integrated into applications through mechanisms like JSR-223, Spring, and Groovy's own GroovyClassLoader to externalize business rules, provide extension points, and customize applications.
HTML5 introduces new semantic elements like article, header, nav, and section that divide the content into meaningful regions. It also defines new multimedia elements such as video, audio, and canvas. New form input types and attributes are added for validation. The Canvas API allows dynamic drawing via scripting. The Drag and Drop API supports dragging and dropping elements. Other HTML5 APIs include Geolocation, Web Storage, and Web Workers. Overall, HTML5 provides a powerful set of features for building robust, dynamic web applications.
Building a microservices architecture means making a lot of decisions, about tools, about frameworks. In this talk I share the decisions that we made at Measurence during our journey for building a microservices architecture based on Scala technologies.
We're going to talk about Spray, Akka, Swagger, Sbt, Docker, Jenkins, Mesos and Marathon.
Jetpack Compose is Google's new declarative UI toolkit for Android that aims to simplify building user interfaces. It uses composable functions to build up UI elements in a declarative way. Composables can update reactively in response to changes in state data models. This allows building UIs as simple as printing lines of code. Compose principles include treating UI as functions, using composable building blocks, and implementing a top-down data flow from state models to views through composables. The speaker demonstrates a simple counter app built with Compose.
This document discusses PHP user-defined functions and arrays. It covers defining functions with arguments and default values, as well as different types of arrays - indexed, associative, and multidimensional. Functions allow reusable blocks of code to be called, while arrays allow storing and accessing multiple values using a single variable name. Loops can be used to iterate through array elements.
Altitude NY 2018: Leveraging Log Streaming to Build the Best Dashboards, EverFastly
If knowing is half the battle, having the most information available is the best way to win. Using real-time log streaming and a knowledge of the data passing through the system, metrics can provide more depth and breadth in to the goings on requests as they pass through various parts of the stack. This session will cover the difference between logging and metrics, writing JSON and Influx Line Protocol in VCL, and building out dashboards to give deeper insights (and more importantly, alerting) on requests and responses at the edge.
The document introduces several uncommon design patterns:
1) Null Object pattern avoids using null values by implementing a "null" object that respects the expected interface.
2) Encapsulated Context pattern encapsulates common services/data needed by different components in a single context object rather than using global objects.
3) Role Object pattern handles modeling problems where an element can have different roles by using role objects that are added to and removed from a core object.
4) ISP & Object Adaptation pattern allows objects to adapt to different protocols by checking for direct implementation, using registered adapters, or throwing exceptions.
5) Essence pattern uses an "essence" class to encapsulate an object's configuration and
Similar to Prompt engineering for iOS developers (How LLMs and GenAI work) (20)
Protocols and generics in Swift allow for polymorphism, sharing of common behaviors and properties, and provide contracts between architecture layers. They help improve testability and allow decoupling of components. Protocols provide static and dynamic dispatch, while generics enable type-level abstraction through constraints and avoid code duplication through abstraction. Associated types and existential types enable value-level abstraction.
The document discusses using a finite state machine to manage real-time subscription connections in an app. It describes a state machine with two states - Connected and Disconnected. Based on events like subscription requests, connect/disconnect requests, and connection status changes, commands are issued and the state machine transitions between the two states accordingly. For example, when a subscription is requested in the Disconnected state, the subscription is saved and a connect command is issued to transition to the Connected state.
Machine learning allows computers to learn without being explicitly programmed. Neural networks are computing systems inspired by the brain that consist of neurons and connections between them. There are different types of machine learning including supervised learning for classification and regression, unsupervised learning like clustering, and transfer learning. Frameworks like Core ML can take models created in other frameworks and deploy them on iOS for tasks like object detection from images using bounding boxes and annotations.
Predicting Test Results without Execution (FSE 2024)andrehoraa
As software systems grow, test suites may become complex, making it challenging to run the tests frequently and locally. Recently, Large Language Models (LLMs) have been adopted in multiple software engineering tasks. It has demonstrated great results in code generation, however, it is not yet clear whether these models understand code execution. Particularly, it is unclear whether LLMs can be used to predict test results, and, potentially, overcome the issues of running real-world tests. To shed some light on this problem, in this paper, we explore the capability of LLMs to predict test results without execution. We evaluate the performance of the state-of-the-art GPT-4 in predicting the execution of 200 test cases of the Python Standard Library. Among these 200 test cases, 100 are passing and 100 are failing ones. Overall, we find that GPT-4 has a precision of 88.8%, recall of 71%, and accuracy of 81% in the test result prediction. However, the results vary depending on the test complexity: GPT-4 presented better precision and recall when predicting simpler tests (93.2% and 82%) than complex ones (83.3% and 60%). We also find differences among the analyzed test suites, with the precision ranging from 77.8% to 94.7% and recall between 60% and 90%. Our findings suggest that GPT-4 still needs significant progress in predicting test results.
Fix Production Bugs Quickly - The Power of Structured Logging in Ruby on Rail...John Gallagher
Rails apps can be a black box. Have you ever tried to fix a bug where you just can’t understand what’s going on? This talk will give you practical steps to improve the observability of your Rails app, taking the time to understand and fix defects from hours or days to minutes. Rails 8 will bring an exciting new feature: built-in structured logging. This talk will delve into the transformative impact of structured logging on fixing bugs and saving engineers time. Structured logging, as a cornerstone of observability, offers a powerful way to handle logs compared to traditional text-based logs. This session will guide you through the nuances of structured logging in Rails, demonstrating how it can be used to gain better insights into your application’s behavior. This talk will be a practical, technical deep dive into how to make structured logging work with an existing Rails app.
I talk about the Steps to Observable Software - a practical five step process for improving the observability of your Rails app.
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdfkalichargn70th171
Software testing is highly essential in the software development lifecycle. Selecting the appropriate testing tool is pivotal for effective test automation and project success. As technology advances, the demands of the software market escalate, pushing industry players to deliver high-quality products swiftly through agile methodologies.
Empowering Businesses with Intelligent Software Solutions - GrawlixAarisha Shaikh
Explore Grawlix's comprehensive suite of intelligent software solutions designed to drive transformative growth and scalability for businesses. This presentation covers our expertise in bespoke software development, digital marketing, web design, cloud solutions, cybersecurity, AI/ML, and IT consulting. Discover how Grawlix's customized solutions enhance productivity, streamline processes, and enable data-driven decision-making. Learn about our key projects, technologies, and the dedicated team who ensures exceptional client satisfaction through innovation and excellence.
AI - Your Startup Sidekick (Leveraging AI to Bootstrap a Lean Startup).pdfDaniel Zivkovic
Ready to take your #startup to the next level? Pankaj Upreti, Lagna360 founder, reveals how a #solopreneur can leverage #AI across their entire business. Learn to use AI as your ultimate sidekick in bootstrapping a #LeanStartup, from coding to marketing. Don't miss these game-changing insights for your entrepreneurial journey!
#ServerlessTO meetup recording is at https://youtu.be/J17OZ6_2jyk
Don't forget to like, comment, and subscribe for more insightful talks and tutorials from #Serverless #Toronto: https://www.meetup.com/serverless-toronto/events/
Trawex provides Amadeus Travel API is a collection of APIs that allow travel organizations to access Amadeus' various travel-related products and content. This includes the ability to search for flights, book flights, get hotel information, and view destination content. With the Amadeus API, travel agents and agencies can serve travelers globally, help them find the best deals, and manage their travel businesses, reducing costs and increasing revenues.
For more details, Pls visit our website:
https://www.trawex.com/amadeus-travel-api.php
4. How LLMs work - GPT architecture
Input processing
Input
Output
Decoder
Contextual and Session Handling
Safety and Content Filters
Bootstrap prompts
5. How LLMs work - Tokenisation
Swift is a powerful and intuitive programming language for all Apple platforms.
Swift is a powerful and intuitive programming language for all Apple platforms.
6. How LLMs work - Token Embeddings
-0.05,
0.017
…
-0.01
Vectors with 12288 dimensions (features) and positional encoding
-0.03,
0.118
…
-0.02
-0.01,
0.007
…
-0.004
…
Swift is a powerful and intuitive programming language for all Apple platforms.
7. How LLMs work - Token Embeddings
This vector encapsulates the semantic meaning of Google, without the
semantics of the word Kotlin, and also includes the semantics of the
word Swift.
Google - Kotlin + Swift = ?
8. How LLMs work - Token Embeddings
Google - Kotlin + Swift = Apple
9. How LLMs work - Token Embeddings
apple, 0.426
spotify, 0.396
amazon, 0.393
net
fl
ix, 0.387
yahoo, 0.382
snapchat, 0.371
huawei, 0.368
Google - Kotlin + Swift =
10. How LLMs work - GPT architecture
Input processing
Transformer layer
Transformer layer
Transformer layer
120 layers (GPT4)
Next word prediction
Decoder
Input
Output
Input +
next word
12. Generative AI as a service - OpenAI API
{
"model": "gpt-3.5-turbo",
"messages": [{
"role": "user",
"content": "Describe Turin in one sentence"
}],
"temperature": 0.7
}
POST https://api.openai.com/v1/chat/completions
13. Generative AI as a service - OpenAI API
struct AIMessage: Codable {
let role: String
let prompt: String
}
struct AIRequest: Codable {
let model: String
let messages: [AIMessage]
let temperature: Double
}
extension AIRequest {
static func gpt3_5Turbo(prompt: String)
-
>
AIRequest {
.init(model: "gpt-3.5-turbo",
messages: [
.init(role: "user", prompt: prompt)
],
temperature: 0.7
)
}
}
14. Generative AI as a service - OpenAI API
}
@MainActor
func invoke(prompt: String) async throws
-
>
String {
15. Generative AI as a service - OpenAI API
let (data, response) = try await URLSession.shared.data(for: request)
guard let httpURLResponse = (response as? HTTPURLResponse) else {
throw AIServiceError.badResponse
}
guard 200
.
.
.
399 ~= httpURLResponse.statusCode else {
throw AIServiceError.httpError(
code: httpURLResponse.statusCode,
description: String(data: data, encoding: .utf8)
?
?
""
)
}
let aiResponse = try decoder.decode(AIResponse.self, from: data)
return aiResponse.choices.f
i
rst
?
.
message.content
?
?
""
}
let openAIURL = URL(string: "https:
/
/
api.openai.com/v1/chat/completions")!
var request = URLRequest(url: openAIURL)
for (f
i
eld, value) in conf
i
g {
request.setValue(value, forHTTPHeaderField: f
i
eld)
}
request.httpMethod = "POST"
request.httpBody = try encoder.encode(AIRequest.gpt3_5Turbo(prompt: prompt))
@MainActor
func invoke(prompt: String) async throws
-
>
String {
20. Generative AI as a service work - Amazon Bedrock
Model Input Output
Titan Text Lite $0.30 / 1M tokens $0.40 / 1M tokens
Claude 3 Haiku $0.25 / 1M tokens $0.15 / 1M tokens
Titan Image
Generator
$0.005 / per image
21. Generative AI as a service work - Amazon Bedrock
AWS
API Gateway
Lambda
Bedrock
iOS app
22. Generative AI as a service work - Amazon Bedrock
def invoke_model(prompt: str)
:
try:
enclosed_prompt = "Human: " + prompt + "nnAssistant:"
body = {
"prompt": enclosed_prompt,
"max_tokens_to_sample": 500,
"temperature": 0.5,
"stop_sequences": ["nnHuman:"],
}
bedrock_runtime_client = boto3.client('bedrock
-
runtime')
response = bedrock_runtime_client.invoke_model(
modelId = "anthropic.claude
-
v2", body = json.dumps(body)
)
response_body = json.loads(response["body"].read())
completion = response_body["completion"]
return completion
except Exception as e:
raise e
23. Generative AI as a service work - Amazon Bedrock
def lambda_handler(event, context)
:
body = json.loads(event["body"])
prompt = body["content"]
if (event["headers"]["authorization"]
!
=
key)
:
return {
'statusCode': 401
}
try:
completion = invoke_model(prompt = prompt)
return {
'statusCode': 200,
'body': json.dumps({"content": completion})
}
except Exception as e:
return {
'statusCode': 400,
'body': json.dumps(str(e))
}
24. Generative AI as a service work - Amazon Bedrock
POST https://[uuid]...amazonaws.com/dev/completions
{
"content": "Describe Turin in one sentence"
}
25. Generative AI as a service work - Amazon Bedrock
def schedule_prompt_template(content: str)
-
>
str:
return f"""
<context>
.
.
.
/
/
Swift Heroes 2024 schedule
.
.
.
.
.
.
<
/
context>
Task for Assistent:
Find the most relevant answer in the context
<question>
{content}
<
/
question>
"""
26. Generative AI as a service work - Amazon Bedrock
def lambda_handler(event, context)
:
…
try:
templatedPrompt = prompt
if template
=
=
"schedule":
templatedPrompt = schedule_prompt_template(content = prompt)
elif template
=
=
"chat":
templatedPrompt = chat_context_template(content = prompt)
completion = invoke_claude(prompt = templatedPrompt)
return {
'statusCode': 200,
'body': json.dumps({"content": completion})
}
except Exception as e:
…
27. Generative AI as a service work - Amazon Bedrock
POST https://[uuid]...amazonaws.com/dev/completions
{
"content": "Describe Turin in one sentence”,
"template": “schedule"
}
28. Generative AI as a service work - Amazon Bedrock
@MainActor
func invokeBedrock(content: String, template: AITemplate = .schedule) async throws
-
>
String {
…
request.httpBody = try encoder.encode(BedrockAIRequest(content: content,
template: template.rawValue))
…
let bedrockResponse = try decoder.decode(BedrockAIResponse.self, from: data)
return bedrockResponse.content
}
let answer = try await aiService.invokeBedrock(content: text, template: .schedule)
struct BedrockAIRequest: Codable {
let content: String
let template: String
}
enum AITemplate: String {
case schedule, chat
}
31. Prompt engineering
The emerging skill set focused on designing and optimizing inputs for AI
systems to ensure they generate optimal outputs.
32. Prompt engineering patterns
One-shot, Few-shot and Zero-shot prompts
Summarize all the talks between context tags
Provide output as an array of json objects with a title, one main topic, and an array of tags.
The tags should not repeat the main topic.
<example>
Title: "Inclusive design: crafting Accessible apps for all of us"
Abstract: "One of the main goals for an app developer should be to reach everyone. ...
<result>
{{
"title": "Inclusive design: crafting Accessible apps for all of us"
"topic": "Accessibility"
"tags": ["user experience", "design", "assistance", "tools", "SwiftUI", "Swift", "Apple"]
}}
</result>
<context>
// Swift Heroes 2024 schedule …
</context>
</example>
33. Prompt engineering patterns
[
{
"title": "Building Swift CLIs that your users and contributors love",
"topic": "Swift CLIs",
"tags": ["terminal", "Tuist", "contributors"]
},
{
"title": "Macro Polo: A new generation of code generation",
"topic": "Swift Macros",
"tags": ["code generation", "modules", "examples"]
},
{
"title": "Typestate - the new Design Pattern in Swift 5.9",
"topic": "Typestate Design Pattern",
"tags": ["state machines", "memory ownership", "generics", "constraints", "safety"]
},
{
"title": "A Tale of Modular Architecture with SPM",
"topic": "Modular Architecture",
"tags": ["MVVM", "SwiftUI", "SPM"]
},
.
.
.
]
34. Prompt engineering patterns
Persona and audience
How does async/await work in Swift?
Act as an Experienced iOS developer
Explain to 12 years old
35. Prompt engineering patterns
Chain-of-thought
How does async/await work in Swift?
Act as an Experienced iOS developer
Explain to the Product manager
Follow this Chain-of-thought:
- Technical details using understandable to the audience analogy
- Bene
fi
ts relevant for the audience
- Additional things to consider
40. Pair programming with AI tools - ChatGPT
Discovering Swift Packages
Converting from legacy code
Writing unit tests and generating test data
Multiplatform development
Brainstorming and evaluating ideas