from sklearn.model_selection import GridSearchCV
import warnings
from sklearn.model_selection import cross_validate
from cde import ConditionalDensity
from cde.utils.center_point_select import *
[docs]class BaseDensityEstimator(ConditionalDensity):
""" Interface for conditional density estimation models """
[docs] def fit(self, X, Y, verbose=False):
""" Fits the conditional density model with provided data
Args:
X: numpy array to be conditioned on - shape: (n_samples, n_dim_x)
Y: numpy array of y targets - shape: (n_samples, n_dim_y)
"""
raise NotImplementedError
[docs] def eval_by_cv(self, X, Y, n_splits=5, verbose=True):
""" Fits the conditional density model with cross-validation by using the score function of the BaseDensityEstimator for
scoring the various splits.
Args:
X: numpy array to be conditioned on - shape: (n_samples, n_dim_x)
Y: numpy array of y targets - shape: (n_samples, n_dim_y)
n_splits: number of cross-validation folds (positive integer)
verbose: the verbosity level
"""
X, Y = self._handle_input_dimensionality(X, Y, fitting=True)
cv_results = cross_validate(self, X=X, y=Y, cv=n_splits, return_estimator=True, verbose=verbose)
test_scores = cv_results['test_score']
test_scores_max_idx = np.nanargmax(test_scores)
estimator = cv_results['estimator'][test_scores_max_idx]
self.set_params(**estimator.get_params())
self.fit(X, Y)
[docs] def fit_by_cv(self, X, Y, n_folds=3, param_grid=None, verbose=True, n_jobs=-1):
""" Fits the conditional density model with hyperparameter search and cross-validation.
- Determines the best hyperparameter configuration from a pre-defined set using cross-validation. Thereby,
the conditional log-likelihood is used for simulation_eval.
- Fits the model with the previously selected hyperparameter configuration
Args:
X: numpy array to be conditioned on - shape: (n_samples, n_dim_x)
Y: numpy array of y targets - shape: (n_samples, n_dim_y)
n_folds: number of cross-validation folds (positive integer)
param_grid: (optional) a dictionary with the hyperparameters of the model as key and and a list of respective \
parametrizations as value. The hyperparameter search is performed over the cartesian product of \
the provided lists.
Example:
{"n_centers": [20, 50, 100, 200],
"center_sampling_method": ["agglomerative", "k_means", "random"],
"keep_edges": [True, False]
}
"""
# save properties of data
self.n_samples = X.shape[0]
self.x_std = np.std(X, axis=0)
self.y_std = np.std(Y, axis=0)
if param_grid is None:
param_grid = self._param_grid()
cv_model = GridSearchCV(self, param_grid, fit_params=None, n_jobs=n_jobs, refit=True, cv=n_folds, verbose=verbose, )
with warnings.catch_warnings():
warnings.simplefilter("ignore") # don't print division by zero warning
cv_model.fit(X, Y)
best_params = cv_model.best_params_
if verbose: print("Cross-Validation terminated")
if verbose: print("Best likelihood score: %.4f" % cv_model.best_score_)
if verbose: print("Best params:", best_params)
self.set_params(**best_params)
self.fit(X, Y)
return best_params
[docs] def pdf(self, X, Y):
""" Predicts the conditional likelihood p(y|x). Requires the model to be fitted.
Args:
X: numpy array to be conditioned on - shape: (n_samples, n_dim_x)
Y: numpy array of y targets - shape: (n_samples, n_dim_y)
Returns:
conditional likelihood p(y|x) - numpy array of shape (n_query_samples, )
"""
raise NotImplementedError
[docs] def log_pdf(self, X, Y):
""" Predicts the conditional log-probability log p(y|x). Requires the model to be fitted.
Args:
X: numpy array to be conditioned on - shape: (n_samples, n_dim_x)
Y: numpy array of y targets - shape: (n_samples, n_dim_y)
Returns:
conditional log-probability log p(y|x) - numpy array of shape (n_query_samples, )
"""
# This method is numerically unfavorable and should be overwritten with a numerically stable method
with warnings.catch_warnings():
warnings.simplefilter("ignore")
log_prob = np.log(self.pdf(X, Y))
return log_prob
[docs] def predict_density(self, X, Y=None, resolution=50):
""" Computes conditional density p(y|x) over a predefined grid of y target values
Args:
X: values/vectors to be conditioned on - shape: (n_instances, n_dim_x)
Y: (optional) y values to be evaluated from p(y|x) - if not set, Y will be a grid with with specified resolution
resulution: integer specifying the resolution of simulation_eval grid
Returns: tuple (P, Y)
- P - density p(y|x) - shape (n_instances, resolution**n_dim_y)
- Y - grid with with specified resolution - shape (resolution**n_dim_y, n_dim_y) or a copy of Y \
in case it was provided as argument
"""
raise NotImplementedError
def _param_grid(self):
raise NotImplementedError
[docs] def score(self, X, Y):
"""Computes the mean conditional log-likelihood of the provided data (X, Y)
Args:
X: numpy array to be conditioned on - shape: (n_query_samples, n_dim_x)
Y: numpy array of y targets - shape: (n_query_samples, n_dim_y)
Returns:
average log likelihood of data
"""
return np.mean(self.log_pdf(X, Y))
[docs] def mean_(self, x_cond, n_samples=10**6):
""" Mean of the fitted distribution conditioned on x_cond
Args:
x_cond: different x values to condition on - numpy array of shape (n_values, ndim_x)
Returns:
Means E[y|x] corresponding to x_cond - numpy array of shape (n_values, ndim_y)
"""
assert self.fitted, "model must be fitted"
x_cond = self._handle_input_dimensionality(x_cond)
assert x_cond.ndim == 2
if self.has_pdf:
return self._mean_pdf(x_cond, n_samples=n_samples)
else:
return self._mean_mc(x_cond, n_samples=n_samples)
[docs] def std_(self, x_cond, n_samples=10 ** 6):
""" Standard deviation of the fitted distribution conditioned on x_cond
Args:
x_cond: different x values to condition on - numpy array of shape (n_values, ndim_x)
Returns:
Standard deviations sqrt(Var[y|x]) corresponding to x_cond - numpy array of shape (n_values, ndim_y)
"""
assert self.fitted, "model must be fitted"
x_cond = self._handle_input_dimensionality(x_cond)
assert x_cond.ndim == 2
return self._std_pdf(x_cond, n_samples=n_samples)
[docs] def covariance(self, x_cond, n_samples=10**6):
""" Covariance of the fitted distribution conditioned on x_cond
Args:
x_cond: different x values to condition on - numpy array of shape (n_values, ndim_x)
Returns:
Covariances Cov[y|x] corresponding to x_cond - numpy array of shape (n_values, ndim_y, ndim_y)
"""
assert self.fitted, "model must be fitted"
x_cond = self._handle_input_dimensionality(x_cond)
assert x_cond.ndim == 2
return self._covariance_pdf(x_cond, n_samples=n_samples)
[docs] def skewness(self, x_cond, n_samples=10**6):
""" Skewness of the fitted distribution conditioned on x_cond
Args:
x_cond: different x values to condition on - numpy array of shape (n_values, ndim_x)
Returns:
Skewness Skew[y|x] corresponding to x_cond - numpy array of shape (n_values, ndim_y, ndim_y)
"""
assert self.fitted, "model must be fitted"
x_cond = self._handle_input_dimensionality(x_cond)
assert x_cond.ndim == 2
return self._skewness_pdf(x_cond, n_samples=n_samples)
[docs] def kurtosis(self, x_cond, n_samples=10**6):
""" Kurtosis of the fitted distribution conditioned on x_cond
Args:
x_cond: different x values to condition on - numpy array of shape (n_values, ndim_x)
Returns:
Kurtosis Kurt[y|x] corresponding to x_cond - numpy array of shape (n_values, ndim_y, ndim_y)
"""
assert self.fitted, "model must be fitted"
x_cond = self._handle_input_dimensionality(x_cond)
assert x_cond.ndim == 2
return self._kurtosis_pdf(x_cond, n_samples=n_samples)
[docs] def mean_std(self, x_cond, n_samples=10 ** 6):
""" Computes Mean and Covariance of the fitted distribution conditioned on x_cond.
Computationally more efficient than calling mean and covariance computatio separately
Args:
x_cond: different x values to condition on - numpy array of shape (n_values, ndim_x)
Returns:
Means E[y|x] and Covariances Cov[y|x]
"""
mean = self.mean_(x_cond, n_samples=n_samples)
std = self._std_pdf(x_cond, n_samples=n_samples, mean=mean)
return mean, std
[docs] def value_at_risk(self, x_cond, alpha=0.01, n_samples=10**6):
""" Computes the Value-at-Risk (VaR) of the fitted distribution. Only if ndim_y = 1
Args:
x_cond: different x values to condition on - numpy array of shape (n_values, ndim_x)
alpha: quantile percentage of the distribution
Returns:
VaR values for each x to condition on - numpy array of shape (n_values)
"""
assert self.fitted, "model must be fitted"
assert self.ndim_y == 1, "Value at Risk can only be computed when ndim_y = 1"
assert x_cond.ndim == 2
if self.has_cdf:
VaR = self._quantile_cdf(x_cond, alpha=alpha)
if np.isnan(VaR).any() and self.can_sample: # try with sampling if failed
VaR = self._quantile_mc(x_cond, alpha=alpha, n_samples=n_samples)
elif self.can_sample:
VaR = self._quantile_mc(x_cond, alpha=alpha, n_samples=n_samples)
else:
raise NotImplementedError()
return VaR
[docs] def conditional_value_at_risk(self, x_cond, alpha=0.01, n_samples=10**6):
""" Computes the Conditional Value-at-Risk (CVaR) / Expected Shortfall of the fitted distribution. Only if ndim_y = 1
Args:
x_cond: different x values to condition on - numpy array of shape (n_values, ndim_x)
alpha: quantile percentage of the distribution
Returns:
CVaR values for each x to condition on - numpy array of shape (n_values)
"""
assert self.fitted, "model must be fitted"
assert self.ndim_y == 1, "Value at Risk can only be computed when ndim_y = 1"
x_cond = self._handle_input_dimensionality(x_cond)
assert x_cond.ndim == 2
VaRs = self.value_at_risk(x_cond, alpha=alpha, n_samples=n_samples)
if self.has_pdf:
return self._conditional_value_at_risk_mc_pdf(VaRs, x_cond, alpha=alpha, n_samples=n_samples)
elif self.can_sample:
return self._conditional_value_at_risk_sampling(VaRs, x_cond, n_samples=n_samples)
else:
raise NotImplementedError("Distribution object must either support pdf or sampling in order to compute CVaR")
[docs] def get_configuration(self, deep=True):
""" Get parameter configuration for this estimator.
Args:
deep: boolean, optional If True, will return the parameters for this estimator and \
contained subobjects that are estimators.
Returns:
params - mapping of string to any Parameter names mapped to their values.
"""
param_dict = super(BaseDensityEstimator, self).get_params(deep=deep)
param_dict['estimator'] = self.__class__.__name__
for x in ["n_centers", "center_sampling_method", "x_noise_std", "y_noise_std",
"random_seed", "ndim_x", "ndim_y"]:
if hasattr(self, x):
param_dict[x] = getattr(self, x)
else:
param_dict[x] = None
return param_dict
[docs] def tail_risk_measures(self, x_cond, alpha=0.01, n_samples=10 ** 6):
""" Computes the Value-at-Risk (VaR) and Conditional Value-at-Risk (CVaR)
Args:
x_cond: different x values to condition on - numpy array of shape (n_values, ndim_x)
alpha: quantile percentage of the distribution
n_samples: number of samples for monte carlo model_fitting
Returns:
- VaR values for each x to condition on - numpy array of shape (n_values)
- CVaR values for each x to condition on - numpy array of shape (n_values)
"""
assert self.fitted, "model must be fitted"
assert self.ndim_y == 1, "Value at Risk can only be computed when ndim_y = 1"
assert x_cond.ndim == 2
VaRs = self.value_at_risk(x_cond, alpha=alpha, n_samples=n_samples)
if self.has_pdf:
CVaRs = self._conditional_value_at_risk_mc_pdf(VaRs, x_cond, alpha=alpha, n_samples=n_samples)
elif self.can_sample:
CVaRs = self._conditional_value_at_risk_sampling(VaRs, x_cond, n_samples=n_samples)
else:
raise NotImplementedError("Distribution object must either support pdf or sampling in order to compute CVaR")
assert VaRs.shape == CVaRs.shape == (len(x_cond),)
return VaRs, CVaRs


Finally Getting To Business.
Pricing depends on several factors such as website size, features, content, special orders and design complexity. However, our usual range is three hundred dollars to about six hundred dollars. Our services come with plenty of free bonuses, like, google analytics setup, SEC optimization and a set of web API integrations.
You can email us @soradev4@gmail.com


© 2017 The original authors.
| Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. |
1. Abstract
In this workshop we’ll work on a application that deals with events (like talks, conferences and so on). The scope of the application is to store those events and provide an API for retrieving, manipulating and updating events.
If we’ll have some time left, we also gonna see a short demo how to orchestrate that as a microservice for a calendar application.
2. Setup
2.1. Prerequisites
You need an installed JDK, at least Java 8. If you use Git, then you can checkout the Code using Git.
The project in this workshop will be a Maven project. It contains the Maven wrapper, so you don’t have to install Maven by hand if you don’t have a recent copy.
An installed IDE is recommended but not necessary. Having cURL
, a browser or, any other sophisticated HTTP client installed is beneficial for issuing HTTP requests.
As Spring Boot Project is a plain Gradle or Maven Project in the end, all three major IDEs (NetBeans, Eclipse / Spring Tool Suite and IntelliJ IDEA) can open and compile them. Additional support like code completion for configuration files, request mappings, dashboards and so on vary from IDE to IDE. You have to decide what you want and need.
If you want to try out the microservice examples in Docker, you’ll need a recent Docker installation on your machine, too.
If you don’t have docker installed, the projects won’t build after commit #445fcec. I have tagged the latest version that works without docker for you, so you can check it out with git checkout no-docker .
|
Downloads
-
Oracle JDK, please choose your operating system
-
One of those:
-
Docker Community Edition, please choose your operating system
2.2. Register a GitHub account (Optional, recommended)
Go to https://github.com and signup for a free account. If you already have a GitHub account, you can skip this step.
2.3. Clone the repository
The code of this project will be available at GitHub at https://github.com/michael-simons/ws-20170627-cluj after the workshop.
2.4. Prepare your IDE
Choose one of
-
Spring Tool Suite (STS) from https://spring.io/tools
-
NetBeans from https://netbeans.org
-
Eclipse from https://www.eclipse.org
-
IntelliJ IDEA from https://www.jetbrains.com/idea/
Even though Spring Boot projects are just regular Maven Projects, you’ll get some perks from IDEs, for example direct integration with Spring Boots initializer, recognition of Spring Boots configuration, Spring Beans and more.
STS and IntelliJ offer the most complete support, however in the case of IntelliJ only the ultimate edition does.
STS is completely free. You can get its integration into Eclipse as well from the marketplace, but I’ll recommend using STS directly.
NetBeans is one of the best choices for Maven projects. It also features direct support of project Lombok for example. If you’re a NetBeans user, I’ll highly recommend to install NB-SpringBoot from the plugin page or directly from NetBeans through https://github.com/AlexFalappa/nb-springboot.
. Find more information on the plugin here:We’ll discover some features of NetBeans, STS and IntelliJ on the way through the workshop, but let me assure you once again: Spring Boot projects are just plain normal Maven or Gradle projects.
3. Create a new Spring Boot project
| In this part you’ll learn about the different ways to bootstrap a Spring Boot application. |
As you have learned in the introduction, Spring Boot projects are basically Spring projects that just happend to configure stuff in a way that seems "magically" at first look. This configuration comes in the form of a parent project in the case of Maven and in the form of a plugin if you’re a Gradle user.
You can write the build file by hand or you just can go to start.spring.io and have the Spring Initializr generate it for you.
3.1. Use the Spring Initializr
Through the website
Steps
-
Go to https://start.spring.io, chose wether you want to use Maven or Gradle, the language (in this workshop we’ll use Java) and the version of Spring Boot (leave as is).
-
Enter "Web" inside dependencies textbox and select "Web"
-
Repeat last steps with the technologies you’ll find interesting
-
Hit generate
Your browser downloads a Zipfile with your project. You can unzip this with a tool of your choice and already start your application:
unzip demo.zip
cd demo
./mvnw spring-boot:run
To explore the generated buildfile and the minimal application skeleton generated, we’re repeat the steps inside an IDE.
From an IDE
Spring Tools Suite
Steps
-
Choose
-
Enter
event-service
as a name -
Enter
ac.simons.ws.cluj:events
as coordinates (feel free to chose whatever you like, though. However: this document and the finished project will refer to those coordinates) -
Enter some appropriate description and name
-
Clear the package name
-
Hit next and chose "Web" as dependency
-
Hit either finish or next. Next gives you a handy URL that can be used to reference exactly the options you used
Wait a second until STS automatically opens your project.
NetBeans
The steps are basically the same, but you have to have the NB-SpringBoot-Plugin installed.
-
Choose
-
Enter your coordinates and description as described above
-
Choose dependencies as described before
-
Select a location
-
Uncheck Remove Maven Wrapper if you want to keep the Maven Wrapper inside the generated project (which is useful, if you ask me)
You’re done.
You’ll notice that neither STS nor NetBeans store a lot of IDE specific stuff. Both have some project specific settings, like which is the main class and so on, but that’s basically it. You can run both projects from the command line.
With cURL or other tools
The Spring Initializr is completely scriptable. It speaks Hypertext Application Language (HAL) and you can get an overview about its options by just curling it:
curl -H 'Accept: application/json' https://start.spring.io
Find a complete documentation at docs.spring.io/initializr. The example from the beginning of this chapter also be created via
curl https://start.spring.io/starter.zip -d dependencies=web -o demo.zip
unzip demo.zip -d demo
cd demo
./mvnw spring-boot:run
| Explore the manual linked above. You can install a custom copy of the Initializr if you want to. Scripting it might be a valuable tool for your process. |
4. Explore your first Spring Boot project
If you didn’t follow the steps above, now it’s time to open the project event-service
. Navigate to the folder that you used while cloning the repository and open the project with your IDE of choice.
4.1. The build file
First check out the pom.xml
. Note that it defines a parent through
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.4.RELEASE</version>
<relativePath/>
</parent>
Then follow some properties. Have a look at java.version
. Its set to 1.8 by default. You don’t have to configure Mavens compiler plugin. The parent does that for you.
| Spring Boot prior to 2 supports Java 7 and 8 (Java 6 with some workarounds), Spring Boot 2 needs Java 8 and will support Java 9. |
Build-in dependency management
Then follow the dependencies, which we just declared:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Noticeable here is the lack of version numbers. That has been taken care of by the Spring and Spring Boot teams: They chose versions of libraries that work well together and put them in their parent pom in a section <dependencyManagement />
Now everytime you need one of those, you can skip the version number.
If you want to override a version, you can do that too via a property declared like the Java version.  Those are "meta-dependencies". They usually consist of an autoconfigure module that has code for configuring certain aspects of a framework module or library. Usually that autoconfigure module depends only optional on the framework module or library. The starter module itself depends on the autoconfiguration as well as on the libraries.
4.2. The main class
Depending on how you parameterized the initializer, your main class will be named differently. In the example project it is EventServiceApplication
, named after the coordinates you entered and located in the package, which you entered explicitly. The class looks pretty innocent:
package ac.simons.ws.cluj.events;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class EventServiceApplication {
public static void main(String[] args) {
SpringApplication.run(EventServiceApplication.class, args);
}
}
The main method is interesting, because it delegates to a static helper method inside SpringApplication
that does all the heavy lifting of initializing the Spring context.
But where does the configuration come from? Explore the @SpringBootApplication
annotation. It’s a composed annotation that looks like this:
@SpringBootApplication
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan
public @interface SpringBootApplication{}
This annotation combines several others:
-
@SpringBootConfiguration
marks the class as a configuration class.@SpringBootConfiguration
is special in so far that there should be only one of those throughout one context whereas@Configuration
classes can be many -
@EnableAutoConfiguration
enables the "magic" of Spring Boot: It looks for@Configuration
classes that are marked as autoconfiguration and loads them fully or partially, depending on wether certain conditions are fulfilled or not. -
@ComponentScan
finally kicks of the search for Spring components. Those are@Controller
,@Services
and many others
As you can see, the application class has a main method and therefor can be used for a runnable jar file. Part of Spring Boots philosophy is to provide single fat jars as deployment artifacts.
As we have declared the WEB dependency and got the spring-boot-starter-web
, we also have an embedded Tomcat on the classpath.
However, you can also choose to deploy Spring Boot applications as war. If you had chose 'WAR' as packaging type in the initializer, it would have created an additional SpringBootServletInitializer
that facilitates Springs SPI for ServletContainerInitializer
.
How does that work with the embedded tomcat? There are Maven and Gradle plugins that repackages the artifact to be a "fat jar" or "fat war". The "main" class we have written isn’t directly called, but a Spring Boot loader class.
4.3. The package structure
At the moment, there’s only one class, the application class. The package is based on the project coordinates. The package structure is actually already important here as the application class is annotated with @ComponentScan
. This annotations searches for Spring components from the package the annotated class declares downwards.
There are two caveats:
-
Don’t annotate a class in the root package with
@SpringBootApplication
or@ComponentScan
. It will scan the whole class path! -
Those annotation won’t scan packages in parallel to their current package
How about the configuration in starter than? Does Spring actually run a full classpath package scan? No: It uses the spring.factories
services locator implementation!
4.4. The test sources
The initializer already generated a test:
@RunWith(SpringRunner.class)
@SpringBootTest
public class EventServiceApplicationTests {
@Test
public void contextLoads() {
}
}
Its a standard JUnit 4 test that is run with a special runner, the SpringRunner
and marked as @SpringBootTest
. The later denotes a full integration test: Loading the embedded web container (if any) and all connections to third party services.
5. Add some content
5.1. Spring Boot Developer Tools
Let’s add a nice runtime dependency call "Spring Boot Developer Tools", "devtools" for short:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
This is a not a compile time but a runtime dependency that has several neat features:
-
When the application is run from an IDE or with the Maven or Gradle plugin, it restarts the context when classes changes
-
It automatically reloads changed resources
-
Changes some settings during development, for example disables caching for messages, templates and so on
It’s not as elaborate like JRebel, but, nevertheless, valuable!
5.2. Spring Boot Starter JPA
We have to store some stuff. org.springframework.boot:spring-boot-starter-data-jpa
is a handy starter that brings you among others:
-
Hibernate Core
-
Hibernate Entity Manager
-
Spring JDBC
-
Spring Data Commons
-
Spring Data JPA
We gonna deep dive into this later. First step is to declare a simple entity for storing events:
@Entity
@Table(
name = "events",
uniqueConstraints = {
@UniqueConstraint(name = "events_uk", columnNames = {"held_on", "name"})
}
)
public class EventEntity implements Serializable {
private static final long serialVersionUID =<PHONE_NUMBER>095134425L;
public enum Status {
open, closed
}
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
@Column(name = "held_on", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Calendar heldOn;
@Column(length = 512, nullable = false)
private String name;
@Column(name = "created_at", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Calendar createdAt;
@Enumerated(EnumType.STRING)
private Status status;
protected EventEntity() {
}
public EventEntity(final Calendar heldOn, final String name) {
this.heldOn = heldOn;
this.name = name;
this.status = Status.open;
}
@PrePersist
@PreUpdate
void prePersistAndUpdate() {
if (this.createdAt == null) {
this.createdAt = Calendar.getInstance();
}
}
}
As you can see: Nothing apart from Hibernate specific annotations and nothing fancy here.
Using Spring with Spring Boot and the JPA starter you don’t have to worry about a persistence unit. Spring Boot takes care of
-
Collecting all entity classes and related classes
-
Provides a datasource
-
Provides local transaction management for that datasource
-
Provides an EntityManagerFactory
-
Provides a thread safe entity manager, independent wether JTA or application based transactions are used → You can omit
@PersistenceContext
annotation which works on attributes only
5.3. Web layer
We already have all the dependencies we need to work on the web layer, so we can add a controller that should take care of handling events:
@RestController
public class EventApi {
}
Nothing there yet, we’re gonna develop the controller in a test driven way.
Inside your test sources create a class EventApiTest
in the same package as your controller having the following content:
@RunWith(SpringRunner.class)
@WebMvcTest
public class EventApiTest {
@Test
public void getEventsShouldWork() {
// Actually test something ;)
}
}
What do we have here: Again a Spring JUnit Test, but this time @WebMvcTest
. This annotation is called a test slice. It only configures infrastructure and Spring components essential for that technical slice. In this case: The web layer.
@WebMvcTest first scans the package of the test class for a context configuration. If it doesn’t find a class with @SpringBootApplication it uses the same rules as the Spring Framework itself, i.e. it looks also for XML and Groovy based configuration. If that isn’t successful, it also scans the class path "upwards", so it finds your main Spring Boot class even if you have put away your controllers inside a subpackage.
|
@Autowired
private MockMvc mvc;
@Test
public void getEventsShouldWork() throws Exception {
this.mvc
.perform(MockMvcRequestBuilders.get("/api/events"))
.andExpect(MockMvcResultMatchers.status().isOk());
}
That first approach uses an instance of MockMvc
provided by @WebMvcTest
to call the events api and expects a status 200 (ok). That test obviously fails. Let’s make this work by adding one method to the controller:
@GetMapping("/api/events")
public List<EventEntity> getEvents() {
return new ArrayList<>();
}
Now run the test again and see it turn green!
We can easily break it again by actually checking the result:
@Test
public void getEventsShouldWork() throws Exception {
this.mvc
.perform(MockMvcRequestBuilders.get("/api/events"))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.jsonPath("$[0].name", equalTo("test1")));
}
This one checks if the returned content is actually valid. Naive implementation would be hitting the entity manager from within the controller but how could we test just the controller and keeping away from the database? Let’s introduce a service:
@Service
public class EventService {
public List<EventEntity> allEvents() {
return new ArrayList<>();
}
}
This class is picked up by the Spring context and can be injected into other beans. Lets cleanup the controller in the way:
@RestController
@RequestMapping("/api/events")
public class EventApi {
private final EventService eventService;
public EventApi(EventService eventService) {
this.eventService = eventService;
}
@GetMapping
public List<EventEntity> getEvents() {
return this.eventService.allEvents();
}
}
You see only annotations relevant to Spring Web MVC. Try running the test know: It doesn’t even start any more: The Service is not part of the webslice! Spring Boot actually helps you a lot here with its failure analyzers:
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 2017-06-19 12:07:57.297 ERROR 73221 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Parameter 0 of constructor in ac.simons.ws.cluj.events.EventApi required a bean of type 'ac.simons.ws.cluj.events.EventService' that could not be found. Action: Consider defining a bean of type 'ac.simons.ws.cluj.events.EventService' in your configuration.
Instead of providing the real bean, we’re gonna use @MockBean
:
@MockBean
@RunWith(SpringRunner.class)
@WebMvcTest
public class EventApiTest {
@Autowired
private MockMvc mvc;
@MockBean
private EventService eventService;
}
That would be possible on class level, too, but we’re gonna need that been together with the Mockito support that the dependency on org.springframework.boot:spring-boot-starter-test
brought:
ZonedDateTime now = ZonedDateTime.now();
List<EventEntity> expectedEvents
= Arrays.asList(
new EventEntity(GregorianCalendar.from(now.plusDays(3)), "test1"),
new EventEntity(GregorianCalendar.from(now.plusWeeks(1)), "test2")
);
Mockito.when(eventService.allEvents()).thenReturn(expectedEvents);
5.4. Database layer
Now that we have tested the web layer, we’ll move back again to the database. Together with the Spring Data JPA dependencies we have added com.h2database:h2
as a runtime dependencies. Spring Boot configures an in-memory instance of H2 if no other database connection is configured. So, we already have a datasource.
Where does the schema come from? Spring Boot configures spring.jpa.hibernate.ddl-auto
for you: It uses create-drop
on an embedded database, none
otherwise which is a sensible default.
Spring Boot also takes schema.sql
and data.sql
scripts in the root of the classpath in consideration. If there is a schema.sql
Spring uses that for database initialization before data.sql
and before JPA. If there’s only data.sql
, Spring Boot uses first JPA to generate schema and than the script.
In the example we’re gonna use data.sql
only and let Hibernate generate the schema for us.
First of all we’re gonna rework the generated test. By default it’s only mocking the web environment. Let’s start in on a random port through @SpringBootTest(webEnvironment = RANDOM_PORT)
. That gives also a TestRestTemplate
that makes calling our a API a breeze:
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = RANDOM_PORT)
public class EventServiceApplicationTests {
@Autowired
private TestRestTemplate restTemplate;
@Test
public void getEventsShouldWork() {
final List<EventEntity> events = this.restTemplate.exchange(
"/api/events",
HttpMethod.GET,
null,
new ParameterizedTypeReference<List<EventEntity>>() {}
).getBody();
assertThat(
events.get(0).getName(),
is(equalTo("Get the most out of your data layer"))
);
}
}
The test fails as expected, but safely assuming we do have some content now, let’s fill the service with life and make the test work:
@Service
public class EventService {
private final EntityManager entityManager;
public EventService(EntityManager entityManager) {
this.entityManager = entityManager;
}
@Transactional(readOnly = true)
public List<EventEntity> allEvents() {
return this.entityManager
.createQuery(
"Select event from EventEntity event order by event.heldOn",
EventEntity.class
)
.getResultList();
}
}
And green again!
Using a repository abstraction
Your service should have to deal with the persistence storage on it’s own, meaning, it should have no knowledge of the underlaying technology.
The repository pattern fixes that. Implemented in Spring Data JPA it takes away the burden of interacting with the persistence layer in many cases.
The abstraction is in so far leaking that you get JPA entites out of a JPA repository and Mongo documents out of a Mongo repository. It’s up to you to encapsulate this further.
We have several tests in place and can try to rework our service.
Spring Boot supports Spring Data JPA out of the box and you can declare a repository like this:
public interface EventRepository extends Repository<EventEntity, Integer> {
List<EventEntity> findAllByOrderByHeldOnAsc();
}
If you already know Spring Data you’ll notice that I don’t used the JpaRepository
interface as I prefer only to declare the methods I actually need and use.
The rewritten service based on that repository now looks like this:
@Service
public class EventService {
private final EventRepository eventRepository;
public EventService(EventRepository eventRepository) {
this.eventRepository = eventRepository;
}
public List<EventEntity> allEvents() {
return this.eventRepository.findAllByOrderByHeldOnAsc();
}
}
And our test is still green.
Testing the service
We have several ways of testing the service. We can either mock the repository (which I usually do), or we can use yet another test slice, that is: @DataJpaTest
. @DataJpaTest
replaces databases via an embedded Database by default, runs all init scripts or migrations and then runs a transactional test. Transactional tests are rolled back by default:
Other options to initialize a database
Although you can use several schema.sql
and data.sql
scripts and also relay on JPA to generate your tables, I’m very sceptic about that. Especially the JPA based migrations work only well if you’re and your application is in charge of the database. That is: Has the right to change schema at will.
The project contains therefor contains a dependency to Flyway (org.flywaydb:flyway-core
) core, that takes care of using dedicated scripts to initialize your database. An alternative would be using Liquibase.
6. Configuration of Spring Boot Applications
You can follow several paradigms to configure a Spring Boot application. You’re either can relay completely on the environment and let your Spring Boot application adapt itself or you chose profiles or combinations thereof. Either way: In no case you have to build your applications for different environments differently.
You should differentiate between external and internal configuration. We speak about internal configuration in regards of beans, context- and dependency injection and so on. External configuration on the other hand basically describes means to change the behavior of your application depending on environment or configuration properties.
Internal configuration often depends on external configuration!
6.1. External configuration
External configuration come from a so called PropertySource
. Those property sources can be of various kind and have a well defined order:
-
@TestPropertySource
annotations on your tests. -
@SpringBootTest#properties
annotation attribute on your tests. -
Command line arguments
-
Properties from
SPRING_APPLICATION_JSON
(inline JSON embedded in an environment -
variable or system property)
-
ServletConfig
init parameters -
ServletContext
init parameters -
JNDI attributes from
java:comp/env
-
Java System properties (
System.getProperties()
) -
OS environment variables
-
A
RandomValuePropertySource
that only has properties inrandom.*
-
Profile-specific application properties outside of your packaged jar
-
(
application-{profile}.properties
and YAML variants) -
Profile-specific application properties packaged inside your jar (
application-{profile}.properties
and YAML variants) -
Application properties outside of your packaged jar (
application.properties
and YAML variants) -
Application properties packaged inside your jar (
application.properties
and YAML variants) -
@PropertySource
annotations on your@Configuration
classes. -
Default properties (specified using
SpringApplication.setDefaultProperties
)
Now, open the file application.properties
. It corresponds to the default
profile and configuration of your application.
| If you’re a YAML fan, you can use YAML as well. |
All IDEs mentioned here support syntax highlighting and auto completion in this file.
How to use those properties?
You basically have to options:
-
The
@Value
annotation that can be used to retrieve any property from the environment. -
Classes annotated with
@ConfigurationProperties
The second option has several advantages:
-
You can concentrate configuration for one topic in one class, including the possibility to provide defaults
-
The class are subject to relaxed binding
-
They are available as beans in the context
-
They are recognized by a build processor to generate meta data which in turn is helpful for content assist and other
Given the following pretty arbitrary properties bean:
@Component
@ConfigurationProperties(prefix = "event-service")
public class EventServiceProperties {
/**
* The default number of seats avaiable for each event.
*/
private Integer defaultNumberOfSeats;
/**
* Some arbitrary information.
*/
private String arbitraryInformation;
public Integer getDefaultNumberOfSeats() {
return defaultNumberOfSeats;
}
public void setDefaultNumberOfSeats(Integer defaultNumberOfSeats) {
this.defaultNumberOfSeats = defaultNumberOfSeats;
}
public String getArbitraryInformation() {
return arbitraryInformation;
}
public void setArbitraryInformation(String arbitraryInformation) {
this.arbitraryInformation = arbitraryInformation;
}
}
The default number of seats can be configured by any of those:
-
event-service.default-number-of-seats = 42
-
eventService.defaultNumberOfSeats = 42
-
event_service.default_number_of_seats = 42
Chose the format that fits the source best: Usually uppercase and underscores works great in environment properties, dashes are good for properties.
To provide metadata of this configuration file for you, you’re IDE and your coworkers add the spring-boot-configuration-processor
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
7. Non functional requirements
Some non functional requirements that usually are requested:
-
Health information
-
Metrics
-
Context and configuration information
-
Logging
Spring Boot offers Spring Boot Actuator that can be added as simple dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
This provides a several interesting new api endpoints, including the information above.
With current Spring Boot they reside directly under the root context:
Spring Boot will change that to /application/
and you can configure that already today. And while we’re at it, disable actuator endpoint security as the endpoints are protected by default and since we don’t have Spring Security yet, there’s no valid user to authenticate with:
management.security.enabled = false
# That will be the default with Spring Boot 2.0
management.context-path = /application
8. Microservice Scenario
The sources contain one microservice scenario which makes use of two projects from the Spring Cloud Netflix portfolio:
-
It uses Eureka for Service Discovery: Eureka instances can be registered and clients can discover the instances using Spring-managed beans
-
It uses Hystrix as a service breaker: Hystrix clients can be built with a simple annotation-driven method decorator
| This is just a demonstration of how one can use those projects. It should not by any means recommend this kind of microservice architecture for all use cases. Its a nice and easy way to demonstrate what you can do with additional Spring projects after finishing your Spring Boot application. |
The project calendar-service
is a client of event-service
. In addition there is now service-registry
.
service-registry
declares an additional dependency management:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
</dependencies>
And the application is annotated like this:
@SpringBootApplication
@EnableEurekaServer
public class ServiceRegistryApplication {
public static void main(String[] args) {
SpringApplication.run(ServiceRegistryApplication.class, args);
}
}
Thus the Spring Boot application boots the Eureka instance. In addition it tries to register itself with other instances. As it’s the only one, disable this:
server.port = 8761
eureka.client.register-with-eureka = false
eureka.client.fetch-registry = false
The listing above also sets Springs server port to Eurekas default. You build and run the service registry as usual. If you do this, you’ll reach a admin interface at http://localhost:8761.
Then back to the event service. Add the same additional dependency management as well as org.springframework.cloud:spring-cloud-starter-eureka-server
.
Also, give the service a fixed name through configuration:
spring.application.name = event-service
You’ll now annotate the EventServiceApplication
with @EnableDiscoveryClient
@SpringBootApplication
@EnableDiscoveryClient
public class EventServiceApplication {
public static void main(String[] args) {
SpringApplication.run(EventServiceApplication.class, args);
}
}
@EnableDiscoveryClient
enables discovery for Eureka instances by default, but there are also implementations for Zookeeper and other.
Imagine the event-service
as provider. The additional calendar-service
in this repository is a client. The calendar-service
should retrieve all existing events and present them in a calendar widget. It’s main application class shall also be annotated with @EnableDiscoveryClient
.
Both services are now registered with Eureka.
We’ll use Springs RestTemplate
to synchronously GET
/api/events
from our event service, but we won’t be hardcoding the server path and port of the event service. Instead, we’ll provide a special instance of RestTemplate
through the following configuration inside calendar-service
:
@Configuration
public class RestTemplateConfig {
@LoadBalanced
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
}
You see an ordinary configuration class that returns one bean. The method is annotated with @LoadBalanced
. @LoadBalanced
also comes with spring-cloud-starter-eureka-server
and is part of Springs so called Ribbon client. Ribbon is a client side load balancer that knows the connection to the service discovery. If you use @EnableDiscoveryClient
with your application and are ok with Ribbons default, you can use it immediately to make your RestTemplate
aware of virtual host names.
Virtual host names are the names of the applications that are registered with the Eureka service registry instance.
The only difference in using the template is the fact, that you have to provide the name of a virtual host instead of a server and port:
@Service
public class EventService {
public List<Event> allEvents() {
final ResponseEntity<List<Event>> response = this.restTemplate
.exchange("http://event-service/api/events", HttpMethod.GET, null, new ParameterizedTypeReference<List<Event>>() {
});
if(response.getStatusCode() != HttpStatus.OK) {
throw new RuntimeException("Could not retrieve events");
}
return response.getBody();
}
}
And that’s all! As you see, we have wrapped the call inside a service to which we’ll come back later.
Using the service from with in a controller like this posses a problem though:
@Controller
public class IndexController {
private final EventService eventService;
public IndexController(EventService eventService) {
this.eventService = eventService;
}
@GetMapping({"/", "index"})
public String index(final Model model) {
model.addAttribute("events", this.eventService.allEvents());
return "index";
}
}
The request against the controller depends on another request from server to server that can fail (and usually will fail some times).
There are many different solutions for that topic. One is a technical solution called "circuit breaker", much like a fuse inside your house that opens when an error happens and depending on the fuse will close again, either manually or after some time, trying again.
From the Netflix stack there’s org.springframework.cloud:spring-cloud-starter-hystrix
that provides @HystrixCommand
. To use those circuit breakers inside your application, they have to be enabled like:
@SpringBootApplication
@EnableCircuitBreaker
public class CalendarServiceApplication {
public static void main(String[] args) {
SpringApplication.run(CalendarServiceApplication.class, args);
}
}
And then it’s easy to use them. In this case we’re using the fallbackMethod
attribute to define another method that is to be called when the original method fails for some reason:
@HystrixCommand(fallbackMethod = "emptyEvents")
public List<Event> allEvents() {
// As above make call to remote server
return response.getBody();
}
List<Event> emptyEvents() {
return new ArrayList<>();
}
Depending on other settings, Hystrix will keep the circuit open for some time, than close and try again.
| Take care in a production system to adapt Hystrix timeouts to Ribbon clients timeouts. |
That may works when a service depends on one remote call, but having different calls, it gets hard very fast to manage. A better solution for that may be architectures that invert the relation ship: Whereas we’ll keep the events as a resource, that resources is polled in some sane interval and events are stored redundant in the calendar service.
Changes from the calendar service to events can be communicated maybe through an event bus.
9. Wrap up
We have managed to setup one of many possible micro service architectures in about 4 hours.
You can run them independent now each as explained in the beginning and than hit http://localhost:8088 for the calendar service or use the provided docker images as follows (given a valid Docker installation on your machine)
Build everything with either build.sh
or build.bat
. That will use Docker Maven Plugin to provide three images:
-
msimons/ws-cluj-calendar-service
-
msimons/ws-cluj-event-service
-
msimons/ws-cluj-service-registry
Which are orchestrated via the following docker-compose.yml
version: '2'
services:
calendar-service:
image: msimons/ws-cluj-calendar-service
ports:
- "8080:8080"
depends_on:
- service-registry
- event-service
environment:
- server.port=8080
- eureka.client.serviceUrl.defaultZone=http://service-registry:8761/eureka/
event-service:
image: msimons/ws-cluj-event-service
depends_on:
- service-registry
- database
environment:
- server.port=8080
- spring.profiles.active=prod
- spring.datasource.url=jdbc:postgresql://database:5432/events-db
- eureka.client.serviceUrl.defaultZone=http://service-registry:8761/eureka/
expose:
- "8080"
service-registry:
image: msimons/ws-cluj-service-registry
expose:
- "8761"
database:
image: postgres:9.6
environment:
- POSTGRES_USER=events-db
- POSTGRESS_PASSWORD=events-db
Notice how some properties of your applications in the containers can easily changed through dockers environment setting. For example we have to configure Eurekas default zone now with eureka.client.serviceUrl.defaultZone
as Eureka doesn’t run on the same host anymore.
Run everything now with docker-compose up
and the calendar service is reachable as a frontend for the whole system under http://localhost:8080.


Form B(Industry Suoervisor Assesment)
Part A
Enter Your Full Name
Position Held in Comapny
Email address
We'll never share your email with anyone else.
Company Address/Location
Student Matric Number
Part B
Student's performance:
Excellent
Very Good
Fair
Poor
Student's punctuality:
Excellent
Very Good
Fair
Poor
Student's integrity:
Excellent
Very Good
Fair
Poor
Rate Student contribution to the company:
Select Option
1
2
3
4
5
Rate Student Team Work:
Select Option
1
2
3
4
5
Rate Student strength to work:
Select Option
1
2
3
4
5
Rate Student communication skill:
Select Option
1
2
3
4
5
Rate Student leadership skill:
Select Option
1
2
3
4
5
Would you like to Hire student?:
Select Option
Yes
No
Maybe
What is student response to assignment given?:
Excellent
Very Good
Fair
Poor
Would accept more students into your organisation from this instiutuion?:
Select Option
Yes
No
Maybe
How Resourceful is this student?:
Excellent
Very Good
Fair
Poor
Summary About the student(Student Personality):
Select Option
Creative
Resourceful
Integrity Inclined
Honesty
Curiosity


JERRY MAGUIRE (1996) A Film Review by Ted Prigge Copyright 1997 Ted Prigge
Writer/Director: Cameron Crowe Starring: Tom Cruise, Renee Zellweger, Cuba Gooding Jr, Bonnie Hunt, Kelly Preston, Jonathan Lipnicki, Regina King, Jay Mohr, Jerry O'Connell, Beau Bridges, Todd Louiso, Glenn Frey, Eric Stoltz
About a year ago, this film came out, and everyone went gaga. Reviewers crowned it as one of the best big budget/big production company films of the year, and it grossed well over 100 million bucks. A couple months later, it was the only big-brand film to do any kind of respectable business at the Oscars (garnering a supporting nod towards Cuba Gooding Jr, who needed the career boost). And Tom Cruise proved that he can actually act so well that he pretty much becomes the character. It's the movie everyone loves...well, except for little old me.
I saw "Jerry Maguire" a couple weeks after it came out with very high expectations. As you can tell, it had a lot to live up to. And for the first third (a little over a half hour), it was really, really good. I mean, I was into the story, I cared about the characters, and the direction and writing were fantastic. But then at some point, the film dove into hokey, corny-as-hell, and bizarre waters, and eventually seemed to collapse under its own weight. I couldn't believe that the film that had started off so good had turned into a mess.
But anyway. The story is all about a sports agent named Jerry Maguire (Cruise). Jerry's a rat, but a likable rat, and he explains all about himself and his work in the great beginning of this film, using voice-over narration by Maguire himself, and some great montages linked together to create a seductive, engulfing, and totally intriguing opener. Jerry, who's job requires him to lie through his teeth and use people right and left, has gained a concious after a long time. We're not exactly sure why, but when a young son of one of his clients cusses at him, it seems to be the catalyst for his awakening, although it seems that it has been a gradual decent into goodness.
In a sweat-full insomniac night at a hotel, Jerry writes a long, heart-felt "mission statement," where he pours out how he thinks the agenting business should be more human, and better to their clients. He sends this out to everyone in his office who's at the hotel, and pretty soon he's gotten recognition for saying what they all wanted to say, but didn't have the guts. Then he gets fired. Quickly, he tries to go out independently, and grabs only one client out of his bunch: Rod Tidwell (Cuba), a cocky, self-absorbed, but loving husband/football player. He also gets only one person from his office to go with him to be his secretary or something: single mom Dorothy Boyd (Renee Zellweger), who has a bit of a crush on him. Then he leaves with Renee, Cuba as his client, and a fish. I re-watched it a couple times, to give it more of a chance, and I pinpoint that the time the film goes painfully downhill is once he walks out the door.
Jerry has already gone through the business awakening, but he also has that whole love awakening to go through.  And he begins falling in love with his secretary, Dorothy, which is way too hokey and unoriginal to do, in my humble opinion. If he could have fallen in love with someone else, maybe. But soon he and Dorothy are falling in love, having some sex, getting married, and soon this subplot falls totally apart.
And the subplot with Cuba also falls apart. The thing that this movie wants to do with this is to draw a paralellism between the two, how Jerry has trouble with love, and Cuba has trouble with giving his all sportswise. It goes okay for a while, although it seems to be highly edited in contrast to the Dorothy subplot. But then its concluded with a bit of luck. Cuba goes through no awakening, and is therefore there for no apparent reason, other than to give Jerry a client.
The screenplay is kind of half and half. Crowe has a definite knack for dialogue (there's this one very long line that Jerry says in the beginning that is definitely classic). But while there are some great lines and some very good dialogue, there is way too many stupid/corny lines that are almost guaranteed to make you vomit (i.e. "YOU...COMPLETE ME!"
On a plus side, the acting is excellent.  Preston proves herself a lovely scene-stealer as Jerry's girlfriend at the beginning of the film (her first line is indeed classic). Bonnie Hunt is fantastic as Dorothy's sister. I can't really grade Jonathan Lipnicki, who's Dorothy's very young son, but let's just say he's "cute," and leave it at that. Gooding is amazing, but I'm still not sure if he should have won that Oscar (I still think it should have been either Edward Norton or William H. Macy). In smaller roles, Jay Mohr, Regina King, and Todd Louiso are great.
But the most amazing part of this film is Tom Cruise. We all knew he could act (look at "Rainman" and "Born on the Fourth of July"), but here he's absolutely incredible. He becomes the role, gets all his quirks and little neuroses, and nabbed a well-deserved Oscar nomination. He's the best part of the film.
"Jerry Maguire" is, ultimately, a failed idealism. It tries to be the emergence of indie fare into big budget fare, but just fails in the end. But it's just my opinion, and since everyone else seems to love it, I could be wrong.
MY RATING (out of 4): **1/2
Homepage at: http://www.geocities.com/Hollywood/Hills/8335/
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


by F.C. DeCoste
This question is put to the
lawyer protagonist, Frank Galvin (Paul Newman), by the bereaved,
and now enraged, son of a deceased accident victim, after Galvin,
posing as the father's friend, slips his card into his widowed
mother's hands in a funeral home, one of several at which Galvin
attends to drum up contingency fee arrangements. And it is repeated,
later on in the piece, by the no less enraged brother-in-law
of the client, the vegetative Deborah Ann Kay, whose case-- Galvin's
only case ("there are no other cases, this is the case")--
provides the narrative structure of this wonderfully written
(David Mamet) and executed (Sidney Lumet) 1982 film.
Francis
P. Galvin: second in his Boston College class of '52, law review
editor, twelve years of distinguished criminal law and personal
injury practice in a two-man firm, married the beautiful Patricia
Harrington (her smiling photo remains still at Frank's bedside)
and, with that and without more, found himself a full partner
in her daddy's prestigious law firm, Sterns, Harrington &
Pierce; after nine years fired from the firm under a cloud of
manufactured allegations of jury tampering ("accused, never
indicted" as one character puts it, nor notably ever disciplined);
now dumped and divorced, he has in the three-and-a- half years
since descended into a hellish caricature of the middle-aged,
alcoholic, obit-reading, ambulance-chasing, case-starved ("four
cases in the last three years, he's lost them all") sole
practitioner. It falls to this Frank -- Frankie to his friends
and acquaintances, lawyers and fellow boozers alike -- to deliver
an answer, his verdict, on just that question: who indeed is
he? and does his being a lawyer matter to that determination?
Galvin's journey of self-interrogation,
discovery, and affirmation, as a lawyer, is complex. It is punctuated
throughout by pauses, by silences, some brief, others lengthy,
each a gnawing and revelatory insistence that Galvin confront
and engage, not just his circumstance, but his very self; it
is framed at beginning and end by the ringing -- a calling surely
-- of bells. And it takes shape through the medium of his client's
medical negligence case, in the fellowship Galvin undeservedly
enjoys with his mentor and original partner, the now semi-retired
Mickey Morrissey (Jack Warden) and, centrally, through his relationship
with the female presence Laura Fisher (Charlotte Rampling), whose
unexpected appearance in his life leads Galvin, until very near
the end, to believe his redemption resides in the recuperation
of his personal life. But Galvin's destination turns out to be
much more interesting and instructive than that, so far at least
as it concerns the demands and promises of leading a life at
the law.
We know straightaway that something
is afoot in Galvin's life. The film opens, the credits still
before us, with the ringing of bells. Galvin appears playing
a pinball machine in what we know is his favorite bar, his home
away from the dingy apartment to which he repairs to sleep it
off. Play he does and drink he does: but he also disengages from
both, before the film speaks a word, once, then again and again,
in a silence and stare at once perplexed and searching.  I can't take this any
more. I mean you're not going to change."); during his meeting
with his client's sister, Sally Donneghy, after ignoring the
file for eighteen months, trial impending, his eyes fixed on
the photos of a healthy Deborah Ann.
Thus does Frankie confront,
interrogate, himself -- in silence, within, not a word spoken
to any other. Perhaps for this reason, he at first misrecognizes
himself and misappraises what his redemption requires of him.
Even after what he experiences as an epiphany in the life-deserted
presence of his client -- again in silent stare, he experiences
her for the first time as a site of responsibility and no longer
as a source of contingency fee income, after he painfully, finally,
declares to a passing nurse, "I am her attorney" --
he thinks his fate a matter of his deciding simply to change,
to lead a renewed life. And so he acts and declares. He declines,
without client authorization, from the Bishop of Boston no less,
in whose "renowned" St. Catherine's Hospital the alleged
negligence occurred, an offer to settle that would have netted
him a cool seventy thousand: "If I take the money,"
he tells the Bishop, "I am lost." Later, he rejects
Mickey's counsel to settle ("When they give you the money
that means you've won") by declaring, with somber conviction,
"I'm going to stand up for that girl." And he tells
Laura, on her second appearance at the bar, after his failed
ham-handed attempt to pick her up at their first meeting, "I
changed my life today."
But his conviction is false,
as false and hollow as his long-sought victory, the very next
morning, first drink at hand, over the pinball machine. Witness
his dinner conversation with Laura ("The weak have got to
have someone to fight for them. Ain't that the truth. Want another
drink") and his provocative, silly, self-serving behavior
at the first chambers conference with the trial judge (Milo O'Shea)
and defendant's counsel Ed Concannon (James Mason) (the judge:
"It seems to me a fellow's trying to come back, he'd take
the settlement. I myself would take it and run like a thief";
Galvin: "I'm sure you would"). His off-the-rack conversion
deforms straightaway into bravado, perhaps indeed into hubris.
Frank is soon to learn that
painless, voluntaristic change provides neither self-recognition
nor life affirmation. When his star witness Dr. Gruber (who,
with his own cigar-munching bravado, promised to testify against
St. Catherine's and the "most respected" Drs. Marx
and Towler that "her doctors killed her ... the doctors
murdered her ... I don't want those bozos in the same profession
as me") turns prudent coward and disappears to the Caribbean,
when Judge Hoyle pays back his bravado by denying his on-knees-begging
request for a continuance ("This case should never have
come to trial. But you know better. You're mister independent.
You want to be independent? Be independent now. I have no sympathy
for you"), when Concannon's firm rejects his hyperventilating,
late-night offer to accept a revived offer: when confronted with
hard reality, Frank dissolves into a puddle of boozy self-pity,
panic, anxiety -- and cowardice. "We're going to lose,"
he whines child-like to Laura, "it's over ... Do you think
that it's my fault? That I could have ... oh God, I never should
have taken it, there's no way I could win."
Galvin's salvation, if it is
to be, lies in his mustering the courage to affirm the tragic
dimensions of his lawyerly world and to recognize the possibilities,
real and not imagined, of his place in it. Galvin must come to
terms, not only with all-too-human limitations of law and justice,
but also with the costs, the real costs and not those he has
conveniently chosen, to his life of his authentically serving
both. It is Laura who sets him on his way and who, at the end,
secures his redemption.
Unlike all the others who populate
his world, the lads at the bar, the denizens of the court, colleagues
and attendants alike, and Mickey especially ("Do you like
that story, Laura? What else do you want to know about Frankie?"),
all of whom finally defer to Frank's carefully constructed self-regarding
victimhood, Laura refuses him the comfy security of his boozy
irresponsibility.  She shreds his dress of hurt and leaves him naked: "You
want me to tell you it's your fault. Okay, it probably is. But
what are you going to do about it?" "I wanted to talk
to you. I thought maybe...." Laura will have none of it:
"Maybe you could get some sympathy. You come to the wrong
place." "What makes you so tough? Maybe I'll tell you
that later. Is there going to be a later?" Then crucially:
"Not if you don't grow up.  You're coming
in here like it is Sunday night, you want me to say you have
a fever so you don't have to go back to school. ...  Thus, after
a final collapse -- "Please don't. Please don't pressure
me. Please don't." -- is forged Frank's authentic epiphany:
sitting at the sleeping Laura's bedside, he acknowledges, first
with silent stare, then with forehead kiss, these truths of his
past and present and the possibility of another, different future
truth.
Frank's resurrection from self-absorption
permits him, perhaps for the first time in his life, to experience
the world in a way that does not center his own situation, that
avoids privileging his own disappointment.  I
know about you. You couldn't hack it as a lawyer.  I know about
you."). Gone too is the romantic perfectionist reverie of
the sort he offered to Laura over dinner on their second meeting,
in his scheme, as he put it to Mickey, "to get laid."
In their place, and in his place, he puts acknowledgment of others
and of the sorry, and wonderful, possibilities of frail, imperfect
creatures, he like them. These other voices -- class (Kevin Donneghy,
obstetrics nurse Maureen Rooney), gendered (admitting nurse Kaitlin
Costello Price -- "who were these men" -- and Laura
herself) and racial (Dr. Thompson -- the frail seventy-four-year-old
African-American M.D. who alone will replace the absconding Gruber
-- and all, the court, Concannon, Mickey, who react to his being
black) -- disclose to Frank, not all at once, but progressively
over the piece, and culminating in his closing address to the
jury, the reality of a world that resists correspondence with
his own circumstance, his feelings, his experiences, that is
grander, in its frailty and possibility, than his life alone.
When Kevin Donneghy, a self-described
"working man," accosts Frank at the courthouse for
failing to seek his and his wife's instructions on the offer
to settle, Frank is bewildered. To Donneghy's words--"You
guys, you guys are all the same. The doctors at the hospital,
you, it's always what I'm going to do for you. And then you screw
up and it's ah, we did the best that we could, I'm dreadfully
sorry, and people like us live with your mistakes the rest of
our lives"-- Frank can only muster a shrug, and a sheepish,
"They took back the offer." He reacts differently when
Maureen Rooney responds with class anger and contempt to his
attempt to strong-arm information. Rooney: "You guys are
the same.  All you care about is
the dollar.  Galvin says nothing;
but, in the camera close-up, tight on his face, he communicates
shocked awareness of this other truth; he hears and confronts
it. So, too, when he reacts to Dr. Thompson's departing counsel,
his case then in shambles: "You know Mr. Galvin sometimes
people can surprise you, sometimes they have a great capacity
to hear the truth"; Galvin, distractively, "yeah",
then hopefully "yes." And finally the closing address,
in which he rejects victimhood as a way of experiencing life
and expresses, to himself as much as to the jury, his matured
belief in law as human aspiration, "a fervent and frightened
prayer", to be freed from power's insistent claims, which
finally depends upon faith, faith by its practitioner stewards
and faith by the people to whom and for whom they are responsible.
Galvin's faith is immediately
put to the test and in a manner which reveals to him, and to
us, the tragic burden of authentically serving the law. In the
beautifully executed scene between Concannon and Laura, we learn,
from his speech and from her silence, both the conceit of feckless
lawyerly performance and of her betrayal, as a lawyer, of Frank
and of her profession. Once an associate in Concannon's New York
partner's office, now returning to the law after a failed marriage,
Laura has been acting as Concannon's paid informant. Profession
devolves from confession of the sort made by Frank in his closing
address; and the test of authentic confession, and consequently
the cost of authentic professionalism, is the subordination of
personal life and morality to public life and its specifically
communal values and demands. Despite the ripening of love between
them -- "I feel the same way Frank" -- Frank's verdict,
his refusal to answer Laura's call to private life, to love and
reconciliation, with which the film ends, is his acknowledgment
of those values and his satisfaction of those demands. Who is
Frank Galvin? With this, he answers: he is a lawyer to his very
roots.
Posted July 5, 2002
|


| 017:075 Khan | : |
In that case, We would have made you taste a double portion (of punishment) in this life and a double portion (of punishment) after death. And then you would have found none to help you against Us. |
| 017:075 Maulana | : |
Then We would have made thee taste a double (punishment) in life and a double (punishment) after death, and then thou wouldst not have found any helper against Us. |
| 017:075 Pickthal | : |
Then had we made thee taste a double (punishment) of living and a double (punishment) of dying, then hadst thou found no helper against Us. |
| 017:075 Rashad | : |
Had you done that, we would have doubled the retribution for you in this life, and after death, and you would have found no one to help you against us. |
| 017:075 Sarwar | : |
Had you done so, We would certainly have made you face double punishment in this life and after your death and you would have found none to help you. |
| 017:075 Shakir | : |
In that case We would certainly have made you to taste a double (punishment) in this life and a double (punishment) after death, then you would not have found any helper against Us. |
| 017:075 Sherali | : |
But if, as they imagine, thou hast been one to forge a lie against US, then WE would have made thee taste a heavy punishment in life and a heavy punishment in death, and then thou wouldst not have found for thyself any helper against US. |
| 017:075 Yusufali | : |
In that case We should have made thee taste an equal portion (of punishment) in this life, and an equal portion in death: and moreover thou wouldst have found none to help thee against Us! |
Concepts/Themes Covered: أركان الإسلام > (محمد (صلى الله عليه وسلم > مخاطبة الله إياه Pillars of Islam> The Blessed Muhammad(PBUH)> Allah's Address to Him(PBUH)
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


RT @atlasobscura: Cougar Gold, a cheese created by the Washington State University Creamery, might be most famous because it comes in a can…
8/4/2018, 3:08:15 AM
Favs: 0
Retweets: 0
link--- layout: tweet ---
RT @atlasobscura: Cougar Gold, a cheese created by the Washington State University Creamery, might be most famous because it comes in a can…
8/4/2018, 3:08:15 AM
Favs: 0
Retweets: 0
link


Firebase Authentication
A demo of authentication with Google+ and Github using Firebase + AngularJS
Home
Authenticated
This is where we will write our updates
Google+
Github
Logout


This page must be run from a web server.
Current cookies
Add or modifiy cookies
Cookie Name
Cookie Value


Before Change
Creates a registry and returns the result. Returns an empty result if
the registry already exists.
// [START iot_create_registry]
client = get_client(service_account_json)
registry_parent = "projects/{}/locations/{}".format(
project_id,
cloud_region)
body = {
"eventNotificationConfigs": [{
"pubsubTopicName": pubsub_topic
}],
"id": registry_id
}
request = client.projects().locations().registries().create(
parent=registry_parent, body=body)
try:
response = request.execute()
print("Created registry")
return response
except HttpError:
print("Error, registry not created")
After Change
print("Error, registry not created")
return ""
except AlreadyExists:
print("Error, registry already exists")
return ""
// [END iot_create_registry]


Donald Trump confirms pre-election UK visit
US President Donald Trump has confirmed he will travel to London 10 days before the UK general election.
He will be in the capital with the first lady for the Nato summit between 2 and 4 December.
Mr Trump will also attend a reception at Buckingham Palace, which will be hosted by the Queen.
The president has previously been criticised for voicing his opinions of British political leaders, including Boris Johnson and Jeremy Corbyn.
The White House said in a statement that the president "looks forward to meeting" the other Nato leaders and would "emphasize the need for the Nato alliance to ensure its readiness for the threats of tomorrow".
'Unprecedented progress'
These threats include "those emanating from cyberspace, those affecting our critical infrastructure and telecommunications networks, and those posed by terrorism," the statement said.
It said the leaders would "review the alliance's unprecedented progress on burden-sharing, including adding more than $100bn (£76bn) in new defence spending since 2016."
In October the president criticised Mr Johnson's Brexit deal with the EU, saying it restricted the US's ability to do future trade with the UK.
Speaking to the Brexit Party leader, Nigel Farage, on LBC, he said that without the deal the two countries could "do many times the numbers" than now.
The US president also took aim at Labour leader Jeremy Corbyn, saying he would be "so bad" as prime minister.
Mr Corbyn accused him of "trying to interfere" in the UK general election to boost "his friend Boris Johnson".


[§439-23] Right of injunction. The department, in addition to any other remedies available, may apply to a court having competent jurisdiction for an injunction to restrain any violation of this chapter. [L 1987, c 154, §1]


Imagine right now that you're living your ideal life. How do you feel? What does your career look like? What do you do with your time? Why not do what it takes to reach your ideal life? You're worth it. It's time to take charge!
Request a Free Consultation Today!
Free ConsultationHealth Coaching is a lot of great things where someone sits down with you and listens to you and helps to set good health goals and feel better. Sign up!
Learn More{{blogContent}}
Read MoreDoing this program, you will experience a Happiness Breathrough, and you life will be forever changed and completely improved in every conceivable way, shape, and form!
Learn More


rst is a python module to create reStructuredText documents through code.
Feedback is greatly appreciated. If you have any questions, comments, random praise, or anonymous threats, shoot me an email.


 It portrays the journey of a music enthusiast who derives inspiration from the host of a music-centric television show. The featured song composed by Brindly Sujith has been visualized under Gokul Narayanan's directorship. Ranjith Pillai dons the producer's hat. Co-founder and lead singer at Masala Coffee, Sooraj Santhosh and Divyavalli Santhosh has lend their soulful voices to this musical treat.
The video narrates the journey of music enthusiast Alan who derives inspiration from Rose Ann, a television music programme anchor. Brindly plays Alan. Neha potrays Rose Ann and is really looking forward its release.
Roll of persons- Conceived by :Gokul Narayanan
Produced by :Ranjith Pillai
Composed by :Brindly sujith
Co-Producers: Brindly Sujith, Parvathy Ramachandran & Friends
Post production: AVISIO Entertainments
Project supervision: Athul Ramachandran
DOP : Alan Varghese
Editing, VFX & DI: Akash Joseph Varghese
Associate director: Deepak Sasikumar
Production controllers : Dileep Vasudevan & Anoop Oduvil
Asst directors : Anumod K Sakar & Kiran Raghavan
Stills : Tom abraham
Publicity designs : Adarsh Nandakumar
Makeup : Tejaswini Divakar
Costumes : Elsa Abraham (Drape tales)
*News courtesy: http://ovmindia.com


Hello Friends! Here's my profile: https://github.com/joulay
Wanna know more about me? www.itsjuliek.com


--- title: "Setting up a bash command to post on jekyll based blog" date: 2014-11-02 lastmod: 2014-11-13 draft: false # Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`. authors: - "Ming Su" tags: - linux - ubuntu - bash shell summary: "Create a beautifully simple website or blog in under 10 minutes." ---
It is very time-consuming to write up the HEADLINE of your each post. This article is aiming to show you a bash command based way to set up the HEADLINE in the post.
#!/bin/bash
## ~/bin/wa
hppath="~/u2/www/homepage"
d=`date '+%Y-%m-%d'`
t=`date '+%b %d, %Y %H:%M:%S'`
filename=${1// /_}
head="---\n"
cd ~/u2/www/homepage/_posts/
postpath="~/u2/www/homepage/_posts"
# touch $d"-"$filename".md"`
echo -e "$head" > "$d"-"$filename".md
vim "$d"-"$filename".md
Add execute permission on this file:
chmod +x ~/bin/wa
Usage:
wa "your article title"


Twas the Grep before Christmas
Sometimes when it rains, it pours. It was 3pm on Christmas Eve and I was mentally out the door and half way home already when proxy alerts came in for a known malicious file (for the sake of this blog will be referred to as “malicious.exe”) hitting a handful of endpoints. Here are a couple of tricks I used to get out of the door by 4:15pm.
I use a tool that pulls back a targeted logical disk image from remote machines for my triage effort. So as you read this it is probably easier to think in terms of forensic disk analysis rather than incident response.
I saw numerous requests for malicious.exe from each machine in the proxy logs. From the surrounding traffic it was more consistent with drive by redirect to a watering hole than anything a user clicked on.
So I mounted the disk images from the 4 machines to C:\Cases and here is how I quickly triaged the extent of compromise: C:\Cases> strings -s | grep malicious.exe Here is what I got back:
Machine One
C:\Cases\Machine1\C\Users\User1\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: http://static.evilsite.com/malicious.exe
C:\Cases\Machine1\C\Users\User1\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: malicious.exe
C:\Cases\Machine1\C\Users\User1\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: http://static.evilsite.com/malicious.exe
C:\Cases\Machine1\C\Users\User1\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: malicious.exe
C:\Cases\Machine1\C\Users\User1\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: http://static.evilsite.com/malicious.exe
So for this first machine the only mention of malicious.exe was found in the Internet Explorer 11 history. Upon further investigation, it turns out that the user cancelled all of the download attempts and the malware never hit the filesystem. NEXT!
 My 30 second analysis on this data tells me:
- There is an $MFT record for malicious.exe. This means it successfully downloaded and found a home in the FS. Also it looks like there is a small file in the $MFT that contains that filename. Looking at the tail end of the string it looks like javascript. This makes for a great IOC.
- I see numerous records in the $UsnJrnl-$J that can most likely be attributed to Internet Explorer attempting to download the malware 3 times before the user said “Ok” and allowed the download. IE creates a “filename.randomstring.partial” file for downloading files. Once the download is complete and everything checks out it renames the file to filename.exe. Here I see malicious.exe.3l98fuk.partial, malicious.exe.sx2afu8.partial, malicious.exe.trtsnvz.partial. There are also a number of USNJrnl-$J records for just malicious.exe. While most of these could be associated with the changes in file size during download and/or the file rename, it is enough of a red flag to pull this box from the network and move on.
- While I pulled the box off the network, it was mostly to err on the side of caution. I really only see the malicious.exe in the IE WebhistoryV01.dat but no files that screams “execution”. No prefetch, no user or system registry hits, no shortcut files, and no hits in event logs. Again, this is my 30 second analysis (I still had presents to wrap).
- This machine validated what my findings from the first machine. This exhibits signs of hitting the file system; Machine1 did not. NEXT!
Machine 3
C:\Cases\Machine3\C\$MFT: http://static.evilsite.com/malicious.exe');
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B3.log: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: http://static.evilsite.com/malicious.exe
C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat: http://static.evilsite.com/malicious.exe
Much like Machine1, Machine3 shows very little filesystem activity. The only files that contain the “malicious.exe” file name are:
- C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\V01001B0.log
- C:\Cases\Machine3\C\Users\User3\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat
NEXT!
Machine 4
C:\Cases\Machine4\C\Users\User4\AppData\Roaming\Google\Chrome\User Data\Default\History: malicious.exe
C:\Cases\Machine4\C\Users\User4\AppData\Roaming\Google\Chrome\User Data\Default\History: malicious.exe
C:\Cases\Machine4\C\Users\User4\AppData\Roaming\Google\Chrome\User Data\Default\History: malicious.exe
C:\Cases\Machine4\C\Users\User4\AppData\Roaming\Google\Chrome\User Data\Default\History: malicious.exe
This user had Chrome setup as the default browser and the only place in the collected evidence that we see the malware’s filename is in the Chrome History file. I decided to crack it open and get some better definition on what happened.
- First things first…Chrome didn’t log current or target path for the malware. This means the download wasn’t written to disk. Great but how?
- The interrupt_reason is populated with code 40. A quick look at a copy of the Chromium source code reveals what happened:
// The user canceled the download. // "Canceled". INTERRUPT_REASON(USER_CANCELED, 40)
- No end time for the download because the user cancelled it.
- Finally, the malware wasn’t opened because because the user cancelled it.
Now before I catch a lot of flack for not being thorough enough, this malware has well established behavior patterns that are easy to check for. Using the SysInternals version of strings checks for unicode and ascii strings at the same time which offers the best avenue of finding evidence of the filename on disk. Even from this small sample of workstations, we can quickly see how far a malicious file has penetrated a file system and determine the extent of compromise.
Does this technique work for all malware? No but it is a great start.


Depending on your type of interest, choose one of the following ways to contact us.
For all PDX data submission requests, questions, comments, website feedback<EMAIL_ADDRESS>Be informed on new PDX data upload and website releases. PDX finder announce list


Marching Squares is a 2D variation of the 3D Marching Cubes algorithm
For my implementation in 2D, I used ancient OpenGL (GLUT was required for the project) and C++. There is a grid of MarchingSquare objects which contain 4 vertices, each specified by a 3D vector. There is also a list of shapes, all circles in this case, which bounce around the scene as they collide with an invisible boundary object.
The grid is searched for a square that contains each circle's center, and then the surrounding square states are calculated based on which vertices are encompassed by that cirlce. In the draw function, the state of each active square is used to pull a set of vertices from a lookup table. The vertices are then sent through the OpenGL pipeline and rendered on screen. The result is the approximation of the circles as they pass over a given section of the grid.
More information about Marching Cubes on Wikipedia: Marching Cubes
If you'd like to see the code, check it out on GitHub.
Approximating Shapes with Squares and Partial Squares
Approximation of the Underlying Grid


gautam.cc is proud to announce that as of January 23rd, our total number of users (not including web traffic) has stepped up to over 4,000. Thanks to all who support SmartCodes, MathNinja, and DeskRock on the Chrome and Apple App Stores.


“My life has changed for the better because I’ve been able to spend more quality time with my daughter and husband.”
Esther, Nairobi
Drive when you want, earn what you need
When you drive with Uber, you decide when and how long to work. So you’ll never have to choose between earning a living and living life.
It’s easy to make money helping people get around. How much is completely up to you. With so many riders in every city, there’s opportunity at every turn.
Just tap and go. You’ll get turn-by-turn directions, tools to help you earn more, and 24/7 support. If you don’t have a smartphone, we can connect you to one.
The fares you earn automatically deposit in your bank account every week. Use the app to track how much you make on every trip. For making the app available to you, we deduct a service fee.
You’re in the driver’s seat. So reward yourself with discounts on fuel, vehicle maintenance, cell phone bills, and more. Reduce your daily expenses and take home extra earnings—the more you drive, the more you earn.
We’re dedicated to keeping you safe before, during, and after every trip. You’ll always know who you’re picking up, and fares are automatically charged through the app—so you avoid the risk of carrying cash. Our specially trained incident response teams are available 24/7.
“My life has changed for the better because I’ve been able to spend more quality time with my daughter and husband.”
Esther, Nairobi
“My goal and dream has always been to be independent, to be an entrepreneur. Uber came in at the perfect moment.”
Liz, Bogotá
“Why do I drive? 50% the money, 50% the fun—and the fun part is the people.”
David, San Francisco
Tell us a little about yourself and your car. Vehicle requirements vary by region, and we’ll show you what’s needed for your city.
We’ll need your license, registration, proof of insurance, and the necessary information to run a background check.
Once you’re approved to drive with Uber as an independent contractor, we’ll provide everything you need to be a success on the road.


Toggle navigation
Project name
Home
About
Contact
New
Revocation
Restore
Clear
Save
pen size:
color:


climate uncertainty hydrological model projections change study ensemble parameter water watersheds models GCM RCP precipitation temperature GCMs watershed selection multi-GCM River monthly Water projected (Fig. ABCD Ohio analysis impact streamflow runoff multi-parameter using components Resour \documentclass[pt]{minimal} \setlength{\oddsidemargin}{-pt} \usepackage{amsbsy} \usepackage{amsfonts} \usepackage{amsmath} \usepackage{amssymb} \usepackage{mathrsfs} \usepackage{upgreek} \usepackage{wasysym} balance relatively {border-style calibration overall variations Hydrol changes ensembles px;} × #ffffff;} Res. Sci. basin equifinality future global impacts increase large multiple parameters ./WR Change PET compared groundwater hydrologic minimum soil watersheds. Projected behavioral different direct selected sets used variables Earth data Figure Syst Uncertainty annual average hydrology maximum model, projection showed use ./hess--- Change. Clim addition, assessment complexity evapotranspiration increases information provided regional results (mm) Climate indicating modeling number quantified simulated studies values ./s--- Average CMIP DR, Fig. Hydrol. QQ, approach calibrated component contributions including methods observations performance predictions ranges scenarios simulation statistical study. accuracy available case larger numbers predicted processes projections, projections. px; represent responses significant small spatial study, {font-family (). ./j.jhydrol... China Model Sci Thus, comparison contribution demonstrated font-size hydrographs increased local management method mm) optimization partitioning potential provide range represents right seasonal set structure total variable weather winter (Eq. (Figs. (e.g. Basin GW, NSE S). [], bias-corrected capacity components. decrease decreases double; estimation framework historical identify included influential models: month months rainfall-runoff rates respectively. river scale scenarios, threshold uncertainty. value variation (Table (or (rather ./j.-...x Eq. However, Report Results SS, S})$$\end{document} Vogel agricultural baseflow border-color border-width calibration. characteristics conceptual developed did expected greater higher humid identified infiltration influence instance, landscape limits months, needs observed outputs posterior prediction quantify reliability reported resources runoff, signifies solid; sources stations temperate trends unique varied vary {font-style {font-weight (. mm) (i.e. (the ./hyp. ./pnas. Assoc. Basin, Bull Commons Comparison Creative Gupta Hydrologic Institute Liu Meteorol Overall, PP, Process. Res Soc. Supplementary Table Then, U.S. United \,S$$\end{document} actual applicability appropriate area assessment. associated availability averages based bold calibration, change: columns, commonly considerable considered content continental correlated correlation courier; current depending difference distributed distribution distributions dominant downscaling em; employed especially evaluation flow generation headwater hydrol. implying improve indicates introduced left literature long mathematical modelling models, moisture output placed prepared processes, pt;} rainfall regarding representation respectively respectively, response scales simple strategies substantial summation summer, temperature, unit upper used, variability varies watersheds, watersheds: wise worth


public class LightGameObject
extends org.cdnomlqko.jglutil.gameobject.GameObject
GameObject
,
Light
| Modifier and Type | Field and Description |
|---|---|
private org.cdnomlqko.jglutil.data.Light |
light |
private int |
sceneBuffer |
private int |
sceneBufferOffset |
| Constructor and Description |
|---|
LightGameObject(org.cdnomlqko.jglutil.data.Light.Type type,
org.joml.Vector3f color,
float intensity)
Same as
LightGameObject(Light) , but calls the Light(Light.Type, Vector3f, float) constructor itself. |
LightGameObject(org.cdnomlqko.jglutil.data.Light light)
Creates the object, using the given
Light data |
| Modifier and Type | Method and Description |
|---|---|
org.cdnomlqko.jglutil.data.Light |
getLight() |
int |
getSceneBuffer()
the
Scene lights buffer where the object is written. |
int |
getSceneBufferOffset()
offset in the
Scene lights buffer where the object is written. |
static int |
getSize()
Get the size of the GLSL struct:
|
void |
setSceneBuffer(int sceneBuffer)
Do not use this unless you really know what you're doing!
|
void |
setSceneBufferOffset(int sceneBufferOffset)
Do not use this unless you really know what you're doing!
|
void |
update()
Updates the object.
|
void |
writeToBuffer(java.nio.ByteBuffer buff,
int offset)
Writes all the data from this object to a buffer for rendering use.
|
private final org.cdnomlqko.jglutil.data.Light light
private int sceneBufferOffset
private int sceneBuffer
public LightGameObject(org.cdnomlqko.jglutil.data.Light light)
Light
datalight
- Light
public LightGameObject(org.cdnomlqko.jglutil.data.Light.Type type, org.joml.Vector3f color, float intensity)
LightGameObject(Light)
, but calls the Light(Light.Type, Vector3f, float)
constructor itself.type
- - the type of the lightcolor
- - color of the lightintensity
- - intensity of the lightLight
,
Light(Light.Type, Vector3f, float))
public org.cdnomlqko.jglutil.data.Light getLight()
public void writeToBuffer(java.nio.ByteBuffer buff, int offset)
struct Light {
mat4 transform;
vec3 color;
float intensity;
int type;
};
buff
- - buffer for the data to be put intooffset
- - offset into the buffer to put the dataByteBuffer
public static int getSize()
struct Light {
mat4 transform;
vec3 color;
float intensity;
int type;
};
public void update()
Transformation
and Light
data in the scene buffers if the object is in a Scene
update
in class org.cdnomlqko.jglutil.gameobject.GameObject
Scene
,
GameObject.isInScene()
public int getSceneBufferOffset()
Scene
lights buffer where the object is written.Scene
, otherwise an integer between 0 and the length of the OpenGL buffer getSceneBuffer()
public void setSceneBufferOffset(int sceneBufferOffset)
sceneBufferOffset
- getSceneBufferOffset()
public int getSceneBuffer()
Scene
lights buffer where the object is written.Scene
, otherwise a valid OpenGL buffer pointerpublic void setSceneBuffer(int sceneBuffer)
sceneBuffer
- getSceneBuffer()


SSL Certificates
Protect your web traffic
Protect your web traffic, and increase shopper confidence, with our range of SSL Certificates.


As an attacker, once you have found a server with Kerberos Unconstrained Delegation, what’s next?
- Compromise the server via an admin or service account.
- Social engineer a Domain Admin to connect to any service on the server with unconstrained delegation.
When the admin connects to this service, the admin’s TGS service ticket (with the TGT) is delivered to the server and placed into LSASS in case it’s needed later.
The Domain Admin’s authentication (TGT) ticket can be extracted and re-used (until the ticket lifetime expires).
No need to wait though, the ticket can be used immediately in order to get the domain KRBTGT account password hash (when a Domain Admin is compromised).
In this case we use PowerShell remoting to connect to a Domain Controller as the Domain Admin.


- The game has 2 players, playing in rounds
- In each turn, a player rolls a dice as many times as he wishes. Each result get added to his ROUND score
- BUT, if the player rolls a 1, all his ROUND score gets lost. After that, it's the next player's turn
- The player can choose to 'Hold', which means that his ROUND score gets added to his GLOBAL score. After that, it's the next player's turn.
- The first player to reach 100 points on GLOBAL score wins the game
- But wait.. There is a twist in the game, if any of the player rolls two 6 in a row, that player will lose his entire global score and all his score will be 0, also a 1 last and amazing twist is -- suppose any of the player is far away from the other player(winning), and the other player rolls 6 , and if he holds and passes the dice to the player who is winning , then keep in mind that the other player already rolled a 6 and passed it, now...if the player who is winning rolls a 6 on his 1st attempt, that player will lose his entire global score..and the turn will be passed as well. Interesting. right.
ENJOY THE GAME
Created By Faizan


Hi,
You're receiving this email because {{details.name_of_parent}} completed WatchMeGrow.care for {{details.first_name_of_child}} {{details.last_name_of_child}}. WatchMeGrow.care tracks developmental progress for children aged between approximately {{minMonths}} to {{maxMonths}} months. It has been designed to facilitate early identification of developmental problems.
{{if concern}}It is highly likely that this child has developmental issues. It is strongly recommended that referral for further assessment and early intervention through a paediatrician or other child development health professional is done. Also continue to monitor the child over time.
{{else}}Developmental issues in this child are unlikely. No further follow-up necessary at this point. Continue ongoing monitoring as usual.
{{/if}}| Child's Name | {{details.first_name_of_child}} {{details.last_name_of_child}} | Date of Test | {{details.test_date_formatted}} |
| Date of Birth | {{details.dob_child_formatted}} | Age of Child | {{details.age_of_child}} |
| Number | Question | Response |
|---|---|---|
| {{##}} | {{metadata.text}} | {{answer.metadata.text}} |
| Comment | {{answer.comments}} |
For further information on child development please go to Learn the signs - act early.
This information has also been provided to the parent.


{% extends 'base.html' %} {% block content %}
Thank you for being able to log-in!  Now go forth and try not to be sad!


Home
How to build a beautiful blog
Zaydek Michels-Gualtieri
@username_zaydek
Self-taught, inspired to learn
Apr 20
· 20 min read
How to build a beautiful blog
Learn from first-principles
The blog we'll build. Click to continue on Scrimba