text stringlengths 454 608k | url stringlengths 17 896 | dump stringclasses 91
values | source stringclasses 1
value | word_count int64 101 114k | flesch_reading_ease float64 50 104 |
|---|---|---|---|---|---|
From: Johan Råde (rade_at_[hidden])
Date: 2008-02-21 06:07:50
Pfligersdorffer, Christian wrote:
> Hello all,
>
> we use fp_utilities in our portable binary archive implementation to
> serialize floating point numbers. For doing so we found the functions
> fp_traits<T>_impl::get_bits() and set_bits() to be exactly what we need.
> In combination with Beman Dawes endian library we're able to transfer
> binary data between ppc-32 and x86-32 reliably. This might serve as a
> usecase since John Maddock pointed out serialization as a prominent
> application of the library.
>
> /**
> * save floating point types
> *
> * We simply rely on fp_traits to extract the bit pattern into an
> (unsigned)
> * integral type and store that into the stream.
> *
> * \todo treat nan values using fp_classify
> */
> template <typename T>
> BOOST_DEDUCED_TYPENAME boost::enable_if<boost::is_floating_point<T>
>> ::type
> save(const T & t, dummy<3> = 0)
> {
> using namespace boost::math::detail;
> BOOST_DEDUCED_TYPENAME fp_traits<T>::type::bits bits;
> fp_traits<T>::type::get_bits(t, bits);
> save(bits);
> }
>
> As you can see our code depends on functions that apparently are not
> part of the public interface and I wonder why. Perhaps I overlooked
> something? Those interested in the full code can find it in the boost
> vault.
Hi Christian,
You are using an undocumented internal implementation detail of the library
for a purpose for which it is not intended.
Be warned that the math::detail::fp_traits<T>::type::get_bits() function
is *not* guaranteed to give you all bits of the floating point number.
It will give you all bits if and only if there is an integer type
that has the same size as the floating point you are copying from.
It will not give you all bits for double if there is no uint64_t.
It will not give you all bits for long double if sizeof(long double) > 8 or there is no uint64_t..
Be careful,
Johan Råde
> To sum it up: We think the fp_utilities provide useful functionality and
> our tests indicate reliability that can be counted on. So thank you
> Johan Rade for this contribution!
>
>
> Best Regards,
>
> --
> Christian Pfligersdorffer
> | https://lists.boost.org/boost-users/2008/02/34105.php | CC-MAIN-2018-05 | refinedweb | 341 | 51.89 |
#include <hallo.h> * Raphael Hertzog [Wed, Jun 28 2006, 12:17:45PM]: > > 9. It would be great if Ubuntu could advertise a bit more its Debian > > correlation by putting Debian logos in CD covers, background images, > > installer splashscreen, etc. Some kind of "Trademark policy" needs to be > > worked out with Ubuntu. > > Mark Shuttleworth discussed this point with the DPL, and also with several > other DD and we explained that the "Open use logo" has been precisely > meant for this kind of use and that they can go ahead. What about creating a logo for a strategy similar to the Intel Inside campain? I imagine a simple circle of letters "Debian Powered" (in Debian-red) around the Swirl. I think we should promote our attendance in the development of forks a little bit more. Today I see a bad trend meeting fresh Ubuntu users and often hearing "Debian? Never heard about that, I use Ubuntu 6". IMO Tec. Committee would endorse the use of a such logo deciding whether the distro deviates too much from the official branch or not. Eduard. | https://lists.debian.org/debian-project/2006/06/msg00325.html | CC-MAIN-2017-43 | refinedweb | 180 | 70.53 |
Ecto - inheriting nested associations
I'm trying to create a migration for my table
folders:
schema "folders" do field(:name, :string) field(:context, :string, default: "workspace") has_many(:files, Application.File, on_delete: :nilify_all) has_many(:contracts, Application.Contract, on_delete: :nilify_all) has_many(:child_folders, Application.Folder, foreign_key: :parent_id) belongs_to(:project, Application.Project) belongs_to(:parent, __MODULE__, foreign_key: :parent_id, on_replace: :nilify) belongs_to(:creator, Application.User, foreign_key: :creator_id) belongs_to(:contact, Application.User, foreign_key: :contact_id) embeds_one(:permission, Application.Permission, on_replace: :delete) has_many(:folder_groups, Application.FolderGroup, on_replace: :delete, on_delete: :delete_all) has_many(:groups, through: [:folder_groups, :group]) timestamps() end
What I want is for each
:child_folder to inherit the
:groups of their
:parent. I already managed to modify my changeset such that creating a new child folder will exhibit such behavior. I'm trying to compose a migration to apply the same for the existing folder records in my repo.
See also questions close to this topic
- Why does my postgres docker image not contain any data?
I'd like to create a docker image with data.
My attempt is as follows:
FROM postgres COPY dump_testdb /image RUN pg_restore /image RUN rm -rf /image
Then I run
docker build -t testdb .and
docker run -d testdb.
When I connect to the container I don't see the restored db. How do I get an image with the restored data?
- Postgresql & pgAdmin: Add a default column to every new table in database
Postgresql & pgAdmin: How can I add a column to every table that is created in my database?
I want to add a "GUID" and "CreateDate" column by default to every single table that will ever be created in my database.
So if I do:
CREATE TABLE my_table ( name string )
Then it should create a table with 3 columns (name, GUID, CreateDate)
- Rails remove duplicated associated records
Let's say I have a
Userand User
has_many :tagsand I would like to remove all
@userstags that have duplicated
name. For example,
@user.tags #=> [<Tag name: 'A'>, <Tag name: 'A'>, <Tag name: 'B'>]
I would like to keep only the tags with unique names and delete the rest from the database.
I know I could pull out a list of unique tags names from user's tags and remove all users's tags and re-create user's tags with only unique names but it would be ineffficient?
On the other hand,
selectwon't work as it returns only the selected column.
uniqalso won't work:
@user.tags.uniq #=> returns all tags
Is there a more efficient way?
UPDATE: I would like to do this in a migration.
- inserting multiple changesets in single transaction
I have this bridge table :
schema "rooms_units" do field(:date_from, :utc_datetime) field(:date_to, :utc_datetime) belongs_to(:room, App.Room, primary_key: true) belongs_to(:unit, App..Unit) end
I have list of maps coming from my endpoint and I made a list of changesets for each map.
[ #Ecto.Changeset< action: nil, changes: %{ date_from: #DateTime<2016-11-03 13:23:00Z>, date_to: #DateTime<2016-11-03 13:23:00Z>, room_id: 255, unit_id: 296 }, errors: [], data: #App.RoomUnit<>, valid?: true #Ecto.Changeset< action: nil, changes: %{ date_from: #DateTime<2016-11-03 13:23:00Z>, date_to: #DateTime<2016-11-03 13:23:00Z>, room_id: 256, unit_id: 296 }, errors: [], data: #App.RoomUnit<>, valid?: true > ]
And I want to insert it in the
rooms_unitstable in single transaction.
I tried
Ecto.multi.insert_all. But it accepts list of maps not the changesets. Is there any other function than can help me with this
Thanks
- How to mock HTTPoison with Mox?
Background
I have library that uses HTTPoison for some functionality I need to test. To achieve this I am using Mox, which I believe is the universal mocking library for Elixir (even though there are others this one has the seal of approval of José Valim)
Problem
Everything is going fine, I define my mocks in the
test_helpers.exs:
ExUnit.start() Mox.defmock(HTTPoisonMock, for: HTTPoison)
And I set up my dummy tests:
defmodule Alfred.Test.Http.Test do use ExUnit.Case, async: true import Mox # Make sure mocks are verified when the test exits setup :verify_on_exit! describe "get" do test "works on OK" do HTTPoisonMock |> get(:get, fn _ -> 1 end) assert HTTPoisonMock.get(1) == 1 end end end
The problem here is I can't run them:
module HTTPoison is not a behaviour, please pass a behaviour to :for
Mock Contracts, not implementations
Now, I know José Valim supports this ideology, thus everything we should mock should have a contract. But HTTPoison is not mine and it doesn't have one. So this brings me to the following question:
- How can I mock 3rd libraries that don't offer behaviours using Mox ?
- extract data inside script tag
I am new to elixir programming, writing a script to fetch a list of movies from a URL using
httpoison, which results in raw html.
For parsing I am using the floki, So the list of movies lies inside a javascript tag, which is very difficult to parse.
I guess it would be easier if complete DOM tree can be created/loaded and then parse it.
Is there any way to make things easier ?
- Delete orphaned records with Ecto
I have 3 models:
user.ex
schema "users" do ... many_to_many(:acts, Act, join_through: UserAct) end
act.ex
schema "acts" do ... many_to_many(:users, User, join_through: UserAct) end
user_act.ex
schema "users_acts" do belongs_to :user, User belongs_to :act, Act end
Each time I delete
UserActI want to check if there is orphaned
Actmodels and delete them, in the transaction.
In SQL it looks like this
DELETE FROM acts WHERE NOT EXISTS ( SELECT 1 FROM users_acts ua WHERE ua.act_id = acts.id ); or DELETE FROM acts WHERE id NOT IN (SELECT act_id FROM users_acts);
My question is how to write a similar query with Ecto?
Please show all the methods you know: joins, fragments, etc...
- Ecto - counting nested associations recursively
I have the following schema:
defmodule MyApp.Folder do use Enterprise.Web, :model schema "folders" do has_many(:contracts, MyApp.Contract) has_many(:child_folders, MyApp.Folder, foreign_key: :parent_id) end end
As you can see, each folder can have recursively many child folders each having their own child folders and so on. In my folder controller, I want to count the total number of contracts contained in each folder and all of the contracts in its child folders and so on.
Say, I have a folder named
root. If I want to count the number of contracts at the top level of the folder, I can just simply call
length(root.contracts). However, I still haven't taken into account
root's child folders and the number of contracts in each child folder and if each child folder descends into a tree of descendant folders and their contracts.
- Adding and removing records with a many to many relationship in Ecto
I have 2 ecto schema models that have a man_to_many relationship.
schema "Users" do many_to_many :locations, Location, join_through: "locations_users" end schema "Locations" do many_to_many :users, User, join_through: "locations_users" end
So in my User.ex schema model file how should I go about writing a function to add and also to remove a user?
def add_location(location) do # ??? end def remove_location(location) do # ??? end
In the ecto docs it says you shouldn't have to load all the associated data before adding/removing an association item, you can just set the association. But since I am using a many to many, I'm not sure how I can just set the association since it is a join table only.
- Dilemma: should I use a module plug or function plug: Phoenix
I need to reuse a function plug on different modules but it seems a bit redundant to do that. Is a module plug a better way to do this or how can I reuse the function plug?
- Facing issues while inserting spark dataframe to phoenix table due to column mismatch
I am creating a phoenix table with below structure
CREATE TABLE IF NOT EXISTS "TEST1"( "slhdr" VARCHAR(100), "totmins" INTEGER, "totslrcds" INTEGER, "tottime" INTEGER, CONSTRAINT pk PRIMARY KEY ("sleepelement") );
Now I have created a dataframe from JSON data by selecting specific columns from another dataframe. Below is the schema of this dataframe:
newDF.printSchema root |-- slhdr: array (nullable = true) | |-- element: string (containsNull = true) |-- totmins: long (nullable = true) |-- totslrcds: long (nullable = true) |-- tottime: long (nullable = true)
Now I am trying to insert data into above phoenix table using this dataframe with help of below code:
newDF.write .format("org.apache.phoenix.spark") .mode("overwrite") .option("table", "TEST1") .option("zkUrl", "Server details") .save()
However its unable to map the dataframe columns with table columns and I am getting below error:
Caused by: org.apache.spark.SparkException: Job aborted due to stage failure: Task 33 in stage 74.0 failed 4 times, most recent failure: Lost task 33.3 in stage 74.0 (TID 2663, ailab003.incedoinc.com, executor 2): java.sql.SQLException: Unable to resolve these column names: SLHDR,TOTMINS,TOTSLRCDS,TOTTIME Available columns with column families: slhdr,0.totmins,0.totslrcds,0.tottime
Looks like the phoenix table is creating default column family '0' for last 3 columns which I don't understand.
Is there a way to get this data inserted.
- (Postgrex.Error) ERROR 58P01 (undefined_file) $libdir/postgis-2.4
I had to brew reinstall some things that my existing project uses.
Now I'm getting this error when I'm running a SELECT statement:
Interactive Elixir (1.7.4) - press Ctrl+C to exit (type h() ENTER for help) iex(1)> 18:07:23.636 [debug] QUERY ERROR source="shops" db=5.4ms SELECT s0."id", s0."name", s0."place_id", s0."point", s0."inserted_at", s0."updated_at",ST_Distance_Sphere(s0."point", ST_SetSRID(ST_MakePoint($1,$2), $3)) FROM "shops" AS s0 WHERE (ST_DWithin(s0."point"::geography, ST_SetSRID(ST_MakePoint($4, $5), $6), $7)) ORDER BY s0."point" <-> ST_SetSRID(ST_MakePoint($8,$9), $10) [176.1666197, -37.6741546, 4326, 176.1666197, -37.6741546, 4326, 2000, 176.1666197, -37.6741546, 4326] 18:07:23.666 [error] #PID<0.356.0> running Api.Router terminated Server: 192.168.20.9:4000 (http) Request: GET /products?categories[]=1&categories[]=2&categories[]=3&categories[]=4&categories[]=5&categories[]=6&categories[]=7&categories[]=8&categories[]=9&categories[]=10&categories[]=11&categories[]=12&categories[]=13&categories[]=14&categories[]=15&categories[]=16&categories[]=17&categories[]=18&categories[]=19&categories[]=20&categories[]=21&categories[]=22&categories[]=23&categories[]=24&categories[]=25&keyword=%22%22&latitude=-37.6741546&longitude=176.1666197&distanceFromLocationValue=2&distanceFromLocationUnit=%22kilometers%22 ** (exit) an exception was raised: ** (Postgrex.Error) ERROR 58P01 (undefined_file): could not access file "$libdir/postgis-2.4": No such file or directory (ecto) lib/ecto/adapters/sql.ex:436: Ecto.Adapters.SQL.execute_and_cache/7 (ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5 (ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4 (api) lib/api/controllers/product/get_product.ex:46: Api.Controllers.GetProduct.get_products/1 (api) lib/api/router.ex:1: Api.Router.plug_builder_call/2 (api) lib/plug/debugger.ex:123: Api.Router.call/2 (plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4 (cowboy) /Users/Ben/Development/Projects/vepo/api/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
It is complaining about PostGis. I did brew install postgis to install it again. Still getting the error. Where is
$libdirdirectory in my macbook so that I can view the files? How do I fix this error?
- Allow Ecto queries to run immediately in a test environment?
I'd like to write tests to validate that the SQL queries in my application return data adhering to certain constraints: namely, that return values are presented in descending insertion order. In the application, I'm using
timestamps()in my schemas to include an
inserted_atfield to the DB, and querying against it in my queries (
SELECT … ORDER BY inserted_at DESC).
My trouble comes in my tests: if I have test code like
person1_params = %{name: "Tidehunter"} {:ok, tidehunter} = People.create_person(person1_params) person2_params = %{name: "Kunkka"} {:ok, kunkka} = People.create_person(person2_params) person3_params = %{name: "Windrunner"} {:ok, windrunner} = People.create_person(person3_params)
and I'd like to assert on their order, like
people = People.get_in_order_of_recency() assert Enum.at(people, 0).name == "Windrunner"
this fails, even though in manual tests it all appears to work. Upon inspection, I see that
inserted_atfor all three records is identical. I've tried adding
:timer.sleep()calls, but it doesn't change the outcome, suggesting some batching or laziness at the Ecto/Postgrex layer.
The "simplest" solution I could think of would be some way to "force" a transaction to occur at the call site, so I could
:timer.sleep(1)between them, giving me distinct
inserted_atfields (thus the question title) but at the risk of XY problem I'm open to other suggestions. Thanks!
- Elixir postgrex with poolboy example on Windows fails with 'module DBConnection.Poolboy not available'
I am exploring using Elixir for fast Postgres data imports of mixed types (CSV, JSON). Being new to Elixir, I am following the the example given in the youtube video "Fast Import and Export with Elixir and Postgrex - Elixir Hex package showcase" (). The basic mix application works until the point that Poolboy is introduced, i.e. Postgrex successfully loads records into the database using a single connection.
When I try to follow the Poolboy configuration, and test it by running
FastIoWithPostgrex.import("./data_with_ids.txt")
in iex or the command line, I get the following error, for which I can not determine the cause (username and password removed):
** (UndefinedFunctionError) function DBConnection.Poolboy.child_spec/1 is undefined (module DBConnection.Poolboy is not available) DBConnection.Poolboy.child_spec({Postgrex.Protocol, [types: Postgrex.DefaultTypes, name: :pg, pool: DBConnection.Poolboy, pool_size: 4, hostname: "localhost", port: 9000, username: "XXXX", password: "XXXX", database: "ASDDataAnalytics-DEV"]}) (db_connection) lib/db_connection.ex:383: DBConnection.start_link/2 (fast_io_with_postgrex) lib/fast_io_with_postgrex.ex:8: FastIoWithPostgrex.import/1
I am running this on Windows 10, connecting to a PostgreSQL 10.x Server through a local SSH tunnel. Here is the lib/fast_io_with_postgrex.ex file:
defmodule FastIoWithPostgrex do @moduledoc """ Documentation for FastIoWithPostgrex. """ def import(filepath) do {:ok, pid} = Postgrex.start_link(name: :pg, pool: DBConnection.Poolboy, pool_size: 4, hostname: "localhost", port: 9000, username: "XXXX", password: "XXXX", database: "ASDDataAnalytics-DEV") File.stream!(filepath) |> Stream.map(fn line -> [id_str, word] = line |> String.trim |> String.split("\t", trim: true, parts: 2) {id, ""} = Integer.parse(id_str) [id, word] end) |> Stream.chunk_every(10_000, 10_000, []) |> Task.async_stream(fn word_rows -> Enum.each(word_rows, fn word_sql_params -> Postgrex.transaction(:pg, fn conn -> IO.inspect Postgrex.query!(conn, "INSERT INTO asdda_dataload.words (id, word) VALUES ($1, $2)", word_sql_params) # IO.inspect Postgrex.query!(pid, "INSERT INTO asdda_dataload.words (id, word) VALUES ($1, $2)", word_sql_params) end , pool: DBConnection.Poolboy, pool_timeout: :infinity, timeout: :infinity) end) end, timeout: :infinity) |> Stream.run end # def import(file) end
Here is the mix.exs file:
defmodule FastIoWithPostgrex.MixProject do use Mix.Project def project do [ app: :fast_io_with_postgrex, version: "0.1.0", elixir: "~> 1.7", start_permanent: Mix.env() == :prod, deps: deps() ] end # Run "mix help compile.app" to learn about applications. def application do [ extra_applications: [:logger, :poolboy, :connection] ] end # Run "mix help deps" to learn about dependencies. defp deps do [ # {:dep_from_hexpm, "~> 0.3.0"}, # {:dep_from_git, git: "", tag: "0.1.0"}, {:postgrex, "~>0.14.1"}, {:poolboy, "~>1.5.1"} ] end end
Here is the config/config.exs file:
# This file is responsible for configuring your application # and its dependencies with the aid of the Mix.Config module. use Mix.Config config :fast_io_with_postgrex, :postgrex, database: "ASDDataAnalytics-DEV", username: "XXXX", password: "XXXX", name: :pg, pool: DBConnection.Poolboy, pool_size: 4 # This configuration is loaded before any dependency and is restricted # to this project. If another project depends on this project, this # file won't be loaded nor affect the parent project. For this reason, # if you want to provide default values for your application for # 3rd-party users, it should be done in your "mix.exs" file. # You can configure your application as: # # config :fast_io_with_postgrex, key: :value # # and access this configuration in your application as: # # Application.get_env(:fast_io_with_postgrex, :key) # # You can also configure a 3rd-party app: # # config :logger, level: :info # # It is also possible to import configuration files, relative to this # directory. For example, you can emulate configuration per environment # by uncommenting the line below and defining dev.exs, test.exs and such. # Configuration from the imported file will override the ones defined # here (which is why it is important to import them last). # # import_config "#{Mix.env()}.exs"
Any assistance with finding the cause of this error would be greatly appreciated! | http://quabr.com/52361661/ecto-inheriting-nested-associations | CC-MAIN-2019-04 | refinedweb | 2,744 | 50.84 |
J u l y /A ug ust 2 0 1 1 • V o l 26 • No 7
In This Issue
PAGE
Capturing Culture:
4
Managing Inflation By Ian Cruz
In
a city renowned for business and
government and the arts industry in their
W ith a view to tur ning Hong Kong into
finance, the subject of arts and culture has
approach towards reigniting the art-scene
a metropolis of international culture and
long been a point of contention in Hong
in Hong Kong.
changing people’s perception of Hong Kong as a finance-focused city, the ambitious
Kong, almost as if a rich involvement in art
PAGE
8
and culture might somehow get in the way
Though the number of homegrown artists
d e s i g n f o r t h e We s t K o w l o o n C u l t u r a l
of the business machine which helps drive
may have been bolstered in recent years,
District (WKCD) is the jewel in the crown
the Asian economy.
artists have found that their expanding
of the Hong Kong government’s strategic
community is being hindered by regulations
promotion of art and culture. The plan is to
Still, there is no question that Hong Kong’s
and lack of capacity. This has mainly been
build an integrated art and culture district
art and culture scene has been on the
attributed to the lack of sufficient options
with world-class facilities, which will feature
rise again in the last few years. Institutions
for space and venues in which the city’s
distinguished talent, iconic architecture
around town, such as the Arts Centre
art, cultural and creative industries can
and will embrace new technologies, new
and the Academy of Performing Arts have
further expand. With expensive land costs
applications of IT, and numerous sustainable
continued to champion arts and culture,
and rising rents to contend with, artists
features. The West Kowloon Cultural District
b o t h t h ro u g h e d u c a t i o n a s w e l l a s i n
are finding it hard to maintain a space to
Authority (WKCDA) was given 40 hectares of
performances and exhibitions. From plays
work, and therefore these industries often
land, where they will build 15 core arts and
and musicals, to operas and symphonies,
lack a solid foundation for growth at the
cultural facilities, including a contemporary
both local and international artists and
grassroots level.
art museum, a mega-performance venue,
UK Property
PAGE
12
Annual Ball
concert halls and theatres, as well as
performers are re-emerging. Meanwhile, art galleries have popped up in every corner of
Partly as a means to try to help artists,
facilities which will provide a framework to
Hong Kong, while our local art fair ART HK
the government enacted new industrial
groom and educate local artists and provide
at the HKCEC has grown to become one of
building policies, introduced during
the best possible environment for them to
the most lauded amongst art aficionados,
its 2009 policy address, outlining
learn and grow.
with this year’s event showcasing works of
tax incentives for building owners to
260 galleries from 38 countries, and more
convert industrial properties for high-
Recently speaking to British Chamber
than 1000 artists, drawing in a record crowd
end commercial use. As it happened, the
members at the Hong Kong Club, Dr
of over 63,000 art collectors and enthusiasts
policy drove up rent in industrial buildings,
M a n Wa i C h a n , E x e c u t i v e D i re c t o r o f
from around the world.
effectively compromising the operations
Project Delivery at the WKCDA provided
of local artists and musicians who had
members with an update on the project’s
However, while there may be strong support
enjoyed the relatively low rent in various
progress. Despite the lengthy planning
for arts and culture on the surface, there
industrial spaces throughout the outskirts
processes that have been put into the
is still a certain skepticism towards the
of the city. As a result, the measure has
WKCD so far, the project is still very much
arts and culture community from one very
actually been counter-productive for Hong
in the early stages, with the WKCDA
crucial element – the artists themselves.
Kong’s art and culture industries, and has
having decided to move forward using the
Plus
The city’s lifeblood of local talent commonly
presented the creative community with
concept design from renowned architect
• News / New Appointments • New Members • Shaken Not Stirred
complains of a disconnect between the
new obstacles.
Norman Foster. The Foster team is now
PAGE
18
Lifestyle
(Continued on page 2)
COVER STORY (Continued from cover)
modifying the concept plan following the second round of public engagement which
for the venues’ design and
took place in August last year. Currently, the WKCDA are still in the process of finalising
building process. It has also
its Procurement Strategy for the venues and infrastructures – a crucial step due to
been decided that at least
the complicated nature of the project. Meanwhile, the Concept Planner (Foster +
three of the WKCD’s iconic
Partners) and Project Consultant, Mott MacDonald are assisting with the Development
buildings will be subject to
Plan process. However, the WKCDA has yet to finalise the appointment of Design
an international architecture
Consultants for the buildings.
competition which will e n s u re t h a t t h e d i s t r i c t ’s
Given the grand scale of this infrastructure project, the WKCD will eventually take up
architecture will be of world-
a considerable portion of the West Kowloon District. As the district’s focal point, the
class standard.
consultations with the general public have not just given the WKCDA a clear indication of what they want to see in terms of art and culture, but also the kind of environment
The construction process is
they want the WKCD to provide. It was evident that the public did not just want an
currently predicted to start
arts-and-culture hub, but also a place for the general public to enjoy and spend time
in 2013 and will be opened
in. Apart from the retail, dining and entertainment facilities within the district, the
in phases to ensure that all
WKCDA will also be setting aside a minimum of 23 hectares of open space out of the
venues will be fully functional
40 hectares of land being used, much of which will feature green spaces that take
and utilised during the initial
advantage of the surrounding waterfront view. With a strong emphasis on international
opening in 2015. Although
cultural exchange, transport access to the district will be convenient from other areas
the first phase of the WKCD
of Hong Kong, and the new Express Rail Link will provide an easy and direct route to
is years away, and the construction has yet to begin, the WKCDA will soon begin
China as well.
to build the framework of promoting art and culture by holding interim programmes of outdoor activities and events, such as staging the Hong Kong International Jazz
Moving forward, the chosen WKCD Project Consultant will be completing and finalising
Festival, Cantonese operas, and exhibitions, all of which will give people a taste of
the development plan by the end of the year, followed by the third and final public
what the future WKCD will have to offer. In the next 20 years, the WKCD hopes to set
engagement exercise, and finally a submission to the Town Planning Board. The process
the tone, and be the focal point for arts, culture and the creative industries in Asia.
of town planning is especially crucial as it can be considerably lengthy, and major
How the people of Hong Kong, and the international arts and culture community
construction work cannot begin before the approval of the land grant. At the same time,
at large will respond to the end result remains to be seen. But no doubt artists and
the Project Consultant will also be helping the WKCDA on their functional brief and
the public alike will have their eyes firmly on West Kowloon when the WKCD opens
schedule of accommodation for the core art and cultural buildings, which will be essential
in 2015.
The Magazine of the British Chamber of Commerce in Hong Kong
CHAIRMAN’S MESSAGE
Editors
With the summer upon us, I am sure most of us are away on holidays, enjoying a well earned break and more importantly, spending
Ian Cruz Sam Powney
quality time with the family.
Design
For those who attended the annual Britcham ball, I can sum it up with the UK (1975) hit single - Oh, What a Night! Themed as ‘We Will
Bill Mo Alan Wong Ken Ng
Rock You’, we were all transported back to the Rock ‘n Roll era as we toasted to the good times for businesses in Hong Kong and
Advertising Contact
members and supporters for their continued support, and to express a special word of appreciation to the team at Britcham who put
Charles Zimmerman
a successful year ahead. The ball was yet again the best evening in town. I would like to use this opportunity to thank our sponsors,
together such fantastic events and who are truly the ‘engine’ of the British Chamber in Hong Kong.
Project Management Vincent Foe The Greek debt crisis has spread wider and as I write this article, Italy is coming under tremendous pressure with the cost of borrowing
starting to raise major concerns in Europe. The economic challenges Europe faces should not be underestimated, and with US debt continuing to grow without a strong, agreed-upon fiscal plan, the global economy continues to be under pressure. Such developments place the spotlight of expectation firmly upon Asia to continue providing strong economic momentum. As investment continues to flow into Asia and into Hong Kong from China, sustaining high growth, it also raises concerns about asset price inflation, especially in residential property markets, where values in some markets including Hong Kong have soared since the beginning of 2009. While the Asia story remains strong, we have to remain cautious about inflationary pressures.
As you know, one of the challenges that we have long highlighted is the almost impossible task of getting children into quality primary schools in Hong Kong. I am delighted that this has now become a firm fixture on the political agenda. With cross-chamber collaboration between the Italian, American, Canadian Chambers, our own Chamber, and the international business community,
British Chamber of Commerce Secretariat Executive Director CJA Hammerbeck CB, CBE
General Manager Cynthia Wang
Marketing and Communications Manager Emily Ferrary
the government has now accepted we have a problem impacting business and investment on Hong Kong Island. However, the government feels that we do not have a primary school issue in Kowloon and the New Territories regarding high-quality Englishbased education. This is not correct, and we will continue to supply our collected facts and figures on the subject independently. The most concerning issue is that in some cases, local state schools are struggling to fill their places whilst international schools at the primary level are completely full. It is surely not beyond reasonable expectation for the government, with the support of the business community, to allow more school accommodation to be made available to the international schools in order to satisfy demand, or to involve the local schools in creating a quality, shared, international-based education system with an international curriculum environment. We will not let this subject drop, and we are making progress.
Special Events Manager Becky Roberts
The brand new Baker Tilly Hong Kong Business Angels website has now been launched; this wonderfully successful programme has
Events Assistant
grown fantastically over the past four years, giving more entrepreneurs the opportunity to pitch their business plans to angel investors
Mandy Cheng
Business Development Manager Dovenia Chow
Membership Executive
and move their business to the next stage. Please do help spread the good word about this dedicated website and encourage both startup companies and investors to register at angel.britcham.com.
Lucy Jenkins
In chamber news and events, Britcham and the Irish Chamber of Commerce of Hong Kong are together celebrating the recent historic
Accountant
visit of Queen Elizabeth II to Ireland. This is in memory of Ireland and Britain’s war dead and in honour of the Queen’s visit marking the
Michelle Cheung
culmination of the peace process and a new era in the relationship between our two countries. This can only be positive.
Executive Assistant Jessie Yip
Finally, do have a great holiday, enjoy your break and we’ll see you soon.
Secretary Yammie Yuen
Happy Holidays!.
MANAGING INFLATION . . . . . . . . . . . . . . . . . . . . . . . . 4 CHINA AUTOMOTIVE INDUSTRY . . . . . . . . . . . . . . . . 5 UK TAXES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 BUSINESS ANGEL PROGRAMME. . . . . . . . . . . . . . . . 7 PROPERTY INVESTMENT . . . . . . . . . . . . . . . . . . . . . . 8 ENVIRONMENTAL CHALLENGES . . . . . . . . . . . . . . . 10 ANNUAL BALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
INTERNATIONAL SCHOOLING . . . . . . . . . . . . . . . . . TADA! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . THE WESTMINSTER TERRACE. . . . . . . . . . . . . . . . . VIEWPOINT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . NEWS AND NEW APPOINTMENTS . . . . . . . . . . . . . . NEW MEMBERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SHAKEN NOT STIRRED . . . . . . . . . . . . . . . . . . . . . . .
15 17 18 20 21 22 23
BUSINESS
inflation
Guarding against By Jason Powell, Sales Manager, ipac financial planning Hong Kong limited
Sky-rocketing
oil prices are fueling inflation and reducing people’s
disposable income. This is exacerbated in Hong Kong by rising costs of food imports and housing. The combined effect lifted Hong Kong’s Consumer Price Index to 4.6% in April 2011 over a year earlier, which is on average 3.1% higher than the preceding 12-month period*. If you do nothing, inflation will undermine your spending power and leave you with less money to spend. So how can you guard your assets and prevent inflation from jeopardising your long-term goals?
Review your budget An effective way to deal with inflation is to plan for it in your budget. While your income is most likely fixed, your expenses will vary and are more likely to increase than decrease. Review your budgets to ensure your savings plans and long-term goals are still on track. Make a monthly direct debit for your tax payment to a tax reserve account, and a second monthly debit for your savings to your investment plan. What you don’t see you don’t
economic cycle. Diversification across asset classes, as well as within each asset class
miss; instead you are forced to review what is left in your wallet and to cut back on
across different regions, is an important and effective inflation defense.
discretionary spending without putting your long-term goals in danger.
Means to an end Invest into Growth assets for long term
So review your budgets, set up your savings plans and invest in robust, well-diversified
Inflation makes it difficult to see what is happening to your family balance sheet. If
portfolios that focus on long-term performance. This is the best inflation defense and the
you have money invested in the bank at, say, 2 per cent per annum and inflation is
best attack. Regular portfolio reviews and strategy adjustments are also critical to ensure
running at 5 per cent per annum, your
your investment plan reflects changes in the market, as well as that in your life.
real wealth is actually reversing at 3 per cent per annum. In real terms $100 can
We know it’s tough to keep a balanced view of things around money in turbulent times
quickly become $97. This means your
and a financial guide with a compatible philosophy can help to keep you grounded,
investments are losing spending power,
even when the markets are not.
and that will ultimately mean you need to save more, work longer, or expect a less
Ultimately, combating inflation is just part of your journey to protect and grow your wealth
comfortable retirement lifestyle.
in order to achieve what you aim at in life. Remember smart money management and investing are a means to an end – and they mean little without linking them directly to how
Long term wealth is built through exposure
you want to lead your life.
to assets with real earnings power and strong growth potential. Equities are the best placed asset class to fill this role. The key is to invest in companies which
*Source: Consumer Price Indices for April 2011 (23 May 2011), The Census and Statistics
can continue to grow earnings and those
Department, HKSAR
less exposed to economic cycles. An investment climate characterised by rising
If you would like to discuss this article, or would like to learn more about ipac, please email
inflation presents a challenging environment
Jason.Powell@ipac.com.hk or visit
for investors, but it also presents new
Shop 7, G/F, Paramount Bldg., 12 Ka Yip Street, Chai Wan, Hong Kong.
4 cha m.c o m
o p p o r t u n i t i e s . N o t a l l c o u n t r i e s a re
The above information is of general advice only, which has not taken into account
experiencing the same levels of inflationary
the investment objectives, financial situation or particular needs of any person.
pressures. US interest rates are very low,
Before making an investment decision, you should speak to a financial planner
while Europe, Japan and developing
to consider whether this information is appropriate to your needs, objectives
markets are all at different stages in the
and circumstances.
BUSINESS
Automobiles ‘Made in China’ or ‘Made by China’ By Daniel Lin, Managing Partner, Grant Thornton Jingdu Tianhua
2009
was an important year for the China automotive industry. This was the year
leading the way and also hopes to see the
that China exceeded the United States and Japan in becoming the top car manufacturer
cost of producing batteries reduced by half
by production volume. 2010 saw China produce just under 14 million units, a 33% increase
by 2015.
from 2009 and therefore consolidating its position as the world’s largest automotive manufacturer. Into 2011, China’s position in the automotive market remains strong and this
With this drive to move up the value chain
is unlikely to change for the foreseeable future.
and with M&A activity being encouraged, we have already seen the big local car
As well as being the largest manufacturer, China is recognised as the largest automotive
manufacturers acquire famous European
market in the world, given the size of the population where only one in five owns a car.
brands and parts manufactures. By
The forecast is that by 2015, the demand for cars in China will reach 25 – 30 million units.
acquiring overseas brands and know-how, it
Foreign car manufacturers are therefore naturally drawn to such an exciting market where
allows the benefits of learning how the ever
the number of potential consumers is staggering.
popular western market automobiles are made without having to surrender domestic
Foreign brands currently hold approximately 85% of the Chinese market and in the recently
market share.
announced 12th Five-Year Plan of the People’s Republic of China (12.5 plan), one of the key goals is to see market share for domestic brands reach 50% by 2015 and for exports
Indeed, after acquiring a foreign manufacturer, besides obtaining the brand, you will
to reach 10%. The 12.5 plan also emphasises the need for Mergers and Acquisitions (M&A)
have access to their technology, R&D, management know-how, distribution channel and
to consolidate the industry and, in fact, many people believe that M&A activity is the key to
supply chain which can take many years of development to acquire. The affiliation with
achieving the main goals of the 12.5 plan.
a high end brand would also send a strong message to the market place regarding your own brand. The acquisition of Jaguar Land Rover by Tata of India, for example, saw
To date, we have seen numerous partnerships develop, where large Chinese car
people’s perception of Tata change. Another example would be Skoda cars, where the
manufacturers are cooperating with foreign brands. These partnerships allow foreign brands
brand was considered to be at the low end of the market in the 90s, but since joining
to gain access to the Chinese market due to the 50% ownership of a domestic entity
the VW group, a Skoda Octavia is well-known to be a variation of an Audi A3 or a
restriction, whilst the domestic manufacturer can learn what makes a foreign automobile so
Volkswagen Golf.
desirable to the Chinese and Western consumer. Besides foreign M&A activity, the Chinese government is keen to consolidate the domestic The direction for the next five years is to
market and reduce the number of manufacturers. There are currently more than 50, but
move the Chinese automotive industry up
15 is seen as a more appropriate number. Manufacturers in China may therefore look at
the value chain and for China to become
sharing knowledge and merging. By working together, the domestic players will have an
leaders in the green energy vehicle sector.
increasingly significant role in the global market.
The 12.5 plan includes objectives and funding for the sector to develop a new
Although the 12.5 plan is keen for M&A activity, it is also cautious of merging for the sake of
energy car where one million units could be
merging. It is important that the merger is of commercial sense and is well executed in order
produced by 2015. With over urbanisation
to be successful.
and cities like Shanghai restricting the number of non-electric car registrations,
Most people will know what the famous foreign brands are, but the challenge is: how
going green is high on the agenda and is
do you know who is for sale and whether your target company can fit in with your
perhaps the golden prize of the automotive
portfolio? How will you structure post-acquisition in order to retain talent and know-
industry.
how? Tax planning? How will you merge culture and experience? It is important to engage with local automotive M&A specialists who know the lay of the land and can
We saw a number of new hybrid and energy
assist you in your expansion.
vehicles being revealed at the recent Shanghai Motor Show, where the intention is for some
M&A indeed may not be the only solution. Manufacturers could consider forming local
of these models to go into production. The
partnerships to share intellectual property (IP) and know-how. In the past, we have seen
ultimate desire, however, is to develop a
alliances such as Nissan with Renault and Rover with Honda, where knowledge has been
workable pure fossil fuel-free automobile
shared. Chinese companies may also form such alliances in future with mutual respect and
which will require significant battery
common objectives. With Chinese technology consistently improving and with the drive to
development time. Indeed, the government
develop a new breed of automobiles, we may indeed see a shift of the domestic and global
expects to see three to five major enterprises
automotive market place within this decade.
July/August 2011 • Vol 26 • No 7
5
BUSINESS
A statutory definition of UK tax residency By Katie Graves, Partner, and Philip Munro, Associate, Withers Hong Kong “…the residence rules are vague, complicated and perceived to be subjective. In certain circumstances it is not possible for a person to be sure whether they are tax resident in the UK or to know what activities or circumstances would make them tax resident. ….”
With
Using these factors, a sliding scale is then set out for each of the ‘Arrivers’ and ‘Leavers’ dictating when they will be resident, based on their day counts and the number of factors that they meet. By using these tests, individuals will be able to determine when they will be resident. The government’s hope is that this “will allow individuals to assess their residence status simply and without the need to resort to specialist advice.” While the consultation is refreshingly light in terms of anticipating abuses, there is a proposal to extend the temporary
these words the UK Treasury launched, on 17 June 2011, its consultation on
non-resident rules. These currently tax capital gains and offshore income gains made by
a new statutory test of what constitutes tax residency in the UK. The new test is designed
an individual who is non-resident for less than five tax years on their return (where such an
to provide certainty for taxpayers in assessing their residency treatment. While this certainty
individual was resident in the UK in four out of the seven years before leaving). It is proposed
will be welcomed given the unsatisfactorily vague nature of the current UK tests of tax
that they should be extended to some types of investment income; dividends from close
residency, it does come at a price and some of the permissiveness of the current regime will
companies are mentioned, while bank interest and dividends from listed companies are
be lost. The new rules are intended to be introduced with effect from 6 April 2012.
excluded. It would seem likely that profits from insurance policies may also be caught by this rule when enacted.
For the purposes of the new test a distinction is to be made between three classes of taxpayer: 1. ‘Arrivers’ – individuals who have not been resident in all of the previous three tax years; 2. ‘Leavers’ – individuals who have been resident in one or more of the previous three tax years; and 3. ‘Full time workers abroad’ – individuals who leave the UK to work abroad. Full time workers are classified as those who work aboard for at least a tax year, who do a 35 hour working week and spend less than 20 days working in the UK. Each class will have its own set of rules and ‘safe-harbours’ – clear guidelines that confirm when individuals will not be regarded as UK resident. This contrasts with the current position where it is not possible to say definitively that even an individual who does not step foot in the UK during a tax year is not UK resident. While these rules are clear (for the most part) they cannot always be described as generous. The rules are still based on a day count and will take the existing “presence at midnight” test as to whether an individual was present in the UK on a particular day. For each class of individual there is then a safe harbour day count, within which an individual will not be treated as resident.
Arrivers
Fewer than 45 days in the UK
Leavers
Fewer than 10 days in the UK
Full time workers abroad
Fewer than 90 days in the UK (up to 20 working days)
For those seeking to establish residency in the UK there are two factors that will show UK residency conclusively: 1. being resident in the UK for 183 days or more in one tax year; and 2. having your only home (or homes) in the UK. Between these safe harbours, there is a sliding day count scale for ‘Arrivers’ and ‘Leavers’ that sets out when individuals falling within those categories will be treated as resident. In contrast to the current position, where all the facts of an individual’s life are relevant (from homes to shotgun certificates and parking permits), only five defined factors are relevant: 1. Whether your family is UK resident 2. Whether you have ‘substantial’ employment in the UK 3. Whether you have ‘accessible’ accommodation in the UK 4. Whether you have been resident for more than 90 days in the previous two years 5. Whether you spend more days in a single other country than you do in the UK
6 cha m.c o m
This article is provided for information only and cannot be relied on as tax advice.
BUSINESS
Angels Go Online New Website for the Baker Tilly Hong Kong Business Angel Programme 15 June, 2011 Kee Club
A
large gathering crowded the Kee Club on June 15th for the launch of a new
website for the Baker Tilly Hong Kong Business Angel Programme. With food and drinks generously provided by Baker Tilly Hong Kong, the evening was indicative of the great interest the programme has generated in a city often criticised for its lack of new investment opportunities. Launched in 2007, the Baker Tilly Hong Kong Business Angel Programme committee has reviewed hundreds of enterprises looking for initial or growth investment, and has put many in touch with investors from the British Chamber of Commerce. This is the first such programme to be launched by a chamber of commerce in Hong Kong. In reaction to its tremendous appeal, Baker Tilly Hong Kong and the British Chamber of Commerce have been working to improve the programme by building a new website with the capabilities needed to handle the growing number of applicants and Angel investors. In mid June, this came to fruition with angel.britcham.com, a new website setting out the programme’s aims and mechanisms and providing an attractive, easy-to-use online registry for investors and enterprises seeking investment. “This takes, in my view, an already excellent programme to the next level,” said Andrew Ross, Managing Director of Baker Tilly Hong Kong. The new website provides separate pages for business Angels to see the benefits and to register, and for entrepreneurs to fill in their details and upload their business plan. Angels can see a full list of vetted businesses looking for investment for only HK$5,000 per annum. If entrepreneurs receive approval of their business plans by the committee, they can simply wait for interested investors to get in touch. Of course, they may also be invited to present their plan in front of assembled Angels at the regular and muchanticipated Baker Tilly Hong Kong Business Angel Programme breakfast events, the next of which will be taking place at the end of September. This remains the greatest opportunity for entrepreneurs to share their ideas face to face with interested investors.
Take your business to new heights
For more information about the Baker Tilly Hong Kong Business Angel Programme and the next event, which is taking place at the end of September, please visit the website angel.britcham.com or contact: emily@britcham.com.
Baker Tilly Hong Kong Business Angel Programme Calling all Start Ups If you have a great idea, or have started a new business and are looking to grow, the Chamber would like to help. The Baker Tilly Hong Kong Business Angel Programme is run by the British Chamber of Commerce to bring entrepreneurs and investors together to create exciting new partnerships. This programme gives entrepreneurs with new business ventures, or SMEs looking for funding to expand, the opportunity to present their business plan to potential investors (known as Angels). Shortlisted applicants will be given advice and assistance by a sub-committee of experienced professionals. Applicants, who do not need to be members of the British Chamber of Commerce, should be seeking to raise between USD100,000 to USD2,000,000. The deadline for applications for the next event is Friday 2nd September 2011. If you’re an entrepreneur or SME looking for investment, and would like to find out more about this programme, please visit our website angel.britcham.com or email emily@britcham.com
July/August 2011 • Vol 26 • No 7
7
BUSINESS
Top Tips on UK Property Investment for Overseas Investors By Ian Clark, MD of Midas Estates
With
more overseas banks such as The Bank of
China coming into the market, there is a massive opportunity
Top Tips on Property Investment
in the UK for overseas investors and expats. One area of
1. Be duly diligent and carry out as much research as
the UK that has huge potential is Cornwall. Here, locals find
possible.
it difficult to buy property in their area as wages are much
2. Location, location, location.
lower in this part of the UK, but overseas investors have
3. Remember that this is an investment. You’re not
realised the huge potential in the area and are making the
looking for a home that you would like to live in
most of the opportunities.
yourself. 4. Always go for growth if possible so you can refinance and buy again to keep building your portfolio. 5. Don’t buy anything smaller than 450 square feet. 6. Get to know the area you’re looking to buy in - visit the shops, pubs and restaurants and speak to the locals. Ask them if it’s safe at night and rent, repairs or an increase in mortgage rates and will let you ride out any storm. 9. Research rental properties within the area and take £100 off to make sure you get it spot on. 10. You should not buy your first buy-to-let investment if you are not prepared to give it 5 to 10 years.
So why the UK? With over 500,000 inhabitants moving to the UK every year, housing is very much in demand. After all we are only a relatively small island and we’re running out of space. Ignore the negative press; if you invest and sit tight on your portfolio, it will always do well. Ian Clark, MD of Midas Estates comments: “Think back to the first house you bought and what it would be worth now. Mine was £19k and is now worth £250k. There is no way that I could have made that kind of money from any other kind of investment. Never panic and don’t sell prematurely, that’s how the rich get richer and the poor get poorer.” •
The UK has fantastic opportunities within the student market and student rentals are very much in demand - year upon year this market expands allowing student landlords the chance to profit. Key areas in the UK for this type of investment are Bristol, Swindon, Reading and Cardiff.
•
London will never stop growing, even in a recession properties here are sound investments.
•
Coastal locations remain popular and landlords can expect to achieve £1,000-£3,000 a week nearly all year round.
8 rit c h a m .c o m
For more information, please visit
ENVIRONMENT
Environmentality
TM
By Fiona Donnelly
On
Thursday 16 June, if any of your colleagues said they were off to Hong Kong
Disneyland (HKDL) for a business trip, you might have been wrong to doubt them! Thanks to the Chamber’s Environment Committee, 22 participants enjoyed an afternoon in the Magic Kingdom, learning about the environmental measures and plans that Mickey and the cast members (ie. their staff) live by. Starting in the Sleeping Beauty conference room of the Hong Kong Disneyland Hotel, Tina Chow, Manager for Environmental Affairs and her team gave a very thought-provoking overview of the business and the environmental challenges it faces. There are so many aspects to operations – the hotel, theme park, F&B outlets, shops, vehicles etc – but also sourcing, waste management, indoors, outdoors and more. You could virtually hear the visitors (or guests in HKDL speak) contemplating the different ways the resort can achieve its ‘3 R principle’ (reduce, reuse, recycle) and meet its goals to reduce electricity consumption, cut green house gas emissions and send less waste to landfill.
On to Inspiration Lake Our tour took us through one kitchen, housing a rainbow of recycle bins – and that was just
Around the corner we had a briefing on the lawn
one of eleven central collection depots for waste. With simple instructions on what was to
where we learned about some of the key aspects
be disposed of where, cast members were busy matching ‘rubbish’ to bin – it was very clear
of the irrigation system, the landscaped areas of the
and simple waste separation, yet on an industrial scale. The less typical recyclable items
premises accounting for the lion’s share of the water
were particularly fascinating: empty glass bottles from wine etc are taken to Tuen Mun where
consumed. No doubt, starting from a greenfield site,
they are converted into bricks, and food waste and green waste are channeled off site into a
HKDL has had more chances than most to set things
machine where they are converted into compost – which is then used throughout the grounds.
up right – and in this infrastructural aspect they have seized the chance. Inspiration Lake is man-made and fills from channels in the surrounding hilly catchment area. HKDL meets 70% of its water needs through this rainfall capture. Furthermore, there are ‘smart’ sprinklers that keep the lawns croquet-ready. The electronic wizardry that controls the water fed to these areas record the rainfall, and switch on automatically only to the extent that the lawn has received a deficit in water supply naturally. No automatic timers, just water switched on when it is genuinely needed.
10 cha m.c o m
Jiminy Cricket, the rooms are fabulous too! We proceeded to a guest bedroom where we learned about more gadgetry. HKDL has adopted Energy Management Systems. In each hotel room this sensor activated system switches off lights – energy efficient compact fluorescent and LED light bulbs where possible – and air-conditioning when the room is empty. It can also calculate sunrise and sunset times every day and adjust the on and off times of lighting automatically. HKDL has enjoyed electricity consumption reductions through this system alone. The character we saw the most during our visit was Jiminy Cricket, the emblem chosen by Disney as the internal logo for their ‘environmental mentality’, or EnvironmentalityTM as they call it. The Jiminy character, as the conscience of Pinocchio in the movie of the same name, is an apt reminder to all cast members that every little bit makes a big difference, another mantra of the company.
Calling all cast members! In learning about HKDL’s steps to incorporate reusable cutlery and glasses in all of the park’s dining outlets, to roll out more solar lights, use more green vehicles and solar club cars and much more, what was very clear was the process of getting ALL cast members involved. At local site level, various steering committees combining cast members from different business sectors throughout the organisation meet regularly, track progress against goals, monitor technologies and keep developing Environmentality TM. Mixing up the teams and involving everyone resulted in one particularly simple yet ingenuous solution to a problem. Hotel Engineering Services have to change the batteries in safes before they run out, so guests don’t get their goods stuck in the safe, but rather than waste these not wholly used batteries, they are now passed to the Merchandise team, who use them for the toys that are used for demos. Mixing up teams, another waste to energy idea is discovered. HKDL are very conscious of their plans to grow but do so living by their EnvironmentalityTM ethos. They are founding members of Hong Kong Green Purchasing Charter, Gold Award winners in the hotels, Restaurant and Catering Companies at the inaugural 2008 and 2011 Hong Kong Awards for Environmental Excellence, but these are very much rosettes for what they want to do. Programmes like Earth Days, Tree Care and Nature Walks are part of their attempt to inspire children, parents, employees and communities to make a lasting, positive change to the world and their total commitment to living with EnvironmentalityTM. As the great man Walt Disney said himself in 1950, “conservation isn’t just the business of a few people. It's a matter that concerns all of us.” It’s good to remember Jiminy’s anthem: Always let your conscience be your guide.
For more information on HKDL’s environmental work, visit: environment July/August 2011 • Vol 26 • No 7
11
EVENTS
Thank
you to everyone who joined us and rocked out at
the Grand Hyatt on Friday 24th June for the Standard Chartered Bank and The British Chamber of Commerce Annual Ball. Inspired by the theme, guests donned their best rock star outfits and enjoyed a riot of rocking entertainment in a ballroom decked out in glitter balls, slash curtains and ballroom glitz! Guests were welcomed with themed cocktails, before indulging in a spectacular five star rock concert menu. Highlights included an Iced Tomato Martini served with Scallop Tartar, a Grilled Wagyu Rock Burger, and Jim Beam Chocolate Pralines. Guests were able to sample some fine British real ales with their meal – kindly sponsored by mybrewerytap.com. After dinner whisky was kindly provided by Glenmorangie. A night of non-stop entertainment started with guests being ‘met’ on arrival by Freddie Mercury, courtesy of Madame Tussauds who provided one of their world famous waxworks for the occasion. The crowd went wild for the highlight of the evening’s show – live performances from two very special acts flown in from the UK by Virgin Atlantic Airways, who kept the dance-floor full with their tributes to Tina Turner and Freddie Mercury. The British Chamber chose the KELY Support Group as the designated Charity for the Ball, and through various fundraising activities, raised over HK$525,000. Prizes in the Live Auction were generously donated by Chamber members and luxury British brands and included: a studded clutch donated by legendary British handbag designer Lulu Guinness, a pair of gemstone earrings from Melville Fine Jewellery and Bridges Tsavorite, a rock star retreat in glamorous Bali donated by Aman Resorts and Garuda Airlines, a night in the Rock Star Suite at the Hard Rock Hotel at City of Dreams, Macau, and a stunning limited edition print of the famous Beatles Sergeant Pepper album cover signed by the artist and ‘godfather of British pop art,’ Sir Peter Blake. All guests at the Ball took home a great gift bag with prizes kindly donated by Chamber members, including: Elemis skincare products, a mug from Jaguar, gifts from British fashion brand Accessorize, BBC Worldwide DVD’s and books, an Alessi napkin holder from Colourliving, a TaDa! ‘We Will Rock You’ gift experience, and a gift from Jaguar. A huge thank you to all those who sponsored the event, which really would not be possible without the support of our members.
12 cha m.c o m
You can see more photos of the Ball on the Chamber’s website: If you would like copies of any of these photos, please contact: Mandy@britcham.com July/August 2011 • Vol 26 • No 7
13
EVENTS With thanks to our sponsors: ––––––––––––––––––––––––––––––––––––––– Title Sponsor ––––––––––––––––––––––––––––––––––––––––
––––––––––––––––––––––––––––––––––––––– Gold Sponsors ––––––––––––––––––––––––––––––––––––––––
––––––––––––––––––––––––––––––––––––––– Silver Sponsors ––––––––––––––––––––––––––––––––––––––––
––––––––––––––––––––––––––––––––––––––– Other Sponsors and Supporters ––––––––––––––––––––––––––––––––––––––––
––––––– Many thanks to the following companies who donated prizes for the Annual Ball 2011 –––––––
LIFESTYLE
Drumming By Hilary Thomas
Set
Experience
up last year, TaDa! are taking the gift world by storm
with their eye-catching and creative gifts. In Asia, where gift giving is a must in corporate culture, it’s often difficult to know what to buy. TaDa! make it easy. Packaged up in fun, bright boxes, the gift set is beautifully presented making the ‘unwrapping’ part of the experience. The gift packages come in a variety of different options including Zen, Life, Delicious, Excite, Escape and Ultimate. Each box has sixteen options to choose from so your gift is sure not to disappoint even the fussiest of clients. However, what I liked most about TaDa! gift experiences was not the concept, but the content. The TaDa! team are not ones for gender stereotyping. For women, the options aren’t all facials and shopping. Obviously the Britcham team are into more than that… promise! We were given a Life box by the lovely team at TaDa! and with a wealth of diverse and creative options from which to choose – Henna body painting, boxing, painting, and Japanese flower arranging, to name but a few – we were overwhelmed with choice. After much discussion, we opted for Batucada – a Brazilian drumming experience in the small Pelourinho Brazilian Cultural Centre in Sheung Wan. TaDa! make it very easy – one phone call to their concierge with our preferred dates, an email confirmation and we were good to go. Given that the Britcham team’s only previous musical performance took place in a karaoke room in Kowloon, it was with some trepidation that our rhythmically challenged group made the trip to Des Voeux Road West. On arrival we were met by our host William, an enthusiastic drumming guru in a small studio absolutely bursting with fascinating percussion instruments, many that we’d never seen before. William was patient and good-humoured, both traits that were needed for working with our group! He introduced us to the world of Brazilian beats and started us off on the relatively simple shaker. Easy enough you might think until we were promoted from that to the frenzied world of the full Batucada set including large drums, snare, tambourine and, at one point, coconuts. The journey through the different Brazilian music was fascinating and, with each of us given a separate rhythm, the drumming session was both a real test of concentration and nerve and also a great team-building exercise. Only by working together and LISTENING could we produce anything resembling proper percussion music and, by the end of the hour long introductory session, we were all pretty pleased with ourselves. The best part of all was that by the end of it the stress of the working week had completely faded away. Of course, we had to celebrate that with a Friday night drink. For more information on TaDa! original gift experiences, please visit
July/August 2011 • Vol 26 • No 7
17
LIFESTYLE
Redefining Luxury By Sam Powney
Grosvenor and Asia Standard International’s new development The Westminster Terrace at Approach Bay aims to redefine extravagant living in Hong Kong, offering new benchmarks for space and sweeping views of the surrounding bay. Sam Powney spent the day at the new development to discover its intriguing designs, and how it offers the luxury of both seclusion and accessibility.
It’s really too tempting to imagine living here. For a start, I arrived by taxi from Hong Kong Central in only fifteen minutes. You drive straight off the main highway into a quiet, leafy road and up to the imposing building itself. The entrance itself is in shade; overhung, as I later discover, by the jutting projection of the club-house. Hard to believe that the city is so close by. In fact, The Westminster Terrace is framed by a pristine backdrop of wooded hills. It’s only when you get inside the building and look back across the water towards Tsing Yi and the city that you become aware that this really is the gateway to the city. It must be a reassuring feeling to arrive here after a long day at work. The lobby is designed entirely in marble and is inhabited by just one, eminently capable receptionist. To add to this discretion, the elevators can only be activated by card-carrying residents. I head up towards a suite designed by acclaimed designer Ikebuchi-san, who also designed the residence’s public areas, and in a few seconds the lift doors open – straight into the apartment itself. Ikebuchi-san’s work is delightfully understated, a truly delicate and thoughtful use of space. Moving around the apartment, every inch of every room seems full of natural light. On the wall hangs a subtle, smoky modern painting of a wood scene, complimenting a thin gold leaf panel near the entrance - the kind of detail one is often aware of only subconsciously. All this comes as a welcome relief from the ostentatious and miscalculated displays of luxury so common in downtown Hong Kong. It must be a great relief to come back to this refuge, and to watch the boats making their way across the water from the quiet of the dining room table. The furnishings too are elegantly simple. Ikebuchi’s bathrooms are walled entirely in a light marble which strings the light out across its skeins. Yet the wash-sink, the shower, the mirror and the cupboards are all very practical and immediately obvious, with none of the irritating ‘little tricks’ and decorations that have crept into bathroom styles in recent decades. The main bathroom does have one major surprise though, before you ever reach it in fact: from the master bedroom its sliding doors masquerade as one of the cupboards. It would be perfect for having friends to stay. The guest bedroom is amply sized, simple, but extremely comfortable. Throughout the rooms of this suite, oak floor boards and window sills contribute to the overall feel of orderly comfort, yet once again this aspect is easy to overlook. Rather than stand out with polished grains or patterns, the wood’s soft, dark hue allows one to focus exclusively on the bright space above. Adding to this almost dreamy effect is the matching oak window sill which juts out just enough that the guest can use it as a very admirable desk. Perhaps the most wonderful aspects of the Ikebuchi suite however, were the wonderful views out over Approach Bay and the Ting Kau Bridge, including one spectacular vista…from the bathtub!
18 cha m.c o m
Tara Bernerd is a young British designer whose design has a charm of its own. Her style is more overt than Ikebuchi’s but also draws the eye straight out across the harbour by opening up the kitchen/dining room with a sizeable balcony, perfect for relaxing with friends or family. Hers also has a more contemporary feel, with built-in plasma screens and a small but funlooking music system. Despite the modern, cutting edge look, taking all the aspects together I detected an atmosphere very conducive to young families especially. The kitchen, is one place in which one can immediately visualise the ease of living in Suite 2. Though apparently compact, the kitchen includes all the modern gadgets one could hope for, and manages to allow space for an eating area, complete with high stools for children. Winningly for adults and children alike, space has also been found for a classic, full-size brass telescope. Personally speaking, this is a great attraction – though I fear that spying on boats and bridges could easily take up most of my day.
The Club-House The club-house is another reservoir of sedate charm, with a spacious armchair lounge and two dining areas set back close to the entrance. This is the perfect place to entertain - there must be capacity for 40 or 50 people. A pair of enormous fibre-frame lamps dominate the high ceiling, but once again the eyes of the visitor are drawn outside. This time, it is not just to the harbour, but also to the garden and the set-piece pool. True to modern form, the water appears to flow over the pool sides into vertical space (I eventually spot a very discreet barrier beyond). The deliberately tropical garden, with its stone banks and terraces, allows one to meander around a surprising diversity of plant-life. Altogether, the club-house allows precisely the kind of versatility of space that makes for a great social event. In other words, after spending some time sipping cocktails in the marble-panelled main hall, relaxing by the pool and then chatting with friends on the vast sofas at the far end of the club-house, it still remains for one to go and play snooker in the billiards room! Bringing to bear all the background and talent of the world-famous Grosvenor and Asia Standard International, the designers of The Westminster Terrace have created a truly unique refuge in one of the most crowded cities in the world. It’s a great achievement, and a delightful experience.
For more information, please visit or call (+852) 2772 3889.
July/August 2011 • Vol 26 • No 7
19
MEMBERSHIP
Perspective
The British Chamber’s Sterling Members
Interview with Kevin Taylor, Managing Director, BT Asia Pacific
How’s business?
How long have you been in Hong Kong?
Business is developing nicely. We’re continuing to grow in the Asian
18 years.
region supporting both the multinational corporations investing in Asia Pacific and the emerging Asia based multinationals. We are investing another £78 million in adding to our product portfolio, expanding our professional services capability and adding another six hundred employees over the next couple of years. It’s a good sign. We currently employ about five thousand people in the region, and thirty thousand with our joint ventures. The investment provides us with more scale. Our customers continually want more in terms of network and associated services. Overall I’m very pleased with our current situation.
How do you spend your time outside the office? Firstly, with family. I particularly love coaching rugby on the weekends. That’s down at HKFC with the kids – including my nine-year old boy, James. This is part of my life where I enjoy giving something back. I also enjoy swimming and doing the usual weekend stuff with the family. You can usually catch me for a drink around town on Friday evenings with friends.
What is the secret of BT’s success? Our people. We have an incredibly strong multicultural population of employees, and we’re very focused on diversity. We also have a real focus on developing talent in our business.
What’s your favourite spot in Hong Kong? Driving down the Island Eastern Corridor towards Central, with the Yacht Club to your right and all of Central and Kowloon beyond. That’s an unbeatable view.
How do you ensure that? Our brand helps. That’s a strong attractor. We are also linked in with higher education, the foremost universities and the vocational training councils. We hire kids from both the top
A transitory moment then… It’s not a picnic spot. But it does provide a truly panoramic view of Hong Kong.
universities and those who haven’t had the best educational opportunities as well.
If you could save one building in Hong Kong from reclamation, which would it be?
What’s the most exciting business-related news you’ve heard recently?
I suppose that would be St. John’s Cathedral. It’s there in
Our latest Customer Survey report. I am always keen to ensure that our customer service continues to improve. Customers always come first in my book.
How does the British Chamber of Commerce add value to your business? In many ways, the Chamber has a positive influence within Hong Kong, ensuring that the framework for doing business here stays healthy. We are also an excellent entry point for
all the old photographs of Hong Kong, the one thing that has remained constant throughout the last hundred and fifty years. Forever and a day it will always be an important part of this city.
One thing you would change if it was up to you? I wouldn’t change anything. Of course there are issues you can mention, but basically I’m delighted to be here. Hong Kong is a wonderful international city.
organisations who want to invest in Hong Kong. We connect very closely to and represent British and Inter national business interests. It’s a great opportunity for networking and, more importantly, for our community to link together. We have a large number of committees – and those are o p e r a t i n g e x t re m e l y w e l l . I t ’s a s t ro n g c h a m b e r a n d I believe we are highly respected by the government. The
Thank you for your continued support 20 cha m.c o m
Chamber wants to continue to be of service to the broader international community. All this fits very well with BT’s aims and ethos.
One thing you’ve learnt recently that you didn’t know before? I’m always amazed by the number of people who have connections to Hong Kong. Last week I had lunch in London with John Ridding, the CEO of the Financial Times. I wasn’t aware before that John was previously a reporter here. Hong Kong is such an important hub for so many people.
NEWS / NEW APPOINTMENTS Foreign banks see growth opportunities in China despite continued challenges Findings revealed in the sixth PwC Foreign Banks in China survey show that despite an environment of increasing funding constraints, foreign banks operating in China are surprisingly confident about their prospects in the Chinese market, more so than ever. In fact, they expect revenue to continue to grow over the next three years. Their optimism stems from the continued opening up of the Chinese economy, and its transition towards a convertible currency. The high level of confidence belies the continued struggle of the foreign banks in trying to gain a foothold in China. The 127 foreign players operating in the country commanded only 1.83% of the Chinese banking market in 2010, a slight increase from 1.7% the year before. Notwithstanding this, the 42 foreign banks that participated in this year’s survey, made it very clear that their commitment to China remains resolute. As in the past three surveys, debt capital markets continue to be viewed as the area with greatest future opportunity, and despite concerns about the broader economy, the majority of foreign banks believe that corporate and consumer credit remains stable, as evidenced by the rise in luxury spending by Chinese consumers.
Record results for the mining industry According to a new report from PwC, Mine: The game has changed, revenues for the world’s 40
Her Majesty The Queen honours Hong Kong residents
largest miners leapt 32% to a record $435 billion, driven by surging commodity prices and a 5% increase in production output in 2010. The strong top-line result catapulted the miners’ net profits
The Queen honoured Hong Kong residents, Dr John Edward Wenham Meredith and Mrs Wai
to an impressive $110 billion – a 156% increase over the previous year. To keep up with demand,
Lan Linda Yau, in the recently announced Birthday Honours List 2011. Dr John Meredith,
the top 40 have announced more than $300 billion of capital programs, of which more than $120
Group Managing Director, Hutchison Ports Holdings, Hong Kong was made a Commander
billion is planned for 2011, doubling 2010 capital expenditure.
of the Order of the British Empire (CBE) for services to the international ports industry. Mrs
Despite the challenges, the top 40 is well positioned to capitalise on the upside. Collectively, they own nearly $1 trillion in assets, including $100 billion of cash. The report also highlights the
Yau, British Consulate-General, was made a Member of the Order of the British Empire (MBE) for an exemplary record of public service stretching over more than twenty years.
growing trend of emerging market producers outperforming those from ‘traditional’ locations
British Consul-General Mr Andrew Seaton said, “I offer my warm congratulations to Dr
such as Australia, US, Canada, South Africa, and the UK. Over the past four years, the average
Meredith and Mrs Yau for these well deserved awards. Dr Meredith has made an outstanding
Total Shareholder Return of companies from emerging markets, more than doubled that of
contribution to trade and investment links between Hong Kong and the UK and it gives me
those from traditional mining locations.
great personal pleasure to see a long-standing, valued and well-respected member of my staff included in the Birthday Honours.”
Accountancy firm BDO has recently appointed Christine Chau as a
Educated at the London School of Economics, Paul joined BDO
Principal of assurance services.
from the corporate finance team of an international accounting firm
Christine has extensive experience in providing audit and business advisory services. She deals with a wide range of companies including manufacturing, international trading, engineering consulting and other services companies of various sizes which are privately held or listed in Hong Kong. She is also
Christine Chau
experienced in working on due diligence assignments.
in 2001. Paul has led teams on a range of roles including accelerated IPO’s and quoted company acquisitions, with a broad range of experience including financial and vendor due diligence, private equity investigations, MBO’s, MBI’s and sales mandates. Paul has assisted many Chinese companies to access capital
Christine is a Certified Public Accountant in Hong Kong and Certified
Paul Williams
markets, and has worked on projects involving Asian companies listing in London, Germany, Hong Kong and Singapore. Paul has also assisted Chinese and Asian
Practising Accountant of CPAs Australia.
companies in a range of other transactions, including corporate M&A, private equity investment Accountancy firm BDO has recently appointed Paul Williams as a Principal within the corporate
and fund-raising, and is seeking to develop better channels that allow Chinese companies to
finance team of BDO Hong Kong, specialising in transaction services and lead advisory projects.
source international investors.
MEMBER DISCOUNTS To enjoy exclusive member discounts please log onto, log in and click on membership discounts. If you have forgotten your login details please email info@britcham.com to request them. Accor
Carey
The Mira Hong Kong
Alfie’s
Compass Offices
Pure Bar + Restaurant
Allied Pickfords
Dot Cod
Renaissance Harbour View Hotel Hong Kong
B&W Group Asia Limited
Grand Hyatt
Ta Da
Berry Bros & Rudd
Hyatt Regency
Virgin Atlantic
British Airways
Le Meridien Cyberport
VisitBritain
For up to date event listings and information, check out July/August 2011 • Vol 26 • No 7
21
NEW MEMBERS CORPORATE
ADDITIONAL
STARTUP
Klako Group
Mazars CPA Limited
Changepoint Consulting Limited
Sven Koehler
Jack Clipsham
Changepoint Consulting Limited
Business Policy Unit Tim Peirson-Smith Executive Counsel
Group Managing Director
Head of Corporate Finance
Jonathan Berney
Tel
2345 7555
Tel
2909 5555
Director
2357 5452
2810 0032
Tel
2297 2374
China Committee David Watt DTZ
info@klako.com
jack.clipsham@mazars.com.hk
2297 2289
10A, Seapower Industrial Centre
42/F, Central Plaza, 18 Harbour Road
jberney@changepointconsulting.com.hk
177 Hoi Bun Road, Kwun Tong,
Wanchai, Hong Kong
Level 8-5, 2 Exchange Square
Kowloon, Hong Kong
Accounting
8 Connaught Place, Central
Chairs of Specialist Committees
Construction Industry Group Derek Smyth Gammon Construction Education Committee Stephen Eno Baker & McKenzie Environment Committee Anne Kerr Mott MacDonald Hong Kong Limited Financial Services Interest Group Debbie Annells Azure Tax Consulting HR Advisory Group Brian Renwick Boyden Search Global Executive
Mace Limited
Consultancy
PT Garuda Indonesia
Helen Amos
Amy Yeung
Project Manager
Maroon Ventures Ltd
Executive Assistant Manager - Marketing
Tel
2994 2341
Barry Jones
Tel
2846 4371
2994 3434
Principal
2801 4819
helen.amos@macegroup.com
Tel
amy.y.nicoll@gmail.com
Room 2203, 22/F, Tower 1, Lippo Centre
barry.jones@maroonanalytics.com
Unit 01, 10/F 68 Yee Wo Street
89 Queensway, Hong Kong
17/F, Comfort Court, 52 Third Street
Causeway Bay, Hong Kong
Construction
Hong Kong
9177 0576
Consultancy
Aviation & Aerospace
South China Cosmetics Simba Logistics
Mark Russell
Michael Saunders
Director
ICT IT Committee Craig Armstrong Standard Chartered
General Manager - Business Development
Tel
Tel
mark.russell@schinac.com
hkg.saunders@simbalogistics.com
305 Wilson House
Iain Brymer
Marketing & Communications Committee Adam O’Conor Ogilvy & Mather Group
Room 2005-2008, 20/F, Ladford Centre
19-27 Wyndham Street, Central
Regional Manager, Far East &
838 Lai Chi Kok Road, Kowloon
Hong Kong
Southeast Asia
Hong Kong
Well-being & Beauty
Tel
Real Estate Committee Jeremy Sheldon Jones Lang LaSalle
3188 3730
9018 3600
Logistics
OVERSEAS Uniserve
3485 3769
isb@ugroup.co.uk
IP Global Limited
London Megal Terminal
Chris Purdon
Thurrock Park Way, Tilbury, Essex
Scottish Business Group Dr. Jim Walker Asianomics Limited
Chief Investment Officer
RM18 7HD, United Kingdom
Tel
Freight Forwarding / Logistics & Delivery
Logistics Committee Mark Millar M Power Associates
17/F, 88 Gloucester Road, Wanchai
Small & Medium Enterprises Committee Kate Kelly Women in Business Committee Lisa Bowman DG3 Asia Limited YNetwork Committee Fiona Foxon Business Angel Programme Neil Orvay Asia Spa & Wellness Limited Tim Hay-Edie Pilot Simple Software
22
Hong Kong
Accounting cha m.c o m
3965 9356
chris.purdon@ipglobal-ltd.com
INDIVIDUAL Mary Rafferty
Gladwell Fine Art Limited
Hong Kong
Glenn Fuller
Property / Real Estate Services
Director
Tel
2849 0333
Tel
+44 207 629 4119
2849 6127
+44 207 499 0119
mary@matilda.org
68 Queen Victoria Street, London
41, Mount Kellet Road, The Peak
EC4N 4SJ, United Kingdom
Hong Kong
Fine Art
EVENTS
Shaken Not Stirred June 2011 Pure Bar + Restaurant Gregory Brossard (Goedhuis & Co), Ben Lester (Elite Capital Solutions)
Victoria Coplans, Emily Ferrary (The British Chamber of Commerce in Hong Kong), Stuart Northrop (Widnell Sweett)
Steven Resco (Widnell Sweett), Maureen Mills (Executive Homes)
James Fearnside (Giles Publications), Ally Lung (Hong Kong Government) Naveen Qureshi (Tanner De Witt), Andrew Tam (Skadden)
Pretty Chu (Travelex), Gregory Seitz (AGS Four Winds) Maureen Gleeson (Simmons & Simmons), Gregory Seitz (AGS Four Winds)
Bong Miquiabas (Giles Publications), Eliza Lee (AIA), Dorothy Luo (AIA) Graham Price (Halifax Fan), Liz Hamerton (Strategic Office Solutions)
Naveen Qureshi (Tanner De Witt), Sasha Koch-Belova
Anthony Richman (Venson), Derek Lynch (BT), Lee Wainwright (BT), Kunal Pradhan (BT)
Nick Gowlland (Sateri), Ally Lung (Hong Kong Government), Roslyn Lau
Ruth Rowan (BT), Roger Wu (Purcell Miller Tritton), Elise von Stolk (Santa Fe Relocation Services), Peter Hodges (Standard Chartered), Graham Price (Halifax Fan) July/August 2011 • Vol 26 • No 7
23
Published on Aug 14, 2011
Britain in Hong Kong is the highly regarded monthly magazine of the British Chamber of Commerce in Hong Kong. The magazine features news and... | https://issuu.com/britcham01/docs/britain_in_hk_july_-_aug_2011_final | CC-MAIN-2017-39 | refinedweb | 10,945 | 56.29 |
I'm trying to make a program that analyzers strings for certain pieces of information such as the length of the string, the number of vowels, and the number of words. However, while trying to analyze for the number of vowels in the string, I ran into an error. I tried figuring out what was going wrong on my own, but I couldn't seem to find what my problem was. If anyone would care to look through and see what I was doing wrong, it'd be greatly appreciated. The error code is posted below the program code. I am able to compile and run the program, but whenever I enter any piece of data, the program crashes from a StringIndexOutOfBounds exception. This is my first post on this forum by the way, so if I did anything wrong or didn't include necessary information, I'm sorry :P Just message me back and I'll try to fix it.
Code :
import java.util.*; class ClrScrn { static void clrScrn() { for(int lineCounter = 0; lineCounter <= 75; lineCounter++) { System.out.println(); } } } class Analysis { int vowelCounter(String userString, int stringLength) { char vowels[] = {'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'}; int numOfVowels = 0; for(int stringCounter = 0; stringCounter <= stringLength; stringCounter++) { char stringFocus = userString.charAt(stringCounter); for(int vowelCounter = 0; vowelCounter <= 9; vowelCounter++) { if(stringFocus == vowels[vowelCounter]) numOfVowels++; } } return numOfVowels; } } class Input { String getString() { Scanner scan = new Scanner(System.in); String userString = ""; do { System.out.print("Please enter a string for me to analyze: "); userString = scan.nextLine(); if(userString == "") System.out.println("\n\nError: Invalid entry.Please try again..."); else return userString; } while (userString == ""); return userString; } } class StringAnalyzer { public static void main(String[] args) { ClrScrn.clrScrn(); System.out.println("\n\n"); Scanner scan = new Scanner(System.in); Input userInput = new Input(); do { String userString = userInput.getString(); int stringLength = userString.length(); Analysis Analyzer = new Analysis(); int vowelNum = Analyzer.vowelCounter(userString, stringLength); System.out.println("String: " + userString); System.out.println("Length: " + stringLength); System.out.println("Vowels: " + vowelNum + "\n"); System.out.print("Would you like to run the analyzer again (y/n): "); String repeat = scan.next(); if(repeat == "y") break; } while(true); System.out.println("\n\n"); } }
Error:
Code :
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 4 at java.lang.String.charAt(String.java:658) at Analysis.vowelCounter(StringAnalyzer.java:26) at StringAnalyzer.main(StringAnalyzer.java:69)
P.S. I entered "test" in the above trial | http://www.javaprogrammingforums.com/%20whats-wrong-my-code/33686-stringindexoutofbounds-exception-printingthethread.html | CC-MAIN-2017-43 | refinedweb | 407 | 52.56 |
In my opinion, Microsoft failed with the implementation of the generic ClientBase implementation that is used for connecting with services. The channel contained within the client base implementation will become invalid when a problem occurs during the communication with the service.
The downside is that this channel cannot be revived so that it can be reused. The only solution is to dispose the current instance and to recreate a new one. This will put a strain on the developers since they need to implement the code for handling the invalid channel and for recreating the actual client proxy.
As one can imagine, this is not efficient and can cause problems since each client proxy needs to be implemented in their own way. Some functionality can be copied and pasted, but this will be error prone.
I did some browsing to see if others ran into the same problems. The only interesting solution I found was at and shows a dynamic proxy which is generated at runtime. This was almost exactly what I had been looking for. The solution however was too complex for my taste, so I started on my own version while reusing certain ideas and the intermediate language generation.
The solution to the problem is to encapsulate the actual client proxy, which is based on the ClientBase, in a specific class which will contain the functionality to recreate the proxy in case of problems. The problem however is that the calls present on the service interface need to be extended with a way to detect these problems. To be able to handle this in a generic way, we need to generate this functionality at runtime to prevent that we still need actions to keep the implementation up to date. This can be done by creating a temporary assembly which will contain the implementation for the specific implementation of the interface by generating intermediate language.
So a generic ProxyClassBuilder is available which will generate a type that contains the methods which will handle the calls to the service implementation. Each method will contain functionality for catching exceptions and for handling them accordingly.
ProxyClassBuilder
I will explain shortly what happens when the following service contract is being used:
[ServiceContract]
public interface ITestService
{
[OperationContract]
void DummyCall();
}
The following will trigger the creation of the specific client proxy which includes the method and the implementation that will handle any exceptions that occur.
clientProxy = ClientProxy<itestservice />.GetInstance("identifier", binding, endpointAddress);
The client proxy that is returned is derived from the ClientProxy class and will contain the following implementation:
ClientProxy
public class TestService : ClientProxy<itestservice />, ITestService
{
// Methods
public TestService(Binding binding1, EndpointAddress address1) :
base(binding1, address1)
{
}
public void DummyCall()
{
try
{
base.Channel.DummyCall();
}
catch (Exception exception)
{
this.HandleException(exception);
}
}
}
It will pass the method call onto the enclosed channel which will eventually call the service. Any exceptions are caught and passed onto the HandleException method which resides in the base class.
HandleException
The generic ClientProxy is the entry point and the one that is to be used by the consumer of the service. It has an abstract method GetInstance which is used to get an instance of the generated class. This generated class is completely built by the ProxyClassBuilder. For performance issues, the ClientProxy will contain a cache with already generated client proxies. This ensures that the communication with a certain service within the same client is done via one instance of the proxy.
abstract
GetInstance
The generic ProxyClassBuilder is responsible for the generation of a temporary type. This type is cached internally to prevent that it needs to be generated more than once.
The generic InternalClientProxy is the actual proxy that talks with the service. This one is recreated when the connection with the server is somehow severed.
InternalClientProxy
The enclosed solution contains 3 projects:
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
ClientProxy.GetInstance
General News Suggestion Question Bug Answer Joke Praise Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages. | http://www.codeproject.com/Articles/125725/A-Better-Way-for-a-Client-to-Work-with-WCF-Service | CC-MAIN-2016-40 | refinedweb | 683 | 50.97 |
Rocking with sigrok
A coworker asked me about buying a telescope the other day. I gave him advice I'd received earlier: The best telescope is one that you will use. If you have a $100 telescope that takes 5 minutes to set up, you might use it more than an $800 telescope that takes two people an hour to set up. So even though the $100 telescope isn't really all that great, it is a better value because you will use it more. Last time, I was talking about my inconvenient logic analyzers; this time, I'll tell you more about my quest for convenience.
A little eBay shopping let me pick up an "ArmFly" logic analyzer for about 10 bucks. No kidding. It is a Cypress CPU that receives a firmware load from the host computer. In reality, it is a clone of the USBee hardware, although as far as I can tell they all originate from a Cypress reference design. From what I have read online, there is a constant battle to keep the USBee software from running on these clones, but since I wanted Linux software anyway, that didn't concern me (there is no USBee software for Linux).
The open source software sigrok supports the ArmFly (and the USBee, and a host of other logic analyzers and similar instruments) and my plan was to use that. In the end, I did wind up using it, but not in the way I expected.
There are a few things that sigrok suffers from and the main one is out of date or lack of documentation. Another item is that some of the ancillary pieces are not quite ready for prime time. For example, the serial UART decoder has a comment in the code that there needs to be a way to invert the incoming signal, but it fails to provide a way to do that (short of writing your own code, of course). The GUI front ends are not really polished nor do they offer all available features.
None of these problems are insurmountable, but they do detract from the overall package. Of course, the strong parts of sigrok are its wide array of input and output options. Last time I showed you the LogicSniffer software and — not surprisingly — the sigrok tool can output in that file format.
Once again, I hooked up an Arduino with a simple SoftwareSerial test program:
#include <SoftwareSerial.h> SoftwareSerial mySerial(10, 11); // RX, TX void setup() { // set the data rate for the SoftwareSerial port mySerial.begin(9600); } void loop() // run over and over { mySerial.println("Hello, Dr. Dobb's."); }
With a probe on pin 11, sigrok can dump a "graphic" right to the terminal:
Cute, but hard to read. Note the command line:
sigrok-cli --driver fx2lafw --samples 1024 -O ascii -p 1
Despite the current documentation, this is the correct way to use the tool. The
--driver options tells the software what device to look for. In my case, all of the Cypress-based cheap analyzers use the same driver, fx2lafw. The rest of the options are self-explanatory. Collect 1024 samples from probe 1 and emit them as ASCII. You can read up to 8 channels at once with this hardware.
It takes some detective work to figure things out. If you use the
--show option you can learn more about the driver's support for your hardware:
alw@enterprise:/tmp/sigrok$
That tells us that there's an option for the driver called
samplerate. The values are fairly tolerant. For example, 25 kHz can appear as '25 kHz', 25khz, or even 25000. Let's go to 100kHz sampling:
sigrok-cli --driver fx2lafw -d samplerate=100khz --samples 1024 -O ascii -p 1
The same trick works for learning about protocol decoders:
alw@enterprise:/tmp/sigrok$ sigrok-cli -a uart --show ID: uart Name: UART Long name: Universal Asynchronous Receiver/Transmitter Description: Asynchronous, serial bus. License: gplv2+ Annotations: - ASCII Data bytes as ASCII characters - Decimal Databytes as decimal, integer values - Hex Data bytes in hex format - Octal Data bytes as octal numbers - Bits Data bytes in bit notation (sequence of 0/1 digits) . . .
The output goes on, including wording about inverting data. However, in the actual code there is simply a comment that inverted input is "to do."
I can change the
-O ascii option to
-O vcd and get a dump that is just what I would get from a typical Verilog simulator. A tool like gtkWave can easily read that:
Note that I'm only looking at one signal by choice. You could easily add any or all of the 8 signals into any of these displays.
Of course, gtkWave doesn't do sophisticated signal decoding (that I know of, at least). But with the OLS format (
-O ols) it is possible to read the data into LogicSniffer and use the UART analyzer tool just like I did last time.
You can combine the sigrok software with the idea of using named pipes I talked about last time:
mknod /tmp/sigrok.pipe p sigrok-cli –driver fx2lafw –d samplerate=100000 –continuous -O binary –p 1 >/tmp/sigrok.pipe
Now you can ask LogicSniffer to do a "generic" acquire on /tmp/sigrok.pipe and you can capture the data directly into the tool without an intermediate file.
You can trigger in a very limited way, and perhaps I'll talk about that next time. However, if you expect this little box — about the size of a small box of mints and about the price of a hamburger — to match an expensive professional instrument, you'll be disappointed. However, its cost/benefit ratio is very good. It is also handy, like a small cheap telescope. It might not give the best views, but you are more likely to look. | http://www.drdobbs.com/architecture-and-design/cpp/rocking-with-sigrok/240147198 | CC-MAIN-2015-48 | refinedweb | 970 | 69.52 |
On Wed, Feb 15, 2017 at 5:58 AM, Borislav Petkov <bp@xxxxxxx> wrote:
>
> On Tue, Feb 14, 2017 at 11:42:56AM -0800, Thomas Garnier wrote:
> > This patch aligns MODULES_END to the beginning of the Fixmap section.
> > It optimizes the space available for both sections. The address is
> > pre-computed based on the number of pages required by the Fixmap
> > section.
> >
> > It will allow GDT remapping in the Fixmap section. The current
> > MODULES_END static address does not provide enough space for the kernel
> > to support a large number of processors.
> >
> > Signed-off-by: Thomas Garnier <thgarnie@xxxxxxxxxx>
> > ---
> > Based on next-20170213
> > ---
> > arch/x86/include/asm/fixmap.h | 8 ++++++++
> > arch/x86/include/asm/pgtable_64_types.h | 3 ---
> > arch/x86/kernel/module.c | 1 +
> > arch/x86/mm/dump_pagetables.c | 1 +
> > arch/x86/mm/kasan_init_64.c | 1 +
> > 5 files changed, 11 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
> > index 8554f960e21b..20231189e0e3 100644
> > --- a/arch/x86/include/asm/fixmap.h
> > +++ b/arch/x86/include/asm/fixmap.h
> > @@ -132,6 +132,14 @@ enum fixed_addresses {
> >
> > extern void reserve_top_address(unsigned long reserve);
> >
> > +/* On 64-bit, the module sections ends with the start of the fixmap */
> > +#ifdef CONFIG_X86_64
> > +#define MODULES_VADDR (__START_KERNEL_map + KERNEL_IMAGE_SIZE)
> > +#define MODULES_END __fix_to_virt(__end_of_fixed_addresses + 1)
> > +#define MODULES_LEN (MODULES_END - MODULES_VADDR)
> > +#endif /* CONFIG_X86_64 */
>
> JFYI: so there's another patchset which adds KERNEL_MAPPING_SIZE:
>
>
>
> and makes it a 1G, i.e., the KASLR default. I guess the above will have
> to be KERNEL_MAPPING_SIZE then.
>
> And why are you moving those to fixmap.h? What's wrong with
> including fixmap.h into pgtable_64_types.h so that you can get
> __end_of_fixed_addresses?
>
> FWIW, I didn't even have to add any includes with my .config, i.e., that
> builds:
>
I tried to add fixmap.h and I thought I tried without too but maybe
not, I will try to adapt it on v4.
> ---
> diff --git a/arch/x86/include/asm/pgtable_64_types.h
> b/arch/x86/include/asm/pgtable_64_types.h
> index 3a264200c62f..eda7fa856fa9 100644
> --- a/arch/x86/include/asm/pgtable_64_types.h
> +++ b/arch/x86/include/asm/pgtable_64_types.h
> @@ -67,7 +67,7 @@ typedef struct { pteval_t pte; } pte_t;
> #endif /* CONFIG_RANDOMIZE_MEMORY */
> #define VMALLOC_END (VMALLOC_START + _AC((VMALLOC_SIZE_TB << 40) - 1, UL))
> #define MODULES_VADDR (__START_KERNEL_map + KERNEL_IMAGE_SIZE)
> -#define MODULES_END _AC(0xffffffffff000000, UL)
> +#define MODULES_END __fix_to_virt(__end_of_fixed_addresses + 1)
> #define MODULES_LEN (MODULES_END - MODULES_VADDR)
> #define ESPFIX_PGD_ENTRY _AC(-2, UL)
> #define ESPFIX_BASE_ADDR (ESPFIX_PGD_ENTRY << PGDIR_SHIFT)
> ---
>
> but I wouldn't be surprised if some strange configuration would need it.
>
> > #define FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
> > #define FIXADDR_START (FIXADDR_TOP - FIXADDR_SIZE)
> >
> > diff --git a/arch/x86/include/asm/pgtable_64_types.h
> > b/arch/x86/include/asm/pgtable_64_types.h
> > index 3a264200c62f..de8bace10200 100644
> > --- a/arch/x86/include/asm/pgtable_64_types.h
> > +++ b/arch/x86/include/asm/pgtable_64_types.h
> > @@ -66,9 +66,6 @@ typedef struct { pteval_t pte; } pte_t;
> > #define VMEMMAP_START __VMEMMAP_BASE
> > #endif /* CONFIG_RANDOMIZE_MEMORY */
> > #define VMALLOC_END (VMALLOC_START + _AC((VMALLOC_SIZE_TB << 40) - 1, UL))
> > -#define MODULES_VADDR (__START_KERNEL_map + KERNEL_IMAGE_SIZE)
> > -#define MODULES_END _AC(0xffffffffff000000, UL)
>
> How much of an ABI breakage would that be? See
> Documentation/x86/x86_64/mm.txt.
>
> With my .config MODULES_END becomes 0xffffffffff1fe000 and it'll remain
> dynamic depending on .config. No idea how much in userspace relies on
> MODULES_END being static 0xffffffffff000000...
>
> Hmm.
>
Why do you think they rely on it being static? The VSYSCALL address is
not changed for example.
> --
> Regards/Gruss,
> Boris.
>
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB
> 21284 (AG Nürnberg)
> --
Thanks for the feedback.
--
Th. | https://lists.xenproject.org/archives/html/xen-devel/2017-02/msg01776.html | CC-MAIN-2018-17 | refinedweb | 560 | 51.04 |
The Modern Way to Use Promise- Based HTTP Requests: axios-hooks
React Hooks for axios, with built-in support for server-side rendering
What’s axios-hooks?
You might need to make requests to your own or external API in your React app and you usually needed to use Promises to get the results back, trying to use them inside your React components with the axios library.
Axios-hooks is here to solve this problem with a simpler syntax using the complete power of React Hooks in a few lines of code.
Features
All the axios awesomeness you are familiar with but simplified with Hooks.
- Zero configuration, but configurable in case it’s needed.
- One-line usage.
- Super straightforward to use with server-side rendering.
How Do I Use It?
It will feel easy, like using
useQuery from Apollo React with GraphQL queries.
useAxios
This hook will return three simple elements:
data: An object containing the response from the server.
error: If the response contained an error code with related messages.
You will access the
useAxios Hook to do almost every operation and, in some cases, also the
configure Hook to define an API-base endpoint URL.
import { configure } from 'axios-hooks'
import LRU from 'lru-cache'
import Axios from 'axios'
const axios = Axios.create({
baseURL: ''
})
const cache = new LRU({ max: 10 })
configure({ axios, cache })
CodeSandbox React axios Playground
If you want to learn more about Hooks
I have personally read “Learn React Hooks” when I started using hooks and it helped me understand them to use tools such as useAxios: | https://medium.com/better-programming/the-modern-way-to-use-promise-based-http-requests-axios-hooks-f00791345a37?utm_source=reactdigest&utm_medium=web&utm_campaign=featured | CC-MAIN-2019-51 | refinedweb | 261 | 60.55 |
Odoo Help
This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.
v7: Pricelist on product tree shows 0.00 on 'price' column
the problem i am facing is the following:
on v7, when selecting a pricelist on the product search form, the 'price' column appears. however, the prices on the 'price' column all show 0.00.
i have tried with different pricelists, new pricelists, etc. but it always shows 0.00.
anybody know how to fix this?
This forum is mostly for questions and answers whereas bugs arae listed on Launchad. This bug has already been reported, and has not been resolved yet, so if you think it is important you should go to launchpad and click the link to state the bug affects you @ bugs.launchpad.net/openobject-addons/+bug/1178835 (Sorry that the system does not allow me to attach links but you can only do a copy and paste)
Not only will doing so help you to quickly get to know the bug has been resolved, but the bug will also become more visible when it is stated to affect more people. Also you can get additional hints and even submit potential patches/solutions.
the following link solves the bug:
this comes on server debug while searching pricelist:
2013-05-28 14:33:13,940 8426 ERROR 2demo_7 openerp.osv.expression: The field 'Pricelist' (pricelist_id) can not be searched: non-stored function field without fnct_search
correct me if i'm wrong, but the line says the fiel 'pricelist_id' cannot be searched... this is why 0.00 is displayed on 'Price' column.
how do i fix this... help please!
obviously, when i tried to modify this through the web portal i got the following error:
2013-05-28 15:45:28,635 9888 ERROR 2demo_7 openerp.netsvc: Error! Properties of base fields cannot be altered in this manner! Please modify them through Python code, preferably through a custom addon!
question is, where do i modify this and in which way must i modify this a bug?
this character restriction is kind of annoying. and how do you post code bits?
v7 product.py (def _product_price)
def _product_price(self, cr, uid, ids, name, arg, context=None): res = {} if context is None: context = {} quantity = context.get('quantity') or 1.0 pricelist = context.get('pricelist', False) partner = context.get('partner', False) if pricelist: for id in ids: try: price = self.pool.get('product.pricelist').price_get(cr,uid,[pricelist], id, quantity, partner=partner, context=context)[pricelist] except: price = 0.0
...
res[id] = price for id in ids: res.setdefault(id, 0.0) return res
v6 product.py (def _product_price)
def _product_price(self, cr, uid, ids, name, arg, context=None): res = {} if context is None: context = {} quantity = context.get('quantity') or 1.0 pricelist = context.get('pricelist', False) if pricelist: for id in ids: try: price = self.pool.get('product.pricelist').price_get(cr,uid,[pricelist], id, quantity, context=context)[pricelist] except: price = 0.0 res[id] = price for id in ids:
i've reported a bug on launchpad, this is the link: (with no link, not enough karma!)
bugs.launchpad.net/openobject-addons/+bug/1178835 | https://www.odoo.com/forum/help-1/question/v7-pricelist-on-product-tree-shows-0-00-on-price-column-16100 | CC-MAIN-2016-50 | refinedweb | 543 | 67.25 |
Lesson 5. How to Reproject Vector Data in Python Using Geopandas - GIS in PythonSpatial data open source python Workshop
Learning Objectives
After completing this tutorial, you will be able to:
- Reproject a vector dataset to another
CRSin
Python
- Identify the
CRSof a spatial dataset in
Python
What You Need
You will need a computer with internet access to complete this lesson and the spatial-vector-lidar data subset created for the course.
Download spatial-vector-lidar data subset (~172 MB)
Data in Different Coordinate Reference Systems
Often when data do not line up properly, it is because they are in different coordinate reference systems (CRS). In this lesson you will learn how to reproject data from one CRS to another - so that the data line up properly.
You will use the
geopandas,
numpy and
matplotlib libraries in this tutorial.
Working With Spatial Data From Different Sources convention used by the data provider which might be a federal agency, or a state planning office.
- The data are stored in a particular CRS that is customized to a region. For instance, many states prefer to use a State Plane projection customized for that state.
In this lesson, you will reproject vector data to create a map of the roads near the NEON San Joaquin Experimental Range (SJER) site in Madera County, California.
Import Packages and Data
To get started,
import the packages you will need for this lesson into
Python and set the current working directory.
# import necessary packages to work with spatial data in Python import geopandas as gpd import numpy as np import matplotlib.pyplot as plt import os import earthpy as et plt.ion() # set the current working directory os.chdir(os.path.join(et.io.HOME, 'earth-analytics'))
Import the vector data for the Madera County roads and for the boundary of the NEON SJER site.
# import the road data madera_roads = gpd.read_file("data/spatial-vector-lidar/california/madera-county-roads/tl_2013_06039_roads.shp") # import the boundary of SJER # aoi stands for area of interest sjer_aoi = gpd.read_file("data/spatial-vector-lidar/california/neon-sjer-site/vector_data/SJER_crop.shp")
Identify the CRS
View the CRS of each layer using
.crs attribute of
geopandas dataframes (e.g.
dataframename.crs).
# view the coordinate reference system of both layers print(madera_roads.crs) print(sjer_aoi.crs)
{'init': 'epsg:4269'} {'init': 'epsg:32611'}
Notice that the EPSG codes do not match.
Look up the EPSG codes for 4269 and 32611. What differences do you notice between these coordinate systems?
Next, plot your data. Does anything look off?
Plot Data
# create the plot fig, ax = plt.subplots(figsize=(12, 8)) # add roads to the plot madera_roads.plot(cmap='Greys', ax=ax, alpha=.5) # add the SJER boundary to the plot sjer_aoi.plot(ax=ax, markersize=10, color='r') # add a title for the plot ax.set_title("Madera County Roads with SJER AOI");
Different Data, Same Location, Different Spatial Extents
View the spatial extent of each layer using
.total_bounds attribute of
geopandas dataframes (e.g.
dataframename.total_bounds).
# view the spatial extent of both layers print(madera_roads.total_bounds) print(sjer_aoi.total_bounds)
[-120.530241 36.771309 -119.031075 37.686847] [ 254570.567 4107303.07684455 258867.40933092 4112361.92026107]
Note the difference in the units for each dataset. The spatial extent for the roads is latitude and longitude, while the spatial extent for
sjer_aoi is in UTM (meters).
Imagine drawing a box on a grid using these extents. The two extents DO NOT OVERLAP. Yet you know that your data should overlap.
Reproject Vector Data in Geopandas
To plot the data together, they need to be in the same CRS. You can change the CRS, which means you need to reproject the data from one CRS to another CRS using the
geopandas method (i.e. function belonging to
geopandas objects):
to_crs()
The
to_crs() method requires two inputs:
- the name of the object that you wish to transform (e.g.
dataframename.to_crs())
- the CRS that you wish to transform that object to (e.g.
dataframename.to_crs(crs-info)) - this can be in the EPSG format or an entire Proj.4 string, which you can find on the Spatial Reference website.
To use the EPSG code, specify the CRS as follows:
'init': 'epsg:4269'
Important: When you reproject data, you are modifying it. Thus, you are introducing some uncertainty into your data. While this is a slightly less important issue when working with vector data (compared to raster), it’s important to consider.
Often you may consider keeping the data that you are doing the analysis on in the correct projection that best relates spatially to the area that you are working in. To get to the point, be sure to use the CRS that best minimizes errors in distance/area/shape, based on your analysis needs.
If you are simply reprojecting to create a base map, then which dataset you reproject matters a lot less because no analysis is involved! However, some people with a keen eye for CRSs may give you a hard time for using the wrong CRS for your study area.
Data Tip:
.to_crs() will only work if your original spatial object has a CRS assigned to it AND if that CRS is the correct CRS for that data!
For this lesson, reproject the SJER boundary to match the Madera County roads in EPSG 4269.
Assign a new name to the reprojected data that clearly identifies the CRS. Suggestion:
sjer_aoi_wgs84.
# reproject the SJER boundary to match the roads layer using the EPSG code sjer_aoi_wgs84 = sjer_aoi.to_crs({'init': 'epsg:4269'})
Create a new plot using the reprojected data for the SJER boundary.
# create the plot fig, ax = plt.subplots(figsize=(12, 8)) # add roads to the plot madera_roads.plot(cmap='Greys', ax=ax, alpha=.5) # add the reprojected SJER boundary to the plot sjer_aoi_wgs84.plot(ax=ax, markersize=10, color='r') # add a title for the plot ax.set_title("Madera County Roads with SJER AOI");
Congratulations! You have now reprojected a dataset to be able to map the SJER boundary on top of the Madera County roads layer.
What do you notice about the resultant plot? Can you see where the SJER boundary is within California?
Optional challenge
You know what to do! Create a map that includes the following layers:
- United States Boundary:
data/spatial-vector-lidar/usa/usa-boundary-dissolved.shp
- State Boundary:
data/spatial-vector-lidar/usa/usa-states-census-2014.shp
- SJER AOI:
data/spatial-vector-lidar/california/neon-sjer-site/vector_data/SJER_crop.shp
HINT: the SJER boundary is very small relative to the entire United States. Try to zoom in on your map using the following code to set the x and y limits on your plot:
ax.set(xlim=[-125, -116], ylim=[35, 40])
Remember: check the CRS of each dataset!
# Map at the extent of the area surrounding SJER # import United States country boundary country_boundary_us = gpd.read_file('data/spatial-vector-lidar/usa/usa-boundary-dissolved.shp') # import United States state boundaries state_boundary_us = gpd.read_file('data/spatial-vector-lidar/usa/usa-states-census-2014.shp') #import the reprojected SJER boundary sjer_aoi_WGS84 = sjer_aoi.to_crs(state_boundary_us.crs) # create the plot fig, ax = plt.subplots(figsize = (12,8)) # add the state boundaries to the plot state_boundary_us.plot(ax = ax, linewidth=1, edgecolor="black") # add the United States country boundary to the plot country_boundary_us.plot(ax=ax, alpha=.5, edgecolor="black", color = "white", linewidth=3) # add the reprojected SJER boundary to the plot sjer_aoi_WGS84.plot(ax=ax, color='springgreen', edgecolor = "r") # add a titlet to the plot ax.set(title="Map of Continental US State Boundaries \n with SJER AOI") # zoom in on just the area surrounding SJER ax.set(xlim=[-125, -116], ylim=[35, 40]) # turn off axis ax.set(xticks = [], yticks = []);
Optional Challenge 2
The SJER boundary is difficult to see at the full extent of the United States.
You can turn a single polygon into a point using the
.centroid() method as follows:
sjer_aoi["geometry"].centroid
Create a plot of the United States with the SJER study site location marked as a POINT marker rather than a polygon. Your map will look like one of the ones below depending upon whether you decide to limit the x and y extents.
# reproject the SJER boundary to match the roads layer using the Proj.4 definition sjer_aoi_wgs84_2 = sjer_aoi.to_crs("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs") # create the plot fig, ax = plt.subplots(figsize=(12, 8)) # add roads to the plot madera_roads.plot(cmap='Greys', ax=ax, alpha=.5) # add the reprojected SJER boundary to the plot sjer_aoi_wgs84_2.plot(ax=ax, markersize=10, color='r') # add a title for the plot ax.set_title("Madera County Roads with SJER AOI");
Additional Resources - CRS
Share onTwitter Facebook Google+ LinkedIn
| https://www.earthdatascience.org/workshops/gis-open-source-python/reproject-vector-data-in-python/ | CC-MAIN-2018-34 | refinedweb | 1,452 | 57.87 |
Mustaches in the World of Java
Mustaches in the World of Java
Join the DZone community and get the full member experience.Join For Free
Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.
Mustache has simple idea of "logic-less" system because it lacks any explicit control statements, like if, else or goto and also it does not have for statement however looping and conditional calculation can be achieved using custom tags that work with lists and lambdas.
The name unfortunately has less to do with Tom Selleck but more with the heavy use of curly braces that look like mustache. The similarity is more than comparable.
Mustache has implementation for most of the widely used languages like: Java, Javascript, Ruby,Net and many more.
The client side template's in JavaScriptLet say that you have some REST service and you have created a book view object that has an additional function that appends amazon associates id to the book url:
var book = { id : 12, title : "A Game of Thrones", url : "", amazonId : "myAwesomeness", associateUrl : function() { return this.url + '?tag=' + this.amazonId; }, author : { name : 'George R. R. Martin', imdbUrl : '', wikiUrl : '' }, haveInStock : true, similarBooks : [{ id : 13, title : "Decision Points" }, { id : 13, title : "Spoken from the Heart" }], comments : [] };
The standard way of rendering data without using templates would be create an output variable and just append everything inside and at the end just place the data where it should be.
jQuery(document).ready(function() { var out = '<div class="book-box"><h3>' + book.title + '</h3><span> is awesome book get it on <a href="' + book.associateUrl() + '">Amazon</a></span></div>'; jQuery('#content-jquery').html(out); });
This is fairly simple but if you for example want to change the span element with div it takes a little bit of time to figure where it should be closed and often you can miss if the element should be in single quotes or double quotes. The bigger issue here is that the content is peaces of strings that need to be easy to styled via CSS and JavaScript. As the code gets bigger this becomes unmanageable and changes to anything become slower especially if you add on top of this jQuery's manipulation functions like appendTo() or prependTo(). This direct use of out+= type of creating the content reminds me a lot of HttpServlet style of using print writer and doing out.print() and for the same reason why this was almost abandoned we should not do this in JavaScript.
To simplify work we can add template engine like Mustache that is one of many client side tempting engines. So how does a template in mustache looks like, well for the example above with the book it would look like :
<script id="book-template" type="text/x-mustache-template"> <div class="book-box"> <h3>{{title}}</h3> <span> is awesome book get it on <a href="{{associateUrl}}">Amazon</a> </span> </div>
So this template can be placed anywhere on the page and then selected and rendered when you need it:
jQuery(document).ready(function() { var template = jQuery('#book-template').html(); var renderedData = Mustache.render(template, book); jQuery('#content-mustache').html(renderedData); });
nder method accepts the content of the template and the view object book, what is great here is that the template looks almost the same as html thus make it easy to style, change and maintain.
Also you can use section like : {{#conditon}} code or data here{{/condition}} where if it evaluates to true, the section is rendered, otherwise the whole block is ignored.
If the conditions returns nonempty list this can be iterated using the same construct. Inverted condition is done using {^conditon}} code or data here{{/condition}}.
Dot notation can be used to access subelements (not in every implementation), for example if you wanted to render the authors imdb page from the previous example it would be like {{author.imdbUrl}}.There are structures called partials that can be used if we need render time inclusion of partial elements, also if needed some of the standard behavior of Mustache JS can be overridden.
You can get the example from
Server side rendering Mustache in Spring MVC
There is an implementation of Mustache templates for Java called Mustache.java and another one called JMustache . As far as usage in web frameworks is needed there are few articles out there about using Mustache in Java web applications based on Struts for example but I went with the Spring MVC option since I found it more interesting for my use.
For the example I used the mustache-spring-view that is fairly simple to add using maven:
<dependency> <groupId>com.github.sps.mustache</groupId> <artifactId>mustache-spring-view</artifactId> <version>1.0</version> </dependency>
This will automatically retrieve jMustache :
+- com.github.sps.mustache:mustache-spring-view:jar:1.0:compile
\- com.samskivert:jmustache:jar:1.2:compile
The next part is including the view in the servlet context and adding the appropriate paths:
<beans:bean <!-- FIXME reload every time--> <beans:property <!-- The default view path is below --> <beans:property <!-- The default suffix path is below --> <beans:property <beans:property <beans:bean </beans:property> </beans:bean>
As you can see the config is extremely simple you just need to add the path where the templates will be stored the suffix that the templates will end in, the actual template loader and if the templates should be cached. It is very good during development to set this property to true since that way you will get instant update on the changes in your templates.
The controller will be very simple one since this is just a small proof of concept:
/** * Hello Mustache. */ @Controller public class HomeController { private static final Logger logger = LoggerFactory.getLogger(HomeController.class); /** * Simple controller that * redirects to home and adds map and date objects. */ @RequestMapping(value = "/", method = GET) public String home(Locale locale, Model model) { Date date = new Date(); DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale); Properties properties = System.getProperties(); Map<String, String> map = new HashMap<String, String>((Map) properties); String formattedDate = dateFormat.format(date); model.addAttribute("serverTime", formattedDate); model.addAttribute("props", map.entrySet()); return "home"; } }
The controller just fills the serer system properties and the current time add passes the model to towards the template. Acorrding to the previous configuration the template name is home.mustache and it is located in /WEB-INF/views/.
Template is as simple as it gets, the idea here was just to illustrate how java maps can be iterated.
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset=utf-8> <title>Hello Mustache</title> </head> <body> <div id="container"> <p>Current server time is {{serverTime}}</p> <p>All the current system properties</p> <ul> {{#props}} <li>{{key}} = {{value}} </li> {{/props}} </ul> </div> </body> </html>
So how does it work? Well if we take serverTime it can be java property, key or a method which makes it very simple and readable. The full example can be retrieved from my github page.
It's just the regular maven clean package and run, it's tested on tomcat 6 with Java 1.6 but it simple enough to work anywhere. While I can't yet say that I have used the servers side rendering in a production environment they most definitely look promising. There are plugins for vim, emacs and textmate but there is no plugin for eclipse. On eclipse you can do a workaround Eclipse->Preferences->General->Content_Types add the *.mustache to be recognized as html, at least you will get the html syntax highlighting.
The cool thing with Mustache is that you can very easily switch whether you gonna use server side rendering on client side additionally it makes it very hard to add unnecessary logic in the templates that makes development simpler.
Don't forget your app is only hot if it has awesome mustaches.
Other links
-
-
-
-
-
-
-
-
-
Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat.
Published at DZone with permission of Mite Mitreski , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}{{ parent.urlSource.name }} | https://dzone.com/articles/mustaches-world-java | CC-MAIN-2019-09 | refinedweb | 1,374 | 52.8 |
> mpeg4_DECORE.rar > GETBITS.C
/************************************************************************ * * getbits.c, bit level routines for tmndecode (H.263 decoder) * Copyright (C) 1995, 1996 Telenor R&D, Norway * * Contacts: * Robert Danielsen
* * Telenor Research and Development * P.O.Box 83 tel.: +47 63 84 84 00 * N-2007 Kjeller, Norway fax.: +47 63 81 00 76 * * Copyright (C) 1997 University of BC, Canada * Modified by: Michael Gallant * Guy Cote * Berna Erol * * Contacts: * Michael Gallant * * UBC Image Processing Laboratory * 2356 Main Mall tel.: +1 604 822 4051 * Vancouver BC Canada V6T1Z4 fax.: +1 604 822 5949 * ************************************************************************/ /* Disclaimer of Warranty * * These software programs are available to the user without any license fee * or royalty on an "as is" basis. The University of British Columb University of British Columbia does not represent or warrant that the * programs furnished hereunder are free of infringement of any * third-party patents. * * Commercial implementations of H.263, including shareware, are subject to * royalty fees to patent holders. Many of these patents are general * enough such that they are unavoidable regardless of implementation * design. * */ /* based on mpeg2decode, (C) 1994, MPEG Software Simulation Group and * mpeg2play, (C) 1994 Stefan Eckart * */ /** * Copyright (C) 2001 - Project Mayo * * adapted by Andrea Graziani (Ag) * * DivX Advanced Research Center * **/ #include #include "mp4_vars.h" #include "getbits.h" #define SE_CODE 31 /* initialize buffer, call once before first getbits or showbits */ void initbits (unsigned char * stream, int length) { ld->incnt = 0; ld->bitcnt = 0; ld->rdptr = ld->rdbfr + 2048; #ifdef _DECORE ld->rdptr = stream; ld->length = length; #endif } /* return next bit (could be made faster than getbits(1)) */ unsigned int getbits1 () { return getbits (1); } /* return next n bits (right adjusted) */ | http://read.pudn.com/downloads56/sourcecode/multimedia/mpeg/198854/mpeg4_DECORE/SRC/GETBITS.C__.htm | crawl-002 | refinedweb | 266 | 53.61 |
why don't i get the command prompt back when I run my java program from the terminal window?
Elsie Wilson
Greenhorn
Joined: Apr 24, 2011
Posts: 2
posted
Apr 24, 2011 16:44:15
0
I feel like there is some basic concept I am missing here. I have a simple chat server program I have written for a class. I don't need any help with the mechanics of the program. That is working fine. My question has to do with running the programs from the command line.
First, I launch the server from one command prompt window. The server is a console program and does not have a user interface. It spews out some messages to the console as different things happen, which is what I want at this point. So, I don't care that this window waits for the server to end before coming back to the command prompt - that makes sense to me.
After the server side is running, I launch clients one at a time from different console windows. The client has a simple swing gui interface. But when I run the client (
java
ChatClient <username>) I do not get a command prompt back - it waits until I quit the client user interface before giving me the command prompt back. Although it does not matter for the purposes of this class project, this is not what I want. How can I start the client side and not have the command window just sitting there waiting for me to quit the user interface?
I am coding in Eclipse on a Mac OS X 10.6 machine. The server and clients are all running on my local machine. I want to
test
50 clients without having to open 50 terminal windows. Thank! :-)
Luigi Plinge
Ranch Hand
Joined: Jan 06, 2011
Posts: 441
I like...
posted
Apr 24, 2011 22:12:25
0
I guess the reason you can't start a java program from a console and leave the JVM running would be because then you have no way of terminating the JVM... you could put it into an infinite loop and have it churning away at 100% CPU until you go to Task Manager (or Mac equivalent) and kill the process. At least as it is you can Ctrl+c out of it.
One thing you could do would be to put any code you have in your
main
method int a
run()
method. I do this all the time - in fact I have a template on NetBeans which looks like this:
public class myClass implements Runnable { @Override public void run() { } public static void main(String[] args) { new myClass().run(); } }
Then you can easily kick off 50 instances of this class in separate threads. Just change the main method to something like
public static void main(String[] args) { for (int i = 0; i < 50; i++) { myClass n = new myClass(); new Thread(n).start(); } }
Obviously if you want each instance to behave differently, you can write a method to change that instance's state before running it, or make sure your constructor can have the appropriate arguments passed to it.
Karthik Shiraly
Ranch Hand
Joined: Apr 04, 2009
Posts: 627
11
posted
Apr 24, 2011 22:35:49
0
@Elsie Wilson:
If you want each client to run in its own process, start them with command line
javaw ChatClient <username>
(note that it's "javaw" and not "java").
Luigi Plinge
Ranch Hand
Joined: Jan 06, 2011
Posts: 441
I like...
posted
Apr 24, 2011 23:15:12
0
Come to think of it, if you're using Swing you're better off using
EventQueue.invokeLater(n); // instead of new Thread(n).start();
which will do pretty much the same thing, except the windows will come up in the order you started them.
Here's a very simple example that brings up 6 frames with numbers 1 to 6 in:
import java.awt.EventQueue; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JLabel; public class myClass implements Runnable { private int value; myClass(int i){ value = i; } @Override public void run() { JFrame f = new JFrame(); JLabel l = new JLabel(String.valueOf(value)); l.setFont(new Font("SansSerif", Font.BOLD, 100)); f.add(l); f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); //or use EXIT_ON_CLOSE to close all at same time f.pack(); f.setLocation(30 * value, 30 * value); f.setVisible(true); } public static void main(String[] args) { for (int i = 0; i < 6; i++) { myClass n = new myClass(i + 1); EventQueue.invokeLater(n); } } }
Elsie Wilson
Greenhorn
Joined: Apr 24, 2011
Posts: 2
posted
Apr 25, 2011 05:48:41
0
Thank you for the replies. @Karthik- when I try javaw I get this error:
-bash: javaw: command not found
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
I like...
posted
Apr 25, 2011 06:27:33
0
What is the value of your environment variable PATH?
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Karthik Shiraly
Ranch Hand
Joined: Apr 04, 2009
Posts: 627
11
posted
Apr 25, 2011 07:11:41
0
Sorry, now I observe javaw isn't available on other platforms - I'd no idea it's Windows only.
So instead, you can launch your chat client as background application by suffixing an "&" to the command line, like this:
java ChatClient <username>
&
I agree. Here's the link:
subject: why don't i get the command prompt back when I run my java program from the terminal window?
Similar Threads
How a character save in 2 bytes in Java?
No console window when running manifest file?
Java Network Question, pls help
Why does cons remain equal to null?
Java Chat Server
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
JForum
|
Paul Wheaton | http://www.coderanch.com/t/535536/java/java/don-command-prompt-run-java | CC-MAIN-2015-22 | refinedweb | 981 | 80.11 |
I just found out that "extern inline" is a complete disaster. It's present in both gcc and C99, but with opposite meanings. See the gcc status page, this bug-hurd ml post, this lkml post, and this bug-glibc post for more info.
I really want to have a portable way to specify inlining. Currently, the Ghostscript codebase uses macros heavily, to the detriment of readability and debugability. Inline functions would be a great way to unsnarl some of this mess, without sacrificing speed.
We can't possibly be the first project to have run into this problem. I know the Linux kernel uses "extern inline" extensively, but it's fairly nonportable to non-gcc compilers. Has anyone out there solved the problem of making inline functions a viable, portable alternative to macros? Anyone trying to read the GS sources will thank you!
trust
I went to a talk by John Mitchell on his trust management work on Monday. It's somewhat interesting stuff, but very different from my own work on trust metrics. Basically all of the "trust management" literature is vulnerable to a failure of any single "trusted" node. To me, this means that the security of any trust management deployment scales inversely with the number of users. Since a lot of the motivation behind trust management over simpler systems such as access control lists is to make things more manageable as they scale, I have a feeling that "trust management" will remain primarily interesting to academics for some time yet.
In any case, the problems they're struggling with now are pretty much the same as the ones I struggled with during my internship under Matt Blaze at AT&T in the summer of 1996 - discovering credentials, being able to analyze the algorithms, managing hierarchical namespaces. It's important to publish your work, dammit! Thus, I have some new motivation to finish my thesis.
rebar
I've put the sources up on casper. Run "./rebar testproj/" to test. It will build an executable stored in /tmp. The code should be interesting to read, but it isn't functional enough to use yet. (no pun intended, of course)
Thanks to the people who responded to my post, and sorry if I haven't replied. Yes, one of the key ideas is memoization across invocations. This is indeed similar to what compilercache does, but I believe that the idea goes back farther, at least to Vesta and probably before.
Anyway, it continues to be interesting, and I wish I had more time to work on it. | http://www.advogato.org/person/raph/diary.html?start=163 | CC-MAIN-2016-36 | refinedweb | 428 | 63.7 |
C# programming language Program Structure (way of write a program):
Before we study basic building blocks of the C# programming language, let us look at a bare minimum C#. Program structure so that we can take it as a reference in upcoming chapters.
C#, how to display message in consol, Example:
Console.WriteLine("hello this is my first program.");
A C# program basically consists of the following parts:
- Namespace declaration
- A class
- Class methods
- Class attributes
- A Main method
- Statements & Expressions
Now we take an Example for give the message:
1.Open IDE:
2.Go to file menu -> new -> project.
3.Select window and console application. Then give the name of project and click on ok.
Write fallowing code on page and run .
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("");
Console.WriteLine("hello this is my first program.");
Console.WriteLine("this is my asp.net tutorials notes");
Console.ReadKey();
}
}
}
Result of this C# Program:
In this program we simple print a message in consol. For print anything on consol we use fallowing commend or instruction with C# program.
Console.WriteLine("hello this is my first program.");
Console.ReadKey();
Here second instruction work as like getch() method in c programming.
Other Asp.net Related post:
- Show grid view row details in to tool.
- Ajax update panel with drop down list
- Select index change in drop down list
- How to archive many selection in drop
- Dynamically create data table and bind
- Example of Templatefield in gridview
- How to fill data into drop down list by Sql.
- Show grid view row details in to tooltip.
- How to Bind Gridview Form database.
- Introduction of Asp.net grid view Control.
- How to use asp ListView control in asp.net:
- how to use Captcha in asp.net Second post
-
- Example of Crystal report(Crystal_report_in asp.net programming )
- How to Make a HTML Table by C# code in asp.net programming
- Example of C# for Bind Data to asp.net Textbox inside gridview control
Learn how to Calculate Running Total, Total of a Column and Row
sql query for running total | http://asp-net-by-parijat.blogspot.in/2014/09/c-language-program-structure.html | CC-MAIN-2017-51 | refinedweb | 360 | 61.22 |
If your website displays the email address of your users, you may be increasing the amount of spam they get by allowing email harvesters to find a path to their inbox. Some websites use obfuscation methods such as "johndoe at example dot com", however many email harvesters have been designed to circumvent such tricks. reCAPTCHA Mailhide protects the user's email address by encrypting it. In order to decrypt the email address, a user must solve a reCAPTCHA to prove that they are a human. reCAPTCHA Mailhide provides a method by which you can obtain an encryption key for your own use.
Obtaining a key
To obtain an encryption key, you can go to the key generation service. This will compute a "public key", which much like a username identifies who you are to the Mailhide server, and a "private key" which allows you to encrypt email addresses.
Encrypting an email address
To send an email address to reCAPTCHA Mailhide, you must first encrypt it with your private key. The private key is a 128 bit AES key. The encryption works as follows:
Pad the email address to 16 bytes, as required by AES. We use a padding scheme that works as follows:
def pad_string (str, block_size): numpad = block_size - (len (str) % block_size) return str + numpad * chr (numpad)
First, we find out how many padding chars will be needed, a number between 1 and 16 inclusive. Then we append that number as many times as needed. For example, the string: x@example.com is padded to x@example.com\x03\x03\x03 where \x03 is the byte 3. \x03 was chosen because 3 padding chars were needed to pad the string.
AES encrypt the string. The private key is your AES encryption key. AES CBC mode is used with an initialization vector of 16 null bytes (in theory, using a common IV would allow an attacker to know if emails encrypted with the same key have a common 16 byte prefix. However, in order to decode both emails, the attacker still must solve a CAPTCHA. On the other hand an IV would make URLs significantly longer).
As an example, if you have the key deadbeefdeadbeefdeadbeefdeadbeef, you would get the following encryptions:
x@example.com
Padded version:
x@example.com\x03\x03\x03
Encrypted data:
c0 11 bb 9c e8 27 b4 aa 96 78 3a 45 f6 e7 15 35
johndoe@example.com
Padded version:
jonhdoe@example.com{\x0d 13 times}
If you have the openssl package, you can generate your own test data by doing:
echo -n "x@example.com" | openssl enc -aes-128-cbc -e -K deadbeefdeadbeefdeadbeefdeadbeef -iv 00000000000000000000000000000000 | hexdump -C
Base 64 encode the string. In order to safely put the encrypted string in a URL, it must be base 64 encrypted. We use a special base 64 encoding that is safe for URLs. Rather than using +, we use -, and rather than using / we use _. In Python, this is implemented as urlsafe_b64 encode.
As an example, with the same key as in part 2, you would get the following encodings:
x@example.com
Encrypted data:
c0 11 bb 9c e8 27 b4 aa 96 78 3a 45 f6 e7 15 35
Base 64 encoding:
wBG7nOgntKqWeDpF9ucVNQ==
johndoe@example.com
Base 64 encoding:
whWIqk0r4urZ-3S7y7uSceC9_ECd3hpAGy71E2o0HpI=
Creating a Mailhide URL
Once you've encrypted an email address, you can create a Mailhide URL for it. The Mailhide decoder is located at. You pass two items on the query string to this script:
The final product should look something like this:
Displaying the Mailhide URL
We recommend that you display email addresses protected with mail hide in one of the following styles:
joh<a href="...">...</a>@example.com
This is when you have only the email address, and not the name. It lets the viewer have a general idea of who's email they are seeing. In fact, the user may know who the email owner is just from this information and not need to decode the email address
The hyperlink is only applied to the ... to make it clear that the email address joh...@example.com isn't actually valid.
It is important not to reveal too much of the email address when operating in this mode. We recommend showing 2 character of the username if the username is 1-4 characters, 3 characters if the username is 5-6 and 4 characters for longer emails.
<a href="...">John Doe</a>
This method provides extra security because an attacker can't see any part of the email address.
When displaying a hyperlink to Mailhide, the following code is preferred:
<a href="?..." onclick="window.open('?...', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0, menubar=0,resizable=0,width=500,height=300'); return false;" title="Reveal this e-mail address">...</a>
This opens up a popup window if the user has JavaScript making sure the user
doesn't lose their place on your website. | https://developers.google.com/recaptcha/docs/mailhideapi | CC-MAIN-2014-15 | refinedweb | 822 | 63.59 |
05 August 2010 04:03 [Source: ICIS news]
SINGAPORE (ICIS)--Saudi International Petrochemical Co (Sipchem) said late on Wednesday that it has signed deals with ?xml:namespace>
“The agreements included a technology license agreement, a marketing agreement and a term sheet for ethanol procurement with Rhodia,” Sipchem said.
The new plant was part of phase III expansion program at Sipchem’s petrochemical base in
The etac plant would be designed as a swing facility that would also produce butyl acetate. Commissioning of the plant was expected in 2013, Sipchem said.
International Acetyl Co, an affiliate of Sipchem, would provide the feedstock acetic acid for the plant, while another feedstock ethanol would be imported.
The statement did not divulge the cost of the plant or other financial details of the | http://www.icis.com/Articles/2010/08/05/9382356/Sipchem-Rhodia-to-build-100000-tyr-etac-plant-in.html | CC-MAIN-2015-14 | refinedweb | 129 | 58.82 |
I am a huge fan of Ajax. If you want to create a great experience for the users of your website – regardless of whether you are building an ASP.NET MVC or an ASP.NET Web Forms site — then you need to use Ajax. Otherwise, you are just being cruel to your customers.
We use Ajax extensively in several of the ASP.NET applications that my company, Superexpert.com, builds. We expose data from the server as JSON and use jQuery to retrieve and update that data from the browser.
One challenge, when building an ASP.NET website, is deciding on which technology to use to expose JSON data from the server. For example, how do you expose a list of products from the server as JSON so you can retrieve the list of products with jQuery? You have a number of options (too many options) including ASMX Web services, WCF Web Services, ASHX Generic Handlers, WCF Data Services, and MVC controller actions.
Fortunately, the world has just been simplified. With the release of ASP.NET 4 Beta, Microsoft has introduced a new technology for exposing JSON from the server named the ASP.NET Web API. You can use the ASP.NET Web API with both ASP.NET MVC and ASP.NET Web Forms applications.
The goal of this blog post is to provide you with.
Creating an ASP.NET Web API Controller
The ASP.NET Web API exposes JSON data through a new type of controller called an API controller. You can add an API controller to an existing ASP.NET MVC 4 project through the standard Add Controller dialog box.
Right-click your Controllers folder and select Add, Controller. In the dialog box, name your controller MovieController and select the Empty API controller template:
A brand new API controller looks like this:
using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Web.Http; namespace MyWebAPIApp.Controllers { public class MovieController : ApiController { } }
An API controller, unlike a standard MVC controller, derives from the base ApiController class instead of the base Controller class.
Using jQuery to Retrieve, Insert, Update, and Delete Data
Let’s create an Ajaxified Movie Database application. We’ll retrieve, insert, update, and delete movies using jQuery with the MovieController which we just created. Our Movie model class looks like this:
namespace MyWebAPIApp.Models { public class Movie { public int Id { get; set; } public string Title { get; set; } public string Director { get; set; } } }
Our application will consist of a single HTML page named Movies.html. We’ll place all of our jQuery code in the Movies.html page.
Getting a Single Record with the ASP.NET Web API
To support retrieving a single movie from the server, we need to add a Get method to our API controller:
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using MyWebAPIApp.Models; namespace MyWebAPIApp.Controllers { public class MovieController : ApiController { public Movie GetMovie(int id) { // Return movie by id if (id == 1) { return new Movie { Id = 1, Title = "Star Wars", Director = "Lucas" }; } // Otherwise, movie was not found throw new HttpResponseException(HttpStatusCode.NotFound); } } }
In the code above, the GetMovie() method accepts the Id of a movie. If the Id has the value 1 then the method returns the movie Star Wars. Otherwise, the method throws an exception and returns 404 Not Found HTTP status code.
After building your project, you can invoke the MovieController.GetMovie() method by entering the following URL in your web browser address bar::[port]/api/movie/1 (You’ll need to enter the correct randomly generated port).
In the URL api/movie/1, the first “api” segment indicates that this is a Web API route. The “movie” segment indicates that the MovieController should be invoked. You do not specify the name of the action. Instead, the HTTP method used to make the request – GET, POST, PUT, DELETE — is used to identify the action to invoke.
The ASP.NET Web API uses different routing conventions than normal ASP.NET MVC controllers. When you make an HTTP GET request then any API controller method with a name that starts with “GET” is invoked. So, we could have called our API controller action GetPopcorn() instead of GetMovie() and it would still be invoked by the URL api/movie/1.
The default route for the Web API is defined in the Global.asax file and it looks like this:
routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } );
We can invoke our GetMovie() controller action with the jQuery code in the following HTML page:
<!DOCTYPE html> <html xmlns=""> <head> <title>Get Movie</title> </head> <body> <div> Title: <span id="title"></span> </div> <div> Director: <span id="director"></span> </div> <script type="text/javascript" src="Scripts/jquery-1.6.2.min.js"></script> <script type="text/javascript"> getMovie(1, function (movie) { $("#title").html(movie.Title); $("#director").html(movie.Director); }); function getMovie(id, callback) { $.ajax({ url: "/api/Movie", data: { id: id }, type: "GET", contentType: "application/json;charset=utf-8", statusCode: { 200: function (movie) { callback(movie); }, 404: function () { alert("Not Found!"); } } }); } </script> </body> </html>
In the code above, the jQuery $.ajax() method is used to invoke the GetMovie() method. Notice that the Ajax call handles two HTTP response codes. When the GetMove() method successfully returns a movie, the method returns a 200 status code. In that case, the details of the movie are displayed in the HTML page.
Otherwise, if the movie is not found, the GetMovie() method returns a 404 status code. In that case, the page simply displays an alert box indicating that the movie was not found (hopefully, you would implement something more graceful in an actual application).
You can use your browser’s Developer Tools to see what is going on in the background when you open the HTML page (hit F12 in the most recent version of most browsers). For example, you can use the Network tab in Google Chrome to see the Ajax request which invokes the GetMovie() method:
Getting a Set of Records with the ASP.NET Web API
Let’s modify our Movie API controller so that it returns a collection of movies. The following Movie controller has a new ListMovies() method which returns a (hard-coded) collection of movies:
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using MyWebAPIApp.Models; namespace MyWebAPIApp.Controllers { public class MovieController : ApiController { public IEnumerable<Movie> ListMovies() { return new List<Movie> { new Movie {Id=1, Title="Star Wars", Director="Lucas"}, new Movie {Id=1, Title="King Kong", Director="Jackson"}, new Movie {Id=1, Title="Memento", Director="Nolan"} }; } } }
Because we named our action ListMovies(), the default Web API route will never match it. Therefore, we need to add the following custom route to our Global.asax file (at the top of the RegisterRoutes() method):
routes.MapHttpRoute( name: "ActionApi", routeTemplate: "api/{controller}/{action}/{id}", defaults: new { id = RouteParameter.Optional } );
This route enables us to invoke the ListMovies() method with the URL /api/movie/listmovies.
Now that we have exposed our collection of movies from the server, we can retrieve and display the list of movies using jQuery in our HTML page:
<!DOCTYPE html> <html xmlns=""> <head> <title>List Movies</title> </head> <body> <div id="movies"></div> <script type="text/javascript" src="Scripts/jquery-1.6.2.min.js"></script> <script type="text/javascript"> listMovies(function (movies) { var strMovies=""; $.each(movies, function (index, movie) { strMovies += "<div>" + movie.Title + "</div>"; }); $("#movies").html(strMovies); }); function listMovies(callback) { $.ajax({ url: "/api/Movie/ListMovies", data: {}, type: "GET", contentType: "application/json;charset=utf-8", }).then(function(movies){ callback(movies); }); } </script> </body> </html>
Inserting a Record with the ASP.NET Web API
Now let’s modify our Movie API controller so it supports creating new records:
public HttpResponseMessage<Movie> PostMovie(Movie movieToCreate) { //; }
The PostMovie() method in the code above accepts a movieToCreate parameter. We don’t actually store the new movie anywhere. In real life, you will want to call a service method to store the new movie in a database.
When you create a new resource, such as a new movie, you should return the location of the new resource. In the code above, the URL where the new movie can be retrieved is assigned to the Location header returned in the PostMovie() response.
Because the name of our method starts with “Post”, we don’t need to create a custom route. The PostMovie() method can be invoked with the URL /Movie/PostMovie – just as long as the method is invoked within the context of a HTTP POST request.
The following HTML page invokes the PostMovie() method.
<!DOCTYPE html> <html xmlns=""> <head> <title>Create Movie</title> </head> <body> <script type="text/javascript" src="Scripts/jquery-1.6.2.min.js"></script> <script type="text/javascript"> var movieToCreate = { title: "The Hobbit", director: "Jackson" }; createMovie(movieToCreate, function (newMovie) { alert("New movie created with an Id of " + newMovie.Id); }); function createMovie(movieToCreate, callback) { $.ajax({ url: "/api/Movie", data: JSON.stringify( movieToCreate ), type: "POST", contentType: "application/json;charset=utf-8", statusCode: { 201: function (newMovie) { callback(newMovie); } } }); } </script> </body> </html>
This page creates a new movie (the Hobbit) by calling the createMovie() method. The page simply displays the Id of the new movie:
The HTTP Post operation is performed with the following call to the jQuery $.ajax() method:
$.ajax({ url: "/api/Movie", data: JSON.stringify( movieToCreate ), type: "POST", contentType: "application/json;charset=utf-8", statusCode: { 201: function (newMovie) { callback(newMovie); } } });
Notice that the type of Ajax request is a POST request. This is required to match the PostMovie() method.
Notice, furthermore, that the new movie is converted into JSON using JSON.stringify(). The JSON.stringify() method takes a JavaScript object and converts it into a JSON string.
Finally, notice that success is represented with a 201 status code. The HttpStatusCode.Created value returned from the PostMovie() method returns a 201 status code.
Updating a Record with the ASP.NET Web API
Here’s how we can modify the Movie API controller to support updating an existing record. In this case, we need to create a PUT method to handle an HTTP PUT request:
public void PutMovie(Movie movieToUpdate) { if (movieToUpdate.Id == 1) { // Update the movie in the database return; } // If you can't find the movie to update throw new HttpResponseException(HttpStatusCode.NotFound); }
Unlike our PostMovie() method, the PutMovie() method does not return a result. The action either updates the database or, if the movie cannot be found, returns an HTTP Status code of 404.
The following HTML page illustrates how you can invoke the PutMovie() method:
<!DOCTYPE html> <html xmlns=""> <head> <title>Put Movie</title> </head> <body> <script type="text/javascript" src="Scripts/jquery-1.6.2.min.js"></script> <script type="text/javascript"> var movieToUpdate = { id: 1, title: "The Hobbit", director: "Jackson" }; updateMovie(movieToUpdate, function () { alert("Movie updated!"); }); function updateMovie(movieToUpdate, callback) { $.ajax({ url: "/api/Movie", data: JSON.stringify(movieToUpdate), type: "PUT", contentType: "application/json;charset=utf-8", statusCode: { 200: function () { callback(); }, 404: function () { alert("Movie not found!"); } } }); } </script> </body> </html>
Deleting a Record with the ASP.NET Web API
Here’s the code for deleting a movie:
public HttpResponseMessage DeleteMovie(int id) { // Delete the movie from the database // Return status code return new HttpResponseMessage(HttpStatusCode.NoContent); }
This method simply deletes the movie (well, not really, but pretend that it does) and returns a No Content status code (204).
The following page illustrates how you can invoke the DeleteMovie() action:
<!DOCTYPE html> <html xmlns=""> <head> <title>Delete Movie</title> </head> <body> <script type="text/javascript" src="Scripts/jquery-1.6.2.min.js"></script> <script type="text/javascript"> deleteMovie(1, function () { alert("Movie deleted!"); }); function deleteMovie(id, callback) { $.ajax({ url: "/api/Movie", data: JSON.stringify({id:id}), type: "DELETE", contentType: "application/json;charset=utf-8", statusCode: { 204: function () { callback(); } } }); } </script> </body> </html>
Performing Validation
How do you perform form validation when using the ASP.NET Web API? Because validation in ASP.NET MVC is driven by the Default Model Binder, and because the Web API uses the Default Model Binder, you get validation for free.
Let’s modify our Movie class so it includes some of the standard validation attributes:
using System.ComponentModel.DataAnnotations; namespace MyWebAPIApp.Models { public class Movie { public int Id { get; set; } [Required(ErrorMessage="Title is required!")] [StringLength(5, ErrorMessage="Title cannot be more than 5 characters!")] public string Title { get; set; } [Required(ErrorMessage="Director is required!")] public string Director { get; set; } } }
In the code above, the Required validation attribute is used to make both the Title and Director properties required. The StringLength attribute is used to require the length of the movie title to be no more than 5 characters.
Now let’s modify our PostMovie() action to validate a movie before adding the movie to the database:
public HttpResponseMessage PostMovie(Movie movieToCreate) { // Validate movie if (!ModelState.IsValid) { var errors = new JsonArray(); foreach (var prop in ModelState.Values) { if (prop.Errors.Any()) { errors.Add(prop.Errors.First().ErrorMessage); } } return new HttpResponseMessage<JsonValue>(errors, HttpStatusCode.BadRequest); } //; }
If ModelState.IsValid has the value false then the errors in model state are copied to a new JSON array. Each property – such as the Title and Director property — can have multiple errors. In the code above, only the first error message is copied over. The JSON array is returned with a Bad Request status code (400 status code).
The following HTML page illustrates how you can invoke our modified PostMovie() action and display any error messages:
<!DOCTYPE html> <html xmlns=""> <head> <title>Create Movie</title> </head> <body> <script type="text/javascript" src="Scripts/jquery-1.6.2.min.js"></script> <script type="text/javascript"> var movieToCreate = { title: "The Hobbit", director: "" }; createMovie(movieToCreate, function (newMovie) { alert("New movie created with an Id of " + newMovie.Id); }, function (errors) { var strErrors = ""; $.each(errors, function(index, err) { strErrors += "*" + err + "n"; }); alert(strErrors); } ); function createMovie(movieToCreate, success, fail) { $.ajax({ url: "/api/Movie", data: JSON.stringify(movieToCreate), type: "POST", contentType: "application/json;charset=utf-8", statusCode: { 201: function (newMovie) { success(newMovie); }, 400: function (xhr) { var errors = JSON.parse(xhr.responseText); fail(errors); } } }); } </script> </body> </html>
The createMovie() function performs an Ajax request and handles either a 201 or a 400 status code from the response. If a 201 status code is returned then there were no validation errors and the new movie was created.
If, on the other hand, a 400 status code is returned then there was a validation error. The validation errors are retrieved from the XmlHttpRequest responseText property. The error messages are displayed in an alert:
(Please don’t use JavaScript alert dialogs to display validation errors, I just did it this way out of pure laziness)
This validation code in our PostMovie() method is pretty generic. There is nothing specific about this code to the PostMovie() method. In the following video, Jon Galloway demonstrates how to create a global Validation filter which can be used with any API controller action:
His validation filter looks like this:
using System.Json; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http.Controllers; using System.Web.Http.Filters; namespace MyWebAPIApp.Filters { public class ValidationActionFilter:ActionFilterAttribute { public override void OnActionExecuting(HttpActionContext actionContext) { var modelState = actionContext.ModelState; if (!modelState.IsValid) { dynamic errors = new JsonObject(); foreach (var key in modelState.Keys) { var state = modelState[key]; if (state.Errors.Any()) { errors[key] = state.Errors.First().ErrorMessage; } } actionContext.Response = new HttpResponseMessage<JsonValue>(errors, HttpStatusCode.BadRequest); } } } }
And you can register the validation filter in the Application_Start() method in the Global.asax file like this:
GlobalConfiguration.Configuration.Filters.Add(new ValidationActionFilter());
After you register the Validation filter, validation error messages are returned from any API controller action method automatically when validation fails. You don’t need to add any special logic to any of your API controller actions to take advantage of the filter.
Querying using OData
The OData protocol is an open protocol created by Microsoft which enables you to perform queries over the web. The official website for OData is located here:
For example, here are some of the query options which you can use with OData:
· $orderby – Enables you to retrieve results in a certain order.
· $top – Enables you to retrieve a certain number of results.
· $skip – Enables you to skip over a certain number of results (use with $top for paging).
· $filter – Enables you to filter the results returned.
The ASP.NET Web API supports a subset of the OData protocol. You can use all of the query options listed above when interacting with an API controller. The only requirement is that the API controller action returns its data as IQueryable.
For example, the following Movie controller has an action named GetMovies() which returns an IQueryable of movies:
public IQueryable<Movie> GetMovies() { return new List<Movie> { new Movie {Id=1, Title="Star Wars", Director="Lucas"}, new Movie {Id=2, Title="King Kong", Director="Jackson"}, new Movie {Id=3, Title="Willow", Director="Lucas"}, new Movie {Id=4, Title="Shrek", Director="Smith"}, new Movie {Id=5, Title="Memento", Director="Nolan"} }.AsQueryable(); }
If you enter the following URL in your browser:
/api/movie?$top=2&$orderby=Title
Then you will limit the movies returned to the top 2 in order of the movie Title. You will get the following results:
By using the $top option in combination with the $skip option, you can enable client-side paging. For example, you can use $top and $skip to page through thousands of products, 10 products at a time.
The $filter query option is very powerful. You can use this option to filter the results from a query. Here are some examples:
Return every movie directed by Lucas:
/api/movie?$filter=Director eq ‘Lucas’
Return every movie which has a title which starts with ‘S’:
/api/movie?$filter=startswith(Title,’S’)
Return every movie which has an Id greater than 2:
/api/movie?$filter=Id gt 2
The complete documentation for the $filter option is located here:
Summary
The goal of this blog entry was to provide you with an overview of the new ASP.NET Web API introduced with the Beta release of ASP.NET 4. In this post, I discussed how you can retrieve, insert, update, and delete data by using jQuery with the Web API.
I also discussed how you can use the standard validation attributes with the Web API. You learned how to return validation error messages to the client and display the error messages using jQuery.
Finally, we briefly discussed how the ASP.NET Web API supports the OData protocol. For example, you learned how to filter records returned from an API controller action by using the $filter query option.
I’m excited about the new Web API. This is a feature which I expect to use with almost every ASP.NET application which I build in the future.
Is this an evolution of what used to be called WCF Http… or whatever other name changes it went through? Does it replace it? How about WCF Data Services which used to be THE way to provide OData services? Is there any value in using it instead of Web API (for example the query interceptors)?
Stephen – thanks, fantastic post. I’ve been looking at the web API and trying to figure out how to get started, and how it relates to WCF data services etc. etc. This blog post will save me tons of time – thank you!
Stephen, thanks for this nice and clean post.
Stilgar, WCF Web API is now ASP.Net Web API. You can find the details here:
@Stilgar – ASP.NET Web API implements only a subset of OData. For example, the $inlinecount query option does not work with Web API and this option is useful for paging when you want to show the total page count. Standard ASP.NET MVC action filters can do the same work as WCF Data Services query interceptors.
Moving forward, I don’t see a big advantage to using WCF Data Services over the ASP.NET Web API. I like the ASP.NET API because it enables me to use the same validation and authentication mechanisms as the rest of my ASP.NET MVC application.
Stephen, do we have any chance to integrate the same business approach model to WCF Azure web service? Can we expose a list of products from the server as JSON with ASP.NET WEB API or it is integrated only with ASP.NET MVC and ASP.NET Web Forms applications?
@Slava — You can host Web API outside of IIS in a console application — see
With Azure, wouldn’t the easiest option to be to host a web role and use Web API with the web role? this using WebAPI?
Thanks,
Manuel
Really awesome post! Cool features and simple model!
CORRECTION: the xml tags were removed from my previous post but the tag that contains the “api/actors/1” content is the one I want to be automatically generated.
Great article and sample code. We passed it around to our entire department to read.
Mr. Walter, is this all that is planned as far as odata support before Web API is released and more specifically implementing things such as $inlinecount to enable paging and stuff like that. We’ve been playing around the forums of the framework just to find out that its data source can’t work with the standard output of the Web API and their developers concluded the same that the Web API with its partial support for odata can’t work the way it’s written and they cited lack of $inlinecount as a reason why paging can’t be implemented for instance.
@Manuel @Vasselin — The ASP.NET Web API is still beta, so this might change before the final release. I don’t work at Microsoft, so I don’t have any special insight here. Currently, the Web API only supports OData querying syntax — just the querying syntax — it does not change the format of the data returned (Under the covers, the Web API appears to be using the standard DataContractJsonSerializer used by WCF to serialize data into JSON).
Great. But unless you use MVC this is not easy to follow. While its probably too much to ask for the examples in webforms, perhaps you can create a zipped webforms project with a link to it?
@Jeremy — Take a look at Henrik’s blog post on Web API and Web Forms at
Hello Stephen – I’m hoping you can direct me to a reliable ASP-enabled hosting provider. We are struggling to find one that can support our current set up in an IIS environment: main site developed in ASP.net (SQL db) in tandem with WordPress blog utilizing a MY*SQL db. We can’t seem to find a reliable company (want them located in US) that can support both effectively with business processes in place (regular back ups, phone support). Cost is not our main concern, reliable service is … Would appreciate any insight you have. Thanks!
Hi Stephan,
This looks great. In the article you mentioned that we can use this with WebForms as well. I use webforms so it would be great to have an article with WebForms? is that a possibility?
thanks
Kamran
Great article!
Just one question. What would be the returned status code when there is an error (exception), let’s say, connecting to the database?
I would use a 400 Bad Request status code (the same status code returned for validation errors). See
I’ve used already WebApi in my university project. Looks great, but compared to Java it is nothing that special.
Is it possible with using the API controllers you could all but eliminate the regular MVC controller and views from the project all together? If i can do everything from my API controller and just create regular html pages why would I bother with calling a regular controller to call a view in a typical MVC project?
@Zack — Yes, you could do everything with HTML pages and the Web API. I’d still recommend using a server-side view (a .cshtml file) instead of an HTML page because you can use partials and generate URLs using MVC helper methods in a server-side view. We follow a convention of placing all client-side templates and dialogs in separate server-side partials which makes our applications more maintainable.
@Stephen – Thanks.
Do you consider a good idea, in practice, to expose as IQueryable the whole table?
( What about a malicious user that tries to get 1.000.000 records at 5 minutes?)
@Andrei — Take a look at the ResultLimitAttribute which should enable you to limit the number of results returned
Do the APICONTROLLER is replacement of controller? I mean do we now need to create html pages and use jquery for data request?
Or controller would still be part of and API controller would be in parallel with controller just for other client applications.
Please suggest | http://stephenwalther.com/archive/2012/03/05/introduction-to-the-asp-net-web-api | CC-MAIN-2017-43 | refinedweb | 4,165 | 58.08 |
GPIO tutorial for the BeagleBone Black
Want to get started controlling hardware from your BeagleBone Black? I've found a lot of the documentation and tutorials a little sketchy, so here's what I hope is a quick start guide.
I used the Adafruit Python GPIO library for my initial hacking. It's easy to set up: once you have your network set up, run these commands:
opkg update && opkg install python-pip python-setuptools python-smbus pip install Adafruit_BBIO
Pinout diagrams
First, where can you plug things in? The BBB has two huge header blocks, P8 and P9, but trying to find pinout diagrams for them is a problem. Don't blindly trust any diagram you find on the net; compare it against several others, and you may find there are big differences. I've found a lot of mislabeled BBB diagrams out there.
The best I've found so far are the two tables at elinux.org/BeagleBone. No pictures, but the tables are fairly readable and seem to be correct.
The official BeagleBone Black hardware manual is the reference you're actually supposed to use. It's a 121-page PDF full of incomprehensible and unexplained abbreviations. Good luck! The pin tables for P8 and P9 are on pp. 80 and 82. P8 and P8 are identified on p. 78.
Blinking an LED: basic GPIO output
For basic GPIO output, you have a wide choice of pins. Use the tables to identify power and ground, then pick a GPIO pin that doesn't seem to have too many other uses.
The Adafruit library can identify pins either by their location on the P8 and P9 headers, e.g. "P9_11", or by GPIO number, e.g. "GPIO0_26". Except -- with the latter designation, what's that extra zero between GPIO and _26? Is it always 0? Adafruit doesn't explain it. So for now I'm sticking to the PN_NN format.
I plugged my LED and resistor into ground (there are lots of ground terminals -- I used pin 0 on the P9 header) and pin 11 on P9. It's one line to enable it, and then you can turn it on and off:
import Adafruit_BBIO.GPIO as GPIO GPIO.setup("P9_11", GPIO.OUT) GPIO.output("P9_11", GPIO.HIGH) GPIO.output("P9_11", GPIO.LOW) GPIO.output("P9_11", GPIO.HIGH)Or make it blink:
import time while True: GPIO.output("P9_11", GPIO.HIGH) time.sleep(.5) GPIO.output("P9_11", GPIO.LOW) time.sleep(.5)
Fading an LED: PWM output
PWM is harder. Mostly because it's not easy to find out which pins can be used for GPIO. All the promotional literature on the BBB says it has 8 GPIO outputs -- but which ones are those?
If you spend half an hour searching for "pwm" in that long PDF manual and collecting a list of pins with "pwm" in their description, you'll find 13 of them on P9 and 12 on P8. So that's no help.
After comparing a bunch of references and cross-checking pin numbers against the descriptions in the hardware manual, I think this is the list: P9_14 P9_16 P9_21 P9_22 P9_28 P9_31 P8_13 P8_19
I haven't actually verified all of them yet, though.
Once you've found a pin that works for PWM, the rest is easy. Start it and set an initial frequency with PWM.start(pin, freq), and then you can change the duty cycle with set_duty_cycle(pin, cycle) where cycle is a number between 0 and 100. The duty cycle is the reverse of what you might expect: if you have an LED plugged in, a duty cycle of 0 will be brightest, 100 will be dimmest.
You can also change the frequency with PWM.set_frequency(pin, freq). I'm guessing freq is in Hertz, but they don't actually say.
When you're done, you should call PWM.stop() and PWM.cleanup().
Here's how to fade an LED from dim to bright ten times:
import Adafruit_BBIO.PWM as PWM PWM.start("P9_14", 50) for j in range(10): for i in range(100, 0, -1): PWM.set_duty_cycle("P9_14", i) time.sleep(.02) PWM.stop("P9_14") PWM.cleanup()
[ 12:36 Aug 11, 2013 More hardware | permalink to this entry | comments ] | http://shallowsky.com/blog/hardware/beaglebone-black-gpio.html | CC-MAIN-2013-48 | refinedweb | 711 | 74.08 |
Exporting your Twitter bookmarks in markdown file
People used to bookmark tweets using the like feature on Twitter. Later, they introduced Bookmarks feature that helps you save the tweets privately. And now, you have saved thousands of tweets and you can't afford to clear them.
How about we export those bookmarks safely in a file. You can use it as you like - in a web application maybe. It should be noted that Twitter DOES NOT provide an API to access the bookmarks. So, we might have to do some stuff manually here.
I am going to show you how to extract links to the bookmark as well in few lines of python code.
Step 1
Store the Twitter payload in JSON file
An alternative of this step is using the Postman Client. You might want to try it out first, here is the link to a blogpost that allows you to send the request and it's download feature enables you to download the response in a click.
If you don't have the setup, we can get back to copy pasting the response from our good old browser DevTools.
- Open Twitter web and go to the Bookmarks page
- Open Dev tools and go to Network tab
- Clear the network logs and select XHR
- Apply filter as "bookmark"
- Refresh the twitter bookmarks page
You would see some API calls are made as
bookmark.json like below image.
If you have tons of bookmarks, you might have to scroll till the end to get all pagination requests.
- After reaching the end. Select each request and copy paste the response received from the Response tab as shown in the image above.
- Save each response object with .json extension.
Step 2
Getting text and link of bookmarked tweets
- Once you have saved the JSON files, put them in a folder.
Now we just have to write a python script that would get us the links to the Bookmarks and text of the tweet!
- Reading JSON files from folder
import json import glob # using glob to read all files in the folder files = [file for file in glob.glob("JSONBookmarks/*")] for file_name in files: print(file_name) with open(file_name) as bk: data = json.load(bk) # reads json data all_bookmarks.append(data)
Here,
JSONBookmarks is the folder name.
glob() takes the path of the folder to read files from.
/* means all files.
The twitter payload explicitly doesn't have the link to the bookmarked tweets.
It provides two primary objects of our use with keys:
- tweets
- users
We will have to use this data in the payload to construct the url to the tweet.
# Function to construct bookmarked tweet url def constructUrl(tweet_id, username): return "" + username + "/status/" + tweet_id
Username can be accessed like this.
# Function to get username def getUserName(id): return response["users"][id]["screen_name"]
Now the final code that loops through all the tweets and writes in the markdown
# saving in markdown file, if no file exists using '+' creates one md_file = open("bookmarks.md", "w+") # Run a loop through all_bookmarks for data in all_bookmarks: response = data["globalObjects"] for tweet_id in response["tweets"]: tweet = response["tweets"][tweet_id] text = tweet["full_text"] url = constructUrl(tweet_id, getUserName(tweet["user_id_str"])) bookmarked_tweet = "\n- " + text + "\n" + "\t - " + url md_file.write(bookmarked_tweet)
The final output would look like this:
I have formatted it as I wanted, you can do something else too. Here is the whole code for you to refer in this gist. | https://divyajyotiuk.hashnode.dev/exporting-your-twitter-bookmarks-in-markdown-file?guid=none&deviceId=dac84b6e-df72-48d7-b63b-bad6489bf326 | CC-MAIN-2020-50 | refinedweb | 574 | 71.14 |
swift_qrcodejs
Cross-platform QRCode generator written in pure Swift, aiming to solve the awkward situation that there's no CIFilter for QRCode generation on Apple Watches.
Installation
Swift Package Manager
dependencies: [ .package(url: "", from: "1.1.1"), ]
CocoaPods
pod 'swift_qrcodejs'
Carthage
github "ApolloZhu/swift_qrcodejs" ~> 1.1.1
Manually
Copy all the
.swift files from the
Sources folder into your project.
Usage
import swift_qrcodejs guard let qrCode = QRCode("Hello World!") else { fatalError("Failed to generate QRCode") } print(qrCode.toString(filledWith: "##", patchedWith: " "))
For more, checkout the documentation.
Example Projects
- swift_qrcodejs-cli: lightweight command line tool to generate QRCodes.
- EFQRCode: popular Swift framework that generates stylized QRCode images.
- Apple Watch Bilibili: login onto bilibili with QRCode.
License
MIT License. Modified based on qrcodejs. See LICENSE and each individual file header for more information.
Github
Help us keep the lights on
Dependencies
Used By
Total: 4
Releases
1.1.1 - Mar 30, 2019
swift-version and podspec remains to be Swift 4.2 to maximize compatibility
1.1.0 - Feb 20, 2019
What's New
Added option to choose text encoding for QRCode data by @joaodforce (#5)
Author's Perspective
Some other parts of this library still assumes UTF-8, so I'm expecting to see some test cases, crash reports, and/or other failures to come in, based on my limited knowledge of QRCode. Please open issues and/or pull requests when you encounter unexpected results.
1.0.1 - Oct 21, 2018
What's New
Fix hanging when string exceeds the maximum capable length to convert (#4) Fix crashes when UTF-8 length of string is in range [195, 220] (#4)
1.0.0 - Oct 21, 2018
What's New
See for documentation and
| https://swiftpack.co/package/ApolloZhu/swift_qrcodejs | CC-MAIN-2019-22 | refinedweb | 281 | 51.55 |
This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
>I'm using gcc ver. 2.97-tru64-010710 downloaded from > (now I'm trying to download >and compile the newest 3.2.1 gcc). Great. I'd suggest trying to get 3.2.1 up and running first, and then dealing with this problem if you still have it. I know that gcc-3.2.0 worked on tru64, based on: So you should be able to get 3.2.1 working. If you still have the problem, another solution is to add explicit instantiations to get around weak linkage issues. You should be able to use the same solution that testsuite/21_strings/capacity.cc uses: #if !__GXX_WEAK__ // Explicitly instantiate for systems with no COMDAT or weak support. template std::basic_string< A<B> >::size_type std::basic_string< A<B> >::_Rep::_S_max_size; template A<B> std::basic_string< A<B> >::_Rep::_S_terminal; #endif Of course, you'll have to changeup the explicit instantiations to be the ones that you're missing (char, most probably.) best, benjamin | http://gcc.gnu.org/ml/libstdc++/2002-11/msg00308.html | crawl-001 | refinedweb | 181 | 68.26 |
This is a follow-up to the article "Compress Zip files with Windows Shell API and C#" by "Gerald Gibson Jr".
I needed a similar functionality for a very basic compression/decompression and didn't want to use any third party libraries. Out of the many options that I came up with, I thought the Windows Shell API served best for my purpose.
Granted, that this is not the best way to archive/un-archive files, but I found this to be one of the simplest ways to achieve what I needed.
What I'm presenting here is a simple wrapper class for archiving/un-archiving using the Windows Shell API with (very) minimal error handling. Additionally, I've also included a function to copy the file permissions from one file to another. This might be useful in some cases.
As the class uses the Shell32 namespace, a reference to Microsoft Shell Controls and Automation should be added to the project. This would come under the COM references section. The wrapper class is named ArchiveManager and has a few public static methods that expose the functionalities.
Shell32
ArchiveManager
public static
public static bool Archive(string archiveFile, string unArchiveFolder);
public static bool UnArchive(string archiveFile);
public static bool UnArchive(string archiveFile, string unArchiveFolder);
public static bool CopyPermissions(string sourceFile, string destFile) ;
The method names are pretty self explanatory, however a sample console application has been included in the accompanying code which shows sample usage of the wrapper class.
string _sourceFile = "Template.zip";
if (!ArchiveManager.UnArchive(_sourceFile))
{
Console.WriteLine("ERROR: " + ArchiveManager.LastError);
}
Other methods can be used in a similar way.
One of the issues with this approach is that the Shell32 APIs used to create/extract an archive are asynchronous. Meaning, our main thread cannot determine when the archiving/extracting methods are complete.
A rather crude approach has been used to get around this problem. I've used a wait loop that keeps sleeping till the number of items in the source folder (or zip file) and destination folder (or zip file) are equal, or, a timeout (configurable) occurs.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
public static bool Archive(string archiveFile, string[] Archivos)
{
try
{
_lastError = "";
// Check if the file has correct extension
if (!VerifyExtension(archiveFile))
return false;
// Create empty .zip archive
byte[] emptyArchiveContent = new byte[] { 80, 75, 5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
File.WriteAllBytes(Path.GetFullPath(archiveFile), emptyArchiveContent);
Shell shell = new Shell();
Folder archive = shell.NameSpace(Path.GetFullPath(archiveFile)); // Get the archive folder object
foreach (string Rec in Archivos)
if (File.Exists(Rec))
archive.CopyHere(Rec, 20);
else
{
_lastError = "ERROR: File not found " + Rec;
return false;
}
return true;
}
catch (Exception ex)
{
_lastError = "ERROR: Could not create archive. Exception: " + ex.Message;
return false;
}
}
System.IO.Compression
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages. | http://www.codeproject.com/Articles/645214/Compress-Decompress-Zip-Files-w | CC-MAIN-2015-22 | refinedweb | 511 | 52.6 |
I am sure that for every person that feels this way, there’s a person that feels the exact opposite.
Indeed. And also let’s all please keep in mind that most people here aren’t noobs with no programming experience. Even though I’m sure it’s not anyone’s intention, it can come across as dismissive and even a bit condescending to keep throwing around the “I’m telling you it’s good and you’ll learn love it once you give it a chance / get used to it” response. I presume that most programmers have worked in other languages before and a decent subset will already have experience in indentation-based languages. It’s unfair to always attribute their objections to inexperience.
I’m an example. I’ve experience in both styles and I’ve come to think that braces are better than whitespace. I’m not super passionate about it but overall I find there are no real advantages to one other the other, but, subtle and significant disadvantages to whitespace.
Btw can we clarify what the plan is? I was previously under the impression that one style would be chosen for Scala 3 and be the only style supported from 3.0 onwards. Then reading the above it sounds like both styles may be available simultaneously and then in the far future, one dropped. It would be really good to clarify what the story is.
Well, this was said on the gitter channel
So brace are going to stay no matter what (?) yielding even more styles of writing code.
Although I sympathize with the sentiment that there is not a lot of transparency on this issue, Martin Odersky is moving mountains to nail down “asless givens” very late in the development cycle. I think the claim he isn’t listening is unfair. Indeed, one may say that Martin must go to the mountain.
I would say it’s the process equivalent of an implementation restriction.
Let’s stipulate that the feature is “optional braces.”
As already hinted, it’s the same as if you felt strongly about using semi-colons. For example, the following semi is optional:
for (x <- xs ; if x > 0) yield x + 1
as is this one:
v match { case p() => x ; case q() => y }
and this entirely apart from the line-ending semi, which may or may not be optional:
def f: Int = 42; + 17
as attested
➜ ~ scala Welcome to Scala 2.13.4 (OpenJDK 64-Bit Server VM, Java 11.0.9.1). Type in expressions for evaluation. Or try :help. scala> { | def f: Int = 42 | + 17 | f | } + 17 ^ On line 3: warning: Line starts with an operator that in future will be taken as an infix expression continued from the previous line. To force the previous interpretation as a separate statement, add an explicit `;`, add an empty line, or remove spaces after the operator. + 17 ^ On line 3: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses val res0: Int = 42 scala> :quit ➜ ~ scala -Xsource:3 Welcome to Scala 2.13.4 (OpenJDK 64-Bit Server VM, Java 11.0.9.1). Type in expressions for evaluation. Or try :help. scala> { | def f: Int = 42 | + 17 | f | } val res0: Int = 59 scala>
Needless to add,
➜ ~ ~/scala3-3.0.0-M1/bin/scala Starting scala3 REPL... scala> { | def f: Int = 42 | + 17 | f | } def f: Int val res0: Int = 59 scala>
Let’s also stipulate that if you’re not doing K&R braces, you’re not really doing braces anyway.
braces and parens are interchangeable
Let’s agree that this has no syntactic basis.
For example, to explain
f(x) and
f { x }, you might say that
f(x, y) is the anomaly. If a function just takes an arg, it doesn’t matter if the arg looks like an expression or a block. (Apologies to the educators.)
Another optional chestnut is
extends:
scala> object X extends { def x = 42 } object X scala> X.x val res0: Int = 42
I would suggest that the uproar over optionality has much in common with differences over the formatting of comments. Scala acknowledges two or three formats, of which all but one are misguided and wrong. Such is the state of political discourse in America. But I think the important thing is that people can make headway in whatever it is they undertake.
No.. | https://contributors.scala-lang.org/t/scala-3-significant-indentation/4672/16 | CC-MAIN-2021-17 | refinedweb | 738 | 71.75 |
Based on the photo, I have a syntax error in line 14. It says “Invalid syntax (pyflakes E)”. What do you think this means?
Based on the photo, I have a syntax error in line 14. It says “Invalid syntax (pyflakes E)”. What do you think this means?
I tried typing “import deeplabcut” but a syntax error would show instead.
@RyanAvenido, these are core DeepLabCut files, you should not edit them. The line is actually
from deeplabcut import DEBUG, so just remove the line return.
Rather open the console and type the code into it interactively, or create your own Python script.
@jeylau, thanks for telling me. Do I need to reset my console? I think I need to use a new console in order to get this work.
What files do you think I edited?
To be more specific, here is the problem I have when I type “import deeplabcut”
You have edited the function
create_new_project in “new.py”. Roll back the changes you brought to the core files, these really should not be edited. DeepLabCut will then work fine.
How is it possible to undo what I possible did in the past week?
I would re-install deeplabcut
Here is the script for Deep Lab Cut. I may have edited something next to create_new_project. What is the text supposed to say? It’s by line 18.
Thank you all so much! I was able to figure out the problem. | https://forum.image.sc/t/syntax-issues-with-running-deeplabcut/44973 | CC-MAIN-2020-50 | refinedweb | 241 | 86.81 |
This site uses strictly necessary cookies. More Information
import System; <---this is up top at start btw.
var testarray : Decimal[];
testarray = [35.0,-3.3,4.0,18.2,-4.0,1.9];
ERROR GIVEN:"Cannot convert 'float[]' to 'System.Decimal[]'."
P.S. Same issue if casting them as Double[] and then filling with same numbers unless I put a "d" after the filled number for each.... So, what is the secret code letter to designate a decimal type?
I want to use higher precision math for more accurate output. (for DOD use). Looks like it is assuming anything with a decimal point is just a float and throwing this error. Do I need to type 30 zeros after the decimal point in each array position number? Because that would seem ridiculous to me.
Answer by OldManSmithers
·
Jul 04, 2018 at 03:51 AM
Just for anyone else coming across this question - the answer is to put an "m" after the number ---> 20m, 30m,.
Access a variable of a class stored in an array.
2
Answers
scale in lightmap access possible with Javascript?
1
Answer
split() for separators more than 1 characters
2
Answers
More like a bulletin than chat box
0
Answers
Problem With Javascript to Built-in Array
0
Answers
EnterpriseSocial Q&A | https://answers.unity.com/questions/1361746/how-to-allow-unityscript-to-see-decimal.html | CC-MAIN-2021-25 | refinedweb | 215 | 66.54 |
>>> import re
>>>>> mystring.find("ocra")
2
>>> re.search("ocra", mystring)
<_sre.SRE_Match object; span=(2, 6),
>>> re.search("banana", mystring)
>>> type(re.search("banana", mystring))
<class 'NoneType'>
>>> if re.search("ocra", mystring): print("found")
...
found>>> if re.search("banana", mystring): print("found")... >>>
f = open("/Users/katrinerk/Desktop/pg11.txt")
alice_lines = f.readlines()
alice_lines = [l.rstrip() for l in alice_lines]
f.close()
for line in alice_lines:
if re.search("Hatter", line): print( line )
>>> for line in alice_lines:
... if re.search("riddle", line): print(line)
begun asking riddles.--I believe I can guess that,' she added aloud.
'Have you guessed the riddle yet?' the Hatter said, turning to Alice
time,' she said, 'than waste it in asking riddles that have no answers.'
if re.search("ed them", line): print line
for line in alice_lines:
if re.search("[Hh]atter", line): print(line)
if re.search("t[aeiou][aeiou]n", line): print( line )
Are there any lines in Alice in Wonderland that contain longer sequences of digits?
if re.search("[0-9][0-9][0-9]", line): print(line)
if re.search("[0-9][0-9][0-9]", line): print(line)
if re.search("[^aeiou][^aeiou][^aeiou]", line): print( line)
if re.search("[^aeiou][^aeiou][^aeiou]", line): print( line)
Let's look for sequences of 3 or more digits again:
if re.search("\d\d\d", line): print( line)
What does this find?
if re.search("b\w\w\wed", line): print( line )
The period "." matches any single character: letter, digit, punctuation, whitespace, and anything else also. For example, "m..c" will match an occurrence of "m", then 2 characters whatever they may be, then "c".
if re.search("b...ed", line): print(line)
If you want to match a literal period, you have to put a backslash ("\") before it:
if re.search("ous\.", line): print(line)
This is called "unescaping" the special character -- it makes it nonspecial. This works with any special character: "\^" matches a literal caret, "\[" matches a straight bracket, and so on.
The "." is especially useful in combination with the "*" and the "+", which we discuss next.
"a+" stands for "one or more a's". "+" means "one or more", and it follows the sequence to be repeated.
"*" (star) stands for "zero or more".
For example:
What will this match? What could this be describing?
"\w+\s*=\s*\d+"
And how about this?
"[A-Z][a-z]*"
Here is some code that looks for the particle verb "give up" in a line, with arbitrarily many intervening characters:
if re.search("give.*up", line): print(line)
When would this go wrong: Can you think of cases where we wouldn't find a particle verb, or where we would find something we weren't looking for?
Both + and * can stand for arbitrarily many letters. But you can also specify the exact number of repetitions:
"a{5}" matches a sequence of 5 a's (but it also matches a sequence of 6 a's, because that will contain a sequence of 5 a's)
"(abc){3}" matches the sequence abcabcabc
A single verticle line "|" means "or". So
a|b
matches a single "a" or "b", same as [ab].
mov(es|ing|e|ed)
matches "moves", "moving", "move", and "moved".
if re.search("mov(es|ed|e|ing)", line): print(line)
Anchors don't match any characters, they mark special places in a string: at the beginning and end of the string, and at the boundaries of words (now, finally, we get to a regular expression character that is not ignorant to what words are!).
"^" matches at the beginning of a string. So
"^123"
will only match strings that begin with "123". Here is how you would look for lines in Alice in Wonderland that start with "The":
if re.search("^The", line): print(line)
This will not match any occurrences of "The" that are not at the beginning of the line, as we can see by counting:
>>> counter = 0
... if re.search("^The", line): counter = counter + 1
>>> counter
81
... if re.search("The", line): counter = counter + 1
198
"$" matches at the end of a string. So
"123$"
will match strings that end with "123". Here is how we would look for the word "Alice" occurring in the end of a line of Alice in Wonderland:
if re.search("Alice$", line): print(line)
There are two more anchors, as promised:
A word of caution: Some combination of \ + letter have special interpretations in strings, for example \n is newline. \b is backspace (delete a character to the left). We don't want Python to interpret "\b" in a regular expression as backspace. The way to say that is to put an r for "raw" before your string. (Looks weird, but is correct.) Like this: r"\bsing\b". This will match the word "sing" but not "singing" and also not "cursing".
Looking for lines in Alice in Wonderland that contain the word "sing" produces this result:
... if re.search(r"\bsing\b", line): print(line)
given by the Queen of Hearts, and I had to sing
'We can do without lobsters, you know. Which shall sing?'
'Oh, YOU sing,' said the Gryphon. 'I've forgotten the words.'
on. 'Or would you like the Mock Turtle to sing you a song?'
with sobs, to sing this:--
This is interesting: The second line has "sing?' ", the third has "sing,' " and both are recognized as "sing" followed by a word boundary. So \b is smart enough to identify punctuation.
Try it for yourself:
Find in Alice in Wonderland
So far, we have just checked whether a string matched an expression, without being able to say more specifically which parts of the string matched which parts of the expression. Now we change that.
Remember the mysterious Match object from above?
>>> re.search("ocra", mystring) <_sre.SRE_Match object; span=(2, 6),
If you look closely, you see that this Match object says what was matched: the string 'ocra' starting from the 3rd letter and ending before the 7th letter (span = (2, 6)). Here is how you extract this information:
>>> mobj = re.search("ocra", mystring)
>>> mobj.group(0)
'ocra'
>>> mobj.start()
>>> mobj.end()
6
So re.search() returns a Match object that has the following methods:
You can also do more fine-grained matches by using parentheses: Each pair of parentheses creates a "subgroup" that will be reported separately. Suppose we have a string that contains a phone number:
>>> mystring = "Phone number: 512-123-4567"
Then we can take it apart like this:
>>> mobj = re.search("Phone\D*(\d+)-(\d+)-(\d+)", mystring)
'Phone number: 512-123-4567'
>>> mobj.groups()
('512', '123', '4567')
>>> mobj.group(1)
'512'
>>> mobj.group(2)
'123'
>>> mobj.group(3)
'4567'
>>> mobj.start(1)
14
>>> mobj.end(1)
17
So, Match objects also have the following methods:
Using alice_lines from above, print all words of 6 letters or more occurring in Alice in Wonderland (not the whole lines, just the matching words)
Suppose we want to extract a substring starting at "<" and ending at a matching ">". We might try this:
>>>>> mobj = re.search("<.*>", mystring)
'<abc><def>'
But this didn't just extract <abc>, it extracted all of <abc><def> even though there was a ">" after the "c". This is because regular expressions do greedy matching: They always match the longest substring that they can. And since the longest substring here that has a "<", then arbitrary characters (which could also be ">") and that ends in a ">" is the whole string, it matches the whole thing.
You can tell your regular expression to match the shortest possible substring instead of the longest one, like this:
>>> mobj = re.search("<.*?>", mystring)>>> mobj.group(0)'<abc>'
>>> mobj = re.search("<.*?>", mystring)
'<abc>'
By using *? instead of just *, you do a non-greedy match. There is also +?
A more complex task
In the "Conditions, Lists and Loops" worksheet I talked about the task of splitting off punctuation. As I said there, Python's split() function leaves punctuation wherever it attaches:
>>> re
import string
sentence = "Computational linguistics (sometimes also referred to as natural language processing, NLP) is a highly interdisciplinary area."
# zero or more punctuation characters, then zero or more arbitrary characters
# ending in a non-punctuation character,
# then zero or more punctuation characters.
# All three pieces extracted using ( )
expr = "([" + string.punctuation + "]*)(.*[^" + string.punctuation + "])([" + string.punctuation + "]*)"
# this will hold the split sentence.
pieces = [ ]
for word in sentence.split():
m = re.search(expr, word)
# append all the non-empty pieces to the new sentence
for piece in m.groups():
if len(piece) > 0:
pieces.append(piece)
>>> print(pieces)
['Computational', 'linguistics', '(', 'sometimes', 'also', 'referred', 'to', 'as', 'natural', 'language', 'processing', ',', 'NLP', ')', 'is', 'a', 'highly', 'interdisciplinary', 'area', '.']
Try it for yourself: | http://www.katrinerk.com/courses/python-worksheets/python-worksheet-regular-expression | CC-MAIN-2019-26 | refinedweb | 1,438 | 68.36 |
We are regularly asked to check various open-source projects with the PVS-Studio analyzer. If you want to offer some project for us to analyze too, please follow this link. Another project we have checked is Dolphin-emu.
Dolphin-emu is a Gamecube and Wii emulator. Since this is an open-source project, anyone can introduce modifications into it. The code can be found on Github.
We have found quite few errors in the project. First of all, this is because of its small size: it is about 260 000 code lines. The rest of the project (1340 000 code lines) is comprised by third-party libraries which are not so much interesting to test.
Though there are few errors, certain code fragments are worth being told about in the article. What the other unsafe code fragments is concerned, the developers can examine them themselves using the trial version of PVS-Studio.
Misprints are insidious and they can be found in any application. Programmers are sure that they make only complicated mistakes and that analyzers should look for memory leaks and synchronization errors first of all. Unfortunately, reality is much more trivial: the most widespread errors are misprints and copy-paste mistakes. For example, there is this function in Dolphin-emu:
bool IRBuilder::maskedValueIsZero( InstLoc Op1, InstLoc Op2) const { return (~ComputeKnownZeroBits(Op1) & ~ComputeKnownZeroBits(Op1)) == 0; }
PVS-Studio's diagnostic message:
V501 There are identical sub-expressions '~ComputeKnownZeroBits(Op1)' to the left and to the right of the '&' operator. Core ir.cpp 1215
The misprint in this code causes the 'Op1' variable to be used twice, while the 'Op2' variable is not used at all. Here is another sample where a closing parenthesis ')' is in a wrong place.
static const char iplverPAL[0x100] = "(C) 1999-2001 ...."; static const char iplverNTSC[0x100]= "(C) 1999-2001 ...."; CEXIIPL::CEXIIPL() : .... { ... memcpy(m_pIPL, m_bNTSC ? iplverNTSC : iplverPAL, sizeof(m_bNTSC ? iplverNTSC : iplverPAL)); ... }
PVS-Studio's diagnostic message:
V568 It's odd that the argument of sizeof() operator is the 'm_bNTSC ? iplverNTSC : iplverPAL' expression. Core exi_deviceipl.cpp 112
The expression inside the sizeof() operator is not calculated. This code works only because the types of the 'iplverNTSC' and 'iplverPAL' arrays coincide. It appears that sizeof() always returns 0x100. This is an interesting thing: if the sizes of the 'iplverNTSC' and 'iplverPAL ' arrays were different, the code would work quite differently. Let's examine the test sample to make it clear:
const char A[10] = "123"; const char B[10] = "123"; const char C[20] = "123"; cout << sizeof(true ? A : B) << ", " << sizeof(true ? A : C) << endl;
This is the result of program execution: 10, 4.
In the first case the array's size is printed, and in the second the size of pointer.
Besides misprints there are many errors of handling such functions as memset() and memcpy().
u32 Flatten(..., BlockStats *st, ...) { ... memset(st, 0, sizeof(st)); ... }
PVS-Studio's diagnostic message:
V579 The memset function receives the pointer and its size as arguments. It is possibly a mistake. Inspect the third argument. Core ppcanalyst.cpp 302
It is the size of the pointer to an object which is accidentally calculated instead of the size of the BlockStats object itself. The correct code is: sizeof(*st).
Here is another similar situation:
void drawShadedTexSubQuad(..., const MathUtil::Rectangle<float>* rDest, ...) { ... if (stsq_observer || memcmp(rDest, &tex_sub_quad_data.rdest, sizeof(rDest)) != 0 || tex_sub_quad_data.u1 != u1 || tex_sub_quad_data.v1 != v1 || tex_sub_quad_data.u2 != u2 || tex_sub_quad_data.v2 != v2 || tex_sub_quad_data.G != G) ... }
Only a part of the structure is participating in comparison. The correct code is this: sizeof(*rDest).
In some fragments of the Dolphin-emu project, handling variables of the float types looks too optimistic. Operators == and != are used to compare float-variables. Such comparisons are admissible only in certain cases. To know more about comparison of float-variables see the documentation on the V550 diagnostic rule. Consider the following sample:
float Slope::GetValue(float dx, float dy) { return f0 + (dfdx * dx) + (dfdy * dy); } void BuildBlock(s32 blockX, s32 blockY) { ... float invW = 1.0f / WSlope.GetValue(dx, dy); ... float q = TexSlopes[i][2].GetValue(dx, dy) * invW; if (q != 0.0f) projection = invW / q; ... }
PVS-Studio's diagnostic message:
V550 An odd precise comparison: q != 0.0f. It's probably better to use a comparison with defined precision: fabs(A - B) > Epsilon. VideoSoftware rasterizer.cpp 264
Note the "if (q != 0.0f)" comparison. As you can see, the 'q' variable is calculated in a rather complicated way. As a consequence, it is almost improbable that it is CERTAINLY equal to zero. The variable will most likely get some value like 0.00000002, for instance. It is not 0, but division by such a small number might cause an overflow. A special check for such cases is needed.
void CMemoryWindow::onSearch(wxCommandEvent& event) { ... //sprintf(tmpstr, "%s%s", tmpstr, rawData.c_str()); //strcpy(&tmpstr[1], rawData.ToAscii()); //memcpy(&tmpstr[1], &rawData.c_str()[0], rawData.size()); sprintf(tmpstr, "%s%s", tmpstr, (const char *)rawData.mb_str()); ... }
You can see from the commented code that this is a weak point. This is already a fourth attempt to form a string. Unfortunately, it is far from being ideal, too. The PVS-Studio analyzer warns us:
V541 It is dangerous to print the string 'tmpstr' into itself. Dolphin memorywindow.cpp 344
What is dangerous about it is that the "tmpstr" string is printed into itself. This code can work correctly but you'd better not do it that way. Depending on how the sprintf() function is implemented, you may unexpectedly get an incorrect result. Consider using the strcat() function instead.
There are other code fragments that work well but are potentially dangerous:
V541 It is dangerous to print the string 'pathData_bin' into itself. Dolphin wiisavecrypted.cpp 513
V541 It is dangerous to print the string 'regs' into itself. Core interpreter.cpp 84
V541 It is dangerous to print the string 'fregs' into itself. Core interpreter.cpp 89
You can review all these and other errors yourselves by downloading PVS-Studio. The new trial mode allows you to see all the detected ... | https://www.viva64.com/en/b/0134/ | CC-MAIN-2021-10 | refinedweb | 1,004 | 59.7 |
A relaxed chat room about all things Scala. Beginner questions welcome. applies
@tirumalesh123
lift is just another name for
map, with a slightly rearranged signature.
map normally looks like
def map(fa: F[A])(f: A => B): F[B]. If you rearrange the arguments you get
def lift(f: A => B): F[A] => F[B], so you can look at
Functor as the api for lifting functions of one argument in
F. This extends to Applicative, which lets you lift functions of multiple arguments into
F, and ultimately into
Monad, which gives you the ability to change the structure of one computation based on the result of another.
et's say I have a method which returns optional if I want to get the value inside optional should I use lifting functions
yeah, pretty much. You should just
map (or
flatMap) and transform the
Option that way. I don't particularly like saying "the value inside the
F" because it's misleading in the long run, but it's a decent approximation at first
Deserializer[A](run: Array[Byte] => A)
A => Bgiving us a
Deserializer[B]
Serializer[A]
but basically it starts from thinking about what types are for (and not what they are against, to quote Connor McBride), to the fact that they are given meaning and semantics not by their underlying representation, but by the operations you define on them (let's say just functions for now).
The second step would be defining algebras as specifications of part of the behaviour of a data type. This works really well with typeclasses, which give you an
has a, rather than the is a relationship you typically get from OO style interfaces. The result of this thought process is that given a datatype, part of what it can do is specified by operations that are unique to that type, and part by algebras (i.e. Monoid, Functor, and so on). This kind of reasoning can be explained with simple types and lower kinded typeclasses only.
Then, you move on to explaining how types of higher kind can be used not just for containers, but for computations as well: List and Option are interesting because they can be viewed both ways, but there are somethings that really only make sense as computations (like State or IO).
At this point you can actually explain F-A-M as algebras that specify part of the behaviour of higher kinded types:
The final bit is learning how to operate on types based on their algebras and operations only, while being agnostic to their representation (e.g avoiding pattern matching on
Option): this is propedeutic to learning about types which either have an opaque representation (
IO) or a very complex one (
fs2.Stream). It also means that you can tackle a new library which exposes different types, and basically know most of what you need to do to use it once you know which algebras it forms (e.g. doobie ConnectionIO).
I guess the main problem with this approach is that it requires some upfront motivation, and ideally a mentor to give you clear explanations and "unstuck" you along the way
@dsebban_twitter
IO)
Vectorbranching factor, you might try the scala/contributors room, and/or
Vector("a","b","c","d"), since in 2.13 these will be passed as an
ArraySeq[String], we could just share the underlying array with the arrayseq like...
object Vector { def apply[A](elems: A*): Vector[A] = if (elems.length <= 32 && elems.unsafeArray.isInstanceOf[Array[AnyRef]]) { new Vector(0, elems.unsafeArray, 0) } else { ... } } | https://gitter.im/scala/scala?at=5c509e3a54f21a71a1c7196a | CC-MAIN-2020-29 | refinedweb | 592 | 56.59 |
Introduction
Executing Python scripts requires a lot of prerequisites like having Python installed, having a plethora of modules installed, using the command line, etc. while executing an
.exe file is very straightforward.
If you want to create a simple application and distribute it to lots of users, writing it as a short Python script is not difficult, but assumes that the users know how to run the script and have Python already installed on their machine.
Examples like this show that there is a valid reason to convert
.py programs into equivalent
.exe programs on Windows.
.exe stands for "Executable File", which is also known as a Binary.
The most popular way to achieve this is by using the
py2exe module. In this article, we'll quickly go through the basics of
py2exe and troubleshoot some common issues. To follow along, no advanced Python knowledge is needed, however you will have to use Windows.
Converting an interpreted language code into an executable file is a practice commonly called freezing.
Installing py2exe
To use the
py2exe module, we'll need to install it. Let's do so with
pip:
$ pip install py2exe
Converting Python Script to .exe
First, let's write up a a program that's going to print some text to the console:
import math print("Hannibal ante Portas") print(factorial(4))
Let's run the following commands in the Windows command line to make a directory (
exampDir), move the code we already wrote to said directory, and finally, execute it:
$ mkdir exampDir $ move example.py exampDir $ cd exampDir $ py example.py
This should output:
Hannibal ante Portas 24
Always test out the scripts before turning them into executables to make sure that if there is an error, it isn't caused by the source code.
Setup and Configuration
Make another file called
setup.py in the same folder. Here we will keep configuration details on how we want to compile our program. We'll just put a couple of lines of code into it for now:
from distutils.core import setup # Need this to handle modules import py2exe import math # We have to import all modules used in our program setup(console=['example.py']) # Calls setup function to indicate that we're dealing with a single console application
If we were dealing with an app with a graphical UI, we would replace
console with
windows like so:
setup(windows=['example.py'])
Now open Command Prompt as administrator and navigate to the directory we just mentioned and run the
setup.py file:
$ cd exampDir $ python setup.py py2exe running py2exe *** searching for required modules *** *** parsing results *** ...
dist folder
If all is done correctly, this should produce a subdirectory called
dist. Inside it, there will be a few different files depending on your program, and one of them should be
example.exe. To execute it from the console run:
$ example
And you'll be greeted by our Latin quote, followed by the value of 4!:
Hannibal ante Portas 24
Or, you can double click it and it'll run in the console.
If you'd like to bundle up all the files, add
bundle_files and
compressed, and set
zipfile to None like so:
from distutils.core import setup import py2exe setup( options = {'py2exe': {'bundle_files': 1, 'compressed': True}}, console = [{'script': "example.py"}], zipfile = None, )
And re-run the commands to generate the .exe file.
Now, your end-users can run your scripts without any knowledge or prerequisites installed on their local machines.
Troubleshooting
Errors while converting
.py files to
.exe files are common, so we'll list some common bugs and solutions.
How to Fix Missing DLL-s After Using py2exe
A common issue with py2exe is missing
.dll-s.
DLL stands for "dynamic-link library", and they're not there just to make bugs, promise. DLLs contain code, data, and resources which our program might need during execution.
After running the
.exe, if you get a system error that says something like:
The program can't start because something.dll is missing from your computer. Try reinstalling the program to fix this problem.
Or the command line says:
ImportError: (DLL load failed: The specified module could not be found.)
The solution is to find the missing
.dll and past it into your dist folder. There are two ways to do this.
- Search your computer for the file and then copy it. This will work most of the time.
- Find the missing
.dllonline and download it. Try not to download it from some shady website.
How to Generate 32/64-bit Executables Using py2exe?
To make a 64-bit executable, install 64 bit Python on your device. The same goes for the 32-bit version.
How to use py2exe on Linux or Mac
py2exe doesn't support on Linux or Mac, as it's aimed to create .exe files which is a Windows-unique format. You can download a Windows virtual machine on both Mac and Linux, use Wine or use a different tool like Pyinstaller on Linux, or py2app on Mac.
Conclusion
To make Python projects easier to run on Windows devices, we need to generate an executable file. We can use many different tools, like Pyinstaller, auto-py-to-exe, cx_Freeze, and py2exe.
Binary files may use DLL-s, so make sure to include them with your project. | https://stackabuse.com/creating-executable-files-from-python-scripts-with-py2exe/ | CC-MAIN-2021-17 | refinedweb | 889 | 66.23 |
Voted Best
ISSUE NO. 1744
6 - 12 December
By Joe Gerrard GUARDIA CIVIL and police customs officers have arrested a man in Fuengirola in connection with a joint Spanish and Belgian operation targeting drugs smuggling from South America. The man detained in Fuengirola was subject to a European Arrest Warrant. Police alleged he was one of the leading members of a Belgium-based gang who operated in Spain, France, the Netherlands, Colombia and Ecuador. A total of seven suspects were arrested in Fuengirola and Sabinallas. A further 12 were arrested in Belgium, police said in a statement. Officers launched their investigation after finding almost 800 kilograms of cocaine hidden inside wood shipments that had arrived in Algeciras from Ecuador. Belgian police also found around 470 kilograms of the drug hidden amongst wood inside containers that arrived in Antwerp about a month before the Algeciras find. Investigators claimed the
Newspaper in Spain 2017 & 2018
COSTA DEL SOL
YOUR PAPER, YOUR VOICE, YOUR OPINION
Drug gang bust
SEIZED: Police found the drugs hidden in wood shipments (inset).
Spanish cargo was set to be taken to a warehouse in Sabinillas where gang members would remove it from the wood before it was moved elsewhere. The operation, dubbed Fraternity by Spanish police, was co-ordinated by the European Union’s (EU) Judicial Co-operation Unit (EUROJUST). It saw Spanish and Belgian police officials meet at the agency’s headquarters in The Hague, in the Netherlands, which were also attended by officers conducting investigations in the countries. The probe was overseen in Spain by the Third Examining Court of Algeciras. Police said the operation came as part of ongoing efforts to tackle drug smuggling in the Campo de Gibraltar area and the southern coast of Spain. The investigation remains open.
Road deaths TWO people were killed on Tuesday after driving the wrong way down a motorway and crashing head on into a lorry in the Archidona area. Emergency services said they were alerted to the crash at around 4.15pm. Traffic officials said the car turned onto the A92-M motorway at kilometre one and travelled around three kilometres the wrong way. The car reached kilometre four when it hit an oncoming lorry. Guardia Civil officers, firefighters and medical personnel were all despatched to the scene of the crash after several witnesses alerted emergency services to the accident. Firefighters had to cut the passengers of the car free, but were found to have been killed, according to Malaga’s Traffic Management Centre. Emergency services closed the motorway to clear the road of debris. Queues around two kilometres long formed before the roads were reopened.
2 EWN
6 - 12 December 2018
NEWS EXTRA Tourist stays
Spain’s ‘bloodiest’ gang falls Credit: Policia Nacional
THERE were almost 25,687,000 overnight stays in hotels, hostels and other tourist lodgings on the Costa del Sol up to October this year, according to statistics from the region’s Tourist Board, a year-on-year fall of 1.2 per cent.
Craft work OFFICIALS with the Junta de Andalucia have granted Mijas the status of a Town of Regional Artisan Interest, which recognises areas for their large numbers of craft businesses if they meet the authority’s criteria.
Fort call MEMBERS of the Centrist Ciudadanos in Malaga City have called on council officials to put in place urgent measures to survey and repair parts of the Gibralfaro Castle after walls were damaged last month.
POLICE: Arrested the alleged gang in a series of raids.
By Sally Underwood POLICE car-
ried.
NEWS
Fake cash scam rumbled OFFICERS of the National Police have arrested two men, aged 22 and 24, for the alleged crime of posing as investors in a real estate scam. The suspects would show interest in private house sellers online, and once they had won the trust of the victim, they would propose transactions involving the use of fake €500 bills. Over the course of the police operation, €13,000 in cash has been seized, as well as a briefcase containing €145,000 in fake €500 and other equipment. The investigation began after a man went to the National Police in Malaga to complain of being caught in the scam. He explained that the suspects came up with various excuses relating to tax and banking problems as to why he could not make the payment online.
NEWS
6 - 12 December 2018
Baby death hearing
THE BIG PICTURE Nº 43
MALAGA City’s Fourth Court of Instruction has remanded a woman in custody in connection with the death of her one-and-ahalf-year-old daughter. Local Police officers arrested the detainee, 20, and a Moroccan national, following an alleged street brawl on Calle Viento last Friday at around 6.45pm.
Two held NATIONAL POLICE officers in Estepona have arrested two suspects in connection with a spate of vehicle thefts. Officers seized electronics which they said were used in the thefts along with several keys for high-end vehicles, with proceedings for the 31year-old and 50-year-old suspects having been sent to the courts.
Award rise THE number of tourism venues in Marbella to receive the TripAdvisor holiday review site’s Certificate of Excellence has tripled in the last four years, according to the company. The city is now home to 313 hotels, bars, restaurants and other establishments with the honour, up from 100 in 2014.
Wrong way OFFICERS with the Guardia Civil arrested a motorist last Sunday after allegedly being seen driving down the wrong side of the AP-7 into oncoming traffic. Police claimed the suspect drove around 10 kilometres down the motorway between La Cala de Mijas and Churriana before the arrest took place.
HIGH POINT: The Sierra Nevada mountain range lies in Granada Province.
Peak position THIS coming Tuesday is International Mountain Day, and what better way to mark the occasion than to look upon the magnificent slopes of one of Spain’s best-known Sierras. The Sierra Nevada mountain range lies in the Andalucia province of Granada in the south of Spain, and parts of it cross into the provinces of Malaga and Almeria. Its name translates to ‘the mountain range covered in snow,’ with its peaks
usually white from the cold conditions at their summits. The Sierra Nevada is home to the Mulhacen, the highest mountain in continental Spain and the third highest in Europe. The mountains also feature a National Park, a protected biosphere reserve, the Sierra Nevada Observatory and the IRAM telescope. The Sierra Nevada is also popular with skiers. Its ski resort is one of the
most southerly in Europe. The range is a member of the Alpine family, which also includes the Pyrenees, the Cantabrian Mountains, the Baetic System, the Atlas range and others across Europe, Africa and Asia. All of them formed after the tectonic plates that lie beneath Africa, India and the Eurasian landmass began colliding around 66 million years ago. That process is still ongoing in some mountain ranges in the Alpide belt.
EWN
3
REGULARS INSIDE News 1 - 46 Finance 48 Leapy 52 Time Out 77 - 80 Health & Beauty 81 Letters 82 Social 83 - 89 Pets 92 Services 94 - 97 Classifieds 98 - 106 Motoring 108 - 109 Sport 110 - 112
Stab probe TWO people aged 32 and 50 were taken to the Costa del Sol regional hospital last Friday evening after allegedly being stabbed on a Fuengirola street. Police have since arrested a 22year-old suspect in connection with the attack, which left one of the victims needing surgery after a blade pierced her lung.
Gun arrest MARBELLA National Police officers have seized a firearm which they claimed was used in an armed robbery at a mechanics workshop in San Pedro de Alcantara. A 60-year-old suspect has since been arrested in connection with the incident which left a mechanic wounded after being hit in the face with the butt of a gun.
6 hurt in crash Escort scam trial SIX people, including two youths, were left injured after an accident involving several vehicles on the A-7 motorway near Benalmadena. Sources with the 112 Emergency Services line said several passing drivers alerted them to the crash after it took place at kilometre 217 of the road. Guardia Civil officers and emergency medical personnel were despatched to the scene. They arrived to find three cars which had crashed in-
to one another, with the cause of the collision unknown. Medical personnel had to pull some of the passengers from their cars after they became trapped following the crash. The passengers were a three-yearold boy, a six-year-old girl, three women aged 26, 34 and 36 and a man aged 27. All were taken to Benalmadena hospital, with the seriousness of their injuries not stated by emergency services.
Do you have news for us?
Email: newsdesk@euroweeklynews.com or call 951 38 61 61 and ask for the EWN news team.
A COURT in Malaga City has jailed a man for two years after he was found guilty of hiring €5,450 in escort services without paying. The court stated in its ruling that the defendant had aimed to get ‘illicit benefits’ from the escort agency and that he had no plans ever to pay for them. The court has also ordered the defendant to pay back the money owed to the company. The court
216
heard the man began hiring the services in April 2017. Prosecutors said he arranged for the services of two women on separate occasions for €2,250 and €2,850 including a €600 deposit which he agreed to pay through a bank. The man placed envelopes into a bank deposit machine but they were empty. The hired women then met the man and gave him the €600 deposit back believing the full amount had been paid.
The total number of news and features which appeared in Issue 1743 of the Euro Weekly News Costa del Sol edition, including 159 local stories.
6 - 12 December 2018
Anti far-right march AROUND 1,000 people took to the streets of Malaga City on Monday to protest against the election of members of a farright political party to Andalucia’s regional assembly. Protesters marched down Calle Larios towards the Plaza de la Constitucion in the centre of the city after Vox won 12 seats in Sunday’s vote. Three of those from the party, known for its hard-line stance on immigration and Spanish unionism, were elected in Malaga Province. One leftist group which took part in the march said on Twitter: ‘To stop the extreme right you have to build a revolutionary alternative in the streets. Build it together!’ Police sources said they estimated that around 1,000 people gathered in central Malaga City for the march. Demonstrators carried placards and chanted slogans including: ‘Your hate does not belong here’and ‘Hitler was also elected’. The march took place around the same time shoppers were in the city for the Christ-
MORE than 200 people have been taken on in Algeciras to work on the world’s largest construction ship which has docked in the city for two weeks. The Pioneering Spirit, which transports offshore oil platforms, is in the dock for maintenance work, crew changes and to take on supplies and spare parts. It is reportedly the first time
NEWS
YOUR LOCAL WRITER CREDIT: Izquierda Revolucionaria, via Twitter
By Joe Gerrard
CONTACT HIM:
Joe Gerrard
951 386 161 ANTI-FASCIST DEMO: Protesters marched through central Malaga on Monday. mas season and shortly before, a sound and music show on Calle Larios. Vox was founded in 2013 and has grown on the back of its anti-migrant stance, as well as its staunch opposition to independence movements in Cataluña and elsewhere in Spain. Members of the party say they support a
free-market economy, a centralised Spanish state and the ‘moral health’ of society and culture. Critics accuse them of racism, sexism and homophobia. They have also been accused of courting the support of fascists and neoNazis, and of being nostalgic for Spain’s former dictator, Francisco Franco.
Largest ship CREDIT: Wikimedia Commons
4 EWN
IN PORT: The Pioneering Spirit docked in Algeciras.
a vessel of its kind has docked in Algeciras. Pepe Rios, of the Alfaship shipping company and based in Algeciras, said the docking was significant because ships such as Pioneering Spirit typically docked in Las Palmas in Gran Canaria. “This is a milestone and we are trying to attract this type of vessel through our company to Algeciras’ port,” Rios said.
joe@euroweeklynews.com
Election results THE votes have been counted from last Sunday’s regional ballot in Andalucia and the three leading parties gained three seats in Malaga Province apiece. The left leaning Partido Socialista (PSOE), which currently runs the Junta de Andalucia, gained almost 152,280 votes or 24.2 per cent of the total cast. The conservative Partido Popular (PP), the largest opposition party in Andalucia, won 142,182 votes, 22.6 per cent. Ciudadanos, the centrist party which saw its total Andalucia Parliament seat numbers jump from nine before the vote to 21 afterwards, scored 124,573 votes or 19.8 per cent. The coalition of leftist parties running for the Adelante Andalucia umbrella group gained three seats and 98,440 votes, more than 15.6 per cent of the total. The far-right Vox, which made headlines after winning its first seats in the assembly, gained two seats in Malaga Province, 72,455 votes, about 11.5 per cent of the total. Voter turnout in Malaga Province stood at more than 56.6 per cent, dropping from almost 61.1 per cent in the 2015 vote. No party won an absolute majority in the 109 seat Andalucia Parliament.
6 - 12 December 2018
NEWS EXTRA Road plan go ahead COUNCILLORS in Coin have approved plans to repair the Huertas Nuevas, Aguera and La Carreta to Villafranco roads which have deteriorated after years of use and suffered further damage following recent storms and floods.
Rail bid SPAIN’S railway infrastructure body ADIF has tendered contracts worth more than €578,118 to replace sleepers on the Fuengirola to Malaga City Cercanias suburban line to improve stability and safety for passengers.
On track WORKERS with Benalmadena Council have begun making renovations to the town’s athletics track and sports centre, with the project’s budget standing at €1.2 million.
Centre plan MARBELLA’S mayor Angeles Muñoz has announced the city’s council will give an €8,000 grant to a centre which supports children with intellectual gifts who lack adequate support in schools to achieve their potential.
Replica makes history ESTEPONA Council has announced that a model of an English ship which took part in the Battle of Trafalgar is being exhibited in its Puertosol building until March 31, 2019. The replica is the work of local resident Jose Miralles, who has dedicated 11 years to the project which has involved the carving of thousands of small pieces of wood. The ship has been made on a 1/50 scale and is a faithful reproduction of the HMS Victory line vessel that was under the command of Admiral Horatio Nelson during the Battle of Trafalgar. As part of his research, Jose Miralles visited the ship several times in Portsmouth and took detailed notes. For the rigging, Miralles spent a week visiting the
Credit: Ayuntamiento de Estepona
6 EWN
SHIP SHAPE: The intricate model took 11 years to painstakingly construct. Science Museum in London to analyse the structure of a model of the HMS Victory. Miralles has even created 90 figurines which represent the different ranks of the officers and crew.
He has revealed that the vessel could hold up to 850 people on board, and that living conditions were not comfortable. The sails of the ship were created using a 3D printer,
and other parts were also produced using this method. The replica has previously been displayed by the Naval League of Andalucia and the Casa de Las Tejerinas in Estepona.
Fugitive appeal POLICE in Warwickshire in the UK, have appealed for information in connection with the disappearance of a man convicted on drugs offences who is believed to have fled to Spain. Officers said Luke Daniel Clarke, 22, from the Nuneaton area, absconded from a sentencing hearing at Warwick Crown Court on Thursday November 22. He may now be hiding in near Malaga or Marbella on the Costa del Sol, police added. Anyone with information has been urged to call Warwickshire Police on 101 from Britain and +44 1926 410000 from Spain.
CREDIT: Shutterstock (main), Warwickshire Police (inset)
WANTED: Clarke is believed to have fled to the Costa del Sol.
NEWS
Brit arrest in ‘onepunch’ kill case, a father of three died in Malaga’s Carlos Haya Hospital, 10 days after a late-night street attack on August 14. However, it is believed the purpose of the unidentified suspect’s return to Spain was to hand himself in to authorities. He was reportedly questioned at a police station near the airport before appearing in court ‘attacker.’
8 EWN
6 - 12 December 2018
NEWS EXTRA Centre plan WORKERS from Marbella Council are set to demolish a shopping centre in Guadalmina built in 2006, after local authorities found it did not comply with planning regulations and a Malaga court voided its permit.
Art permits FUENGIROLA’S council opened the application period for licences for public performance artists on Monday, with those interested asked to submit their bid by January 31, with 15 permits available.
Work data ALMOST 30 per cent of workers employed in Andalucia’s tourism industry work in Malaga Province according to data which showed a growth in staff of 4.2 per cent between January and September compared to last year.
Bioparc branches out By Tom Woods IT may be 2018, but it is still possible to find love th ro u g h a m atch m ak e r and an arranged marriage. That is what has happened to one of the most fam o u s in h ab itan ts o f Fuengirola’s Bioparc. After more than a year of living in the zoo, gorilla Echo will meet his new p artn er in th e n ex t few days. Trav ellin g 2 ,3 0 0 k m fro m Ch essin g to n Zoo (Lo n d o n ) to jo in Ech o and begin a new chapter in their lives, is 20-yearold Buu. Bu u was alread y a
mother in London, and hopes are high that she will have a family with Echo in the Bioparc. After the death a few months ago of legendary silverback Ernst who had been in the Bioparc for 14 years, the zoo has made some major changes to facilities and security. It has also become the fifth largest gorilla breeding park in Spain, doing vital work to protect one of the 10 most threatened primates in the world.
MALAGA’S Provincial Commissioner for the National Police has written a letter in which he talks about his love of the area ahead of his relocation to Navarra. Francisco Lopez Canedo, who
GOING APE: Echo will be delighted to have a female companion.
Malaga love letter
Credit: BioparcF
has served in the role since April 2017, wrote: ‘I have to say it has been a magnificent and enriching experience, both in a professional and personal capacity. ‘I feel especially pleased.’
NEWS
Ship suspect arrested POLICE in Malaga City have arrested a suspect in connection with the death of a migrant woman aboard a boat intercepted by coastguards. Officers say the suspect, from Senegal, was the captain of a boat carrying 50 migrants across the Mediterranean in an attempt to reach Spain. Police said they arrested him on suspicion of committing reckless homicide and violating the rights of foreign workers. Initial investigations suggest the woman died after being crushed on the overcrowded boat but their probe remains open. Officers arrested the suspect as he disembarked from the Salvamento Maritimo’s Guardamar Caliope ship. Other passengers have been transferred to a temporary migrant shelter on Malaga City Port’s Pier 6. The investigation into the suspect’s alleged offences continues.
10 EWN
6 - 12 December 2018
NEWS EXTRA Pension findings SPAIN has the largest proportion of widows drawing pensions out of its retirees in the developed world, according to a report from the Organisation for Economic Co-operation and Development (OECD).
Abuse data ALMOST half of those who claimed they were the victims of sexual offences in 2017 were underage, figures from the Interior Ministry showed, with 4,542 youths out of a total of 9,537 people filing complaints last year.
Hotel hack AROUND 500 million people may have personal details including their names, addresses, emails, passport information and phone numbers breached following the alleged computer hacking of one of the Marriott International hotel chain’s databases.
NATIONAL
Toddlers drive to surgery A SPANISH hospital has launched a stress-reducing initiative which allows children ‘drive’ themselves to the operating room in an electric car. While a member of staff controls the vehicle by remote, the scheme helps ‘eliminate the stress and tears’ of young patients prior to surgical treatment. A spokesperson for IMQ Zorrotzaurre Hospital in Bilbao, said the car system ‘is demonstrating great efficiency, getting children who require surgery to go more quietly to the operating room.’ General director, Nicolas Guerra, said there was ‘considerable concern about the tears and the state of nervousness and anguish of the little ones.’ He added that it was extremely difficult to calm some children once they realised they were being separated from their parents. The team of IMQ anaesthetists were reportedly most
BIG HIT: Almost 100 per cent of the young patients asked opted to drive to surgery.
concerned about the levels of anguish because ‘if children fall asleep scared, they will wake up in the same way.’ While if a child falls asleep calmly, ‘they tend to wake up from the intervention with less upset and worry.’ After mulling over a number of ideas and researching what was done in other hospitals, the hospital board de-
cided to purchase an electric car. A survey of nurses, surgeons and anaesthetists who spoke with young patients revealed 98 per cent of children wanted to use the car, all of whom entered the operating room ‘calm and without tears.’ Of those, 95 per cent woke up ‘calm and without agitation.’
Balcony rescue A MAN who had left his keys in his flat tried to get in through his balcony and ended up hanging from the façade before police rescued him. The 49-year-old climbed onto the roof of the apartment block in Sant Andreu de la Barca, and using a
rope, lowered himself over the edge. It transpired the rope wasn’t long enough, and he was left hanging precariously. Neighbours notified the police and fire service, who brought him back to safety.
ADVERTISING FEATURE
6 - 12 December 2018
EWN 13
Nobu Marbella launched its Winter Omakase menu Nobu Restaurant, located in Puente Romano Marbella, has launched its winter Omakase Menu. Omakase means in Japanese ‘I’ll leave it up to you’ and refers to chef’s selection. The dishes include legends from Nobu Style cuisine; the appetizers consist of three choices: Salmon ‘New Style’ Sashimi, White Fish Dry Miso or Sashimi Salad Matsuhisa. The main course cannot be without Black Cod Miso and as the sweet treat, there is the classic Green Tea Tartlet.
Nobu Restaurant & Lounge, the first Nobu opened in Spain, is located in the centre of Puente Romano’s lively ‘La Plaza.’ The famous and unique gastronomy hub offers a variety of restaurants and cocktail bars. Through diversity and innovation it attracts outgoing and passionate guests from all round the world. Winter Omakase menu is served for dinner between Sunday and Thursday. Price is 45€ per person.
For reservations please write dine-marbella@nobuhotels.com or call Tel (+34) 952 778 686
6 - 12 December 2018
CREDIT: DENAES, via Twitter
14 EWN
NEWS EXTRA Prison data THERE were 137.9 inmates in Spanish prisoners per every 100,000 people living in the country on average from 2005 to 2015 according to a new Council of Europe report which found that the same figure for Britain was 148.3.
More drugs SPAIN has the highest consumption of antibiotics in Europe, with many people taking them for no good medical reason, it has been announced. Self medication for the common cold is largely to blame.
Migrant call SPAIN’S Secretary of State for Security, Ana Botella has revealed that the government is working hard to convince the EU of the migration challenges Spain is facing, and the need for more resources to address it.
RALLYING: Demonstrators gathered in Madrid’s Plaza de Colon.
Unity rally THOUSANDS of protesters took to the streets of Madrid on Saturday to demonstrate in favour of Spanish unity and against regional independence movements. The rally saw demonstrators accuse pro-Catalan independence figures and others leading a coup against Spain and claimed they acted with impunity. It was organised by the Foundation for the Defence of
the Spanish Nation (DENAES) and backed by the far-right Vox party. It was also attended by members of the conservative Partido Popular (PP) including local politicians. Javier Ortega, secretary general of Vox, said protesters gathered there had the ‘determined will’ to demonstrate until all pro-independence figures were jailed. Protestors in the Plaza de Colon waved Spanish flags and
chanted slogans which included calling for the abolition of regional autonomy in Cataluña. They also branded pro-independence parties, unions and groups “criminal organisations”. Those rallying also called for former Catalan President Carles Puigdemont to be imprisoned and chanted: ‘Long live Spanish unity.’ The demonstration ended with the playing of the Spanish national anthem.
NATIONAL
Murder suspect ‘destroyed’ evidence POLICE believe a teenager accused of killing another girl threw away the clothes she was wearing on the night of the attack, to evade suspicion. The accused, Rocio M, aged 19, was arrested on suspicion of killing Denisa Maria, 17, on Monday after allegedly stabbing her multiple times in the chest in Alcorcon, Madrid. Officers from the National Police believe Rocio’s father, who works for the Guardia Civil, helped his daughter dispose of the sweatshirt she was wearing the night of the attack to avoid physical evidence linking her to the crime. Sources also claim the man did not co-operate with police and even tried to hide his daughter’s mobile phone. Officers say the evidence against Rocio is strong, claiming the victim was on her phone to a friend when she was stabbed. Denisa allegedly said, ‘Rocio, Rocio, what are you do-
ing,’ before telling her friend, ‘they have stabbed me with a knife, help me.’ Her friend later found Denisa lying on the ground on the town’s Calle Desmonte. Health workers managed to stabilise the girl and transferred her to hospital where she later died. Police believe the accused was concerned her boyfriend, Mario, who had been in a relationship with the victim before, would leave her for Denisa. The victim’s parents claim Rocio had been sending their daughter threatening messages through WhatsApp. On Wednesday, a judge jailed Rocio pending trial. Rocio denied the charges, claiming she spent the evening of the murder with Mario, going out to eat a burger. Police say they cannot find any evidence the pair ate in a restaurant and Rocio’s mobile phone GPS history puts her near the crime scene.
16 EWN
6 - 12 December 2018
Expat death plunge One dead in rescue drama By Tom Woods A BRITISH man has fallen to his death while abseiling down a mountain near Spain’s Costa Blanca known as the ‘Sleeping Lion.’ The unnamed 36-year-old was with his sister-in-law who was rescued by helicopter and taken to hospital with a broken leg. The climber reportedly fell more than 24 metres while abseiling down Monte Ponoig, near
TRAGIC FALL: Mountain rescue experts are inspecting the area for evidence.
Civil GREIM team will be carrying out a site inspection later today to try to establish why this accident happened.” The abseil anchor reportedly broke away, but as the woman fell from a lesser height of almost eight metres,.
NATIONAL
Woman dies in fire A BLAZE at an apartment building has claimed the life of a 64-year-old woman. Another adult and a child who both lived with the deceased, suffered from smoke inhalation, while one of the casualties also received burns and was transferred to a nearby hospital in Barcelona. The fire broke out at the Paseo de la Zona at 2.50am last Friday, and the surrounding roads were closed for two hours while emergency services dealt with the incident.
Bank probe INVESTIGATORS with the European Union (EU) have concluded that the Spanish government is at fault for not adopting rules designed to regulate the banking industry following the financial and eurozone crises which began in 2008.
18 EWN
6 - 12 December 2018
NEWS EXTRA Art attack RONALD LAUDER, president of the World Jewish Congress, has hit out at what he sees as a lack of political will by Europe (and Spain in particular) to investigate artworks stolen by the Nazis.
Money march THOUSANDS of Catalan civil servants joined strikes and ongoing protests by students and health workers to demand more funding and better working conditions, with around 8,000 people marching to the Barcelona regional parliament.
NATIONAL
Constitution day Spanish mark 40 years of democracy EVENTS have been organised across Spain today (Thursday) to mark 40 years since the adoption of the country’s Constitution. Government officials and members of Spain’s parliament are set to gather at the Congress of Deputies for an institutional commemoration of the anniversary. Ana Pastor, President of the Congress of Deputies, said the
anniversary was a celebration of Spain’s freedom, progress and reconciliation since adopting democracy in 1978. The government’s Constitution 40 body has organised a programme of events taking place today to mark the anniversary. Other events have already gone ahead this year including visits to regional assemblies by Pastor. Exhibits from Spain’s EFE news agency featuring photographs from the 40 years since the Constitution was adopted, are in Madrid and other cities across Spain. The Congress of Deputies and the Senate, the lower and upper houses respectively of Spain’s Cortes Generales, were also open to the public this week for tours. Princess Leonor, the daughter of King Felipe and Queen Letizia and heir to the Spanish throne, was one of many figures who read extracts from the Constitution for the anniversary. Pedro Sanchez, Spain’s prime minister, also read Article Two of the Constitution at the Cervantes Institute in Madrid in October. Article Two states that Spain is an ‘indissoluble union’ and
40 YEARS: Spain adopted its Constitution on this day in 1978. establishes autonomy for the country’s regions. Sanchez has proposed making a number of changes to the Constitution including modifying the article from which he read to recognise Spain’s regional diversity. Critics claim it would open the way for regions such as Cataluña and the Basque Country to break away from Spain. Reforms proposed by the centrist Ciudadanos to end legal immunity for politicians have also been backed by Spain’s
political parties and look set to be written into the Constitution. Work on the Constitution began after former dictator Francisco Franco’s death on November 20, 1975 and the installation of King Juan Carlos I on the Spanish throne two days later. Politicians elected to Spain’s parliament in 1975 in the country’s first democratic elections since the Second Republic were tasked with coming up with proposals for the Constitution. Parliament approved their
plans on October 31, 1978. The Constitution was then put to a referendum on December 6 and it was backed by almost 92 per cent of those who voted, with it ratified once ballots were counted. The Constitution is made up of 169 Articles which commit the government to protecting certain rights, lay out the structure of the Spanish state and define conditions for citizenship. It has been amended twice since, once in 1992 and again in 2011.
20 EWN
6 - 12 December 2018
BREXIT BRIEF
More time THE EU is ready to offer Britain a three-month extension to Article 50 to prevent parliamentary deadlock resulting in a no-deal Brexit. Under plans being discussed by European leaders, the EU would agree to extend Britain’s membership to allow time for a trade arrangement to be ironed out. However, Theresa May has claimed that any extension to Article 50 would require the reopening of the Brexit negotiations which could result in a worse deal than the one on offer. In practical terms, the extension could only last until July when the new European parliament is convened. The EU is adamant that only the political declaration and trade deal can be reviewed, not the broader withdrawal agreement, including the Northern Ireland backstop.
BREXIT EXTRA
Crunch vote looms By Joe Gerrard THE British government has stepped up efforts to sell its European Union (EU) withdrawal deal to politicians and the public as Parliament prepares to vote this Tuesday. Prime Minister Theresa May continued to host face-to-face meetings with Members of Parliament from her ruling Conservative Party this week as many remain sceptical of her Brexit deal. The Conservative Party’s position in Parliament is wafer thin and the government relies on 10 MPs from the Northern Irish Democratic Unionist Party (DUP) to pass legislation. The vote continues to loom as Labour leader Jeremy Corbyn said his party would not support her deal in Parliament. Corbyn and other party figures added they would seek to bring about a general election if the deal is voted down, and would not rule out a second EU referendum. May also faced the prospect that the Scottish National Party (SNP) would also vote against her. The Prime Minister hosted Scotland’s First Minister Nicola
FEATURE
Easier entry A FRENCH lawmaker has told British media that illegal immigrants would be able to enter Britain ‘very easily’ in the event of a hard or nodeal Brexit, with PierreHenri Dumont adding increased customs queues allow more time for sneaking into lorries.
Plan ‘works’
SHOWDOWN: May’s (inset) Brexit deal must overcome Parliamentary arithmetic on Tuesday. Sturgeon in Downing Street in an attempt to win her over last Monday. May’s position was further jeopardised by hard-line Brexiteer MPs from within the Tory fold threatening to sink the deal, on the grounds it leaves Britain tied too closely to the EU. Meanwhile DUP members jumped on comments made by May’s top Brexit negotiator Oliver Robbins which suggested Britain may not be able to withdraw
from the Northern Ireland ‘backstop’ arrangement. The mechanism, which would come into force in the event of stalling trade negotiations after Brexit, is a red line for the DUP. They claim it subjects Northern Ireland to different trade arrangements to the rest of Britain. In these circumstances May will have to bring everything to bear if she is to get her deal over Tuesday’s crunch hurdle.
AN oil tycoon has said that British Prime Minister Theresa May’s plan to bring Britain out of the European Union (EU) is ‘workable’ and added businesses felt that London needed to move ahead with the withdrawal process.
Goods move BRITISH factories have begun stockpiling goods and materials they fear could be harder to import into the country following Brexit due to concerns over customs problems and political uncertainty in the event of a nodeal withdrawal, the EEF trade body said.
NATIONAL
Jobless down S PA I N h a s e x p e r i enced one of the sharpest drops in unemployment of the European Union. F i g u re s f e l l f ro m 16.6 per cent to 14.8 per cent in Oct o b e r, a c c o r d i n g t o figures published by Eurostat, the European Statistical Office. In contrast, une m p l o y m e n t a c ro s s the Eurozone was at 6.7 per cent. The statistics show unemploym e n t f e l l a c ro s s a l l member states, with S p a i n ’s f i g u re s i m proving the most dramatically. C r o a t i a ’s n u m b e r s also fell from 10.2 per cent to 8.1 per cent.
6 - 12 December 2018
EWN 23
Junta chief HIV rates ‘not welcome’
MORE than one in 10 people living with HIV in Spain are aged between 15 and 24 years old according to new figures from health academics which also showed 3,381 contracted the virus last year.
LINARES: Has been in decline since its major factory closed in 2011.
By Sally Underwood SUSANA DIAZ, President of the Junta de Andalucia, avoided visiting Jaen’s second largest town on her pre-election campaign tour, over concerns she would not be welcomed The political chief, who has carried out an extensive tour of Andalucia in the weeks leading up to the Andalucian elec-
tions last Sunday, bypassed the major town of Linares, instead visiting smaller towns in the province. Residents of Linares, whose major employer Santana Motor was closed by the Junta in 2011, protested in their thousands against the actions of politicians in Andalucia, who they say failed to pay out compensation and early retirement claims.
A SUSPECT: Allegedly killed two eagles.
Poisoner arrested POLICE have arrested a man for allegedly poisoning two eagles, one of which was endangered. The 52-year-old suspect is said to have killed a mouse eagle and an Iberian imperial eagle, a species which is at danger of extinction in Manzanares, Ciudad Real. Officers from the Guardia Civil arrested the man, after agents from the Nature Protection Service (SEPRONA) found a dead mouse eagle at a private game reserve in Manzanares. Further tests confirmed that the animal had
died from poisoning. Later, an Iberian imperial eagle was also found, showing symptoms of poisoning. The Guardia Civil stepped up their investigations further when a resident in Membrilla, Ciudad Real, reported two cats had died of poisoning on the same reserve. Police later searched the home of the suspect, allegedly finding several containers of the same poison used to kill the eagles, as well as further chemicals on the roof of his house and in the trunk of his car.
In two major demonstrations, between 30,000 and 40,000 residents of Linares came out to condemn the deterioration of their town, which was once known for its prosperity but has been in decline since the closure of the Santana Motor factory. Instead, Susana Diaz’s campaign bus passed by the town on the A-4 motorway, stopping in nearby Ubeda and Baeza.
26 EWN
6 - 12 December 2018
FEATURE
A letter from UK ambassador Simon Manley I WANTED to update you on the recent developments on our exit from the EU. As many of you are no doubt aware, on Sunday November 25, three million EU citizens who has come and built your life in the UK - come to be our colleagues, our neighbours and our friends - you need a deal that guarantees your rights. If you are one of the almost one million UK nationals living elsewhere in the EU, you need the same. This deal delivers for you all.” The next stage is for the UK Parliament to vote on the deal the government has negotiated, which is expected on December 11. The European Parliament will also vote on the agreement. If approved, the Withdrawal Agreement will secure the rights of one million UK nationals living in the EU. It means that the 300,000 British people who have chosen to make Spain their home have a legal guarantee that they will be allowed
to stay here after the UK leaves the EU on March 29, 2019. The Agreement also defines the Implementation Period as running from March 30, 2019 until December 31, 2020. All UK nationals lawfully residing in Spain on December resi-
dent, • Make sure you are correctly registered with Extranjeria here in Spain (please see gov.uk/living-in-spain) • Sign up for email alerts to stay up-to-date and find out about our outreach events, by visiting the Living in Spain guide on gov.uk. • Follow our ‘B.
SIMON MANLEY: Will update advice as changes are announced.
28 EWN
6 - 12 December 2018
NATIONAL
Waiting times fall TH E a ve ra ge s urge ry waiting times for patients in Spain is 93 days, acc ording to ne w da ta rele a s e d by the c ountry’s Health Ministry. One in every eight people wait over six months a nd figure s s how that 584,000 patients were on a waiting list on June 30, 20,000 fe w e r tha n i n 2017. The best patient to popula tion ra tio is in the Basque Country, where there are 8.02 people on a surgery waiting list for every 100,000 residents, follow e d by M a drid (8.05) a nd A nda luc i a (8.15).
WAIT LOSS: Average waiting times have been reduced by 11 days for operations. The areas with the worst ratio are Cataluña (21.44), Extremadura (19.97) and Murcia (18.5). Orthopaedic surgery and
ophthalmology continue to have the largest number of patients, while the smallest are thoracic and heart surgery.
Export market on the upward trend SPAIN will now export an expanded range of pork products and table grapes to China following an agreement made as part of the framework of President X i J i n p i n g ’s v i s i t l a s t week. Last year, it became the first exporter of pork to Asia, and the fourth supplier of offal, with a total of 373,000 tons worth €574 million. The recent signing will significantly expand the range of products aut h o r i s e d t o i n c l u d e f r e s h meat and cured products such as ham, shoulder, loin and sausage. China reportedly consumes almost 50 per cent of all pork products pro-
duced worldwide. It accounts for two thirds of the total consumption of meat in the diet of Chinese consumers. Until now, Spain could only export citrus fruits, peaches and plums to the Asian country, as China reportedly negotiates just one fruit at a time. So the signing of the new protocol, made in only two years is very unusual. The negotiations were carried out by the Ministry of Agriculture, Fisheries and Food with the General Administration of Customs of China, in co-ordination with the Secretary of State for Commerce of the Mini s t r y o f I n d u s t r y, C o m merce and Tourism.
30 EWN
6 - 12 December 2018
NATIONAL
Violent end to four years of hell Nobody deserves to go through violence - a sufferer has put an end to four years of hell and wants to help others do the same by telling her story By Tara Rippin AFTER four years of violent abuse at the hands of her ex, Debbie Ann Jones took the brave step to press charges after the most recent vicious attack, which led to him being deported to the UK last week. Now she wants to use her experience to inspire other victims to take action before it’s too late and things escalate to a potentially fatal conclusion. The 40-year-old singer had only been in Benidorm for two weeks after moving to Spain for a new start, when her 45-year-old partner - who cannot be named for legal reasons - beat her before attacking her 54-year-old brother Michael Edwards, who is registered disabled. Speaking exclusively to Euro Weekly News, Debbie took the courageous decision to share her horrific experiences to help raise awareness. Debbie had recently divorced when she got together with her unemployed partner, and at first everything seemed rosy. But things soon changed. “It started off with him chucking a cup at the wall. I really wish I had seen that as a sign, but he apologised and that was that. “Things escalated from there. We had been together for about a year and were arguing when he starting pulling my hair. He said he was sorry, that it would never happen again and I believed him.” But three months later, the violence
VICIOUS ATTACK: Brother Michael Edwards was hit with a table leg. DEBBIE: Debbie has broken her silence. stepped up to a terrifying level. Debbie was singing at a holiday park and her partner was sat right next to her, using his laptop. She asked him to move while she was performing. “When we got back to the house, he shouted ‘who do you think you are, telling me what to do?’ He smashed the mantelpiece above the fire, then literally punched me in the face and dragged me around while I was on the floor. “My daughter, who was 18 at the time, came downstairs and that’s when he stopped and ran out of the house. I don’t know why I didn’t ring the police. I tried to see the goodness in him, and I loved him. He kept saying sorry and that it wouldn’t happen again. “I never knew when he was going to
BRUISING: Debbie’s face is blackened after being punched. get violent. “It wasn’t drink related. He was very controlling and jealous and by my side 24 hours. “But in public he was the perfect partner, he was like Jekyll and Hyde. I tried to be the perfect partner for his sake. Debbie and her brother sold their flat in Wales and they all moved to Benidorm on November 1 this year for a
new start. “I believed my ex when he said it would be different, I wanted to believe him.” But just two weeks later on November 15, Debbie asked her partner to come home at 9pm so they could watch the last night of fiestas’ fireworks display from the balcony. When he hadn’t come home, Debbie and her brother decided to go to Planet Benidorm. “He found us and was shouting ‘where have you been?’ He was asked to leave because he was causing a disturbance. I walked home with my brother and when he came home minutes later he just completely lost it and smashed my wooden coffee table and the leg came off. He came over to me and punched in the face, on both sides.” Her brother Michael lay over Debbie to protect her.
“My ex lifted the leg and hit my brother twice in the head with the metal bracket end. There was blood everywhere.” Debbie called an ambulance and because it was an attack the police arrived, too. The attacker was kept in custody until a court appearance the following morning. “The officers asked me if I wanted to press charges and I said yes. I knew it would be murder next. We gave statements and were in court by 11.30am. The police and justice system were brilliant, really on the ball. “At Benidorm court before sentencing on November 29, he was sitting opposite me, and I felt physically sick, I was shaking and broke down, but the officers were brilliant and helped me through it.” The aggressor was given a suspended sentence of two years and nine months, cannot contact Debbie for nine months nor Michael for three years. He was also deported to the UK. “I feel relieved but just keep questioning why I put myself, my brother and my daughter through it all. They wanted me to leave him. I’m going through the aftermath and putting myself on trial. “I don’t want this to happen to anyone, man or woman. Anybody is going through abuse should run, get out of the situation and call the police immediately after an attack. “I can’t stress enough that it’s important to trust and believe in yourself and the system, because it works.”
In Spain victims of domestic/gender violence can call 016 for multilingual help and advice 24 hours a day.
32 EWN
6 - 12 December 2018
Pool death toll drops A TOTAL of 14 people died in pools and off beaches in Spain up to November 30, bringing the total to 356 according to a new report. The National Drowning Report for 2018, from Spain’s Royal Salvage and Lifeguard Federation, showed the number of deaths fell by 21.8 per cent compared to the same time last year. The number of those who died in pools and in waters off beaches stood at 455 by November 30, 2017. The Federation said bad weather at the start of 2018 could have led to the fall. The weather would have discouraged bathers from swimming during that time, the agency said. Data showed Spanish men aged 65 and over were the most common victims of drowning up to November 30 this year. A total of 76 per cent of those who drowned were males. Around 82 per cent of deaths took place in places where there was no surveillance, including from lifeguards, of the pool or beach in question. Around 59.5 per cent of deaths took place between the hours of 10am and 6pm, the report showed. Andalucia saw the largest number of deaths, followed by the Canary Islands. The Basque Country and Castilla y Leon came joint third and the Murcia Region came fourth.
NATIONAL
Showing up Banksy MADRID is to host Spain’s first exhibition of enigmatic street artist Banksy’s work starting today (Thursday). Although the exhibition has not been authorised by Banksy, around 70 works owned by international private collectors will be on display at the Trade Fair Institution of Madrid. The pieces will be on show until midMarch, and many of the collectors are open to selling the works. The exhibition is entitled ‘Genius or Vandal?’ with visitors invited to make up their own minds.
POOLS: More than four-fifths of deaths happened in areas without lifeguards. DEATHS BY REGION: • Balearic Islands - 41 deaths, 11.5% • Valencian Communities - 36, 10. 1% • Castilla y León and País Vasco -14, 3.9% in each community. • Murcia - 12, 3.4%, • Asturias - 11, 3.1%, • Aragón 9, 2.5%, • Cantabria,Castilla-La Mancha and Madrid - 8, 2.2% in each region.
• Navarra 4, 1.1%, • Extremadura and Ceuta - 2, 0.6%, • La Rioja and Melilla - 1, 0.3%, each. 76 per cent of all of those to die in aquatic spaces this year have been male. 75 per cent have been Spanish and the largest proportion of deaths have occurred in the 65 and older age category (40.7 per cent).
Rocking deal SPAIN and the UK have signed the most important bilateral agreement over Gibraltar in more than a decade. Four Memorandums of Understanding have been finalised, aimed at reducing inequality between the Rock and Campo de Gibraltar, the neighbouring Spanish region in Andalucia which has struggled with high unemployment and drugs crime. They represent the first accord between Madrid and London since Gibraltar was ceded to Great Britain in 1713 under the Treaty of Utrecht.
34 EWN
6 - 12 December 2018
NATIONAL
THE WEEK IN POLITICS
The votes are in
Hunger strikes
THE dust is still settling from Sunday’s Andalucian election but wrangling has begun in earnest over who will control the region’s assembly. The election was Junta President Susana Diaz’s to lose. Voters once again gave PSOE the largest number of seats in the Andalucian regional assembly. But its majority of 47 has been cut to 33, leaving them the largest party by a margin of seven seats in the 109-seat parliament. The loss came on the back of a surge in support for smaller parties from the left, far right and centre, with a turnout of little over 58.6 per cent. Diaz acknowledged that voters had not enthusiastically backed her party, while speaking at a press conference on Monday. “All PSOE members must reflect on how to strengthen the role of institutions. If there are people who have stayed at home, then there are things we have to do better,” Diaz said. The conservative Partido Popular (PP), the second largest party in the assembly both before and after the vote, also lost
CREDIT: PSOE Andalucia, via Twitter
By Joe Gerrard
RESULTS IN: The vote was a setback for Diaz (centre). seats. The PP now has 26 members in the assembly, down from 33 before the vote. Despite the loss, party officials claimed voters had given them a mandate to unseat Diaz. Junta president candidate Juan Moreno said they were ready to form a right-wing administration in a region which has been a left-wing stronghold throughout Spain’s democratic history. Neither Diaz nor Moreno has the numbers needed to govern alone. Whoever takes power will have to work with smaller parties, the big winners of the poll. PSOE’s natural ally would be Adelante
Andalucia, a grouping of leftist parties who won 17 seats. But that would still leave them short of a majority. The PP is similarly up against the maths. It could join forces with the centrist Ciudadanos, whose seats jumped from nine to 21, but together they would still fall short of a majority. The PP may seek to bring Vox into the fold. The far right anti-immigration party entered the assembly for the first time and now has 12 seats, pushing the PP and Ciudadanos into majority territory if they work together.
On trial for rape and murder A BOY is on trial accused of raping and murdering a young woman. The 16-year-old suspect is accused of raping 32-year-old Leticia Rosino on May 3 in Zamora, northeast Spain, before battering her to death with
a stone. Prosecutors are seeking eight years in prison, the maximum penalty allowed for criminals aged under 18, after the boy reportedly admitted his crime. Leticia Rosino was brutally assaulted and murdered earlier
this year as she walked in an industrial estate near her workplace. Police initially arrested the suspect’s father after the accused pushed the blame onto him, before eventually confessing.
TWO leading figures of the pro-Catalan independence movement have begun hunger strikes from their prison cells in protest against what they claimed was ‘unfair’ treatment from Spain’s justice system. Jordi Sanchez and Jordi Turull said they would not give up on their chance to have a fair trial. The two were remanded in custody earlier this year in connection with last year’s Catalan independence referendum and independence declaration. Spain’s Prime Minister Pedro Sanchez said the two were protected by the rule of law and would receive a fair trial ‘like all citizens’. It comes as Sanchez called on Madrid to offer new proposals to help settle the matter, including allowing Catalan officials to stage a new referendum. He added pro-independence figures would not necessarily push for an immediate independence vote in what has been interpreted by some as a concession. Any further push for independence is likely to be hamstrung by the fact Spain’s Supreme Court ruled the previous referendum violated Spain’s Constitution. It was that ruling, that led Sanchez, Turull and others to be arrested.
Poll tracker: Partido Socialista (PSOE): 24.1 per cent, 105 seats Partido Popular (PP): 19.6 per cent, 94 seats Ciudadanos: 22.4 per cent, 70 seats Unidos Podemos: 18.1 per cent, 53 seats Result: PSOE largest party, no overall control.
Designer label robbery A GUCCI store has been ram-raided by a gang which fled with a large haul of designer goods, leaving the car embedded in the shop front. At around 5am last Friday morning, a red car was driven at speed through a display window, smashing a metal security blind at the shop in Passeig de Gracia, Barcelona. Several thieves then grabbed clothing, shoes and handbags worth thousands of Euros. It has still to be determined exactly how much was stolen, and an investigation is underway.
6 - 12 December 2018
More skilled and lower paid SPANIARDS under the age of 30 are earning less than a decade ago, despite being better trained and prepared for the workplace, according to the Annual Salary Structure Report. The average salary among teenagers has dropped by 28 per cent in 10 years, while earnings among 20 to 24-year-olds slipped 15 per cent, and by 9 per cent for those aged 25 to 29. This is in spite of the fact those born in the 1990’s have grown up in fear of the ‘crisis’ and are studying more, believing extra
skills will help them in future. The report highlights two issues in particular. The first is the ‘precarious’ nature of today’s working conditions which is littered with temporary or part-time contracts and positions which pay by the hour. The second is the fact there are fewer younger people. The Spanish Statistics Institute (INE) registered 4.8 million Spaniards between the ages of 20 and 29 at the start of this year, 30 per cent less than the 6.7 million recorded in 2005.
Building ruling MADRID’S 67th Court of First Instance has ruled that works to the Spanish capital’s Edificio España (Spain Building) to turn it into a hotel can continue, with a case against the company undertaking the project still ongoing.
Carer held for sexual abuse A FILIPINO fugitive has been arrested in Madrid for allegedly forcing a 10-year-old girl in his care to ‘perform serious acts of a sexual nature.’ The 31-year-old father of two has reportedly temporarily cared for children for a number of years in various countries,
including Spain. The offences for which he is being held, occurred in Norway in 2015. But an international investigation involving both Norwegian and Spanish police officers, is underway to determine if there are other possible victims.
NATIONAL
‘Leading’ on migration By Joe Gerrard PEDRO SANCHEZ has said that Spain has assumed a leadership role on migration while addressing a meeting of world leaders in South America last week. Spain’s Prime Minister also called for more international co-operation to tackle other global issues including climate change, gender inequality and trade. He was speaking at the G20 summit in the Argentinian ‘orderly’inian Prime Minister Mauricio Macri, South African Presi-
CREDIT: La Moncloa
36 EWN
TAKING LEADERSHIP: Sanchez praised Spain’s action on migration while at the G20. dent.
FEATURE
6 - 12 December 2018
EWN 37
Expats Guide to
Spanish Life Sponsored by Blevins Franks For more information about the sponsors go to
Driving licences in Spain LIVING. If you are planning on living in Spain on a permanent basis, it’s a good idea to have a Spanish driving licence - in fact it is mandatory after a while. Here are some guidelines for current and new drivers on how to do this quickly and easily. If you already have a valid EU (European Union) Community or an EEA (European Economic Area) driving licence and meet the minimum driving age in Spain, you can use it for the first two years of residence in Spain, although you must register your details with the traffic authorities after six months. You can register at your Central Register of Drivers and Minor Offenders of the Provincial Traffic Headquarters. If you don’t obtain a Spanish driver’s licence after two years of residence in Spain and are caught driving, you can face a fine of around €200. Visit: to find out more. Once the process is under way, you will have to adhere to the same conditions as Spanish licence holders: Have reached minimum age in Spain for the specific category of vehicle you want to drive, Relevant medical checks, Renew or exchange the licence after the first two years’ residence in Spain. If an EU licence is renewed in Spain it effectively converts it into a Spanish EU licence, which then needs to be renewed every 10 years up to the age of 65, and every five years after 65. The new regulation which requires new residents to exchange their licences for a Spanish one, was enforced three years ago. As such, Spain has agreements with more than 20 countries, allowing drivers to exchange a foreign driver’s licence for its equivalent. To find out more, check with your home country’s consulate in Spain or the Spanish Traffic Authority at. To exchange your licence, you will need to fill out an application form that is issued by the Provincial Traffic Headquarters. (See the above website). The following documents will be required: Proof of identity (original passport and a copy), Proof of your residence for six months (Certificate of Registration in the Central Aliens Register - the NIE number), Application form (in Spanish), Current valid driving licence to be exchanged (original and a copy), Written declaration stating that you don’t have another driving licence of the same class in another country, Written declaration stating that you have not been suspended or banned, Two recent passport size photographs (32 by 25 mm), Medical fitness report (visit the DGT website for information). For new drivers, check the legal driving ages and permit types before you register. You can get details depending on what type of vehicle you want to drive by visiting: Englishdriving-school.com. The best option (for new drivers) is to go to a driving school as they take care of the registration process with the Jefatura (Jefatura Provincial de Trafico) on your behalf. Once you have registered, get your medical and vision test done, too. Theory tests can be done in a classroom or be computer based. The written test is normally taken in Spanish, but some places offer it in English. For more information, visit.
38 EWN
6 - 12 December 2018
NATIONAL
Violence ‘unreported’ BETWEEN 60 and 80 per cent of violence against LGBT people in Spain goes unreported, according to one report. A study by the State Federation of Lesbians, Gays, Trans and Bisexuals (FELGTB) and the Observatory of Networks against Hate called for organisations to become more rigorous in collecting figures of this type of hate crime.
The report explained there are many people who: ‘Neither report nor denounce the violence they suffer, in many cases they suffer in silence and solitude.’ The organisations claim public bodies should do more to find out about the background of the victim when a crime is reported, as well as asking why they were afraid to report it, in order to make progress.
WORKER: Died in a factory in Alcala la Real.
Worker dies in plastics machine A YOUNG worker has died in Jaen after becoming trapped in a machine at a plastics factory. The 21-year-old man reportedly became stuck in the moving parts of a machine, in the Poligono Llanos Mazuelos in Alcala la Real, Jaen.
Another worker called emergency services after finding his colleague trapped. Members of the Alcala la Real Fire Department, the Guardia Civil, Local Police, and Public Health Emergency Company (EPES), all attended the scene. Officers from the Labour Inspection
and Occupational Risk Prevention Centre were also called in. Health workers confirmed the young man had died in the incident. The Guardia Civil said the usual protocols following a workplace death had been put in place.
Judge investigates scooter death of elderly woman A COURT in Barcelona has heard that a young man may have been using his phone when he knocked down and killed an elderly woman, while on his mobility scooter. Lawyers claim the accused was travelling at speeds close to 30 kilometres an hour when he fatally ran over a woman in her 90’s in Esplugues de Llobregat, Barcelona. Prosecutors say this amounts to negligence and the man should be convicted of reckless homicide. Another person who was travelling on the scooter at the time of the incident is appearing as a witness in the case. Sources told one publication the driver may have been using Google Maps on his mobile
phone when he ploughed into the woman, causing her to fall and hit her head. The incident occurred in August, in an area reserved for pedestrians. The victim was admitted to Moises Broggi Hospital in a serious condition but died a few days later from her injuries. Sources say before the incident, the woman walked with a cane but was otherwise in good health. The case has raised the question of whether legislation is required to protect pedestrians from mobility scooters. Spain’s Interior Minister, Fernando Granda Marlaska, said while their users were ‘vulnerable,’ they: ‘can cause significant damage to third parties, depending on how they drive.’
Bailed out A BRITISH man arrested in Spain in connection with a double murder in Coventry has been released on bail. The 29-year-old was detained by authorities in southern Spain on Thursday, as part of the investigation into the murder of 28year-old Daniel Shaw in Tile Hill, and the disappearance of Johnny Robbins who is also believed to have been murdered. The arrested man was brought back to the West Midlands to be questioned over his ‘involvement.’
FEATURE
Advertising Feature
HOME ASSISTANCE: For unexpected accidents.
Urgent assistance for emergency household repairs BLOCKED drains, burst pipes or even a broken boiler, accidents around the home can happen at any time of the day or night. Whatever the minor emergency they can often be daunting, and cost valuable time and money to sort out. Línea Directa knows that owning and maintaining a home is a big responsibility and that extra protection against accidental damage offers customers peace of mind. Accidentally drilling through a water pipe in order to hang a picture can disrupt what is probably already a busy day. Now they are offering customers their Home Assistance service which covers a wide range of very useful guarantees such as emergency change of locks, TV and video technicians and home computer assistance to help set-up reliable Wi-Fi. One call to our home helpline and we’ll arrange for an authorised contractor to resolve your problem as fast and efficiently as possible. Our vast supplier network
offers accredited professionals with expert knowledge on electrical, plumbing, locksmith and appliances. Extremely convenient and designed to make customers lives a little bit easier. The Home Assistance service is an emergency service and is available 24hours-a-day, seven-days-a-week. There’s no need to get your hands dirty. No need to get frustrated. No need to worry. With Línea Directa, one of Spain’s leading insurance providers, their Home Assistance service will soon sort out any minor accidents around your home and property. Línea Directa is definitely an intelligent decision when it comes to making life in Spain a little bit easier. Best price. Better cover.
We hope the information provided in this article is of interest. If you would like to contact Linea Directa please call 902 123 309 More information about Linea Directa online at.
6 - 12 December 2018
EWN 39
6 - 12 December 2018
GUARDIA CIVIL searching for missing British animal trainer, Amy Louise Gerard, who disappeared in Tenerife, Canary islands, have found a body. Police sources have stated that a woman’s body has been discovered near the spot where Ms Gerard disappeared. The 28-year-old animal
Credit: Twitter/PableysaOstos
Body found in search for missing Brit
NATIONAL MAIN PHOTO Credit: Wikimedia
40 EWN
MISSING: Amy Louise Gerard disappeared after a night out.
trainer is known to have lived nearby to the lighthouse after she moved to Spain from Grimsby. However, police sources are yet to confirm that the discovered body is that of Ms Gerard. Ms Gerard’s family have
reportedly flown to Tenerife and are being kept up-to-date on the latest developments. Reports suggest Ms Gerard went missing after a night out with colleagues last Friday night, and she has not been seen since leaving an Irish pub in the Puerto de la Cruz area.
Axe attack NATIONAL POLICE have arrested two suspects accused of an axe attack on a householder during a burglary at a Torremolinos home. The suspects, aged 29 and 34, have been charged over the break in and thefts, as well as with attempted murder. Officers said they also seized tools and around €6,680 in connection with their probe into the robbery.
MARACAIBO: Ivan Merino (inset) admitted his crime.
Priest arrest in sex crime by Sally Underwood A SPANISH priest from Motril has been arrested in Venezuela for allegedly abusing a 12year-old girl. The accused, 35-year-old Ivan Merino Pedial, worked as a professor at the Santo Tomas de Villanueva school in Granada until three years ago. The priest confessed his crimes to the police in a video statement posted on Twitter. Merino admitted: “We grew fond and it was a game… and one thing led to another.” When the police then criticised him for his comments, the priest remained silent. Merino studied in Burgos, Granada and
Rome before working as a religious studies teacher in Granada. Three years ago he was transferred to Venezuela, ‘to support pastoral work,’ and is currently a vicar in the parish of Maracaibo, in the northwest state of Zulia. Lisandro Cabello, the Secretary of State for Zulia, said there had been previous evidence of ‘other violations and other victims,’ and Merino had been sent to Venezuela as punishment. His Augustine Order of Burgos strongly refute the claims, however, and said: “we have always repudiated, condemned and rejected any action that threatens the dignity of any human, and much more so if the victim is a child.”
Woman dies in fire A BLAZE at an apartment building has claimed the life of a 64-year-old woman. Another adult and a child who both lived with the deceased, suffered from smoke inhalation, while one of the casualties also received burns and was trans-
ferred to a nearby hospital in Barcelona. The fire broke out at the Paseo de la Zona at 2.50am last Friday, and the surrounding roads were closed for two hours while emergency services dealt with the incident.
6 - 12 December 2018
TWO apartment blocks in the Costa Blanca resort of Benidorm are set to be demolished after a probe found they did not comply with planning rules. The apartments, located in the Puenta Lista area of the city and made up of 168 flats on 22 floors, are owned by the Gemelos 28 company.
Towers demolition Authorities are due to pay out compensation which could reach up to €100 million. Ximo Puig, head of the Valencia Generalitat, told regional assembly members last
FEATURE
week the previous conservative Partido Popular (PP) regional administration was to blame for the plans. The plans follow an earlier ruling from Spain’s Supreme Court which annulled the buildings’ permit in 2012. The Court has also refused to hear an appeal from the Generalitat.
Tom Thirkell
42 EWN
NICOLE KING: Presented with 200 red roses by staff member Sally Underwood (left).
SURROUNDED: By friends and guests, King was visibly emotional at the gesture.
Television royalty By Sally Underwood NICOLE KING has received a surprise appearance from the Euro Weekly News as she filmed her 200th ever edition of ‘Marbella Now.’ The famous fixture on Andalucia’s screens was amazed as members of the Euro Weekly News team interrupted filming to present her with 200 red roses, one for each episode of her hit show. As Nicole carried out an interview at restaurant Posidonia Banus two staff carried in the huge display, presenting it to the delighted star as friends and guests looked on. After offering Nicole a ‘huge congratulations on 200 shows from everyone at the Euro Weekly,’ the visibly touched presenter hugged the team, before thanking everyone at the paper for their support. King, who is also a long-standing columnist for the Euro Weekly News, hosts her popular English language television show on network RTV Marbella, interviewing the rich and famous from one of Spain’s most glamorous locations. Her fun and informative programmes give expatriates and Spanish living in Marbella the lowdown on all the latest news, events, clubs and activities. Her popular show takes in the various sights and sounds of the city, getting to know its local characters and bringing to life new opportunities for those who live in or visit Marbella. Credit: Facebook/MarbellNowTV Her show this week was filmed at the beautiful Posidonia Banus Restaurante. THE PRESENTER: Is a regular Ever the pro, King took time out to thank our staff, on Marbella’s screens. stopping to pose for photos and even handing out roses to onlookers before returning to the task in hand; filming scenes for this week’s show.
COMMUNITY
THE Association of Benalmadena for the Attention of the Disabled (ABAD), is a wonderful organisation which provides respite care for children with disabilities. Their 2019 calendars are now ready to buy, and young Tomas Leighton - the severely handicapped boy well-known to our readers features prominently. The calendars are €5 each and funds raised will go towards a new therapy centre. We at Euro Weekly News are right behind ABAD and will be stocking copies of the calendars to sell in our Fuengirola office, but you can also contact Tomas Leighton’s father, John, on 628 562 580. In the build up to Christmas, the public’s generosity is particularly warmly welcomed.
Credit: ABAD
Centre of attention CALENDAR CAUSE: ABAD is a vital daycare centre.
A bumper Poppy Appeal A SPONSORED cycle ride by Coin Royal British Legion member Ray Bower and his friend John Staton raised €2,150 for the Royal British Legion 2018 Poppy Appeal. This amazing achievement brings the year-end
total for 2018 to a colossal €13,747. Poppy Appeal organiser George Chaney and his wife Marion wish to thank Ray and John, as well as all members and friends of the Coin branch for their help and support throughout the year.
6 - 12 December 2018
EWN 43
44 EWN
6 - 12 December 2018
EUROPEAN
NETHERLANDS PLANS to spend an extra €245 million on bicycle infrastructure have been announced by the Dutch government. This is on top of €100 million that State Infrastructure Secretary Stientje van Veldhoven pledged last year to improve bicycle parking and city-to-city cycle ways.
Bike drive
Redress offer THE Dutch state-owned railway company has said it will pay compensation to Holocaust survivors and relatives of victims who were transported on its trains toward Nazi death camps during the Second World War.
PLEDGE: The Netherlands is investing €245 million in bicycle infrastructure.
BELGIUM
Legal killing
Firm appeal
OFFICIALS are investigating whether three doctors improperly euthanised a 38-year-old woman who was diagnosed with Asperger syndrome two months before she died in an apparently legal killing. It’s the first criminal investigation in a euthanasia case since legalisation in 2002.
THE government has launched a campaign to lure finance and insurance firms away from London and to the Belgian capital after Brexit by claiming it would give them a ‘passport’ to the EU’s single market and place them closer to the heart of EU policy making.
FRANCE
NORWAY
HIV initiative
Sex charges
THE French government has announced it will take the rare step of reimbursing prescriptionbought condoms to combat the spread of HIV and other sexually transmitted diseases. French-made Eden condoms are the first to be approved for remuneration by the country’s health authority.
A FORMER Norwegian cabinet minister has been charged with sexually abusing three asylum seekers. Svein Ludvigsen, 72, was charged with one count of taking advantage of his position as regional governor, and another of exploiting the asylum seekers’ vulnerable situation
Solar energy
Clear waters
A PUBLIC support scheme in France that aims to encourage solar power generation from innovative installations, costing €600 million has been given the green light by the European Commission (EC). The project involves the installation of 350 MW of solar power generation capacity.
GLOBAL efforts to combat the generation of marine litter received a major boost during a Sustainable Blue Economy Conference after Norway and the World Bank committed US$ 300 million (€263 million) to the cause. A third has been allocated to managing dumping in oceans.
SWEDEN
Tax revenue
Racism probe
SWEDEN had the fourth highest tax-toGDP ratio in the European Union last year, according to figures released by Eurostat. The country’s tax revenue accounted for 44.9 per cent of its gross domestic product, which is well above the EU average of 40.2 per cent.
A FORMER department head at Sweden’s prestigious Karolinska Hospital, affiliated with the body that grants the Nobel Prize in Medicine, has been accused of anti-Semitic behaviour toward Jewish doctors. Alleged victims have claimed ‘alleged’ bullying.
DENMARK
GERMANY
Bank inquiry
Under scrutiny
DENMARK’S prosecution authority has filed preliminary charges against Danske Bank, for ‘violation of the laws on money laundering.’ An international economic crimes’ source said the investigation is ‘still at an early stage.’
US ecommerce giant Amazon is accused of exploiting its market dominance in its relations with third-party retailers who use the website as a marketplace. The Federal Cartel Office is investigating ‘many’ complaints from traders.
Costly travel PETROL prices in Denmark are among the highest in the world according to the Global Fuel Price Index which compared how far €50 worth of petrol would take a motorist, with the Danes ranking in the bottom five.
Repatriation aid MIGRANTS are being offered rental costs in their countries of origin as Germany tackles the ‘challenge’ of migration. The Interior Ministry has launched a controversial advertising campaign to increase the number of voluntary repatriations.
46 EWN
6 - 12 December 2018
NEWSDESK ALMERIA
With six editions on the Spanish Costas and Mallorca we cover the main expat areas of Spain - take a look at what is happening around our regions.
COSTA BLANCA SOUTH
Double Guardia Civil success
Violent crimes GUARDIA CIVIL arrested a 17-yearold in connection with a violent attack. The victim reported they had met with someone they knew in a commercial centre car park in Almeria City to sort out a misunderstanding on a social media site, and when they moved on to somewhere quieter, the teenager snatched their mobile phone and started to hit them, eventually whacking them with an iron bar on the legs, neck and hands. Guardia also reported the arrest of a man in connection with an attempted mugging in Roquetas. A 66-yearold woman said someone jumped out at her as she walked to her car from her home, the individual pulling out a 20-centimetre long tool used for piercing holes and threatening to stab her if she didn’t hand over her money. The would-be thief ran off when a neighbour rushed over to intervene.
COSTA BLANCA NORTH
Club strips credit cards NATIONAL POLICE in Benidorm have arrested four people in connection with alleged credit card fraud in a strip club. According to reports, they took more than €53,000 from more than 20 customers who used their credit cards to pay for their drinks in the venue. Those detained are the owner of the club and three employees. It is also understood the nine others are also being sought by the police, including the alleged ringleaders, and are believed to be in Poland. Reports of the possible credit card misuse first came to light within weeks of the club opening in April,
NEWSDESK
cultural technique being introduced on land that was very difficult to cultivate. “These small walls follow the contours of the hills with ingenious use of local stone.” The multi-purpose structures fortified the hillside against erosion from rain, and also helped to provide a natural irrigation system. However, landslides did occur which destroyed the walls and they would have to be rebuilt by the farmers. Dry stone walls were also used to construct huts, shelters for shepherds and miners, and snow defences.
MALLORCA RECOVERED: Many of the stolen items from the warehouse have been located
OFFICERS from the Guardia Civil in San Javier have arrested three people in connection with a robbery and arson attack at a warehouse. Separately, police also arrested suspects in connection with organised crime offences and robbery in nearby San Pedro del Pinatar. The incidents in San Miguel led the Guardia Civil to a property in Santiago de la Ribera in connection with the search for a girl who was reported missing. Police claimed the suspects began to flee the scene across nearby rooftops before being caught close by. Guardia Civil officers found a number of young people, including the missing girl, as well as items allegedly stolen from the warehouse which had been robbed and torched. The detainees are aged 18, 23 and 24, and all live in Santiago de la Ribera. Three others, two of them youths, were also detained in San Pedro del Pinatar in connection with the spate of robberies from houses. Others were later arrested. The case continues.
and since then there have been a trickle of cases with customers reporting excess charges on their statements after attending the club. It appears that every time drinks were purchased using the cards, an extra 0 was added, so that customers ended up paying 10 times more than expected.
AXARQUIA
Pride of the hillside THE renowned dry stone walls of
Arenas, Axarquia, have been designated a World Heritage site by UNESCO. They have been in place for centuries, with a clear function of protecting the land from erosion and creating favourable conditions for cultivation. Now this feature, which is also seen in other parts of Spain, and countries like Croatia, France, Greece, Italy and Switzerland, has been included by UNESCO on the list of the Intangible Cultural Heritage of Humanity.
The stone walls were also erected by farmers in the hills of Axarquia to assist in the planting of olives, grapevines and wheat. Moreover, they helped to prevent landslides, floods and avalanches. According to UNESCO, “these structures do not harm the environment and are an example of a balanced relationship between human beings and nature.” Axarquia’s Ecologists in Action group said in a statement: “The region of Axarquia could not have been sustained without an agri-
Isolated in Paradise A VICTIM of domestic abuse at the hands of a Mallorcan ex has written a book about her experience as a ‘wake up’ call to other women. ‘Isolated in Paradise’ is a first person account of Eva Karlsson’s, a mother-of-one from Sweden, torment at the hands of a man she met online in 2007. Eva previously met with the man whenever she could and he treated her ‘like a queen.’ But when Eva landed in Palma with her cat and all her belongings she said she knew she had made a mistake. The book reveals how the violence began early on and the isolation she felt. “He didn’t want a wife, he wanted a slave,” she writes. Eventually, Eva found the courage to pack her things, and take her daughter back to Sweden where she rebuilt her life. ‘Isolated in Paradise’ has been published in Swedish, but Eva has not ruled out an edition in other languages.
COSTA DEL SOL I AXARQUIA I COSTA BLANCA NORTH I COSTA BLANCA SOUTH I ALMERIA I MALLORCA
EWN online this week 109,063 Page views POLL OF THE WEEK Climate change has recently been dubbed the greatest threat to humanity. Do you agree?
*For week 26 Nov – 2 Dec 2018
TOP 3 STORIES
LAST WEEK’S POLL: The population of wild parakeets has apparently soared to uncontrollable numbers since they were first introduced to Spain, should they be culled?
Yes 17% No 83%
CORRECTIONS At the EWN, we pride ourselves that reports are accurate and fair. If we do slip up, we promise to set the record straight in a clear, no-nonsense manner. To ask for an inaccuracy to be corrected. Email: editorial@euroweeklynews.com
FOUND: Norah has been located!
8,508
views
BREAKING: Norah Garratt has been FOUND alive and well in Benidorm
1,888
views
MISSING: Urgent appeal to find Norah Garratt in Benidorm
1,662
views
Woman in Spain plunges fivefloors to her death when faced with eviction from her home
48
E W N
STAT OF WEEK
Down sizing CAIXABANK plans to cut almost a fifth of its branches in Spain over the next three years in a drive to boost profitability while undergoing a digital transformation. As part of its 2019-2021 strategic plan, the Spanish lender has announced that it expects to cut the number of branches by 821 to 3,640 by 2021. The bank, which employs around 32,600 people in Spain, and also has operations in Portugal, said the plan would lead to job losses, but did not elaborate.
€1 billion
6 - 12 December 2018 This is the amount that former Chief Executive of Abengoa, Felipe Benjumea, through Inversion Corporativa, is suing Santander and HSBC for its collapse.
FINANCE
business & legal
Vineyard gets wind of deal VINEYARD WIND, the company owned in a 50/50 partnership between Iberdrola and Copenhagen Infrastructure Partners (CIP), has c h o s e n M H I Ve s t a s O f f s h o r e Wind as the preferred supplier for its 800 MW offshore megaproject in the US. The contract is worth €1.2 billion and the project is scheduled for installation in 2021. It is large enough to act as a catalyst for the build-up of a local supply chain in the region. Once the turbine supply order
is confirmed, MHI Vestas will begin the process of local hiring and supply chain investment to support the project as it nears the construction phase. M H I Ve s t a s C h i e f E x e c u t i v e Philippe Kavafyan said: “We feel honoured to have been selected as preferred supplier for the first large-scale offshore wind project in the US.” To keep pace with growing demand for offshore wind turbines worldwide, MHI Vestas plans to increase production capacity at
its Lindo nacelle factory and hire new employees to work there. The company said it plans to recruit 50 new employees and is implementing a new testing regime designed to increase production and improve quality. “This next phase of production will allow us to meet demand and d o s o m o r e e f f i c i e n t l y, ” s a i d Kavafyan. M H I Ve s t a s a l s o a n n o u n c e d that it has extended its lease agreement with Lindo to eight years.
New chief SPAIN’S multinational banking group Banco Bilbao Vizcaya Argentaria, known as BBVA, has appointed 44-year-old Turkish banker Onur Genc as its new CEO. Genc, who is currently the CEO of BBVA Compass and US Country Manager for BBVA, is expected to take over on December 31. BBVA is the principle shareholder of Turkey’s third largest private lender Garanti Bank. Genc stressed the importance of digitalisation and said that Spain and Turkey have some of the best mobile banking applications.
EU to review banks
» BUSINESS EXTRA
Tobin tax SPAIN will be the next European country to introduce the Financial Transaction Tax (FTT), which aims to increase tax collection from international transactions and is estimated to raise €8.45 billion in 2019.
Game on MONEY MATTERS: The EU intends to investigate recent scandals. EUROPEAN UNION finance ministers are set to delay a reform of money laundering supervision at banks next week, because they first want to assess recent alleged cases of financial crime at the bloc’s lenders. An EU draft document, to be adopted on December 4, supports a need ‘to strengthen the effectiveness of the current framework’ after recent scandals. However, it does not propose institutional or legislative changes like the creation of an EU-wide supervisor recommended by the
European Central Bank. The document details an action plan meant to be the EU response to a series of high profile cases of alleged money laundering at banks in several EU states including Spain, Britain, Denmark, the Netherlands and Malta. The plan foresees a review of recent bank scandals that could indefinitely delay legislative changes already proposed by the European Commission in September to bolster supervision of banks against money-laundering risks.
SPAIN’S regulated iGaming market grew by 30 per cent in the third quarter of 2018 as gross gaming revenue (GGR) reached €181.8 million, buoyed a growth in sports betting, casino and poker.
Wage boost THE Mercadona supermarket chain has signed an agreement with worker unions that will introduce a salary increase of almost 15 per cent for its entire 84,000 strong workforce, and working hours are also under review.
Spain taps up China SPAIN’S Prime Minister Pedro Sanchez has met with Chinese President Xi Jinping along with representatives from the China-Spain Business Advisory Council, in Madrid. President Xi Jinping urged Spanish businesses to make the best use of the China International Import Expo (CIIE) trade fair and take ChinaSpain economic and trade ties to a new level. Xi praised the establishment of the Business
Advisory Council and said that building a strong synergy between the two countries’ strategies will help bring about a more open and inclusive relationship between Asia and Europe. For his part, Sanchez said the trading world is changing and that Spain is paying more and more attention to Asia. X’s wife, Peng Liyuan, called for more artistic and cultural exchanges between the two countries.
50 EWN
6 - 12 December 2018
LONDON - FTSE 100
FINANCE, BUSINESS & LEGAL MAKE THE MOST OF YOUR MONEY WITH US See our advert on previous page
C LOSING P RICES D ECEMBER 3
PRICE(P) CHANGE(P) COMPANY Anglo American 1,673.10 62.10 Associated British Foods 2,454.00 30.00 Admiral Group 2,104.00 20.00 Ashtead Group 1,854.50 95.50 Antofagasta 866.50 60.10 Aviva 410.00 3.00 AstraZeneca 6,186.50 69.50 BAE Systems 494.70 4.40 Barclays 166.14 3.26 British American Tobacco 2,827.00 77.00 Barratt Developments 463.60 -9.10 BHP GROUP PLC ORD $0.50 1,595.50 90.90 Berkeley Group Holdings 3,277.00 -92.00 British Land Co 575.80 11.20 Bunzl 2,430.50 14.50 BP 532.00 8.40 Burberry Group 1,870.75 94.25 BT Group 261.20 -0.80 Coca-Cola HBC 2,400.00 66.00 Carnival 4,651.50 98.50 Centrica 140.25 2.50 Compass Group 1,708.00 50.00 Croda International 4,985.50 109.50 CRH 2,237.50 90.50 DCC 6,020.00 115.00 Diageo 2,849.50 26.00 Direct Line Insurance Group 330.40 -0.60 Evraz 488.85 34.75 Experian 1,942.25 35.75 easyJet 1,112.00 -31.50 Ferguson 5,179.00 127.00 Fresnillo 786.00 32.60 Glencore 308.33 21.98 GlaxoSmithKline 1,644.20 22.60 GVC Holdings 761.50 10.00 Hargreaves Lansdown 1,945.25 43.75 Halma 1,405.00 33.00 HSBC Holdings 680.55 16.25 International Conslidtd Arln Grp 626.50 0.90 InterContinental Hotels Grp 4,289.00 89.00 3i Group 850.80 17.20 Imperial Brands 2,457.75 39.75 Informa 704.80 -4.80 Intertek Group 4,870.00 173.00 ITV 146.65 1.45 Just Eat 602.20 19.60 Johnson Matthey 3,051.50 127.50 Kingfisher 254.00 4.00 Land Securities Group 824.10 -51.30 Legal & General Group 248.55 3.65
% CHG. NET VOL 3.85 22,001.64 1.24 19,190.18 0.96 6,054.08 5.43 8,445.03 7.45 7,890.80 0.74 15,878.91 1.14 77,490.04 0.90 15,697.81 2.00 27,898.73 2.80 63,078.63 -1.93 4,687.39 6.04 31,713.76 -2.73 4,167.13 1.98 5,450.38 0.60 8,127.27 1.60 104,319.83 5.31 7,307.95 -0.31 25,995.39 2.83 8,596.78 2.16 8,878.68 1.81 7,846.76 3.02 26,588.57 2.25 6,418.91 4.22 17,598.39 1.95 5,801.08 0.92 68,546.64 -0.18 4,510.00 7.65 6,502.95 1.88 17,352.31 -2.75 4,418.94 2.51 11,638.90 4.33 5,551.76 7.68 40,841.65 1.39 80,440.50 1.33 4,300.02 2.30 9,019.17 2.41 5,208.73 2.45 133,083.93 0.14 12,406.76 2.12 8,008.14 2.06 8,110.55 1.64 22,985.06 -0.68 8,651.20 3.68 7,580.64 1.00 5,844.89 3.36 3,966.50 4.36 5,658.92 1.60 5,319.49 -5.86 6,029.57 1.49 14,597.47
COMPANY
PRICE(P)
Lloyds Banking Group ORD 56.21 London Stock Exchange Grp 4,061.50 Micro Focus International 1,561.50 Marks & Spencer Group 295.45 Mondi 1,793.00 Melrose 183.63 Morrison (Wm) Supermarkets 239.18 National Grid 839.30 NMC Health 3,479.00 Next 4,983.50 Ocado Group 845.50 Paddy Power Betfair 7,125.00 Prudential 1,600.75 Persimmon 1,911.00 Pearson 975.90 Reckitt Benckiser Group 6,581.50 Royal Bank of Scotland Group 222.50 Royal Dutch Shell 2,438.75 Royal Dutch Shell 2,473.25 RELX 1,656.00 Rio Tinto 3,734.75 Royal Mail 318.25 Rightmove 446.20 Rolls-Royce Group 864.50 Randgold Resources 6,303.00 RSA Insurance Group 551.80 Rentokil Initial 336.65 Sainsbury (J) 309.30 Schroders 2,585.00 Sage Group (The) 596.30 Segro 616.50 Shire 4,596.50 Smurfit Kappa Group 2,204.00 Standard Life Aberdeen 268.78 Smith (DS) 349.75 Smiths Group 1,425.00 Scottish Mortgage Invstmnt Trst 505.30 Smith & Nephew 1,454.50 SSE 1,103.50 Standard Chartered 635.90 St James's Place 1,028.50 Severn Trent 1,834.50 Tesco 201.25 TUI AG 1,146.75 Taylor Wimpey 133.45 Unilever 4,274.50 United Utilities Group 763.30 Vodafone Group 169.31 John Wood Group 671.60 WPP Group 888.00 Whitbread 4,640.00
CHANGE(P) -0.13 28.50 11.50 2.75 83.50 3.63 1.58 6.40 1.00 82.50 12.10 115.00 52.25 11.00 14.50 -40.50 2.40 68.75 77.75 1.00 115.75 -1.55 8.60 14.90 27.00 9.20 5.35 4.30 8.00 14.90 -3.10 46.50 78.00 3.38 15.65 35.50 9.95 29.50 8.00 26.50 23.00 -115.50 3.70 29.75 -7.95 31.00 2.90 1.55 36.60 22.20 42.00
% CHG.
NET VOL
-0.23 0.71 0.74 0.94 4.88 2.02 0.66 0.77 0.03 1.68 1.45 1.64 3.37 0.58 1.51 -0.61 1.09 2.90 3.25 0.06 3.20 -0.48 1.97 1.75 0.43 1.70 1.61 1.41 0.31 2.56 -0.50 1.02 3.67 1.27 4.68 2.55 2.01 2.07 0.73 4.35 2.29 -5.92 1.87 2.66 -5.62 0.73 0.38 0.92 5.76 2.56 0.91
39,387.19 14,041.22 6,524.07 4,756.06 6,277.98 8,579.68 5,626.11 28,307.31 6,866.79 6,845.98 5,803.87 5,586.95 39,928.57 6,003.01 7,524.80 46,047.41 26,289.32 106,923.70 89,723.14 32,149.88 46,043.08 3,198.00 3,916.39 16,019.07 5,918.07 5,571.70 6,083.00 6,714.84 5,711.59 6,310.05 6,113.45 41,624.25 5,043.15 6,760.88 4,575.24 5,501.49 7,211.33 12,461.95 11,245.71 20,154.71 5,322.50 4,339.83 19,347.05 6,566.86 4,390.74 49,611.70 5,185.08 45,135.62 4,327.78 10,924.78 8,443.61
0.88791
1.12605 Units per €
US dollar ...............................................................1.13638 Japan yen............................................................128.886 Switzerland franc...............................................1,13325 Denmark kroner...............................................7,46245 Norway kroner .................................................9,68973
currenciesdirect.com/marbella • Tel: +34 952 906 581 THE ABOVE TABLE USES THE CURRENT INTERBANK EXCHANGE RATES, WHICH AREN’T REPRESENTATIVE OF THE RATE WE OFFER
DOW JONES C LOSING P RICES D ECEMBER 3
COMPANY AMERICAN EXPRESS APPLE BOEING CATERPILLAR CHEVRON TEXACO CISCO SYSTEMS COCA-COLA EXXON MOBIL GOLDMAN SACH HOME DEPOT IBM INTEL JOHNSON & JOHNSON JP MORGAN CHASE MCDONALDS MERCK MICROSOFT NIKE PFIZER PROCTER & GAMBLE ST. PAUL TRV UNITED TECHNOLOGIES UNITEDHEALTH VERIZON VISA CLASS A WALGREENS BOOTS WAL-MART WALT DISNEY 3M
PRICE 112,270 178,580 346,760 135,670 118,940 47,870 50,400 79,500 190,690 180,320 124,270 49,310 146,900 111,190 188,510 79,340 110,890 75,120 46,230 94,510 130,370 121,840 281,360 60,300 141,710 84,670 97,650 115,490 207,920
CHANGE% CHANGE 0,86 0,96 -0,54 -0,97 1,23 4,20 4,18 5,44 0,08 0,09 0,00 0,00 2,90 1,42 0,56 0,44 -2,13 -4,16 2,65 4,66 2,30 2,79 0,00 0,00 0,72 1,05 1,03 1,13 -0,40 -0,75 1,84 1,43 0,00 0,00 1,05 0,78 1,58 0,72 1,82 1,69 -0,20 -0,26 0,53 0,64 -0,42 -1,19 1,43 0,85 1,88 2,61 0,00 0,00 0,37 0,36 -0,96 -1,12 1,64 3,36
VOLUME(M) 1.238.571 12.155.358 2.070.190 2.742.672 2.449.942 17.915.436 9.426.024 4.990.612 1.563.717 4.256.452 2.283.970 18.871.576 4.645.429 9.785.190 2.502.575 11.023.566 11.726.713 3.039.145 19.397.080 7.267.743 615.690 2.796.391 2.932.672 14.208.526 4.873.370 4.691.399 3.761.718 6.637.934 1.272.165
M - MILLION DOLLARS
NASDAQ C LOSING P RICES D ECEMBER 3
COMPANY
PRICE
CHANGE NET / %
Most Advanced Ambarella, Inc. Gamida Cell Ltd. Marin Software Incorporated Workday, Inc. Cidara Therapeutics, Inc. Osmotica Pharmaceuticals plc i3 Verticals, Inc. Kezar Life Sciences, Inc. Hovnanian Enterprises Inc Gritstone Oncology, Inc. SeaSpine Holdings Corporation
$ 39.99 $ 15.41 $ 2.83 $ 164 $ 3.64 $ 7.88 $ 22.53 $ 29.68 $ 4.50 $ 28.04 $ 19.66
6.24 ▲ 18.49% 1.87 ▲ 13.81% 0.33 ▲ 13.20% 18.70 ▲ 12.87% 0.41 ▲ 12.69% 0.88 ▲ 12.57% 2.46 ▲ 12.26% 3.13 ▲ 11.79% 0.46 ▲ 11.39% 2.80 ▲ 11.09% 1.88 ▲ 10.57%
$ 5.19 $ 76.60 $ 23.02 $ 3.01 $ 3.29 $ 20.50 $ 7.87 $ 2.12 $ 4.36 $ 4.07 $ 2.42
1.78 ▼ 25.54% 15.08 ▼ 16.45% 4.01 ▼ 14.84% 0.37 ▼ 10.95% 0.39 ▼ 10.60% 2.37 ▼ 10.36% 0.81 ▼ 9.33% 0.21 ▼ 9.01% 0.41 ▼ 8.60% 0.37 ▼ 8.33% 0.22 ▼ 8.33%
Most Declined Tonix Pharmaceuticals Holding Corp. AeroVironment, Inc. Sprouts Farmers Market, Inc. Windstream Holdings, Inc. Uxin Limited Citi Trends, Inc. OptiNose, Inc. Melinta Therapeutics, Inc. Arbutus Biopharma Corporation Asta Funding, Inc. Highpower International Inc
FINANCE, BUSINESS & LEGAL
6 - 12 December 2018
EWN 51
Brexit negotiations and Italian defiance drive euro Ask the expert Peter Loveday Contact me at euroweekly@currenciesdirect.com
FOR the last few weeks, Brexit chaos has remained in the driving seat in the movement of the euro, with Italy trailing not far behind. Euro EUR/GBP: Remained at £0.88 EUR/USD: Remained at $1.13 Although the euro has been pressured by the ongoing Brexit chaos, and the tensions between Italy and the European Union Commission, it has managed to start and finish the period at a very similar rate. The tensions between Brussels and Rome played out this month, as Italy’s refusal to revise their draft budget for 2019 as it went against European Union regulations. Italy’s Deputy Prime Minister, Matteo Salvini remained defiant in the face of the EU, calling for the EU to ‘respect the Ital-
BREXIT CHAOS: Has remained in the driving seat in the movement of the euro. ian people.’ Despite this, it seems that Italy have backed down against the European Commission with sources suggesting that they are going to reduce their deficit target for next year to as low as 2 per cent of GDP, despite the previous 2.4 per cent goal. There has been a lot of weakness revealed in the German economy, with the economy contracting for the first time since 2015, as it shrank by 0.2 per cent in the third quarter, with investors believing that the German economy is not going to recover rapidly from this weakness in its third quarter.
Unemployment figures for Germany are set to be released later this week, with a predicted drop in unemployment, and if this is the case, the euro is likely to push back further against the major currency pairings before the month is up. The Gross Domestic Product (GDP) is set to be released for the Eurozone on December 7, which will show whether or not the Eurozone has grown, if GDP is seen to have grown compared to this time next year, it could mean the euro is likely to push back against the pound and US dollar.
Pound GBP/EUR: Up from €1.12 to €1.13 GBP/USD: Remained at $1.28 The pound remained volatile for the majority of the month, as Brexit chaos saw the currency continuously pushed around, being able to push back against the euro and US dollar, only to plummet when pessimistic Brexit-related news hit. The currency suffered a major dent when Theresa May’s cabinet was hit with the shock resignation of Dominic Raab, and then again when Jo Johnson resigned.
Sterling took a dent from the Consumer Price Index and Core Consumer Price Index figures, as both were expected to increase, although they remained at the same figure as the previous month. The UK GDP figures are set to be released for October on December 10, and the average earnings for October are set to be released the following morning. If these figures are positive and show growth, it is likely the GBP will push back against the major currency pairings. Although May’s Brexit negotiations are happening around the same time, major opposition from MPs over the EU Withdrawal Act is likely to cause the majority of the movement within the currency. US Dollar USD/GBP: Remained at £0.77 USD/EUR: Remained at €0.88 The US is currently embroiled in a trade war with China and with the G20 Summit coming up at the end of this month is likely to show whether this tension is going to be eased or escalated further..
52 EWN
6 - 12 December 2018
FEATURE
Snowflakes need boot camps… LEAPY LEE SAYS IT OTHERS THINK IT SOMETIMES I really do find myself losing the will to live (I can hear the hurrahs from here!) This week yobbo violence against the British police rose to new unprecedented levels. In one of a number of incidents, after the beleaguered force was called out to attend to a fight outside a pub (where else?) they were apparently set on by up to 100 youngsters. Among this gang of feral youths it was later discovered that a few were actually only around 10 years old! In the fracas, the police were pelted with stones and fireworks, kicked and one punched heavily in the face. OMG I hear you say. How many were arrested? When do their trials come up? What assault charges are the police going to bring? Well, don’t hold yer breath. After the incidents, (and all the arrested perpetrators were released, basically with slaps on the wrist) the police issued a statement accusing the parents of ‘not having enough control’ over their offspring and that they had to ‘move up to the plate’ and give more guidance to their children. Is that not the most naive, unhelpful and posi-
POLICE: Confronted by ‘feral’ youths. tively inane simpering rubbish you have ever heard? So what do they suggest? Stopping their pocket money? Not letting them watch the X Factor for a week? This PC ‘snowflake’ attitude toward the
young is the main reason their behaviour is spiralling out of control. The only ‘guidance’ they need, is a short swift sentence in boot camp on bread and water. All these do-gooders are simply confusing our youngsters into experiment-
ing just how far they can actually go before they receive some heavy retribution or another. As for leaving it to the parents to sort out, are these law enforcers actually kidding? Don’t they realise that most of these youngsters come from homes that contain no love, no respect for the authorities and are often even worse than the unwanted offspring they allow to roam the streets. Step up to the plate? The only plate these products of our benefit society are interested in, is the one bearing a pile of chips on a Friday night. In the absence of National Service (come back, all is forgiven!) the only real answer to this yobbo culture are heavy boot camps with zero tolerance and the ability to make these youngsters petrified of ever being sent to them. Only then will we be able to introduce alternatives, youth clubs, gymnasiums, sports facilities and the like, to give them the opportunity to live decent lives and respect the laws and decencies of our society. As a final note to the small number of sad people that continue to think they are ‘revealing’ the ol’ boys hidden past, I suggest they buy my autobiography available on Amazon. Or if they are too mean for this, look me up on Wikipedia. Then for heaven’s sake give us all a break. Keep the faith, love Leapy leapylee2002@gmail.com.
Leapy Lee’s opinions are his own and are not necessarily representative of those of the publishers, advertisers or sponsors.
54 EWN
6 - 12 December 2018
FEATURE
56 EWN
6 - 12 December 2018
Brexodus ... can anyone put the great back into Britain?
Nora Johnson
Breaking Views Nora is the author of popular psychological suspense and crime thrillers and a freelance journalist. To comment on any of the issues raised in her column, go to
A BIT of a rant this week (so what’s new, I hear you say!) First off, a nursing graduate claiming to be a doctor secured a management job with the NHS and fraudulently earned almost £350,000. What? Didn’t HR do any checks? Then, we have the completely unqualified psychiatrist who ‘treated’ NHS patients for 22 years. (Maybe she raised suspicions because she provided the best psychiatric care ever encountered in the NHS?) Isn’t it amazing what people can get away with, if they’re brash enough and nobody checks? I mean, just look at my own qualifications: Nora Johnson FRCS, PhD, QC! And guess what: I regularly carry out heart surgery with only a Girl Guide certificate in embroidery (plus my stitching of vital organs is so artistic - incredibly underrated these days). Next we learn that residents in Belgravia, London and Chigwell, Essex pay for private ‘bobbies on the beat’ and community groups in Hartlepool, Co Durham conduct nightly patrols to prevent crime and ‘protect what’s ours.’ Let’s look at the NHS and police service a bit more closely. Firstly, the NHS. Its sacred cow status has allowed its service and efficiency to decline still further with unac-
CONSULAR MATTERS
IN CHARGE: Bureaucrats have taken over.
LEGALLY SPEAKING
Can they rent out their road? Two properties which are not part of our community or our urbanisation share our privately owned sewer and road. They pay into a special fund for repairs to these facilities when needed. This is separate from the community fees which we on the urbanisation pay into twice a year. At our AGM this year it was decided to make these payments a legal undertaking. Is this possible? W J (Costa Blanca)
countable bureaucrats more committed to keeping their jobs and the unwieldy bureaucracy than improving the patient’s lot. Although we’ve all heard wonderful stories of people saved by the NHS, we’ve also read truly shocking, dreadful accounts of hopeless, abusive, incorrect care, leading to suffering and death. And as for the police, get bobbies back walking the beat, policing real crime, not ‘hate’ crime. It’s ridiculous that time, effort and taxpayers’ money is spent on virtuesignalling PC issues while real life ones go wanting. What’s the betting enterprising villains are at this moment hell bent over sewing machines, running up their own
‘private bobby’ costumes? What a sad indictment of these depressing Brexit times. But time to get used to the fact Britain’s rapidly changing. Incompetent politicians; incompetent police; the NHS run by ‘managers’ who couldn’t run a village fête let alone vital NHS trusts....
Yes, you can make a legal agreement David Searl but you want to give it You and the Law careful study first. First in Spain there is the general principle that communities cannot be seen to make money. However, there are various possibilities. You can make an agreement with the two owners to pay a yearly fee for the use of the sewer and road, for example. This payment will be subject to Spanish tax because it is the community renting out an asset. We see this sort of agreement when an apartment building rents out its roof for a telephone aerial. Or you could make a legal agreement with the two owners for them to pay a certain percentage of any work on the road or sewers.
Send your questions for David Searl through lawyers Ubeda-Retana and Associates in Fuengirola at Ask@lawtaxspain.com, or call 952 667 090.
A warm Danish welcome
Marisa Moreno is the Danish Consul on the Costa del Sol. As an international lawyer, she has a wealth of knowledge and experience on many matters which affect expats of all nationalities. She will bring this experience to you in her monthly column, but first she wants to introduce you to Peter and a taste of Danish Christmas…. CHRISTMAS is almost upon us and I would like to take the opportunity to share with you one of my favourite Danish traditions. I am going to introduce you to my good friend ‘Peter’ who will be the subject of my articles over the coming weeks on social, cultura l a n d l e g a l m atte rs w h ic h concern all foreign community res i d e n t s i n g e n e r al, a n d th e Danish in particular. So Peter, who is very organised in his life, has this year offered to do traditional activities with h i s g r a n d c h i l d re n to g et ready for the arrival of Christmas. Peter is 50 years old and is Danish by birth, although he has
FEATURE
DECOR: Sharing family traditions.
been living in Spain since he was 1 0 y ea rs o ld w he n he move d with his family, parents and siblings, from his native Roskilde to our Costa del Sol. Peter has two grandchildren from his two daughters of his previous marriage and he wants to p rep are a spe c ia l D a nis h Christmas for them this year, because he wants his grandchildren to know and enjoy the traditions of their own country. Many Danish traditions have common roots with several other
northern European countries, so many readers will recognise the similarities in their own traditions. Christmas in Denmark begins with the preparation of the Advent crown, a Christmas decoration which each family makes, so Peter will take his two grandchildren to the field and pick up pine tw igs a nd pine c one s , to s urround and shelter four white or red candles. They will also look for small wild red fruits and they will dec-
orate it with some red ribbons. Then they will have to wait for each of the Sundays which precedes Christmas Eve for their grandchildren to light one of the four candles, one for each Sunday until the four candles are lit, then it will mean that Christmas has arrived. Also, Peter wants his grandchildren to have an authentic ‘Christmas calendar ’ this year. To d o t h i s , P e t e r w i l l h a v e t o prepare 24 small gifts (one for each day of December before
Christmas). It’s going to be a big job because there are two Christmas calendars, one for each grandchild, but it’s worth the effort. Peter could use chocolate figures in the advent calendar. They are easy to buy in the shops, but he wants his grandchildren to experience a different calendar this year along with the illusion of surprise which each gift gives. Pet er has t o gi ve i t som e thought because children today ar e not as exci t ed as when he was a child himself. So his two grandchildren, Alicia, four, and Adam, six, will be given gifts of small cars, animal figures, coloured pencils with glitter, plasticine, etc. The idea is that the grandchildren can share their gifts as he himself did with his brothers when he was little. I am sure that Peter’s grandchildren are privil eged t o be abl e t o enj oy t he preservation of this beautiful Danish tradition but I am even more sure it will be Peter who will enjoy ‘Christmas calendar’ this year the most.
58 EWN
6 - 12 December 2018
FEATURE
Advertising Feature holilday’t cover wind perils. Liberty Seguros does, but even if yours also covers it
HEAVY RAIN: Keep your home safe.
also they will pay for the repairs of the parts affected in case your pipe bursts due to the cold snaps. However, replacing the entire pipe system can be costly for you, so that choose over 300 brokers and agents who are dedicated to providing unbiased, friendly, expert advice. Speaking your own language, these brokers and agents will be pleased to help you as much as possible. Liberty Seguros is considered the expat’s number one choice in Spain. To find out more visit. Or simply call 913 422 549.
60 EWN
6 - 12 December 2018
A good servant or poor master? Prince was wrong; the internet is definitely not over, says Terence Kennedy
TECH FOR THE TIMID A HILARIOUS scene in ‘The IT Crowd’ had naive tech novice Katherine Parkinson given a precious box to hold. It ostensibly contained the Internet. All of it. The World Wide Web, the Interweb, the Intertubes, call it what you will. Barely three decades old, it now connects almost half of the world’s population, with five exabytes coursing through it daily. No I don’t know what that means either, but apparently it’s equivalent to 40,000 movies per second. Slightly too large to fit in Ms Parkinson’s box. From cat videos to connected kettles, from ordering pizza to analysing the Kardashian rear, the internet has become an essential part of our everyday lives. How on earth did we ever manage without it? Few of us have any conception of what holds it together. Try 300 un-
INTERNET: Around 85 per cent of people in Spain are online. dersea cables for a start. Experts estimate it will use 20 per cent of the world’s electricity by 2025 and release 5 per cent of our emissions. America’s data centres alone will need the equivalent of 10 nuclear power stations. Back in the mid-90’s we were impressively tech-savvy if we searched on AltaVista, which put the world at our fingertips through 13 million queries a day at its peak. Today’s
Google does 3.5 trillion. But fully half the world’s web traffic goes to just 0.1 per cent of today’s two billion websites. And miaouw for the news: astonishingly there are well over seven billion pictures of cats on the web, with two million videos on YouTube alone. Grumpy Cat and its ubiquitous videos earned its owners more than € 100 million. That’s a lot of Whiskas.
Of course the web has a dark side. Some estimates say up to 95 per cent of it is unindexed and thus invisible to standard browsers. Although this ‘dark web’ can have its good sides (not least in preserving the anonymity of journalists, activists and whistle-blowers), much of it is driven by criminal activity. While China leads in adding new users with more than 800 million people connected, Chinese surfers are actually far less fortunate than the rest of us. Imagine a world without Google, YouTube, Facebook and Instagram and that’s China, infamous for its so-called ‘Great Firewall of China’ manned by a mindboggling 50,000 internet censors. Around 85 per cent of Spain’s people are online, but that’s still well behind global leaders like Iceland (98 per cent) and those other lucky Nordics. So all in all, if ever you’re privileged enough to be allowed to hold the entire internet in its box, be very aware of your awesome responsibility. Respect, bro.
FEATURE
For better or worse CAT videos apart, the internet undoubtedly spreads real knowledge and understanding around the world. But it’s also responsible for many of our modern problems, from the rabbitholes of time wasted on social media to the sheer destructiveness of online bullying and trolling. In the western world we spend an estimated 24 hours a week online, and many of us have little to show for it. Our sleep is disrupted, our attention-spans fragmented, our credit cards reeling. But observers say we are finally gaining more control over both our online identities and our habits as the dangers become all too apparent. That eminent 21st-century philosopher Lady Gaga said famously that ‘The internet is a toilet’. But we can at least flush it to let clean water in.
Falling at the last fence Cassandra Nash A weekly look - and not entirely impartial reaction to the Spanish political scene
GIBRALTAR residents, according to the Daily Mail, ‘mocked’ Pedro Sanchez’s claim of victory over Spain’s recent Brexit spat as ‘fake news.’ To a certain extent it was a victory because Spain’s ‘prior agreement’ will be needed on matters concerning Gibraltar, although this was confirmation of the existing agreement rather than a concession. And it was a foregone conclusion that poor Teresa May would say yes to practically anything that Sanchez wanted, to avoid falling at the last fence in the EU obstacle course. Especially when she knew that the Grand National was waiting for her back home.
Cold comfort for old cure DANI MATEO is described as a humourist although anyone who watches Gran
Choice of friends JUAN CARLOS I, who abdicated in favour of his son Felipe more than two years ago, was photographed hobnobbing with Mohammed bin Salman, the Crown Prince of Saudi Arabia. Juan Carlos has always been on good terms with the Saudis and has supposedly helped Spain to pull off some very juicy arms and civil engineering contracts.
Wyoming’s programme El Intermedio can see that he’s a satirist. He’s in big trouble because of a sketch where he allegedly insults the Spanish flag in a mock homage to Frenadol, Spain’s goto cure for a cold and is now being prosecuted for hate crime. Reverently intoning its contents he finishes with an almighty sneeze and wipes his nose on the nearest thing to hand, a Spanish flag, before realising in mock horror what
Credit: Twitter/Saudi Foreign Ministry
HOBNOBBING: Former king with Saudi Crown Prince. The Crown Prince is in hot water right now, but presumably the Rey Emeritus isn’t fussy about socialising with someone with no qualms about disposing of the journalists who diss him.
he’s just done. Hastily gabbling Sana sanita he then kisses it better as a Spanish mother does when a toddler hurts itself. It wasn’t Mateo’s best sketch and he knew what to expect, but the nose-wiping has been taken out of context. Called before a Madrid judge, he refused to declare but said before entering that he found it worrying that a ‘clown was being taken to court for doing his job.’
The Spanish nationalists are beside themselves with wounded patriotism, but the manufacturers Frenadol, who should also be outraged, haven’t complained about the implication that it doesn’t work.
Not so simple arithmetic HACIENDA did its sums and Spain’s tax authority found that the unauthorised Catalan referendum of October 1 last year cost €197,000, a long way off the €3 million that the previous government maintained. Strictly speaking, €615,717 was ‘compromised’ but in the way of governments worldwide, most of that was not paid. Misappropriation of public funds is the charge that will get the remanded members of Cataluña’s previous government convicted, rather than rebellion. Ironically, it is below €250,000 and means they face lowish sentences. Makes you wonder if it was all worth it when weighed up against the cost of paying the board-and-lodging in chokey of Oriol Junqueras & Co for more than a year.
FEATURE
6 - 12 December 2018
EWN 61
Oh! Beautiful Benidorm OH what a year it has been! We started it in Palm Beach, Florida and finished it in Benidorm! Having seen how the other half lives, we thought of seeing the remaining half! Benidorm gained its reputation from an English TV series, as a cheap and cheerful Spanish resort where the Brits, beer louts and all sorts go for all-inclusive sunshine holidays in Europe. But earlier this year, we saw a TV documentary by Alex Polizzi featuring Benidorm based on a personal visit and I was truly captivated and intrigued by it as she named it Spectacular Spain! To celebrate our joint birthdays this time around I suggested to Clive that we go for a ‘tongue in cheek’ celebration and head to Benidorm to see it for ourselves. Reluctant to agree at first, he eventually succumbed, ready to be disappointed or as he says ‘to take it all with a pinch of salt.’ Five hours drive later, we had reached our destination! ...And suddenly, we’re in a different Spain, with skyscrapers stretched along miles of seafront something normally not existing on
Benidorm sometimes gets a bad press, but intrigued by a TV documentary Nena Jacques decided to find out for herself…
BENIDORM: A different Spain.
GREAT TIME: Nena and Clive loved Benidorm. Spanish coastlines. But it does in Benidorm. And surprisingly we discovered the summer-time beer louts were replaced by groups doing Tai Chi and open air Yoga on the beach. There was even a Spanish chorus practis-
ing in one corner of the promenade where even strolling sun-worshippers joined in the enchanting Spanish lyrics. Clive booked us in a hotel for three nights B and B and each day we just happily sat in the Benidorm
Old Town soaking up the glorious sunshine in a lofty square overlooking the whole stretch of Benidorm. No photo can give justice to this magnificent setting. And for our birthday celebration finale, we went for a Dinner and
Show at the Benidorm Palace where the show could equally be in par with those in Chicago or Las Vegas (sorry no pictures allowed inside the palace and during the show). Truly spectacular and the service was excellent! I am so glad we visited Benidorm and had a memorable birthday. Lots of people call Benidorm the Chicago of Spain or Las Vegas of Spain but in my opinion and personal experience, it is ‘almost’ the Miami of Spain. I agree with Alex Polizzi, indeed it is truly Splendid! And oh!.... everyone speaks English in Benidorm, mostly with British accents. I also strongly suggest not to visit it during the peak of summer.
64 EWN
2:20am 7:00am 10:15am 11:00am 12:00pm 12:45pm 1:15pm 2:00pm 2:30pm 2:45pm 3:15pm 4:15pm 4:45pm 5:30pm 6:15pm 7:00pm 7:30pm 8:00pm 8:30pm 9:00pm 10:00pm 11:00pm 11:30pm 11:45pm 12:45am 1:30am
4:50am 6:05:30pm 12:00am 12:20am 12:50am 1:45am
6 - 12 December 2018
BBC News Breakfast Defenders UK Homes Under the Hammer A Matter of Life and Debt Ill Gotten Gains Bargain Hunt BBC News at One BBC London News Doctors The Doctor Blake Mysteries Escape to the Country The Best Christmas Food Ever Flog It! Pointless BBC News at Six BBC London News The One Show EastEnders A Hotel for the Super Rich and Famous Ambulance BBC News at Ten BBC London News Question Time This Week Weather for the Week Ahead Christmas Buyers Beware - Tonight Emmerdale Gino's Italian Coastal Escape I'm a Celebrity, Get Me Out of Here! ITV News ITV News London The Late Debate Heroes and Villains: Caught on Camera Jackpot247
4:35am 7:30am 8:15am 9:00am 10:00am 11:00am 12:00pm 1:15pm 2:00pm 3:45pm 6:00pm 7:00pm 7:30pm 8:00pm 9:00pm 10:00pm
11:00pm 11:30pm 12:15am 1:05am 3:05am 4:20am 5:20am
8:10am 9:00am 9:25am 9:55am 10:25am 11:20am 11:50am 1:15pm 1:45pm 2:15pm 2:45pm 3:40pm 4:45pm 5:50pm 7:00pm 8:30pm 9:00pm 9:30pm 10:00pm 10:30pm 11:00pm 11:30pm 12:35am 1:05am
This is BBC Two The Best Christmas Food Ever Flog It! MasterChef: The Professionals BBC News at 9 Victoria Derbyshire BBC Newsroom Live Politics Live Snooker Rugby Union Snooker Richard Osman's House of Games Strictly: It Takes Two Snooker MasterChef: The Professionals Escape From Dubai: The Mystery of the Missing Princess Live at the Apollo Newsnight Snooker Snooker A Northern Soul Inside the Foreign Office This is BBC Two
Ninja Warrior UK Emmerdale Coronation Street Coronation Street The Ellen DeGeneres Show Planet's Got Talent I'm a Celebrity, Get Me Out of Here! Emmerdale Coronation Street Coronation Street The Ellen DeGeneres Show The Jeremy Kyle Show The Jeremy Kyle Show The Jeremy Kyle Show I'm a Celebrity, Get Me Out of Here! You've Been Framed! Two and a Half Men Two and a Half Men Family Guy Family Guy Family Guy I'm a Celebrity... Extra Camp Family Guy American Dad!
3:30am 7:58pm 8:00pm 8:30pm 9:00pm
Digging for Britain This is BBC Four Beyond 100 Days University Challenge Secret Life of Farm Animals 10:00pm Operation Iceberg 11:00pm Gravity and Me: The Force That Shapes Our Lives 12:30am Roy Orbison: Love Hurts Roy Orbison's legacy as a beloved rock legend and a devoted father is revealed through intimate interviews with his three surviving sons, featuring previously unseen home videos. 1:30am Beautiful Equations 2:30am The Mystery of Van Gogh's Ear 3:30am Secret Life of Farm Animals 4:30am This is BBC Four
8:20am 8:45am 9:10am 9:40am 10:05am 10:35am 11:05am 12:00pm 12:30pm 1:00pm 1:05pm 2:05pm 3:10pm 4:00pm 5:00pm 6:00pm 7:00pm 7:30pm 8:00pm 8:55pm 9:00pm 10:00pm 11:00pm 12:00am 1:00am 1:30am
3:30am Teleshopping:05am A Touch of Frost 2:15am Liverpool 1 3:10am ITV3 Nightscreen 3:30am Teleshopping
4:00am 7:00am 7:50am 8:10am 8:30am 9:25am 10:35am 11:35am 12:35pm 1:40pm 2:45pm 3:50pm 4:50pm 5:55pm 6:55pm 8:00pm 8:30pm 9:00pm 10:00pm 11:00pm 12:30am 12:35am 1:15am 3:20am 3:45am 4:00am
3rd Rock from the Sun Everybody Loves Raymond Everybody Loves Raymond Frasier Frasier Supervet at Christmas The First Naked Attraction First Dates Random Acts Lego Masters Inside London Fire Brigade The Usual Suspects FYI Daily The Usual Suspects Hornblower Tommy Cooper ITV4 Nightscreen Teleshopping
8:15am 8:35am 8:45am 8:55am
THURSDAY TV
Shane the Chef Peppa Pig Peppa Pig Ben and Holly's Little Kingdom Paw Patrol Floogals Digby Dragon Shimmer and Shine The Secret Life of Puppies Jeremy Vine Chasing Christmas Neighbours Snowed-Inn Christmas Christmas with a Prince 5 News at 5 Friends Friends Neighbours 5 News Tonight Esther Rantzen's House Trap Shop Smart, Save Money Oxford Street 24/7 Stabbed in the Back: Murder of Sam Caulfield Young, Dumb and Banged Up in the Sun 11:35pm 12:05am 12:35am Young Sheldon Happy Together New Girl The Inbetweeners The Inbetweeners The Big Bang Theory The Big Bang Theory
6:00am 7:00am
Jarhead 3: The Siege Viking The Accountant Black Panther Pirates of the Caribbean: Salazar's Revenge 6:05pm Wild Wild West 7:55pm Mission: Impossible II 10:00pm Black Panther 12:15am The Bourne
5:15am 7:00am 8:45am 10:30am
Holly Star Bomb City Wonder Wheel A Very Sordid Wedding A Gift for Christmas The Greatest Showman Showstopping musical biopic about legendary 19thcentury circus entrepreneur PT Barnum. Lady Bird Bomb City A Gift for Christmas The Greatest Showman Wonder Wheel Lady Bird Western Top Ten Show, the 2018 Which movies are doing the best business at home and across the pond? Holly Star
9:45am A New Life in Turin 10:00am Football Years 11:00am Play-Off Final Highlights 12:00pm One2eleven 12:30pm SPFL Greatest Games 1:00pm Football's Greatest 1:30pm Football Countdowns 2:00pm EFL Greatest Games 3:00pm Play-Off Final Highlights 4:00pm Football's Greatest 4:30pm Football Countdowns 5:00pm One2eleven 5:15pm One2eleven 5:30pm One2eleven 5:45pm A New Life in Turin 6:00pm Football Years 6:30pm UEFA Nations League Review Show 7:30pm Football Countdowns 8:00pm EFL Matters 8:30pm A New Life in Turin 8:45pm EFL Greatest Games 9:00pm Championship Season Review 10:00pm EFL Matters 10:30pm A New Life in Turin 10:45pm EFL Greatest Games 11:00pm Play-Off Final Highlights 12:00am EFL Matters
9:05am 9:25am 9:40am 9:50am 10:05am 10:15am 12:15pm 1:45pm 2:20pm 4:00pm 5:45pm 6:00pm 6:30pm 7:00pm 7:30pm 8:00pm 9:00pm 10:00pm 11:00pm
12:05am
7:20am 8:55am 11:25am 1:35pm 3:50pm
6:00am 7:45am 9:20am 11:00am 1:05pm 3:25pm 5:30pm 7:15pm
Whisky Galore! The Night is Young Big Daddy You've Got Mail Downsizing Hitch The Wedding Singer Anchorman: The Legend of Ron Burgundy 9:00pm You've Got Mail 11:05pm Downsizing 1:25am Anchorman: The Legend of Ron Burgundy 3:05am Planes, Trains and Automobiles
12:25pm 2:00pm
3:55pm 5:40pm 7:25pm 9:00pm 11:00pm 12:45am 2:35am 4:50am
5:10am
Sky Sports News Good Morning Sports Fans Bitesize 7:30am Good Morning Sports Fans Bitesize 8:00am Good Morning Sports Fans 9:00am Good Morning Sports Fans 10:00am Good Morning Sports Fans 11:00am Live European Tour Golf 4:00pm Sky Sports News 5:00pm Sky Sports News 6:00pm Sky Sports News at 5 7:00pm Sky Sports News at 6 7:30pm Live Mosconi Cup Pool Day three of the 2018 Mosconi Cup from the Alexandra Palace in London. 12:00am Sky Sports News 1:00am To be Announced 1:30am Live NFL: Jacksonville @ Tennessee
The schedules for the television programme pages are provided by an external company: we regret that any changes or errors are not the responsibility of Euro Weekly News.
66 EWN
6 - 12 December 2018
12:00pm A Matter of Life and Debt 12:45pm Ill Gotten Gains 8:30pm A Question of Sport 9:00pm EastEnders 9:30pm Not Going Out 10:00pm Have I Got News for You 10:30pm Mrs Brown's Boys Christmas Special 2015 11:00pm BBC News at Ten 11:25pm BBC London News 11:35pm The Graham Norton Show 12:25am Enterprice
5:20am This is BBC Two 7:30am The Best Christmas Food Ever 8:15am Flog It! 9:00am Dynasties 10:00am BBC News at 9 11:00am Victoria Derbyshire 12:00pm BBC Newsroom Live 1:15pm Politics Live 2:00pm Snooker 6:15pm Put Your Money Where Your Mouth Is 7:00pm Strictly: It Takes Two 8:00pm Snooker 9:00pm Celebrity Antiques Road Trip 10:00pm Made in Great Britain 11:00pm The Mash Report 11:30pm Newsnight 12:05am Snooker 12:55am Roots 2:35am Panorama 3:05am Imagine... 4:30am Doctor Who 5:20am This is BBC Two
4:25am ITV Nightscreen 6:05am The Jeremy Kyle Show Imitation Game 9:30pm Coronation Street 10:00pm I'm a Celebrity, Get Me Out of Here! 11:30pm ITV News 12:00am ITV News London 12:20am The Break-Up 2:10am Jackpot247 4:00am Cold Feet
9:25am Emmerdale 9:55am You've Been Framed! 10:25am The Ellen DeGeneres Show 11:20am Planet's Got Talent 11:50am I'm a Celebrity, Get Me Out of Here! 1:15pm Emmerdale 2:15pm You've Been Framed! 2:45pm The Ellen DeGeneres Show 3:40pm The Jeremy Kyle Show 5:50pm The Jeremy Kyle Show 7:00pm I'm a Celebrity, Get Me Out of Here! 8:30pm You've Been Framed! 9:00pm Two and a Half Men 9:30pm Two and a Half Men 10:00pm Family Guy 10:30pm Family Guy 11:00pm Family Guy 11:30pm I'm a Celebrity... Extra Camp 12:35am Family Guy 1:05am American Dad!
4:30am This is BBC Four 8:00pm World News Today 8:30pm Top of the Pops Janice Long presents the pop chart programme, first broadcast on 30 October1986. 9:00pm The Live Lounge Show 10:00pm Barbra Streisand: Becoming an Icon 1942-1984 11:00pm Roxy Music: A Musical History 12:00am Tom Jones's 1950s: The Decade That Made Me 1:00am Roy Orbison: One of the Lonely Ones 2:00am Top of the Pops 2:30am The Live Lounge Show 3:30am Blackadder Goes Forth 4:00am Blackadder Goes Forth 4:30am Blackadder Goes Forth
3:30am Teleshopping 7:00am Classic Coronation Street 7:25am Classic Coronation Street 7:50:00am A Touch of Frost 2:05am Chicago 4:00am Inspector Morse 5:55am Murder, She Wrote
8:45am Everybody Loves Raymond 9:10am Everybody Loves Raymond 9:40am Frasier 10:05am Frasier 10:35:30pm Unreported World 9:00pm Jamie and Jimmy's Friday Night Feast 10:00pm Gogglebox 11:00pm The Last Leg 12:05am Ministry of Justice 1:05am The Purge: Anarchy
4:00am 7:00am 7:50am 8:10am 8:30am 9:25am 10:35am 11:35am 12:40pm 1:40pm 2:45pm 3:50pm 4:50pm 5:55pm 7:00pm 8:05pm 8:30pm 9:00pm 10:00pm 11:00pm 11:05pm 12:05am 1:05am 1:10am 2:20am 3:15am 3:45am 4:00am
Teleshopping The Chase Pawn Stars Pawn Stars Kojak Quincy, M.E. Minder The Sweeney The Professionals Kojak Quincy, M.E. Minder The Sweeney The Professionals Ironside Pawn Stars Pawn Stars Monster Carp Source Code FYI Daily Source Code Falling Down FYI Daily Falling Down The Americans The Protectors ITV4 Nightscreen Teleshopping
7:55am 8:05am 8:15am 8:35am 1:15am
8:30am 10:25am 12:20pm 2:10pm 4:25pm 6:50pm 9:00pm 11:15pm 1:35am 3:10am
6:30am 8:25am
10:30am 12:30pm 12:50pm 2:45pm 4:45pm 6:35pm 6:55pm 9:00pm 11:00pm
Thomas and Friends Fireman Sam Shane the Chef Peppa Pig Peppa Pig Ben and Holly's Little Kingdom Paw Patrol Floogals Digby Dragon Shimmer and Shine The Secret Life of Puppies Jeremy Vine Switched for Christmas Neighbours Season's Greetings The Perfect Christmas Village 5 News at 5 Friends Friends Neighbours 5 News Tonight The Gadget Show Britain by Boat Portillo's Hidden History of Britain Run All Night Super Casino 12:15am 12:40am 1:05am 2:10am
Deep Blue Sea The Hurricane Heist Rocky Balboa The Perfect Storm Marvel's Avengers Assemble Mission: Impossible III Die Hard The Bourne Legacy Rambo Marked for Death
5:10am 7:00am 8:50am 10:40am
Robin Hood: Men in Tights Talladega Nights: The Ballad of Ricky Bobby Hope Floats The Grinch: Special This is the End Father Figures Rough Night The Grinch: Special My Cousin Vinny This is the End Father Figures Identity Thief The Big Bang Theory The Big Bang Theory Naked Attraction Tattoo Fixers
Holly Star Lady Bird Holly Star The Greatest Showman 12:40pm Maze Runner: The Death Cure Sci-fi action sequel starring Dylan O'Brien (American Assassin) as the leader of a renegade group battling to save their friends from sinister organisation WCKD. 3:15pm Wonder Wheel 5:15pm A Gift for Christmas 7:00pm The Greatest Showman 9:00pm Maze Runner: The Death Cure 11:25pm Lady Bird 1:05am Bomb City 3:00am Western 5:15am A Gift for Christmas
FRIDAY TV
6:00am 7:00am 7:30am 8:00am 9:00am 10:00am 11:00am 4:00pm 5:00pm 6:00pm 7:00pm 8:00pm 11:15pm 12:15am 1:00am 2:00am 3:00am 3:30am
9:00am 9:30am 10:00am 11:00am 12:00pm 12:15pm 12:30pm 1:00pm 1:30pm 2:00pm 2:15pm 3:00pm 4:00pm 4:30pm 5:00pm 6:00pm 6:30pm 7:00pm 7:30pm 8:00pm 11:15pm 12:15am 12:45am 1:00am
Sky Sports News Good Morning Sports Fans Bitesize Good Morning Sports Fans Bitesize Good Morning Sports Fans Good Morning Sports Fans Good Morning Sports Fans Live European Tour Golf Football Centre Football Centre Sky Sports News at 5 Sky Sports News at 6 Football The Debate - Live Premier League Best Goals Sky Sports News Sky Sports News Sporting Records Live NBA: Golden State @ Milwaukee
Football's Greatest EFL Greatest Games Football Years Play-Off Final Highlights A New Life in Turin One2eleven SPFL Greatest Games Football's Greatest Football Countdowns A New Life in Turin EFL Greatest Games Play-Off Final Highlights Football's Greatest Football Countdowns One2eleven Football Years Football Countdowns SPFL Matters EFL Matters Football The Debate - Live SPFL Matters EFL Greatest Games Football's Greatest
The schedules for the television programme pages are provided by an external company: we regret that any changes or errors are not the responsibility of Euro Weekly News.
68 EWN
6 - 12 December 2018
SATURDAY TV
7:00am Breakfast The latest news, sport, business and weather from the BBC's Breakfast team. 11:00am Saturday Kitchen Live Matt Tebbutt is joined by Yotam Ottolenghi plus special guest Hugh Dennis 12:30pm Classic Mary Berry 1:00pm Football Focus 2:00pm BBC News 2:15pm Snooker 5:30pm Final Score 6:25pm BBC News 6:35pm BBC London News 6:45pm Pointless 7:35pm Strictly Come Dancing 9:10pm Michael Mcintyre's Big Show 10:10pm Casualty 11:00pm BBC News 11:20pm Match of the Day 12:50am The NFL Show 1:20am Weather for the Week Ahead
8:00am All Over the Place 8:25am Wild and Weird 2 8:40am Show Me What You're Made of 9:10am All Over the Workplace 9:40am Flushed Away 11:00am Radio Gibbon 12:00pm Homes Under the Hammer 1:00pm A Cook Abroad 2:00pm Call Me Madam 3:50pm Escape to the Country 4:35pm Flog It! 5:30pm Snooker 6:00pm Football: Women's World Cup Draw 2018 7:00pm Dad's Army 7:30pm Richard Osman's House of Games 8:00pm Snooker 11:00pm Performance Live: Love 12:00am Snowfall 12:40am Gambit 2:00am Hunky Dory 3:45am Louis Theroux's Altered States: Choosing Death
8:00pm Wild Tales From the Village 9:00pm Tap America: How a Nation Found It's Feet 10:00pm The Sinner 10:40pm The Sinner 11:20pm Barbra Streisand: Becoming an Icon 1942 - 1984 12:20am Top of the Pops Gary Davies and Peter Powell present the pop chart programme, first broadcast on 22 May 1986. 12:55am Guitar Heroes 1:55am Wild Tales From the Village 2:55am Mcmafia 3:50am Mcmafia
8:10am Everybody Loves Raymond 8:35am Everybody Loves Raymond 9:05am Frasier 10:05am The Big Bang Theory 10:35am The Big Bang Theory 11:00am The Big Bang Theory 11:30am Heineken Champions Cup Rugby 12:30pm The Simpsons 1:00pm The Simpsons 1:30pm Heineken Champions Cup Rugby 4:10pm The Simpsons 4:40pm The Simpsons 5:15pm The Simpsons 5:40pm Arthur Christmas 7:35pm Channel 4 News 8:00pm Britain's Most Historic Towns 9:00pm Hunt for the Arctic Ghost Ship 10:00pm Allied 12:25am The Impossible 2:30am Ministry of Justice 3:25am Hollyoaks Omnibus 5:40am Big House, Little House
8:45am Peppa Pig 8:55am Peppa Pig 9:00am Ben and Holly's Little Kingdom 9:15am Paw Patrol 9:35am Nella the Princess Knight 9:50am Shimmer and Shine 10:00am Pirata and Capitano 10:20am Rusty Rivets 10:35am Paw Patrol 10:55am Rise of the Teenage Mutant Ninja Turtles 11:05am Rooftop Christmas Tree 12:50pm The Christmas Train 2:55pm Enchanted Christmas 4:40pm Rock and Roll Christmas 6:30pm Home for Christmas Day 8:10pm 5 News Weekend 8:15pm Britain's Craziest Christmas Lights 9:10pm Harrogate: A Yorkshire Christmas 10:10pm Harrogate: A Yorkshire Christmas 11:10pm My Big Fat Greek Wedding 2 1:00am Super Casino
5:45am Mike and Molly 6:05am Mike and Molly 7:00am Christmas Land unclassified. 8:35am Baby Daddy 9:00am Baby Daddy 9:30am Baby Daddy 10:00am Couples Come Dine with Me 11:00am Made in Chelsea 12:00pm Thunderbirds 1:50pm Rude(Ish) Tube Shorts 2:00pm The Goldbergs 2:30pm The Goldbergs 3:00pm The Goldbergs 3:30pm Brooklyn Nine-Nine 4:00pm Brooklyn Nine-Nine 4:30pm Brooklyn Nine-Nine 5:00pm Brooklyn Nine-Nine 5:30pm Brooklyn Nine-Nine 6:00pm Young Sheldon 6:30pm The Big Bang Theory 7:00pm The Big Bang Theory 7:30pm The Big Bang Theory 8:00pm The Big Bang Theory 8:30pm The Big Bang Theory 9:00pm The Big Bang Theory 9:30pm The Big Bang Theory 10:00pm The World's End 12:10am Gogglebox
Sky Sports News Sky Sports News Good Morning Sports Fans 9:00am Rugby Gold Remember some classic matches from rugby's autumn internationals. 9:05am Live Rugby 7s: Cape Town 12:15pm My Icon 12:30pm Football Bournemouth host Liverpool at the Vitality Stadium in the Premier League. 4:15pm Info not available 6:15pm Football Reading take on Sheffield United at the Madejski Stadium in the Sky Bet Championship. 12:00am Live NBA: Houston @ Dallas 2:30am Sporting Records 3:00am Sky Sports News 4:00am Sky Sports News 5:00am Sky Sports News
8:35am The Tom and Jerry Show 8:50am The Powerpuff Girls 9:10am Toonmarty 9:30am Robozuna 10:05am Mighty Magiswords 10:25am ITV News 10:30am Saturday Morning with James Martin 12:40pm The X Factor 2:10pm ITV Lunchtime News 2:20pm Apollo 13 5:00pm You've Been Framed! 5:30pm Tipping Point 6:30pm ITV Evening News 6:40pm ITV News London 6:55pm Star Wars: Episode IV - A New Hope 9:10pm The Chase: Celebrity Special 10:10pm I'm a Celebrity, Get Me Out of Here! 11:10pm The Jonathan Ross Show 12:15am ITV News 12:30am Jaws 2 2:30am Jackpot247 4:00am Paul O'grady: For the Love of Dogs
3:20am Teleshopping 6:50am ITV2 Nightscreen 7:00am Totally Bonkers Guinness World Records 7:25am Emmerdale Omnibus 9:55am Coronation Street Omnibus 12:50pm I'm a Celebrity, Get Me Out of Here! 2:20pm Catchphrase 3:20pm Jack Frost 4:20pm FYI Daily 4:25pm Jack Frost 5:25pm I'm a Celebrity, Get Me Out of Here! 6:55pm Yes Man 7:55pm FYI Daily 8:00pm Yes Man 9:00pm The Fast and the Furious: Tokyo Drift 10:05pm FYI Daily 10:10pm The Fast and the Furious: Tokyo Drift 11:10pm I'm a Celebrity... Extra Camp 12:15am Family Guy 12:40am Family Guy 1:15am Family Guy 1:40am Family Guy
5:55am 6:45am 7:00am 7:20am 7:40am
4:00am 7:00am 7:15am 7:40am 8:35am 9:30am 10:30am
9:25am The Amazing SpiderMan 2 11:50am Spider-Man 2:00pm Spider-Man 2 4:15pm Spider-Man 3 6:40pm The Amazing SpiderMan 9:00pm The Amazing SpiderMan 2 11:25pm Spider-Man: Homecoming 1:45am Spider-Man
5:15am A Gift for Christmas 7:00am Wonder Wheel Woody Allen's 1950s-set drama stars Kate Winslet as a former actress whose life is upturned by the appearance of her husband's estranged daughter. 9:00am The Greatest Showman 11:00am A Yeti Adventure 12:40pm Maze Runner: The Death Cure 3:15pm A Gift for Christmas 5:00pm Black Panther: Special 5:30pm Lady Bird 7:20pm A Yeti Adventure 9:00pm Maze Runner: The Death Cure 11:25pm The Greatest Showman 1:20am A Very Sordid Wedding 3:20am Bomb City 5:15am Holly Star
6:00am 6:30am 6:45am 7:00am 7:15am 7:30am 7:45am 11:00am 12:30pm 1:00pm
9:40am
11:40am
1:50pm 2:55pm 4:00pm 6:00pm 8:00pm 10:00pm 12:00am 2:05am 2:35am 3:00am 3:30am
Murder, She Wrote ITV3 Nightscreen Judge Judy Judge Judy Columbo: Death Hits the Jackpot Bertie and Elizabeth Enchanting featurelength portrayal of the life of Queen Elizabeth, the Queen Mother. Santa Claus Classic family Christmas adventure starring Dudley Moore, 1985 Agatha Christie's Poirot Agatha Christie's Poirot Midsomer Murders Midsomer Murders Midsomer Murders Midsomer Murders Midsomer Murders On the Buses On the Buses ITV3 Nightscreen Teleshopping
11:35am 11:50am 12:20pm 12:45pm 1:10pm 1:40pm 2:15pm 5:00pm 5:25pm 5:50pm 6:50pm 6:55pm 7:55pm 10:00pm 11:00pm 11:05pm 12:05am 1:05am 1:10am 2:25am 3:20am
Teleshopping World of Sport The Protectors The Professionals The Professionals Motorsport UK ITV Racing: The Opening Show World of Sport Pawn Stars Pawn Stars Pawn Stars Pawn Stars Pawn Stars ITV Racing: Live from Sandown Pawn Stars Pawn Stars The Train Robbers FYI Daily The Train Robbers Hornblower First Blood FYI Daily First Blood Training Day FYI Daily Training Day The Americans The Protectors
9:55am Click 11:50am Sweet Home Alabama 1:50pm Game Night 3:40pm Role Models 5:30pm National Lampoon's Christmas Vacation 7:15pm Dodgeball: A True Underdog Story 9:00pm Game Night 10:45pm Role Models 12:35am Fist Fight 2:15am The Little Hours 4:00am Wilson
6:00am 7:00am 8:00am
4:15pm 6:00pm 6:15pm 9:00pm 10:00pm 11:00pm 12:00am 12:15am 12:30am 12:45am 1:00am 2:00am 2:15am 2:30am 2:45am
Football's Greatest EFL Greatest Games EFL Greatest Games EFL Greatest Games EFL Greatest Games EFL Greatest Games Football Soccer A.M. SPFL Matters Gillette Soccer Saturday Info not available EFL Greatest Games Football EFL Goals: Championship UEFA Nations League Review Show EFL Goals: Championship A New Life in Turin EFL Greatest Games EFL Greatest Games EFL Greatest Games EFL Goals: Championship One2eleven One2eleven SPFL Greatest Games SPFL Greatest Games
The schedules for the television programme pages are provided by an external company: we regret that any changes or errors are not the responsibility of Euro Weekly News.
70 EWN
1:25am 7:00am 9:30am 11:00am 12:00pm 12:30pm 1:30pm 2:00pm 2:15pm 2:50pm 3:35pm 5:00pm 6:00pm 6:15pm 6:25pm 7:25pm 8:15pm 9:00pm 10:00pm 11:30pm 11:50pm 12:00am 12:45am 1:20am 2:20am
6 - 12 December 2018
BBC News Breakfast Match of the Day The Andrew Marr Show Sunday Politics My Faith and Me: Jj Chalmers Bargain Hunt BBC News Songs of Praise Escape to the Country Shrek the Third Dynasties BBC News BBC London News Countryfile Doctor Who Strictly Come Dancing Dynasties Care BBC News BBC London News Match of the Day 2 The Women's Football Show The Apprentice The Apprentice: You're Fired!
10:30am The Martin Lewis Money Show 10:55am Gino's Italian Coastal Escape 11:25am Doc Martin 12:25pm Midsomer Murders 2:20pm ITV Lunchtime News 2:30pm Best Walks with a View with Julia Bradbury 3:00pm Paul O'grady: For the Love of Dogs 3:30pm The Chase 4:30pm Tenable 5:30pm How to Spend it Well at Christmas with Phillip Schofield 6:30pm Tipping Point 7:30pm ITV Evening News 7:45pm ITV News London 8:00pm The Chase: Celebrity Special 9:00pm I'm a Celebrity Catchphrase Special 10:00pm I'm a Celebrity...Get Me Out of Here! Final 11:35pm ITV News 11:55pm Les Dawson Forever 1:40am Football Genius
7:15am School for Scoundrels 8:45am Greatest Gardens 9:15am The Instant Gardener 10:00am Countryfile 11:00am Saturday Kitchen Best Bites 12:30pm The Hairy Bikers' Best of British 1:30pm Food and Drink 2:00pm Snooker 6:15pm Flog It! 7:00pm Britain's Biggest Warship 8:00pm Snooker 12:00am The Mash Report 12:30am I'll Get This 1:00am Athletics 2:00am Stacey Dooley Investigates 3:00am Question Time 4:00am Holby City A much-loved face from the past forces a guilty Serena to think about her future. 5:00am This is BBC Two Highlights of programmes on BBC Two.
8:00pm A History of Christianity 9:00pm Why the Industrial Revolution Happened Here Professor Jeremy Black examines one of the most extraordinary periods in British history. 10:00pm Daredevils and Divas: A Night at the Circus 11:00pm The Sky at Night A look at the world of astronomy. 11:30pm Horizon Series exploring topical scientific issues. 12:30am The Farthest: Voyager's Interstellar Journey 2:00am Why the Industrial Revolution Happened Here Professor Jeremy Black examines one of the most extraordinary periods in British history. 3:00am Mcmafia
7:20am King of Queens 7:45am Everybody Loves Raymond 8:10am Everybody Loves Raymond 8:35am Everybody Loves Raymond 9:00am Frasier 9:25am Frasier 10:00am Frasier 10:30am Sunday Brunch 1:30pm The Simpsons 2:00pm The Simpsons 2:30pm The Simpsons 3:00pm The Simpsons 3:30pm Stuart Little 2 5:05pm Father Christmas 5:35pm The Snowman 6:05pm The Snowman and the Snowdog 6:35pm Home Alone 8:35pm Channel 4 News 9:00pm Escape to the Chateau 10:00pm A Very British Country House 11:00pm Tin Star 11:55pm 8 Out of 10 Cats Does Countdown 1:00am The Angels' Share 2:45am The Last Leg
7:35am Emmerdale Omnibus 10:10am Coronation Street Omnibus 1:10pm I'm a Celebrity, Get Me Out of Here! 2:15pm You've Been Framed! 2:50pm Shrek the Halls 3:20pm Spy Kids 3: Game Over 4:20pm FYI Daily 4:25pm Spy Kids 3: Game Over 5:05pm How the Grinch Stole Christmas 6:05pm FYI Daily 6:10pm How the Grinch Stole Christmas 7:10pm Despicable Me 8:10pm FYI Daily 8:15pm Despicable Me 9:00pm The Mask 10:00pm FYI Daily 10:05pm The Mask 11:05pm Family Guy 11:35pm I'm a Celebrity... Extra Camp 12:40am Family Guy 1:10am Family Guy 1:35am Family Guy 2:05am American Dad!
7:00am 7:55am 8:55am 10:00am 12:05pm
7:00am 7:50am 8:45am 9:40am 10:40am 11:50am 12:50pm 1:50pm 2:50pm 2:55pm 3:55pm 4:55pm 5:00pm 6:00pm 6:25pm 6:50pm 7:50pm 10:00pm 11:05pm 11:10pm 12:45am 1:55am 2:00am 3:00am 3:50am 4:00am
1:40pm 2:55pm 4:00pm 6:00pm 8:00pm
10:00pm 12:00am
1:05am 2:15am 3:30am 4:20am 5:15am 5:35am
Murder, She Wrote Heartbeat Heartbeat Goodbye Mr Chips Columbo: Forgotten Lady Agatha Christie's Poirot Agatha Christie's Poirot Midsomer Murders Midsomer Murders Endeavour Crime drama series about the young Detective Constable Endeavour Morse. Vera Joanna Lumley's Trans-Siberian Adventure Agatha Christie's Poirot Lucan Road to Avonlea Road to Avonlea Judge Judy Murder, She Wrote
The Professionals The Professionals The Sweeney The Sweeney The Sweeney Minder Minder The War Wagon FYI Daily The War Wagon The Train Robbers FYI Daily The Train Robbers Pawn Stars Pawn Stars Made in Britain Hornblower Executive Decision FYI Daily Executive Decision The Usual Suspects FYI Daily The Usual Suspects Minder ITV4 Nightscreen Teleshopping
8:05am 8:15am 8:30am 8:50am 8:55am 9:00am 9:10am
SUNDAY TV
Thomas and Friends Bob the Builder Digby Dragon Peppa Pig Peppa Pig Peppa Pig Ben and Holly's Little Kingdom Paw Patrol Nella the Princess Knight Friends Friends Friends Friends Friends Friends Friends Friends Friends Friends 101 Dalmatians Nativity 3: Dude, Where's My Donkey?! Call Me Claus Warship: Life at Sea 5 News Weekend Edge of Tomorrow Timecop Super Casino
7:00am Hollyoaks Omnibus 9:25am Rude(Ish) Tube Shorts 9:40am Baby's Day Out 11:30am Made in Chelsea 12:35pm Don't Tell the Bride 1:35pm The Goldbergs 2:00pm The Goldbergs 2:30pm The Big Bang Theory 3:00pm The Big Bang Theory 3:30pm The Big Bang Theory 4:00pm The Big Bang Theory 4:30pm The Big Bang Theory 5:00pm The Big Bang Theory 5:30pm The Big Bang Theory 6:00pm The Big Bang Theory 6:30pm Young Sheldon 7:00pm The Big Bang Theory 7:30pm Oblivion 10:00pm Colombiana 12:05am The Big Bang Theory 12:35am The Big Bang Theory 1:05am The Inbetweeners 1:35am The Inbetweeners 2:05am Tattoo Fixers 3:10am Rude Tube 4:05am Rude(Ish) Tube 4:30am Hollyoaks Omnibus
6:00am 7:00am 8:00am 9:00am 9:15am 9:25am
Spider-Man Spider-Man 2 Spider-Man 3 Spider-Man: Homecoming 4:10pm The Amazing SpiderMan 6:30pm The Amazing SpiderMan 2 9:00pm Spider-Man: Homecoming
7:00am A Gift for Christmas 8:45am Black Panther: Special 9:15am A Yeti Adventure 10:55am The Greatest Showman 12:55pm Maze Runner: The Death Cure 3:30pm In Darkness 5:25pm A Yeti Adventure 7:00pm The Greatest Showman Showstopping musical biopic about legendary 19thcentury circus entrepreneur PT Barnum. 9:00pm Maze Runner: The Death Cure 11:25pm In Darkness 1:15am Lady Bird 2:55am Bomb City 4:50am Top Ten Show, the 2018 5:10am Holly Star
9:30am 9:45am 10:00am 10:30am 12:00pm 12:15pm 12:30pm 12:45pm 1:00pm
9:30am 9:45am 10:00am 10:30am 11:00am 11:25am 11:55am 12:25pm 12:55pm 1:25pm 1:55pm 2:25pm 2:55pm 5:05pm
7:15pm 9:05pm 9:55pm 10:00pm 12:15am 2:00am
7:00am 9:10am 11:25am 1:50pm
7:30am Dude, Where's My Car? 9:00am A Little Something for Your Birthday 10:45am Pretty Woman 12:50pm The Terminal 3:05pm Jack and Jill 4:45pm How to Lose a Guy in 10 Days 6:45pm Pretty Woman 9:00pm The Terminal 11:15pm Pineapple Express 1:10am Zombieland 2:45am Ali G Indahouse
12:35pm 12:50pm 2:00pm 4:30pm 7:30pm
10:00pm
1:45am 2:00am 2:10am
2:00pm 5:00pm 5:30pm 5:45pm 6:00pm 6:15pm 6:30pm 6:45pm 7:00pm 7:30pm 8:30pm 9:00pm 10:00pm 10:30pm 11:30pm 12:00am
Sky Sports News Sky Sports News Total Goals Info not available Rugby Archive Live Rugby 7s: Cape Town Info not available Live Rugby 7s: Cape Town Info not available Live Renault Super Sunday Live NFL: Sunday A match from the NFL. Live NFL: Sunday A match from the NFL. My Icon My Icon Live NFL: Sunday The Oakland Raiders take on the Pittsburgh Steelers at the Oakland Alameda Coliseum in the NFL.
EFL Greatest Games EFL Greatest Games Info not available Sunday Supplement One2eleven One2eleven SPFL Greatest Games A New Life in Turin EFL Goals: Championship Football Info not available A New Life in Turin SPFL Greatest Games SPFL Greatest Games SPFL Greatest Games SPFL Greatest Games SPFL Greatest Games To be Announced EFL Goals: Championship Football's Greatest Play-Off Final Highlights To be Announced EFL Goals: Championship Football's Greatest Play-Off Final Highlights
The schedules for the television programme pages are provided by an external company: we regret that any changes or errors are not the responsibility of Euro Weekly News.
FEATURE
Richard Shanley. As has become tradition, another David Walliams’ book has been adapted for the festive period - this time round, it’s The Midnight Gang.
6 - 12 December 2018
EWN 71
Mrs Brown’s Boys and Luther set for a BBC Christmas
MRS BROWN’S BOYS: Will be returning to our screens over the Christmas period. Take That mark their 30th anniversary with a special one-off p ro g ramme fo r B B C O ne a nd younger viewers may be keen to catch the animated version of Ju-
lia Donaldson and Axel Scheffler’s Zog. The stars of Goodness Gracious Me will celebrate the show’s 20th anniversary alongs ide c e le brity fa ns Arterton and Olivia Colman. Separately, award-winning screenwriter Andrew Davies - the subject of a documentary also shown over the Christmas period - has adapted Victor Hugo’s novel Les Miserables for the small screen. John Malkovich will return to BBC One playing Poirot in The ABC Murders, with Rupert Grint appearing alongside as Inspector Crome. Ken Dodd will be remembered in How Tickled We Were on BBC Two.
Wishing you a lively long life Marbella Moments by Nicole King GETTING old is a privilege but as we get older simple tasks can become more of a challenge and that’s why having an organisation to take care of our elderly, particularly when no family members are to hand, is imperative. Marbella and San Pedro de Alcantara now have our own Age Concern organisation, presided by Tom Burns and supported by a very active and interactive committee who have dedicated much time to get it set up and established. There is already a team of 25 volunteers but more are needed to fully cover our 27km stretch of coastline. Our community becoming aware that we have this facility and passing the information on is equally as important as the association itself as often those most in need of assistance don’t realise that they need it or that help is available. Tom and Lynda Woodin, one of Age Concern Marbella’s fundraising and awareness volunteers came to Mi Marbella Radio last week and explained that they have just disbanded their ini-
tial affiliation with Age Concern España and have joined forces with Age Concern UK with the added benefit of having access to all the training materials, videos and back up already offered by this long established branch. Obviously this is a big plus as all their material is in English, the main language of communication within our international community, enabling them to do an even better job. Raising funds is also very important to keep things going. To this end there are several events already programmed. Coming up on December 13 is the Christmas lunch to be held at Posidonia Banus. The tickets are just 25€ and includes a three-course meal, a choir and other entertainment. Tickets available so please do join us. Also the owner of Links restaurant bar has planned a sponsored hike up the Concha mountain in February 2019 to help raise awareness and much needed funds, again please support this incentive. Tom has also booked a gala event for October 4, 2019 at the
Melia Don Pepe, hoping for at least 150 locals to attend and support the cause. This is very much a #BetterTogether charity, where all of us can do our little bit to help and indeed all of us should, as we hopefully all aspire to reach old age and it’s comforting to know that we won’t be facing this alone. Just having someone to talk to when hospitalised or when you can’t get out and about much can make all the difference to our health. With this in mind Age Concern also hold monthly coffee mornings the last Thursday of each month at the Padel and Tennis Club, Nueva Alcantara, where everyone is welcome. Again, the important thing is that regardless of our age we pass this information on to everyone we know so that those in need know there is support out there so that we may all enjoy a healthy, happy and lively long life!
VOLUNTEER: Lynda Woodin, Age Concern volunteer on Marbella Now TV with Nicole.
Age Concern Helpline 689 355 198 @marbellanow Hug and happiness, Nicole
72 EWN
6 - 12 December 2018:10pm Escape to the Country 4:40pm The Best Christmas Food Ever 5:30pm Flog It! 6:15pm Pointless 7:00pm BBC News at Six 7:30pm BBC London News 8:00pm The One Show 8:30pm River Walks 9:00pm EastEnders 9:30pm Panorama 10:00pm Nadiya's Asian Odyssey 11:00pm BBC News at Ten 11:30pm BBC London News 11:45pm Have I Got a Bit More News for You 12:30am The Graham Norton Show 1:15am Ambulance Martin Lewis Money Show 9:30pm Coronation Street 10:00pm Sir Cliff Richard: 60 Years in Public and in Private 11:00pm ITV News at Ten and Weather 11:35pm ITV News London 11:50pm Killer Women with Piers Morgan 12:50am Judge Rinder's Crime Stories 1:15am Jackpot247
10:00am 11:00am 12:00pm 1:15pm 2:00pm 3:00pm 3:15pm 3:45pm 4:45pm
5:45pm 6:15pm 7:00pm 7:30pm 8:00pm 9:00pm 9:30pm 10:00pm 11:00pm 11:30pm 12:15am 1:15am
BBC News at 9 Victoria Derbyshire BBC Newsroom Live Politics Live Athletics Coast Railways: The Making of a Nation Who Do You Think You Are? Gordon Buchanan: Elephant Family and Me Eggheads Put Your Money Where Your Mouth Is Richard Osman's House of Games Strictly: It Takes Two Celebrity Antiques Road Trip Only Connect University Challenge Babies: Their Wonderful World People Just Do Nothing Newsnight Inside the Foreign Office The Apprentice
9:55am Coronation Street 10:25am The Ellen DeGeneres Show 11:20am Totally Bonkers Guinness World Records 11:45am I'm a Celebrity...Get Me Out of Here! Final 1:15pm Emmerdale 1:45pm Coronation Street 2:45pm The Ellen DeGeneres Show 3:40pm The Jeremy Kyle Show 4:45pm The Jeremy Kyle Show 5:50pm The Jeremy Kyle Show 7:00pm I'm a Celebrity...Get Me Out of Here! Final 8:35pm You've Been Framed! 9:00pm Two and a Half Men 9:30pm Two and a Half Men 10:00pm Family Guy 10:30pm American Dad! 11:00pm American Dad! 11:30pm Family Guy 12:00am Family Guy
8:00pm Beyond 100 Days 8:30pm Christmas University Challenge 2017 9:00pm Hidden Wales with Will Millard Professor Jeremy Black examines one of the most extraordinary periods in British history. 10:00pm Treasures of Ancient Rome 11:00pm A Very English Scandal 11:55pm A Very English Scandal 12:55am Everyday Eden: A Potted History of the Suburban Garden 1:55am Mcmafia 2:50am Mcmafia 3:50am Hidden Wales with Will Millard
5:35am 6:30am 7:00am 7:25am 7:55am 8:55am 9:55am 10:25am 10:50am 11:20am 1:35pm 2:35pm 3:40pm 4:10pm 4:40pm 6:55pm 7:55pm 8:55pm 11:00pm 12:05am 2:10am 3:05am 3:30am
Murder, She Wrote ITV3 Nightscreen Classic Coronation Street Classic Coronation Street Heartbeat The Royal Judge Judy Judge Judy Judge Judy Inspector Morse The Royal Heartbeat Classic Coronation Street Classic Coronation Street Inspector Morse Heartbeat Murder, She Wrote Agatha Christie's Poirot Liar A Touch of Frost Liverpool 1 ITV3 Nightscreen Teleshopping
9:10am Everybody Loves Raymond 9:40am Frasier 10:40:55pm The Political Slot 9:00pm Liam Bakes 9:30pm Food Unwrapped 10:00pm 24 Hours in A&E 11:00pm First Dates 12:05am Emergency Helicopter Medics 1:10am Ramsay's Hotel Hell 2:00am Obsessive Compulsive Country House Cleaners
8:45am Peppa Pig 8:55am Ben and Holly's Little Kingdom 9:05am Paw Patrol 9:25am Floogals 9:40am Digby Dragon 9:55am Shimmer and Shine 10:05am The Secret Life of Puppies 10:15am Jeremy Vine 12:15pm Mr Christmas 1:45pm Neighbours 2:15pm My Christmas Love 4:00pm Christmas Catch 5:45pm 5 News at 5 6:00pm Friends 6:30pm Friends 7:00pm Neighbours 7:30pm 5 News Tonight 8:00pm Gallagher Premiership Rugby Highlights 9:00pm Police Interceptors 10:00pm Warship: Life at Sea 11:00pm The Sex Business 12:00am The Internship 2:15am Super Casino 4:10am Secrets of Great British Castles 5:00am Get Your Tatts Out: Kavos Ink 11:30pm 11:55pm 1:00am
4:00am 7:00am 7:50am 8:10am 8:30am 9:30am 10:35am 11:35am 12:45pm 1:50pm 2:50pm 3:50pm 4:50pm 5:55pm 7:00pm 8:05pm 8:30pm 9:00pm
7:00am 8:20am 10:35am 12:20pm 2:15pm 4:50pm
5:10am 7:00am 8:40am 9:00am
10:00pm 11:00pm 11:05pm 12:05am 1:10am 1:15am 2:30am 3:00am 3:50am Rambo: First Blood Part II FYI Daily Rambo: First Blood Part II American History X FYI Daily American History X The Protectors Motorsport UK ITV4 Nightscreen
Justice League Dark Battleship Legion Sucker Punch The Last Samurai King Arthur: Legend of the Sword 7:00pm The Mummy 9:00pm The Terminator 11:00pm T2: Judgement Day 1:35am Terminator 3: Rise of the Machines 3:30am Terminator Salvation
5:50am 7:20am 8:55am 10:35am 12:15pm 1:55pm 3:30pm 5:15pm 7:15pm 9:00pm 10:35pm 12:20am
Police Academy 6: City Under Siege Psych: the Movie Permanent Dear Dictator Little Nicky The House Bad Teacher Fred Claus Chips: Law and Disorder The House Bad Teacher Bowfinger Young Sheldon The Big Bang Theory Made in Chelsea The Big Bang Theory The Big Bang Theory Naked Attraction Gogglebox
Holly Star A Yeti Adventure The Grinch: Special The Greatest Showman Showstopping musical biopic about legendary 19th-century circus entrepreneur PT Barnum. 11:00am Katie Says Goodbye 12:45pm Maze Runner: The Death Cure 3:20pm In Darkness 5:20pm A Yeti Adventure 7:00pm The Greatest Showman Showstopping musical biopic about legendary 19th-century circus entrepreneur PT Barnum. 9:00pm Maze Runner: The Death Cure 11:30pm Katie Says Goodbye 1:10am In Darkness 3:10am Wonder Wheel 5:10am Holly Star
MONDAY TV
6:00am 7:00am 7:30am 8:00am 9:00am 10:00am 11:00am 12:00pm 1:00pm 2:00pm 3:00pm 4:00pm 5:00pm 6:00pm 7:00pm 8:00pm 12:00am 1:00am 2:00am
9:00am 9:30am 10:00am 11:00am 12:00pm 12:30pm 1:00pm 1:30pm 2:00pm 3:00pm 4:00pm 4:30pm 5:00pm 5:45pm 6:00pm 6:30pm 7:00pm 7:30pm 8:00pm 8:30pm 9:30pm 10:00pm 11:00pm 11:15pm 11:30pm 12:00am 12:15am
Sky Sports News Good Morning Sports Fans Bitesize Good Morning Sports Fans Bitesize Good Morning Sports Fans Good Morning Sports Fans Good Morning Sports Fans Football Centre Football Centre Football Centre Sky Sports News Sky Sports News Sky Sports News Sky Sports News Sky Sports News at 5 Sky Sports News at 6 Live Monday Night Football Sky Sports News Sky Sports News Live NFL: Minnesota @ Seattle
Football's Greatest EFL Greatest Games Football Years Play-Off Final Highlights One2eleven SPFL Greatest Games Football's Greatest Football Countdowns EFL Greatest Games Play-Off Final Highlights Football's Greatest Football Countdowns One2eleven One2eleven Football Years Football Countdowns Soccer Am Best Bits Football Countdowns Info not available EFL Goals: Championship Soccer Am Best Bits Play-Off Final Highlights Info not available SPFL Greatest Games Soccer Am Best Bits EFL Greatest Games EFL Greatest Games
The schedules for the television programme pages are provided by an external company: we regret that any changes or errors are not the responsibility of Euro Weekly News.
74 EWN
7:00am 10:15am 11:00am 12:00pm 12:45pm 1:15pm 2:00pm 2:30pm 2:45pm 3:15pm 4:10pm 4:45pm 5:30pm 6:15pm 7:00pm 7:30pm 8:00pm 8:30pm 9:00pm 10:00pm 11:00pm 11:30pm 11:45pm 12:45am 1:40am 1:45am
6 - 12 December 2018
Breakfast Defenders Homes Under the Britain's Secret A1: Britain's Longest Road Bargain BBC News at One BBC London Doctors The Doctor Blake Escape to the Country The Best Christmas Flog It!This edition Pointless BBC News at Six BBC London The One Show EastEnders Holby City Mrs Wilson BBC News at Ten BBC London The Apprentice Stacey Dooley in the USA Weather for the Week Ahead BBC NewsJudge 4:00pm Dickinson's Real Deal Northampton plays host to David and his dealers. 5:00pm Tipping Point 6:00pm The Chase Four more contestants face The Chaser. 7:00pm ITV News London 7:30pm ITV Evening News 8:00pm Emmerdale 8:30pm The Royal Variety Performance 2018 11:05pm ITV News at Ten and Weather 11:35pm ITV News London 11:50pm Britain's Busiest Airport - Heathrow 12:20am Lethal Weapon 1:15am Jackpot
7:30am 8:15am 9:00am 10:00am 11:00am 12:00pm 1:15pm 2:00pm 2:45pm 3:15pm 3:45pm 4:45pm
5:45pm 6:15pm 7:00pm 7:30pm 8:00pm 9:00pm 10:00pm 11:00pm 11:30pm 12:15am 1:05am
7:50am 8:10am 9:00am 9:25am 9:55am 10:25am 11:20am 11:50am 12:15pm 1:15pm 1:45pm 2:15pm 2:45pm 3:40pm 4:45pm 5:50pm 7:00pm 7:30pm 8:00pm 8:30pm 9:00pm 9:30pm 10:00pm 11:10pm 11:15pm 12:45am
The Best Christmas Flog It! MasterChef: The BBC News at Victoria BBC Newsroom Politics Live Think TankBill Reel History of Britain Railways: The Making of a Nation Who Do You Think You Are? Gordon Buchanan: Elephant Family and Me Eggheads Put Your Money Richard Osman's House of Games Strictly: It Takes Two Celebrity Antiques Road Trip MasterChef: The Professionals School I'll Get This Newsnight NFL A Hotel for the Super Rich and Famous
8:00pm Beyond 100 Days 8:30pm Christmas University Challenge 2017 9:00pm The Story of Wales Huw Edwards concludes an indepth history of Wales. Huw Edwards concludes an indepth history of Wales. Wales changes rapidly from the 1940s onwards, as Aneurin Bevan battles to set up Britain's most cherished institution, the NHS. 10:00pm Rise of the Clans 11:00pm A Very English Scandal 12:00am The Jeremy Thorpe Scandal 1:00am The Men Who Built the Liners 2:00am Mcmafia 3:00am Mcmafia 4:00am Rise of the Clans
You've Been Framed Gold at Christmas Ninja Warrior UK Emmerdale Coronation Street Coronation Street The Ellen DeGeneres Show Planet's Got Talent Planet's Got Talent Britain's Got Talent Emmerdale Coronation Street Coronation Street The Ellen DeGeneres Show The Jeremy Kyle Show The Jeremy Kyle Show The Jeremy Kyle Show You've Been Framed! You've Been Framed! You've Been Framed! You've Been Framed Gold at Christmas Two and a Half Men Two and a Half Men The Holiday FYI Daily The Holiday Family Guy 7:00pm Heartbeat 8:00pm Murder, She Wrote 9:00pm Agatha Christie's Marple 11:00pm Liar 12:00am A Touch of Frost Frost investigates when a couple returning home from holiday find the body of a stranger 2:05am Liverpool 1
7:30am 3rd Rock from the Sun 7:55am 3rd Rock from the Sun 8:20am 3rd Rock from the 8:45am Everybody Loves Raymond 9:40am Frasier 11:10am Ramsay's Kitchen Nightmares USA 12:05pm The Simpsons 12:30pm The Simpsons 1:00pm Channel 4 1:05pm A New Life in the 2:05pm My Family Secrets Revealed 3:10pm Countdown 4:00pm Fifteen to One 5:00pm A Place in the Sun 6:00pm Kirstie's Handmade 7:00pm The Simpsons 7:30pm Hollyoaks 8:00pm Channel 4 8:55pm The Political 9:00pm Celebrity Lego Masters at Christmas 10:00pm 999: What's Your Emergency? 11:00pm Gogglebox 12:05am First Dates 1:10am Paul Heaton: From Hull to Heatongrad
7:50am 8:10am 8:30am 9:25am 10:35am 1:35am 12:40pm 1:45pm 2:50pm 3:50pm 4:50pm 5:55pm 7:00pm 8:05pm 8:30pm 9:00pm 10:00pm 11:00pm 12:05am
12:10am 1:45am 2:50am
Pawn Stars Pawn Stars Kojak Quincy, M.E. Minder The Sweeney The Professionals Kojak Quincy, M.E. Minder The Sweeney The Professionals Ironside Pawn Stars Pawn Stars Made in Britain The Motorbike Executive Decision Action thriller FYI Daily Latest news from the world of entertainment. Executive Decision Action thriller The Sweeney Minder Comedy drama series.
8:05am 8:15am 8:35am 8:55am 9:05am 9:25am 9:40am 9:55am 10:05am 10:15am 12:15pm
1:45pm 2:15pm 4:00pm 5:45pm 6:00pm 7:00pm 7:30pm 8:00pm
9:00pm 10:00pm 11:00pm 12:05am
Fireman Sam Shane the Chef Peppa Pig Ben and Holly's Little Kingdom Paw Patrol Floogals Digby Dragon Shimmer and Shine The Secret Life of Puppies Jeremy Vine Murder, She Baked: A Christmas Pudding Mystery Neighbours Christmas in Homestead Christmas by the Book 5 News at 5 Friends Neighbours 5 News Tonight Ultimate Strongman Team Challenge 2018 Our Yorkshire Farm Secrets of Ss Great Britain The Sex OAPs Behaving Badly
8:55am 10:30am 12:10pm 2:05pm 3:45pm
Babylon A.D. Braven Collateral Red Sonja Marvel's Avengers Assemble 6:15pm Gone in 60 8:15pm Avatar 11:00pm Transformers: The Last Knight 1:40am Resident Evil: Apocalypse
Hollyoaks Mike and Molly Baby Daddy Melissa and Joey The Big Bang Theory The Goldbergs The Big Bang Tattoo Fixers Tattoo Fixers at Christmas 12:05am The Big Bang Theory 12:35am The Big Bang Theory 1:00am Naked
7:30am 8:00am 9:00am 10:00am 11:00am 12:00pm 1:00pm 2:00pm 3:00pm 4:00pm 5:00pm
7:00am 8:40am 10:10am 12:00pm
7:15am EFL Greatest 7:30am SPFL Greatest 7:45am SPFL Greatest Games 8:00am Football Years 8:30am Football Countdowns 9:00am Football's Greatest 9:30am EFL Greatest Games 10:00am Football 11:00am Play-Off Final Highlights 12:00pm One2eleven 12:30pm SPFL Greatest Games 1:00pm Football's Greatest 1:30pm Football 2:00pm EFL Greatest 3:00pm Play-Off Final 4:00pm Football's Greatest 4:30pm Football 5:00pm One2eleven 6:00pm Football Years 6:30pm Football Countdowns 7:00pm EFL Greatest 7:30pm Football 8:15pm SPFL Greatest Games 8:30pm Soccer Am Best 9:00pm League Cup Final 10:00pm Play-Off Final 1:15pm SPFL Greatest 11:30pm Soccer Am Best Bits 12:00am EFL Greatest Games
7:30am 8:00am 9:00am 10:00am 11:00am 12:00pm 1:00
1:45pm 4:10pm 5:45pm 7:15pm 9:00pm
11:25pm 7:00am Austin Found 8:50am The Competition 10:40am The Truth About Cats and Dogs 12:25pm Ferris Bueller's Day Off 2:15pm You've Got Mail 4:20pm The Back-Up Plan 6:10pm Bad Santa 7:55pm You've Got Mail 10:00pm Pretty Woman 12:05am T2: Trainspotting 2:10am City Slickers 4:10am The Nutty Professor
TUESDAY TV
1:10am
2:50am
4:45am
A Gift for Christmas A Yeti AdventureTo In Darkness We Wish You a Marry Christmas Maze Runner: The Death Cure Katie Says Goodbye A Yeti Adventure We Wish You a Marry Christmas Maze Runner: The Death Cure Sci-fi action In Darkness Blind pianist Natalie Dormer (who also co-writes) is drawn into a brutal criminal underworld Katie Says Goodbye Olivia Cooke (Ready Player One) stars as a young woman with plans to fund a new life Bomb City Long-simmering tensions between misunderstood punk rockers and footballplaying jocks A Gift for Christmas
6:00pm 7:00pm 8:30pm 12:00am
1:00am
2:00am 4:00am
Good Morning Good Morning Good Morning Good Morning Sky Sports News Sky Sports News Sky Sports News Sky Sports News Sky Sports News Sky Sports News Sky Sports News All the news from the Premier League and beyond. Sky Sports News at 5 Sky Sports News at 6 Gillette Soccer Special Sky Sports News All the news from the Premier League and beyond. Sky Sports News All the news from the Premier League and beyond. Live WWE Late Night Smackdown Sky Sports News
The schedules for the television programme pages are provided by an external company: we regret that any changes or errors are not the responsibility of Euro Weekly News.
76 EWN
7:00am Breakfast 10:15am Defenders UK 11:00am Homes Under the Hammer 9:00pm Christmas Shop Well for Less 10:00pm The Apprentice 11:00pm BBC News at Ten 11:30pm BBC London News 11:45pm A Question of Sport 12:15am Michael Mcintyre's Big Show 1:20am Weather for the Week Ahead
10:00am 11:00am 12:00pm 12:15pm 2:00pm 2:45pm
4:50am 6:05am
9:25:00pm 11:30pm 11:45pm 12:45am
6 - 12 December 2018 Paul O'grady: For the Love of Dogs Coronation Street I'm a Celebrity...Get Me Out of Here! Coming Out ITV News at Ten and Weather ITV News London Peston The Jonathan Ross Show
3:15pm 3:45pm 4:45pm 5:45pm 6:15pm
7:00pm 7:30pm 8:00pm 9:00pm 10:00pm 11:00pm 11:30pm 12:15am
1:15am
10:25am 11:20am 11:50am 12:15pm 1:15pm 1:45pm 2:45pm 3:40pm 4:45pm 5:50pm 7:00pm 7:30pm 8:00pm 8:30pm 9:00pm 9:30pm 10:00pm 11:00pm 11:05pm 12:45am 1:15am
BBC News at 9 Victoria Derbyshire BBC Newsroom Live Politics Live Think Tank Reel History of Britain Railways: The Making of a Nation Who Do You Think You Are? The Polar Bear Family and Me Eggheads Put Your Money Where Your Mouth Is Richard Osman's House of Games Strictly: It Takes Two Celebrity Antiques Road Trip MasterChef: The Professionals Death and Nightingales The Apprentice: You're Fired! Newsnight Escape From Dubai: The Mystery of the Missing Princess School
8:00pm 8:30pm
You've Been Framed! The Ellen DeGeneres Show Planet's Got Talent Planet's Got Talent Britain's Got Talent Emmerdale You've Been Framed! Special The Ellen DeGeneres Show The Jeremy Kyle Show The Jeremy Kyle Show The Jeremy Kyle Show You've Been Framed! You've Been Framed! You've Been Framed! You've Been Framed! Two and a Half Men Two and a Half Men Love Actually FYI Daily Love Actually Family Guy Family Guy
3:30am 7:00am
9:00pm
10:00pm 11:00pm 11:30pm
12:00am
1:00am 2:00am 3:00am 4:00am
Beyond 100 Days Christmas University Challenge 2017 Vikings A warrior and farmer who dreams of riches begins working on a project that will turn the Viking world on its head. Digging for Britain 2018 Vic and Bobs Big Night Out Inside No 9 A second season of dark comedies by Steve Pemberton and Reece Shearsmith. Nature's Wonderlands: Islands of Evolution St Petersburg: An Art Lovers' Guide Collateral Collateral Digging for Britain 2018
8:45am 9:10am 9:40am 11:10am 12:05pm 12:30pm 1:00pm 1:05pm 2:05pm 3:10pm 4:00pm 5:00pm 6:00pm 7:00pm 7:30pm 8:00pm 8:55pm 9:00pm 10:00pm
11:00pm 12:05am 1:05am
7:25am 7:50am 8:55am 9:55am 10:25am 10:50am 11:20am 1:35pm 2:40pm 3:40pm 4:15pm 4:45pm 7:00pm 8:00pm 9:00pm 11:00pm 12:00am 2:05am 3:00am 3:30am
Teleshopping Classic Coronation Street Classic Coronation Street Heartbeat The Royal Judge Judy Judge Judy Judge Judy Inspector Morse The Royal Heartbeat Classic Coronation Street Classic Coronation Street Inspector Morse Heartbeat Murder, She Wrote Agatha Christie's Marple Liar A Touch of Frost Paul O'Grady's Animal Orphans ITV3 Nightscreen Teleshopping
4:00am 7:00am 7:45am 8:10am 8:30am 9:30am 10:35am 11:30am 12:35pm 1:40pm 2:45pm 3:50pm 4:50pm 5:55pm 7:00pm 8:05pm 8:30pm 9:00pm 10:00pm 11:00pm 12:00am 12:05am 1:05am 3:15am 3:45am 4:00am
Everybody Loves Raymond Everybody Loves Raymond Secret Life of the Zoo Old People's Home for 4 Year Olds: Christmas The World's Most Expensive Presents 24 Hours in A&E Pokerstars Caribbean Adventure The Motorbike Show On Deadly Ground FYI Daily On Deadly Ground Hornblower The Protectors ITV4 Nightscreen Teleshopping 12:05am
Peppa Pig Ben and Holly's Little Kingdom Paw Patrol Floogals Digby Dragon Shimmer and Shine The Secret Life of Puppies Jeremy Vine Home for Christmas Day Neighbours Christmas in the Smokies Christmas Connection 5 News at 5 Friends Friends Neighbours 5 News Tonight World's Strongest Man: Giants Live 2018 Kids a&e at Christmas Christmas with the Queen: Inside Sandringham The Sex Business My Secret Sex Fantasy
8:50am Goal! 11:00am The League of Extraordinary Gentlemen 12:55pm Battle: Los Angeles 3:00pm The Accountant 5:10pm Wild Wild West 7:00pm Geostorm 9:00pm Atomic Blonde 11:00pm Die Hard 1:15am Resident Evil: Extinction
7:30am 9:10am
Billy Madison A Bad Idea Gone Wrong 10:40am It Had to be You 12:10pm The Longest Yard 2:10pm The Other Guys 4:05pm National Lampoon's Christmas Vacation 5:50pm Airplane! 7:25pm My Blind Brother 9:00pm The Other Guys 11:00pm Think Like a Man 1:10am Think Like a Man Too 3:00am The Wedding Singer 4:40am Nutty Professor II: The Klumps
WEDNESDAY TV
8:00 The Twilight Saga: Breaking Dawn Part 1 12:20am Dracula Untold 2:05am Married at First Sight USA
6:00am 7:00am
4:45am 6:30am 7:00am
11:00am Championship Season Review 12:00pm One2eleven 12:30pm SPFL Greatest Games 12:45pm SPFL Greatest Games 1:00pm Football's Greatest 1:30pm Football Countdowns 2:00pm EFL Greatest Games 3:00pm Championship Season Review 4:00pm Football's Greatest 4:30pm Football Countdowns 5:00pm One2eleven 6:00pm Football Years 6:30pm Football Countdowns 7:00pm EFL Greatest Games 7:30pm Football Countdowns 8:00pm Football's Greatest 8:30pm Football's Greatest 9:00pm League Cup Final Highlights 10:00pm Play-Off Final Highlights 11:00pm Play-Off Final Highlights 12:00am EFL Greatest Games 12:15am EFL Greatest Games 12:30am EFL Greatest Games
A Gift for Christmas Moana: Special We Wish You a Marry Christmas 8:40am Katie Says Goodbye 10:15am A Yeti Adventure 11:45am In Darkness 1:30pm Maze Runner: The Death Cure 3:55pm The Blind Spot 5:45pm We Wish You a Marry Christmas Miranda and Ian are excited to tie the knot at their Christmas wedding, but with complications on the horizon will they get their happily ever after? Romantic drama. 7:30pm A Yeti Adventure 9:00pm Maze Runner: The Death Cure 11:25pm The Blind Spot 1:15am In Darkness 3:10am Katie Says Goodbye 4:55am Top Ten Show, the 2018 5:15am A Gift for Christmas
7:30am 8:00am 9:00am 10:00am 11:00am 12:00pm 1:00pm 2:00pm 3:00pm 4:00pm 5:00pm 6:00pm 7:00pm 8:00pm 8:30pm 11:00pm 12:00am 1:00am 2:00am 3:00am 4:00am 5:00am
Sky Sports News Good Morning Sports Fans Bitesize Good Morning Sports Fans Bitesize Good Morning Sports Fans Good Morning Sports Fans Good Morning Sports Fans Sky Sports News Sky Sports News Sky Sports News Sky Sports News Sky Sports News Sky Sports News Sky Sports News Sky Sports News at 5 Sky Sports News at 6 To be Announced Gillette Soccer Special To be Announced Sky Sports News Sky Sports News Sky Sports News Sky Sports News Sky Sports News Sky Sports News
The schedules for the television programme pages are provided by an external company: we regret that any changes or errors are not the responsibility of Euro Weekly News.
TIME OUT
6 - 12 December 2018
* There are 22 countries in the world that do not have an army, the large majority comprising tiny island states or enclaves. Incidentally, this doesn’t include the Vatican City, which has the Gendarmerie Corps.
* The seven largest countries in the world (Russia, Canada, USA, China, Australia, Brazil and Argentina) take half of the planet’s territory. * The Mid-Atlantic Ridge is the longest mountain chain on Earth, at 40,000 km.
* Despite the beautiful game’s popularity in Greenland, the country can’t join FIFA because the extreme weather conditions mean grass cannot grow there. In 2006, they were allowed to participate in two World Cup qualifying games. They lost both.
* Fiji is the only country other than India with Hindi as an official language. Native Fijians make up 54 per cent of the population after Indian
YOUR STARS
average rate of 10cm a year, 10 times faster than Venice. This is because it was built on a soft lake bed with subterranean water reserves pumped out.
labourers were brought to Fiji to work on the sugarcane crops under British rule.
* January 1, 2000.
* Mexico City is sinking at an
CREDIT: Wikimedia
WELL POLISHED: Elvis had a secret that he went to great lengths to disguise.
Women’s wit
LOTTERY
UK NATIONAL LOTTERY
Saturday December 1
Don’t waste your energy trying to educate or change opinions; go over, under, through, and opinions will change organically when you’re the boss. Or they won’t. Who cares? Do your thing, and don’t care if they like it.”
IRISH LOTTO
Saturday December 1
Tuesday November 27
Friday November 30
16
24
4
9
12
31
39
17
31
49
43
47
32
26
LUCKY STARS
LUCKY STARS
2
1
3 12
17
Don’t chance your plans being disrupted by ill health. Get any problems sorted out now even if you think they are ‘nothing’. When you are feeling good it is easy to take that for granted. PISCES (February 20 - March 20)
Thursday November 29
Saturday December 1
Sunday December 2
8
18
2
12
9
26
40
19
39
29
44
49
44
45
51
12
EL MILLON: LFD21753
34
4
7
JOKER: 3 594 429
REINTEGRO
22
9
JOKER: 1 687 972
TAURUS (April 21 - May 21) Bring more zip to your life by putting the spotlight on your health. Getting out and about lifts the spirits, while perking up the diet with new foods brightens the system. As energy levels come up this week, be aware of what is happening around you.
The chance to travel seems exciting but can be made even more so by including a few people who are on your wavelength. So busy have you been on the more mundane aspects of life that the ‘big picture’ may have faded into the background. CANCER (June 22 - July 23)
20
REINTEGRO
There are moments of boundless energy which really urge you to ‘get up and go’. Make use of this at work, where most progress is to be made this week. Be you a politician, pensioner or anyone in between, the opportunities are there to be had.
GEMINI (May 22 - June 21)
EL GORDO DE LA PRIMITIVA
23
18
57
Tina Fey
10
16
11
Commensalism - an association between two organisms in which one benefits from the relationship and the other derives neither harm nor benefit.
LA PRIMITIVA
8
BONUS BALL
‘
EURO MILLIONS
5
BONUS BALL
World of English
‘
‘
AQUARIUS (January 21 - February 19)
ARIES (March 21 - April 20)
Elvis Presley is known for many things; his dulcet voice, his sinful and gyrating pelvis, and his jet-black coiffed hair. But one of those things on the list is totally fake, and it’s not his pelvis. In fact, Elvis was actually a natural blonde. In his earlier days the singer, who died in 1977, aged 42, even admitted to colouring his hair with black shoe polish to achieve his signature look.
Famous quote
FOR NEXT 7 DAYS
Your mind is positively buzzing with ideas. There has been so much progress in your personal life during the past year that it is hard to believe. However, you are capable of being very dynamic and single-minded.
DID YOU KNOW?
I am a teacher. It’s how I define myself. A good teacher isn’t someone who gives the answers out to their kids but is understanding of needs and challenges and gives tools to help other people succeed. That’s the way I see myself.” Justin Trudeau
77
FOR MORE INFORMATION ABOUT THE SPONSOR GO TO
SPONSORED BY
Trivia from around the world * Papua New Guinea is the most linguistically diverse country in the world with 851 individual languages listed. Of these, 839 are living and 12 are extinct. English is its official language, though only 1-2 per cent of the population actually speak it.
EWN
An authority figure may also be seen as a possible romantic attachment. Your talents and charm serve you well when approaching this person.
REINTEGRO
LEO (July 24 - August 23) 6
Keeping up the activity level physically is really in
your best interests this week. It is a pivotal point where your resolutions in this area could fail. With life very busy, it is still important to retain your priorities. VIRGO (August 24 - September 23) Does someone in the family need your attention? Don’t begrudge time spent with them, even if you are busy. Consider what you would want others to do if you were in the same position. After all, you love a challenge so see this as a bit of a juggling act. LIBRA (September 24 - October 23) With your enthusiasm socially at a peak, now is the time to get involved with anything that takes your fancy. A project involving music or painting will give you the chance to make new friends. SCORPIO (October 24 - November 22) This week will see more progress on a health issue. Maybe you have recently given up something or taken to the gym. Recent weeks may have conspired to upset your best efforts. It is never too late to make a fresh start, though, especially right now. Someone who gives your confidence a boost also leads you to believe that anything is possible. SAGITTARIUS (November 23 - December 21) Avoid like the plague people who would dampen your spirit. It may not be deliberate but, if you are near repressed or depressed people, it may rub off. Find positive, active people to be near. If you have not started a form of exercise, then now is as good a time as any. Make it group activity if you want more social contacts. CAPRICORN (December 22 - January 20) Romance will find you this week if only you are in the right frame of mind. You may be inclined to refuse festive social gatherings that hold no prospects for you, but don't close the door on anything. The right kind of companions are sometimes found in the strangest places.
78
E W N 6 - 12 December 2018
FOR MORE INFORMATION ABOUT THE SPONSOR GO TO
SPONSORED BY
TIME
Quick
Cryptic Across 7 Friend given card in royal residence (6) 8 A Brie I made from the peninsula (6) 9 Keep making a little dog (4) 10 Example of epic men’s makeup (8) 11 Rowing types, terrible moaners (7) 13 Put off in high-altitude terrain (5) 15 Old Peruvians of a certain caste! (5) 17 Returning paler, she loses heart to fall ill again (7) 20 Accommodation for American coins (8) 21 Where a camper sleeps is in contention (4) 23 Fancy cake outside exotic den (6) 24 Root cause of vehicle decay? (6) Down 1 Loose cloak or carbon copy (4) 2 Sapper's new identity documents? (6) 3 Had plenty of food - but about a quarter had no food! (7) 4 Article I had submitted to editor helped (5)
5 Determine content of crude cider (6) 6 Enjoy Scottish loch portrait (8) 12 Declare Ann put on very little weight (8) 14 Poems about current fashion
Code Breaker
company (7) 16 A Liberal from overseas (6) 18 Possibly faster getting desert (6) 19 Poet has European facial feature (5) 22 Approval after turning on corner (4)
Each number in the Code Breaker grid represents a different letter of the alphabet. In this week’s puzzle, 5 represents C and 12 represents G, so fill in C every time the figure 5 appears and G every time the figure 12 appears. Now, using your knowledge of the English language, work out which letters should go in the missing squares. As you discover the letters, fill in other squares with the same number in the main grid and the control grid.
Across 1 Pleasant-smelling (8) 8 White heron (5) 9 Concur (5) 10 Inactive (4) 11 Sailplane (6) 13 Medical practitioner (6) 15 Elaborate song for solo voice (4) 18 Desist from (5) 19 Intermission (5) 20 Singer of folk songs (8)
English - Spanish
LAST WEEK’S SOLUTION FACING PAGE
Across 1 Caliente (no frio) (4) 3 Piruleta (8) 9 Kidneys (7) 10 Limpio (5) 11 Asado (5) 12 Dill (6) 14 Burbujeante (6) 16 Bitter (in taste) (6) 19 To grow (6) 21 Dirt (5) 24 Bendecir (5) 25 Beehive (7) 26 Tan pronto como (2,4,2) 27 Silk (4)
Down 2 Relating to the countryside (5) 3 Movable barrier in a fence or wall (4) 4 Capable of being farmed productively (6) 5 Weary (5) 6 Drunk (10) 7 Publication that appears at fixed intervals (10) 12 Formal and dignified (6) 14 State to be true or existing (5) 16 Established line of travel or access (5) 17 Pimple (4)
The clues are mixed, some clues are in Spanish and some are in English.
Down 1 Guardarropa (8) 2 Income (from property) (5) 4 Ostra (6) 5 Milk (5) 6 To catch (7) 7 Fist (4) 8 Useless (person) (6) 13 Slap (8) 15 Barriles (7) 17 Mascullar (6) 18 Paintbrush (decorating) (6) 20 Basket (5) 22 Gansos (5) 23 Work (4)
OUT
6 - 12 December 2018
79
FOR MORE INFORMATION ABOUT THE SPONSOR GO TO
SPONSORED BY
Hexagram
The purpose of the Hexagram puzzle is to place the 19 six-letter words into the 19 cells. The letters at the edges of interlocking cells MUST BE THE SAME. The letters in the words must be written CLOCKWISE. The word in cell 10 (COTTON) and one letter in four other cells are given as clues.
AFFORD ASCENT BETONY BIOPSY CENTER CORDON COTTON (10) CUPFUL FRAYED FROSTY HIDDEN MICRON POUNCE PYRITE SCHOOL SIERRA SUFFER SUNDER VERBAL
LAST WEEK’S SOLUTION 1 Coarse 2 Larvae 3 Locate 4 Tallow 5 Rookie 6 Breezy 7 Vestal 8 Tinkle 9 Armful 10 Single 11 Gentry 12 Effort 13 Ginkgo 14 Memoir 15 Floury 16 Shaken 17 Typify 18 Cougar 19 Stroll.
Nonagram
EWN
Boggled.
Kakuro
How many English words of four letters or more can you make from the nine letters in our Nonagram puzzle? Each letter may be used only once (unless the letter appears twice). Each word MUST CONTAIN THE CENTRE LETTER (in this case E) and there must be AT LEAST ONE NINE LETTER WORD. Plurals, vulgarities or proper nouns are not allowed..
LAST WEEK’S SOLUTION
TARGET:
TARGET: • Average: 19 • Good: 27
• Very good: 39 • Excellent: 50
SCORING: 4 letters: 1 point 7 letters: 5 points 5 letters: 2 points 8 or more letters: 6 letters: 3 points 11 points
Average: 7 Good: 9 Very good: 14
LAST WEEK’S SOLUTION
Excellent: 18
rete react reap reaper recap race racer exeat expect expiate exec teraphim terce tear text teat acre aper apex apiece crete crape care caret cape caper utter epic pare pace pacer pact pear peace perch peat preheat piece excrete rear repeat reheat rhea hear heap heat atom atomic teeter team tout crepe cheap cheapie cheat chip cipher ciao miaou mate moat mote
LAST WEEK’S SOLUTIONS
QUICK Across: 1 Proboscis, 5 Nudge, 7 Sober, 9 Dear, 10 Cannon, 12 Sweden, 13 Fake, 15 Radio, 16 Clean, 18 Regarding.
CODE BREAKER
Down: 1 Pen, 2 Obey, 3 Casual, 4 Strange, 6 Dead end, 8 Bandage, 9 Deserve, 11 Belong, 14 Scar, 17 Nag.
CRYPTIC
ENGLISH-SPANISH
Across:
Across:
1 Thrush, 4 Bairns, 9 Rangoon, 10 Sonic, 11 Alert, 12 Explore, 13 Clandestine, 18 Lioness, 20 Apple, 22 Snaps, 23 Radiant, 24 Sadden, 25 Serene.
1 Cliffs, 4 Chupar, 9 Realeza, 10 Glove, 11 Ahead, 12 Ternera, 13 Hermanastro, 18 Apostar, 20 Etapa, 22 Tease, 23 Outside, 24 Spokes, 25 Granja.
Down:
Down:
1 Tarzan, 2 Range, 3 Shorten, 5 Aesop, 6 Run-down, 7 Sacred, 8 Unnecessary, 14 Leopard, 15 Twaddle, 16 Blasts, 17 Gentle, 19 Elsie, 21 Plane.
1 Cargar, 2 Image, 3 Freedom, 5 Hogar, 6 Proveer, 7 Ruedas, 8 Waiting room, 14 Enojado, 15 Sweeter, 16 Mantas, 17 Bañera, 19 These, 21 Avion.
App of the week Calculator Pro While most phones now come with an inbuilt calculator, new app Calculator Pro offers smart phone users exciting new features, including a currency convertor using living data. The app also features a maths calculator, allowing users to take a picture of a problem and get an instant result, as well as a unit conversion facility and BMI calculator.
QUIZ: YOUNG AND OLD 1. By what name is the Central Criminal Court of England and Wales in London more commonly known? 2. In which 1944 Frank Capra film does Mortimer Brewster (Cary Grant), a writer who has repeatedly denounced marriage as ‘an old fashioned superstition’, fall in love with Elaine Harper (Priscilla Lane), the minister's daughter who grew up next door to him? 3. In which decade was BBC TV’s iconic, non-chart music programme the Old Grey Whistle Test first broadcast? 4. In which US state is Salt Lake City, where Brigham Young and his Mormon followers first settled in July 1847? 5. Old Possum’s Book of Practical Cats (1939) is a collection of whimsical poems by which Nobel Prize winning, USborn, British poet? 6. Singer-songwriter/actor Will Young first came to prominence after winning the 2002 inaugural series of which ITV talent contest?
7. Unchained Melody and The Man from Laramie were both UK number one hit singles in 1955 for which BBC DJ/radio personality? 8. Which anarchic 1980s British sitcom featured the characters Mike, Rick, Vyvyan and Neil? 9. Which Ernest Hemingway short story, first published in 1952, tells the story of Santiago, an ageing Cuban fisherman who struggles with a giant marlin far out in the Gulf Stream off the coast of Cuba? 10. Which worldwide organisation, now based in Geneva, was founded in June 1844 by George Williams in London and aims to put Christian principles into practice by developing a healthy ‘body, mind, and spirit’? Not a lot of people know that… the phrase ‘angry young men’ was originally coined by the Royal Court Theatre's press officer in order to promote John Osborne’s 1956 play ‘Look Back in Anger.’
Answers: 1. OLD BAILEY, 2. ARSENIC AND OLD LACE, 3. 1970s (1971), 4. UTAH, 5. T S (Thomas Stearns) ELIOT, 6. POP IDOL, 7. JIMMY YOUNG, 8. THE YOUNG ONES, 9. THE OLD MAN AND THE SEA, 10. YOUNG MEN'S CHRISTIAN ASSOCIATION (YMCA)
LAST WEEK’S SOLUTION atom calm camp clam coma comp lamp limn limo limp loam mail main malt mica milo milt mint moan moat moil molt mont omit palm tamp amino amnio claim clamp clomp compt manic matin anomic atomic impact lipoma manioc mantic oilman optima pitman potman tampon campion implant maintop optimal ptomain tampion complain COMPLAINT COMPLIANT
FOR MORE INFORMATION ABOUT THE SPONSOR GO TO
Credit: Amazon UK
BOOKS
SPONSORED BY
weather
Costa del Sol TOMORROW
TODAY ANTEQUERA
ANTEQUERA
COIN RONDA
Winter murder
MIJAS
COIN RONDA
MALAGA
BENALMADENA MARBELLA
MIJAS
MALAGA
BENALMADENA MARBELLA ESTEPONA
SATURDAY Almeria
Malaga TODAY: MAX 23, MIN 10-S
Fri Sat Sun Mon Tues Wed -
21 21 20 19 17 15
11 - S 10 - S 11 - S 9-S 9 - Cl 8 - Cl
Bilbao
TODAY: MAX 21, MIN 11-S
Fri Sat Sun Mon Tues Wed -
20 20 19 20 16 15
12 - S 11 - S 11 - S 10 - S 9-C 9-S
Madrid
TODAY: MAX 16, MIN 7-C
Fri Sat Sun Mon Tues Wed -
16 12 14 12 10 9
9 - Sh 9-C 9 - Sh 5 - Sh 4-S 4 - Cl
TODAY: MAX 14, MIN 2-C
14 13 13 13 11 9
Fri Sat Sun Mon Tues Wed -
3-C 1-S 2-S 1-S 0-S 0 - Sh
Alicante
Benidorm
Mallorca
Barcelona
TODAY: MAX 21, MIN 10-S
TODAY: MAX 22, MIN 10-S
TODAY: MAX 20, MIN 9-S
TODAY: MAX 17, MIN 8-S
Fri Sat Sun Mon Tues Wed -
21 20 20 19 16 15
S: Sun
11 - S 9-S 11 - S 9-S 8 - Cl 7 - Cl
20 20 20 18 15 15
Fri Sat Sun Mon Tues Wed Cl: Clear
11 - S 9-S 11 - S 9-S 8-C 8-S
Fri Sat Sun Mon Tues Wed -
19 16 17 16 14 14
C: Cloudy
11 - S 9-S 10 - S 8-S 7-C 7 - Sh
Fri Sat Sun Mon Tues Wed -
17 15 16 15 12 11
8-S 7-C 7-S 6-S 5 - Cl 5 - Cl
ANTEQUERA
COIN RONDA
MIJAS
MALAGA
BENALMADENA MARBELLA ESTEPONA
Sh: Showers
Th: Thunder
Sn: Snow
BIRTHDAYS
Euro Weekly News strives for accuracy, but cannot be held responsible for any errors in published forecasts
books@euroweeklynews.com
Sudoku LAST WEEK’S SOLUTION
*Gary Lineker, Ex-footballer; November 30, *Britney Spears, Pop singer; December 2. 36 57 The superstar’s first two albums, Baby One The legendary striker, who played for the More Time and Oops, I Did it Again, both sold English national team from 1984 to 1992, over 20 million copies worldwide. She released another six albums from 2001 to 2013 and became the country’s all-time top scorer in the FIFA World Cup finals after scoring a starred in her film debut Crossroads in 2002. Ozzy Osbourne. remarkable 10 goals. Since retiring, he has *Ozzy Osbourne, Heavy metal singer; forged a successful career as a sports commentator. December 3, 69 *Bette Midler, Singer and actress; December 1, 72 The Black Sabbath frontman became known as the Prince of Darkness and the Godfather of Heavy Metal. He Midler has sold more than 30 million records worldwide, earning herself the stage name The Divine Miss M, and married X Factor judge Sharon Osbourne in 1982 and the biggest hit is ‘Wind Beneath My Wings.’ Her films they split in 2016. include Down and Out in Beverley Hills, Get Shorty, *Jeff Bridges, Movie actor; December 4, 68 The actor starred as Jeff ‘The Dude’ Lebowski in the 1998 Ruthless People, Outrageous Fortune and Hocus Pocus.
Fill the grid so that every row, every column and every 3X3 box contains the digits 1-9. There’s no maths involved. You solve the puzzle with reasoning and logic.
cult classic The Big Lebowski and earned an Academy Award for Best Actor for his portrayal of Otis ‘Bad’ Blake in the 2009 film Crazy Heart. *Little Richard, Rock singer; December 5, 85 The ‘Good Golly Miss Molly’ hitman was inducted into the Rock and Roll Hall of Fame and the Songwriters Hall of Fame. He infused gospel tones with blues music during his performances as a teenager, and performed onstage when he was 14. *Andrew Flintoff, Cricket player; December 6, 40 Retired English all-rounder was named ICC ODI Player of the Year in 2004 and ICC Player of the Year in 2005. He finished his Test career with more than 3,000 runs and 200 wickets taken. He retired from cricket in 2010.
Word Ladder FOAM
RAVE BACK
Move from the start word (FOAM) to the end word (RAVE) in the same number of steps as there are rungs on the Word Ladder. You must only change one letter at a time.
1884 - Monument complete One of the world’s most iconic structures, the Washington Monument was completed. 1917 - Halifax explosion The largest man-made explosion in the pre-atomic era takes place when a French munitions ship, the Mont Blanc, collides with another vessel in Halifax, Canada. 1921 - Free state Following five years of Irish struggle for independence from Britain, an Irish Free State is declared. 1936 - Stepping down After less than a year on the throne, Edward VIII becomes the first ever English monarch to voluntarily abdicate. 1941 - Pearl Harbour America joined the Second World War after a surprise attack by the Japanese on the American naval base at Pearl Harbour. 1945 - Bermuda Triangle Five US Navy Avenger torpedo bombers became lost in the Bermuda Triangle during a routine training mission. A search plane dispatched to rescue the men also became lost. 1975 - East Timor Indonesia launches a largescale invasion of the former Portuguese part of the island of Timor, near Australia. 1980 - Shock shooting One of the most famous pop stars in history John Lennon was killed by an obsessed fan in New York City.
This week in history
ESTEPONA FROM the outside, a snowcovered cottage in the Cotswolds looks like an idyllic festive home, but inside waits the body of local writer Leonora Jewell. When Melissa Craig visits the area to enjoy her first winter there, she is asked to complete Jewell’s final book. Staying in her cottage, Craig finds a gruesome discovery overlooked by the police; a metal bar covered in blood. Police refuse to take seriously Craig’s claims this could be linked to the murder and she is left to finish her book. As she goes through Leonora’s notes, though, she begins to wonder whether the writer accidentally laid the way for her own murder. Doing some digging of her own, Melissa uncovers some unsavoury locals who she begins to suspect. But can she solve the case before the killer strikes again? Murder on a Winter Afternoon is the fifth book in the Melissa Craig series by Betty Rowlands.
TIME OUT
DVD Criminal Minds CREDIT: Amazon UK
E W N 6 - 12 December 2018
Solution FOAM FORM FARM FARE RARE RAVE
80
SOME of the world’s favourite fictional FBI agents return in series 13 of Criminal Minds. The profilers from the FBI’s Behavioural Analysis Unit work to unearth psychopaths and sociopaths joined by a new addition to the team, former International Response Team member and ex-Delta soldier, Matthew Simmons. Each grim case tests the skills of characters David Rossi, Dr Spencer Reid, Jennifer Jareau, Penelope Garcia, Dr Tara Lewis, Luke Alvez, and Emily Prentiss. The American crime drama was created and produced by Jeff Davis and began in 2005, running successfully for 14 seasons. In its time the show has become a ratings hits for its network CBS.
HEALTH BEAUTY
&
EWN
6 - 12 December 2018
TO READ MORE
81
V I S I T O U R W E B S I T E W W W. E U R O W E E K LY N E W S . C O M
Your knee isn’t improving?
RESEARCH FOUND: Bacteria on our skin is becoming resistant to antibiotics.
(Not so) friendly bacteria A TYPE of bacteria found naturally on our skin is becoming immune to antibiotics, scientists have warned. Staphylococcus epidermis grows naturally on our skin and is normally harmless, but experts claim the bacteria is mutating to defend itself against antibiotics, leaving us more vulnerable to infection. The bug, which is similar to the hospital superbug MRSA, can make its way into an open wound after surgery, causing infection. Scientists at the University of Bath are now urging doctors to identify patients who may be more vulnerable to infection and work to prevent or quickly treat any issue. Professor Sam Sheppard from Bath’s Milner Centre for Evolution said: “Staphylococcus epidermis is a deadly pathogen in plain sight.” He added: “It’s always been ignored clinically because it has frequently been assumed that it was a contaminant in lab samples, or it was simply accepted as a known risk of surgery.” Professor Sheppard noted: “Post-surgical infections can be incredibly serious and fa-
tal,” adding, “infection accounts for almost a third of deaths in the UK so I believe we should be doing more to reduce risk if we can.” The scientist concluded: “If we can identify who is most at risk of infection, we can target those patients with extra hygiene precautions before they
undergo surgery.” Experts say you can help avoid bacteria travelling into cuts and scratches by washing hands frequently using soap and warm water, keeping the skin clean, not sharing razors, bedding or towels, and keeping any cuts clean and covered.
THE knee is the largest joint in the body. • four bones • more than 20 muscles (each with a tendon!) • four major ligaments as well as many little ones • and at least three layers of cartilage. And as we put more ‘miles on the clock’ it can start to complain. Which makes living the active life you came to Spain for, more uncomfortable. If you’ve been having treatment with no improvement here are my five top reasons why: • It’s not your knee when you spoke to someone about your knee pain they never bothered to check all the joints attached to it - feet, ankles, hips, lower back. Problems
By Estelle Mitchell in these areas can get referred to the knee. The best treatment in the world isn’t going to help if it’s in the wrong place! • No one told you it needs to be STRAIGHT We tend to focus on bending the knee, but if it doesn’t straighten properly it can change how we move our hips and lower back, affect nerve function and muscle strength. • You got an injection corticosteroids are a fabulous short term / emergency pain relief. They are
NOT a treatment. They just hide the pain rather than treat the cause. Long term they can start to damage the tissues inside the joint. • You got an MRI not an assessment - more and more research shows that MRIs don’t actually tell us what is causing pain. All they show is what your joint looks like on in the inside. They don’t tell us how you move, what the other joints are like, when it happens... • You skipped rehab after surgery - so now the other knee hurts because you never got full function back in the first knee. Or your back hurts. Or the same knee still hurts because the other issues weren’t addressed.
For more information and research on how to beat knee pain check out our website, our Facebook page Bodyworks Health Clinic or call us on 952 83 151.
82 EWN
6 - 12 December 2018
YOUR PAPER - YOUR VOICE - YOUR OPINION Letters should be emailed to oursay@euroweeklynews.com or make your comments on our website:
Views expressed and opinions given are not necessarily those of the EWN publishers. No responsibility is accepted for accuracy of information, errors, omissions or statements.
Being together is a life saver AS Christmas approaches I often think of those in the autumn of their years who for whatever reason, find themselves without friends and family around them. Recently I read that being lonely is as bad for elderly people as smoking 15 cigarettes a day. The evidence suggests that people don’t eat as well when they are on their own, which can make them more vulnerable to kidney and heart problems. While people are living longer, society has changed and extended family life is not as common as it used to be. I hope you will help to promote social clubs for pensioners and activities that they can get involved in on the Costa del Sol. Nora Clarkson
Sorry Leapy I WILL indeed withdraw my statement and would like to send my sincere apologies to Leapy Lee. I am sorry I misread his comments when highlighting the Grenfell disaster. The quote was: ‘To hear the moaning and whingeing of the evacuated you would have thought they would have preferred to chance an agonising death than be disturbed at that time of night.’ He was of course referring to a neighbouring tower block that was also evacuated, again very sorry for misreading his comments. Ray Osborne
Barrelling in I WAS shocked to read about Malaga Council’s plan to employ a marksman to cull the city’s parakeets. I do understand that their numbers have grown out of control and that they impact on other birds and wildlife, but this just seems a little inhumane. I personally prefer another method used to eradicate some overpopulated species; increasing numbers of their natural predators. In London, falcons used to be to help keep down the number of pigeons. Some people may disagree with this but I think it is better to let nature take its course rather than having gunmen wandering through the streets. Mrs A Ford
Good guide
BEAUTIFUL: Calle Larios, Malaga, Xmas 2017. I JUST wanted to say thank you for your guide to upcoming Christmas events in last week’s Social Scene (Costa Del Sol issue 1743). My grandchildren always look forward to the turning on of the lights in Malaga and this year I will now be able to surprise them with a few more local events. On the subject of Christmas lights, I was pleased to read that Malaga City Council was using LED lights in this year’s display. I imagine this measure will help to save costs for the taxpayer and also give us a much-needed reminder we should all be doing more to avoid waste, even during the festive period. Mrs Sheila A Booth
HAVE YOUR SAY
All letters by email or post should carry the writer’s address, NIE and contact number though only the name and town will be published.
OPINION & COMMENT
OUR VIEW
A call for order AS British Members of Parliament prepare to vote this Tuesday on the Prime Minister’s Brexit deal, many expatriates will be left wondering what the future holds due to ongoing uncertainty. Many will no doubt welcome the repeated guarantees Theresa May has made to expatriates living in Spain and elsewhere in the European Union (EU). These state that at least 300,000 expatriates living in Spain should, in theory, be able to continue living or working in the country as they did before Brexit. The problem lies not in the details of the deal, but in its chances of being approved in Westminster. Scores of MPs including those from Labour, the Scottish National Party (SNP) and hard-line Conservative Brexiteers have said they are prepared to vote the deal down. The British expatriate community is a broad church as far as Brexit is concerned. Many would have liked Britain to remain in the EU, while others are happy the country is leaving. But all are equally entitled to feel secure about their future in Spain. While political posturing and threats may satisfy some MPs it is people here who are left worried about their homes, pensions and if their future here is secure. Politicians should for the sake of all British citizens both at home and abroad focus on securing an orderly Brexit instead of playing fast and loose with people’s lives.
Now we want to hear your views. YOUR PAPER - YOUR VOICE - YOUR OPINION Readers who have missed correspondence can see all letters - which can be edited before publication - posted on:.
Spain is leading on migration at G20 summit I am not sure how accepting 47,000 migrants and then allowing them to cross into France and make their way to Calais to try to get to central London ... is leading the World. May we know how many have been repatriated ? PM
ANDALUCIA ELECTIONS: Ruling PSOE’s majority slashed as far right Vox party makes gains This is a reflection of the people’s opinion of the ruling elite that have plundered Andalucia for decades. I think it is a protest that should make all Spain wake up to the fact that they have been misled by the governing parties for too long. Derek Robinson
BREAKING: Norah Garratt has been FOUND alive and well in Benidorm Fantastic news, it’s the best news I’ve heard in ages, been a frantic 72hrs about my dear friend. Just glad the ending is the one everyone wished and pray for. Hugs and kisses to Norah
Public announcement from the Sales Director of EWN Media Group Proud to work in the best expat paper in Spain and I’m sure this new venture will only make things even better. Nazario I am proud to have been part of the EWN family for more
COMMENTS FROM EWN ONLINE than eight years now and always look forward to seeing the paper hitting the streets. Here’s to another few years to enjoy this publication. Maureen The EWN continues to grow from strength to strength, power in presence and publication across southern Spain with its tangible product as well as with the digital and social platforms opening the reading audience globally for all past residents, visitors and future visitors to the region to continue to keep up with the news. Being part of the EWN family previously I continue to enjoy reading weekly, so far this year I have read and introduced new readers to the Euro Weekly in the UK, Sydney, Australia, Budapest and Transylvania, Romania, the heart of the South Pacific in New Caledonia as well as the USA, friends globally message me saying they still read despite only having spent the odd five minutes initially, why, because it’s more than a weekly, bi-weekly rag, it’s a people persons community publication and people read to keep up with both news and columnists, that pretty much speaks volumes!!! The public have spoken, and the general consensus is that the Euro Weekly is by far the best in the region then yester-
day’s announcement makes absolute perfectly good sense! Good luck (not that it is needed) in the future growing publications of the Euro Weekly News! Harrison I really hope I can continue to get the EWN after the changes. I live in the UK and go to the Costa del Sol as often as I can, although it is getting increasingly difficult for me. As a pensioner and the crumbling UK financial situation since Brexit, I find I can only get down there for one week a year now. I would come to live there, but just can’t afford the initial outlay as I don’t have property here. Very sad!! Anyway, I really enjoy reading EWN as I feel it brings me closer to the place I love and it’s good to keep up with what’s going on there. Good luck in the new venture, I will stay a loyal reader and poster of certain articles on Facebook. Linda I believe we all agree Euro Weekly News is a well-known newspaper but the best of it is just here round the corner. The Euro Weekly family is working very hard to achieve the best result ever. Thank you very much to all our readers and clients for your support and understanding. Laura I am very proud to have been part of the EWN family for 11 years, and am looking forward to exciting things happening in the future. Our clients are the best and I know they are going to love the way ahead. Amalia
SCENE
OCIAL
EWN
6 - 12 December 2018
Update on food, drink, entertainments, what’s on and weekly happenings
83
TO READ MORE VISIT
CELEBRITIES
Jobs fit for a queen AFTER attending a glittering gala banquet at Madrid’s Royal Palace it was back to business for Queen Letizia last Thursday as she took part in a series of workshops in the Spanish capital. The Spanish queen, 46, joined Labour Minister Magdalena Valerio to mark the 40th anniversary of the National Employment Institute at the palace. Letizia looked typically sharp in a belted grey coat
teamed with a pussybow blouse and flared trousers, with her hair worn in her signature side parting. She began her day by meeting the President of the National Heritage Board of Directors, Alfredo Perez de Arminan, before attending the workshops which included saddlery, binding, moving goods and gardening. At the end of the engagement, Letizia spoke to students from the institute.
REGAL STYLE: Queen Letizia was promoting employment.
The only way is marriage JAMES ARGENT has big plans for 2019, revealing recently that he’ll propose to girlfriend Gemma Collins within the next year. Moreover, he is thinking about sunnier climes for the nuptials, saying: “We love the idea of getting married in Es-
sex or Brighton as they’re both special places to us, or we might go abroad and do it in Spain or Italy.” While the marriage may be on the cards, Gemma, 37, is not feeling rushed and does not plan to have a baby until at least 40.
Elsa is a siren SHE portrays the darkly enigmatic leader of a group of siren-human hybrids in upcoming Netflix series Tidelands, and this week Spanish actress Elsa Pataky, 42, praised the show for having strong female characters and embracing gender equality. The mother of three, who lives in Byron Bay, Australia, with husband Chris Hemsworth, said: “I’m not saying the men’s characters are not strong, I ’ m j u s t s a y i n g t h e y ’ re very equal. “ I t ’s g o o d t o s e e s t o ries like that right now.” The former model who was born in Madrid, also said she felt particularly connected to the mythology surrounding sirens, saying she “grew up with them.” Last month, Elsa revealed that starring in Tidelands had been a positive experience for her marriage.
Large Terrace with - TV showing live FOOTBALL
She said being on set again had allowed her and husband Chris, 36, to focus on things outside family life and bond over their shared love of acting.
SPANISH SIREN: Elsa Pataky.
84 EWN
6 - 12 December 2018
SOCIAL SCENE
Get into the groove By Sally Underwood THE Gibraltar International Jazz Festival comes to town this Sunday. The last few tickets are still on sale for the world-famous event, where the Ronnie Scott’s Jazz Orchestra with Georgina Jackson will perform the music of Count Basie, Duke Ellington, Woody Herman, Stan Kenton, The Rat Pack, and Benny Goodman, amongst others. Also performing will be ‘Malfunktion,’ the result of a musical metamorphosis moving away from the traditiona l J a z z s ound to the more up tempo Funk Fusion arrangements. Gibraltarian Saxophonist Nick Gonzalez, frontman of the well-known Nick Gonzalez Jazz Quartet, a popular a nd ve rs a tile s e t up pe rforming in Gibraltar and Spain, will join with Burkhard ‘Bee’ Menn from Germany, his musical partner in crime during his musical independence, performing original material as well as music influenced by artists like Maceo Parker, Miles Davis and Nils Landgren. For tickets, visit jazzfestival.com/buy-tickets.
RONNIE SCOTT’S: Jazz Orchestra will play the international event.
GEORGINA JACKSON: Will join the famous ensemble.
ICE turns 30 By Sally Underwood ONE of the Costa del Sol’s most popular clubs has celebrated its 30th anniversary with a special event at the
Finca Monasterio at San Martin. The International Club of Estepona (ICE) has also got in to the festive spirit with a series of events to mark the season, including a performance to commemorate the First World War, and a Festive Fair. Coming up on its social calendar is also the Christmas Quiz Night tomorrow at 8pm for an 8.30pm start, as well as a carol concert on Sunday from 7.30pm for an 8pm start. Next Thursday, December 13, is the organisation’s Christmas lunch, while the following day there will be a Family History day from 11am. To check out ICE’s regular club activities and plans for the festive season visit their website, or drop into the clubhouse on Bahia Dorada on Thursday 10.30am to 2.30pm, or Sunday 12pm to 2.30pm, or email info@theiceclub.es.
SOCIAL SCENE
6 - 12 December 2018
EWN 85
Advertising Feature
Christmas is coming - celebrate at Da Bruno Mijas ONE of the friendliest restaurants on the Mijas Costa, Da Bruno is gearing up for Christmas and the New Year with a selection of great food and sensational entertainment. If you have a group of friends or colleagues who are looking for a venue to get together and celebrate the end of the year, then there are seven different group options of set me a l s a t a r a n g e o f p ric e s which could be ideal, provided there are 12 of you or more. Ther e i s n o t h i n g w o rs e th a n people t r y i n g t o wo r k o u t w h o spent what with a meal, but Da Bruno solves the problem for you as the price is set and wine with the menu is included. They a r e o p e n o n Ch ris tmas Day for lunch and dinner with a special three-course set meal at €39.90 per person (drinks extra) or the full a la carte menu. If you choose the evening session, t h e n t h e r e st a u ran t h a s arranged for some very special entertainment starting at 8pm with the Vintage Girls, a duo led by La Voz finalist Virginia Alexandre
CHRISTMAS TREAT: The Vintage Girls promise a Vintage Xmas Performance. who specialise in presenting songs fro m th e 1 9 4 0 ’s , 50’s a nd 60’s with a definite touch of the Andrew Sisters. Once Christmas is over, it’s only a few days to New Year’s Eve and as would be expected, Da Bruno’s is pulling out all of the stops to
ensure that guests can welcome 2019 with a bang. There is a five-course set meal with wine, cotillion (party bag), New Year ’s Eve grapes, Champagne at midnight and live music with Frankie Valentine, but for this very exciting event you have
to ma ke your booki ng no l at er than Wednesday December 26. Every day and night is an event at Da Bruno’s and with its great seasonal menu as well as all of the usual favourites and the calm and relaxing décor, you are guaranteed to enjoy your visit
As is now traditional, there will be live music on the two Thursday evenings leading up to Christmas Day with an appearance by a sensational Abba Tribute - as seen on the UK’s Channel 4 TV - on December 13 and the Senza Catene group performing their romantic Tribute to Il Divo on December 23. Each of these musical performances take place between 8pm and 11.30pm with of course breaks for the artists during the evening. Although a lot of thought is given to the Christmas and New Year celebration, the Da Bruno Mijas Restaurant doesn’t overlook the fact that there are plenty of diners who want to celebrate a birthday, an anni ver sar y or j ust want t o have a romantic meal for two, so whatever you are looking for, you won’t be disappointed. Visit for details of bookings and menus or call 952 460 724 for your special reservation, but note that the restaurant will be closed all day on Christmas Eve.
86 EWN
6 - 12 December 2018
SOCIAL SCENE
Light a Light Celebration By Sally Underwood ONCE again Cudeca Hospice celebrates their traditional Christmas ‘Light a Light’ in memory of a loved one, on Friday, December 14 from 6pm. During this celebration the traditional turning on of the lights that decorate the Cudeca Hospice Centre in Benalmadena will be carried out by the Founder and Honorary President, Joan Hunt OBE; and the chief executive and medical director, Marisa Martin together with more than 300 charity candles of the volunteers, friends and employees. During this uplifting occasion, there will also be a visit from Father Christmas, face painting for children, a selection of Christmas cakes and sweets, and a special performance by the pupils of Sunny View College Choir. On this special evening, there will be a chance to take part in a charity raffle, home-
CUDECA: Is hosting its annual commemorative event. made cakes, and other savoury delights. Further items will be on sale, including Cudeca’s popular Christmas cards, hand crafted by patients and volunteers, calendars and the Christmas lottery tickets.
If you wish to light a light in memory of your loved one, you can do it at tupcudeca.org for a minimum donation of €10 or at the Hospice Centre on the night of the event. The dedication will figure in the book ‘Light a
Light,’ which will be printed and displayed in the Cudeca Hospice. The Lights of the Centre are a personal tribute and will continue to shine until January 6. Everyone is welcome to join the charity for this
poignant evening. The charity aims to raise €15,000 with its annual commemorative event. Each year, over 500 people dedicate a light in memory of a loved one and help raise funds for
Cudeca’s special kind of caring. Every year they care for more than 1,400 patients and their families, totally free of charge. For more information, visit.
88 EWN
6 - 12 December 2018
LA SALA BANUS bring a unique pop up Ski Lodge ready for Christmas in Marbella, followed by a special appearance by Santa Claus. There is no need to venture to Sierra Nevada this winter season for that special après ski feeling, as the outdoor terrace at La Sala Banus is receiving a festive makeover with dazzling snow, twinkling lights and plenty of festive cheer, bringing you the ultimate alpine ski experience. If you are looking for a venue to book your Christmas Party with work colleagues, sports team or even just a group of friends, La Sala Banus are offering an affordable two-course Christmas Party Menu for just €19.95. This can be upgraded to include a welcome glass of Cava and ½ a bottle of House Wine for just €29.95 per person. This offering is available every Thursday, Friday and Saturday starting at 8pm in the Live Lounge with live entertainment and exclusive Sala Ski Lodge access. It is also available to book in the
Let it snow! Will be offering that apres ski experience on the Costa del Sol.
main restaurant at lunchtime. Personalised bespoke packages can be arranged on request along with private hire of the Live Lounge and Ski Lodge for larger groups. Pretend you are in the mountains this winter at La Sala Banus. And remember: What happens on the slopes… stays on the slope! Meanwhile, this Sunday it has been confirmed that the No 1 festive celebrity icon, Santa Claus is visiting La S a la P u e rto B an u s along
SANTA CLAUS: Will be at La Sala Banus. with his elves. Arriving at 5pm, children of all ages are invited to meet the main man himself in the Live Lounge of the Puerto Banus venue. The afternoon will include plenty of games, sing-along stories and prizes guaranteed to lift your festive spirits.
Don’t forget to bring your Christmas Wish List so that Santa Claus can prepare for the big day. For more information, please email reservations@LaSala Banus.com or call 952 814 145.
SOCIAL SCENE
Get into the arts THE Andalucia Performing Arts Society (TAPAS) has announced its December events. TAPAS will host its annual Christmas party tomorrow at 7pm at Restaurante Las Cabales on the Coin-Cartama road. Ther e, t he f ant ast i c TAPAS Choi r wi l l be si ngi ng l ot s of f est i ve favourites, old and new, while dance fans will be sure to get up on the floor to music by DJ Big Kevin after a two-course Christm as di nner and m i nce pies. Ever yone i s wel com e and t i cket s ar e €14 f or m em ber s and €16 f or non-members. The following day will be the ‘TAPAS Sing with Ri cky Lavazza,’ at t he Moonlight Lounge, Sunset
Beach Hotel, Benalmadena. By invitation, the fabulous TAPAS choir will j oi n popul ar vocal i st Ri cky Lavazza i n hi s Christmas Show. Tickets ar e €12.50, avai l abl e from the Sunset Beach reception or ductions.rocks. Fi nal l y, on Thur sday, December 13 at 6pm will be t he Mi j as Town Hal l annual Christmas Concert. The TAPAS choir have been invited to sing festive songs, and this year will be adding some surprises. The event i s f r ee and tickets are available from: 952 589 010 or f rd@mi jas.es. Mor e det ai l s f or al l events are available from TAPAS Box office on 678 932 284.
SOCIAL SCENE
6 - 12 December 2018
EWN 89
This week Celebrity Chef from Ready Steady Cook & Fellow Master Chef Steven Saunders, proprietor of The Little Geranium in La Cala shares a special Christmas recipe.
I’m dreaming of a White Chocolate Christmas! Steven Saunders FMCGB The Little Geranium La Cala de Mijas & Marbella WHEN I was younger I had borrowed hundreds of thousands to invest into my first restaurant (The Pink Geranium). I was concerned about how to make it a viable project financially but almost immediately employed a top quality pastry chef (dessert chef) because desserts are not my strongest point! A few months later my pastry chef fell seriously ill and I had to take over that section as well as running the whole kitchen. I had to literally learn how to make high level desserts and I searched high and low for recipes and ideas and I taught myself how to pull sugar, how to make honeycomb for crispy decoration, how to use dried ice and how to make gels to create glossy, shiny fin-
• 200 grams digestive biscuits • 75 grams butter (melted) • 300 grams white chocolate • 280 millilitres double cream • 500 grams soft cheese (fullfat, such as Philadelphia) • 200 grams of mixed dried fruits (cranberries, apricots (cut into small pieces) sultanas, glace cherries) • 100g of glace sweet cherries (in jar) • 100g of cooked chestnuts (you can find these in most supermarkets) • 100g of dark choc broken into small pieces • 100g of white chocolate pieces • 2 tablespoons of icing sugar • 3 leaves of gelatine softened in a little cold water
Method 1. M i x t h e c r u sh e d b is cu its with the melted butter and tip the mixture into a lined 20cm springform cake tin and smooth down with the back of a metal spoon.
ishes which are very much on trend even nowadays. The Pink Geranium was a hit pretty quickly and very soon we started to see the food guides hovering around us and the celebrities poured in. I have served this dessert to many of my clients over the years, including Pierce Brosnan who reluctantly ordered it saying… bang goes my diet! He was about to take on the role as the new James Bond and in his soft Irish accent he asked me if I have ever seen a fat James Bond. I assured him that he wasn’t fat, in fact he looked great and that the calories for this dessert were worth it and he actually agreed! Would you like another slice Pierce? Lol. All year around I try my best to avoid unnecessary calories. I love chocolate though and so it’s nearly impossible especially at this time of year, we should eat what we want at Christmas… right? I created this special cheesecake after spending hours of playing around with white chocolate to create something amazing. It encapsulates every-
PIERCE BROSNAN: Bang goes the diet!
thing that a chocolate lover needs and wants and has a Christmas theme, so it’s a great alternative to the traditional Christmas pudding. That doesn’t mean that you make this instead but you should consider making it as well as the traditional pudding, its better to have some choices. My mother who was a great cook always made three desserts for Christmas Day and we always finished them off on Boxing Day, just as it should be! (One of them was always a Christmas trifle and I will share that recipe with you soon) I promise that this is the best cheesecake you will ever eat and one of the easiest desserts to make. When you make it you should take full credit for it, saying, ‘well I played around with white chocolate and this is what I came up with!’ However I am also happy for you to say that I’ve shown you this recipe personally because it feels as though I have! I am going to be sharing lots more Christmas recipes in the coming weeks so watch this space. I am happy to be your online chef, so if you need me, just email me.
Dreamy White Chocolate Christmas cheesecake
WHITE CHOCOLATE: An amazing dessert. 2. Pop it in the fridge to keep cool while you make the topping. 3. Melt the white chocolate in a bowl over some gently simmerin g w ate r, b e in g c a re ful not to overheat it otherwise it will be ru-
ined. 4. B e a t the c re a m a nd Philadelphia c he e s e in a bow l until smooth. 5. H e a t a little c re a m (a bout one tablespoon) a nd a dd the three leaves of gelatine (softened in cold water for a few minutes first). Now pass it through a sieve into the melted white chocolate and whisk quickly in. 6. Stir the melted white choc mix into the creamy, cheese mix. 7. Scatter dried cranberries,
glace cherries, apricots, cherries and sultanas into the mix. 8. Add the choc pieces and stir in well with a spatula. 9. Add the chestnuts and stir well in. 10. Po ur t he m i x i nt o t he springform tin which is lined with digestive biscuit base 11. Chill for at least six hours or preferably overnight before cutting. Chef’s Note Cut it with a warm knife for best results. You could serve it with a dark chocolate sauce or a toffee s auc e . I l ove i t wi t h t he t of f ee sauce see below.
Quick home-made toffee sauce 110 g butter 250 g light brown sugar 225 ml double cream 1/2 tsp vanilla extract or fresh vanilla seeds
1. Put the butter in a saucepan set over a high heat and melt. 2. Add the sugar and stir well for approximately 4-5 minutes, stirring regularly. 3. Add the cream (or you can use condensed milk) and whisk in the vanilla. 4. Whisk the sauce until it has thickened. Pass if lumpy. Serve warm.
You can email Steven your questions or enquiries to: steven@thelittlegeranium.com. Steven Saunders FMCGB - The Little Geranium, La Cala de Mijas & Marbella.
90 EWN
6 - 12 December 2018
A diabolical liberty Mike Senker In my opinion Views of a Grumpy Old Man APART from me, who is fed up going into restaurants, and when ordering a soft drink like a coke, getting served a 200ml mixer sized bottle that’s the size you use for rum and coke or gin and tonic instead of a 330ml can or bottle and being charged ‘full’ price? It’s a diabolical liberty and a raving con. Don’t give me the old tosh that you can only get them direct from Coca Cola. I don’t care. Go into the local supermarket and buy some. I don’t care if they cost 30 cents and you sell them for €2.20 - just give me a proper size drink OK! One place told me if you use cans, it lowers the tone of the establishment. Listen mate, I’ve got news for you - your place, as brilliant as it is and I love eating there, is an upmarket cafe serving people in t-shirts, swimming shorts and flip flops in the summer. All the staff are walking about in t-shirts, jeans and trainers, not dinner suits and bow ties. It’s not the Ritz. Don’t be the person that stands behind the counter saying ‘you are the 200th person today that I’ve told we don’t get any call for this.’
OK so it’s ‘have a grump at eateries’ today. If you have a sign up saying you close at 4pm like the place Mrs S and Dr S went to in England - then it should be pretty safe to assume that you close at four o’clock correct? Wrong! Mrs S goes in at half three and Dr S is going to join her five minutes later. Patti orders a coffee then Sarah comes in five or so minutes later and also orders a coffee only to be told she can’t have one because the machine is off and is being cleaned. ‘But you don’t close til 4.’ ‘Yeah, but it takes half an hour to clean the machine and tidy up.’ ‘Yes, so do it when you close not when you are open.’ ‘We can’t cos we are open till four.’‘Then close the doors at 3.30!’‘But we have to stay open till four.’ Unfortunately it was a comprehension battle that could not be won. You can almost hear the staff saying, ‘if it wasn’t for all the bloody customers we could get on with our work!’ When I had my shops there was a very simple rule. We opened at 10am and closed at 10pm. The staff had to get there at 9.30am to hoover and do whatever was needed to do so we were ready to serve the public at 10am, and at night they didn’t start the closing process till the shop was closed and all the shifts that worked knew those were the rules.
mikesenker@gmail.com
FEATURE
Behind THE MUSIC V L James | vljcomms@gmail.com | Facebook: @vljamesinfo
Bat Out Of Hell Meat Loaf DESPITE Paradise By The Dashboard Light being metaphorically murdered by a million drunk karaoke singers the world over, Bat Out Of Hell - the album it comes from, remains one of the biggest sellers of all time. Released in September 1977 it was a slow burner with sales being pretty poor to start with. It was a now legendary appearance on the BBC’s Old Grey Whistle Test that gave the album a boost. Written by composer Jim Steinman and produced by Todd Rundgren the album is a set of mini-epics. Influenced by Phil Spectre’s ‘Wall of Sound’ production techniques tracks such as Two
BAT OUT OF HELL: One of the biggest sellers of all time.
Out Of Three Ain’t Bad, You Took The Words Right Out Of My Mouth, Paradise and of course Bat Out Of Hell are not short affairs but are well worth the time. After success in the UK, Australia and Canada, Meat Loaf’s
own USA would eventually catch on. More than 43 million copies have so far been sold. Bat Out Of Hell is Marmite to some people, but having listened to it again recently it deserves its reputation as a classic.
Advertising Feature
Why buy a refurbished computer? THERE are many great reasons for buying refurbished Laptops, PCs and Tablets from Computer City! 1. Savings The fact is that in almost every case you can save money! You can buy a refurbished laptop with a more powerful processor, larger hard drive and more memory for the same price as a basic new laptop. At Computer City España we sell higher- powered processor laptops, not the cheapest Celerons like you get in the supermarkets. 2. Reliability There’s an old tech saying ‘never buy the first release of anything.’ The reason is simple; the manufacturer hasn’t had time to test the product in the real world yet and identify any problems.!
4. Reduce loss If you’re buying a computer for a child, or if your equipment is going to be subject to stressful situations on a regular basis then it makes sense to buy less expensive refurbished equipment. It won’t sting quite as much when it gets dropped, rained on or has peanut butter smeared in the USB ports! 5. Personal service At Computer City España we offer an honest, friendly after-sales support service in English from a couple who have been established on the coast for 18 years. We stock laptops with UK keyboards, UK software and full Office package, all updates and drivers have been downloaded for you. If you need your email set up in Mail or Outlook with your contacts and mail safely migrated, that’s no problem! All of our computers come with a warranty and we transfer all data from your old PC or laptop included in the price. For more information and personal service contact Marcus or Penny on 616 160 474. See our positive feedback on Facebook page.
92
6 - 12 December 2018
SPONSORED BY
Thank you, David
David THE Dogman columnists@ewnmediagroup.com
DAVID THE DOGMAN, the Euro Weekly News’ long standing canine columnist, has decided to retire after more than 20 years of writing for the newspaper. The pet trainer, whose full name is David Klein, has been providing readers with tips on how to train and look after their pets every week at EWN. His writing came on the back of more than 55 years of experience working with animals as a humane and non-confrontational behaviourist and trainer. He was also involved in charitable activity in Spain and Britain and helped to found the Nottinghamshire Hospice in the latter country. He is married to his wife, Susan. David’s philosophy on dog training was summed up by his motto: ‘Commitment, firmness, kindness’. David explained that commitment stood for a dog being for life, firmness because a dog needed to respect its owner and kindness because it made
BOWING OUT: David has been writing for EWN for more than 20 years. for a happier animal. Many of the techniques he perfected are still used by trainers across the world today. David’s writings on dogs covered topics from health, training methods,
communication, feeding and behaviour. He is also an honorary life member of the British Police Services Canine Association. His professional life began with a career in Israel’s Border Police K9
Dog Section which saw him take part in air-sea rescues, scent work and drug and explosives detection. He later became a Fellow of The Institute of Directors and also worked with the Board of Trade.
PETS
The British Prime Minister’s Office went onto congratulate him for his achievements in the field. David’s charity work goes back to the 1970’s, when he used his passion for the piano and organ to raise money by breaking records for non-stop playing. The causes he backed included centres for the elderly, mental health patients and for disabled children. He was honoured for his work with an illuminated scroll presented by then Lord Lieutenant of Nottinghamshire Sir Philip Franklin in December 1973. David later went on to found The Nottinghamshire Hospice in 1977. David retired aged 50 in 1988 and moved to Spain where he has lived ever since. It was while living in Spain that he formed a Costa del Sol-based action group to help people who had suffered from scams, to recover their money. David’s media career has seen him work on radio stations in southern Spain and Gibraltar and he has also appeared on television. He has had a lengthy career as EWN’s in-house dog writer. Everyone at EWN wishes him a happy, well-deserved retirement.
Will your dog miss their usual walk when you’re away? MOST of our pets take great joy and comfort in their daily routines, regular feeding times, their regular walking routes. When you go away on holiday who walks your dogs and keeps
up their routines? We can help you find house-sitters who will do that for you to make sure your pets are happy and feel safe where you know they will be comfortable, at home. If you are not yet familiar with our house-sitting network, HouseSitMatch. com take a look online. It is easy to join, we can help you get started.
DAILY ROUTINES: Dogs take great comfort in this.
Check out our client references online to see what genuine customers say about us too. So if you have holiday plans firming up for 2019, best to pin down your house-sitter n o w. G e t a h e a d a n d s t a r t early. We can help you! Check out our latest Trustpilot reviews We use Trustpilot to verify our client reviews on-
line. Here below we’d like to share one of our latest client testimonials. ‘Every time we’ve used HouseSitMatch we have had a great experience. We have found excellent house sitters and the process has been quick and easy with great customer service. Consistently good experiences … Ruth Dowse, pet owner.
FEATURE
6 - 12 December 2018
EWN 93
Whatever happened to civil discourse? ANGER: Better to listen and respond in a civil manner.
Barry Duke I DON’T normally quote favourably from religious publications, but a while back I set aside an unusually intelligent piece written for the Salvation Army’s The War Cry by Rivera Sun, who called for calm and civil language ahead of the US presidential election. Sun wrote: ‘Discourse is the f o u n d a t i o n o f d e m o c r a c y. T h e ability to have a respectful and informed conversation about polit i c s - i n t h e p o s t o ff i c e , o u r homes, on the media, with friends, family or with total strangers - is essential for a society that prizes the ideals of liberty and freedom. ‘If we are not free to converse without being verbally assaulted, insulted and screamed at, what does that say about the content of our character? Is it really so hard to engage in the practices of be-
ing curious about our differences, asking questions, listening and responding in a sane and civil manner?’ Already things were hotting up, with Trump using the most obnoxious rhetoric to attack his opponents. We all see now, that a
president whose neck size exceeds his IQ has propelled America into a very dark place indeed, where a tsunami of intolerance has been unleashed against vast swathes of the population. Pipe bombs being sent by one of his more deranged supporters
to people like Barack Obama and actor Robert De Niro, the massacre of 11 people in a Pittsburgh synagogue and the gassing of refugees, are the latest examples of the lunacy that has overtaken the country. Meanwhile, Brexit has done immense damage to the UK, with discourse on both sides reaching unprecedented levels of hysteria. I’ve nothing against sarcasm a n d i n s u l t s p e r s e , b u t i t ’s t h e poor quality of the language used which irritates me most. Put-downs now being traded are completely lacking in subtlet y, w i t h t h e F - b o m b b e i n g dropped into every sentence. Insults, of course, have been bandied about since biblical times. Elijah, for example, told the priests of Baal. ‘Perhaps your god is sleeping, or maybe he’s off relieving himself somewhere,’ he suggested (2 Kings 18:27). Shakespeare was renowned for
his insults. ‘Thine face is not worth sunburning’, ‘Thou art as fat as butter ’ and ‘Thou art unfit for any place but hell.’ Centuries later, when boxer Joe Frazier said of Muhammad Ali ‘he’s a phoney, using his blackness to get his way,’ Ali retorted ‘Joe Frazier is so ugly he should donate his face to the US Bureau of Wildlife.’ When Noel Coward told US writer and playwright Edna Ferber that she ‘almost looks like a man,’ she came back with ‘so do you.’ Actress Mae West said of a fella she met, that ‘his mother should have thrown him away and kept the stork’; and when a woman said to Winston Churchill ‘You’re drunk, and what’s more, you’re disgustingly drunk,’ he replied ‘You’re ugly, and what’s more, you’re disgustingly ugly. But in the morning I shall be sober and you’ll still be ugly.’ Oh, for a return to a time when invective was at its most entertaining when people had a better command of the English language.
94
E W N 6 - 12 December 2018
SPONSORED BY
FOR BEST RATES IN MOTOR INSURANCE CALL: 952 89 33 80
AIRPORT TRANSFERS
AIR CONDITIONING
BLINDS
SERVICES
AWNINGS
BUILDING SERVICES
ARCHITECTS
DAMP PROOFING
CAR HIRE
DRAINS
AWNINGS / BLINDS
PETS
DES A H S F ACE O
SERVICES
6 - 12 December 2018 PROPERTY MAINTENANCE
DOORS & WINDOWS
SWIMMING POOLS
SUPERMARKET
EWN 95
WINDOWS
UPHOLSTERY
96 EWN
6 - 12 December 2018
REMOVALS & STORAGE
SERVICES
SERVICES
6 - 12 December 2018
REMOVALS & STORAGE
WASHING MACHINE REPAIRS
TV & SATELLITE STORAGE
EWN 97
98
EWN
6 - 12 December 2018
SPONSORED BY ACCOUNTANTS NEW SERVICE for nonresident property owners. File your yearly tax return (form 210) online from the comfort of your home. (281830)
ADVANCED CLEANING ADVANCED CLEANING SERVICES. Professional Carpet, Upholstery Cleaning, 27 Years Experience, Wet/Dry Clean. Honest, Reliable Service. 678 808 837 / 952 669 701 Or Email acservs@ outlook.com (252581)
ECONOCOOL – Top quality air-conditioning installed from €500. Service, Repairs & Re-Gas from €50. Top Quality Installations. All Areas Covered. Chris – 662 427 396 econocool @hotmail.es
REPAIRS AIR CONDITIONING repairs and service. All areas covered. EnviroCare 21 years’ experience. EnviroCare 952 663 141 carespain.com
AIRPORT TRANSFERS
AIR CONDITIONING AIRFLOW Air conditioning for cooling and heating units. Professional, fully g u a r a n t e e d installations. Tel: 952 443 222 (281291) AIR CONDITIONING. Quality installations. Free quotations. All areas covered. EnviroCare, 21 years’ experience Heating and cooling products. 952 663 141 carespain.com (281338) AIR CONDITIONING Repairs and servicing. Airflow. 952 443 222 (281291) AIR CONDITIONING by Cool and Cosy. The family company that cares. Installation and repairs. Quality machines. Ecosense movement sensors supplied and fitted from 100 Euros. For other energysaving products visit cosy.es. 952 935 513. We are Junta de Andalucia authorised installers as the new laws states (real decreto 115/2017). On the Costa del Sol since 1993 (256689) MR COOL – Air Conditioning, Refrigeration, Heating Systems, Sales & Service – Call Christian 629 527 587 or Nick +34 618 678 853 – (281336)
For daily news visit
BATHROOMS Bathroom renovations and remodelling: Quality installations guiding you through furniture and tile selection working with your requirements. All areas. Masterbuildspain installing bathrooms since 1996. 952 663 141 670 409 759 spain.com info@mas terbuildspain.com
ACE OF SHADES - Vertical, Venetian, Roman, Roller, Wooden blinds, various colours available, also black-out blinds. Tel: 951 273 254 / 671 732 204 / in fo@aceofshades.design (101730)
ANTIQUES
ARCHITECTS PROJECTS, constructions, new buildings, extensions, reforms, licences, legalisations, interior design. 680 700 430 (277250) RENOVATION, reforms, construction, new properties, extensions, pool works, licences, interior design. 629 532 695
AWNINGS ACE OF SHADES - All colours available. Urbanisations catered for, electric and manual operation; also recovery service available, largest selection of colours and designs on the coast. Tel: 951 273 254 / 671 732 204 / info@aceof shades.design (101730)
SOLAR BLINDS SOLAR BLINDS ES Ideal for large glazed areas to reflect heat / glare and stop furniture fading and still keep the view. SAVE HEAT IN THE WINTER to improve your living envi ronment. ian@solar shadetinting.com Tel Ian 958 496 571 / 644 546 176 (256591)
BOATS PUERTO BANUS – Moorings for rent. 8, 12 & 15 metres. 662 379 483 (276083) PUERTO BANUS – Moorings wanted to buy. 0032 473 815 789 (276083)
BOILERS BOILERS. Gas, electric, Solar. Installations & servicing. Gas certificates for gas boilers. Excellent quality. Over 22 years on the Coast. om info@envirocares pain.com 952 663 141 / 670 409 759 (280586)
CARPENTRY KITCHEN, Bedroom and Bathroom refurbishments by try.com 952 196 457 or 696 064 019. Facebook: The Irish Carpenter (276006)
BUILDING SERVICES SWINGLES CASAS SL. For all your building needs. Visit casas.com for more details or call 952 428 067 / 666 960 262 (258056) JIM’S HOME IMPROVEMENTS. bathrooms / kitchen reforms, repairs, plumbing, carpentry, painting, tiling, maintenance. Give us a call no job too small. 692 207 799 / 645 559 423 (281332) CONCRETE – OZBUILD. The specialists of printed concrete. Reseals, Brickwork, Tiling, Plastering, Reforms. 14 Years in Spain. Competitive Prices, Quality Finish. 952 426 074/606 745 920 (279160) GENERAL BUILDER. Tiling, plastering, painting, electrician, plumber, carpentry. Reasonable prices. 635 913 885 (References available) (277904) BUILDING and Renovations. Masterbuild Spain. Refurbishments, bathrooms, kitchens, tiling. All trade work undertaken by professional workmanship. Fully guaranteed. Free quotations. 952 663 141 spain.com (281338)
BUY & SELL DECLUTTER, cash paid for small/medium furniture, antiques, decanters, brass, copper, golf clubs & other ornaments. Howard 608 121 817 (276603)
DR DAMP leaking roofs, damp walls, all mould cured. All work guaranteed. Call 689 515 558 (276245)
HOUSE CLEARANCE SPECIALISTS, FULL OR PART CLEARANCE. ALL FURNITURE WANTED, WE PAY MORE. TEL 634 324 914 OR EMAIL houseclearance man@hotmail.com (27 9484)
DAMP PROOFING.. info@electro-os.com. 958 656 560 / 619 666 363 (281216)
THE WAREHOUSE – We buy a Single item to a Full House Clearance – 602 610 103 (276498)
DAMP PROOFING
BLINDS
BLINDS, awnings, mosquito screens, curtains, vast choice. All areas covered. Coast and inland. 655 825 931 (280561).
BOOKS
CLASSIFIEDS
METALWORK NEW REJAS, GATES, Carports & Fencing, repairs & alterations. Work Guaranteed. Reliable. 14yrs on Coast. Steve the Welder. Call/Whatsapp 655 040 648 (279079)
PLASTERING PLASTERING, rendering, dry lining, coving. Fitted Kitchens, Bathrooms and Bedrooms. All work guaranteed. 689 515 558 (276245)
PROPERTY MAINTENANCE MR-MAINTENANCE – For ALL your Property needs. No Job Too Small – Contact 647 460 155. (276479)
BUSINESS FOR SALE SMALL Garden furniture shop between Estepona/San Pedro. Low price, low rent. Perfect family business. Aircon. Call George 669 331 280 (278098)
BUSINESS OPPORTUNITY CASHBACK on your house/commercial. Payback only when you sell. Quick/easy. Min 20k. 617 333 777
SUPERPOOL est. 1985. Pool tables, boxing and mini-vending machines on profit share, also new/second hand domestic tables and accessories. Tel 629 530 233 - spain.com (278052) ALHAURIN FURNITURE EMPORIUM Buyers & Sellers of quality furniture. Top prices paid. 675 357 575 (281330)
CAMPER/CARAVAN CAMPER VANS, CARAVANS, MOBILE HOMES, BOATS AND ALL PLANT, DIGGERS, DUMPERS, MOTORBIKES, CARS AND COMMERCIALS WANTED. BEST PRICE PAID, CASH TODAY, ANY REGISTRATION WITH OR WITHOUT PAPERS. PLEASE CALL 678 808 837 (253107)
CAR HIRE ALH RENT A CAR – SHORT & LONG-TERM RENTALS FROM €9.90 A DAY. INSURANCE INCLUDED IN OUR P R I C E S . TLF: 638 846 909 or reservasalhrentacar@g mail.com (278376)
CLASSIFIEDS CARAVANS PARKING, STORAGE & SALES. Caravans - Motorhomes - Boats - Cars and Vans etc. Short / long term - Safe & secure, drop off & collections. Excellent rates, discount for long term, 5 mins from Fuengirola. Established 25 years. / in fo@eurodog.es 679 786 669 / 606 101 807 CLASSES CALAHONDA LANGUAGE CENTRE. Established 1987. New beginner’s Spanish course starts 14th January. Maximum 5 students per group for guaranteed results. Other levels and private classes available. Enrol now. Also Translations undertaken calahondalan guage@gmail.com Tel: 952 931 176 (276497)
CLEANING SERVICES CARPENTERS CARPENTER cabinet maker, Irish. Available for all types of property maintenance, plumbing, painting, electrical, kitchens and bathrooms renovated etc., 30 years experience, very reliable. Tel: 952 441 955 / 677 087 575
CARS WANTED CAMPER VANS, CARAVANS, MOBILE HOMES, BOATS AND ALL PLANT, DIGGERS, DUMPERS, MOTORBIKES, CARS AND COMMERCIALS WANTED. BEST PRICE PAID, CASH TODAY, ANY REGISTRATION WITH OR WITHOUT PAPERS. PLEASE CALL 678 808 837 (253107)
CATERING SERVICES CATERING for all occasions, birthdays, weddings, parties, children’s parties. Offering BBQ’s, buffets, paellas, tapas, hog roasts, canapes, seated menus. Can adapt to most budgets. Please call Heather on 657 214 831 or e-mail info@fiestasol.com.
CHIMNEY SERVICES CHIMNEY SWEEP. Clean reliable professional. All types, special price for more than one. Chris 608 337 497 (279225) APEX CHIMNEY SERVICES, professional chimney sweeping and smoke testing. NACS Qualified. Clean and efficient Tel: Bob 696 320 202 (256040)
CHURCH SERVICES BENALMADENA Elim Family Fellowship. Sundays 11am. Elimfamilyfellow ship.com or call 951 912 525 or 952 446 627
UPHOLSTERY and steam cleaning sofas, carpets etc… JA Cleaning Services 626 357 955 (249674)
COMPUTER PROBLEMS SOLVED. Error messages fixed, viruses removed. Repairs and upgrades available. Laptops in English. Kindle, iPad & Android help. One-to-one training. Experienced, reliable service. Paul 630 652 338 / 952 493 859 (276301) PC & LAPTOP SOLUTIONS Windows.Apple.iPhone.Android Efficient Guaranteed Service Marbella.Estepona.Sotogrande Home-Office call 689666888 ifixrp@gmail.com RICHARD (279075)
DAMP PROOFING
ADVANCED Cleaning Services. Professional carpet, upholstery cleaning, 27 years’ experience, wet/dry clean. HONEST, reliable service 678 808 837 / 952 669 701 or email ac servs@outlook.com (253107) RUGS fitted carpets, upholstery including leather cleaned on site 685 524 921 (253107) OVEN CLEANING, domestic, commercial, complete fittings, let professional do hard dirty work. From 40€. 611 283 162 oven cleaningcostadelsol.co m (258467)
DECORATORS RAINBOW Pinturas. English, professional painters & decorators. All aspects of interior & exterior work. Also kitchen/ furniture spraying. Call / WhatsApp: Daniel 628 066 08. turas.com (279078)
DOMESTIC REPAIRS STARLIGHT CLEANING SERVICES. All types of cleaning. Any size of property. All Areas. Residential & Holiday Lets. 682 636 451 (279483) WINDOW Cleaner, professional & reliable. Affordable prices. Call Chris 603 630 049 (282247) PROFESSIONAL Carpet And Upholstery Cleaning, 27 Years Experience, Wet/Dry Clean. Honest, Reliable. 678 808 837, 952 669 701, acservs@out look.com (252581)
COMPUTERS PC DOCTOR Computer Sales & Repairs in any Language. 24HR IT Support. 20 Years on the Coast. We come to wherever YOU are – Home or Business. 952 591 071 (279023)
DOMESTIC Appliance repairs - washing machines, fridges, cookers, ovens, water heaters, gas / electric, professionally repaired. Christian 608 337 497 (279980) REPAIRS to Washing Machines-Dish WashersOvens-Fridges. Call Garry Goodman 673 344 212. English Service Technician. 35 years’ experience. (276695)
6 - 12 December 2018
ELECTRICIANS LIT ELECTRICIANS for all your Electrical work on the Costa del Sol. Call Craig on 604 106 414 or Ben 622 911 177 (278504) ELECTRICIAN Exclusively Marbella and Estepona Richard on 687 352 358 or email richi@europe.com All installations & maintenance. Surge Protection, Garden Lights, Upgrades, Boletins. MARBLE POLISHING, CRYSTALLIZING, LASTING, HIGH SHINE. REGRINDING, RESTORATION OF SALTY, DEAD FLOORS. RELIABLE. 27 YRS EXPERIENCE. REFS AVAILABLE. CYRIL. 634 455 064 (279112) MARBLE FLOORS polished high shine non-slip. Fast Service Reliable, family run business. TERRACOTTA CLEANED and sealed. No job too small. Cleansol 10am – 10pm 7 days all areas. 952 930 861 / 607 610 578 Discount code: EWN 1 CLEAN
FOR SALE/WANTED
CLEARFLOW – Unblocking, CCTV inspection, repair and installation. Tel: 630 200 600 / 952 885 661. Facebook: DesatorosClearflow (276256)
FUNERALS
GATE REPAIRS E L E C T R I C GATE/GARAGE DOOR automation repaired. Free, no obligation quotation. Call Colin - 636 394 641 (278431)
GLASS CURTAINS ALHAURIN FURNITURE Emporium. Buyers and sellers of quality furniture. We buy from a small item to full clearances. Top prices paid. 697 511 071 (253107)
GLASS CURTAIN repairs, specialist in replacement of discoloured plastic strips that act as a seal between the glass panels. Call Julian 655 825 931 (276609)
HEALTH & BEAUTY
THE WAREHOUSE – We buy a Single item to a Full House Clearance – 602 610 103 (253107)
BEAUTY TREATMENTS
FURNITURE wanted, same day collection, also house clearance and removals. 675 357 575
BOTOX AND FILLERS From €95. Covers the Costa del Sol and inland. marbella.es 609 347 086. (276478)
GARDENING PROFESSIONAL garden services from Fuengirola to Estepona. All aspects of gardening and full maintenance and landscaping, free quotes, competitive prices. Contact Andrew 600 259 981 Andrew@garden-pro fessionals.com GARDENING SERVICES and other related jobs in your garden. Ricardo 637 160 129 cardogardens.es Torremolinos to Marbella
IRRIGATION IRIS-IRRIGATION and landscapes. New Installations and problem-solving. Turf (supply and laying). Garden constructions. Tree surgeon. Clearing and maintenance. 676 747 521
GATES
DRAINAGE BLOCKED DRAINS? Leak detection, CCTV survey, root removal, Tel 952 568 414 / 661 910 772 / drain spain.com (257090)
FURNITURE
EWN 99
E L E C T R I C Gates/Garage Doors. Intercoms/access control systems and replacement remotes. New installs and repairs. For all your electric gate and garage door requirements call us on 605 356 469/952 786 178. The Garage Door Co & 2 Way Gates. tgdc@hotmail.co.uk pany.es (259432)
CHIROPRACTOR FUENGIROLA, Myofascial Release. J. Schaegen, Specialized in treating neck, back & extremity disorders, 30 years in Practice. 652 291 224 work.es (276149)
DENTISTS ENGLISH SPEAKING DENTIST in Fuengirola. Specialising in Zircon crowns, bridges etc. Free check up! drvisky@hot mail.com - 689 887 019
MASSAGE SAYAN MASSAGE. Your best traditional & tantric massage for ladies and gentlemen. 952 586 339 608 977 260 (256078)
HEATING SERVICES FIRES gas or wood burners. Envirocarespain since 1996. All areas. Quality guaranteed. 952 663 141 670 409 759 c a r e s p a i n . c o m info@envirocarespain.c om (281338)
100 EWN HOLIDAY LETS
GUALDAMINA, (near the Marbella Barcelo Hotel), 5 En Suite Bedroom Detached Villa, Air-Con, Swimming Pool, Gated Urbanisation. Fantastic Golf & Mountain Views. Fully Legal and Licensed. All year round Short Term Rentals. Ring for Availability 0044 7840 802 444 (277911)
HOT TUBS/SPAS HOT TUBS, new, used, bought, sold, hired. Also move & repairs. 691 973 131 / 952 793 398 (280596)
HOUSE CLEARANCES THE WAREHOUSE – We buy a Single item to a Full House Clearance – 602 610 103 (253107) ALHAURIN FURNITURE EMPORIUM furniture wanted, same day collection, also house clearance and removals. 675 357 575 (281330) WANTED House Clearances, single item to full house. Anything considered. Top prices paid. Cash waiting. 625 025640 (281849)
For daily news visit
INSURANCE
6 - 12 December 2018
INSURANCE) EU INSURANCE DIRECT. Best prices, best service, best cover for all your Insurance needs. TEL 951 080 118 or 952 830 843 (281380)
INTERNET GET YOUR business noticed online! Make sure that expats in Spain can find your product, service, restaurant, bar or shop. Contact Spain’s newest and brightest online directory TODAY. Call 951 386 161 or email mark.w@eu roweeklynews.com for more details
LAWYERS
LEGAL SERVICES PRIVATE INVESTIGATOR Debt Collection, evictions, solicitor. Professional & discreet. 697 834 934 (277632)
LOANS LOANS AVAILABLE on all types of paintings, jeweler, watches, silver etc. Any condition. Immediate cash settlement. For more information call into Anthony’s Antiques & Jewelers shops extensive premises at C/Ramon y Cajal 40, Fuengirola. Mobile 609 529 633. Tel: 952 588 795 (SE) (201522)
For daily news visit
LOCKSMITH LOCKSMITH emergency / appointment. Doors opened without damage, locks changed, patio doors and windows secured, 24 hour honest, fast and reliable service. Call Paul 657 466 803 (248853) ENGLISH 24/7 LOCKSMITH/SAFE ENGINEERS. EST 2004. CALL DAREN OR MICK 952 660 233 / 667 668 673 / 636 770 865 CURITYOFSPAIN.COM (278429)
MASSAGE CARIBBEAN and Asian lady, gives full body massage, clean atmosphere and very professional in san pedro near Banus. 652 069 930 (282193)
RASCAL turnabout electric wheelchair, as new, under guarantee. €900. 952 578 408 (282120)
MORTGAGES FLUENT FINANCE Abroad. Are you looking to release equity in your home here in Spain? Need to pay IBI, Community Fees, Taxes, but don’t have the cash available now to do this. Do you want to sell your property for what it is worth but don’t have the ability/time frame due to cash constraints? Do you want an alternative to the Banks who are costly and slow? Call us now on 691 179 445 / 952 961 952 or email ronald@fluentfi nanceabroad.com Come and visit us in our San Pedro office (281207)
MOSQUITO SCREENS MISCELLANEOUS WOODY´S LOS BOLICHES. Greeting Cards, mail to and from the UK. Worldwide courier and Passport renewals. All adverts taken for the Euro Weekly News- display or classified. Open 9.00-2.00PM (Monday to Friday). Special hours apply August and Xmas. One street behind the Confortel, just off Plaza San Rafael, Los Boliches, on C/Poeta Salvador Rueda 93. Tel: 952 471 877 (95705)
MOSQUITO screens, sliding, pulldown, pleated colours call Mosquito Nick 647 072 861 (281384) (T1) ACE OF SHADES - Don’t let the bugs get you! Available in enrollable, slider and pleated. Large choice of colours including wood effect. Tel: 951 273 254 / 671 732 204 / info@aceof s h a d e s . d e s i g n (101730)
For daily news visit
MOBILITY SENIORWORLD - MOBILITY scooters, wheelchairs, stairlifts, nursing beds, rise ´n´ recline chairs and a large range of daily living aids for sale or hire. Visit our showroom in Los Boliches - or call on 952 663 131 or 670 964 181 for advice & best prices. (279180) The Mobility Wizards S.L. For all your mobility needs: Repairs, Rentals, Sales and Insurance. Call: 633 127 901/ 622 832 954. (278557)
MOTORING
CLASSIFIEDS MOSQUITO SCREENS MOSQUITO Screens for windows, doors and a high-quality sliding patio door screen. All finishes available. Quick service. All areas covered. Call Julian 655 825 931 (276610)
MOTORING. (277164) BRITISH MECHANIC Mijas Costa. Experienced & Reliable. 605 407 369
FOR SALE SELLING YOUR SPANISH CAR? PHONE Bill Brady for the best cash price. Stay safe and phone Bill on 952 838 842 / 608 950 221 billbradycars.com
CLASSIFIEDS FOR SALE MASSIVE SAVINGS ATbrady cars.com (257838) AUTOMATIC / Diesel Seven seater Chrysler Voyager LX 2.8 CRDI 2006 Mdl. 46,000 Km (28,000 Mls) Full Specification, electric side doors, climate control, leather interior, lots more a very scarce MPV. For only €7,995 952 838 842 / 608 950 221 billbrady cars.com AUTOMATIC / Diesel Hyundai I-40 2012 Like new one private owner full service history and lots of extras looks and drives like cars double the price. Only €13,995 952 838 842 /608 950 221 billbrady cars.com (257838) AUTOMATIC Seven seater Peugeot 5008 Sport Line 1.6 Inj. 2011 One private owner 43’000 Klm. ( 27’000 Mls ) Full service history, panoramic sun roof, sat-nav, sensors and lots more great buy at only 12’995€ 952 838 842 / 608 950 221 billbradycars.com JAGUAR XE. R-Sport 2.0. D. 2016 Automatic 6’000 Klm. (3’700 Mls) Health forces this sale bought from Salamanca Marbella keys still in plastic bags, this car cost 45’000 € LOOK at this massive saving ONLY 27’995€ 952 838 842 608 950 221 billbrady cars.com AUTOMATIC Citroen C-1 2009 5 Door One private owner only 69,000 Km (43,000 Mls) looks great in sunburst red, small automatics are very scarce its only €4,995 952 838 842 /608 950 221 billbrady cars.com.
For daily news visit DIESEL Renault Clio 1.5 DCI 3 Door hatch back 2009 from private owner metallic black, parking sensors, privy glass looks nice and sporty with great economy, its only €4,995 952 838 842 /608 950 221 billbradycars.com AS NEW (Special Order) Automatic / Diesel Seat Alhambra Seven seats. Nov 2016 Only 8,000 Klm. (5’000 Mls) Touch electric side doors, Apple touch and sat-nav, sensors all round front back sides etc. Climate control, cruise control, parking cámera privy glass, lots more to many to list here, a perfect family M.P.V. Save a fortune on a top quality family car remember this is not ex-rent or lease cost 35,000 € Was selling for 27,995€ NOW ITS ONLY 26,995€ 952 838 842 608 950 221 bill bradycars.com GREAT buy Toyota Aygo 1.0 Live 2010 one private owner only 34’000 Klm (21’000 Mls) S/History airconditioning looks great in sunburst red look at this low price only 3,995€ 952 838 842 / 608 950 221 bill bradycars.com PEUGEOT 208 Blue HDI 1.6 5 Door 2015 bought and full service history from Peugeot one private owner sat-nav, reverse camera, cruise control, lots of extras and its only 8,995€ 952 838 842 608 950 221 billbradycars.com 2007 TRANSIT CONNECT in good all round condition. Electric Windows, Air Con. One local owner. €2,995 Tel: 695 559 939 (254317) 2011 FIAT DOBLO 1.3 CDTi DIESEL. Very economical. Only 135,000klm. In very good condition throughout. One local owner. €4,995. Tel: 695 559 939 (254317) 1998 MERCEDES C240 ELEGANCE This car must be seen, only 160,000klm with service history. Metallic blue with cream leather trim. Lots of extras. Drives perfectly. First to call will buy €2,995. Tel: 695 559 939 2007 FORD FOCUS Diesel Estate. Only 160Km. In very good condition all round. Alloys, Air con, New ITV, Service history. €3,995. Tel: 695 559 939.
VAN 2010 Dacia Logan Renault 1.5 DCI Diesel only 130,000 KLM, Twin side doors full roof rack new ITV Air Con €3,450. Tel: 695 559 939 (254317) 2002 MITSUBISHI Shogun Longwheel Base 2.5 Diesel, 7 seater Top Model super exeed air con, in very good condition throughout €3,750. Tel: 695 559 939 (254317) 2007 SEATCordoba 1.9 TDI Brand new Tyers and new ITV, Alloys, air con, very good condition throughout excellent Driver €3,450. Tel: 695 559 939 CONVERTIBLE 2007 Opel Astra Alloy Air Con 1.9 CDTI 6 Speed Diesel, excellent condition throughout, new Itv, very economical €5,995. Tel: 695 559 939 (254317) 2006 SAAB 93 convertable RHD on English, new MOT and Tax, really nice car, low mileage, 6 speed, leather trim €2,995. Tel: 695 559 939 (254317) BIG VAN 2009 Renault Master 120 DCI 6 speed LHD on English plates long wheel base High Roof with light weight tail gate only 120,00 KLM Air con New MOT and TAX €6,750. Tel: 695 559 939 (254317) AUTOMATIC 2007 Fiat Grand Punto Diesel Automatic, new ITV 140,000 KLM, 5 Door in very good condition throughout, climate Alloys, new tyres €3,450. Tel: 695 559 939 (254317) CLASSIC MERCEDES 190 E 2.0 Petrol, rare 4 speed manual 1991, Spanish car, in very good condition throughout. These cars are increasing in Value, only €2,995. Tel: 695 559 939 (254317) MINI BUS MERCEDES VITO. Year 2011. 313 CDi automatic. Right hand drive on Spanish plates. 120,000 miles. New ITV. Very good condition throughout. 9-seater. €9,750. Tel: 695 559 939 (254317) 2011 Focus Trend 1.6tdi 209kms €5,500. 2010 Fiesta Trend 1.4tdi 129kms €4,200. 2011 Punto Evo 1.2 79kms €4,200. More available call 677 079 805
6 - 12 December 2018 2010 Punto Dynamic 1.3 diesel 114k €3,400. 2013 Punto Easy 1.3 diesel 71k €4,300. 2014 Fiesta Trend 1.2 petrol 99k €5,600. All excellent condition. All prices plus IVA 677 079 805 (278447) VAN LUTON Fiat Ducato, LWB with taillift 2013, AirCon, 6 Speed Box, UK RHD, 2 Keys. Just arrived from UK €5,000 Tel: 0044 7403 200234 / 611 386 014 (282197) MERCEDES E250 CDI AMG Sport Automatic Convertible. Azure Blue. Cream leather seating. 33,000miles. Service History. Just services. Spanish plates, RHD. Immaculate condition. €22,500. Tel: 650 679 123 / 952 838 167 (282125) FORD Fiesta, 2013, 1.0L Ecoboost, Red, 39,000kms, ITV 2020. 1 lady owner. FSH. Excellent condition. €7,250. 632 633 406 (282192) OPEL Zafira, 2010, 7 Seater, 92,000kms, 2yrs ITV, 1.7 Petrol, Manual, 1 Owner, VGC. €7,995 ONO. 678 643 941 (282246)
EU INSURANCE DIRECT. Best prices, best service, best cover for all your Insurance needs. TEL 951 080 118 or 952 830 843 (277294)
MECHANICS MOBILE MECHANIC will come to your home or work. Servicing, repairs, ITVs & diagnostics. Call Mick on 617 553 072 BRITISH MECHANIC Mijas Costa. Experienced & Reliable. 605 407 369
REPAIRS ENGLISH bodyshop, fully equipped, Mijas Costa. No Job Too Small. 952 667 074 (279183) BRITISH MECHANIC Mijas Costa. Experienced & Reliable. 605 407 369 (259167)
EWN 101
WANTED, wanted, wanted!! All cars, all years, all models…from exotic to classic. Spanish, English, Dutch plated. Call us on 951 977 329 or 606 647 597. (281326)
MUSIC LIVE MUSIC with DAVID CHRISTIAN-CLARK specialising in Spanish Guitar for Weddings & Events, Gib to Nerja. Call 00 350 540 367 29. E-mail: davechris tianclark@gmail.com. Search on YouTube & Google + for video-demos etc. (277271)
NAUTICAL
NAUTICAL - COURSES INTERNATIONAL SKIPPER LICENCE: Courses held in English and starts soon. RYA VHF and Radar Courses. 636 444 929 (279482)
PEST CONTROL
WANTED
SEAT Leon 1.9 Stylance Ecomotive, 2008. Very economical Diesel Car. Serviced yearly. Current ITV. Must be seen. €4,795 ONO. 626 426 642 (282198)
INSURANCE) LSM INSURANCE. No fat singing blokes or trumpeting telephones, just professional service at the best prices for all your insurance needs including car, household, commercial, life, health and travel. Tel 952 578 008 or iz for a quotation (278681)
CARS, VANS, ANY REGISTRATION, INSTANT CASH, FINANCE/EMBARGO UK OR SPANISH 685 524 921 CARS, VANS UK OR SPANISH BOUGHT FOR CASH. FREE COLLECTION IN SPAIN/UK. PLEASE CALL 678 808 837 OR 952 669 701 (253107) WANTED CARS AND VANS, FREE COLLECTION, SAME DAY 685 524 921. (253107) CAR, VANS BOUGHT WITH/WITHOUT PAPERS. CASH WAITING 678 808 837. (253107) WANTED all cars, vans and anything interesting also classic cars, bikes, etc., with or without paperwork considered, same day decision, cash waiting, 653 777 073. (2543 (277244)
102 EWN
6 - 12 December 2018
PETS YOUNG DOMESTICATED cats rescued from the killing station need kind homes. Fully vaccinated and neutered. We will also deliver to England for a donation to the charity. Please give one of these beautiful cats a home so we can save more from death. Can be seen without obligation at Cat and Dog World Kennels. Tel. 630 197 435 (246764) LOW COST NEUTERING 630 197 435 (Eng) / 644 374 139 (Spanish) (279084)
CHARITIES ACE CHARITY “El Refugio” in La Cala de Mijas is a registered charity. We have on average 275 dogs in our care and we receive no help from the Town Hall or the Andalucian government. We desperately need foster homes and adoptants for our many dogs, especially the small ones and puppies who do not do well in a big shelter. We are grateful for any help offered, including donations of food and blankets. Visiting times are from 13.00 to 15.00 and you can always turn up or make an appointment by calling Denise on 669 018 736. Our website is where you can view all the dogs in our care. (93320) 952 113 467, available from 10.00am until 14.00pm. (93319) SEPE the horse and donkey charity is open to the public at weekends05 227 155. If you would like to know more about rehoming, please call 653 257 875. Visit our website or please phone Sandy on 952 385 923 or 666 814 056 if you would like to make a donation or help in any way. (93317) ARCH - Andalusian Rescue Centre for Horses welcomes visitors and volunteers to our stables every day from 9-11am. Come along and help out, or sponsor or adopt one of our horses, donkeys or ponies. We always need help with fund raising to look after the abandoned and abused animals. Our aim is to rescue, rehabilitate and re-home.alusia No 8448. rescuespain.org or info @horserescuespain.org or archrescue@yahoo.co.uk Tel 656 935 613 or 659 408 664 Our Charity shop is located in Calle Melen-
dez Pelayo, just off Calle Gerald Brenan, Alhaurin el Grande. Tel: Liz 600 651 007. We always need volunteers and stock for the shop. We can also arrange collection. (93322)
PLUMBING
MALAGA EXPAT CONSULTING - Paperwork Assistance, (NIE, Residencia, Driving Licence Renewal, Car Transfer, Doctor Registrations, Translation, Property Rental License and more), Relocation Advice. Outstanding service at competitive rates. Call Irina Saltmarsh 687 733 743
KENNELS CAT & DOG World Kennels and Cattery. 952 112 978 / 630 197 435. (279084) EURODOG Boarding Kennels & Cattery. Under new ownership by animal loving family. Large kennels and exercise yards, fully licensed and sanitary approved. Safe, secure and caring environment. Inspections welcome anytime. 5 minutes from Fuengirola 679 786 669 / 952 464 947 / (242538) PETCARE PET HOTEL. Alhaurin el Grande. Holiday accommodation for dogs and cats. Heated/Air-conditioned kennels available. Tel: 952 112 284 / 685 400 216 pain.com. Find us on Facebook at Petcare Spain. (278403) LAGUNA KENNELS AND CATTERY. Your pets lovingly cared for by English mother and daughter. Near Coin. lagunaken nels@hotmail.com. Tel 952 112 021 / 606 838 983. (280597) Excellent Kennel & Cattery facilities Est. 1986 Viewing most Welcome 952 790 943 (282111)
PET TRANSPORT ACCOMPANY your pets to their new home. Fully licensed pet transport service. Denise ffeur.eu 952 197 187 / 696 233 848 info@petchauf feur.eu (276821) PET TRANSPORTATION by road. Fully DEFRA/OCA/TRACES compliant. Complete service by professional licensed kennels. 630 197 435 (241623)
PROFESSIONAL SERVICES
PROPERTY FOR SALE W W W . I N M O A N DALUZ.COM is always looking for realistically priced inland properties to sell to our interested buyers. Tel 952 491 609 / 685 514 835
PLUMBING & repairs/descales, water heaters supplied and fitted same day. Will travel as Benalmadena based. NO job to small. Call Glen 669 073 773. (281331)
W W W . I N M O A N DALUZ.COM. Bargain inland properties for all budgets, fincas, village homes, apartments and villas. Legal building plots. 952 491 609 / 685 514 835 (258053)
PLUMBING. Leak detection & blocked drains. Tel 952 568 414 / 661 910 772 / drainspain.com (257090)
LOS BOLICHES 3 Bedroom, 2 Bathroom Apartment, 98m2, close to beach, shops & amenities. €189,500. 627 011 848
E M E R G E N C Y PLUMBER 24/7 Rapid Response. Blocked drains Water leaks. All urgent plumbing works. Covering all the Costa & Inland. 603 109 212 (281382)
PRINTERS
PROPERTY MAINTENANCE STARLIGHT PROPERTY. All Areas. Residential & Holiday Lets. 689 819 592
PROPERTY MANAGEMENT
BUSINESS cards, flyers, posters, magazines, design, canvas, exhibition equipment, signage, vehicle branding Eyeprint: 951 310 395 print.es with offices all along the coast (259024) C R E A T I V E MARBELLA Your friendly local printers. Luxury Printing, Copying, Binding, Branded Merchandise and Clothing, Menus, Bespoke Gifts, Wedding Accessories. Located in Poligono Industrial Nueva Campana 27 - 952 810 831 marbella.es or follow us on Facebook (278561)
For daily news visit
CLASSIFIEDS PROPERTY TO LET
LONG TERM RENTALS AVAILABLE and also wanted. Super prices, no commission. Apartments, townhouses, villas, fincas, shops, offices, bars, restaurants. Coast & inland. Tlf 679 111 522 BENALMADENA charming sunny 1 bedroom apartment, fully furnished, 2 pools, parking. Long Term €580pm. Close to amenities. 607 019 444 or e-mail lynntrans56@ya hoo.com (282191)
PROPERTY WANTED SELLING UP?? Why not give us a call and let us give you an honest and realistic valuation of your property. List with us and let us take the stress out of selling your home. No sale, no fee!! English agent on the ball with clients waiting. Please call 685 524 921. (253107) WE HAVE clients actively looking for villas, townhouses & apartments from Torremolinos to Calahonda. Call Joe 626 864 683 (276690)
REMOVAL/STORAGE
MAR MANAGEMENT Join our Property Management Services. Holiday Rentals. Commitment and References. ment.es 622 580 866 (278479)
PROPERTY TO LET MARBELLA, BANUS, Luxury 2 & 3 bedroom apartment by Marina. Private garden. Pools, Garage. Long-Term let. Visit om reference ‘Garden’ bravoelezovic@gmail.com / 637 439 222 (281841)
CLASSIFIEDS REMOVAL/STORAGE
NATIONAL / INTERNATIONAL 15 CUBIC metre van returning to the UK 20th December. Space available each way. Tel. 639 928 090 (258054) EUROPE SPECIALIST. Combitrans Movers. 952 775 300 trans.es (277262) USA SPECIALIST Combitrans Movers. 952 775 300 (277262) STORAGE SPECIALIST. Combitrans Movers. 952 775 300 trans.es (277262) LOCAL and INTERNATIONAL SPECIALIST. Combitrans Movers. 952 775 300 (277262)@yahoo.co.u k (276485) MOVING MATTERS SL – removals and storage. Local or to and from the UK/Ireland/Portugal and across Europe. Over 16 years’ experience. For free quotation Tel 951 311 118. LOCAL & International Removals Regular Schedules 952 816 582 move@frein ternational.com (257824) HIGH TOP VAN going from Spain to UK and return. Reliable Service. Call Graham 620 353 594 for details. E-Mail vgcasacolor @gmail.com
For daily news visit
SITUATIONS VACANT
ANDALUCIA International Removals & Storage. Contact 658 568 589. See our Main Advert in Services Pages (278573)
6 - 12 December 2018 JDS EURO TRANSPORT & REMOVALS - Regular trips throughout Europe. Contact Julian 00 44 7884 908 929/00 34 637 066 114 See Facebook Page for recommendations (276418)
MAN AND VAN MAN & LARGE VAN, 100% reliable, Removals, Clearances. Ikea collection & assembly. 20€ per hour. Tel: 622 020 856 (246758)
SERVICES
CARPENTRY CARPENTER cabinet maker, Irish. Property maintenance, plumbing, painting, electrical, kitchens. Bathrooms renovated etc. 30 years’ experience. Very reliable. 677 087 575
FURNITURE
HANDYMAN & VAN – Small removals, clearances. Ikea collection & assembly. Experienced & Reliable. €20 hourly – 603 257 612 (281246)
FRENCH POLISHING REPAIRS, restoration etc. restore your valuable furniture to its former glory. Tel 647 579 519 / 952 499 944
MOVEIT-STOREIT.COM Tel David 696 810 618
SEWING SERVICES
BIG VAN (Removals) UKEurope. Always on time. 100% reliable €25 PH 633 277 270 (279080) 2 MEN, Van €30 p hour. House Clearances & Storage. 651 081 610 (276419)
STORAGE STORAGE Marbella Dry Secure 952 816 582 move@freinternation al.com (257824) STORAGE lowest price guaranteed. Packaging materials Self-Storage Marbella 952 811 311 (278691) moveit-storeit.com Tel David 696 810 618 (259433)
ROLLER/SHUTTERS ACE OF SHADES - PERSIANA (security shutter) electric and manual, various colours available including wood effect, we also offer a repair service. Make your home more secure! Tel: 951 273 254 / 671 732 204 / in fo@aceofshades.design (101730) ROLLER shutter repairs, 7 days a week, conversion from manual to motorised, new installations. All areas covered. Coast and inland. 655 825 931 (280561)
CURTAINS, Blinds, Upholstery, Soft furnishings made to measure, wide range fabrics and foam 672 800 887 judein spain@hotmail.com
SITUATIONS VACANT
EWN 103
SIGNS & DESIGNS EYEPRINT – 951 310 395 (259024) SHOP signs, vehicle signs, banners, window signs, 603 464 582, sign.es (257068)
SITUATIONS VACANT
104 EWN
6 - 12 December 2018
SITUATIONS VACANT
PART-TIME ADMIN office person required for general office duties. Must speak English & Spanish, be based in San Pedro area. Experience preferred. Contact 952 781 939 (281892) MALE ACTORS (Native English speaking) for spectacular musical playing May 2019, confirmed venue. 657 979 799, around80@yahoo.com facebook:musical80 You’ll love the experience! (282190)
SOFT FURNISHING
EARN 75€-400€ weekly, flexible hours from home working with a leading Swedish health & beauty brand. No selling required or experience needed as full training given. Apply now at (277919) YOUR FUTURE STARTS TODAY! We are looking for enthusiastic business partners. Flexible hours, full training and on-going support. Fantastic earning potential. If you’re looking for a better work/life balance call today Phil Cony 643 781 651
TV & SATELLITE
CURTAINS, blinds, cushions and much more. Free estimates and home visits. Tel 657 369 343 or rosan nacarmella@hotmail.com (257839)
SOLAR
TAROT
SOLAR BLINDS ES Ideal For Large Glazed Areas To Reflect Heat / Glare And Stop Furniture Fading And Still Keep The View. Save Heat In The Winter Too Improve Your Living Environment. ian@solarshadet inting.com Tel Ian 958 496 571 / 644 546 176 (258409)
SPORT GOLF SHARE Las Brisas €18000. Offers 617 333 777
SWIMMING POOLS
EXPERIENCED Medium and Spiritual Healer. Tarot readings and individual healing sessions, in person or at distance. Call or text Amanda 686 617 621 (282126) GRAND Powerful African Spiritualist. I solve most difficult problems, I specialise in Love issues, keeping your love by you, getting back your old love, sexual impotence 664 745 587 (282136)
SOLAR Solar Hot Water Systems. Quality Guaranteed. All Areas, Envirocarespain since 1996. 952 663 141 670 409 759. pain.com info@enviro c a r e s p a i n . c o m (281338)
TAROT READING African Spiritualist. Voodoo. Black and White Magic. LOVE ISSUES? Bring Back Your Love? Business and Economy Problems? Family Matters? Sales? Sport? Protect From Evil? Feel Like You Cannot Go On? Etc. Mr Syla has a rapid solution within 24h result – Tel. 663 483 489 (278787)
TEACHING POOL MAINTENANCE, repairs, friendly, reliable service. Estepona, Malaga, inland re-grouts, heaters. 678 791 495 / 951 295 699 (257044) M aintenance, Repairs & Renovations. Also, the very latest technology in pool heaters, covers & rollers. info@perfectpools.es. 650 348 785 (257069) WESTARPOOLS. Pool construction, renovation, repairs and heating. 619 246 372 / pools.com (277920)
ADVANCED Cleaning Services. Professional carpet and upholstery cleaning, 28 years’ experience, wet/dry clean. Honest, reliable. 678 808 837 / 952 669 701 ac servs@outlook.com (253107) UPHOLSTERY including leather cleaned also carpets. 685 524 921 (253107) CARPETS AND SOFAS cleaned. Reliable, fast service. Family run. Cleansol 952 930 861 / 607 610 578. 10am 10pm 7 days, all areas Discount Code: EWN 1 CLEAN (206437) RUGS FITTED CARPETS, Upholstery Including Leather Cleaned On Site 685 524 921 (252581)
WASHING MACHINES WASHING Machine Repairs by qualified Engineers.For a rapid response call Melec Costa 952 493 426/627 120 352 (281317)
WINDOWS
TV & SATELLITE REPAIRS – TV’s, Plasmas, LCD’s, Digi – Boxes, Video, Hi-Fi and microwaves. Free estimates, can collect. 35 years’ experience. John 952 491 723 or 600 706 201 (281211)
TRANSLATOR
POOL HEATERS, covers and rollers. Quality inatallations. Free quotations. All areas covered. Over 20 years’ experience. EnviroCare. 952 663 141/670 409 759 om (281338) JUSTPOOLS.ES 8x4m pool 90€ inc. 10x5m pool 100€ inc. Re-grout 8x4 500€ inc Full liability insurance. 952 472 476 / 619 636 586 (258615)
UPHOLSTERY
P.P.S – PVC Door & Windows. Persianas & Glass Curtains. All supplied & fitted. Good Quality, Reliable & Reasonable rates. Damp Proofing also carried out 631 571 108 (281212)
WINDOW TINTING
OFFICIAL TRANSLATIONS. All languages. 952 789 204. Mobile 654 613 094. sanpedrotransla tions@gmail.com (279016)
For daily news visit
MOBILE SERVICE. ITV Legal. Solar Reflective tint for glass curtains, balconies, yachts. Stop fading, heat & glare. 958 496 571 – 644 546 176 ian@solarshadetinting.com (256591)
CLASSIFIEDS XXX RELAXATION Please note that in Spain there is NO legislation banning adverts in this section. Neither regional nor national governments are able to pass such a law due to rules governing freedom of publication and printing.. (257837) T1 RIVIERA. Beautiful long dark hair, elegant and discreet and vicious. I enjoy sex with no limits. Call me. I can´t wait to give you pleasure and an unforgettable moment. I speak English. Available 24hrs. VISA – T. 616 368 985 (276235) CALAHONDA. Debora, Brazilian mulato with gorgeous body. Tall, long dark hair, big bottom. Vicious lover, kisses. I am the only one who will fulfill your fantasies. Come on, ask me for that you have dream about. From 50€ - T. 648 814 653 (280449) CRISTAL, Good Sex, nymphomaniac, hot and multi-orgasmic. I am a real volcano and a very pretty and gentle lady. Kisses, gold rain, greek, couples, lesbic. Incalls and outcalls. 24hrs. VISA – T. 608 949 543 (280449) NEAR ELVIRIA. Laura, sweet and passionate, Brazil, blonde, sleep, good looking, hot. I am Professional masseuse but also a great lover and very pervert. I enjoy games and erotic massages. Look at my profile girls.es and you are going to fall in love. 24hrs. Visa 650 237 102 (280449)
CLASSIFIEDS NUEVA ANDALUCIA: Very sexy, slim, horny and submissive girl offers you a special experience with maximum pleasure. All services, including sensual massages (qualified independent masseuse) with natural French and happy ending. Private apartment. 656 350 401 CALAHONDA. I am Noemi, a Young lady with White skin and Brown eyes, slim and elegant, I will give you moments of passion you will never forget. Don’t doubt and come to see me. I can be your secretary, your nurse, your pervert lover. Natural French till the end, greek, lesbic, couples. You Choose. T 648 814 653 (280449) SADO. Dungeon fully equipped. Professional services and equipment. Pain is pleasure. Whip, Handcuffs, Bandages, Ropes. Call now and Book appointment. T. 608 949 543. INCALLS and OUTCALLS. Luxury premises. High standing. Beautiful ladies, Lovers, Very Sexy, 24hrs, Striptease, Lesbic, Greek, Gang Bang, Porn films, Toys. VISA 951274723, 648 814 653 (280449) CUBAN, 29 years, simply a delicious brunette, very happy and pleasant. Will not regret it. Hard to find something better. When do you want to meet? Natural French, kisses. 24 h 616 368 985 (280449) RIVIERA, Karina, lovely Young lady with exquisite body that will awaken your wishes. Expert lover, liberal and passionate. You will love my kisses and my massages will simply lead you to pleasure and guarantee you will repeat. Unforgettable. 24h 650 237 102 (276235) BENALMADENA - LAURA 28, slim brunette. Sexy model. Warm and friendly. Fluent English. Incalls & outcalls. 633 744 422 (258645) FUENGIROLA. Oriental young, beautiful & sexy Japaneses girls. Complete services. Pleasure always guaranteed. Discretion Assured. Outcalls. 24hrs 693 988 340 (Whatsapp) MATURE elegant lady. Voluptuous bust. All services. Only hotel and home visits. 687 387 680 (257096) LAURA. 24, busty, slim, juicy French. All services. Nueva Andalucia. 697 219 468
SLIM horny naughty tantra massage. Marbella 603 228 081 LETICIA: Fuengirola (Perla 6). 30, Beautiful young, sexy Brazilian, kisses, erotic massages. Hot sex! French without. 697 883 690 (246734)
RIVIERA. Sofia, Spanish good looking and very hot. A lady with class who will make you enjoy to the most. I have many erotic toys which we can enjoy to the maximum. I am sweet and love giving you love, kiss all your body and my wet tongue wherever you like. T. 608 949 543 (280449)
ENGLISH Elegant, attractive and sexy lady gives a very sensual girlfriend experience. First timers and golfers especially welcome. Discretion assured. Call 680 177 569
COMPLIANT GENUINE COUPLE (willing wife and knowing husband) offer an incredibly sexual and unique experience to ladies, couples, and gentlemen. Indulge your fantasy, be a voyeur, or simply enjoy very special pleasures with us. Private apartment in Nueva Andalucia or out calls 685 189 518
BOLICHES: Celina kind beautiful lady only discreet gentlemen! Receive in airconditioned private comfortable apartment, prepared especially for your pleasure. Enjoy cosy, quiet atmosphere. Excellent treatment without complications. Massages + full sex, anal from 40€. Appointments 11am-7pm. Sunday off. 622 210 797
LORA. Horny girl, 24, large breast, French, 69. Massages. All services. Locrimar, Nueva Andalucia 673 251 634
RAQUEL. Young Brazilian brunette, sexy. Paseo Maritimo Fuengirola 626 039 574
FUENGIROLA: Carolina. Bombom. Big Boobs. Great Body. 9am to 9pm. 634 703 111 BOLICHES. CAROLINA.BIG BREAST. PERFECT BODY.9am 9pm. 634 703 111 DISCRETION Privacy. Fuengirola – Los Boliches. Beautiful Lady Perfect Body 35yrs. Big Breast. Call 9am till 9pm – 617 818 615 (279319) lady Calahonda. Beautiful Spanish model, 28.Discretion. 685 624 324 (256257) NEW!! Just arrived from Russia to study in Marbella. 19 years. A volcano under the sheets. Call 655 607 102 (278083) BOLICHES: Beautiful seductive mature lady, voluptous, sexy. Ludi 612 459 241.
DUQUESA. Sensual blonde. In/outcalls. Discretion. Guaranteed pleasure. 602 617 318
FUENGIROLA. Nice couple available for guys, ladies and couples. Private apartment. Incall/Outcall. 631 146 803 ORIENTAL european, beautiful, multiorgasmic, horny, complete luxury, near Banus 618 448 131 ORIENTAL slim sexy beautiful naughty hot massage. MARBELLA 660 898 501 ENGLISH independent, sophisticated & pretty lady in her 40’s, gives gentlemen a sensual time in her discreet apartment. Lunch/Dinner optional. Please call 680 177 569 m Dungeon-studio. Massage. Fantasies. Squirting. Role play. All services. 662 913 428 COLOMBIAN 35 years, 150 breast, tall. Complete services. In/Outcalls. 631 103 648 TORREQUEBRADA (Near Flatotel) New private villa: 3 girls. Complete services. Guaranteed pleasure. 24hrs. 602 887 532
6 - 12 December 2018 EXPLOSIVE Cubana 130 breast, 19yrs, luscious, sexy. Greek. In/Outcalls. Torrequebrada. 631 395 554 TORREQUEBRADA: Latina 26 years, nymphomaniac. Natural French. Hot sex! Discretion. 632 413 858 ESTEPONA 2 girls, luscious. No limits. Outcalls 24h. Visa. 680 966 710 YASMIN: Mature 52yrs, busty, guaranteed pleasure. Boliches. 612 459 241 LATIN asian beautiful slim, hot, horny, luxury, hotel, home, visit. Marbella 679 126 231 VALERIA. Blonde Mature Portuguese, Big Breast, deep anal, erotic massages, sensitive, prostatic, Black kiss, full Service. Appointments only by whatsapp 643 591 319. Nueva Andalucia, Los Naranjos, Private & Discreet FUENGIROLA Spectacular Playboy girl, 35ys, light tanned skin, perfect body, voluptuous breasts, tall. 698 646 685 BENALMADENA. Fantastic hands, mature, seductive breast, curves. All services. Discreet. 632 368 555 46 YEAR old blonde, natural French. No limits. Secluded facilities. Call 663 265 150 FUENGIROLA PASEO MARITIMO 61. Spanish. Private. Natural French, Black Kiss, Fetish, Squirting, Rain, French Kiss. Loving. Massages. Appointments. Whatsapp 658 145 296 (282199) CANCELADA/San Pedro, Lola Mature, Charming for discreet gentlement. Erotic massage with happy ending. All services. 604 109 768 46 YEAR old brunette, slender, natural French, Greek, toys, squirting, no limits, dungeon. Secluded facilties. Call 662 913 428. Check me out at: lynch1.com
ESTEPONA/ Guadalmina. Sandra, Brazilian, very horny All services. 24 hours. 604 109 768
EWN 105
MARBELLA Carmen, Mature, all services. Avenida Arias Maldonado Edf Iberest 1, Apartment 3 G 602 475 138 (282200)
MULTIORGASMIC Danish sexpot enables you to fullfill all your fantasies Benajarafe. Xena 698 874 944
FUENGIROLA new cute Latina, hot, slim, horny, kisses, massage on a bed. 603 171 298 (282249)
EXPLOSIVE, sexy lady, 30yrs. Charming, pleasing €40. Outcalls. Fuengirola 625 912 315
MARBELLA Mother and Daughter, playful, horny, funny, kisses, massages 672 159 565 (282249)
CASSIE. Mature English Lady. Discreet and clean. Fuengirola. 667 914 732 951 219 946
MARBELLA House madame. Pretty girls, Greek duplex, golden shower massage on a bed 630 373 719 (282249)
NEW FUENGIROLA. Saray mulata, stunning model body!! 602 394 930 MARBELLA: Beautiful blonde, natural tits, superbody, lingerie, sexual toys, 69, french watersports, relaxing massage. Discreet apartment. Visits. 645 898 573 Juliana
LOS BOLICHES beautiful Brasilian, 43, sexy, exotic and enjoy sex. 604 340 856 (282248)
SHEMALE
BETWEEN San Pedro & Estepona. Unforgettable experience for nice gentleman with Polish lady. 617 700 999 (281876)
TRANSEXUAL Sophia, beautiful brunette, active/passive, great bust, well hung. 662 045 252. abiagg Fuengirola (246734)
MATURE ELEGANT LADY. Voluptuous Bust. All Services. Only Hotel And Home Visits. 687 387 680 (259505)
ESTEPONA. Beautiful transvestite, luscious, milky. Outcalls 24 hours. Visa 660 874 904
CALAHONDA BEACH Monika sophisticated mature petite lady, offers a discreet and relaxing time, no rush 658 039 189 (281254)
TRANSVESTITE Violeta, young (+18) endowed, horny, milky, 140 bust, very feminine. 24h. 660 867 374 Fuengirola
ESTEPONA Vicky Spanish young elegant sexy Body massage Fantasies Full services 656571749 FUENGIROLA: Irina beautiful blonde. Qualified masseuse. Massage and all services. Whatsapp 615 673 668 - 674 819 249 BOLICHES. Perla spectacular mature blonde. All services. Outcalls. 611 370 608 FUENGIROLA. Carolina, blonde, elegant, relaxing massage, full erotic massage. Whatsapp. Message: 634 797 230 ESTEPONA Claudia mature, 150 breast, superluscious. No limits. Appointments. 619 834 169
BENALMADENA: Trans Emily, mulata, big cock, big tits. Party girl. 695 973 362 TORREMOLINOS New Transvestite Carla Schwingel, blonde, superbusty, complete, endowed. 24hrs. 674 838 075
MALE ATTRACTIVE BOY, Super Endowed. Perfect lover, that will make you enjoy sex. 603 202 758 (281836) BOY FOR GOOD TIME and horny fantasies 643 101 739 (281836)
For daily news visit
106 EWN
6 - 12 December 2018
FUENGIROLA – Male to male full body massage. Very discreet, private villa. 634 004 512 (281329) SUBMISSIVE gentleman wltm an imaginative mildly sadistic gay male with a penchant for very comprehensive outre fun your private venue no fees either way outrefun1@ yahoo.co.uk (282108)
MASSAGE PURE ECSTACY in Nueva Andalucia with young pretty independent masseuse. Erotic body, tantric and other completely relaxing massages in private apartment 656 350 401 PAOLA. Keep your mind relaxed and your body satisfied. Erotic-Tantra Massage. relaxingtouch.es 602 448 534 (279019) SHAVING secret zone by experienced mature Japanese masseuse. 20 Euros. Fuengirola. 610 396 186 THAI & TANTRIC MASSAGE – MARBELLA PORT – 683 644 557 FUENGIROLA: Visit glamorous Sasha & Sophia 22/29, for enchanting Tantric massage with delightful finale. Secluded luxury villa, music, drinks. Special offer: €50 1/2h – €90€hour. 602 570 272 (282196) MARBELLA Centre. Andrea. Pretty, sexy... Erotic masseuse. Nuru, body2body, happy ending tantra. Total luscious. 697 232 876 (246734) MARBELLA centre. New. Luxury center with wide selection of expert masseuse... Sensual, erotic. Unique experience 4 hands, pleasant and exciting, double stimulation. Massage for couples. Open: 9:00am/ 9:00pm. Appointment: 690 046 233 (246734) VICKY Special erotic massage hard to forget Vicky’s hands on extras always remember where to cum again Benalmadena Tel: 633 693 334 (278563)
BENALMADENA Costa windmill roundabout. Body massage and any fantasies! Happy ending. 658 336 295 40 EUROS. Erotic, prostatic body2body massage. Happy ending by beautiful lady. Fuengirola. 645 131 273 PHILIPINA professional relaxing massage near Banus 634 123 519 Philipina, Thai, expert traditional professional oriental massages, relieve pain stress, exotic tantra, luxury private. Marbella 604 143 788 CALAHONDA BEACH Monika sophisticated mature petite lady, offers a discreet relaxing time, no rush 645 617 779 TWO asian slim spanish professional massage, naughty erotic tantra, body massage, hotel, home, visit. Marbella 604 143 788
For daily news visit
LUXURY discreet apartment Ukrainian blond, elegant lady, near San Pedro, full service 615 036 096 THAI/Spanish Selina, beautiful girl, passionate kisses. Sensual massages. Amore complete. Fluent English Torrequebrada. Whatsapp 603 318 101 VERY SENSUAL and Erotic Massages for men, women and couples. Discreet and Elegance in Costa del Sol. 649 809 695 BENALMADENA Costa by Windmill roundabout by Sabrina from NY City. 7am to 7pm. A total nude body massage. 50% discount for senior citizens. 658 336 295
MARY sexy. Massage for discreet gentleman. Full sex, oral without. 40 Euros. 697 441 387 Church Square Fuengirola (246734) THAI woman, sexy. Excellent professional massage, complete. Visits. Torrequebrada, Benalmadena 631 842 307 Whatsapp MASSAGE and fun! Genuine trained exotic male Tantric masseur. 645 291 083
VARIOUS, the number one website to meet like-minded singles/couples for fun and friendship (276183)
VIAGRA (Kamagra) 100mg, Cialis (Tadalafil) 20 mg, Jellies 100 mg. Wholesale & retail. Free delivery all areas. For the best products & service. 617 740 250 Debbie. 24 hrs VIAGRA/Kamagra/Ciali s/Weight loss pills the best prices in Spain! BUY ONE GET ONE FREE on certain items. Order securely & discreetly online: Postal Nationwide d e l i v e r y sales@costapills.net 279028 Male/Female viagra, cialis, kamagra jelly all areas. Delivery available 604 385 476. via gra4you19@gmail.com
CLASSIFIEDS FIT person, 70, looking for adult fun. Can Accommodate. 603 689 240 (281344) SOTOGRANDE - Dominant man, tall and athletic, seeks submissive woman for fun times and more 649 566 133 (282109)
XXX RELAXATION
108
E W N 6 - 12 December 2018
MOTORING FACT TO build a car that remains at the very top of its class even when it’s at the end of its life, after new rivals have come and gone, is some feat. Even as the last Ford Fiesta bowed out, it was still winning group tests, still earning itself fivestar reviews, and still at the top of many hot hatch buyers’ want list. The latest Fiesta ST is available with three or five doors, both of which come with the same 197bhp, 1.5-litre three-cylinder turbo engine. The improvements Ford has made in the interior become immediately apparent on climbing inside. Gone is the old, plasticky dashboard littered with buttons, with a too-small infotainment screen. Although it is not exactly upmarket, the dashboard is more userfriendly, more modern and better finished, with some smart sections of black plastic drawing your attention away from the hard, brittle plastic lower down. In the front the chunky Recaro
MOTORING
SPONSORED BY
FOR BEST RATES IN MOTOR INSURANCE CALL: 952 89 33 80
“New Ford Fiesta ST:
French authorities stopped the Paris-Madrid race in Bordeaux in 1903 after 10 were killed, including Marcel Renault, leading to a French ban on road races.
Class is permanent s e a t s o ff e r f a b u l o u s s u p p o r t a l l round, enclosing you within deep bolsters and keeping you wonderfully comfy. But this leaves slightly less room in the back than is ideal, and the boot could be a little bigger too. However, as with all versions of this model, the extraordinary driveability of the Fiesta ST soon m a k e s y o u f o rg e t about any foibles. Put your foot down away from
FEISTY FORD: The new ST delivers once again.
t h e l i g h t s a n d t h e S T ’s p o t e n c y comes into play, the steering wheel gliding in your hands as the front
wheels effortlessly grip the tarmac. The Sport driving mode gives you sharper throttle and opens up
the exhaust to deliver more engine noise, while race disengages traction control to really put the car in your hands. The nose still responds beautifully to the steering, which is incredibly accurate and perfectly weighted. Overall the new ST is exhilarating, addictive and beguiling, just like the old model was.
Credit: Ford.es
Tanking it IF you’ve somehow managed to put the wrong fuel in your car, don’t panic, these things happen. But whether you’ve realised your mistake 30 seconds in, or not until you’ve filled the tank it makes no difference, the entire tank will need to be drained. The most important thing above all else is not to start your car, as this will make the fix simpler and less expensive. If you’ve had your wits about you in this way, notify the fuel station attendant and hopefully they’ll help you push your car to the station’s car park. From there you will be able to call your roadside assistance provider who will be able to come and assist. But if you’ve already driven a short distance before realising your mistake, you will need to have your vehicle towed to a mechanic. This is where the costs can mount as it’s likely that you will need a new fuel tank, new fuel lines, fuel filters, pumps and injectors, though this depends on
FUEL FOR THOUGHT: It is worth being extra careful at petrol stations. the vehicle. Unfortunately misfuelling isn’t covered by your warranty or insurance, and you’ll need to let your dealer know what has happened.
Most fuel filler caps will have a sticker stating what fuel the vehicle should be filled with, and there are also products with safety latches designed to block the wrong pumps going in.
110 EWN
6 - 12 December 2018
Premier League Preview
Arsenal rule demolition derby maintain their 100 per cent home record in the league this season. All seemed to be going to script when Bernardo Silva smashed them ahead early on, but without Sergio Aguero they lacked a killer instinct and Simon Francis swept in a perfect cross for Callum Wilson to level for the Cherries just before half-time. However, Raheem Sterling del i ver ed agai n wi t h a poached effort, before Illkay Gundogan’s close-range finish made sure of the points with 11 minutes remaining. Other fixtures this weekend will see Burnley host Brighton, Newcastle entertain Wolves and West Ham t ake on Cr yst al Palace.
FINE FORM: Arsenal’s PierreEmerick Aubameyang is making his mark this season.
Kenny and Nelson strike with 54 laps to go after a crash involving Italy’s Letizia Paternoster..
La Liga Preview
Real revolution continues REAL MADRID kept up their remarkable renaissance with a 2-0 victory over Valencia at the Bernabeu. An eighth minute Daniel Wass own goal and Lucas Vazquez’s late strike earned Real boss Santiago Solari his sixth win from seven games since he took over. Gareth Bale had a shot brilliantly saved by Neto, and Karim Benzema volleyed wide early in the match. Defeat for Valencia leaves them 13th in the table, while Real Madrid are fifth but looking upwards. Los Blancos next face Huesca while Valencia will host Sevilla. Barcelona moved above Sevilla to the top of La Liga in securing a comfortable 2-0 win over Villareal. Pique headed in Ousmane Dembele’s cross for the opener, and youngster Alena scored his first ever league goal when he chipped the ball over Sergio Asenjo from Lionel Messi’s through ball. It was only the second win in five games for Barca, while Villareal remain one place outside the relegation zone with one win in eight. The Catalans will next travel to Espanyol, while Villareal will host Celta Vigo. Atletico Madrid missed the chance to go top of La Liga after drawing 1-1 at Girona. Girona forward Cristhian Stuani struck the
Credit: @realmadrid/Twitter
an important 2-0 victory at Stamford Bridge. Ch els e a s truggle d for fluency, but subs tit ute Loftus Cheek made the win safe when he fired p a s t R ic o a fte r a n in tric a te pa s s ing mo ve w ith Ede n Hazard and Pedro. Chelsea next face a testing tie against league leaders Manch es te r C ity, w hile Fulham will travel to Manchester United. Ma n C ity ha d to work hard to see off Bournemouth 3-1 and
nal @Arse Credit:
UNAI EMERY’S Arsenal side produced a wonderful attacking performance to overpower London rivals Tottenham 4-2 at the Emirates. Pierre-Emerick Aubameyang put the Gunners ahead before an Eric Dier header and Harry Kane penalty saw Spurs surprisingly ahead at the break. But Aaron Ramsay and Alexandre Lacazette were introduced for the second half, and the Wels hma n so o n se t u p A u b a me y an g fo r th e equaliser. Then Lacazette’s deflected shot beat goalkeeper Hugo Lloris, before the outstanding Lucas Torreira sealed a fine victory for Arsenal. Arsenal next host Huddersfield while Tottenham will travel to Leicester. Liverpool’s Divock Origi scored a bizarre 96th minute goal in dramatic circumstances as an uncharacteristic Jordan Pickford error gifted the Reds a 1-0 victory over Everton. The feisty derby was heading for a draw when Pickford mishandled a sliced Virgil van Dijk shot, allowing Origi to head home the loose ball. It sent Jurgen Klopp sprinting onto the pitch to hug goalkeeper Alisson, but was harsh on Everton who had played with adventure. Liverpool will next face Bournemouth away, while Everton will entertain Watford. Chelsea overcame a spirited Fulham to claim
SPORT
REAL RECOVERY: Real Madrid are transformed under their new manager. opener from the penalty spot after he was fouled by keeper Jan Oblak. Atletico were on course for a first domestic defeat since September 1 but a Jonas Ramalho own goal denied the home side. Atletico will next face Alaves, while Girona will take on Athletic Bilbao. Other fixtures this weekend will see Leganes host Getafe, Eibar entertain Levante, and Rayo Vallecano travel to Real Betis.
SPORT
6 - 12 December 2018
Credit: @cyclist/Twitter
WITH less than two weeks to go until the official unveiling of the 2019 Vuelta a España route, pieces of the puzzle continue to fall into place. Visits to Andorra and France are already on the cards, and Bilbao and Los Muchucos have now been added to the route. The Minister for Employment, Industry and Tourism, Isaac Pola, has also revealed that the Vuelta will be spending three days in Asturias. The stretch is set for the end of the second week, September 7, 8 and 9 and will see the riders tackle two summit finishes. With its challenging climbs, the Vuelta has visited Asturias on several occasions and this year’s race featured summit finishes at Praeres de Nava and Lagos de Covadonga. In 2019, the Alto de Acebo and Puerto de La Cubilla will play host to the two summit finishes, while the third stage finish will be held in the Asturian capital of Oviedo.
Credit: @BronzeBomber/Twitter
Vuelta to hit Bilbao
EWN 111
FIRE AND FURY: The fight has captured the world’s attention.
Fury takes Wilder to the limit BRIT GRIT: Simon Yates will be looking to defend his Vuelta title next year. It will be the first time since 1987 that the Vuelta has visited Oviedo, the home of Formula 1 driver Fernando Alonso. The 2019 Vuelta España will start in Torrevieja on
August 24 and will spend three days in Alicante Province. The full route of the race will be officially revealed in a ceremony in Alicante on December 19.
4* Sant Cugat, Cataluña
SANT CUGAT GOLF COURSE: Was established in 1914. CostaLessGolf Weekly News with
Ron Garrood THE uniquely designed 4* Hotel Sant Cugat lies in the centre of the Catalan city in Sant Cugat, the exterior-facing rooms offer pleasant views of the historic centre and the Sierra de Collserola Hills. Socialising and dining in the plaza, trendy bars or fine restaurants is a great all year round experience and only a fiveminute walk away. This modern hotel building follows an intriguing lens-shaped form which runs all the way up the hotel’s central atrium. The colour scheme blends clean white with bold colours in a contemporary, minimalist style.
After returning from a day’s golf or sightseeing in the Catalan capital you can head to the hotel’s relaxing bar / restaurant or large outdoor terrace. Staying here gives you the additional bonus of high quality golf on your door step as only five mins from the hotel is the delightful Sant Cugat Golf Course established in 1914 or a short transfer will take you to the prestigious RCG El Prat. CostaLessGolf have a special offer staying for 3 Nights - B&B at 4* Hotel Sant Cugat, Barcelona. Playing 3 Rounds: 1 x RCG El Prat Pink Course, 1 x Yellow Course and Club de Golf Sant Cugat. Return Barcelona Airport & all Golf Transfers. Offer Valid between 01/02/19 – 28/02/19 for only €465.00 pp + 1 Free in 8 players, based on 2 persons sharing a twin/double room. For this offer or other dates & packages - Tel: 0034 952 661 849 or email enquiries@costalessgolf.com today.
TYSON FURY’S shot at completing an incredible return to the top of world boxing saw him survive two knockdowns in a thrilling draw with WBC heavyweight champion Deontay Wilder in Los Angeles. In one of the most absorbing heavyweight contests for years, the Briton was floored in the ninth round and brutally dropped in the 12th, but somehow got to his feet to survive for the final two minutes of the fight. Fury had shown plenty of the evasive, counter-punching skill that made his name be-
fore his 30-month spell away from the sport, and he enjoyed success in the middle rounds. But in the 12th he hit the canvas after a savage combination by his American opponent, just making the count and surviving to the bell. The fight was scored 115-111 for Wilder, 114-112 for Fury and 113-113, but many experts felt that Fury had been the better boxer. “The Gypsy King has returned,” said Fury. “I’m a professional athlete who loves to fight. He is a fearsome fighter. The world knows the truth.”
112
6 - 12 December 2018 MARK HUGHES has been sacked as Southampton manager after only eight months in charge, leaving the Saints 18th in the table while first-team assistant coach Kelvin Davis has been installed as interim manager.
TO READ MORE
SPORT
SPANIARD Jon Rahm recorded seven birdies to win the Hero World Challenge by four strokes in the Bahamas. Rahm, who led overnight with Tony Finau and Henrik Stenson, posted a bogeyfree seven-under 65 to finish on 20 under. Britain’s Justin Rose was in sight of the world number one spot after a 65 but F inau d e n i e d h i m with a birdie a t t h e l a st f o r s o le possession of second. Tourn a m e n t h o st Tig er Woods was 17th in the 18man field after a closing 73 left him at one under. Rose, 38, who was five shots off the lead in a share of eighth going into the fi-
Credit: @TGRLiveEvents
Rahm rocks Bahamas HEROIC WIN: Rahm was in sparkling form during the tournament.
nal round, holed a putt from off the green at the 11th for
his fourth birdie of the day.
He drained regai n t he t op spot he f i r st earned in September, it left him in sole possession of the runner-up spot at that st age af t er Fi nau m ade a double bogey at the 14th. But the American picked up two shots in the closing four holes to ensure that compatriot Brooks Koepka, who was not pl ayi ng t hi s week, remained at the top of the rankings as Rose finished third. Bi g- hi t t i ng Rahm , t he first Spaniard to play in the 20-year history of the event, m oved ahead af t er f our birdies in his opening nine holes in Albany. The 24- year- ol d wor l d number eight, part of Europe’s triumphant Ryder Cup t eam i n Sept em ber, wrapped up his third individual title of the year, the sixth of his blossoming career.
FREE Newspaper in Spain with the best local news in English from the Costa del Sol, Costa Blanca North, Costa Blanca South, Costa de Almeria...
Published on Dec 7, 2018
FREE Newspaper in Spain with the best local news in English from the Costa del Sol, Costa Blanca North, Costa Blanca South, Costa de Almeria... | https://issuu.com/euroweeklynews/docs/1744-costa-del-sol | CC-MAIN-2018-51 | refinedweb | 54,155 | 68.6 |
I have two files, huge.txt and small.txt. huge.txt has around 600M rows and it's 14 GB. Each line has four space separated words (tokens) and finally another space separated column with a number. small.txt has 150K rows with a size of ~3M, a space separated word and a number.
huge.txt
small.txt
Both files are sorted using the sort command, with no extra options. The words in both files may include apostrophes (') and dashes (-).
The desired output would contain all columns from the huge.txt file and the second column (the number) from small.txt where the first word of huge.txt and the first word of small.txt match.
My attempts below failed miserably with the following error:
cat huge.txt|join -o 1.1 1.2 1.3 1.4 2.2 - small.txt > output.txt
join: memory exhausted
What I suspect is that the sorting order isn't right somehow even though the files are pre-sorted using:
sort -k1 huge.unsorted.txt > huge.txt
sort -k1 small.unsorted.txt > small.txt
The problems seem to appear around words that have apostrophes (') or dashes (-). I also tried dictionary sorting using the -d option bumping into the same error at the end.
-d
I tried loading the files into MySQL, create indexes and join them, but it seems to take weeks on my laptop. (I don't have a computer with more memory or fast disk/SSD for this task)
I see two ways out of this but don't know how to implement any of them.
How do I sort the files in a way that the join command considers them to be sorted properly?
I was thinking of calculating MD5 or some other hashes of the strings to get rid of the apostrophes and dashes but leave the numbers intact at the end of the lines. Do the sorting and joining with the hashes instead of the strings themselves and finally "translate" back the hashes to strings. Since there would be only 150K hashes it's not that bad. What would be a good way to calculate individual hashes for each of the strings? Some AWK magic?
See file samples at the end.
Sample of huge.txt
had stirred me to 46
had stirred my corruption 57
had stirred old emotions 55
had stirred something in 69
had stirred something within 40
Sample of small.txt
caley 114881
calf 2757974
calfed 137861
calfee 71143
calflora 154624
calfskin 148347
calgary 9416465
calgon's 94846
had 987654
Desired output:
had stirred me to 46 987654
had stirred my corruption 57 987654
had stirred old emotions 55 987654
had stirred something in 69 987654
had stirred something within 40 987654
IMO the best way to do this would be to use the programming/scripting language you know best and: algorithm:
line1 = read a line from file 1
line2 = read a line from file 2
start of loop:
if (first word of line1 == first word of line2) {
write all fields of line1
and second field of line2 to output
line1 = read a line from file 1
go to start of loop
}
else if (first word of line1 < first word of line2) {
write line1 to output
line1 = read a line from file 1
go to start of loop
}
else (first word of line1 > first word of line2) {
line2 = read a line from file 2
go to start of loop
}
Here's a Python version (since Python is just what I happen to know best, not necessarily the best language for the job):
file1 = open('file1', 'r')
file2 = open('file2', 'r')
w2, n2 = file2.readline().split()
for line1 in file1:
w11, w12, w13, w14, n15 = line1.split()
if w11 == w2:
print w11, w12, w13, w14, n15, n2
continue
elif w11 < w2:
print w11, w12, w13, w14, n15
continue
else:
while w11 > w2:
w2, n2 = file2.readline().split()
if w11 == w2:
print w11, w12, w13, w14, n15, n2
elif w11 < w2:
print w11, w12, w13, w14, n15
and for completeness, after some digging here's what I came up with for Awk:
BEGIN {
getline line2 <"file2";
split(line2, a);
}
{
if (a[1] == $1) print $0,a[2];
else if (a[1] < $1) print $0;
else { getline line2 <"file2"; split(line2, a); }
}
Invoke as awk -f program.awk <file1.
awk -f program.awk <file1
My answer is similar to Michael Borgwardt's, but you don't have to load all of either file into memory. If the files are both sorted, then you walk through first file one line at a time, and you do binary search on the second file to find the target line in question. That's a lot of HD access, but it's low memory consumption.
I know it's embarrassingly simple but it works.
Based on the assumption that my original files contain only lowercase characters, I simply replaced the problematic apostrophes and dashes with two uppercase letters, re-sorted than joined the files, finally changed back the letters back to the signs. That's it.
Thanks again for everyone contributing an answer or insightful comment.
The sorting took like 2 hours for huge.txt (14Gig), the joining less than an hour.
cat small.txt | tr "\'-" "AD" | sort -k1 > small.AD
cat huge.txt | tr "\'-" "AD" | sort -k1 | cat huge.txt | join -o 1.1 1.2 1.3 1.4 2.2 - small.AD | tr "AD" "\'-" > output.txt
OK, this approach uses as a quicker way to look up the content of 'small.txt':
cdbmake
Use awk to pipe small.txt to cdbmake.
% awk ' { printf "+%d,%d:%s->%s\n", \
length($1),length($2),$1,$2 } \
END { print "" }' | cdbmake small.cdb small.cdbtmp
(This transforms a line of 'small.txt' from something like "key value" into "+ks,vs:key->value".)
Now you go line by line over 'huge.txt' and print it out, looking up the first word in 'small.cdb':
#!/bin/python
import cdb
import fileinput
c = cdb.init("small.cdb")
for l in fileinput.input(['huge.txt']):
print l.strip(),
v = c.get(l.split()[0])
print "" if v == None else v
You would have to install python-cdb of course to make this tiny snippet work (and it works only for Python 2.5 because of the 'conditional expression'. Anyway, there are a lot of bindings for whatever language you like. You could also use cdbget(a command line tool) and invoke it over and over again but spawning a new process for millions of lines is a bit ineffective.
cdbget
Anyway, keep this in mind:
Instead of MySQL, you might try PostgreSQL which likely can handle this task more gracefully. See their guide on efficiently populating a database.
By posting your answer, you agree to the privacy policy and terms of service.
asked
4 years ago
viewed
954 times
active
2 years ago | http://superuser.com/questions/145641/joining-text-files-with-600m-lines/147449 | CC-MAIN-2014-35 | refinedweb | 1,146 | 80.82 |
Allow only 1 (child) JFrame on screen
I have a main JFrame. There is a button inside the frame. When I click on the button, it opens a child frame.
But I only want one child frame to be open at any time (instead, when I click the button again, it gives me the second child frame, etc.).
So, I added an actionListener to the button to disable it when the child frame opens, and add a windowListener to the child frame, so that when I click the close button in the top right corner, it makes the button (on the main frame).
Here is my code:
import java.awt.Button; import java.awt.EventQueue; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JButton; import javax.swing.JFrame; public class Form1 extends JFrame implements ActionListener{ JButton btn1=new JButton("help"); public Form1() { super("Form 1"); this.add(btn1); setSize(200, 200); btn1.addActionListener(this); setVisible(true); } public void actionPerformed(ActionEvent e) { if(e.getSource()==btn1){ btn1.setEnabled(false); final Form2 x= new Form2(); x.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e){ x.dispose(); btn1.setEnabled(true); } }); } } public static void main(String[] args) { EventQueue.invokeLater(new Runnable(){ public void run() { new Form1(); } }); } } import javax.swing.JFrame; import javax.swing.JLabel; public class Form2 extends JFrame { JLabel lbl1=new JLabel("đang mở form 2 - trợ giúp"); public Form2() { super(); add(lbl1); setVisible(true); setSize(200, 200); } }
So my question is, is there any other way I could only have one child frame open (this means that when that child frame is opened, clicking the button in the main frame does nothing, unless that child frame is closed)
source to share
This seems like a great way, but yes, there are other ways. Your class can contain a reference to a child element
JFrame
as a member variable. The button can check if the item is
null
or is removed, and if so, create a new one; but otherwise he could have simply brought the existing child to the front.
source to share
Use a modal dialog instead. See How to make dialogs for details .
Dialogue can be modal. When a modal dialog is displayed, it blocks user input to all other program windows .
JOptionPane
creates
JDialogs
that are modal. To create a modeless dialog, you must use the class directly
JDialog
.
source to share
Build Form2 ahead of time and use setVisible (true) to show it and setVisible (false) to hide it. Here's an example:
if(e.getSource()==btn1){ btn1.setVisible(false); // not really needed if you disable form1 on btn1 press form2.setVisible(true); // show form2 form1.setVisible(false); // hide form1 }
source to share | https://daily-blog.netlify.app/questions/1893227/index.html | CC-MAIN-2021-43 | refinedweb | 460 | 68.47 |
Important: Please read the Qt Code of Conduct -
How to properly store objects into a list
I have a method that generates objects of a specific class; and those objects are added to a QList.
What is the difference between:
QList<MyClass *> object
QList<MyClass> object
And how should the objects that i'm adding be created, on stack or on heap ?
If you crate objects dynamically at runtime, they'll go on the heap. else will be on the stack. (it's not all the story !)
Your first object is a list of pointers to objects of type MyClass. second one is a list of objects of type MyClass. If you overloaded assignment operator and instance constructor for MyClass, operations on your list may be time-consuming (depending on nature of your class)
bq. And how should the objects that i’m adding be created, on stack or on heap ?
AFAIK there is no general rule. It depends on what you need to implement and how your code is organized. for example if you are creating objects inside a function and planing to use them outside of it; it's a bad idea to use pointers of objects to pass them to a list outside of function. you should probably consider about passing objects by value. But in some other conditions you may want to pass object pointers.
If you give us more details about your class then we can give you better advise.
I think the choice depends very much on what MyClass is. If it's a lightweight class that is passed around by value, then put objects in the list. If it's a more complex class, e.g. something derived from QObject, you should create the objects on the heap (using new) and store pointers in the list. Of course, then you have to make sure the objects are destroyed at some point, e.g. when the list is destroyed.
[quote author="Pufo" date="1309620091"]
What is the difference between:
QList<MyClass *> object
QList<MyClass> object
And how should the objects that i'm adding be created, on stack or on heap ?
[/quote]
Regarding the lists, will the second sollution create the objects on the heap while the first one will only store pointers and the objects itself can live anywhere. The content of the list will be created on the heap.
My class has 3 members. Two integers and a QString pointer.
I've created a list "QList<MyClass> *data" which is populated with objects ( not pointer to objects ).
If i do takeFirst() method, my program crashes.
I can avoid that if i comment out the constructor of MyClass.
I can't understand this behavior.
I think you'll have to show us MyClass for us to be able to help you with that.
I assume you have added at least one object to the list before you do takeFirst(), right?
I have almost 2000 objects, verified with size() method.
@#include "myline.h"
#include <QString>
#include <QChar>
static QChar badArray [] = {L'þ',L'ã',L'Ã',L'ª',L'º',L'â',L'Î',L'î', L'Þ'};
static QChar goodArray [] = {'t','a','A','S','s','a','I','i','T'};
MyLine::MyLine(QString &p_text, int p_startTime, int p_endTime){
text = new QString(p_text); startTime = p_startTime; endTime = p_endTime;
}
MyLine::MyLine(){
text = new QString(""); startTime = 0; endTime = 0;
}
MyLine::MyLine(const MyLine &obj){
text = obj.text; startTime = obj.startTime; endTime = obj.endTime;
}
void MyLine::addDelay(int mili){
startTime += mili; endTime += mili;
}
void MyLine::subtractDelay(int mili){
startTime -= mili; endTime -= mili;
}
void MyLine::correct(){
for (int i = 0; i < 9; i++) { if (text->indexOf(badArray[i]) != -1){ text->replace(badArray[i], goodArray[i]); } }
}
MyLine::~MyLine(){
delete text;
}@
You don't want to use QString that way...
Just use QString, not pointer to QString. And don't create them using new.
Edit: I guess it might work, if you copy the string in the copy constructor as well. But you really don't want to use QString this way anyway.
Can you tell my why i don't want to use pointers for QString ?
QStrings are implicitly shared. You can safely pass them around as objects without worrying about how, when and where they are copied, and how much space they are taking up. I guess you can use pointers, but it just makes things much more difficult for you.
What did you do to get that error message?
If you use QString instead of a pointer, you can get rid of the destructor and copy constructor.
Also, you should probably consider using initializer lists in your constructors, i.e.:
@
MyLine::MyLine(const QString &p_text, int p_startTime, int p_endTime)
: text(p_text)
, startTime(p_startTime)
, endTime(p_endTime)
{
}
@
As a side node, the crash comes from here:
@
MyLine::MyLine(const MyLine &obj){
text = obj.text; startTime = obj.startTime; endTime = obj.endTime;
}
@
You copy the pointer. and in the destructor of both objects, you then destroy it (this and obj) | https://forum.qt.io/topic/7222/how-to-properly-store-objects-into-a-list | CC-MAIN-2021-43 | refinedweb | 827 | 74.39 |
Description
Opens the specified file for reading or writing and assigns it a unique integer file number. You use this integer to identify the file when you read, write, or close the file. The optional arguments filemode, fileaccess, filelock, and writemode determine the mode in which the file is opened.
Syntax
FileOpen ( filename {, filemode {, fileaccess {, filelock {, writemode {, encoding }}}}} )
Return value
Integer.
Returns the file number assigned to filename if it succeeds and -1 if an error occurs. If any argument's value is null, FileOpen returns null.
Usage
The mode in which you open a file determines the behavior of the functions used to read and write to a file. There are two functions that read data from a file: FileRead and FileReadEx, and two functions that write data to a file: FileWrite and FileWriteEx. FileRead and FileWrite have limitations on the amount of data that can be read or written and are maintained for backward compatibility. They do not support text mode. For more information, see FileRead and FileWrite.
The support for reading from and writing to blobs and strings for the FileReadEx and FileWriteEx functions depends on the mode. The following table shows which datatypes are supported in each mode.
When a file has been opened in line mode, each call to the FileReadEx function reads until it encounters a carriage return (CR), linefeed (LF), or end-of-file mark (EOF). Each call to FileWriteEx adds a CR and LF at the end of each string it writes.
When a file has been opened in stream mode or text mode, FileReadEx reads the whole file until it encounters an EOF or until it reaches a length specified in an optional parameter. FileWriteEx writes the full contents of the string or blob or until it reaches a length specified in an optional parameter.
The optional length parameter applies only to blob data. If the length parameter is provided when the datatype of the second parameter is string, the code will not compile.
In all modes, PowerBuilder can read ANSI, UTF-16, and UTF-8 files.
The behavior in stream and text modes is very similar. However, stream mode is intended for use with binary files, and text mode is intended for use with text files. When you open an existing file in stream mode, the file's internal pointer, which indicates the next position from which data will be read, is set to the first byte in the file.
A byte-order mark (BOM) is a character code at the beginning of a data stream that indicates the encoding used in a Unicode file. For UTF-8, the BOM uses three bytes and is EF BB BF. For UTF-16, the BOM uses two bytes and is FF FE for little endian and FE FF for big endian.
When you open an existing file in text mode, the file's internal pointer is set based on the encoding of the file:
If the encoding is ANSI, the pointer is set to the first byte
If the encoding is UTF-16LE or UTF-16BE, the pointer is set to the third byte, immediately after the BOM
If the encoding is UTF-8, the pointer is set to the fourth byte, immediately after the BOM
If you specify the optional encoding argument and the existing file does not have the same encoding, FileOpen returns -1.
File not found
If PowerBuilder does not find the file, it creates a new file, giving it the specified name, if the fileaccess argument is set to Write!. If the argument is not set to Write!, FileOpen returns -1.
If the optional encoding argument is not specified and the file does not exist, the file is created with ANSI encoding.
When you create a new text file using FileOpen, use line mode or text mode. If you specify the encoding parameter, the BOM is written to the file based on the specified encoding.
When you create a new binary file using stream mode, the encoding parameter, if provided, is ignored.
Examples
This example uses the default arguments and opens the file EMPLOYEE.DAT for reading. The default settings are LineMode!, Read!, LockReadWrite!, and EncodingANSI!. FileReadEx reads the file line by line and no other user is able to access the file until it is closed:
integer li_FileNum li_FileNum = FileOpen("EMPLOYEE.DAT")
This example opens the file EMPLOYEE.DAT in the DEPT directory in stream mode (StreamMode!) for write only access (Write!). Existing data is overwritten (Replace!). No other users can write to the file (LockWrite!):
integer li_FileNum li_FileNum = FileOpen("C:\DEPT\EMPLOYEE.DAT", & StreamMode!, Write!, LockWrite!, Replace!)
This example creates a new file that uses UTF8 encoding. The file is called new.txt and is in the D:\temp directory. It is opened in text mode with write-only access, and no other user can read or write to the file:
integer li_ret string ls_file ls_file = "D:\temp\new.txt" li_ret = FileOpen(ls_file, TextMode!, Write!, & LockReadWrite!, Replace!, EncodingUTF8!)
See also | https://docs.appeon.com/pb2021/powerscript_reference/ch02s04s176.html | CC-MAIN-2021-49 | refinedweb | 834 | 63.29 |
Details
- Type:
New Feature
- Status: Open
- Priority:
Major
- Resolution: Unresolved
- Affects Version/s: None
- Fix Version/s: None
- Component/s: contrib-bindings, documentation, java client, server
- Labels:None
Description.
[edit - JIRA interprets ( n ) without the spaces as a thumbs-down. cute.]
Issue Links
- is related to
ZOOKEEPER-1022 let the children under a ZNode in order.
- Open
ZOOKEEPER-282 the getchildren api in zookeeper should return an iterator.
- Open
Activity
Thanks - I'm afraid I need a bit more clarification (I'm slow first thing in the morning
).
For a stack, each worker can call getLastChild which will give a FIFO ordering. Actually locking the nodes is not covered by this patch, although we could look at doing getAndDelete[First|Last]Child.
If a worker could get the last N children, that could bring a benefit in terms of being able to batch process some nodes. Is that what you're describing?
Henry
Hi Henry,
One case would be to have a queue with many workers. Each worker tries to lock a node and does the job/work/task associated with it. If it has finished, it removes the node from the queue.
For a stack like / last in, first out kind of queue this ordered top N api would afaic be beneficial.
Best,
Lukas
Lukas -
Good suggestion. Could you describe the use case you're thinking of, so we can properly weigh up the idea?
Thanks -
Henry
Wouldn't it also be beneficial to generalize this method for fetching the top N nodes instead of just the first one (i.e. allow an ordered access to the child nodes)?
[Non-garbage patch this time]
This is a draft patch for this issue. I'd appreciate feedback on the approach.
I've added two API methods - getFirstChild and getLastChild. I've changed DataNode to keep its child list in a TreeSet, not a HashSet. This may be controversial because operations are now logarithmic in the number of children, not O(1), but the datatree's hashmap is still used for most path-based lookups.
Both API methods throw an Empty exception if there are no children.
I've decided not to address the issue of what to sort by here, and just defaulted to sorting by node name. The API leaves the door open to specifying a sort order at the time of parent node creation (i.e. another argument to create(...)).
This patch obviously lacks tests, comments and general cleanup. You should be able to use a shell to call lsfirst and lslast.
Any comments on the APIs would be great - would we rather one getOrderedChild API which took a flag describing whether to get the first or last? Or a getNthChild API?
Draft patch
I started taking a look at this today, just to see how hard it would be.
Sorting by name would be extremely easy; even sorting in such a way as to make sure that sequential nodes return in order would be straightforward. This would be sufficient to support e.g. queues.
Sorting by anything else (zxid, for example) is hard because a DataNode can't get at the data of its children, only their names. We could add references to child objects, but that would increase the size of a DataNode object by a factor of asymptotically 2. We could also add a reference to the parent DataTree, and use the map there to retrieve child objects, but that's an uglier design.
Does anyone have any thoughts? I'm tempted just to add getOrderedChildByName(path, ordertype) and leave it there. It would be enough to help out several use cases. As a side-effect, getChildren would return a sorted list of child paths.
we should keep in mind that someday we may have a partitioned namespace. when that happens some of these options would be hard/very expensive/blocking. NAME of course is easy. the client can always do this. when the creation happens, we can store the xid with the child's name in the parent data structure since it doesn't change, so CREATED is reasonable. MODIFIED and DATA_SIZE is more problematic/seemingly impossible in the presence of a namespace partition.
?
Take a look at ZOOKEEPER-282 - perhaps should wrap this all up together with
List<String> listChildren(start, count, order, watch/watcher)
type of api (async too)
tricky bit is probably the semantics of watch? also how to keep track of the znodes
btw calls? Perhaps start is the opaque xid which we somehow provide to the client for
use in starting/continuing calls:
xid = Xid.first()
List<String> listChildren(xid, count, Order.XID_DESC, watch/watcher)
...
List<String> listChildren(xid, count, Order.XID_DESC, watch/watcher)
... // loop until null returned
Hi Henry,
.
I hope i can make it more clear
Given a scenario of a job queue with multiple workers. Each worker shall process one job at the time and the jobs should be processed in an ordered fashion (lets say LIFO in this case, could also be FIFO). Each job is represented as a child node of some zookeeper node.
Each worker tries to process the newest job which is currently not processed by another worker. For this, he retrieves the newest not locked child and creates his lock (=ephemeral+sequential node) under this child node (grand child so to say
If the worker has finished the job, he deletes the lock (grand child) and the child (yes, here could be a race, but this can be circumvented).
In this scenario it is beneficial, if the worker can get the first N children and try to lock one of them as some of them are already locked by other workers.
Also, getAndDelete is not appropriate, as in case of a worker failure (e.g. hardware failure) the job is not in the queue anymore, but also not finished which gives a zombie job.
By locking, I mean the zookeeper locking pattern using ephemeral+sequential nodes.
Best,
Lukas | https://issues.apache.org/jira/browse/ZOOKEEPER-423?attachmentSortBy=dateTime | CC-MAIN-2015-18 | refinedweb | 997 | 72.76 |
16 February 2011 17:54 [Source: ICIS news]
SAN DIEGO, California (ICIS)--The US biochemicals industry should broaden its focus beyond technology and seek out further opportunities for business investment, a manager with the US Department of Energy (DoE) said on Wednesday.
“To get things moving, the business side has to be even with the technology,” said Paul Bryan, programme manager with the DoE’s office of biomass.
?xml:namespace>
“Over here [in the technical room], it’s been packed,” he said. “But over there, there is plenty of room. I’d like to see that side packed as well.”
“I’d like to see you pull more people in, and persuade more people in the business world that this is a place to invest money,”
“People in government are beginning to understand that making fuel - and the price you have to sell fuel at to compete in the marketplace - is extraordinarily challenging,” he said.
“This [biochemicals] is getting us back into the natural order,” he added.
But in addition to government initiatives, the biochemicals industry must focus on innovative commercialisation strategies, he said.
“It can’t just be about the technology,”
The Bio-Based Chemicals Summit runs | http://www.icis.com/Articles/2011/02/16/9436043/us-biochemicals-too-technology-driven-need-business-focus-doe.html | CC-MAIN-2013-48 | refinedweb | 198 | 50.16 |
The idea is basic binary search with some tricky points to think of.
Since the array is rotated, we have to make sure which part we are in right now. The order is ascending order, so we compare with the right one to decide.
Two cases:
A1= [4,5,6,7,8,9,1,2,3];
A2= [9,1,2,3,4,5,6,7,8];
In A1, l=4, r=3, m=8, A[m]>A[r], we can know A[l] to A[m] is in ascending order.
In A2, l=9, r=8, m=4, A[r]>A[m], we can know A[m] to A[r] is in ascending order.
After this, we compare the target with the two boundary elements of the ascending ordered part, see if the target lie in it. If not so, we choose from the other part.
Note that in BST, if we give
while(left<=right), we have to make sure,
right=mid-1, and
left=mid+1, so that every element will be reached.
public class Solution { public int search(int[] A, int target) { if(A==null || A.length==0) return -1; int l = 0; int r = A.length-1; while(l<=r) { int m = (l+r)/2; if(target == A[m]) return m; if(A[m]<A[r]){ if(target>A[m] && target<=A[r]) l = m+1; else r = m-1; } else{ if(target>=A[l] && target<A[m]) r = m-1; else l = m+1; } } return -1; } } | https://discuss.leetcode.com/topic/28851/my-java-solution-with-explanation | CC-MAIN-2017-39 | refinedweb | 251 | 80.11 |
In regression analysis, heteroscedasticity refers to the unequal scatter of residuals. Specfically, it refers to the case where there is a systematic change in the spread of the residuals over the range of measured values.
Heteroscedasticity is a problem because ordinary least squares (OLS) regression assumes that the residuals come from a population that has homoscedasticity, which means constant variance. When heteroscedasticity is present in a regression analysis, the results of the analysis become hard to trust.
One way to determine if heteroscedasticity is present in a regression analysis is to use a Breusch-Pagan Test.
This tutorial explains how to perform a Breusch-Pagan Test in Python.
Example: Breusch-Pagan Test in Python
For this example we’ll use
We will fit a multiple linear regression model using rating as the response variable and points, assists, and rebounds as the explanatory variables. Then we will perform a Breusch-Pagan Test to determine if heteroscedasticity is present in the regression.
Step 1: Fit a multiple linear regression model.
First, we’ll fit a multiple linear regression model:
import statsmodels.formula.api as smf #fit regression model fit = smf.ols('rating ~ points+assists+rebounds', data=df).fit() #view model summary print(fit.summary())
Step 2: Perform a Breusch-Pagan test.
Next, we’ll perform a Breusch-Pagan test to determine if heteroscedasticity is present.
from statsmodels.compat import lzip import statsmodels.stats.api as sms #perform Bresuch-Pagan test names = ['Lagrange multiplier statistic', 'p-value', 'f-value', 'f p-value'] test = sms.het_breuschpagan(fit.resid, fit.model.exog) lzip(names, test) [('Lagrange multiplier statistic', 6.003951995818433), ('p-value', 0.11141811013399583), ('f-value', 3.004944880309618), ('f p-value', 0.11663863538255281)]
A Breusch-Pagan test uses the following null and alternative hypotheses:
The null hypothesis (H0): Homoscedasticity is present.
The alternative hypothesis: (Ha): Homoscedasticity is not present (i.e. heteroscedasticity exists)
In this example, the Lagrange multiplier statistic for the test is 6.004 and the corresponding p-value is 0.1114. Because this p-value is not less than 0.05, we fail to reject the null hypothesis. We do not have sufficient evidence to say that heteroscedasticity is present in the regression model.
How to fix Heteroscedasticity
In the previous example we saw that heteroscedasticity was not present in the regression model. However, when heteroscedasticity actually is present there are three common ways to remedy the situation:
1. Transform the dependent variable. One way to fix heteroscedasticity is to transform the dependent variable in some way. One common transformation is to simply take the log of the dependent variable.
2. Redefine the dependent variable. Another way to fix heteroscedasticity is to redefine the dependent variable. One common way to do so is to use a rate for the dependent variable, rather than the raw value.
3. Use weighted regression. Another way to fix heteroscedasticity is to use weighted regression. This type of regression assigns a weight to each data point based on the variance of its fitted value. When the proper weights are used, this can eliminate the problem of heteroscedasticity.
Read more details about each of these three methods in this post. | https://www.statology.org/breusch-pagan-test-python/ | CC-MAIN-2022-21 | refinedweb | 522 | 51.24 |
Your Account
by Simon St. Laurent
Related link:
XSL-FO combines an enormous (and verbose!) vocabulary and lots of possible combinations. In our second day of XSL-FO training, the potential number of interactions is seems ever larger, as does the number of cases where repurposing features (especially empty blocks, and footnotes) to produce results which aren't immediately obvious.
block
footnote
There's a strange kind of genius at work in the page-layout systems of XSL-FO, demanding that stylesheet writers specify the logic by which their documents operate. The XSLT/XSL-FO combination lets developers create enormous logic puzzles which lay out pages rather than the more familiar (to me) process of human interaction in applications like PageMaker, Quark, InDesign, and FrameMaker.
While it's sometimes possible to leap into the XSL-FO instance markup, there's still (deliberately) a large layer of indirection between that markup and the final rendered product. Working with XSLT stylesheets which generate XSL-FO, which is for the most part the preferred approach, adds another layer of indirection. While it's certainly possible to tweak stylesheets to render a particular document, I have to admit that I really miss the cascade of CSS and its much easier element-by-element tweaking capabilities. There are best practices for creating tweakable (well, modularized) XSLT stylesheets, but you're much more at the mercy of the creator of the stylesheet with which you're interacting.
I have a hard sitting through five days of anything, especially huge volumes of technical information, but Ken Holman has done a remarkable job of keeping this interesting. He combines enthusiasm for the training with a long list of projects outside of training, and his work beyond the training made the examples a lot more compelling. I can't imagine teaching this for five days solid, but he seemed just as ready to explore the details of keeps and breaks this afternoon as he was to explain the overall architecture on Monday.
I came to the training as a skeptic of XSLT and especially XSL-FO, and I haven't experienced a massive conversion. At the same time, though, I have a far better perspective on what these tools are good for (and not good for), not to mention a much deeper understanding of how they fit together. I'll be taking what I've learned back to O'Reilly, where I'm hoping to use my improved XSLT skills for a variety of editorial tasks, and see if I can fit XSL-FO into my process so that authors can get a better snapshot of what their work will look like.
After five days of this, I'm pretty tired, but very happy. It's a different feeling than I tend to get after a conference or reading a book, and it's one I'd encourage more people to enjoy.
Does training make a big difference for you?
It's seems quite powerfull but difficult. I was wondering if it can be used to generate simple printing and full blown report generation. We need to print simple transactions and generate reports. I was hoping to use one system to do both.
I like the fact that the output can be configured, this way customers can get their own custom output, logo's, disclaimer's, etc. FO seems like it can handle this easily, but what about report generations, charts, graphs, etc.
Thanks for any feedback,
Joe
I acknowledge many people think XSL-FO is difficult, but I've come to the conclusion that is usually because the are reading the Recommendation. The Recommendation is written for XSL-FO engine implementers and has all the gory detail necessary to ensure consistency across products and applications. I don't think the Recommendation makes a great learning tool for a beginning stylesheet writer.
Thankfully, it is easy to meet straightforward requirements quickly and easy to build on the basics to make very professional-looking results for rule-based publications.
Without knowing your requirements for "simple transactions and generate reports", I am confident in predicting these to be rule-based and you will be able to make good-looking publications.
Regarding charts and graphs, XSL-FO easily accommodates foreign namespaces for graphic images and a number of tools support the inline presentation of SVG. XSLT stylesheets can produce the mixture of SVG and XSL-FO from XML in a seamless fashion to flexibly produce an integrated result.
I hope you find this is helpful.
............... Ken
Specifically, I find XSL-FO (using FOP) to be the perfect tool for security marketing and sales. There's a lot similarity between products, but the columns change from product to product. There's also a lot of disclosure, footnotes and explanation paragraphs, that XSL-FO handles quite easily. Other reporting tools that we've used have required us to break up text into separate controls to handle bold text. We've even had to use unicode footnote symbols to handle superscripts. XSL-T usually is enough to generate the formatting and the logic we need to create reports.
BIG THANKS
Marc Laventurier
© 2015, O’Reilly Media, Inc.
(707) 827-7019
(800) 889-8969
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners. | http://archive.oreilly.com/pub/post/xslfo_day_2.html | CC-MAIN-2015-18 | refinedweb | 884 | 51.38 |
This document introduces the ASN.1 (Abstract Syntax Notation) framework delivered as part of the Harmony classlibrary. This document provides an overview of ASN.1 types and encoding rules with focus on the characteristics of the current implementation. The document gives details on the framework design and provides an overall description of the ASN.1 package.
The target audience for the document includes a wide community of engineers interested in using ASN.1 and in further work with the product to contribute to its development. The document assumes that readers are familiar with the ASN.1 notation and the Java* programming language.
This document uses the unified conventions for the Harmony documentation kit.
ASN.1 (Abstract Syntax Notation One) is an international standard of notation used to specify data structures with a high level of abstraction, which is reflected in the ASN.1 specification [2]. ASN.1 is fully platform- and language-independent. ASN.1 goes with the encoding rules, which determine how to represent a value of an abstract type as a string of octets [3].
The Java* API specification [1] employs ASN.1 in the following ways:
To learn more about ASN.1, you can use online documentation [4], [5], and publications [6], [7].
ASN.1 has the following basic types:
ANYand
CHOICE.
These types are used to specify a wide range of other abstract types, as shown in Example 1.
This example is based on RFC 3280 [8].
Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension Extension ::= SEQUENCE { extnID OBJECT IDENTIFIER, critical BOOLEAN DEFAULT FALSE, extnValue OCTET STRING } Version ::= INTEGER { v1(0), v2(1), v3(2) }
In this example, the basic ASN.1 types
SEQUENCE,
OBJECT IDENTIFIER,
BOOLEAN and
OCTET STRING are used to specify a new abstract
type
Extension. The newly created type is then used with another basic
type
SEQUENCE OF to describe the
Extensions type. The
ASN.1
INTEGER type is used to specify the
Version abstract
type and to provide constraints for this type.
This part of the document describes the ASN.1 framework as a whole, defines the mapping principles to establish the correspondence between ASN.1 and Java* types, and represents the hierarchy of ASN.1 types representation in the current framework.
The ASN.1 framework provides a common, easy and efficient approach for working with ASN.1 basic types, notations and encoding rules. This framework can be described as a layer between a Java* object and its ASN.1 encoded form, as shown in Figure 1.
Figure 1: ASN.1 Framework Layer
The Harmony ASN.1 framework is characterized by:
The framework enables the following:
Note
The current ASN.1 framework is a partial implementation of the ASN.1 and encoding rules specifications. This framework covers certain ASN.1 basic types and basic encoding rules (BER), and provides most restrictions employed by the distinguished encoding rules (DER).
The framework maps all ASN.1 abstract types and notations to Java* primitive types or Java* classes.
The notations in Example 1 can be represented as the following Java* classes:
public class Extension { private String extnID; private boolean critical; private byte extnValue[]; } public class Extensions { // contains elements of Extension class private List extensions; }
The
Extension notation corresponds to a Java* class
with three fields, where every field corresponds to one entry in the
Extension
notation. For example, the
critical BOOLEAN DEFAULT FALSE field in
the
Extension notation corresponds to the
boolean critical
field in the Java* class. The
Extensions notation
equals to a Java* class with a field that contains an ordered collection
of the instances of the
Extension class.
The table below describes the default mapping ASN.1 types to Java* types, and indicates the class providing the specified mapping in the current framework.
Basic ASN.1 types are in the
org.apache.harmony.security.asn1 package
in accordance with the hierarchy shown in Figure 2.
Figure 2: Class Hierarchy
The subsequent sections provide as short description of the classes included in the package.
INTEGERtype that denotes an arbitrary integer with positive, negative, or zero values and any magnitude. Because an integer value is not restricted, it is up to the application class to choose the Java* type for storing the integer value, for example, an instance of the
java.math.BigIntegerclass. By default, an integer value is stored in an array of bytes.
ENUMERATEDtype that denotes a set of integer values. The implementation of this class is similar to that of the
ASN1Integerclass.
OBJECT IDENTIFIERtype. This type is a sequence of integer components that identifies an entity, such as an organization or an algorithm. Integer components have no negative values. An
OBJECT IDENTIFIERvalue includes at least two components. The corresponding Java* type is an array of integer values.
BOOLEANtype, which corresponds to the
java.lang.BooleanJava* class.
BMPString, IA5String, GeneralString, PrintableString, TeletexString, UniversalString,and
UTF8String. The class maps all these types to the
java.lang.Stringobject.
Note
The current implementation does not verify allowed characters for any of ASN.1 restricted
characters types. The class only stores and retrieves contents bytes to and from
the
String object.
BitStringtype. The corresponding Java* class is
BitStringincluded in the
asn1package. The class provides implementation for decoding or encoding
BitStringobjects.
Note
A special use case for this ASN.1 type exists, when the type is declared as
Named
BitString. For example:
Keys ::= BIT STRING { Key1 (0), Key2 (1), MyKey (2) }
In this case, the BER specification [3] enables adding
and removing any number of trailing to and from the basic encoding. To provide a
correct type implementation, use the
ASN1Bitstring.ASN1NamedBitList
class. By default, the class maps the ASN.1
Named BitString type to
an array of primitive boolean values.
OctetStringtype, which corresponds to the Java* type of an array of bytes.
UTCTimetype. The corresponding Java* class is
java.util.Date.
GeneralizedTimetype. The corresponding Java* class is
java.util.Date.
integer,
boolean,
ANY, then an initialization array must contain three class instances in the same order:
ASN1Boolean,
ASN1Integer,
ASN1Any.
SEQUENCE OFtype denotes an ordered collection of one or more values of the selected ASN.1 type. An instance of the class is initialized with an instance of the ASN.1 class according to the type notation. The passed instance is used to decode or encode all values in an collection.
SET OFtype denotes an unordered collection of one or more values of the selected ASN.1 type. This class is similar to the
ASN1SequenceOfclass.
EXPLICITtype tagging. Explicit tagging denotes a type derived from another type by adding an outer tag to the base type. This type can be represented as a sequence type with only one component, so that the implementation class acts as a container for another ASN.1 type.
IMPLICITtype tagging. An implicitly tagged type is a type derived from another type by changing a tag of the base type. The implementation class for this type changes only the tag when decoding or encoding the base type.
ANYtype. The type denotes any ASN.1 type that can be defined by a value of the
OBJECT IDENTIFIERor by an integer index. The class handles only raw data represented as a Java* byte array. It is up to the application class to select the appropriate decoder or encoder for retrieving or storing the content respectively.
CHOICEtype. The type represents a list of one more type alternatives with distinct tags. an instance of the class is initialized with the Java* array of ASN.1 classes, which corresponds to a type notation.
CHOICEtype is specified as a list of
boolean,
OctetStringand
UTCTime, then an initialization array contains instances of the
ASN1Boolean,
ASN1OctetStringand
ASN1UTCTimeclasses. During decoding or encoding, a required type alternative is selected.
Encoding rules specify how to represent an ASN.1 type as a sequence of octets. ASN.1
encoding rules are represented in the
org.apache.harmony.security.asn1
package, as follows:
BerInputStreamand
DerInputStreamprovide decoding and verifying functionality for corresponding notation rules.
BerOutputStreamand
DerOutputStreamprovide the encoding functionality.
Encoding an object is the process of extracting all required information
from an object and storing it in a sequence of octets according to the specified
ASN.1 notation and encoding rules. The common encoding functionality is implemented
in the
BerOutputStream class. Encoding for DER is represented by the
DEROutputStream class.
The encoding of data for each ASN.1 type includes:
DER Encoding
In contrast to BER, DER enables using only the definite form of length encoding. That is why, before encoding an ASN.1 type value, the ASN.1 framework must obtain the length of the value. This requirement determines the whole process of DER encoding: to calculate the length of a constructed ASN.1 type, the framework calculates lengths of its components, which can also be constructed, and so on. DER encoding goes in the following stages:
Decoding or verifying the provided encoded form is a sequential process of parsing strings of octets according to the specified ASN.1 notation and encoding rules.
An iteration of decoding an ASN.1 type includes decoding its tag, length, and content
octets. The class
BerInputStream provides a common decoding implementation
for all basic ASN.1 types. To provide specific decoding for a basic ASN.1 type,
a derived class must override one of the corresponding methods. For example,
DerInputStream
provides a custom implementation for decoding the
ASN.1 Boolean type
by overriding the method
readBoolean().
In the current framework, the basic classes meet the following requirements:
getInstance()method.
Classes from the
asn1 package that represent ASN.1 basic types are
used as building blocks for implementing a custom ASN.1 encoding or decoding
class. A custom ASN.1 class provides mapping of an abstract ASN.1 type to a definite
Java* class.
Two approaches for implementing custom ASN.1 classes are available. Custom classes can be designed as singleton Java* classes or not. The choice depends on further use of the class decoder. The singleton approach is not efficient when decoding only one Java* object. However, for decoding a series of encodings (for example, with an application server), the singleton approach is rather effective because only one reusable decoder instance exists. Creating a new decoder object for each decoded or encoded Java* object leads to performance penalties.
To implement the singleton approach, a custom ASN.1 class must meet the following requirements:
Example 3
This example illustrates the singleton approach to static instances of ASN.1 custom
classes for the
Extensions and
Extension classes used
in Example 2 . For this, create an instance of a custom
ASN.1 class as an instance of an anonymous class as shown below.
class Extensions { // instance of decoder/encoder public static final ASN1SequenceOf ASN1 = new ASN1SequenceOf(Extension.ASN1); private List extensions; } class Extension { // instance of decoder/encoder public static final ASN1Sequence ASN1 = new ASN1Sequence(new ASN1Type[] { ASN1Oid.getInstance(), // extnID ASN1Boolean.getInstance(), // critical ASN1OctetString.getInstance()}) { // extnValue // replace constructor { // set default value for critical field // first parameter - a default value // second parameter - an index of ASN.1 type in a sequence starting with 0 setDefault(Boolean.FALSE, 1); } }; private String extnID; private boolean critical; private byte extnValue[]; }
The
static final ASN1 field instance provides a mapping between the
Java*
Extension class and its ASN.1 notation. The
field is initialized so that it reflects the ASN.1 notation of the class: it is
the instance of the
ASN1Sequence class that is initialized with instances
of the
ASN1Oid,
ASN1Boolean and
ASN1OctetString
classes.
The
Extensions class has a similar field. The field also reflects the
ASN.1 notation: it is the instance of the
ASN1SequenceOf class and
it is initialized by the
ASN1 field from the
Extension
class.
Figure 3 displays the correspondence between the application object tree and the object tree of ASN.1 custom classes.
Figure 3: Java Object and ASN.1 Custom Class Trees
This section demonstrates the usage of the ASN.1 framework.
An abstract type can be defined as
ASN.1 Boolean, for example:
MyBooleanType ::= BOOLEAN;
Then the following code can be used to decode and encode values of this type:
// represents encoded ASN.1 Boolean type: false value byte encoding[] = new byte[] {0x01, 0x01, 0x00}; // get instance of ASN.1 Boolean decoder/encoder ASN1Type asn1 = ASN1Boolean.getInstance(); // decoded value is Boolean.FALSE Boolean value = (Boolean)asn1.decode(encoding); // encode Boolean.TRUE value // an array value equals to {0x01, 0x01, 0xFF} byte enc[] = asn1.encode(Boolean.TRUE);
The following ASN.1 notation can be used to define a tagged type:
MyTaggedType ::= [APPLICATION 0] EXPLICIT BOOLEAN;
By default, a tagged type,
MyTaggedType, is mapped to the same Java* type as a basic type, see ASN.1
BOOLEAN above.
Then the following code can be used to decode and encode the values of this type:
// represents encoded explicitly tagged ASN.1 Boolean type: false value byte encoding[] = new byte[] {0x60, 0x03, 0x01, 0x01, 0x00}; // create an instance of custom decoder/encoder for tagged type ASN1Type asn1 = new ASN1Explicit( ASN1Constants.CLASS_APPLICATION, // tagging class 0, // tag number ASN1Boolean.getInstance() // type to be tagged ); // decoded value is Boolean.FALSE Boolean value = (Boolean)asn1.decode(encoding); // encode Boolean.TRUE value as explicitly tagged // an array value equals to {0x60, 0x03,0x01, 0x01, 0xFF} byte enc[] = asn1.encode(Boolean.TRUE);
A constructed ASN.1 type notation can go as follows.
MyConstructedType ::= SEQUENCE { classVersion INTEGER, isExtendable BOOLEAN DEFAULT FALSE }
By default, a sequence type is mapped to an array of objects. In the example, it
is an array of two objects: the first object represents
classVersion
and the second object represents the
isExtendable flag.
The following code can be used to decode and encode the values of this type:
//); } }; // decoded sequence value is mapped to array of objects Object value[] = (Object[])asn1.decode(someEncoding); // first value (ASN.1 Integer) is mapped by default to an array of bytes byte version[] = (byte[])value[0]; // second value (ASN.1 Boolean) is mapped by default to a Boolean object Boolean isCritical = (Boolean)value[1];
When it is necessary to change the default mapping of an array of objects for the
ASN.1
Sequence type to a custom Java* class, two methods
are overridden.
// class for storing MyConstructedType values class A { int version; boolean isExtendable; } //); } // for decoding public Object getDecodedObject(BerInputStream in) throws IOException { Object values[] = (Object[])in.content; A a = new A(); // array of bytes to primitive int value a.version = (new BigInteger((byte[])value[0])).intValue; // Boolean object to primitive boolean a.isExtendable = ((Boolean)value[1]).booleanValue(); return a; } // for encoding public void getValues(Object object, Object values[]) { A a = (A)object; // primitive int value to array of bytes values[0] = BigInteger.valueOf(a.version).toByteArray(); // primitive boolean value to Boolean object values[1] = Boolean.valueOf(a.isCritical); } }; // decoded sequence value is mapped to custom A class A a1 = (A)asn1.decode(someEncoding); // encode an instance of A class A a2 = new A(); a2.version = 5; a2.isExtendable = true; byte enc[] = asn1.encode(a);
[1] Java API Specification,
[2] Abstract Syntax Notation One (ASN.1) Specification of Basic Notation ITU-T Rec. X.680 (2002) | ISO/IEC 8824-1:2002
[3] Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER) ITU-T Rec. X.690 (2002) | ISO/IEC 8825-1:2002
[4] ASN.1 Information Site,
[5] A Layman's Guide to a Subset of ASN.1, BER, and DER,
[6] Olivier Dubuisson, translated by Philippe Fouquart, ASN.1 - Communication between heterogeneous systems,
[7] Professor John Larmouth, ASN.1 Complete,
[8] The Internet Engineering Task Force, Requests for Comments,
* Other brands and names are the property of their respective owners. | http://harmony.apache.org/subcomponents/classlibrary/asn1_framework.html | crawl-002 | refinedweb | 2,583 | 50.94 |
What is __main__.py?
Often, a Python program is run by naming a .py file on the command line:
$ python my_program.py
You can also create a directory or zipfile full of code, and include a
__main__.py. Then you can simply name the directory or zipfile on the command line, and it executes the
__main__.py automatically:
$ python my_program_dir$ python my_program.zip# Or, if the program is accessible as a module$ python -m my_program
You'll have to decide for yourself whether your application could benefit from being executed like this.
Note that a
__main__ module usually doesn't come from a
__main__.py file. It can, but it usually doesn't. When you run a script like
python my_program.py, the script will run as the
__main__ module instead of the
my_program module. This also happens for modules run as
python -m my_module, or in several other ways.
If you saw the name
__main__ in an error message, that doesn't necessarily mean you should be looking for a
__main__.py file.
What is the
__main__.py file for?
When creating a Python module, it is common to make the module execute some functionality (usually contained in a
main function) when run as the entry point of the program. This is typically done with the following common idiom placed at the bottom of most Python files:
if __name__ == '__main__': # execute only if run as the entry point into the program main()
You can get the same semantics for a Python package with
__main__.py, which might have the following structure:
.└── demo ├── __init__.py └── __main__.py
To see this, paste the below into a Python 3 shell:
from pathlib import Pathdemo = Path.cwd() / 'demo'demo.mkdir()(demo / '__init__.py').write_text("""print('demo/__init__.py executed')def main(): print('main() executed')""")(demo / '__main__.py').write_text("""print('demo/__main__.py executed')from demo import mainmain()""")
We can treat demo as a package and actually import it, which executes the top-level code in the
__init__.py (but not the
main function):
import demodemo/__init__.py executed
When we use the package as the entry point to the program, we perform the code in the
__main__.py, which imports the
__init__.py first:
$ python -m demodemo/__init__.py executeddemo/__main__.py executedmain() executed
You can derive this from the documentation. The documentation says:
__main__— Top-level script environment
'__main__'is the name of the scope in which top-level code executes.A module’s
__name__is set equal to
'__main__'when read from standardinput, a script, or from an interactive prompt.
A module can discover whether or not it is running in the main scopeby checking its own
__name__, which allows a common idiom forconditionally executing code in a module when it is run as a script orwith
python -mbut not when it is imported:
if __name__ == '__main__': # execute only if run as a script main()
For a package, the same effect can be achieved by including a
__main__.pymodule, the contents of which will be executed when the module is run with
-m.
Zipped
You can also zip up this directory, including the
__main__.py, into a single file and run it from the command line like this - but note that zipped packages can't execute sub-packages or submodules as the entry point:
from pathlib import Pathdemo = Path.cwd() / 'demo2'demo.mkdir()(demo / '__init__.py').write_text("""print('demo2/__init__.py executed')def main(): print('main() executed')""")(demo / '__main__.py').write_text("""print('demo2/__main__.py executed')from __init__ import mainmain()""")
Note the subtle change - we are importing
main from
__init__ instead of
demo2 - this zipped directory is not being treated as a package, but as a directory of scripts. So it must be used without the
-m flag.
Particularly relevant to the question -
zipapp causes the zipped directory to execute the
__main__.py by default - and it is executed first, before
__init__.py:
$ python -m zipapp demo2 -o demo2zip$ python demo2zipdemo2/__main__.py executeddemo2/__init__.py executedmain() executed
Note again, this zipped directory is not a package - you cannot import it either.
__main__.py is used for python programs in zip files. The
__main__.py file will be executed when the zip file in run. For example, if the zip file was as such:
test.zip __main__.py
and the contents of
__main__.py was
import sysprint "hello %s" % sys.argv[1]
Then if we were to run
python test.zip world we would get
hello world out.
So the
__main__.py file run when python is called on a zip file. | https://codehunter.cc/a/python/what-is-main-py | CC-MAIN-2022-21 | refinedweb | 760 | 57.37 |
Given the following program, which statements are guaranteed to be true?
public class ThreadedPrint {
static Thread makeThread(final String id, boolean daemon) {
Thread t = new Thread(id) {
public void run() {
System.out.println(id);
}
};
t.setDaemon(daemon);
t.start();
return t;
}
public static void main(String[] args) {
Thread a = makeThread("A", false);
Thread b = makeThread("B", true);
System.out.print("End\n");
}
}
Select the two correct answers.
The letter A is always printed.
The letter B is always printed.
The letter A is never printed after End.
The letter B is never printed after End.
The program might print B, End and A, in that order.
Which statement is true?
Select the one correct answer.
No two threads can concurrently execute synchronized methods on the same object.
Methods declared synchronized should not be recursive, since the object lock will not allow new invocations of the method.
Synchronized methods can only call other synchronized methods directly.
Inside a synchronized method, one can assume that no other threads are currently executing any other methods in the same class.
Given the following program, which statement is true?
public class MyClass extends Thread {
static Object lock1 = new Object();
static Object lock2 = new Object();
static volatile int i1, i2, j1, j2, k1, k2;
public void run() { while (true) { doit(); check(); } }
void doit() {
synchronized(lock1) { i1++; }
j1++;
synchronized(lock2) { k1++; k2++; }
j2++;
synchronized(lock1) { i2++; }
}
void check() {
if (i1 != i2) System.out.println("i");
if (j1 != j2) System.out.println("j");
if (k1 != k2) System.out.println("k");
}
public static void main(String[] args) {
new MyClass().start();
new MyClass().start();
}
}
The program will fail to compile.
One cannot be certain whether any of the letters i, j, and k will be printed during execution.
One can be certain that none of the letters i, j, and k will ever be printed during execution.
One can be certain that the letters i and k will never be printed during execution.
One can be certain that the letter k will never be printed during execution. | http://etutorials.org/cert/java+certification/Chapter+9.+Threads/Review+Questions_nradp/ | CC-MAIN-2020-16 | refinedweb | 337 | 59.5 |
Say you're demonstrating a compiler at a conference. What's the best way to do it?
Should you just type in code in the code window? Doing this, you're relying on the audience's imagination -- that they form a mental picture of how the program will behave. You're also relying on their trust that your code really does what you say it does.
Or should you execute your code every minute or so, so the program's output window pops up and the audience can see that the code really works? Here it's risky because each time you switch it breaks the flow. And you're relying on the audience to remember what the code each time they look at the output.
I think this is one of those problems that can be solved by technology! I wrote small plugin for Visual Studio 2008. It looks at what the current text buffer contains, compiles it in the background, and displays the output in a topmost window. It does this every two seconds or so. You don't even need to save or recompile to see the output. It only makes sense for standalone console programs that don't take input. Here's a screenshot:
The source code is small and straightforward, and available for download at the link above.
There were two "gotcha" moments. The first was to do with multi-threading. I wanted the source code to be compiled in a background thread so it wouldn't interfere with the Visual Studio UI. But to grab the text of the current buffer you have to be in the UI thread, and also to display the output you have to be in the UI thread. I used a System.Timers.Timer, which fires its events in the background thread, and called form.Invoke(...) for any tasks that needed the UI thread.
I also used a "non-AutoReset" timer. I wanted it to get the source code and compile+run+display it, then pause for two seconds, then get the source code and compile+run+display it, then pause for two seconds, and so on. In other words the timer interval has to be two seconds after the end of handling the previous timer event.
''' <summary>
''' OnTimer handles the non-autoreset timer signal. It runs in a background thread. It gets the source
''' code from the current buffer, and compiles it, and displays the output.
''' </summary>
''' <remarks></remarks>
Sub OnTimer() Handles t.Elapsed
Try
Dim oldsrc = src
' We're in a background thread. But the source can only be obtained from the UI thread...
' This delegate will get the source and store it in the "src" field
f.Invoke(New Action(AddressOf GetSource))
If src <> oldsrc Then
Dim oldoutput = output
' We want to compile-and-run in the background thread
output = CompileAndRun(src)
If output <> "" OrElse oldoutput = "" Then
' Displaying the output on-screen must be done in the UI thread.
' This delegate gets the content of the "output" field and displays it
f.Invoke(New Action(AddressOf ShowOutput))
End If
End If
Finally
t.Start()
End Try
End Sub
The other "gotcha" moment had to do with how to execute the code and capture its output. VB has very nice helper functions surrounding this, in the "My" namespace. My main concern was to recover from exceptions gracefully without leaving any mess. (Note: the code for getting a temporary filename isn't quite correct: the mere fact that you got a temporary unused filename one statement ago does not mean that the filename will still be unused; nor does it mean that the filename with ".vb" appended to it will be unused. But doing it more correctly didn't seem worth the bother; in any case, the exception handling means we'll recover okay from problems.)
Function CompileAndRun(ByVal src As String) As String
Dim fn_exe = ""
Dim fn_src = ""
Dim vbc As System.Diagnostics.Process = Nothing
Dim exe As System.Diagnostics.Process = Nothing
' Prepare for compilation
fn_src = My.Computer.FileSystem.GetTempFileName() & ".vb"
My.Computer.FileSystem.WriteAllText(fn_src, src, False)
fn_exe = My.Computer.FileSystem.GetTempFileName() & ".exe"
Dim framework = Environment.ExpandEnvironmentVariables("%windir%\Microsoft.Net\Framework")
Dim latest_framework = (From d In My.Computer.FileSystem.GetDirectories(framework) Where d Like "*\v*" Select d).Last
' Compile it
vbc = System.Diagnostics.Process.Start(New ProcessStartInfo _
With {.CreateNoWindow = True, _
.UseShellExecute = False, _
.FileName = latest_framework & "\vbc.exe", _
.Arguments = String.Format("/out:""{0}"" /target:exe ""{1}""", fn_exe, fn_src)})
Dim vbc_done = vbc.WaitForExit(3000)
If Not vbc_done Then Return ""
If vbc.ExitCode <> 0 Then Return ""
' Execute it
Dim pinfo = New ProcessStartInfo With {.CreateNoWindow = True, _
.UseShellExecute = False, _
.FileName = fn_exe, _
.RedirectStandardOutput = True}
exe = New System.Diagnostics.Process With {.StartInfo = pinfo}
exe.Start()
Dim output = exe.StandardOutput.ReadToEnd
Dim exe_done = exe.WaitForExit(3000)
If Not exe_done Then Return ""
Return output
' Close the VBC process as neatly as we can
If vbc IsNot Nothing Then
If Not vbc.HasExited Then
Try : vbc.Kill() : Catch ex As Exception : End Try
Try : vbc.WaitForExit() : Catch ex As Exception : End Try
Try : vbc.Close() : Catch ex As Exception : End Try
vbc = Nothing
' Close the EXE as neatly as we can
If exe IsNot Nothing Then
If Not exe.HasExited Then
Try : exe.Kill() : Catch ex As Exception : End Try
Try : exe.WaitForExit() : Catch ex As Exception : End Try
Try : exe.Close() : Catch ex As Exception : End Try
exe = Nothing
' Delete leftover files
Try : My.Computer.FileSystem.DeleteFile(fn_exe) : Catch ex As Exception : End Try
Try : My.Computer.FileSystem.DeleteFile(fn_src) : Catch ex As Exception : End Try
End Function
As always, I love to hear suggestions and bugfixes and code improvements and comments!
Nice idea, but it would be even cooler if you used a MSUnit project type and displayed the test results (and Console if you had to). It would encourage folks to write unit tests.
I prefer using MSUnit (or any xUnit framework) over console projects to demo code. | http://blogs.msdn.com/lucian/archive/2008/10/16/liverun-a-vs-plugin-to-see-the-output-of-our-program-immediately.aspx | crawl-002 | refinedweb | 990 | 68.16 |
#include <coherence/net/cache/SimpleCacheStatistics.hpp>
Inherits Object, and CacheStatistics.
List of all members.
A cache hit is a read operation invocation (i.e. get()) for which an entry exists in this map.
A cache miss is a get() invocation that does not have an entry in this map.
For the LocalCache implementation, this refers to the number of times that the prune() method is executed.
prune()
For the LocalCache implementation, this refers to the time spent in the prune() method.);
[virtual]
Register a cache hit.
Register a multiple cache hit.
Register a cache miss.
Register a multiple cache miss.
Register a cache put.
Register a multiple cache put.
Register a cache prune. | http://docs.oracle.com/cd/E15357_01/coh.360/e18813/classcoherence_1_1net_1_1cache_1_1_simple_cache_statistics.html | CC-MAIN-2014-10 | refinedweb | 113 | 63.66 |
So I am here with my new Contactless Switching Mechanism that can almost applicable in the real world scenario. Unlike mechanical switches you don't need to apply pressure on switches, they extremely contactless. So it is highly usable in the world which faces COVID - 19 pandemics. So this mechanism can be used in public places to avoid contact between peoples which avoid the possibility of spread in the community.
Rather than a simple contactless switching mechanism. It has different two different modes of switching capability. They are
- Toggle Mode
- Push-button Mode
Let's see the Demo video
This contactless switching mechanism can be used anywhere
- as Nurse call button
- as proximity switches
The possibilities are infinite and that depends upon the user's need.
In this project, I made a switchboard with this mechanism. The user didn't need to change the mode, the switching device automatically changes its mode in accordance with user interactions. Apart from this,switchboard can monitor the energy consumption of the gadget connected to this device,and it will be shown on your mobile. By its capability, the switching can be done on this device only by the infrared rays emitted by the human body. So any other body emitting the infrared rays can't trigger the switches.Hardware
- KEMET’s Pyroelectric Infrared Sensor(SS-430):
The most important part of the switching device is Kemet SS-430. This sensor is actually triggering the switch,when we fingered in to the switch board. It works by using the pyroelectric effect of ceramic by absorbing infrared rays emitted from the human body.
For working with this I have removed the connector pads because i don't have JST-Connectors.
For connecting and soldering,i have used 30AWG wires and mustool's iron. I have soldered the wires in the 300 degree Celsius temperature. That temperature won't damage the IC's in the sensor board. We need only three wires from SS-430, that are
Vin - Pin No.1 (Input Voltage)
Vout - Pin No.4(Comparator output)
GND - Pin No.5(Ground)
The other pins are not used. Also be careful while soldering the wires.
- ACS712 Current Sensor Module:
Here AC current is measured by using ACS712. It is a Hall Effect current sensor that accurately measures current when induced. The magnetic field around the AC wire is detected which gives the equivalent analog output voltage. The analog voltage output is then processed by the microcontroller to measure the current flow through the load. To know more about this sensor check out here . It is a current sensor, so it is connected in series with the load. Here i am using ACS712 with 5A current range. It is available in different ranges.
- Relay:
A relay is a switching device as it works to isolate or change the state of an electric circuit from one state to another. It is used to switch the High load with 3v input from micocontroller.
- NodeMCU:
NodeMCU is a low-cost open source IOT platform. It initially included firmware which runs on the ESP8266 WiFi SoC from Espressif Systems, and hardware which was based on the ESP-12 module.
In this project, NodeMCU forms the brain of the device. All the data are processed here and further events are triggered by this microcontroller unit. Sensors and relay are connected with this Microcontroller. It should be connected to a wifi to share the data and the wifi has proper internet access.
- 5V 1A Power Supply:
I have used the 5V 1A power supply to power up the NodeMCU. I have taken it from my mobile charger. It is easily available at local stores.Software & Design:
- Arduino IDE :
The code is developed in C and is uploaded using Arduino IDE. For interfacing Nodmcu with Arduino IDE just go here.
- Design:
For testing the SS-430, connect the sensor to the nodmcu. The comparator output of sensor is connected to the D1(GPIO5) of MCU,GND to GND and 3V to Vin. Upload this test code in to MCU.
int sensorPin=5;
void setup() {
pinMode(sensorPin,INPUT);
Serial.begin(9600);
}
void loop() {
int value=digitalRead(sensorPin);
Serial.println(value);
}
After the code uploaded. When you open the Serial monitor in Arduino IDE(make sure that the baud rate is 9600) as you can see like this.
If we move hands in front of the sensor, it will show like this
In this way we can easily check whether the sensor is working or not.
For this switch board we need to reduce the angle of detection(for proper working) so we are adding white lens at top of the sensor(as you can see below). So the angle is reduced, but the distance of detection is increased.
This can be avoided by making a Resin like case for the switch board. Here i bought a switch board from the local store,for this project. In this board i am replacing the mechanical switches with contact less one.
I have only one SS-430 with me, so i placed at the left side of the box.
The other side is just covered by the plastic sheet.
Let's get in to technical aspects of sensor.
When the hand approaches the embedded sensor, the signal from the sensor is 2 square waves of 200 msec each. When the IR presence is removed from the viewing area, then a second set of square waves can be detected.
So our code should be framed by remembering this technical aspects. Then only we get desired results. This is the basic code of switching mechanism with relay
unsigned long PyroRead = 0;
int Pyro=5; // D1 of MCU
unsigned long IR_threshold = 200000;
int state=1; //Defining state of the device
int IR_sensed = 0;
int relay=16; //D0 of MCU
void setup() {
pinMode (relay, OUTPUT);
pinMode (Pyro,INPUT);
Serial.begin(9600);
}
void loop() {
while ((IR_sensed < 2))
{
PyroRead = pulseIn(Pyro, HIGH);
if(PyroRead > IR_threshold)
{
IR_sensed++;
}
}
digitalWrite(relay,state);
if(state==1)
{
Serial.println("HIGH");
}
if(state==0)
{
Serial.println("LOW");
}
state=1-state;
PyroRead = 0;
IR_sensed = 0;
delay(1000);
}
As soon as the program starts, i have given the threshold value as 200ms as per the specs. When the data coming from the sesnor is greater than this value, it will mark that as good trigger(that is IR_sensed becomes 1). When we get two good triggers from the sensor(when we introduce our hand in to the box), the program exits the while loop and make the relay ON. Then we need to change the state, by this piece of code. Then this process is repeated.
state=1-state;
Then all the variables are made zero and it will look for another triggers with a delay of one second. This code is enough for working in two modes.
Here i connected the SS-430 with the digital pin of MCU because the NodMCU only contains one analog pin. That is being used by the current sensor.
- ACS712 Sensor & SS-430 With Blynk:
The energy is monitored by the current sensor. I have used his techniques to calculate the energy consumption of the load connected. The sensor is connected to A0 of NodmMCU. This is the code used for calculating Rate.
int Sensor_Pin = A0;
unsigned int Sensitivity = 185; // 185mV/A for 5A, 100 mV/A for 20A and 66mV/A for 30A Module
float Vpp = 0; //peak to peak voltage
float Vrms = 0; // rms voltage
float Irms = 0; // rms current
float Supply_Voltage = 230.0;// As of your household supply
float Vcc = 3.0; // ADC reference voltage // voltage at 3V pin of MCU
float power = 0; // power in watt
unsigned long last_time =0;
unsigned long current_time =0;
unsigned int calibration = 100;
unsigned int pF = 85;//power factor
float Wh =0 ;
float bill_amount = 0;
unsigned int energyTariff = 5.0;//As per the rate of your country
void setup() {
pinMode(Sensor_Pin,INPUT);//sensor is connected to A0
Serial.begin(9600);
}
void loop() {
timer.run();
Vpp = getVPP();
Vrms = (Vpp/2.0) *0.707;
Vrms = Vrms - (calibration / 10000.0);
Irms = (Vrms * 1000)/Sensitivity ;
if((Irms > -0.015) && (Irms < 0.008)){ // remove low end chatter
Irms = 0.0;
}
power= (Supply_Voltage * Irms) * (pF / 100.0);
Serial.println(power);
last_time = current_time;
current_time = millis();
Wh = Wh+ power *(( current_time -last_time) /3600000.0) ; //calculating energy in Watt-Hour
bill_amount = Wh*(energyTariff/1000);
Serial.println(bill_amount);
}
float getVPP()
{
float result;
int readValue;
int maxValue = 0;
int minValue = 1024;
uint32_t start_time = millis();
while((millis()-start_time) < 950)
//read every 0.95 Sec
{
readValue = analogRead(Sensor_Pin);
if (readValue > maxValue)
{
maxValue = readValue;
}
if (readValue < minValue)
{
minValue = readValue;
}
}
result = ((maxValue - minValue) * Vcc) / 1024.0;
return result;
}
The rate for that energy consumption is also shown in the Blynk application(for that device only). The current state of the device is also shown lively in the application.
Note:This code is not as much accurate.
Let's explore the Blynk app
Blynk is a Platform with IOS and Android apps to control Arduino, Raspberry Pi and the likes over the Internet. It’s a digital dashboard where you can build a graphic interface for your project by simply dragging and dropping widgets.
First download the Blynk app and signup in it. Then create a new project. Select the hadrware as Nodmcu. Give some proper name for the project. It's connection type is wifi. After creating the project the Auth Token will be sent to your mail id corresponding to the project. This Token should include in your code for working with the project. Please refer the screen shots below.
Add three widgets to the project.
1. Gauge display - for showing the bill amount
2. Labelled Value - for showing the state
3. Calibrate Slider - for calibrating
Assign the virtual pin and name as follows
Virtual Pin is a concept invented by Blynk Inc. to provide exchange of any data between hardware and Blynk mobile app. Virtual pins are different than Digital and Analog Input/Output (I/O) pins. They are physical pins on your microcontroller board where you connect sensors and actuators.
The final outlook will be like this.
We need to install the blynk libraries in the Arduino IDE for the proper communication with the NodMCU and the Blynk app. Just follow this tutorial to done it.
These are to be included in the code to work with blynk application
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
BlynkTimer timer;
#define BLYNK_PRINT Serial
char auth[] = "XXXXXXXXXXX";//Token send to email
char ssid[] = "Xxxxxx";// Hotspot password
char pass[] = "xxxxx";// password of the hotspot
This piece of code should be included in the void setup to start the blynk app
Blynk.begin(auth, ssid, pass);
This should be included in the void loop to run the blynk app
Blynk.run();
virtualWrite is a function in blynk. By using the function we can easily update the value in the code to the blynk app. Here we are updating the variable bill_amount with the code
Blynk.virtualWrite(V1, bill_amount);
Updating the state of the device by
Blynk.virtualWrite(V2,"ON");
OR
Blynk.virtualWrite(V2,"OFF") ;
for calibrating the slider we will use this function
BLYNK_WRITE(V4) { // calibration slider
calibration = param.asInt();}
That's all about the Blynk app. Full code is given in the github repo. So upload that code in to the NodMCU and run the blynk app. Just go here to get more information about Blynk.Circuit:
Connect the components as per the schematics given below. I have used jumpers and copper wires for the connection. Here as a load i connected a bulb. Any device can be connected,that's up to you.
So i enclose my circuit in that switch board as shown below.
So i made holes for giving 230v and load connection.
The final version......
When we introduce the hand in the switchboard, the Kemet sensor detects the motion and it switches the bulb,via the relay. The state of the device is instantly streamed to the Blynk application through Nodmcu over wifi. When the device becomes off, the rate of energy consumption is calculated for that time period when the load being driven and is shown in the Blynk app. There is a slider in the Blynk app for calibrating the energy consumption,for the user.
The Rate for the energy consumed for that load in the Blynk app is shown below.
By incorporating more Kemet sensors,in the future we are increasing the mode capability of switching. In addition to Toggle and Push-button mode we are adding some extra modes. They are
- Selector Mode: It has some sort to select one of two or more positions(rotary mode)
- Joystick Mode: This mode is actuated to freely moving in more than one axis of motion. | https://www.hackster.io/coderscafe/contactless-switching-mechanism-csm-9aac29 | CC-MAIN-2021-04 | refinedweb | 2,119 | 66.33 |
Devel::MAT::Tool - extend the ability of
Devel::MAT
The
Devel::MAT::Tool:: namespace provides a place to store plugins that extend the abilities of Devel::MAT.
Such tools can be used to provide extra analysis or display capabilities on the UI.
It can interact with the UI by calling methods in the Devel::MAT::UI package.
A tool should be placed in the namespace and provide an object class. It does not need to inherit from anything specific. Tools will be constructed lazily by the UI as requested by the user.
The following methods should provided on a tool class.
$display = CLASS->FOR_UI
If the tool should be displayed on the UI's
Tools menu, this constant method should be provided to return a true value.
$cname = CLASS->CMD
If the tool provides a named command for the commandline, this constant method should be provided to return its name.
$load = CLASS->AUTOLOAD_TOOL( $pmat )
If the tool should be automatically loaded for the given file, this method should be provided to return a true value. This might be useful to provide extra analysis if the tool detects it can provide something useful; for example when the tool peeks inside objects of specific classes, and those classes are found in the file.
$tool = CLASS->new( $pmat, %args )
Constructs the instance of the tool. If the tool does not need to store any instance data, this may instead simply return the class name.
This will be passed the Devel::MAT object itself, and additional arguments as named parameters.
If provided, the tool should call this function occasionally if it has to perform a long-running task, such as a calculation across the entire heap, that may take some time. The function should be passed a status string to indicate progress on the UI; the UI will display it and flush pending input events to ensure the interface remains moderately responsive to user input.
$tool->init_ui( $ui )
Asks the tool to initialise any UI elements it may require, by calling methods on the given
$ui. This may be an object, or the package name
Devel::MAT::UI directly.
Tools may, and are encouraged to where appropriate, add methods to the
Devel::MAT::SV package to access results of analysis or perform other related activities. All SVs are implemented as blessed HASH references, and tools may use keys beginning
tool_... in it. Key and method names should be namespaced appropriately according to the tool name, to avoid collisions.
Paul Evans <leonerd@leonerd.org.uk> | http://search.cpan.org/~pevans/Devel-MAT-0.24/lib/Devel/MAT/Tool.pod | CC-MAIN-2016-44 | refinedweb | 420 | 61.67 |
Red-Black Tree | Set 3 (Delete)
We have discussed following topics on Red-Black tree in previous posts. We strongly recommend to refer following post as prerequisite of this post.
Red-Black Tree Introduction
Red Black Tree Insert
Insertion Vs Deletion:
Like Insertion, recoloring and rotations are used to maintain the Red-Black properties.
In insert operation, we check color of uncle to decide the appropriate case. In delete operation, we check color of sibling to decide the appropriate case.
The main property that violates after insertion is two consecutive reds. In delete, the main violated property is, change of black height in subtrees as deletion of a black node may cause reduced black height in one root to leaf path.
Deletion is fairly complex process. To understand deletion, notion of double black is used. When a black node is deleted and replaced by a black child, the child is marked as double black. The main task now becomes to convert this double black to single black.
Deletion Steps
Following are detailed steps for deletion.
1) Perform standard BST delete. When we perform standard delete operation in BST, we always end up deleting a node which is either leaf or has only one child (For an internal node, we copy the successor and then recursively call delete for successor, successor is always a leaf node or a node with one child). So we only need to handle cases where a node is leaf or has one child. Let v be the node to be deleted and u be the child that replaces v (Note that u is NULL when v is a leaf and color of NULL is considered as Black).
2) Simple Case: If either u or v is red, we mark the replaced child as black (No change in black height). as black. So the deletion of a black leaf also causes a double black.
3.2) Do following while the current node u is double black and it is not root. Let sibling of node be s.
….(a): If sibling s is black and at least one of sibling’s children is red, perform rotation(s). Let the red child of s be r. This case can be divided in four subcases depending upon positions of s and r.
…………..(i) Left Left Case (s is left child of its parent and r is left child of s or both children of s are red). This is mirror of right right case shown in below diagram.
…………..(ii) Left Right Case (s is left child of its parent and r is right child). This is mirror of right left case shown in below diagram.
…………..(iii) Right Right Case (s is right child of its parent and r is right child of s or both children of s are red)
…………..(iv) Right Left Case (s is right child of its parent and r is left child of s)
…..(b): If sibling is black and its both children are black, perform recoloring, and recur for the parent if parent is black.
In this case, if parent was red, then we didn’t need to recur for prent, we can simply make it black (red + double black = single black)
…..(c): If sibling is red, perform a rotation to move old sibling up, recolor the old sibling and parent. The new sibling is always black (See the below diagram). This mainly converts the tree to black sibling case (by rotation) and leads to case (a) or (b). This case can be divided in two subcases.
…………..(i) Left Case (s is left child of its parent). This is mirror of right right case shown in below diagram. We right rotate the parent p.
…………..(iii) Right Case (s is right child of its parent). We left rotate the parent p.
3.3) If u is root, make it single black and return (Black height of complete tree reduces by 1).
below is the C++ implementation of above approach:
Output:
Inorder: 2 3 6 7 8 10 11 13 18 22 26 Level order: 10 7 18 3 8 11 22 2 6 13 26 Deleting 18, 11, 3, 10, 22 Inorder: 2 6 7 8 13 26 Level order: 13 7 26 6 8 2:
- Delete Operation in B-Tree
- K Dimensional Tree | Set 3 (Delete)
- Splay Tree | Set 3 (Delete)
- Trie | (Delete)
- Overview of Data Structures | Set 3 (Graph, Trie, Segment Tree and Suffix Tree)
- Check if a given Binary Tree is height balanced like a Red-Black Tree
- Implementation of Binomial Heap | Set - 2 (delete() and decreseKey())
- Treap | Set 2 (Implementation of Search, Insert and Delete)
- Tournament Tree (Winner Tree) and Binary Heap
- Two Dimensional Binary Indexed Tree or Fenwick Tree
- Efficiently design Insert, Delete and Median queries on a set
- Binary Indexed Tree or Fenwick Tree
- Order statistic tree using fenwick tree (BIT)
- Design a data structure that supports insert, delete, search and getRandom in constant time
- Red Black Tree vs AVL Tree
Improved By : shwetanknaveen, BhanuPratapSinghRathore | https://www.geeksforgeeks.org/red-black-tree-set-3-delete-2/ | CC-MAIN-2019-43 | refinedweb | 835 | 68.5 |
remove - remove files
#include <stdio.h> int remove(const char *path);
The remove() function causes the file named by the pathname pointed to by path to be no longer accessible by that name. A subsequent attempt to open that file using that name will fail, unless it is created anew.
If path does not name a directory, remove(path) is equivalent to unlink(path).
If path names a directory, remove(path) is equivalent to rmdir(path).
Refer to rmdir() or unlink().
Refer to rmdir() or unlink().
None.
None.
None.
rmdir(), unlink(), <stdio.h>.
Derived from the POSIX.1-1988 standard and ANSI C standard | http://pubs.opengroup.org/onlinepubs/7990989775/xsh/remove.html | CC-MAIN-2014-15 | refinedweb | 104 | 70.29 |
#include <iostream>
using namespace std;
class MyClass {
int x;
public:
MyClass (int val) : x(val) {
cout << "constructed :" << this << endl;
}
int& get() {
cout << "x is : " << x << endl ;
return x;
}
};
int main () {
MyClass foo = {10};
foo.get() = 20;
foo.get();
foo = 30;
cout << &foo << endl;
foo.get();
}
constructed :0x7fffc44ef920
x is : 10
x is : 20
constructed :0x7fffc44ef924
0x7fffc44ef920
x is : 30
foo.get() = 20
foo = 30
0x7fffc44ef924
cout << &foo << endl;
0x7fffc44ef920
0x7fffc44ef924
Why is this foo.get() = 20 a legitimate way of changing the value of 'x' in the object foo?
Because you're returning a reference to x and that's how references behave. In fact, the only reason I know of to return a reference from a function (
int &get()) is to allow this behaviour. You might do this, for example, if you were implementing operator[].
Sometimes you want to return a const reference (
const int &foo()) in order to avoid a copying the value, but you'd only do that with a class or struct.
Also why is this foo = 30 constructing a new object at the address 0x7fffc44ef924 ? What is this object type?
Because MyClass has a constructor that takes one
int argument, the compiler interprets this as a way to convert an int to a MyClass, which is what is happening here. It's equivalent to
foo = MyCLass(int) If you don't want this behaviour, you can declare MyClass(int) as explicit:
explicit MyClass( int val ) {...
Also why is this foo = 30 constructing a new object at the address 0x7fffc44ef924 ? What is this object type?
Also why does this: cout << &foo << endl; print the address of the original MyClass foo object instantiated at the beginning of the main function (at address 0x7fffc44ef920)?
First, the implicit MyClass(30) I described above is used to construct a new MyClass object. The address of this object happens to have the address 0x7fffc44ef924 then the new object is copied into the old object, at 0x7fffc44ef920. Probably if you had optimization turned on you would only see one address, since the compiler would see that creating a whole new object and then copying it is a wast of CPU cycles.
How do you reference the 'new' foo at the address 0x7fffc44ef924?
You can't, that object was created and destroyed in one line of code. Once it was copied over the original object like I described above, it was deleted. | https://codedump.io/share/JwdXCU7kTkHh/1/why-is-this-function-in-a-class-initializing-a-member-value-with-this-strange-call | CC-MAIN-2021-21 | refinedweb | 399 | 71.44 |
Please follow these coding standards when writing code for inclusion in Django.
Please conform to the indentation style dictated in the
.editorconfig
file.
file.
Avoid use of “we” in comments, e.g. “Loop over” rather than “We loop over”.
Use underscores, not camelCase, for variable, function and method names
(i.e.
poll.get_unique_voters(), not
poll.getUniqueVoters()).
Use
InitialCaps for.
In test docstrings, state the expected behavior that each test demonstrates. Don’t include preambles such as “Tests that” or “Ensures that”.
Reserve ticket references for obscure issues where the ticket has additional details that can’t be easily described in docstrings or comments. Include the ticket number at the end of a sentence like this:
def test_foo(): """ A test docstring looks like this (#123456). """ ...
Use isort to automate import sorting using the guidelines below.
Quick start:
$ python -m pip install isort $ isort -rc .
This runs
isort rec module
statements before
from module import objects in each section. Use absolute
imports for other Django components and relative imports for local components.
On each line, alphabetize the items with the upper case items grouped before the lowercase yaml except ImportError: yaml = None CONSTANT = 'foo' class Example: # ...
Use convenience imports whenever available. For example, do this:
from django.views import View
instead of:
from django.views.generic.base import View
In Django template code, put one (and only one) space between the curly brackets and the tag contents.
Do this:
{{ foo }}
Don’t do this:
{{foo}}
In Django views, the first parameter in a view function should be called
request.
Do this:
def my_view(request, foo): # ...
Don’t do this:
def my_view(req, foo): # ... Meta should)
The order of model inner classes and standard methods should be as follows (noting that these are not all required):
class Meta
def __str__()
def save()
def get_absolute_url()
If
choices is defined for a given model field, define each choice as a
list of tuples, with an all-uppercase name as a class attribute on the model.
Example:
class MyModel(models.Model): DIRECTION_UP = 'U' DIRECTION_DOWN = 'D' DIRECTION_CHOICES = [ (DIRECTION_UP, 'Up'), (DIRECTION_DOWN, 'Down'), ].
importstatements that are no longer used when you change code. flake8 will identify these imports for you. If an unused import needs to remain for backwards-compatibility, mark the end of with
# NOQAto silence the flake8 warning.
AUTHORSfile distributed with Django – not scattered throughout the codebase itself. Feel free to include a change to the
AUTHORSfile in your patch if you make more than a single trivial change.
For details about the JavaScript code style used by Django, see JavaScript. | https://django.readthedocs.io/en/latest/internals/contributing/writing-code/coding-style.html | CC-MAIN-2019-43 | refinedweb | 424 | 67.04 |
This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.
On 30 Jul 2000 at 14:35 (-0400), brent verner wrote: | | I built a working compiler from 20000727 cvs after applying A. Oliva's | libtool patch. Today I did a checkout to get the tree with the patch | already in it, and the compiler is not handling exceptions correctly. | I built both with the same config opts, is there some (add'l) step I | need to take to get the 20000730 tree to build a working compiler? ... more info, hoping it helps. the following builds a working compiler, where libtool-multi.patch is from cvs co -rgcc_ss_20000724 gcc cd gcc patch -p0 < ../libtool-multi.patch cd .. mkdir gcc-build cd gcc-build ../gcc/configure --prefix=/usr/local/opt --enable-libstdcxx-v3 \ --enable-threads=posix --enable-long-long \ --enable-cshadow-headers --enable-namespaces \ --disable-nls make bootstrap make check # one failure: testsuite/26_numerics/binary_closure.cc # moving right along, just to see... cd ../gcc mv libstdc++-v3 libstdc+-v3.works cvs co libstdc++-v3 cd ../gcc-build rm -rf i686-pc-linux/libstdc++-v3/* make make check # all tests with throw/catch fail cd ../gcc mv -f libstdc++-v3.works/configure libstdc++v3/ cd ../gcc-build rm -rf i686-pc-linux/libstdc++-v3/* make make check # all test pass ...so basically, the new configure script looks like it breaks (for me) whatever Alexanrdre Oliva's patch fixed :\ I did a diff on the two configure files, but the resulting file was 21000+ lines long, and I _really_ don't know enough about the configure/build magic to, so I'm useless at this point. hth. Brent -- Damon Brent Verner o _ _ _ Cracker Jack? Surprise Certified _o /\_ _ \\o (_)\__/o (_) brent@rcfile.org _< \_ _>(_) (_)/<_ \_| \ _|/' \/ brent@linux1.org (_)>(_) (_) (_) (_) (_)' _\o_ | http://gcc.gnu.org/ml/libstdc++/2000-07/msg00224.html | crawl-003 | refinedweb | 322 | 60.01 |
As in above, unable to resolve Component, ProperTypes, InfoBar components, etc..
I have installed the latest IntelliJ, and have run npm install hence node_modules contain all the react folder.
The project I am working is
I am suspecting require.js issue as
react.js contains
'use strict';
module.exports = require('./lib/React');
I have installed require.js plugin for Intellij but still the same issue.
How to make sure Intellij IDE understand
{Component, PropTypes}
Neither Component nor PropTypes modules are defined in node_modules/react/lib/React.js; they are defined in node_modules/react/lib/ReactIsomorphic.js and assigned to React module dynamically. WebStorm can't resolve dynamic references using static code analysis.
As a workaround you can try downloading react typescript stubs: Settings | Languages & Frameworks | JavaScript | Libraries, Download..., choose 'react' from the stubs list
This worked for Component and PropTypes, but not React is not found stating 'Default export is not declared in imported module'
Here is a workaround that I am using after installing the 'react' library.
I have the same isse. Tried the thing from @Elena and it didn't work. Anyone have any other ideas?
BTW I'm on IntelliJ Ultimate 2016.3.4 EAP (went to EAP hoping it was more friendly to React Native).
please vote for
Ah I see. Done. Hope they do that soon.
+1
By the way I've downloaded React as instructed, but to no effect. The problem persists.
`npm install @types/react --save`
After that it all worked for me :)
I'm still having the same issue with:
import React, { Component } from ‘react’;
WebStorm gives the following warning:
Cannot resolve symbol ‘Component’
what WebStorm and React versions do you use? Is react installed locally and listed in the project's package.json file?
WebStorm 2017.2.4
Build #WS-172.4155.35, built on September 11, 2017
Licensed to WebStorm Evaluator
Expiration date: November 17, 2017
JRE: 1.8.0_152-release-915-b11 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.11.6
Yes, react is installed locally and listed in package.json. Version 0.14.9
>Version 0.14.9
it is very age-old - current version is 16.0.0... see for explanation.
Installing typescript stubs (npm install @types/react --save) helps
"very age-old" is subjective. The version I'm using was released 6 months ago. From npm info:
'0.14.9': '2017-04-12T15:45:16.662Z',
So are you saying WebStorm will only work with the latest react version 16.0.0? It does not support a stable version released 6 months ago?
with more recent versions, it works out of the box. For your version, installing typings is required - see above
Tried updating to 16.x and it worked. Thanks
Hi,
I'm having the same issue in PHPStorm 2017.2.4.
Updating to React 16.0.0 didn't make a difference. Installing stubs in Javascript -> Libraries didn't change anything either.
Not sure if I need to create a separate issue in the PHPStorm community or keep the discussion here, please advise.
Thank you!
Adding typescript stubs via Preferences | Languages & Frameworks | JavaScript | Libraries doesn't always help to resolve module imports, you need to have the required modules right in your project (added via `npm install`). in your case I can clearly see that react modules are not in your project - they are installed, but excluded from indexing, thus they can't be resolved
This is what resolved the issue for me. I previously had the stubs installed using the ide and npm, however, neither resolved React.Component.
Hope the screenshot helps. | https://intellij-support.jetbrains.com/hc/en-us/community/posts/207725245-React-import-are-not-resolved-in-WebStrom-and-Intellij-2016-2?page=1 | CC-MAIN-2019-35 | refinedweb | 608 | 60.31 |
Building the Right Environment to Support AI, Machine Learning and Deep Learning
Watch→
At this point you may be thinking: "I thought this article was about mocks and stubs, but so far I've only seen stubs!" So it's time you have a look at mocks.
Up to this point, your tests can be considered "state-based" tests: you act upon your system under test, and then you check its state to make sure it matches your expectations. The first batch of tests checked the state of the newly instantiated presentation model to answer questions such as "Does it have references set to the appropriate objects?" or, "Does it have some properties set to some specific defaults?" The second batch of tests checked the state of the presentation model, more specifically the state of its VideosList property, to make sure the list gets populated properly after the presentation model has handled an event raised by the view. Stubs are the type of fake objects that help you with state-based testing. They are either filled with values to be read by the SUT to perform its duties, or the SUT sets their values, which the test then checks.
In other situations, state-based tests aren't possible, or aren't easy to write (for example, there may not be a state to check for). This type of situation comes up when the SUT has dependencies and you need to test the interaction of the SUT with those dependencies. In such cases, you can resort to interaction-based tests. Mocks are the type of fake objects that help you with interaction-based testing. They act much like spies, watching expectations set by the test on the mock, and then reporting these expectations back to the test.
In the sample application, the VideosListPresentationModel is responsible for showing its view when you call its ShowView method:
public void ShowView()
{
View.Show();
}
The ShowView method shows the view by sending a message to it; that is, it calls the view's Show method. The test for that behavior has to check for the interaction between the presentation model and its view. To write such a test using a static mock object, you need to write some code, so that whenever methods get called you flip a Boolean field to indicate that the message has been received. The test can then check the value of that field to see whether the expectation has been met.
Start by creating a static mock class that implements your IVideosListView interface:
public class MockView : IVideosListView
{
public bool ShowWasCalled;
public void Show()
{
ShowWasCalled = true;
}
// other members code elided
}
The important information there is that you define a Boolean ShowWasCalled property, which gets set to true by the Show method whenever that method gets called.
Your test class for that behavior looks pretty much like the ones you've created earlier in this article when you were using static stub classes, except that now you instantiate the MockView class, as opposed to the StubView class:
[TestClass]public class
VideosListPresentationModel_ViewDisplay_Tests
{
private static VideosListPresentationModel PM;
private static MockView View;
private static StubRepository Repository;
[ClassInitialize()]
public static void FixtureSetup(TestContext tc)
{
View = new MockView();
Repository = new StubRepository();
PM = new VideosListPresentationModel(View,
Repository);
}
}
The following snippet shows the test method for that expected behavior:
[TestMethod]
public void ShowView_should_display_the_view()
{
PM.ShowView();
Assert.IsTrue(View.ShowWasCalled);
}
Not much there: you act on the presentation model by calling its ShowView method, and you check the ShowWasCalled property on the "mock" View to make sure the message was sent to that object, thereby validating the interaction between the two objects.
So how would you write an interaction-based test using dynamic mocks?
You can rewrite the test to use dynamic fake objects (which means you can get rid of that MockView class you created in the previous section). The code snippet below highlights the main aspects of building a test class that uses dynamic fake objects:
private static VideosListPresentationModel PM;
private static IVideosListView View;
private static IVideoRepository Repository;
[ClassInitialize()]
public static void FixtureSetup(TestContext tc)
{
View = MockRepository.GenerateMock<IVideosListView>();
Repository = MockRepository.GenerateStub<IVideoRepository>();
PM = new VideosListPresentationModel(View, Repository);
}
Type both the View and Repository fields to their respective interfaces. The Repository field gets an instance of a stub generated by Rhino Mocks; whereas, the View field gets an instance of a mock generated by Rhino Mocks. I'll explain what the difference is between a stub and a mock shortly.
Here's how the test method should look now:
[TestMethod]
public void ShowView_should_display_the_view()
{
PM.ShowView();
View.AssertWasCalled(v => v.Show());
}
AssertWasCalled is another one of those nice extension methods exposed by the Rhino.Mocks namespace. You call that method on the View to assert that a given method was called on it; in this case, the Show method. That eliminates the need to create a separate class manually, create a Boolean field, and then set that field within the method you expected to be called! Rhino Mocks takes care of inspecting the object to make sure the expected method was called.
So what happens if you break the ShowView method, by removing the call to View.Show(). The test would then fail, and Rhino Mocks would give you the following error message:
TestCase
'VideosListPresentationModel_ViewDisplay_Tests.
ShowView_should_display_the_view' failed:
Rhino.Mocks.Exceptions.ExpectationViolation
Exception: IVideosListView.Show();
Expected #1, Actual #0.
In other words, the test failed because you expected one call to IVideosListView.Show(), but didn't get any.
So what's the difference between the GenerateMock and GenerateStub methods? The dynamic objects created by both methods are very similar. The main difference is that mock objects can cause a test to fail when expectations set on it aren't met. A stub, on the other hand, won't cause a test to fail if expectations set on it aren't met.
You can learn more about these subtle differences reading the documentation on Rhino Mocks. Also make sure to read Martin Fowler's "Mocks Aren't Stubs" article.
Dynamic fake objects are not silver bullets. They certainly help in many scenarios, but may not be very helpful in others. Sometimes, configuring the dynamic mock is so hard and/or complex that it's better to just create a simple static fake object for it. It's up to the developer to analyze the situation and decide which technique will produce a test that is easier to write, understand, and maintain.
Also, there are situations where a mock framework may have limitations that can rule out its use. For example, Rhino Mock can mock only virtual members, and it cannot mock sealed classes. Many developers would argue that members should always be virtual, and mocking sealed classes shouldn't be necessary if classes have been designed properly—but you may be in a situation where you just can't afford the time or money to make changes to your design to make your classes more testable.
TypeMock (the commercial framework mentioned earlier), on the other hand, can mock pretty much everything: sealed classes, private and non-virtual members, etc. That's definitely useful when you're writing tests for a legacy code base that wasn't designed with testability in mind, and when fixing the design and implementation is out of question, but it may also spoil you, and lead you to write sloppy code.
I really don't want to dive into that discussion because a lot has already been said about it on the web. I'll leave it up to readers to research. I just wanted to briefly mention these things so you are aware of their existence.
This article covered the isolation of dependencies when writing unit tests by using fake objects. By isolating those dependencies you end up with unit tests that become more informative in case things go wrong, because you're more likely to be tracking a bug in your SUT, as opposed to tracking a bug that may stem from the SUT's dependencies. Fake objects also help the unit test to become solely a "unit" test, causing tests to run faster and be independent of outside resources such as files on disk, databases, web services, etc.
Mock frameworks help you keep your code base clean, eliminating the need to create and maintain extra individual classes for static fake objects.
You've seen some basic scenarios, the main differences between static and dynamic fake objects, as well as state-based and interaction-based tests. You've also covered a little of how to use Rhino Mocks for dynamic fake objects. To be fair, Rhino Mocks deserves an entire article that would show how to leverage the framework when writing tests for more complex behaviors.
I recommend these resources as a starting point for digging more deeply into writing unit tests using mocks and stubs to isolate SUT. | http://www.devx.com/codemag/Article/42148/0/page/5 | CC-MAIN-2020-05 | refinedweb | 1,474 | 58.21 |
Post your Comment
Create Shape in Excel Using JSP
create shape in excel using jsp
...; and
then after we create a shape. At excel sheet e.g. we are creating line in this
example. To create shape we use setShapeType() in this method we are passing
Drawing a Shape in Excel Sheet
Drawing a Shape in Excel Sheet
In this section, you will learn how to draw a shape in excel sheets using
Apache POI library.
Using Apache POI, you can draw...;
Secondly, for positioning the shape on the excel sheet , create an
anchor.
Use
JSP TO EXCEL
JSP TO EXCEL Hi sir/mam,
How to import data to excel using jsp without retrieving database.
friend,
you can't import excel data into the middle of an HTML pages (your JSP will result in an HTML page
update excel sheet using jsp::
update excel sheet using jsp:: Hi Sir,...
I have a excel... given excel sheet and display it into
another excel sheet using jsp"
i am using 'session' to get the empid from one page to another jsp
convert html to excel using jsp
convert html to excel using jsp i want to convert a html page into mcrosoft excel page using jsp.how i do
shape looping
shape looping can some1 help me?i have to make a shape using "*" by looping...and i dun know how...please and thank you
*
**
java diamond shape:
public class Diamond{
public static void main(String[] args){ Excel Tutorial
;
Display
output in excel format using JSP
We can create excel sheet in the .xls format using jsp. In this example we create... are going to create a new
excel sheet using JSP. Our
application consists
jsp excel code - JSP-Servlet
jsp excel code hi
how to store html form data into excel sheet by using jsp?
and repeat this process continuously for entire sheet
Excel - JSP-Servlet
Excel How to export data from jsp to excel sheet. I am using struts1.2 in my application. Hi friend,
Code to data from Jsp to excel...:
"success.jsp"
For more information on excel sheet Using JSP visit
jsp excel code - JSP-Servlet
jsp excel code Hi
how to insert form data into excel file using jsp? Hi Friend,
Try the following code:
1)register.jsp:
Registration Form
User Name:
Shape - Java Beginners
Shape Respected Sir, Please send me the code of diamond shape by using loop and with single statement of " " and single statement with "*". ... for diamond shape. Hi friend I understand your problem, so that
excel
excel how to save excel sheet data into the database using poi api?
import java.io.*;
import java.sql.*;
import java.util.*;
import java.util.regex.*;
import org.apache.poi.hssf.usermodel.
Create Excel Sheet Using JSP
create excel sheet using jsp
In this example we create excel sheet and insert... use third party API for creating a
excel sheet in JSP. You will learn more about
Error in reading Excel data using jsp
Error in reading Excel data using jsp ERROR while executing bellow...: drive?If not then create it.Anyways do you have POI library in the lib folder...)
at org.apache.jsp.AdminSaaS.excelreading_jsp._jspService(excelreading_jsp.java:71
Jsp to Excel
Jsp to Excel
In this section you will learn how to create an excel file and write data
into it using jsp. For this, you have to import
Read data from excel file and update database using jsp
Read data from excel file and update database using jsp read data from excel file and update database using jsp
Hi, I am using a MySQL database... upload excel file and update database using JSP ?
Thanks in Advance
How to export web page to excel using java or jsp or servlets
How to export web page to excel using java or jsp or servlets Hi
I am trying to export web page(jsp page ) to excel using jsp or servlets. I am... errors. Please can anyone tell me how to do this using java or jsp or servlets
Create Excel Sheet Using JSP
create excel sheet using jsp
In this program, we are going to create the cells and
rows into excel sheet using
java .You can create any number of cells and rows
How to Create New Excel Sheet Using JSP
How to create new excel sheet using jsp
... a new excel
sheet using
java .You can create any number of new excel sheets in a excel file.
To create a excel sheet we can use third party APIs
Inserting Text on Shape Using Java
Inserting Text on Shape Using Java
In this example we are going to create auto shape... parameter .We are passing ShapeTypes.Star32
as shape type. Then we are using setAnchor
Creating Oval in Excel Using JSP
creating oval in excel using jsp
In this program we are going create a sheet and
then after we create a oval.
Code description
The package we
Post your Comment | http://roseindia.net/discussion/18467-Create-Shape-in-Excel-Using-JSP.html | CC-MAIN-2015-22 | refinedweb | 827 | 62.48 |
A list of strings. More...
#include <qstringlist.h>
List of all member functions.
QStringList is basically a QValueList of QString objects. As opposed to QStrList, that stores pointers to characters, QStringList deals with real QString objects. It is the class of choice whenever you work with unicode strings.
Like QString itself, QStringList objects are implicit shared. Passing them around as value-parameters is both fast and safe.
Example:
QStringList list; // three different ways of appending values: list.append( "Torben"); list += "Warwick"; list << "Matthias" << "Arnt" << "Paul"; // sort the list, Arnt's now first list.sort(); // print it out for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { printf( "%s \n", (*it).latin1() ); }
Convenience methods such as sort(), split(), join() and grep() make working with QStringList easy.
See also
Constructs a new string list that is a copy of l.
QString s1,s2,s3; ... QStringList mylist = QStringList() << s1 << s2 << s3;
If cs is TRUE, the grep is done case sensitively, else not.
See also split().
Sorting is very fast. It uses the Qt Template Library's efficient HeapSort implementation that operates in O(n*log n).
See also join().
See also join().
See also join().
This file is part of the Qtopia platform, copyright © 1995-2005 Trolltech, all rights reserved. | http://doc.trolltech.com/qtopia2.2/html/qstringlist.html | crawl-001 | refinedweb | 209 | 79.06 |
Hide Forgot).
Gregory (Grisha) Trubetskoy gives this example:
For example, given a published module foo.py:
_secret_info = "BLAH"
def hello(req):
return "Hello world!"
A request to would result in (as expected)
"Hello world!". _scret_info is inaccessible by the rules of the
publisher because it begins with an underscore.
Here is the problem. A request to
Would result in a slew of interesting info (too much to paste in here),
among them the name and value of _secret_info and other things such as
the full pathname of the file foo.py.
The fix (tennatively) is this patch to the publisher.py file. As a
super-quick hack perhaps dissalowing access to anything that contains
"func_" in the apache config may be the way to go.
Created attachment 110440 [details]
Patch to fix this issue.
This issue also affects RHEL2.1
Erratum queued as RHSA-2005:104.. | https://bugzilla.redhat.com/show_bug.cgi?id=146655 | CC-MAIN-2019-26 | refinedweb | 146 | 67.25 |
What's the best way to pass long length of variables, as arguments, to a method?
def foo(a,b,c,d,e,f) # Could this be shorter? No?
puts f + " loves " + e
# dad loves you
end
egg = "Chicken"
girl = "Money"
car = "luxury"
rich = "poor"
me = "you"
mom = "dad"
foo(egg, girl, car, rich, me, mom)
foo(a..f)
All the possible ways to call methods are described in the documentation:
egg = "Chicken" girl = "Money" car = "luxury" rich = "poor" me = "you" mom = "dad"
def foo(*args) puts "#{args[-1]} loves #{args[-2]}" end foo(*[egg, girl, car, rich, me, mom]) # dad loves you
double splat with defaults:double splat with defaults:
def foo(**params) puts "#{params[:mom]} loves #{params[:me]}" end foo(me: me, mom: mom) # dad loves you
def foo(me: 'you', mom:, **params) puts "#{mom} loves #{me}" end foo(mom: mom) # dad loves you | https://codedump.io/share/UAg4rPsSifbg/1/best-way-to-shorten-arguments-passed-to-a-method | CC-MAIN-2017-04 | refinedweb | 146 | 73.55 |
= Fed. 1. Announcements 1. Fedora's way forward 2. Planet Fedora 1. Transition 2. Fedora marketing revitalization 3. To all FUDCon attendees 4. FUDCon 2008 - Day 2 5. FUDCon 2008 - Day 1 3. Marketing 1. Fedora gets a new project leader 2. FUDCon Raleigh 2008 Video 4. Developments 1. The X-orcist: Driver Slasher! 2. Call To Choose An Initscript Replacement 3. Firewire, Choice And Fedora 4. Applications Using Type1 Fonts Should Upgrade To OTF 5. I'm Melting! Core Temp Of 125C Due To Kernel? 5. Infrastructure 1. Outages 2. A new FIG: sysadmin-tools 6. Security Week 1. Coverity and Open Source 2. Bruce Schneier Interview 7. Security Advisories 1. Fedora 8 Security Advisories 2. Fedora 7 Security Advisories 8. Events and Meetings 1. Fedora Board Meeting Minutes 2008-MM-DD 2. Fedora Ambassadors Meeting 2008-MM-DD 3. Fedora Documentation Steering Committee 2008-MM-DD 4. Fedora Engineering Steering Committee Meeting 2008-01-10 5. Fedora Infrastructure Meeting (Log) 2008-01-10 6. Fedora Localization Meeting 2008-MM-DD 7. Fedora Marketing Meeting 2008-MM-DD 8. Fedora Packaging Committee Meeting 2008-MM-DD 9. Fedora Quality Assurance Meeting 2008-MM-DD 10. Fedora Release Engineering Meeting 2008-MM-DD 11. Fedora SIG EPEL Meeting Week 02/2008 12. Fedora SIG KDE Meeting Week 02/2008 13. Fedora SIG Store Meeting (Log) 2008-01-09 14. Fedora SIG Astronomy Meeting Log 2008-MM-DD [[Anchor(Announcements)]] == Announcements == In this section, we cover announcements from Fedora Project. In this issue, we've included all new announcements since last issue. Contributing Writer: ThomasChung === Fedora's way forward === MaxSpevack announces in fedora-announce-list[1], "Over 150 people will be attending FUDCon on Saturday, which will be a more traditional day of presentations, sessions, etc. The opening talk will be my yearly "State of Fedora" speech. I believe it will be videotaped and up on the internet eventually, but I want to take a few minutes to share some of the details with." [[Anchor(PlanetFedora)]] ==] [[Anchor(Marketing)]] ==] [[Anchor(Developments)]] ==. [1] The ''chips'' driver for C&T 65xx mode[2] was declared[3] by AlanCox to be essential to the small LCD displays which are common on low-power boxes and for which VESA is unable to correctly set the modes. Alan offered to test or debug as required. Adam promised[4] "chips will be spared from the coming apocalypse." [2] "Chips and Technology" [3] [4] The next two objections seemed to be false alarms. WarrenTogami was worried[5] about both the AMD Geode driver and the ''s3'' driver as the former was used by the OLPC and the latter by Intel's "Affordable PC". ThorstenLeemhuis corrected[6] this with the information that the APC actually used the "SiSM661GX [which] is driven by xorg-x11-drv-sis" and AdamJackson confirmed[7] this and also clarified that the AMDGeode was not going to be dropped. HansdeGoede noted[8] however that the ''vesa'' driver would not be able to handle pre-Virge cards contrary to Adam's plan as their BIOSes had no VESA support. [5] [6] [7] [8] A plea to save the ''tseng'' driver came[9] from FelixMiata. He outlined their usefulness for upgraders with only a PCI and no AGP slots. In the end Adam agreed to do his best to port all the drivers (as a low priority task) as there had been requests to retain them. ChristopherAillon and AlanCox nevertheless vied[11] to name the promised purge. [9] [10] [11] ===d''. [1] [2] [3] CaseyDahlin responded[4] that he had been working on a parallel boot system, ''rrn'', which provided ''dbus'' notifications of starting services, retains 'initd' and is compatible with SysV initscripts. (A FUDCon[5] session was planned for ''rrn''). Casey was skeptical about the use of Python, preferring Haskell, but agreed that BASH ran many other programs causing extra I/O. [4] [5] JonathanUnderwood asked why ''upstart'' had not been chosen as a replacement and Casey provided[6] the information that discussions on the subject (he included a link to the wiki entry) had preferred ''prcsys'' but that its use of pthreads and lack of dbus functionality had inidcated a rewrite would be useful. Jonathon thought[6a] that the current roadmap for "upstart" obviated many of those objections. [6] [6a] NicolasMailhot wished[7] that any replacement init system would also take care of session initiation and LinusWalleij provided[8] a link to the ''InitKit'' project at Freedesktop.org. Casey investigated this and later reported[8a] that InitKit plans solely to create a standard for even-based activation to provide a common target for dependent software. No actual code is specifically planned to come from InitKit. [7] [8] [8a] A name-change was suggested by LeszekMatok due to both the sound and a potential namespace pollution. Casey explained[9] that it stood for "Resolve/Run/Notify" but took the points on board. [9] The suggestion that Haskell might be used was ridiculed by DimiPaun who pointed out that any language chosen should be widely known by sysadmins and that it would be better to use C if the init scripts were to be rewritten. YaakovNemoy accepted the obscurity argument but argued[10] Haskell's advantages over Python, pointing out that Haskell needed no VM and instead is compiled to native machine code. NilsPhilippsen thought[11] that requiring a compiler collection merely to boot a machine needed much justification. [10] [11] The use of any dependency bloating requirements such as PERL or Python was considered[12] a non-starter by EnricoScholz. YaakovNemoy responded[13] that Python was installed on most machines and that the combination of Bash with awk, grep and other tools most definitely was. Yaakov called for comparative measurements of the time taken and number of kilobytes read during startup by the current system and one that starts python. Enrico pointed[14] to over 50% of his machines not using Python and MattMiller's disbelief that YUM (and hence python) was installed on less than half was answered[15] by DanielBerrange with the information that "stateless" installs or VM "appliances" do not require YUM. [12] [13] [14] [15] The use of an initscript which required anything outside of POSIX was anathema to RalfCorsepius. NilsPhillipsen responded[16] that he could see no way of removing the numerous forks and exec()s within the current SysV framework. Casey and YaakovNemoy thought that Ralf's argument that a bare-bones POSIX should be adhered to was a nearly religious one. Ralf backed[18] up his argument with reference to SuSE's initscript changes. [16] [17] [18] The suggestion of HorstvonBrand was that service dependencies should be considered and AndrewFarris largely agreed[19] but thought that Horst's specific suggestion that a webserver should be prevented from running if there were no network was wrong. An interesting subthread developed in which the hanging of network services due to DNS lookups failing when there is no network developed. [19] The suggestion that daemons could be changed to become non-forking and thus avoid having to use Python was made[20] by Enrico and this led to an informative exchange. NilsPhilippsen riposted[21] that Enrico's scheme only handled the subset of daemons which used pidfiles and that Python was not irretrievably bloated. JamesAntill confirmed[22] that a "core" python could be a fraction of the current size, but cautioned that it would be a lot of work to sort out the dependencies. Enrico responded[23] with an estimate of the size of a slimmed down bash and arguments that suggested that pidfiles were an anachronism required by initsystems with forking daemons. Nils seemed to rebut[24] most of these points, arguing that PIDs of processes could change and that python's size had been demonstrated to be of similar magnitude to bash's. Enrico countered[25] this by noting, among other things, that fork() and exec() performance were dependent on the particular program being executed and that a distinction needed to be drawn between first startup (which is not that important) and subsequent instances. This exchange continued a little further without apparent resolution or clarity. [20] [21] [22] [23] [24] [25] A suggestion was made[26] by CaseyDahlin to consider the use of ''busybox'' to replace bash and its attendent required programs. KevinKofler worried[27] that the number of forks would remain the same and wondered whether a "shell which emulates POSIX process handling in-process and uses direct builtin function calls for commands like sed rather than forking a new process [...] could work," but worried that maintainability would suffer due to the need for special-case code to handle pipes and other necessary features. Both Casey[29] and AlanCox[30] noted that the fork was less of an issue than the execve due to disk IO. Alan suggested Plan9's ''rc'' or ''ash'', but BillNottingham reported[31] that ''ash'' had been benchmarked and shown to be unpromising. [26] [27] [28] [29] [30] [31] A skeptical evaluation of ''initng'' was posted by LennartPoettering who seemed inclined[32] towards favoring ''upstart'' but thought it was a bit of a moving target "in short: initng is a joke, initkit not ready yet, upstart a bit of a moving target that's going to be replaced soon anyway. The other systems seem to be too simple (minit, runit) or totally un-Linuxish (SMF, launchd)." Lennart preferred the idea of following Debian's lead and implementing LSB headers "to allow parallel startup" and Casey responded[33] that Fedora should "commit to that outright, and not let ourselves sit on our asses for another 5 years while everything blows by." [32] [33] Casey made the excellent point that Fedora is supposed to be a showcase for innovation and that he had attempted to move forward with ''rrn'' (based on discussion with HaraldHoyer) and this was now apparently not desired. He exhorted fellow contributors to pick firm goal so that someone could do the work and expressed the willingness to do it himself as long as there was an agreed target. === Firewire,ope/Plone. [1] [2] Hans' original firewire concerns spawned a mostly technical thread while his more general complaint and Thorsten's amplification of it gave rise to a very wide ranging, voluminous argument. The firewire issue was directly addressed[3] by WillWoods who posted that a fix had already gone into Fedora 7 and Fedora 8, due in no small part to the feedback received by making the Juju stack available in Fedora. Information[4] from KrzysztofHalasa and JarodWilson suggested that Hans' "Via vt 6306" controller should work in OHCI-1.1 mode and Hans offered to help test a rawhide kernel built with some of the upstream linux1394 tree when it was ready. [3] [4] The idea that "Linux is about choice" was roundly rebuffed[5] by AdamJackson in a longish, impassioned post which argued that too much choice increased the failure rates combinatorially: "If I could only have one thing this year, it would be to eliminate that meme from the collective consciousness. It is a disease. It strangles the mind and ensures you can never change anything ever[...]" There was lots of (dis)agreement on this point especially between DavidZeuthen in agreement and PatriceDumas arguing in favor of more diversity. It was mildly heated and led David to accuse[6] Patrice of "screw[ing] up the SN ratio of this list even more". David wondered why he (David) was even on the list anymore. [5] [6] ===. [1] [2] DEbian FOnt MAnager KellyMiller was horrified[3] and cited his negative experiences with ''defoma'', including Xorg locking during startup, as a prime motivator in switching to Fedora. In response to MatejCepl Patrice clarified[4] that there was nothing wrong with ''fontconfig'' except that some applications, specifically ''grace'', ''xglyph'' and ''xdvi'', did not use it. Patrice noted that it might be better to port ''t1lib'' to use fontconfig instead of adding ''defoma''. [3] [4] A long-term perspective was added[5] by NicolasMailhot when he commented that Type1 fonts were becoming increasingly rare as the preferred non-TTF format was now OTF[6]. Nicolas advised that applications currently depending on Type1 fonts should upgrade their backend. [5] [6] ===. [1] AndrewHaley suggested[2] that the hardware was at fault rather than the software which led RichiPlana to rebut[3] that with a list of instances in which software had damaged hardware. AlanCox seemed to agree[4] with Richi that it was possible that a kernel error could lead to overheating and then the BIOS would shut the machine off once a critical temperature had been reached. Alan requested that the fans be checked and then old and new kernels run and if any anomalies resulted that Len Brown then be informed. [2] [3] [4] Inaccurate ACPI readings with other AMD processors were reported by SteveGrubb[5] and TrondDanielsen[6] although Trond noted that ''lm_sensors'' appeared to give accurate readings. [5] [6] [[Anchor(Infrastructure)]] ==] [[Anchor(SecurityWeek)]] == Security Week == In this section, we highlight the security stories from the week in Fedora. Contributing Writer: JoshBressers === Coverity and Open Source === There were quite a few stories about Coverity this week. Most were rather poorly written and were confusing at best. The real story is best read from the Coverity site here: In general Coverity is portrayed in a mostly positive light for providing their service to various Open Source projects. In reality it's not that simple. Using a closed source tool for the supposed benefit of Open Source is misleading at best. If Coverity was serious about improving the state of Open Source, they would release their tool under an Open Source license for the community to consume and improve upon. Right now they simply have a clever marketing program. ===. [[Anchor(SecurityAdvisories)]] == Security Advisories == In this section, we cover Security Advisories from fedora-package-announce. Contributing Writer: ThomasChung === - [[Anchor(EventsMeetings)]] == Meeting 2008-MM-DD === * No Report === Fedora Packaging Committee Meeting 2008-MM-DD === * No Report === Fedora Quality Assurance Meeting 2008-MM-DD === * No Report === Fedora Release Engineering Meeting 2008-MM-DD === * No Report === Fedora SIG EPEL Meeting Week 02/2008 === * === Fedora SIG KDE Meeting Week 02/2008 === * === Fedora SIG Store Meeting (Log) 2008-01-09 === * === Fedora SIG Astronomy Meeting Log 2008-MM-DD === * No Report -- Thomas Chung | https://www.redhat.com/archives/fedora-announce-list/2008-January/msg00004.html | CC-MAIN-2017-22 | refinedweb | 2,379 | 52.8 |
[courtesy cc of this posting mailed to cited author] In comp.lang.python, Florian Weimer <fw at s.netic.de> writes: :Manpages are most useful for languages which do not support namespaces :(so you can hit `K' or `M-x man RET RET', and you get the right page). :Perl fits into this more than Python (which heavily uses methods on :builtin objects). Unfortunately, `man exists' (or `perldoc exists') :doesn't work with my Perl installation either, I really hate that. You're right about perlfunc being insanely long. I've always argued against it, and there's a script in the distribution kid that *will* create things like /usr/local/perl/man/man3/exists.3, but I haven't managed to get my lobbying power worked up enough to push through to make that the default. --tom -- "If you don't know where you are going, any road will take you there." Lewis Carroll, "Alice in Wonderland". | https://mail.python.org/pipermail/python-list/1999-August/006887.html | CC-MAIN-2019-30 | refinedweb | 158 | 74.08 |
Bart De Smet: Inside Rx 2.0 Beta
- Posted: Mar 14, 2012 at 8:37 PM
- 46,695 Views
- 23 Comments
Something went wrong getting user information from Channel 9
Something went wrong getting user information from MSDN
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
Rx v2.0 Beta is here! Who better to tell us all about it - and in great detail at the whiteboard - than Bart J. F. De Smet. This is a long interview, so take your time. Watch it in parts or at one sitting. There was no easy way to dice this up into separate videos, so we give it to you as it happened - in one take. As usual, Bart's explanations are thorough and clear. Enjoy. Learn. Rx has a come a long way and there's a great deal of new, improved reactive goodness in 2.0! Congratulations to Bart and team.
Highlights of this release:
Support for .NET 4.5 Beta.
Support for .NET for Metro style applications and Windows 8 Consumer Preview.
Rx Portable Library Beta.
Await support on IObservable<T>.
Async variants of various operators.
Scheduling using async methods.
Generalized time-based operators.
Improved performance.
You can read much more about this release in Bart's (lengthy) blog post, including download links and installation awesome!
I love Rx!
Events are so dead
Awesome
Nice Job Bart
Rx Live
Great material !!!
Thanks
The integration between Tasks and Observables, using async/await, is absolutely fantastic. It really seems natural to combine the two as demonstrated by Bart.
The enlightenments are a great way to deal with platform specific capabilities, and I imagine it's facilitated by the compositionality gained by using LINQ - is that correct?
I'm still working my way through the video and Bart's blog post ... I was definitely into the prime number filter, in the blog post because I was working on one recently - and using Rx for it in fact, and Bart's solution using Rx with await/async was just so much fun to read (and better) I was absorbed into that sample until 2:30am last night.
Hm, I have the impression that this thing is somehow getting a little bit out of control. Where are the real use-cases ? How is the debugging experience ? I'm really not sure about it and I'm wondering people like Anders think about it.
@Mike: Rx represents a pattern, a style, a methodology and mechanism for stream-based, asynchronous programming using LINQ operators. Rx works with simpler, single value async models seamlessly (so, with C# async/await).
). Most recently, you can see/hear Anders talking about Rx here
No offense, but I wouldn't rely on somebody else's opinion about something while forming your own. Granted, it's Anders, but still...
Go ahead and watch some of the C9 interviews with Anders ( Rx typically comes up as I generally see to it that he talks about it
C
@Mike The debugging experience just got a whole lot better with this release. Have you gotten to the point where Bart talks about the call stacks? Those changes help you a lot in cases of trouble...
@Mike: There are a whole bunch of use cases. I'm surprised to learn about new customers using Rx in different ways every week. Most recently:
The spectrum of places used has also grown signficantly. We started off by going into Windows Phone 7 as an API to help users process sensor data (accelerometer, GPS, etc.). In full desktop CLR, we've seen adoption ranging from client UI scenarios to server/datacenter workloads. We're seeing an increasing interest in the embedded space as well, including robotics. And we have Rx for JavaScript used in both client and server scenarios (e.g. node.js).
Stay tuned and you'll see us "eat our own dogfood" in various places. Quite a few products today are shipping "powered by Rx" (most lately PowerView in SQL Server 2012, various online services in Bing, but also yet-unannounced projects), and the number is growing fast.
With regards to debuggability, we've done a lot of work in this release to make callstacks readable, approachable, and understandable (see the blog post). This is just the end of the beginning of work we're doing in this field. So again, stay tuned!
Great improvements to Rx Bart. Keep the good stuff coming...
Over the years, following Rx videos on C9; it has helped me to think outside IEnumerable box; to solve problems in more declarative/reactive way using Rx Operators.
With tremendous performance improvements; Rx just got a great boost for real-time systems (which can't be build with IEnumerable mind-set).
@WinInsider: Rock and roll.
C
@bdesmet: Would love to see the base libraries using observables instead of events.
I'm having to write all kinds of extension messages around them just to be able to use the observable.).
@Maddus Mattus: Observables come at a slightly higher cost than events, e.g. due to the need for an IDisposable "subscription handle". So, having events at the core isn't a bad thing either. For "non-complex event processing" scenarios, a simple event handler often suffices (e.g. the form closing event to pop up a "do you want to save" dialog).
What you likely want is a smoother way to convert an event into an observable sequence, just like F# has an implicit conversion allowing this (see here and here for starters).
@Novox: You're seeing an internal namespace with a Greek alpha in its name to make the call stack look exactly like the methods you wrote. We can't have inner classes such as Where nested inside Observable, because there's already a method with that name. So, the closest approximation was an Observαble namespace with classes such as Where in it.
Unfortunately, the namespace shows up in IntelliSense at this point, due to some complexities around the IDE's handling of InternalsVisibleTo. We're aware of this problem and are looking into it.
@bdesmet: Thanks Bart!
Will check out the links,..
Is it still less expensive when one takes into account that nobody ever de-subscribes their handlers?
When I discovered Rx, normal events seemed like a hack
@Maddus Mattus: Still need to allocate the IDisposable. This said, not that big of a deal, especially if you don't ever need to unsubscribe, meaning the object becomes food for a Gen0 collection.
As soon as you start composing events, the benefits far outweigh the cost. A lot of the composition of Rx builds on the ability to compose subscriptions. Subscribing to the merge of N sources means returning an IDisposable that holds on to the underlying N source subscriptions. It's as simple as that.
If you'd measure all sorts of performance metrics in real-world scenarios, I doubt the disposable object graph will show up as a relevant influence. (Btw, we have many IDisposable implementations internally in Rx, also to allow for reuse of objects.) It definitely didn't in the Rx v2.0 Beta analysis of performance. Also, typically there's 1 subscription for a whole bunch of events flowing through the pipeline: 1 <<<<< N.
To conclude, my remark is mostly about the debate whether or not observables are a primitive or an abstraction over a primitive. Just like delegates are first-class representations of methods, observables are first-class representations of events (which are method pairs for our purposes). In this analogy, one doesn't "convert" (e.g. through method group conversion in C#, see ECMA 334, section 13.6) a method into a delegate unless you want to do a more functional style composition (e.g. LINQ to Objects heavily relies on delegates). The same holds for observables, with the only difference being a bit more friction to convert an event to its first-class representation (i.e. there's no method group equivalent for event members).
@bdesmet: Thanks for taking the time to answer my ramblings
You, Erik and Brian are always fun to watch and learn from!
Keep up the good stuff!
You have done an amazing job.
Great work. Very interesting!
I'm curious about how these platform specific "enhancements" are enabled, are they loaded via reflection or are there any special tricks to override the default behaviour?
I think there are many instances where this will be an issue in the following years and if there is a standard way to leverange portable core functionality with platform specific overrides it would make an interesting article/video.
@Kim: The platform enhancements are loaded through a Type.GetType call, followed by an instantiation of the discovered type (if any). The resulting object is cached so subsequent uses of the service don't take a performance hit.
The BCL/CLR teams are aware of the need for such tricks in some types of APIs, and we may see more guidance or helper functionality to address this going forward (no promises implied in this statement). For a lot of Portable Libraries though, one can live without such mechanisms. Think about class libraries for a data model that can be reused across Windows Phone, Metro, Silverlight, classic desktop, etc.
Hi!
I just did the VS 11 Beta "async lab" from the msdn on:
I would love to get a tutorial on how to best refactor the results of that course to use RX 2.0 beta!
That would be a great starting point for RX newbies like me
Any hope someone can do that?
Or is there already a good tutorial for this?
Brilliant work Bart. I really like the perf improvement stuff you have done. It is cool to see a conceptual evolution from your MiniLinq concept to Rx v1 to the optimisations you are doing in v2 (eg Buffer/Merge/SelectMany/Either).
Call stack imrpvements are super welcome addition too. Are there any tricks that your operators do to know that they are part of a "safe" chain? ie that Select doesnt need to protect itself from Where, but potentially does from my own custom operator?
@genteldepp: has an introduction to Rx, but for V1. It is currently undergoing a total rewrite...hope to be out soon. Hope it helps.
@LeeCampbell: At this point, there are no magic tricks to know whether an operator is part of a "safe" chain. What's really going on here is a different approach to writing operators, based on custom observer implementations rather than the anonymous implementation approach through lambda-based Subscribe calls to the sources of the operator.
In order to ensure "global" safety, there's a minimal amount of cheap safeguarding based on swapping out observers for mute ones as soon as an operator's input reaches a terminal state. So, multiple terminal messages (invalid from the grammar's point of view) are silenced but the first one, and the place this happens is inside the custom operator noticing this (rather than in the Subscribe method's wrapping of the observer in the past).
As for concurrent notifications (which are invalid too), there has never been true safeguarding against this, so inputs are assumed to be safe. Only when an operator has to deal with multiple sources, it will do proper orchestration internally (e.g. Merge has to ensure we never talk to the outgoing observer in a concurrent manner), using locks or other approaches. However, when an ill-behaved producer is in the mix, behavior is undefined (e.g. a Subject<T> that exhibits concurrent messages). In case such a producer exists, one has to safeguard the pipeline using Synchronize.
When implementing sources or custom operators, we recommend to use ObservableBase<T> and Observable.Create, respectively. Those are the safest way to get things right. In fact, for custom operators, the use of composition of existing operators is a good start. Going forward, we may provide more advanced "power user" facilities to write more efficient custom operators using techniques similar to the ones we're using internally now. However, with power comes responsibility, so users of such primitives and implementation patterns need to have a thorough understanding of expectations with regards to observable sequences, the observer grammar, etc.
Remove this comment
Remove this threadclose | http://channel9.msdn.com/Shows/Going+Deep/Bart-De-Smet-Inside-Rx-V2-Beta?format=progressive | CC-MAIN-2014-15 | refinedweb | 2,052 | 64.41 |
java programming...........
java programing
do it in eclips and make sure it compile
Goals
1)Be able to work with individual bits in java.
2)Understand the serializable interface.
3)Understand the comparable interface.
4)Answer questions about a general-purpose class to be developed.
5)Understand the use of a driver program for ‘glass box’ debugging.
6)Develop a program that can grade true/false te
Description
1)The first step is to develop a general-purpose class that will be able to perform operations on strings of bits. The class API follows:
public class BitMap implements Comparable, Serializable
{ public static final int BITSIZE = 64;
private long bitString;
public BitMap() // Three constructors.
public BitMap(String s)
throws IndexOutOfBoundsException,ArithmeticException
public BitMap(boolean[] bits)
throws IndexOutOfBoundsException
private long bitMask(int b) // Other class methods.
public void setBit(int b)
public void clearBit(int b)
public boolean checkBit(int b)
public int countTrue()
public void clearAll()
public void setAll()
public int compareTo(Object bm) //For Comparable.
public boolean equals(BitMap bm)
public String toString()
}
Notes:
a.The only instance variable that is needed is bitString.
b.Use BITSIZE for the maximum index value of your loops.
The above looks like a lot of methods, but the whole class requires about a page of code when the methods are filled in. Some methods can use others instead of duplicating code. For example, the first constructor can just call the method, clearAll(). The method bitMask() can be used by four or five other methods whenever a bit operation is called for. We'll discuss that in class.
The operations to be performed by each method are briefly described below:
a) Constructors
(i) The first constructor just needs to set all bits to false (or zero). The method clearAll() does the same thing.
(ii) The second constructor takes a character string as input. Each character of the string is either a t (for true) or f (for false) value. The bits with a t character are to be set on in the bit map; bits with an f character should be set off in the bit map. Throw an ArithmeticException if the input string has characters other than ‘t’, ‘T’, ‘f’, or ‘F’ appear. Throw IndexOutOfBoundsException if the string is too long.
(iii) The third constructor works just like the second except the input is a boolean array. The bits corresponding to the array elements that have a true value should be set to a value of one;the elements having a false value shoule beset to a value of zero.
b) Primary Methods
The methods, setBit(int), clearBit(int), and checkBit(int) respectively set a given bit on, off or check a bits current value. The method, countTrue() returns the total number of bits that are set. It can be used by the compareTo() method. The method setAll() turns on all the bits; clearAll() clears all bits. Both setAll() and clearAll() methods can be written with one instruction.
c) Comparable interface
The compareTo() and equals() methods should be provided to conform to the standard way that java programs compare objects. One BitMap object is considered less than another if it contains less true bits. In effect, this method of comparison can be used to determine if one BitMap object has more bits on than another. The equals() method can compare whether two BitMaps have all of their on and off bits in the same positions.
d) The toString() method should return an appropriate string of 't' and 'f' values. The System.out.print methods use this method.
2)The next step is to debug the class that was created in the above step. I provide the program driver.java for this purpose; its code is at the bottom of this document. Don’t modify this program in any way; use it to test your class. It contains a menu that has options to test every option. Once the testing is complete, BitMap,could be used as a general tool for working with bits and could be used in many programs.
3)Use notepad to create a file of true/false questions.
4)Now write a program (CreateTest.java) that constructs a true/false test. This program reads the file created in step 3 to ask a series of true false questions and record the resulting answers in a bit map object. Be sure to use a fileChooser to ask the user for the file name. Make sure you catch all exceptions (programs should never crash).
You can use your TextReader from the previous lab as the starting point for this program. Better yet, just instantiate a BufferedReader and read lines from the text file till you encounter a null line.
Make sure to have at least 25 questions in your test. When the test is completed, the program should use an ObjectOutputStreamto write one record (the BitMap object) to a sequential binary file. That is why the BitMap class must have ‘implements serializable’ on its signature line. Name the disk file ans.bin. Hopefully, you'll know the answers to your questions so the answer file will represent a perfect score.
5)Finally, create a new application (Test.java). You can copy and paste the program that you just wrote (and save it as Test.java), and then modify it appropriately. This program should read the answer file (using an ObjectInputStream) and compare the answers given by someone taking the test to ans.bin. Display the score earned by the test taker.
6)Answer the synthesis questions in an rtf or doc file (answers.rtf or answers.doc). Type your name and the lab number on this file and include the questions with the answers.
7)Zip your Eclipse project along with the synthesis answers and email to harveyd@sou.edu.
Driver.java
// Driver program to test the BitMap class.
import java.io.*;
public class Driver
{ static BitMap bitMap[];
static BufferedReader in = new BufferedReader
(new InputStreamReader(System.in));
// Method to start the driver program.
public static void main(String[] args)
{ int bit, map, option;
BitMap bitMap = new BitMap();
BitMap secondMap;
// Use a menu to test all of the other options.
option = menu();
while (option != 10)
{ switch (option)
{ case 1: // Set bit.
bit = getBit();
bitMap.setBit(bit);
System.out.println(bitMap);
break;
case 2: // Clear bit.
bit = getBit();
bitMap.clearBit(bit);
System.out.println(bitMap);
break;
case 3: // Check bit.
bit = getBit();
if (bitMap.checkBit(bit))
System.out.println("Bit is set");
else System.out.println("Bit is not set");
System.out.println(bitMap);
break;
case 4: // Clear all bits.
bitMap.clearAll();
System.out.println(bitMap);
break;
case 5: // Set all bits.
bitMap.setAll();
System.out.println(bitMap);
break;
case 6: // Count number of true bits.
System.out.println(bitMap);
System.out.println(bitMap.countTrue()
+ " bits are set");
break;
case 7: // Compare to bit maps.
secondMap = getMap();
System.out.println(bitMap);
System.out.println(secondMap);
System.out.println("compareTo = "
+ bitMap.compareTo(secondMap));
break;
case 8: // See if maps equal.
secondMap = getMap();
System.out.println(bitMap);
System.out.println(secondMap);
if (bitMap.equals(secondMap))
{ System.out.println("Maps equal" ); }
else
{ System.out.println("Maps not equal" ); }
break;
case 9: // toString.
System.out.println(bitMap);
break;
default:
System.out.println("Illegal Option - try again");
break;
}
option = menu();
}
System.out.println("End of Driver for BitMap");
} // End main.
// Method to display menu and get selection.
public static int menu()
{ System.out.println("Menu of driver options");
System.out.println(" 1 = setBit");
System.out.println(" 2 = cleartBit");
System.out.println(" 3 = checkBit");
System.out.println(" 4 = clearAll");
System.out.println(" 5 = setAll");
System.out.println(" 6 = countTrue");
System.out.println(" 7 = compareTo");
System.out.println(" 8 = equals");
System.out.println(" 9 = toString");
System.out.println("10 = exit");
System.out.print("Enter option: ");
return readInt(1,10);
} // End menu().
// Method to accept a bit number.
public static int getBit()
{ int bit;
System.out.print("Enter bit number: ");
bit = readInt(0,BitMap.BITSIZE-1);
return bit;
} // End getBit().
// Method to instantiate either a boolean or string bit map.
public static BitMap getMap()
{ boolean success = false;
BitMap bitMap = null;
do
{ try
{ System.out.println(
"Enter string of 't','T','f', or 'F' ");
String values = in.readLine().toLowerCase();
System.out.println(
"Enter 'b' or 'B' for Boolean map");
String type = in.readLine().toLowerCase();
if (type.length()!=0 && type.charAt(0)=='b')
{ boolean bools[] = new boolean[values.length()];
for (int i=0; i<values.length(); i++)
{ if(Character.toLowerCase(values.charAt(i))=='t')
bools[i] = true;
else bools[i] = false;
bitMap = new BitMap(bools);
} }
else bitMap = new BitMap(values);
success = true;
}
catch (Exception e) {System.out.println(e); }
} while (!success);
return bitMap;
} // End getMap().
// Method to get an integer between min and max.
public static int readInt(int min, int max)
{ String token;
int value = 0;
boolean ok = false;
while (!ok)
{ ok = true;
try
{ token = in.readLine();
value = Integer.parseInt (token);
if (value<min || value>max) ok = false;
}
catch (Exception exception) {ok = false;}
if (!ok)
{ System.out.print("Illegal input, enter between "
+ min + " and " + max + ": ");
} }
return value;
} // End readInt().
} // End | https://www.studypool.com/questions/195974/java-programming-8 | CC-MAIN-2017-26 | refinedweb | 1,507 | 60.92 |
Add a List All the Notes API
Now we are going to add an API that returns a list of all the notes a user has.
Add the Function
Create a new file called
list.js with the following.
import handler from "./libs/handler-lib"; import dynamoDb from "./libs/dynamodb-lib"; export const main = handler(async (event, context) => { const params = { TableName: process.env.tableName, // 'KeyConditionExpression' defines the condition for the query // - 'userId = :userId': only return items with matching 'userId' // partition key KeyConditionExpression: "userId = :userId", // 'ExpressionAttributeValues' defines the value in the condition // - ':userId': defines 'userId' to be the id of the author ExpressionAttributeValues: { ":userId": "123", }, }; const result = await dynamoDb.query(params); // Return the matching list of items in response body return result.Items; });
This is pretty much the same as our
get.js except we use a condition to only return the items that have the same
userId as the one we are passing in. In our case, it’s still hardcoded to
123.
Configure the API Endpoint
Open the
serverless.yml file and append the following.
list: # Defines an HTTP API endpoint that calls the main function in list.js # - path: url path is /notes # - method: GET request handler: list.main events: - http: path: notes method: get
This defines the
/notes endpoint that takes a GET request.
Test
Create a
mocks/list-event.json file and add the following.
{}
We are still adding an empty mock event because we are going to replace this later on in the guide.
And invoke our function from the root directory of the project.
$ serverless invoke local --function list --path mocks/list-event.json
The response should look similar to this.
{ "statusCode": 200, "body": "[{\"attachment\":\"hello.jpg\",\"content\":\"hello world\",\"createdAt\":1602891322039,\"noteId\":\"42244c70-1008-11eb-8be9-4b88616c4b39\",\"userId\":\"123\"}]" }
Note that this API returns an array of note objects as opposed to the
get.js function that returns just a single note object.
Next we are going to add an API to update a note.
For help and discussionComments on this chapter | https://serverless-stack.com/chapters/add-a-list-all-the-notes-api.html | CC-MAIN-2021-04 | refinedweb | 339 | 68.57 |
Pure Components in React
Pure Components in React
We take a look at what pure components look like in a React.js application and how to use Immutable.js to make working with these components easier.
Join the DZone community and get the full member experience.Join For Free
Pure components were introduced in React 15.3.
React.Component and
React.PureComponent differ in implementing the
shouldComponentUpdate() lifecycle method. The
shouldComponentUpdate() method decides the re-rendering of the component by returning a boolean. In
React.Component, it returns true by default. But in pure components,
shouldComponentUpdate() compares if there are any changes in state or props to re-render the component.
Here I am sharing my observations about how unnecessary renders are reduced by the pure component.
import React from 'react'; class Car extends React.Component{ state={type:"Xylo"} changeType = () => { this.setState({ type:"Xylo"}) } render(){ console.log("Car -- Render"); return (<div>Car <button onClick={this.changeType}>Change Type</button> </div>) } } export default Car;
Here,
render() will be called for each set
State(), though we are not representing the “type” property in the JSX and also the “type” property is not changing. We need to stop calling
render() in both the above situations. To make this happen,
shouldComponentUpdate() should return true by:
- comparing only the properties represented in the JSX. Here, the “type” property is not represented in the JSX. It is unnecessary to re-render the Car component.
- checking if the properties are really changing, i.e. is the “type” property really changing?
Pure components come into the picture in the second scenario. Pure components compare all the properties of the current state with the next state, and current props with next props for every set
state() call of itself or its parent in the hierarchy. Thus, it helps in reducing unnecessary
render() method calls.
A very specific thing about pure components is the shallow comparison. JavaScript is completely based on objects. The comparison is based on address references. In a shallow comparison, the references of the objects are compared leaving the internal references in the object uncompared. This creates a problem while working with objects with mutable nested structures along with pure components.
Pure Components Used With Mutable Objects
Mutable objects share the same reference. A change in one would affect the other object. So, updating them would result in mutating the state directly due to a shallow comparison. This is not a good approach. Let’s look at an example:
class Courses extends React.PureComponent{ state={ arr:[{id:1,name:"C"},{id:2,name:"C++"},{id:3,name:"Java"}] } changeArr = () => { let arr1 = [...this.state.arr]; arr1[1].name = "Javascript"; console.log(arr1[1] === this.state.arr[1]); this.setState({arr:arr1}, ()=>{ console.log("Done ",this.state.arr); }); } }
Here,
this.state.arr and
arr1 share a different reference. But their internal structures still share the same references. As a result, a change in
arr1 would change the
this.state.arr. Looks like the state is updated but the state is mutated. Because
arr1[1] === this.state.arr[1] is true. A shallow comparison results in updates to the virtual DOM, but the state is also mutated. If nested mutable objects need to be used with pure components, then we need to either:
- use
forceUpdate()for updating state manually.
- use the Immutable.js library to create immutable data for nested mutable structures.
forceUpdate( )
This method reads the latest state, props, and non-state properties of the parent that are passed to the child. Its use is suited for small applications with minimal properties so that we can assume the scenarios and use them appropriately. This approach is not recommended.
Immutable.js
Immutable.js helps in creating immutable data structures for nested data. It always returns a new object with the updated operation. Therefore, it maintains immutability. It also helps in using
map() on the structures but the index cannot be accessed. Supported data structures include: List, Stack, Map, Ordered Map, Set, Ordered Set. and Record.
const { Set } = require('immutable'); p = 6; state = { set1:Set([1,2,3,4,5]) }; increment = () => { this.setState((oldState) => { let newSet1 = oldState.set1.add(this.p); this.p++; return {set1:newSet1} }) }
Here, the
add() operation does not add the element to the
set1. It creates a copy of
this.state.set1, adds the element
p, and returns the new object reference to
newSet1. Therefore, neither
this.state.set1,
newSet1, nor the internal structures of these components share the same references. This implies that immutability has been maintained.
Conclusion
Pure components are ideal for classes with minimal and immutable properties. If we must use them with objects nested with mutable objects, it would be very complicated to maintain immutability. Irefer using Immutable.js in such scenarios.
References:
Opinions expressed by DZone contributors are their own.
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}{{ parent.urlSource.name }} | https://dzone.com/articles/pure-components-in-react?utm_medium=feed | CC-MAIN-2019-35 | refinedweb | 810 | 52.46 |
These days, I worked on running the MLPERF benchmark submitted by Nvidia. Firstly, I tried to not use nvidia-docker, but I failed. I don’t know what version of fairseq do you use in the docker image. It is totally different from the version I can find on github. Secondly, I use the docker you provided and ran it successfully. Then I uninstalled the original pytorch and reinstalled my own version which disabled CUDA P2P. However,
import fairseq.data.batch_C
ImportError: /workspace/translation/fairseq/data/batch_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN2at5ErrorC1ENS_14SourceLocationERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE.
Could you please explain me about the fairseq you use? I can hardly solve this problem. Thanks! | https://forums.developer.nvidia.com/t/nvidia-docker-pytorch-fairseq-problem/69681 | CC-MAIN-2020-40 | refinedweb | 113 | 53.88 |
> You are of course correct. The <% python code %> construct
> just makes it a lot easier to place application code in the
> wrong place. That is not really a criticism of the
> mechanism, it is a criticism of people who do that.
Yes, I agree fully.
> Mind you, I could argue that while you have not introduced a
> third language, you have introduced a new mechanism. That
> was part of the point I was trying to make. You need either
> a new language or a special mechanism.
Ok, fair enough.
> > reduces your formatting code to something like this:
> >
> > <%
> > for tr in rows:
> > print """
> > html formatted string
> > """ % tr
> > %>
>
> How is the application namespace made available to the templating?
Funny that you should say namespace, because that is the 3rd and last
central concept in Draco ;-) (the others are templates and handlers).
The variables from the "interface" namespace are available as global
variables to all code in templates.
Other namespaces include "session", "user", "cookie", "config" and
"args". All of these have a different meaning and putting variables in
them does different things. Namespaces are _the_ mechanism in Draco to
use for persistency.
> No argument here.
>
> I have toyed with the idea of experimenting with different
> templating mechanisms in Albatross. The templating is only
> part of the problem that Albatross is trying to address.
Yes, the same goes for Draco here. I've had some requests to support TAL
(OpenTAL) as the templating language, as this is becoming a sort of
de-facto standard. If I get to it one day I will.
Cheers,
Geert | https://modpython.org/pipermail/mod_python/2003-June/013742.html | CC-MAIN-2022-21 | refinedweb | 261 | 75.2 |
cc [ flag ... ] file ... -lbsm -lsocket -lnsl -lintl [ library ... ]
#include <sys/param.h>
#include <bsm/libbsm.h>
These interfaces document the programming interface for obtaining entries from the audit_event(4) file. getauevent(), getauevnam(), getauevnum(), getauevent(), getauevnam(), and getauevnum() each return a pointer to an audit_event structure.
getauevent() and getauevent_r() enumerate audit_event entries; successive calls to these functions will return either successive audit_event entries or NULL.
getauevnam() and getauevnam_r() search for an audit_event entry with a given event_name.
getauevnum() and getauevnum_r() search for an audit_event entry with a given event_number.
getauevnonam() searches for an audit_event entry with a given event_name and returns the corresponding event number.
setauevent() ``rewinds'' to the beginning of the enumeration of audit_event entries. Calls to getauevnam(), getauevnum(), getauevnonum(), getauevnam_r(), or getauevnum_r() may leave the enumeration in an indeterminate state; setauevent() should be called before
the first getauevent() or getauevent_r().
endauevent() may be called to indicate that audit_event processing is complete; the system may then close any open audit_event file, deallocate
storage, and so forth.
The three functions getauevent_r(), getauevnam_r(), and getauevnum_r() each take an argument e which is a pointer to an au_event_ent_t. This pointer is returned on a successful function call. To assure there is enough space for the information returned, the applications programmer should be sure to allocate AU_EVENT_NAME_MAX and AU_EVENT_DESC_MAX bytes for the ae_name and ac_desc elements of the au_event_ent_t data structure.
The internal representation of an audit_event entry is an struct au_event_ent structure defined in <bsm/libbsm.h> with
the following members:
au_event_t ae_number
char *ae_name;
char *ae_desc*;
au_class_t ae_class;
getauevent(), getauevnam(), getauevnum(), getauevent_r(), getauevnam_r(), and getauevnum_r() return a pointer to a struct au_event_ent if the requested entry is successfully located; otherwise it returns NULL.
getauevnonam() returns an event number of type au_event_t if it successfully enumerates an entry; otherwise it returns NULL, indicating
it could not find the requested event name.
See attributes(5) for descriptions of the following
attributes:
The functions getauevent(), getauevnam(), and getauevnum() are not MT-Safe; however, there are equivalent functions: getauevent_r(), getauevnam_r(), and getauevnum_r() -- all of which provide the same functionality and a MT-Safe function call interface.
bsmconv(1M), getauclassent(3BSM), getpwnam(3C), audit_class(4), audit_event(4), passwd(4), attributes(5)
All information for the functions getauevent(), getauevnam(), and getauevnum() is contained in a static area, so it must be copied if it is
to be saved.
The functionality described in this man page is available only if the Basic Security Module (BSM) has been enabled. See bsmconv(1M) for more information. | http://www.shrubbery.net/solaris9ab/SUNWaman/hman3bsm/getauevent.3bsm.html | CC-MAIN-2016-36 | refinedweb | 415 | 52.29 |
Using properties on pages not in EPiServer
Sometimes I’ve had some use for a page on a site which isn’t a EPiServer page. Some pages should just be used once or a page that the editor shouldn’t touch. I found a use for it when I had to create a password recovery page. I couldn’t see a benefit in having it cluttering the page tree.
The problem comes when we want to use the master page from our site which uses properties or page listings. The problem is that the properties don’t know which page you are on, since you aren’t on an episerver page. The solution is to inherit from a base page like the following, or just to implement in on the page itself.
public class EPiServerContextPageBase : Page, ICurrentPage, IPageSource { public EPiServerContextPageBase() { CurrentPage = DataFactory.Instance.GetPage(PageReference.StartPage); } private PageData currentPage; public EPiServer.Core.PageData CurrentPage { get { return currentPage; } set { currentPage = value; } } public PageDataCollection GetChildren(PageReference pageLink) { return DataFactory.Instance.GetChildren(pageLink); } public PageData GetPage(PageReference pageLink) { return DataFactory.Instance.GetPage(pageLink); } }
These interfaces creates a context for properties and lists to work.
I hope you found it useful. :)
you could also do it like this
public partial class Test : SystemPageBase
{
}
But your code makes it easy to change the default page thou
Anders: I like that way, but it somwhow feels odd to use a System page for display, and not just for administrative stuff. On the other hand, naming should not stand in the way for putting it to great use. Your way is better since it hooks up other stuff such as the translations in surrounding code like the UserControlBase. Thanks for the tip.
Using SystemPageBase seem to have some unexpected downsides when creating customer facing pages. Like textboxes getting class="episize240" added. I think Ill go back to using my original base page and take the consequesces. | https://world.episerver.com/blogs/Hjalmar-Moa/Dates/2011/1/Using-properties-on-pages-not-in-EPiServer/ | CC-MAIN-2021-17 | refinedweb | 319 | 64.81 |
Bit blit in Toit
The bitmap library contains a powerful tool for manipulating byte arrays, called blit.
The full API is documented in the library documentation. This document provides more of a conceptual overview.
Motivation
Tight loops manipulating byte arrays often follow a set pattern. The blit function is implemented in C++ and can be faster than pure Toit code for manipulations that can be expressed as a traversal of a byte array, seen as a two-dimensional array of values.
Model
Blit reads a series of lines from a source byte array, manipulates the bytes, and then writes them to a destination byte array. The number of bytes per line is specified, and the operation stops when it hits the end of either the source array or destination array. Only whole lines are processed, so the operation may stop early if the byte array size is not a multiple of the line size.
If the whole array is not to be processed, for example if you want to start at an offset other than zero, or stop before the end, byte array slices are used to describe the extent of the blit operation.
If the array is not arranged as a two-dimensional array, the line length can be specified to match the entire length of the array, and it will be processed as one line.
For example to create a new byte array with only the low four bits of each byte in a source array you can write:
import bitmap show blit mask_four_bits source/ByteArray -> ByteArray: destination := ByteArray source.size blit source destination source.size // Line length is whole array. --mask=0xf // Perform dest_byte = source_byte & 0xf. return destination main: source := #[0xff, 0x3e, 0x9f] print (mask_four_bits source) // => #[0xf, 0xe, 0xf]
You can specify a pixel stride for source and destination. This lets you read or write only every 2nd (or nth) byte. For example you might want to double the size of a byte array, writing alternately the high and low halves of the original byte array:
import bitmap show blit explode_nibbles source/ByteArray -> ByteArray: destination := ByteArray source.size * 2 // Put high nibble in even destination bytes. blit source destination source.size // Line length is whole array. --destination_pixel_stride=2 --shift=4 // Rotate 4 bits to the left --mask=0xf // Extract the high nibble after rotation. // Put low nibble in odd destination bytes. blit source destination[1..] // Write into destination with offset 1. source.size // Line length is whole array. --destination_pixel_stride=2 --mask=0xf // Extract the low nibble return destination main: source := #[0xff, 0x3e, 0x9f] print (explode_nibbles source) // => #[0xf, 0xf, 0x3, 0xe, 0x9, 0xf]
Line strides
When using blit for line-oriented operations it is often the case that the
lines are not adjacent. Or you might be writing only the first 4 bytes of each
line, but each line has 10 bytes in it. In this case you can use
--destination_line_stride and
--source_line_stride to specify the
distance in bytes between adjacent lines. You can also use this to
manipulate only every second line, by specifying a line stride that is
twice as large as the line length.
By making use of both slices and line strides, you can copy an arbitrary rectangle from one byte array into a rectangle of another byte array. In the example below we place the image in the top left of the destination, but we could place it anywhere by using a slice of the destination byte array.
By using
destination_pixel_stride you can write every second byte
in the output, giving the following result.
| https://docs.toit.io/language/sdk/blit/ | CC-MAIN-2022-40 | refinedweb | 591 | 61.77 |
On 10/18/2016 09:46 AM, Juergen Gross wrote: > On 14/10/16 20:05, Boris Ostrovsky wrote: >> We are replacing existing PVH guests with new implementation. >> >> Signed-off-by: Boris Ostrovsky <boris.ostrov...@oracle.com> > Reviewed-by: Juergen Gross <jgr...@suse.com> > > with the following addressed: > >> diff --git a/include/xen/xen.h b/include/xen/xen.h >> index f0f0252..d0f9684 100644 >> --- a/include/xen/xen.h >> +++ b/include/xen/xen.h >> @@ -29,17 +29,6 @@ enum xen_domain_type { >> #define xen_initial_domain() (0) >> #endif /* CONFIG_XEN_DOM0 */ >> >> -#ifdef CONFIG_XEN_PVH >> -/* This functionality exists only for x86. The XEN_PVHVM support exists >> - * only in x86 world - hence on ARM it will be always disabled. >> - * N.B. ARM guests are neither PV nor HVM nor PVHVM. >> - * It's a bit like PVH but is different also (it's further towards the H >> - * end of the spectrum than even PVH). >> - */ >> -#include <xen/features.h> >> -#define xen_pvh_domain() (xen_pv_domain() && \ >> - xen_feature(XENFEAT_auto_translated_physmap)) >> -#else >> #define xen_pvh_domain() (0) > Any reason you don't remove this, too (together with its last user in > arch/x86/xen/grant-table.c) ?
Advertising
grant-table.c is in fact one of the reasons: we will be using that code for PVHv2 again so I kept it to avoid unnecessary code churn. Also, we want to have a nop definition of xen_pvh_domain() for !CONFIG_XEN_PVH. -boris _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org | https://www.mail-archive.com/xen-devel@lists.xen.org/msg84561.html | CC-MAIN-2016-44 | refinedweb | 228 | 50.23 |
Back to GarbageCollectorNotes queue timer interrupt) the way OS threads are [cross check if there is some time sliced mechanism]. Instead they are interrupted.
More about Capabilities
It is useful to understand capabilities well because it is closely tied to the maintenance of the program roots and multithreading in Haskell - all of which the GC has to be aware of. If however you are reading this the first time, you may want to skip this section and come back to it later.
Capabilities are defined in capability.h. The file OSThreads.h provide an platform neutral absraction for OS level threads used by Haskell.
struct Capability_ { // State required by the STG virtual machine when running Haskell // code. During STG execution, the BaseReg register always points // to the StgRegTable of the current Capability (&cap->r). StgFunTable f; StgRegTable r; nat no; // capability number. // The Task currently holding this Capability. This task has // exclusive access to the contents of this Capability (apart from // returning_tasks_hd/returning_tasks_tl). // Locks required: cap->lock. Task *running_task; // true if this Capability is running Haskell code, used for // catching unsafe call-ins. rtsBool in_haskell; // The run queue. The Task owning this Capability has exclusive // access to its run queue, so can wake up threads without // taking a lock, and the common path through the scheduler is // also lock-free. StgTSO *run_queue_hd; StgTSO *run_queue_tl; // Tasks currently making safe foreign calls. Doubly-linked. // When returning, a task first acquires the Capability before // removing itself from this list, so that the GC can find all // the suspended TSOs easily. Hence, when migrating a Task from // the returning_tasks list, we must also migrate its entry from // this list. Task *suspended_ccalling_tasks; // One mutable list per generation, so we don't need to take any // locks when updating an old-generation thunk. These // mini-mut-lists are moved onto the respective gen->mut_list at // each GC. bdescr **mut_lists; #if defined(THREADED_RTS) // Worker Tasks waiting in the wings. Singly-linked. Task *spare_workers; // This lock protects running_task, returning_tasks_{hd,tl}, wakeup_queue. Mutex lock; // Tasks waiting to return from a foreign call, or waiting to make // a new call-in using this Capability (NULL if empty). // NB. this field needs to be modified by tasks other than the // running_task, so it requires cap->lock to modify. A task can // check whether it is NULL without taking the lock, however. Task *returning_tasks_hd; // Singly-linked, with head/tail Task *returning_tasks_tl; // A list of threads to append to this Capability's run queue at // the earliest opportunity. These are threads that have been // woken up by another Capability. StgTSO *wakeup_queue_hd; StgTSO *wakeup_queue_tl; #endif // Per-capability STM-related data StgTVarWaitQueue *free_tvar_wait_queues; StgTRecChunk *free_trec_chunks; StgTRecHeader *free_trec_headers; nat transaction_tokens; }; // typedef Capability, defined in RtsAPI.h
Question - if a capability can consist of multiple OS threads then in THREADED_RTS, where is the list of current threads in execution?
Here are some important observations about a capability: it consists of essentially a collection of OS threads, a register set and a set of TSOs. The register set is the member of type 'r'. Real hardware may or may not provide mappings of these to actual registers. [Anything else to add here?].
TSO
TSO stands for Thread State Object and is the abstract for a haskell thread from the perspective of the RTS. TSO's are defined in TSO.h.
typedef struct StgTSO_ { StgHeader header; struct StgTSO_* link; /* Links threads onto blocking queues */ struct StgTSO_* global_link; /* Links all threads together */ StgWord16 what_next; /* Values defined in Constants.h */ StgWord16 why_blocked; /* Values defined in Constants.h */ StgWord32 flags; StgTSOBlockInfo block_info; struct StgTSO_* blocked_exceptions; StgThreadID id; int saved_errno; struct Task_* bound; struct Capability_* cap; struct StgTRecHeader_ * trec; /* STM transaction record */ #ifdef TICKY_TICKY /* TICKY-specific stuff would go here. */ #endif #ifdef PROFILING StgTSOProfInfo prof; #endif #ifdef PAR StgTSOParInfo par; #endif #ifdef GRAN StgTSOGranInfo gran; #endif #ifdef DIST StgTSODistInfo dist; #endif /* The thread stack... */ StgWord32 stack_size; /* stack size in *words* */ StgWord32 max_stack_size; /* maximum stack size in *words* */ StgPtr sp; StgWord stack[FLEXIBLE_ARRAY]; } StgTSO;
Probably the single most important part of a TSO from the perspective of the GC is the stack that it contains. This stack is essentially the 'roots of the program'.
A TSO is treated like any other object by the GC and it resides in the program heap. A TSO is always part of its mut list. A TSO is considered "clean" if it does not contain pointers to previous generations. This happens in the case where a TSO went through a GC and the objects it refers to got promoted. It then didn't allocate any memory since (maybe it didn't get scheduled) till the next GC. In that case it is considered "clean" - being clean is indicated by its dirty bit (tso->flags & TSO_DIRTY) not being set.
Terminology
This is a good point to introduce some terminology related to the above -
- task - is essentially an OS thread executing a forgein function call. The haskell thread that needed to execute the FFI call is attached to this thread for the entire duration of the forgein call. [is there something more that I can say here?] | https://ghc.haskell.org/trac/ghc/wiki/CapabilitiesAndScheduling?version=7 | CC-MAIN-2016-44 | refinedweb | 848 | 55.24 |
To open scheduled tasks in Sana Admin click:
Tools > Scheduled tasks.
In Sana Admin there are 8 scheduled tasks:
On the Scheduled tasks page you can see the
list of tasks, their status and last result, last run time and next
run time.
The table below provides the description of the buttons on the
Scheduled tasks page:
There are two options for the Product
import and Customer
import tasks:
When you click Start, without choosing the
alternative task, the index will be updated as this action is set
by default.
Multiple tasks can be run simultaneously.
By default Sana Commerce scheduled tasks are installed within the
system, but it also possible to install and use the Sana Commerce
Task Service as a Windows service. For more information, see
'Sana
Commerce Task Service'.
Below you can read the detailed information about each task and
how to configure it.
The multilingual fields are also indexed for all configured
languages (title, description, product group, item category and
others). When a translation is not available the default
description is indexed for that language.
The index should be updated when some products have been
modified in the database.
When you change the index fields or visibility of prices in the
maintenance mode you should run the product import task to
make all recent changes take effect.
For more information about the index fields, see 'ERP
Integration'.
For more information about prices visibility in the maintenance
mode, see 'Products'.
To configure the Product import task click
Edit.
The table below provides the description of the Product
import task settings:
If you enable Run on schedule you should enter
either the interval in minutes when the task should run
automatically or the fixed time.
When the list of customers is indexed they become available for
managing the shop accounts in Sana Admin.
For more information about shop accounts management in Sana
Admin, see 'Shop
Accounts'.
When you add a new customer/contact/sales agent to your ERP
system or change the name of a customer in ERP you should run the
Customer import task to update the customers
information.
To configure the Customer import task
click Edit.
The table below provides the description of the Customer
import task settings:
For more information about maintenance mode, see 'ERP
Connection'.
For more information about sales orders that are placed in the
maintenance mode, see 'Orders'.
The General information import task is used to
synchronize data with your ERP system to be able to run the
webstore in the maintenance mode when connection to ERP
is not available. If data is not synchronized with your ERP system
the webstore will not be able to switch to the maintenance mode.
The task can be run only when connection to your ERP is
available.
This task synchronizes the following data with your ERP
system:
We recommend to run this task when the products catalog and
customers in your ERP system are ready to synchronize the above
mentioned data and before you are planning to switch you webstore
to the maintenance mode intentionally due to some reasons, for
example because of the planned hardware/software maintenance.
During synchronization data is stored in the SQL database and
thus can be used in the maintenance mode. When the webstore is in
the maintenance mode the data of the last synchronization will be
used.
In the maintenance mode you can show/hide prices in the
webstore. To enable/disable prices in the maintenance mode in Sana
Admin click: Setup > Products
> Price > Price visibility when ERP
connection is not available. Enabling this option
requires reindexing of the products.
If your webstore is in the maintenance mode and the option Price
visibility when ERP.
The table below provides the description of the General
information import task settings:
For more information, see 'Product
Images'.
The table below provides the description of the Product
image import task settings:
All web pages are available for indexing:
The URLs of the pages in different languages are also created in
the 'sitemap' files when the webstore is multi-language.
The tables below provide the description of the Sitemap
export task settings:
Providers
Use Providers to configure web pages for
indexing:
'Always' is used to mark web pages that change each time when
they are accessed. 'Never' is used to mark archived URLs (for
example files that will not be changed again).
When the sitemap file has been created and placed on the web
server, you need to inform the search engines that support this
protocol of its location. You can do this by specifying the
location of the sitemap using the 'robots.txt' file, which must be
placed in the root of the web store hierarchy. To do this, add the
following line to the 'robots.txt' file including the full URL to
the sitemap:
For more information about sitemaps, please visit this website:
This is necessary when connection to your ERP system is not
available for some reasons and your webstore has switched to the
maintenance mode. This task checks the connection and when it is
available again it switches the webstore to the online mode
automatically.
The table below provides the description of the ERP
connection status check task settings:
See also:
ERP
Connection
Unprocessed
Orders
General Information
Import
If IIS has been restarted, the System - task
scheduler task will run after the first request to the
webstore.
The table below provides the description of the System -
task scheduler task settings:
The Authorize.Net bank account confirmation
task checks the status of the orders which are transferred through
the Authorize.Net Payment Provider ECheck.Net method.
The table below provides the description of the
Authorize.Net bank account confirmation task
settings: | http://help.sana-commerce.com/sana-commerce-90/user_guide/tools/scheduled-tasks | CC-MAIN-2018-13 | refinedweb | 950 | 59.64 |
Open a file stream
#include <stdio.h> FILE * fopen( const char * filename, const char * mode ); FILE * fopen64( const char * filename, const char * mode );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The fopen() function opens a file stream for the file specified by filename. The fopen64() function is a large-file support version of fopen().
The mode string begins with one of the following sequences: QNX Neutrino, there's no difference between text files and binary files.
(QNX Neutrino 7.0 or later) You can add x to the w and w+ specifiers to prevent the function from overwriting the file if it already exists.
The largest value that can be represented correctly in an object of type off_t is the offset maximum in the open file description.
By default, each stream gets a buffer of BUFSIZ characters. It's allocated when you first read from or write to the stream, and the stream I/O functions use it for their internal purposes. If you're reading and writing large amounts of data, you can improve performance by increasing the size of this internal buffer from the default specified by BUFSIZE:
#include <stdio.h> #include <stdlib.h> int main( void ) { FILE *fp; fp = fopen( "report.dat", "r" ); if( fp != NULL ) { /* rest of code goes here */ fclose( fp ); return EXIT_SUCCESS; } return EXIT_FAILURE; }
fopen() is ANSI, POSIX 1003.1; fopen64() is Large-file support | https://www.qnx.com/developers/docs/7.1/com.qnx.doc.neutrino.lib_ref/topic/f/fopen.html | CC-MAIN-2022-40 | refinedweb | 243 | 66.13 |
Hey React engineers! In this article, I'll explain the 4 most important hooks you need to know in React. Don't worry, I'll not write a long essay and bore you. If you love simplistic articles that get straight to the point, this is the article you need to understand these hooks.
[1] useState
The simplest of the 4 hooks I'm going to explain in this article. useState allows you to have a state variable in functional component. If you're confused, it's just a normal variable which can make a component re-render when the value of the variable is changed (to be exact, in most cases). For example:
import { useState } from "react"; function demo() { const [isVisible, setIsVisible] = useState(true); return <>{isVisible && <h1>I'm visible</h1>}</>; } export default demo;
Use useState in functional component. The argument (initial value) can be anything, such as numbers, boolean values, etc. In this case, true (boolean). Doing this gives us two things in an array, the first is the actual variable itself and then a function to update the value of that variable. In this case, we're destructuring the two values right away which is the convention. Now, it's just a normal variable. To set its value use the dedicated function that we destructured earlier like this:
setIsVisible(false);
That's it. The only special thing to note is that state variables allow you to re-render components upon change of data (in most cases).
[2] useEffect
Used in one of the following two cases. One is to trigger something when the function it is in is rendered. Another is to trigger something when a specific data it is assigned to keep an eye on is changed.
Case 1:
import { useEffect } from "react"; function demo() { useEffect(() => { console.log("Like my post!"); }, []); } export default demo;
Please take note that the second argument is array of dependencies. In this case useEffect is not keeping an eye on any data, thus it will not get executed (except for the first time this component is rendered). Therefore, we'll only see "Like my post!" in console for the first time.
Case 2:
import { useEffect } from "react"; function demo() { const data = [1, 2, 3]; useEffect(() => { console.log("Like my post!"); }, [data]); } export default demo;
In this case, useEffect is keeping an eye on variable called data. Therefore, if you change this data a million times, you'll see "Like my post!" in console a million times.
Edit: credits to Harsh Wardhan from comment section below because he suggested me to add the 3rd case for useEffect, which is the cleanup function. Basically, just before the last right curly brace in useEffect, you can write a "return" keyword followed by function used to do cleaning up. For example, maybe you've got a timer in useEffect that is used to refresh a component, say every 5 minutes. When the component is unmounted, you need to stop that timer, otherwise there's going to be a memory leakage. By the way, the equivalent of this in class component is componentWillUnmount(), which basically means if the component will unmount, clean it up (of course you need to implement the cleaning logic yourself).
[3] useContext
What this hook means is that you can send a data from a component to all child components. Now, all child components are ELIGIBLE to get that data and if they want to, the child components may choose to consume that data using useContext. Example:
const whateverContext = React.createContext(); <whateverContext.Provider value={whateverValue}> <> <ChildComponent1 /> <ChildComponent2 /> <ChildComponent3 /> </> </whateverContext.Provider>
Here, after creating the context, the parent component wraps the child component (make sure to append .Provider to provide data to child component) and passed whateverValue as the value. At this point, all child components are ELIGIBLE to get the data. Let's assume ChildComponent3 wants to consume the data. Here's how it would do that:
const whateverValue = useContext(whateverContext);
That's it. Basically, useContext is an elegant solution instead of prop drilling. Please take note that useContext is NOT a replacement to Redux. The reason will be explained in upcoming post. However, be assured that you can build pretty much any application easily by using useContext.
[4] useRef
Everyone talks about it, no one really uses it. First, let's look at the problem:
<ScrollView onContentSizeChange={() => }> // ... </ScrollView>
Now, for whatever reason, we've got a component named ScrollView with incomplete onContentSizeChange() attribute. The challenge is,
inside onContentSizeChange(), we need to reference this ScrollView and invoke a function called scrollToEnd(). How can this component refer itself? I guess useRef would help. Here's the solution:
function abc() { const scrollView = useRef(); return ( <View> <ScrollView ref={scrollView} horizontal onContentSizeChange={() => scrollView.current.scrollToEnd()} > // ...
See, first useRef was called and the output was given a value called scrollView. Then, ScrollView component is connected with the scrollView reference from useRef (ref={scrollView}). Finally, now that we've got a reference to this component and connected it, we can call the function we wanted to inside onContentSizeChange, and that is scrollView.current.scrollToEnd(), where current references the current ScrollView component.
That's it. If you find this informative, please give this article a like as I've spent an hour writing it (had to review my notes).
Discussion (35) | https://practicaldev-herokuapp-com.global.ssl.fastly.net/ishakmohmed/react-hooks-usecontext-useeffect-usestate-useref-summarized-like-crazy-short-concise-article-254k | CC-MAIN-2021-31 | refinedweb | 882 | 57.06 |
Localising the DisplayAttribute and avoiding magic strings in ASP.NET Core
This post follows on from my previous post about localising an ASP.NET Core application. At the end of that article, we had localised our application so that the user could choose their culture, which would update the page title and the validation attributes with the appropriate translation, but not the form labels. In this post, we cover some of the problems you may run into when localising your application and approaches to deal with them.
Brief Recap
Just so we're all on the same page, I'll briefly recap how localisation works in ASP.NET Core. If you would like a more detailed description, check out my previous post or the documentation.
Localisation is handled in ASP.NET Core through two main abstractions
IStringLocalizer and
IStringLocalizer<T>. These allow you to retrieve the localised version of a key by passing in a string; if the key does not exist for that resource, or you are using the default culture, the key itself is returned as the resource:
public class ExampleClass { public ExampleClass(IStringLocalizer<ExampleClass> localizer) { // If the resource exists, this returns the localised string var localisedString1 = _localizer["I exist"]; // "J'existe" // If the resource does not exist, the key itself is returned var localisedString2 = _localizer["I don't exist"]; // "I don't exist" } }
Resources are stored in .resx files that are named according to the class they are localising. So for example, the
IStringLocalizer<ExampleClass> localiser would look for a file named (something similar to) ExampleClass.fr-FR.resx. Microsoft recommends that the resource keys/names in the .resx files are the localised values in the default culture. That way you can write your application without having to create any resource files - the supplied string will be used as the resource.
As well as arbitrary strings like this,
DataAnnotations which derive from
ValidationAttribute also have their
ErrorMessage property localised automatically. However the
DisplayAttribute and other non-
ValidationAttributes are not localised.
Finally, you can localise your Views, either providing whole replacements for your View by using filenames of the form Index.fr-FR.cshtml, or by localising specific strings in your view with another abstraction, the
IViewLocalizer, which acts as a view-specific wrapper around
IStringLocalizer.
Some of the pitfalls
There are two significant issues I personally find with the current state of localisation;
- Magic strings everywhere
- Can't localise the
DisplayAttribute
The first of these is a design decision by Microsoft, to reduce the ceremony of localising an application. Instead of having to worry about extracting all your hard coded strings out of the code and into .resx files, you can just wrap it in a call to the
IStringLocalizer and worry about localising other languages down the line.
While the attempt to improve productivity is a noble goal, it comes with a risk. The problem is that the string values embedded in your code (
"I exist" and
"I don't exist" in the code above) are serving a dual purpose, both as a string resource for the default culture, and as a key into a resource dictionary.
Inevitably, at some point you will introduce a typo into one of your string resources, it's just a matter of time. You better be sure whoever spots it understands the implications of changing it however, as fixing your typo will cause every other localised language to break. The default resource which is embedded in your code can only be changed if you ensure that every other resource file changes at the same time. That coupling is incredibly fragile, and it will not necessarily be obvious to the person correcting the typo that anything has broken. It is only obvious if they explicitly change culture and notice that the string is no longer localised.
The second issue related to the
DisplayAttribute seems like a fairly obvious omission - by it's nature it contains values which are normally highly visible (used as labels for a form) and will pretty much always need to be localised. As I'll show shortly there are workarounds for this, but currently they are rather clumsy.
It may be that these issues either don't bother you or are not a big deal, but I wanted to work out how to deal with them in a way that made me more comfortable. In the next sections I show how I did that.
Removing the magic strings
Removing the magic strings is something that I tend to do in any new project. MVC typically uses strings for any sort of dictionary storage, for example Session storage, ViewData, AuthorizationPolicy names, the list goes on. I've been bitten too many times by subtle typos causing unexpected behaviour that I like to pull these strings into utility classes with names like
ViewDataKeys and
PolicyNames:
public static class ViewDataKeys { public const string Title = "Title"; }
That way, I can use the strongly typed
Title property whenever I'm accessing ViewData - I get intellisense, avoid typos and get renaming safely. This is a pretty common approach, and it can be applied just as easily with our localisation problem.
public static class ResourceKeys { public const string HomePage = "HomePage"; public const string Required = "Required"; public const string NotAValidEmail = "NotAValidEmail"; public const string YourEmail = "YourEmail"; }
Simply create a static class to hold your string key names, and instead of using the resource in the default culture as the key, use the appropriate strongly typed member:
public class HomeViewModel { [Required(ErrorMessage = ResourceKeys.Required)] [EmailAddress(ErrorMessage = ResourceKeys.NotAValidEmail)] [Display(Name = "Your Email")] public string Email { get; set; } }
Here you can see the
ErrorMessage properties of our
ValidationAttributes reference the static properties instead of the resource in the default culture.
The final step is to add a .resx file for each localised class for the default language (without a culture suffix on the file name). This is the downside to this approach that Microsoft were trying to avoid with their design, and I admit, it is a bit of a drag. But at least you can fix typos in your strings without breaking all your other languages!
How to Localise DisplayAttribute
Now we have the magic strings fixed, we just need to try and localise the DisplayAttribute. As of right now, the only way I have found to localise the display attribute is to use the legacy localisation capabilities which still reside in the
DataAnnotation attributes, namely the
ResourceType property.
This property is a
Type, and allows you to specify a class in your solution that contains a static property corresponding to the value provided in the
Name of the
DisplayAttribute. This allows us to use the Visual Studio resource file designer to auto-generate a backing class with the required properties to act as hooks for the localisation.
If you create a .resx file in Visual Studio without a culture suffix, it will automatically create a .designer.cs file for you. With the new localisation features of ASP.NET Core, this can typically be deleted, but in this case we need it. Generating the above resource file in Visual Studio will generate a backing class similar to the following:
public class ViewModels_HomeViewModel { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; // details hidden for brevity public static string NotAValidEmail { get { return ResourceManager.GetString("NotAValidEmail", resourceCulture); } } public static string Required { get { return ResourceManager.GetString("Required", resourceCulture); } } public static string YourEmail { get { return ResourceManager.GetString("YourEmail", resourceCulture); } }
We can now update our display attribute to use the generated resource, and everything will work as expected. We'll also remove the magic string from the
Name attribute at this point and move the resource into our .resx file:
public class HomeViewModel { [Required(ErrorMessage = ResourceKeys.Required)] [EmailAddress(ErrorMessage = ResourceKeys.NotAValidEmail)] [Display(Name = ResourceKeys.YourEmail, ResourceType = typeof(Resources.ViewModels_HomeViewModel))] public string Email { get; set; } }
If we run our application again, you can see that the display attribute is now localised to say 'Votre Email' - lovely!
How to localise DisplayAttribute in the future
If that seems like a lot of work to get a localised
DisplayAttribute then you're not wrong. That's especially true if you're not using Visual Studio, and so don't have the resx-auto-generation process.
Unfortunately it's a tricky problem to work around currently, in that it's just fundamentally not supported in the current version of MVC. The localisation of the
ValidationAttribute.ErrorMessage happens deep in the inner workings of the MVC pipeline (in the
DataAnnotationsMetadataProvider) and this is ideally where the localisation of the
DisplayAttribute should be happening.
Luckily, this has already been fixed and is currently on the development branch of the ASP.NET Core repo. Theoretically that means it should appear in the 1.1.0 release when that happens, but we are at very early days at the moment!
Still, I wanted to give the current implementation a test, and luckily this is pretty simple to setup, as all the ASP.NET Core packages produced as part of the normal development workflow are pushed to various public MyGet feeds. I decided to use the 'aspnetcore-dev' feed, and updated my application to pull NuGet packages from it.
Be aware that pulling packages from this feed should not be something you do in a production app. Things are likely to change and break, so stick to the release NuGet feed unless you are experimenting or you know what you're doing!
Adding a pre-release MVC package
First, add a nuget.config file to your project and configure it to point to the aspnetcore-dev feed:
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="AspNetCore" value="" /> <add key="NuGet" value="" /> </packageSources> </configuration>
Next, update the MVC package in your project.json to pull down the latest package, as of writing this was version
1.1.0-alpha1-22152, and run a
dotnet restore.
{ "dependencies": { ... "Microsoft.AspNetCore.Mvc": "1.1.0-alpha1-22152", ... } }
And that's it! We can remove the ugly
ResourceType property from a
DisplayAttribute, delete our resource .designer.cs file and everything just works as you would expect. If you are using the magic string approach, that just works, or you can use the approach I described above with
ResourceKeys.
public class HomeViewModel { [Required(ErrorMessage = ResourceKeys.Required)] [EmailAddress(ErrorMessage = ResourceKeys.NotAValidEmail)] [Display(Name = ResourceKeys.YourEmail)] public string Email { get; set; } }
As already mentioned, this is early pre-release days, so it will be a while until this capability is generally available, but it's heartening to see it ready and waiting!
The final slight bugbear I have with the current localisation implementation is the resource file naming. As described in the previous post, each localised class or view gets its own embedded resource file that has to match the file name. I was toying with the idea of having a a single .resx file for each culture which contains all the required strings instead, with the resource key prefixed by the type name, but I couldn't see any way of doing this out of the box.
You can get close to this out of the box, by using a 'Shared resource' as the type parameter in injected
IStringLocalizer<T>, so that all the resources using it will, by default, be found in a single .resx file. Unfortunately that only goes part of the way, as you are still left with the
DataAnnotations and
IViewLocalizer which will use the default implementations, and expect different files per class.
As far as I can see, in order to achieve this, we need to replace the
IStringLocalizer and
IStringLocalizerFactory services with our own implementations that will load the strings from a single file. Given this small change, I looked at just overriding the default
ResourceManagerStringLocalizerFactory implementation, however the methods that would need changing are not
virtual, which leaves us re-implementing the whole class again.
The code is a little long and tortuous, and this post is already long enough, so I won't post it here, but you can find the approach I took on GitHub. It is in a somewhat incomplete but working state, so if anyone is interested in using it then it should provide a good starting point for a proper implementation.
For my part, and given the difficulty of working with .resx files outside of Visual Studio, I have started to look at alternative storage formats. Thanks to the use of abstractions like
IStringLocalizerFactory in ASP.NET Core, it is perfectly possible to load resources from other sources.
In particular, Damien has a great post with source code on GitHub on loading resources from the database using Entity Framework Core. Alternatively, Ronald Wildenberg has built a JsonLocalizer which is available on GitHub.
Summary
In this post I described a couple of the pitfalls of the current localisation framework in ASP.NET Core. I showed how magic strings could be the source of bugs and how to replace them with a static helper class.
I also showed how to localise the
DisplayAttribute using the
ResourceType property as required in the current 1.0.0 release of ASP.NET Core, and showed how it will work in the (hopefully near) future.
Finally I linked to an example project that stores all resources in a single file per culture, instead of a file per resource type. | http://andrewlock.net/localising-the-displayattribute-and-avoiding-magic-strings-in-asp-net-core/ | CC-MAIN-2016-50 | refinedweb | 2,225 | 52.7 |
Hello,
Im kinda new to scripting with python and I would like to convert my messy GH script into python. What I want to do is to convert truss geometry below into python script.
I’ve spend some time searching and trying but it seems I got stuck pretty much in the first steps
import rhinoscriptsyntax as rs #import start & end point of truss, height of truss, segmentation count pt1 = rs.coerce3dpoint(start) pt2 = rs.coerce3dpoint(end) segments = division height = -height #create bottom chord line line = rs.AddLine(pt1,pt2) #divide bottom chord division_points = rs.DivideCurve(line,segments,True,True) #copy points to defined height of truss height_point = rs.CreatePoint(0,0,height) translation_top = pt1-height_point top_chord = rs.CopyObjects(division_points,translation_top) a = line b = division_points c = top_chord
I have no idea how to proceed and I would like to ask you guys for some help. Anybody willing to share some thougths on how to make such geometry? Ive tried to search for references but with no results. Thank to anybody willing to help!
EDIT:
GH files attached. (Original one and python one)
Truss_Python_v00.gh (6.1 KB)
Truss_v04.gh (28.0 KB)
Dan. | https://discourse.mcneel.com/t/truss-script-in-python/82171 | CC-MAIN-2019-26 | refinedweb | 193 | 69.28 |
Continuation Passing Style (CPS for short) is a style of programming in which functions do not return values; rather, they pass control onto a continuation, which specifies what happens next. In this chapter, we are going to consider how that plays out in Haskell and, in particular, how CPS can be expressed with a monad.
Contents
What are continuations?Edit
To dispel puzzlement, we will have a second look at an example from way back in the book, when we introduced the
($) operator:
> map ($ 2) [(2*), (4*), (8*)] [4,8,16]
There is nothing out of ordinary about the expression above, except that it is a little quaint to write that instead of
map (*2) [2, 4, 8]. The
($) section makes the code appear backwards, as if we are applying a value to the functions rather than the other way around. And now, the catch: such an innocent-looking reversal is at heart of continuation passing style!
From a CPS perspective,
($ 2) is a suspended computation: a function with general type
(a -> r) -> r which, given another function as argument, produces a final result. The
a -> r argument is the continuation; it specifies how the computation will be brought to a conclusion. In the example, the functions in the list are supplied as continuations via
map, producing three distinct results. Note that suspended computations are largely interchangeable with plain values:
flip ($) [1] converts any value into a suspended computation, and passing
id as its continuation gives back the original value.
What are they good for?Edit
There is more to continuations than just a parlour trick to impress Haskell newbies. They make it possible to explicitly manipulate, and dramatically alter, the control flow of a program. For instance, returning early from a procedure can be implemented with continuations. Exceptions and failure can also be handled with continuations - pass in a continuation for success, another continuation for fail, and invoke the appropriate continuation. Other possibilities include "suspending" a computation and returning to it at another time, and implementing simple forms of concurrency (notably, one Haskell implementation, Hugs, uses continuations to implement cooperative concurrency).
In Haskell, continuations can be used in a similar fashion, for implementing interesting control flow in monads. Note that there usually are alternative techniques for such use cases, especially in tandem with laziness. In some circumstances, CPS can be used to improve performance by eliminating certain construction-pattern matching sequences (i.e. a function returns a complex structure which the caller will at some point deconstruct), though a sufficiently smart compiler should be able to do the elimination [2].
Passing continuationsEdit
An elementary way to take advantage of continuations is to modify our functions so that they return suspended computations rather than ordinary values. We will illustrate how that is done with two simple examples.
pythagorasEdit)
Modified to return a suspended computation,
pythagoras $ k
How the
pythagoras_cps example works:
- square x and throw the result into the (\x_squared -> ...) continuation
- square y and throw the result into the (\y_squared -> ...) continuation
- add x_squared and y_squared and throw the result into the top level/program continuation
k.
We can try it out in GHCi by passing
*Main> pythagoras_cps 3 4 print 25
If we look at the type of
pythagoras_cps without the optional parentheses around
(Int -> r) -> r and compare it with the original type of
pythagoras, we note that the continuation was in effect added as an extra argument, thus justifying the "continuation passing style" moniker.
thriceEdit
Example: A simple higher order function, no continuations
thrice :: (a -> a) -> a -> a thrice f x = f (f (f x))
*Main> thrice tail "foobar" "bar"
A higher order function such as
thrice, when converted to CPS, takes as arguments functions in CPS form as well. Therefore,
f :: a -> a will become
f_cps :: a -> ((a -> r) -> r), and the final type will be
thrice_cps :: (a -> ((a -> r) -> r)) -> a -> ((a -> r) -> r). The rest of the definition follows quite naturally from the types - we replace
f by the CPS version, passing along the continuation at hand.
Example: A simple higher order function, with continuations
thrice_cps :: (a -> ((a -> r) -> r)) -> a -> ((a -> r) -> r) thrice_cps f_cps x = \k -> f_cps x $ \fx -> f_cps fx $ \ffx -> f_cps ffx $ k
The
Cont monadEdit
Having continuation-passing functions, the next step is providing a neat way of composing them, preferably one which does not require the long chains of nested lambdas we have seen just above. A good start would be a combinator for applying a CPS function to a suspended computation. A possible type for it would be:
chainCPS :: ((a -> r) -> r) -> (a -> ((b -> r) -> r)) -> ((b -> r) -> r)
(You may want to try implementing it before reading on. Hint: start by stating that the result is a function which takes a
b -> r continuation; then, let the types guide you.)
And here is the implementation:
chainCPS s f = \k -> s $ \x -> f x $ k
We supply the original suspended computation
s with a continuation which makes a new suspended computation (produced by
f) and passes the final continuation
k to it. Unsurprisingly, it mirrors closely the nested lambda pattern of the previous examples.
Doesn't the type of
chainCPS look familiar? If we replace
(a -> r) -> r with
(Monad m) => m a and
(b -> r) -> r with
(Monad m) => m b we get the
(>>=) signature. Furthermore, our old friend
flip ($) plays a
return-like role, in that it makes a suspended computation out of a value in a trivial way. Lo and behold, we have a monad! All we need now [3] is a
Cont r a type to wrap suspended computations, with the usual wrapper and unwrapper functions.
cont :: ((a -> r) -> r) -> Cont r a runCont :: Cont r a -> (a -> r) -> r
The monad instance for
Cont follows directly from our presentation, the only difference being the wrapping and unwrapping cruft:
instance Monad (Cont r) where return x = cont ($ x) s >>= f = cont $ \c -> runCont s $ \x -> runCont (f x) c
The end result is that the monad instance makes the continuation passing (and thus the lambda chains) implicit. The monadic bind applies a CPS function to a suspended computation, and
runCont is used to provide the final continuation. For a simple example, the Pythagoras example becomes:
Example: The
pythagoras example, using the Cont monad
-- Using the Cont monad from the transformers package. import Control.Monad.Trans add_cont x_squared y_squared
callCCEdit
While it is always pleasant to see a monad coming forth naturally, a hint of disappointment might linger at this point. One of the promises of CPS was precise control flow manipulation through continuations. And yet, after converting our functions to CPS we promptly hid the continuations behind a monad. To rectify that, we shall introduce
callCC, a function which gives us back explicit control of continuations - but only where we want it.
callCC is a very peculiar function; one that is best introduced with examples. Let us start with a trivial one:
Example:
square using
callCC
-- Without callCC square :: Int -> Cont r Int square n = return (n ^ 2) -- With callCC squareCCC :: Int -> Cont r Int squareCCC n = callCC $ \k -> k (n ^ 2)
The argument passed to
callCC is a function, whose result is a suspended computation (general type
Cont r a) which we will refer to as "the
callCC computation". In principle, the
callCC computation is what the whole
callCC expression evaluates to. The caveat, and what makes
callCC so special, is due to
k, the argument to the argument. It is a function which acts as an eject button: calling it anywhere will lead to the value passed to it being made into a suspended computation, which then is inserted into control flow at the point of the
callCC invocation. That happens unconditionally; in particular, whatever follows a
k invocation in the
callCC computation is summarily discarded. From another perspective,
k captures the rest of the computation following the
callCC; calling it throws a value into the continuation at that particular point ("callCC" stands for "call with current continuation"). While in this simple example the effect is merely that of a plain
return,
callCC opens up a number of possibilities, which we are now going to explore.
Deciding when to use
kEdit
callCC gives us extra power over what is thrown into a continuation, and when that is done. The following example begins to show how we can use this extra power.
Example: Our first proper
callCC function
foo :: Int -> Cont r String foo x = callCC $ \k -> do let y = x ^ 2 + 3 when (y > 20) $ k "over twenty" return (show $ y - 4)
foo is a slightly pathological function that computes the square of its input and adds three; if the result of this computation is greater than 20, then we return from the
callCC computation (and, in this case, from the whole function) immediately, throwing the string
"over twenty" into the continuation that will be passed to
foo. If not, then we subtract four from our previous computation,
show it, and throw it into the continuation. Remarkably,
k here is used just like the 'return' statement from an imperative language, that immediately exits the function. And yet, this being Haskell,
k is just an ordinary first-class function, so you can pass it to other functions like
when, store it in a
Reader, etc.
Naturally, you can embed calls to
callCC within do-blocks:
Example: More developed
callCC example involving a do-block
bar :: Char -> String -> Cont r Int bar c s = do msg <- callCC $ \k -> do let s0 = c : s when (s0 == "hello") $ k "They say hello." let s1 = show s0 return ("They appear to be saying " ++ s1) return (length msg)
When you call
k with a value, the entire
callCC call takes that value. In effect, that makes
k a lot like an 'goto' statement in other languages: when we call
k in our example, it pops the execution out to where you first called
callCC, the
msg <- callCC $ ... line. No more of the argument to
callCC (the inner do-block) is executed. Hence the following example contains a useless line:
Example: Popping out a function, introducing a useless line
quux :: Cont r Int quux = callCC $ \k -> do let n = 5 k n return 25
quux will return
5, and not
25, because we pop out of
quux before getting to the
return 25 line.
Behind the scenesEdit
We have deliberately broken a trend here: normally when we introduce a function we give its type straight away, but in this case we chose not to. The reason is simple: the type is pretty complex, and it does not immediately give insight into what the function does, or how it works. After the initial presentation of
callCC, however, we are in a better position to tackle it. Take a deep breath...
callCC :: ((a -> Cont r b) -> Cont r a) -> Cont r a
We can make sense of that based on what we already know about
callCC. The overall result type and the result type of the argument have to be the same (i.e.
Cont r a), as in the absence of an invocation of
k the corresponding result values are one and the same. Now, what about the type of
k? As mentioned above,
k's argument is made into a suspended computation inserted at the point of the
callCC invocation; therefore, if the latter has type
Cont r a
k's argument must have type
a. As for
k's result type, interestingly enough it doesn't matter as long as it is wrapped in the same
Cont r monad; in other words, the
b stands for an arbitrary type. That happens because the suspended computation made out of the
a argument will receive whatever continuation follows the
callCC, and so the continuation taken by
k's result is irrelevant.
Note
The arbitrariness of
k's result type explains why the following variant of the useless line example leads to a type error:
quux :: Cont r Int quux = callCC $ \k -> do let n = 5 when True $ k n k 25
k's result type could be anything of form
Cont r a; however, the
when constrains it to
Cont r (), and so the closing
k 25 does not match the result type of
quux. The solution is very simple: replace the final
k by a plain old
return.
To conclude this section, here is the implementation of
callCC. Can you identify
k in it?
callCC f = cont $ \h -> runCont (f (\a -> cont $ \_ -> h a)) h
The code is far from obvious. However, the amazing fact is that the implementations of
callCC,
return and
(>>=) for
Cont can be produced automatically from their type signatures - Lennart Augustsson's Djinn [1] is a program that will do this for you. See Phil Gossett's Google tech talk: [2] for background on the theory behind Djinn; and Dan Piponi's article: [3] which uses Djinn in deriving continuation passing style.
Example: a complicated control structureEdit
We will now look at some more realistic examples of control flow manipulation. The first one, presented below, was originally taken from the "The Continuation monad" section of the All about monads tutorial, used with permission.
Example: Using Cont for a complicated control structure
{-
fun is a function that takes an integer
n. The implementation uses
Cont and
callCC to set up a control structure using
Cont and
callCC that does different things based on the range that
n falls in, as stated by the comment at the top. Let us dissect it:
- Firstly, the
(`runCont` id)at the top just means that we run the
Contblock that follows with a final continuation of
id(or, in other words, we extract the value from the suspended computation unchanged)..
Example: exceptionsEdit
One use of continuations is to model exceptions. To do this, we hold on to two continuations: one that takes us out to the handler in case of an exception, and one that takes us to the post-handler code in case of a success. Here's a simple function that takes two numbers and does integer division on them, failing when the denominator is zero. -}
How does it work? We use two nested calls to
callCC. The first labels a continuation that will be used when there's no problem. The second labels a continuation that will be used when we wish to throw an exception. If the denominator isn't 0,
x `div` y is thrown into the
ok continuation, so the execution pops right back out to the top level of
divExcpt. If, however, we were passed a zero denominator, we throw an error message into the
notOk continuation, which pops us out to the inner do-block, and that string gets assigned to
err and given to
handler.
A more general approach to handling exceptions can be seen with the following function. Pass a computation as the first parameter (more precisely, a function which takes an error-throwing function and results in the computation) and an error handler as the second parameter. This example takes advantage of the generic
MonadCont class [4] which covers both
Cont and the corresponding
ContT transformer by default, as well as any other continuation monad which instantiates it.
Example: General
try using continuations.
import Control.Monad.Cont tryCont :: MonadCont m => ((err -> m a) -> m a) -> (err -> m a) -> m a tryCont c h = callCC $ \ok -> do err <- callCC $ \notOk -> do x <- c notOk ok x h err
And here is our
try in action:
In this example, error throwing means escaping from an enclosing
callCC. The
throw in
sqrtIO jumps out of
tryCont's inner
callCC.
Example: coroutinesEdit
In this section we make a CoroutineT monad that provides a monad with
fork, which enqueues a new suspended coroutine, and
yield, that suspends the current thread.
{-# LANGUAGE GeneralizedNewtypeDeriving #-} -- We use GeneralizedNewtypeDeriving to avoid boilerplate. As of GHC 7.8, it is safe. import Control.Applicative import Control.Monad.Cont import Control.Monad.State -- The CoroutineT monad is just ContT stacked with a StateT containing the suspended coroutines. newtype CoroutineT r m a = CoroutineT {runCoroutineT' :: ContT r (StateT [CoroutineT r m ()] m) a} deriving (Functor,Applicative,Monad,MonadCont,MonadIO) -- Used to manipulate the coroutine queue. getCCs :: Monad m => CoroutineT r m [CoroutineT r m ()] getCCs = CoroutineT $ lift get putCCs :: Monad m => [CoroutineT r m ()] -> CoroutineT r m () putCCs = CoroutineT . lift . put -- Pop and push coroutines to the queue. dequeue :: Monad m => CoroutineT r m () dequeue = do current_ccs <- getCCs case current_ccs of [] -> return () (p:ps) -> do putCCs ps p queue :: Monad m => CoroutineT r m () -> CoroutineT r m () queue p = do ccs <- getCCs putCCs (ccs++[p]) -- The interface. yield :: Monad m => CoroutineT r m () yield = callCC $ \k -> do queue (k ()) dequeue fork :: Monad m => CoroutineT r m () -> CoroutineT r m () fork p = callCC $ \k -> do queue (k ()) p dequeue -- Exhaust passes control to suspended coroutines repeatedly until there isn't any left. exhaust :: Monad m => CoroutineT r m () exhaust = do exhausted <- null <$> getCCs if not exhausted then yield >> exhaust else return () -- Runs the coroutines in the base monad. runCoroutineT :: Monad m => CoroutineT r m r -> m r runCoroutineT = flip evalStateT [] . flip runContT return . runCoroutineT' . (<* exhaust)
Some example usage:
printOne n = do liftIO (print n) yield example = runCoroutineT $ do fork $ replicateM_ 3 (printOne 3) fork $ replicateM_ 4 (printOne 4) replicateM_ 2 (printOne 2)
Outputting:
3 4 3 2 4 3 2 4 4
Example: Implementing pattern matchingEdit
An interesting usage of CPS functions is to implement our own pattern matching. We will illustrate how this can be done by some examples.
Example: Built-in pattern matching
check :: Bool -> String check b = case b of True -> "It's True" False -> "It's False"
Now we have learnt CPS, we can refactor the code like this.
Example: Pattern matching in CPS
type BoolCPS r = r -> r -> r true :: BoolCPS r true x _ = x false :: BoolCPS r false _ x = x check :: BoolCPS String -> String check b = b "It's True" "It's False"
*Main> check true "It's True" *Main> check false "It's False"
What happens here is that, instead of plain values, we represent
True and
False by functions that would choose either the first or second argument they are passed. Since
true and
false behave differently, we can achieve the same effect as pattern matching. Furthermore,
True,
False and
true,
false can be converted back and forth by
\b -> b True False and
\b -> if b then true else false.
We should see how this is related to CPS in this more complicated example.
Example: More complicated pattern matching and its CPS equivalence
data Foobar = Zero | One Int | Two Int Int type FoobarCPS r = r -> (Int -> r) -> (Int -> Int -> r) -> r zero :: FoobarCPS r zero x _ _ = x one :: Int -> FoobarCPS r one x _ f _ = f x two :: Int -> Int -> FoobarCPS r two x y _ _ f = f x y fun :: Foobar -> Int fun x = case x of Zero -> 0 One a -> a + 1 Two a b -> a + b + 2 funCPS :: FoobarCPS Int -> Int funCPS x = x 0 (+1) (\a b -> a + b + 2)
*Main> fun Zero 0 *Main> fun $ One 3 4 *Main> fun $ Two 3 4 9 *Main> funCPS zero 0 *Main> funCPS $ one 3 4 *Main> funCPS $ two 3 4 9
Similar to former example, we represent values by functions. These function-values pick the corresponding (i.e. match) continuations they are passed to and pass to the latter the values stored in the former. An interesting thing is that this process involves in no comparison. As we know, pattern matching can work on types that are not instances of
Eq: the function-values "know" what their patterns are and would automatically pick the right continuations. If this is done from outside, say, by an
pattern_match :: [(pattern, result)] -> value -> result function, it would have to inspect and compare the patterns and the values to see if they match -- and thus would need
Eq instances.
Notes
- ↑ That is,
\x -> ($ x), fully spelled out as
\x -> \k -> k x
- ↑ attoparsec is an example of performance-driven usage of CPS.
- ↑ Beyond verifying that the monad laws hold, which is left as an exercise to the reader.
- ↑ Found in the
mtlpackage, module Control.Monad.Cont. | https://en.m.wikibooks.org/wiki/Haskell/Continuation_passing_style | CC-MAIN-2017-17 | refinedweb | 3,378 | 55.07 |
This post is really a simple layer-8 issue, but I thought it justified a post as there’s a nuance or two that are worth discussing. I’m in the process of designing yet another Active Directory Federation Services deployment although this one is more interesting than some of my previous projects as it involves a lot of multi-factor authentication rules and configuration against a lot of trusts for a large user base. While I’m authoring the design I like to essentially setup the design in my own lab, which is what brings me to this post. I was enabling the Device Registration Services (DRS) in an existing Active Directory Federation Services (AD FS) 3.0 deployment and, having followed the small and simple set of well documented instructions, realised that my clients could not Workplace Join because the DRS essentially wasn’t there…
The WPJ event log on my Windows 7 desktop that is configured to automatically and silently WPJ showed this event:
And this:
Clicking that URL returns the browser “This page cannot be displayed” (as opposed to the actual XML when it works correctly) error.
Looks pretty clear. There’s something really wrong with the DRS endpoint, i.e. it isn’t there (did I forget to enable DRS on each node?), or the DNS entry is wrong, etc.
So I take the URL and try hitting it on each local federation service server node (I have HOSTS entries on each node to hit self and avoid the internal load balancer). The endpoint isn’t there. No DNS issue, something else is up. I dump the HTTP.SYS URLACL list (netsh http show urlacl) and I can see there’s a listener for this URL:
Rerunning Enable-ADFSDeviceRegistrationService doesn’t fix the matter. It does complain about missing UPN suffixes but that’s expected as this is a multi-purpose lab and I have loads of UPN suffixes defined that won’t be used by WPJ clients.
I try hitting the URL with the FS name instead, e.g. and that works. I take a look at the certificate and the problem is now obvious. This certificate doesn’t contain subject alternate name (SAN) properties. Which is weird because I’ve just procured a new HTTPS certificate with multiple SAN properties to support DRS – as I said at the beginning, I was enabling DRS post-deployment. My original deployment did not need DRS and therefore only had an SSL certificate with the FS name as the subject. I have had to enrol a new certificate with multiple DNS SAN attributes for enterpriseregistration.<UPN suffix in use in the enterprise>.
And here’s the crux of the matter and the major layer-8 issue. When I changed the AD FS certificate I did so using the following command on the primary FS:
Set-AdfsCertificate -CertificateType Service-Communications -Thumbprint “b5 9b d6 af 08 53 08 85 6e b8 aa 52 7b e3 15 65 87 66 e0 f5”
The problem is that command allows you to change the Service Communications certificate, the Token Signing certificate and the Token Encryption certificate. That command does not change the SSL certificate!
To change the SSL certificate you must use Set-AdfsSslCertificate. And unlike Set-AdfsCertificate you must do this on each FS node as it is configuring HTTP.SYS (we no longer do this in IIS).
Once done, the SAN attributes allow the HTTPS binding to work and the endpoint is live. WPJ worked immediately then.
Lessons learned
When planning and designing AD FS consider future DRS needs. Try and get the certificate right up front. For many customers this is easy – they have a common and consistent UPN namespace, so just get the enterpriseregistration DNS SAN along with the DNS SAN for the FS name, e.g. for sts.contoso.com FS and users with @contoso.com UPN:
- Subject: sts.contoso.com
- SAN: DNS=sts.contoso.com
- SAN: DNS=enterpriseregistration.contoso.com
For more complex deployments look to see what UPNs are in use. In my experience DRS is closely aligned with cloud deployments and cloud deployments have a dependency on on-premises remediation that rationalises and remedies UPNs among other things.
When deploying the Device Registration Service, remember that the endpoints will only work if you have the correct DNS SAN attributes in your SSL certificate. Check which certificate is in use using Get-AdfsSslCertificate and Get-AdfsCertificate -Type Service-Communications and also use the browser to validate, i.e. navigate to and look at the certificate in use by your browser – check the subject alternate name and subject fields and the thumbprint.
Lastly, deploying DRS consists of the following commands:
Primary FS (WID deployment):
- Initialize-ADDeviceRegistration (Initialise DRS in the AD DS forest – requires Enterprise Admins group membership)
- Enable-AdfsDeviceRegistration (Enable DRS on this server)
- Set-AdfsGlobalAuthenticationPolicy -DeviceAuthenticationEnabled $true (Enable device authentication in AD FS)
Secondary FS:
- Enable-AdfsDeviceRegistration (Enable DRS on this server)
In a SQL deployment you run the first set of commands on one node and the subsequent set of commands on all other nodes.
On your Web Application Proxy servers you might need to reconfigure the SSL endpoint listeners to listen on all of the SANs in your certificate. You do this using Update-WebApplicationProxyDeviceRegistration.
Summary
When changing your AD FS SSL certificate remember you basically need to do this in two places for 99% of deployments:
- You set the HTTPS certificate using Set-AdfsSslCertificate on each node in the farm
- You set the Service Communications certificate using Set-AdfsCertificate on one server – in a WID deployment on the primary, in a SQL deployment on any node
You must also update your Web Application Proxy (WAP) servers, if they’re in play:
- You set the HTTPS certificate for your WAP servers using the Set-WebApplicationProxySslCertificate cmdlet – again, as with Set-AdfsSslCertificate, this is done on each WAP node as it’s applying the configuration to HTTP.SYS
- You update the HTTP.SYS endpoints using Update-WebApplicationProxyDeviceRegistration
This is important as the typical deployment pattern expects the service communications certificate to be the same as the federation service (SSL) certificate (it doesn’t have to be, hence the 99% of deployment statement).
Note that even if you use the GUI you must remember to set the SSL certificate to correctly update the HTTP.SYS bindings.
Join the conversationAdd Comment | https://blogs.technet.microsoft.com/iamsupport/2015/04/27/workplace-join-failed-0x10dd-a-k-a-how-to-properly-changeset-your-adfs-certificates/ | CC-MAIN-2019-22 | refinedweb | 1,067 | 51.48 |
For an Oracle database. The app also retrieves these speed traps from the database and draws them onto a Google map:
Fig. 1 After pressing the Android device’s menu button, two menu options ‘Retrieve’ and ‘Report’ (speed traps) appear.
Fig. 2 After pressing the ‘Retrieve’ option all speed traps already stored in the database appear as markers on the map.
Fig. 3 When tapping on a marker a dialog appears with date and address information related to this specific speed trap.
Fig. 4 After spotting a speed trap and pressing the ‘Report’ option, your current location (the speed trap) will be stored into the database.
SPEED_TRAPS table
In order to achieve all this I first created a database table SPEED_TRAPS:
CREATE TABLE SPEED_TRAPS
(
ID NUMBER(6) NOT NULL,
LATITUDE NUMBER(11,8) NOT NULL,
LONGITUDE NUMBER(11,8) NOT NULL,
CREATION_DATE DATE NOT NULL,
CONSTRAINT SPS_PK PRIMARY KEY
(
ID
)
ENABLE
)
/
A before-row-insert trigger on this table will fill the creation_date column with sysdate (today’s date) and the id column with a sequence (sequential number). The latitude and longitude columns will be filled by the Android app (of course).
Creating the web service interface
ADF Business Components can easily be exposed through a web service interface. I refer to a blog post of Lucas Jellema: Quickly creating, deploying and testing a WebService interface for ADF Business Components. After creating the ADF BC Project, an Entity Object on the SPEED_TRAPS table, its corresponding Updateable View Object and an Application Module, we can add a Service Interface to this Application Module as described in forementioned blog post.
By the way I marked the Entity Object attributes Id and CreationDate as not mandatory; values for these attributes are not generated by the app, but by the database (before-row-insert trigger on the table) at the end of the process. So not-null-validation by the ADF Business Components layer will not occur for these attributes when reporting a new speed trap, which is the correct behavior.
To the Service Interface I included the single view instance SpeedTrapsView1 as ViewObject and specified Create (report a speed trap) and Find (retrieve all speed traps) as CRUD operations to be supported on it (see fig. 5). The method names findSpeedTrapsView and createSpeedTrapsView will become the operation names in the WSDL for the web service.
After deployment of the web service application we can test it.
Invoking the operation findSpeedTrapsView:
Results in:
Invoking the operation createSpeedTrapsView:
Results in:
SOAP web service call by Android
The Android SDK does not contain any framework or library for making SOAP calls. The ksoap2-android open source project provides a lightweight and efficient SOAP library for the Android platform that handles the XML and HTTP work. You have to add it as an External Library to your project (in a non-Maven project). You can download this library at
retrieveSpeedTraps()
When tapping the ‘Retrieve’ menu option in the Android app, the method retrieveSpeedTraps() of activity class SpeedTraps (fig. 10) is called. This method executes the findSpeedTrapsView SOAP call from fig. 6 after this request is composed. The values of the local variables SOAP_ACTION, NAMESPACE and METHOD_NAME of retrieveSpeedTraps() are marked in yellow in this figure.
reportSpeedTrap()
When tapping the ‘Report’ menu option in the Android app, the method reportSpeedTrap() of activity class SpeedTraps (fig. 10) is called. This method executes the createSpeedTrapsView SOAP call from fig. 8 after this request is composed. The values of the local variables SOAP_ACTION, NAMESPACE _1, NAMESPACE _2, METHOD_NAME_1 and METHOD_NAME_2 of reportSpeedTrap() are marked in yellow in this figure. The challenge here was to compose the request in the correct format, because of the two (yellow marked) namespaces in it. The ksoap2-android library takes only account of one when creating a new SoapObject, so I did some fiddling by introducing the setProperty() method. Running the app in debug mode, setting the mHttpTransportSE debug field to true and then analyzing its requestDump field (the string representation of the SOAP call) has helped me a lot to get this done.
Finally, I would like to thank my colleague Paco van der Linden for helping me setting up the web service interface in ADF 11g.
Resources
Download the JDeveloper 11g web service project: SpeedTrapsWS
Download the Eclipse Android project: SpeedTraps | http://technology.amis.nl/2011/03/24/android-puts-oracle-on-the-google-map/ | CC-MAIN-2014-41 | refinedweb | 723 | 50.57 |
KWin
#include <tabgroup.h>
Detailed Description
This class represents a group of clients for use in window tabbing.
All clients in the group share the same geometry and state information; I.e if one client changes then all others should also be changed.
A group contains at least one client and DOES NOT contain multiple copies of the same client. A client MUST NOT be in two groups at the same time. All decorated clients SHOULD be in a group, even if it's a group of one client.
rohanp: Had to convert this object to a QObject to make it easier for adding scripting interface to TabGroup.
If a group contains multiple clients then only one will ever be mapped at any given time.
Definition at line 50 of file tabgroup.h.
Member Enumeration Documentation
Definition at line 59 of file tabgroup.h.
Constructor & Destructor Documentation
Creates a new group containing
c.
Definition at line 31 of file tabgroup.cpp.
Definition at line 45 of file tabgroup.cpp.
Member Function Documentation
Activate next tab (flips)
Definition at line 50 of file tabgroup.cpp.
Activate previous tab (flips)
Definition at line 56 of file tabgroup.cpp.
Allows to alter several attributes in random order and trigger a general update at the end (must still be explicitly called) this is to prevent side effects, mostly for geometry adjustments during maximization and QuickTiling.
Definition at line 286 of file tabgroup.cpp.
Returns the list of all the clients contained in this group in their current order.
Definition at line 180 of file tabgroup.h.
Close all clients in this group.
Definition at line 186 of file tabgroup.cpp.
Whether client
c is member of this group.
Definition at line 170 of file tabgroup.h.
The amount of clients in this group.
Definition at line 175 of file tabgroup.h.
Returns the currently visible client.
Definition at line 190 of file tabgroup.h.
Returns whether or not this group contains the active client.
Definition at line 224 of file tabgroup.cpp.
Returns whether this group is empty (used by workspace to remove it)
Definition at line 185 of file tabgroup.h.
Returns combined maximum size of all clients in the group.
Definition at line 200 of file tabgroup.h.
Returns combined minimum size of all clients in the group.
Definition at line 195 of file tabgroup.h.
Makes
c the visible client in the group - force is only used when the window becomes ready for painting.
Any other usage just causes pointless action
Definition at line 229 of file tabgroup.cpp.
- Parameters
-
Definition at line 244 of file tabgroup.cpp.
updates geometry restrictions of this group, basically called from Client::getWmNormalHints(), otherwise rather private
Definition at line 257 of file tabgroup.cpp.
Ensures that all the clients in the group have identical geometries and states using
main as the primary client to copy the settings off.
If
only is set then only that client is updated to match
main.
Definition at line 294 of file tabgroup.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Feb 16 2020 04:48:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online. | https://api.kde.org/4.x-api/kde-workspace-apidocs/kwin/html/classKWin_1_1TabGroup.html | CC-MAIN-2020-10 | refinedweb | 550 | 68.26 |
Google Map with Marker Clustering
Have you ever used a map with so many markers on it, that it was impossible to select the pin of interest? If only the pins in close proximity could be grouped together to make the map more user-friendly. This is known as Clustering, and yes it can be done.
How do I get clustering in my app?
Clustering on Google Maps is really simple because there is an awesome library that helps us do this. The Google Maps Utils library.
Note: This is assuming you have already set up a Google Map in your Android app. If not, then visit Google Maps API to get started.
To get this library, all we need to do is add it as a dependency in our build.gradle.
compile 'com.google.maps.android:android-maps-utils:0.5'
Once that’s done, we need to implement an interface called ClusterItem on our model class. This interface will provide marker data to our model.
public class Person implements ClusterItem
ClusterItem provides us with three methods that we need to implement:
- LatLng getPosition()
- String getTitle()
- String getSnippet()
This will make our model conform to what we need for the cluster manager, which is what we will look at next.
In our Activity, we create a ClusterManager variable of the same Type as our model.
private ClusterManager<Person> mClusterManager;
Then in our onMapReady method (or wherever you have access to your GoogleMap object):
- Initialize our ClusterManager.
- Set the ClusterManager to the relevant listeners on the GoogleMap object.
- Add Items, which are our markers, to the ClusterManager.
- Finally ask the ClusterManager to cluster our markers.
Yes, that sounds like a lot of work but as we can see below, it’s just a few lines of code.
mClusterManager = new ClusterManager<>(this, googleMap);
googleMap.setOnCameraIdleListener(mClusterManager); googleMap.setOnMarkerClickListener(mClusterManager); googleMap.setOnInfoWindowClickListener(mClusterManager); addPersonItems();
mClusterManager.cluster();
The addPersonItems function:
private void addPersonItems() { mClusterManager.addItem(new Person(-26.187616, 28.079329, "PJ", ""));
}
And there you go, you have clustering on your Google Map Activity!
There is so much more you can do with clustering, and Google Maps.
Stay tuned for more on Google Maps.
For a more complete example of the above code, you can visit my Github page:
Let me know what you think in the comments.
Get in Touch!
Peter-John (@pjapplez) | Twitter
The latest Tweets from Peter-John (@pjapplez). Mobile App Developer, Technology Explorer, Photographer, Co-Founder…
twitter.com
Peter John Welcome — Google+
Thanks to Ashton Welcome and Joshua Leibstein for reviewing this post. | https://medium.com/android-news/google-map-with-marker-clustering-b918aa331db6 | CC-MAIN-2021-43 | refinedweb | 424 | 57.67 |
It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
I am trying to have a custom field show how many days a issue has been open. I am using the script runner and created a script field. I am trying to find current date - created date for the days open. Here is the script
import com.atlassian.core.util.DateUtils
DateUtils.getDurationString(((new Date().getTime() - issue.getCreated().date) / 1000 / 3600 / 24 ) as long)
But the date is not showing up correctly.
I also want to exclude issue that are in a closed status here is what i have tried to add
import com.atlassian.core.util.DateUtils
def Status = issue.getStatusObject();
if (Status == Closed) {
return null;
}
DateUtils.getDurationString(((new Date().getTime() - issue.getCreated().date) / 1000 / 3600 / 24 ) as long)
but it comes back with an error of No such property: Closed for class: Script7* (* this number keeps growing when you press preview).
This is so i can use the field in a gadget on the dashboard.
Hi David,
Did you try the similar example in the documentation. First of all the error you are getting is because you misses the quotes in your status comparison, should be
if (Status == 'Closed') { return null; }
Also I do not know your exact requirements but I would suggest to use the statusCategory instead of Status. Also in your example, if I move the issue to a Closed status for 3 day and then reopen it, then in your script the result will not be valid (because now the issue is open but it was closed for 3 days)....
David,
I created a calculated field called "Days Open" with the following in the description field:
<!-- @@Formula: issue.get("resolutiondate")!=null ? null : ((new Date().getTime()) - issue.get("created").getTime()) / 1000 / 3600 / 24 -->
So, once the Issue is resolved this field is blank (i.e., empty) so it won't show. I am running JIRA 6.3.13.
Regards,
Bryan
Bryan,
when i create either a calculated Date/Time Field, Calculated Number Field then add the line that into the description. I go into the ticket click edit and then save to update the issue. It still does not show up. So i click admin then where is my field. I find the custom field and it gives me a message The field 'Day' does not have value for issue (issue ticket #) and will not be displayed on the view issue page. Set value for that field so that it shows up.
Dave
I tried what you suggest again Bryan and it works. Thanks. Not sure why it did not work. | https://community.atlassian.com/t5/Jira-Core-questions/Calculate-how-many-days-a-issue-is-open/qaq-p/455574 | CC-MAIN-2018-30 | refinedweb | 447 | 64.3 |
Method in Java is similar to a function defined in other programming languages. Method describes behavior of an object. A method is a collection of statements that are grouped together to perform an operation.
For example, if we have a class Human, then this class should have methods like eating(), walking(), talking() etc, which describes the behavior of the object.
Declaring method is similar to function. See the syntax to declare the method in Java.
return-type methodName(parameter-list) { //body of method }
return-type refers to the type of value returned by the method.
methodName is a valid meaningful name that represent name of a method.
parameter-list represents list of parameters accepted by this method.
Method may have an optional return statement that is used to return value to the caller function.
Lets understand the method by simple example that takes a parameter and returns a string value..
Methods are called to perform the functionality implemented in it. We can call method by its name and store the returned value into a variable.
String val = GetName(".com")
It will return a value studytonight.com after appending the argument passed during method call.
In Java, we can return multiple values from a method by using array. We store all the values into an array that want to return and then return back it to the caller method. We must specify return-type as an array while creating an array. Lets see an example.
Example:
Below is an example in which we return an array that holds multiple values.
class MethodDemo2{ static int[] total(int a, int b) { int[] s = new int[2]; s[0] = a + b; s[1] = a - b; return s; } public static void main(String[] args) { int[] s = total(200, 70); System.out.println("Addition = " + s[0]); System.out.println("Subtraction = " + s[1]); } }
In some scenario there can be need to return object of a class to the caller function. In this case, we must specify class name in the method definition.
Below is an example in which we are getting an object from the method call. It can also be used to return collection of data.
Example:
In this example, we created a method get() that returns object of Demo class.
class Demo{ int a; double b; int c; Demo(int m, double d, int a) { a = m; b = d; c = a; } } class MethodDemo4{ static Demo get(int x, int y) { return new Demo(x * y, (double)x / y, (x + y)); } public static void main(String[] args) { Demo ans = get(25, 5); System.out.println("Multiplication = " + ans.a); System.out.println("Division = " + ans.b); System.out.println("Addition = " + ans.c); } }.
You can understand it by the below image that explain parameter and argument using a program example.
call-by-valueand
call-by-reference
There are two ways to pass an argument to a method
NOTE :However there is no concept of call-by-reference in Java. Java supports only call by value.
call-by-value
Lets see an example in which we are passing argument to a method and modifying its value.
public class Test { public void callByValue(int x) { x=100; } public static void main(String[] args) { int x=50; Test t = new Test(); t.callByValue(x); //function call System.out.println(x); } }
50
See, in the above example, value passed to the method does not change even after modified in the method. It shows that changes made to the value was local and argument was passed as call-by-value. | https://www.studytonight.com/java/methods-in-java.php | CC-MAIN-2021-04 | refinedweb | 586 | 57.06 |
> It is important because on UNIX, "root" rules on local filesystems.> I dont't like the idea of root not being able to run "find -xdev"> anymore for administrative tasks, just because something got hidden> by accident or just for fun by a user. It's not about malicious> users who want to hide data: they can do that in tons of ways.That's a sort of security by obscurity: if the user is dumb enough hecannot do any harm. But I'm not interested in that sort of thing. Ifthis issue important, then it should be solved properly, and not justby "preventing accidents".> IMHO The best thing FUSE could do is to make the mount totally> invisible: don't return EACCES, don't follow the FUSE mount but stay> on the original tree. I think it's either this or returning EACCES> plus the leaf node constraint at mount time.The leaf node constranint doesn't make sense. The hidden mount thingdoes, but it has been very flatly rejected by Al Viro.There's a nice solution to this (discussed at length earlier): privatenamespaces.I think we are still confusing these two issues, which are in factseparate. 1) polluting global namespace is bad (find -xdev issue) 2) not ptraceable (or not killable) processes should not be able to access an unprivileged mountFor 1) private namespaces are the proper solution. For 2) thefuse_allow_task() in it's current or modified form (to checkkillability) should be OK.1) is completely orthogonal to FUSE. 2) is currently provably secure,and doesn't seem cause problems in practice. Do you have a concreteexample, where it would cause problems?Miklos-To unsubscribe from this list: send the line "unsubscribe linux-kernel" inthe body of a message to majordomo@vger.kernel.orgMore majordomo info at read the FAQ at | http://lkml.org/lkml/2005/7/4/32 | CC-MAIN-2016-07 | refinedweb | 304 | 64.91 |
Soft Tabs
First thing that was annoying to me was the soft tabs. I tried to mess with all settings but with no luck.
So i made this custom shortcut/key bind:
- Code: Select all
{ "keys": ["tab"], "command": "move", "args": { "by": "words", "forward": true }, "context":[
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\t", "match_all":true }
]}
(sublime-keymap)
Selection Wrap
I found there was a package with a lot of stuff that had this thing too, but was for Sublime 1. So i made this key bind:
- Code: Select all
{
"keys" : ["alt+shift+w"],
"command" : "insert_snippet",
"args" : {
"contents": "<${1:p}>${0:$SELECTION}</${1/\\s.*//}>"
}
}
Tada! Works!
Switch Syntax
this is the initial version, read below
This is kind of tricky. It may be a shorter version for this, but i didn't get it how to do it. All i found was this. Unfortunately, I didn't understand too much from that thing and what should i do with it. I was stuck at this:
- Code: Select all
{ "keys": ["alt+1"], "command": "set_file_type", "args":{ ***** } }
With no clue on what should i put where astericses are.
So i did this keybinds:
- Code: Select all
{ "keys": ["alt+1"], "command": "set_js_syntax" },
{ "keys": ["alt+2"], "command": "set_html_syntax" },
{ "keys": ["alt+3"], "command": "set_php_syntax" },
{ "keys": ["alt+4"], "command": "set_css_syntax" }
And for all syntax i created a new plugin that contains this:
- Code: Select all
import sublime, sublime_plugin
class set_css_syntax(sublime_plugin.TextCommand):
def run(self, edit):
self.view.settings().set('syntax', 'Packages/CSS/CSS.tmLanguage')
Updated (10x to jbjornson)
- Code: Select all
{ "keys": ["alt+1"], "command": "set_file_type", "args":{ "syntax" : "Packages/JavaScript/JavaScript.tmLanguage" } },
{ "keys": ["alt+2"], "command": "set_file_type", "args":{ "syntax" : "Packages/HTML/HTML.tmLanguage" } },
{ "keys": ["alt+3"], "command": "set_file_type", "args":{ "syntax" : "Packages/PHP/PHP.tmLanguage" } },
{ "keys": ["alt+4"], "command": "set_file_type", "args":{ "syntax" : "Packages/CSS/CSS.tmLanguage" } },
(you can replace CSS with any syntax you want)
So, what do you think guys?
The only two thing that I need to replace E completely is: translate all snippets from E to ST and make ctrl+tab to behave (is very redundant right now). Go to last active tab would be great. Any clues?
(oh, and a history tree would be nice to have) | http://www.sublimetext.com/forum/viewtopic.php?p=10358 | CC-MAIN-2014-49 | refinedweb | 361 | 62.98 |
This tutorial will introduce you to I2C and provide a framework that you can use to start communicating with various devices that use I2C. This tutorial is meant for the Kinetis K40 and will probably not work on any other Kinetis chip. DISCLAIMER: This has not been fully tested and may not work for you and for all devices. The header file provided does not handle errors and should not be used for critical projects.
Introduction to I2C signaling
I2C is a simple two wire communication system used to connect various devices together, such as Sensory devices and microprocessors using 8 bit packets. I2C requires two wires: the first is called SDA and is used for transferring data, the second is called SCL and it is the clock used to drive the data to and from devices. I2C uses an open drain design which requires a pull up resistor to logic voltage (1.8,3.3,5) on both SDA and SCL for proper operation. I2C is a master-slave system where the master drives the clock and initiates communication.
The I2C protocol has 5 parts.
- The Start signal which is defined as pulling the SDA line low followed by pulling SCL low.
- The slave device address including the Read/Write bit
- The register address that you will be writing to/ reading from
- the data
- The acknowledgement signal which is sent from the receiving device after 8 bits of data has been transferred successfully.
- the Stop signal, which is defined by SDA going high before SCL goes high.
1. The start signal is sent from the Master to intiate communication on the bus. The start and stop signals are the only time that SDA can change out of sync with SCL. Once the start signal is sent no other device can talk on the bus until the stop signal is sent. If for whatever reason another device tries to talk on the bus then there will be an error and the K40 can detect this.
2. The slave device is a 7 bit (sometimes 10bit but this will not be covered in this tutorial) address provided by the device and is specific to the device. The type of data operation (read/write) is determined by the 8th bit. A 1 will represent a write and a 0 a read operation.
3. The register addresses are provided by the device's specifications.
4. The data you will send to a device if you are writing or the data that you receive from the device when reading. This will always be 8 bits.
5. After 8 bits of data has been transferred successfully the receiving device will pull the SDA line low to signify that it received the data. If the transmitting device does not detect an acknowledgement then there will be an error. The K40 will be able to detect this.
6. The stop signal is sent from the Master to terminate communication on the bus. Some devices require this signal to operate properly but it is required if there will be more than one master on the bus (which will not be covered in this tutorial)
I2C header file
This header file only has functions for reading and writing one byte at a time. Most devices support reading and writing more than one byte at a time without sending the Stop signal. Typically the device will keep incrementing the register's address to the next one during read/writes when there is no stop signal present. See your device's user manual for more information.
/* * i2c.h * * Created on: Apr 5, 2012 * Author: Ian Kellogg * Credits: Freescale for K40-I2C example */ #ifndef I2C_H_ #define I2C_H_ #include "derivative.h" #define i2c_EnableAck() I2C1_C1 &= ~I2C_C1_TXAK_MASK #define i2c_DisableAck() I2C1_C1 |= I2C_C1_TXAK_MASK #define i2c_RepeatedStart() I2C1_C1 |= I2C_C1_RSTA_MASK #define i2c_Start() I2C1_C1 |= I2C_C1_TX_MASK;\ I2C1_C1 |= I2C_C1_MST_MASK #define i2c_Stop() I2C1_C1 &= ~I2C_C1_MST_MASK;\ I2C1_C1 &= ~I2C_C1_TX_MASK #define i2c_EnterRxMode() I2C1_C1 &= ~I2C_C1_TX_MASK;\ I2C1_C1 |= I2C_C1_TXAK_MASK #define i2c_write_byte(data) I2C1_D = data #define i2c_read_byte() I2C1_D #define MWSR 0x00 /* Master write */ #define MRSW 0x01 /* Master read */ /* * Name: init_I2C * Requires: nothing * Returns: nothing * Description: Initalizes I2C and Port E for I2C1 as well as sets the I2C bus clock */ void init_I2C() { SIM_SCGC4 |= SIM_SCGC4_I2C1_MASK; //Turn on clock to I2C1 module SIM_SCGC5 |= SIM_SCGC5_PORTE_MASK; // turn on Port E which is used for I2C1 /* Configure GPIO for I2C1 function */ PORTE_PCR1 = PORT_PCR_MUX(6) | PORT_PCR_DSE_MASK; PORTE_PCR0 = PORT_PCR_MUX(6) | PORT_PCR_DSE_MASK; I2C1_F = 0xEF; /* set MULT and ICR This is roughly 10khz See manual for different settings*/ I2C1_C1 |= I2C_C1_IICEN_MASK; /* enable interrupt for timing signals*/ } /* * Name: i2c_Wait * Requires: nothing * Returns: boolean, 1 if acknowledgement was received and 0 elsewise * Description: waits until 8 bits of data has been transmitted or recieved */ short i2c_Wait() { while((I2C1_S & I2C_S_IICIF_MASK)==0) { } // Clear the interrupt flag I2C1_S |= I2C_S_IICIF_MASK; } /* * Name: I2C_WriteRegister * Requires: Device Address, Device Register address, Data for register * Returns: nothing * Description: Writes the data to the device's register */ void I2C_WriteRegister (unsigned char u8Address, unsigned char u8Register, unsigned char u8Data) { /* shift ID in right position */ u8Address = (u8Address << 1)| MWSR; /* send start signal */ i2c_Start(); /* send ID with W/R bit */ i2c_write_byte(u8Address); i2c_Wait(); // write the register address i2c_write_byte(u8Register); i2c_Wait(); // write the data to the register i2c_write_byte(u8Data); i2c_Wait(); i2c_Stop(); } /* * Name: I2C_ReadRegister_uc * Requires: Device Address, Device Register address * Returns: unsigned char 8 bit data received from device * Description: Reads 8 bits of data from device register and returns it */ unsigned char I2C_ReadRegister_uc (unsigned char u8Address, unsigned char u8Register ){ unsigned char u8Data; unsigned char u8AddressW, u8AddressR; /* shift ID in right possition */ u8AddressW = (u8Address << 1) | MWSR; // Write Address u8AddressR = (u8Address << 1) | MRSW; // Read Address /* send start signal */ i2c_Start(); /* send ID with Write bit */ i2c_write_byte(u8AddressW); i2c_Wait(); // send Register address i2c_write_byte(u8Register); i2c_Wait(); // send repeated start to switch to read mode i2c_RepeatedStart(); // re send device address with read bit i2c_write_byte(u8AddressR); i2c_Wait(); // set K40 in read mode i2c_EnterRxMode(); u8Data = i2c_read_byte(); // send stop signal so we only read 8 bits i2c_Stop(); return u8Data; } /* * Name: I2C_ReadRegister * Requires: Device Address, Device Register address, Pointer for returned data * Returns: nothing * Description: Reads device register and puts it in pointer's variable */ void I2C_ReadRegister (unsigned char u8Address, unsigned char u8Register, unsigned char *u8Data ){ /* shift ID in right possition */ u8Address = (u8Address << 1) | MWSR; // write address u8Address = (u8Address << 1) | MRSW; // read address /* send start signal */ i2c_Start(); /* send ID with W bit */ i2c_write_byte(u8Address); i2c_Wait(); // send device register i2c_write_byte(u8Register); i2c_Wait(); // repeated start for read mode i2c_RepeatedStart(); // resend device address for reading i2c_write_byte(u8Address); i2c_Wait(); // put K40 in read mode i2c_EnterRxMode(); // clear data register for reading *u8Data = i2c_read_byte(); i2c_Wait(); // send stop signal so we only read 8 bits i2c_Stop(); } #endif
Example of I2C communication using Freescale MMA8452Q 3-axis accelerometer
This example is very simplistic and will do nothing more than read the WHO AM I register to make sure that I2C is working correctly. To see more check out the Freescale MMA8452Q Example
/* Main. C */
#include <stdio.h>
#include "derivative.h" /* include peripheral declarations */
#include "i2c.h"
int main(void)
{
// checking the WHO AM I register is a great way to test if communication is working
// The MMA8452Q has a selectable address which is either 0X1D or 0X1C depending on the SA0 pin
// For the MMA8452Q The WHO AM I register should always return 0X2A
if (I2C_ReadRegister_uc (0x1D,0x0D) != 0x2A {
printf ("Device was not found\n");
} else {
printf ("Device was found! \n");
}
}
This code contains too many mistakes.
DELETE lines: 49, 50, 51, 52, 55, 106, 108, 111, 112.
SWAP lines 11 & 12, DisableAck and EnableAck.
Replace line 112 with this code: i2c_DisableAck();
And modify function I2C_ReadRegister likewise than I2C_ReadRegister_uc | https://community.nxp.com/docs/DOC-1034 | CC-MAIN-2018-43 | refinedweb | 1,244 | 51.52 |
Hi all
This blog should give you some examples how the graphical mapping can be done without bad results.
This is only a proposal and my experience, this should not mean that there is no other solution.
But maybe it is helpful for some PI developer without SAP Mapping Training or deep experience.
We all know that the graphical tool looks very easy.
But to get a waterproof mapping and not only a LuckyPunch success you really need to know how it works.
I think and know
- 99,9% of all mappings can be done by using graphical mapping tool
- If you know how the target queue must look like then you can start with development
- All other approach is trail & error with LuckyPunch result
Below you will find a summary of the most needed actions from my point of view.
(…and in this blog you can copy and paste the UDF code… )
IF Function
It looks easy but I saw a lot of garbage in the past.
So please notice: the two input “Queues” must have same number of values and same structure (ContextChanges). If not you have to think about this.
Maybe “MapWithDefault” or change Context can help!
Target Element should only appear one time but source element is multiple.
Most solutions I saw have used CopyValue[0] or “RemoveContext” in combination “CollapsContext”.
Please be care full by using these 3 functions. I like to use “sum” for this.
equalS vs. FixFalue
Sometimes a FixValue Table is better than equalS
How to combine different hierarchies or levels (useOneAsMany and formatByExample)
Sometimes the target structure has 3 Elements which are relevant for one target field.
Sample: If qualifier of each position has value XY then value the Text of sub segment should be used.
(all of us know TDLINE Problems)
UDF: GetSystemname and SetFileName
String sysName = “EMPTY”;
try{
sysName = (String) System.getProperty(“SAPSYSTEMNAME”);
}catch(Exception e) {
sysName = “ERROR”;
}
return sysName;
String filename = new String(“EMPTY”);
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); DynamicConfigurationKey key1 = DynamicConfigurationKey.create(“http:/”+”/sap.com/xi/XI/System/File”,”FileName”);
filename = var1;
try{
conf1.put(key1,filename);
}catch(Exception e) {
}
return filename;
UDF: how to handle SUPPRESS and CC
try{
for ( int i = 0; i < var1.length; i++){
if( var1[i].equals(ResultList.CC)){
result.addValue(“found CC”);
}else{
if( var1[i].equals(ResultList.SUPPRESS)){
result.addValue(“found SUPPRESS”);
}else{
result.addValue(var1[i]);
}//end els
}//end else
}//end for
//below how to set SUPPRESS und CC in UDF
//result.addSuppress();
//result.addContextChange();
}catch(Exception e) {
result.addValue(“EMPTY”);
}//end try
UDF: how to put all values of one CC into one target field (concat)
String stringle = “”;
try{
for ( int i = 0; i < var1.length; i++){
if(! var1[i].equals(ResultList.CC)){
stringle = stringle + var1[i];
}//end if
}//end for
result.addValue(stringle);
}catch(Exception e) {
result.addValue(“EMPTY”);
}//end try
UDF: to convert number to decimal
String in = var1.trim();
try {
double value = Double.parseDouble(in);
value = value / 1000d;
String res = new String (new java.text.DecimalFormat(“0.000”).format(value));
if (res.length() > 11)
res = res.substring(0, 11);
return (res);
} catch (NumberFormatException e) {
return (“ERROR ” + e.toString());
}
UDF: check if number. (the format number PI function throws errors, so this function helps to avoid mapping error)
String ret;
int i = 0;
ret = “false”;
try{
i = Integer.valueOf(var1).intValue();
ret = “true”;
}catch ( Exception e){
ret = “false”;
}
return ret;
UDF: channelJump during mapping (asy)
MappingTrace trace;
trace = container.getTrace();
String back=”default”;
try{
back = “start”;
//instance the channel to invoke the service.
Channel channel = LookupService.getChannel(“”,BS,CC);
SystemAccessor accessor = LookupService.getSystemAccessor(channel);
//payload xml
InputStream inputStream =new ByteArrayInputStream(payload.getBytes());
XmlPayload xmlpayload = LookupService.getXmlPayload(inputStream);
Payload SOAPOutPayload = null;
//The response will be a Payload. Parse this to get the response field out.
SOAPOutPayload = accessor.call(xmlpayload);
/* Parse the SOAPPayload to get the SOAP Response back.
The conversion rate is available under the Field Name ConversionRateResult */
InputStream inp = SOAPOutPayload.getContent();
back = “ende”;
} catch(Exception ex) {
trace.addWarning(ex.getMessage());
back = “ERROR”;
}
return back;
UDF: date plus or minus x days
try {
SimpleDateFormat sdf = new SimpleDateFormat(“yyyyMMdd”);
Date date = sdf.parse(var1[0],new ParsePosition(0));
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, var2[0]);
date = cal.getTime();
String output = sdf.format(date);
result.addValue(output);
} catch (Exception e) {
result.addValue(“20171201”);
}
Hi Daniel
The functions and UDF here covers quite a lot of the UDF that I would normally create.
There is a good amount UDF in the B2B addon that you want to try. For the set/get dynamic properties.
Hi Daniel
Yes with “B2B add on” or Seeburger you will have nice UDF collection.
But this is not available for all developer. It depends on the SAP license you have.
My intention with this blog is that PI developer should know what they are doing and in case of UDF it is very important to cover “error cases” as well.
So the important hint from my side is: do not forget “try and catch”.
As PI trainer for SAP education Germany and Switzerland.
I realized that we have a big gap in the PI developer world about understanding of XML structure and meaning of queue context.
I like the graphical mapping tool and the “display Queue” option.
But I see a big gap in case of Mapping quality.
Does they really know what they are doing or is this only a LuckyPunch?
This is the reason why I started to write blogs (I do not like to write, but it is important that we share our deep knowledge).
We have to help the new developer to have it easier as we in the past
The most developer I know have only visit the TBIT40/BIT400 (PI/PO overall basics) but more important is the BIT460 “PI Message Mapping”.
For all developer which are not tired about my words, use this link to get a better understanding about “Mapping Functionality in XI”.
If you are aware about this and know how the target “Queue” has to look like then you are close to get “senior” title.
Also please use the wonderful Test option, and do negative tests.
Delete some Fields / Segments, duplicate some elements …
and if your mapping will work then as well, then you are close to get “principal” on your business card
Daniel | https://blogs.sap.com/2016/11/07/sap-xipipo-mapping-tricks-and-udf-samples/ | CC-MAIN-2020-40 | refinedweb | 1,058 | 58.28 |
Tag:keyboard
Differences between iPad and iPhone development1、 Differences between iPhone and iPad development Screen size / resolution Layout / design of UI elements keyboard API Screen orientation support… … Because the iPad screen is larger than the iPhone and can accommodate more UI elements, the arrangement is differentFor example, Sina Weibo: (iPhone on the left, iPad on the right) keyboard The […] […]
#JS realizes browser’s full screen and exit full screenJS realizes browser’s full screen and exit full screen For more daily use of the public class operation method, you can pay attention to the small pulley website… /** *Full screen */ let toFullScreen = () => { let el = document.documentElement; let rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen; //typeof rfs […] […]
Win10 Ctrl and ALT key exchangeI tried to use third-party software to modify, but it was always unsuccessful. Later, I found that modifying the registry directly was very successful. Win + R input regedit Go to this path Note: to create a new binary file named scayboard, right click on it Enter the code 00,00,00,00,00,00,00,00 03,00,00,00,38,00,1D,00 1D,00,38,00,00,00,00,00 How it’s done […]
Upload local code to GitHub1. Create public key and private key 1) ssh-keygen -t rsa -C “[email protected]” 2) Press enter continuously 3) If ID exists_ The RSA file will displayXXX/.ssh/id_rsaaalready exists. It is necessary at this timerm -f id_rsaAnd repeat the above operation. [. SSH is a hidden file. If you want to display it, keyboard command + Shift […]
H5 webpage, IOS mobile terminal soft keyboard folded, page content does not slideIOS mobile terminal input content, soft keyboard pop-up, the whole page content moved up. But the keyboard is folded, and the page content does not slide. Android is OK. The treatment methods are as follows: //JQuery method reference $(‘input,textarea’).on(‘blur’,function(){ window.scroll (0,0); // the key is this sentence }); $(‘select’).on(‘change’,function(){ window.scroll(0,0); }); The principle is that […]
C practical exercise topic 18Title:Find the value of S = a + AA + AAA + AAAA + AA… A, where a is a number. For example, 2 + 22 + 222 + 2222 + 22222 (at this time, there are 5 numbers added), and the addition of several numbers is controlled by keyboard. Program analysis:The key is to […]
Keyboard events1、 Listen for enter call events1、jquery: $(“dom”).keypress(function (even) { if (even.which == 13) { //Event handling } }); 2、JavaScript: document.onkeydown=function(event){ var e = event || window.event || arguments.callee.caller.arguments[0]; If (E & & e.keycode = = 27) {// press ESC //Event handling } If (E & & e.keycode = = 13) {// enter key //Event handling […]
A Windows Desktop sedentary reminder widgetdownload To get to the point, give the download address directly introduce There is no need to talk about the harm of sitting for a long time, but when we work, we always sit for hours without moving.Before graduation last year, I wrote a desktop sedentary reminder tool that I didn’t care about when I […]
JavaScript game example: simple keyboard practiceKeyboard is a kind of common input equipment. It is a basic skill for computer users to input flexibly and skillfully. Let’s write a simple keyboard practice game. 1. Small interactive animation of puncturing bubbles Before writing a simple keyboard practice game, first design a simple bubble piercing interactive animation. At the bottom of the […] | https://developpaper.com/tag/keyboard/ | CC-MAIN-2020-50 | refinedweb | 564 | 52.8 |
#include <lvt/Group.h>
Inheritance diagram for Group:
A Group is a Node that aggregates other Nodes. Use Groups to arrange related Nodes into a single object. Groups are the building blocks of hierarchical scene graphs.
Default constructor.
Constructs an empty, unsealed Group.
Copy constructor.
Constructs a new Group with the same children as the argument Group. If the argument Group is sealed, the new group is compiled into a new display list.
[virtual]
Default destructor.
When a Group is destroyed, the reference count of each child object is decremented, and the children are destroyed, if necessary.
Adds a child object to the Group.
Animates the Group.
Calls the Animate() member function for each child Node. Note that Animate() always animates the child objects, even if the Group is sealed. Therefore, sealing a group which contains Animators (or other Nodes that implement Animate()) may cause discontinuities when the group is unsealed. Pause or disable any animation in child nodes to avoid discontinuities.
Reimplemented from Node.
Removes all children from the Group.
Removes all children from the Group, decrementing their reference counts, and deleting them, if necessary.
Searches for a child Node.
Returns a BoundingBox containing all of the Group's children.
Inserts a child object into the Group.
[inline]
Returns true if the Group is sealed, false if it is not.
Returns a pointer to the ith child node.
[protected, virtual]
Performs any cleanup necessary after rendering child objects.
Called by Render() after any child objects have been rendered, and after a display list is created or executed, if the Group is sealed. When deriving from Group, override this function to perform any necessary cleanup after rendering children.
Reimplemented in Separator.
Performs any setup necessary before rendering child objects.
Called by Render() before any child objects are rendered, and before a display list is created or executed, if the Group is sealed. When deriving from Group, override this function to perform any necessary initialization before rendering children.
Removes a node from the Group.
Renders the group.
If the Group is sealed, Render() creates a display list, if necessary, and executes it. If the Group is not sealed, Render() calls the RenderChildren() member function to render each child.
When deriving from Group, this function should not, in general, be overridden. The work is performed by PreRender(), PostRender(), and RenderChildren(), and those are the function that an implementor of a Group derived class should override. Using the Group implementation of Render() for derived objects guarantees that the behavior of sealed Groups is consistent for all Group-derived classes.
Note that PreRender() and PostRender() are not compiled into the display list. Use these two functions to implement any animation, or other changes across different calls to Render().
Implements Node.
Renders child objects.
Renders all child objects. The default implementation iterates over the child objects in the order they were added and calls the Render() function for each child. When deriving from Group, override this function to change the behavior of child rendering.
Reimplemented in Switch, and AutoSwitch.
Seals a static group to speed rendering.
If a group contains objects that are static, i.e. not changing with respect to each other. An increase in performance can be gained by sealing the Group, which collects its child nodes into an OpenGL display list.
Once a Group is sealed, the display list will be built on the next call to Render(). After this call, the display list will be fixed, and no changes to any child nodes will show up in successive calls to Render(). For changes to take effect, the group must be unsealed with UnSeal(), and then resealed.
NOTE: Sealing a Group which contains an Animator will "freeze" the Animator in time until the Group is unsealed. This is not the recommended way to pause the animation of an Animator. Animator::Pause() is the correct way to stop an animation.
Rapidly sealing and unsealing an object can be expensive. Only Groups that change infrequently should be sealed.
Returns the number of child objects in the Group.
Creates a new traversal (subgraph) of the node.
Unseals a Group.
Destroys the sealed group's associated display list and marks the Group as unsealed. A sealed group must be unsealed before any changes made to child nodes will show up in a call to Render().
Is it perfectly acceptable for a sealed or unsealed Group to contain other sealed or unsealed Groups. However, sealing a Group will effectively seal any child Groups. Modifying a child Group of a sealed Group will have no effect until the parent Group is unsealed. | http://liblvt.sourceforge.net/doc/ref/class_l_v_t_1_1_group.html | CC-MAIN-2017-13 | refinedweb | 764 | 67.76 |
Hello,
I am attempting to create a simple TGraph of information from a root file. All the PyROOT demos work appropriately and I am essentially attempting to recreate the graph.py demo. However, when I run my code from the command line as:
python Plot.py
The resulting canvas is blank. If I run the code from the interpreter, the canvas is again blank until I ‘quit’, due to the piece of code at the end of my Plot.py file to keep the canvas from disappearing once the code was executed. After I ‘quit’ the code, then the canvas is filled with the TGraph I intended to plot. It also works if I remove the code from the function definition and simply execute the file from the interpreter with execfile(). Below is the code I have:
def fileTimePlots(path, Act, Eng): L = [] X = [] fname = path + "/INFO/Activation_Scalers.txt" with open(fname,"r") as f: line1 = int(f.readline().strip().split()[-1]) line2 = int(f.readline().strip().split()[-1]) T0 = line1-line2 fname = path + "/DATA/gamma/" + "GammaData_{}_{}MeV.root".format(Act.replace("_",""), Eng) tfile = ROOT.TFile(fname) ttree = tfile.fileInfo for ev in ttree: L.append((datetime.strptime((ev.DateTime).rstrip('\x00'),"%Y%m%d.%H%M%S")-datetime(1970,1,1)).total_seconds()) L.sort() L = [int(T-T0) for T in L] x = array('i', L) for key in tfile.GetListOfKeys(): if key.GetName() != "fileInfo": X.append(int((key.GetName()).split("_")[3])) y = array('i',X) n = len(L) print x print y gr = ROOT.TGraph(n,x,y) gr.SetMarkerStyle(20); gr.SetMarkerSize(.6); gr.Draw("ZPA")
I am trying to understand why the TGraph does not appear when this function is run.
I was able to get the same behavior from the graph.py tutorial by adding
## wait for input to keep the GUI (which lives on a ROOT event dispatcher) alive if __name__ == '__main__': rep = '' while not rep in [ 'q', 'Q' ]: rep = raw_input( 'enter "q" to quit: ' ) if 1 < len(rep): rep = rep[0]
and then running the graph.py from the command line with ‘python graph.py’. There again, the canvas was blank.
I am wanting to call this function from a gui, and see the resulting plot. I have checked that all the data in the arrays is correct, but there must be some pythonic issue that I don’t understand that keeps the TGraph from actually plotting.
Thank you.
ROOT Version: 6.14.06
Platform: OSX 10.14
Compiler: Not Provided | https://root-forum.cern.ch/t/pyroot-tgraph-blank-canvas-from-function/32244 | CC-MAIN-2022-27 | refinedweb | 421 | 67.65 |
Hello everybody,
A brief reading of blender minutes, to me suggests that perhaps the errors to both install attempts are the results of absence of python 2.6?
Please help
a2z
Hello everybody,
A brief reading of blender minutes, to me suggests that perhaps the errors to both install attempts are the results of absence of python 2.6?
Please help
a2z
Not a lot to go on is there ?
Richard
an external python install shouldn’t be necessary. many python functions are compiled into the blender code, so you only need python installed separately if you want to use additional python functions.
Sorry to be so brief. I think the problem was with blender site. I was getting 2 different dll errors while I tried to download from the installer and the zip. Went back a few hours later and all is working.
Thanks
a2z
Can you pleas tell me how do i install Python 2.6 in Blender. Coz when i open the program, that black screen behind Blender was unable to find the python, even though i have it in my computer. Can you tell me. Its Blender 2.49a 64-bit version. Thanx
i actually figured that out by overwriting it. Can you guys tell me, is it a good idea to overwrite Blenders python script with downloaded new version python script?
It’s a good idea if you get the scripts from a correctly updated site (svn’s blender\release\scripts folder or, for french users, the packed files from zoo-logique.org/3D.Blender, for instance). Elsewhere, the scripts are often older than the ones in the zipped archives of the curreent released version.
If there is any possibility you could tell me what my problem is about, it’ll be perfect. I have put Luxrender’s LuxBlend.py Script in Blenders script. When i opened Blender i could see Luxrender Exporter, but the problem is, when i press it, it gives me a python error, and when i check the black screen that’s behind blenders window, it shows a SyntaxError: Invalid Syntax, and something like “File <“strdn” line 1” something like that. Pleas tell me the solution.
Try to work with a blender built with python 2.5.
jms,
there is no problem exporting to Luxrender using Python 2.5 or Python 2.6.
I know, I tested it.
I tried the zipped 2.49a from blender.org and use it without a complete python 2.6.2 installation :
the 2.6.2 file provided in the ptyhon…zip does not work as they should (like in the 2.48a)
import os or import random will fail…
will make some tests.
hey littleneo,
yes, you will find this is a known issue with the random module.
(i heard devs debating this recently.)
I didn’t pick up on it until it was mentioned
I’m on Windows xp & Vista, I have Python 2.5, 2.6 & 3.1.
That way there’s no issues with finding Python & all the modules are correct.
Hopefully this issue will be fixed in a bug release.
Really there should at least be a note on the download page that a full Python install may be needed to run some scripts.
This is why on the wiki pages I write that a full Python install is recommended.
To avoid confusion & errors.
thanks meta,
the os module seems broken also… everything’s ok with 2.6.2. installed
I tried to modify the python26.zip with the original 2.6.2 files (I believe they are not the same) but blender complains about the zip format. tried also to add a path to a python26 folder, but it checks the zip first… what is the tool used to zip it ? tried different things with 7z but it failed)
…and I did this silly thing that works (at least with the city engine script), when no python 2.6.2 installed :
just copy the python25.zip from the 2.49 install and paste/rename it python26.py in the 2.49a.
(that’s insane, I know)
python26.zip (python25.zip in fact)
hey littleneo, that’s a handy trick.
i would suggest taking a look at some builds from Graphicall.
Zebulon & Kai Kostack produce some good builds.
I think Zebulon has fixed the py26 zip, but I’m unsure.
I have a question, i got everything resolved in terms of software problems, BUT there is one thing that bothers me about working with fluids. I rendered a water scene with Subdivide and Smooth levels 2(you can already imagine rendering while those on can take forever, well mine took 10 hours, that’s not bad), and also i set the resolution to 430, but after baking i could still see some pixelation in the water. Than what i did after baking was, i Mulitiresed it to Level 4 and added subsurf modifier to level 3. But i still could see tiny bit of pixelation in the water. Do you think i should add more Multires and more subsurf levels? The thing is, if i can see tiny bit of pixelation at 1000x400, than higher pixel image would show more. I’m trying to make a high quality image, probably around 5000x3000 for illustration. Pleas tell me if there is any other ways to solve this problem. Thanx
Just use Set Smooth. In the Link and materials section in the Editing (F9) Panel.
All your multires and subsurf is way overkill to get a smooth surface. You must have a supercomputer to use those settings.
Richard
“You must have a supercomputer to use those settings.” That i definitely do have(of course i have to add more rams to render more faster for images), but i already did add set smooth, and also i did add more multires and subsurf to level 6 and 7. It did kind of get what i want, but then i realized my mistake was from the beginning. Yes i’ll still add the multires and subsurf after baking, but i forgot to bake it with more then level 2 smooth surface, so i can get smoother. For off topic question, do other 3d softwares have installation headaches like you would normally have with Blender. Don’t get me wrong, I f****ing love Blender, because you get the same professional quality as the other softwares that cost from $2000 to $8000. The reason why i’m asking this is, i’m starting to get really in to 3d illustrations and most studios require knowledge in the other softwares, and i’m thinking of get those softs, so what you think, basically it seems that this question is mostly for those who use the other softwares(Maya, Cinema 4d, 3D’s Max, XSI, etc.). Will i have the same installation problems like i had with Blender? Will i have headaches with installing external Rendering engines? Thanx
O and i almost forgot, do other softwares require installing python and stuff like that?
^^no, check your control panel. you most likely have 2.5 or nothing at all.
Download 2.6 so that in appears in your control panel. then restart blender. | https://blenderartists.org/t/error-installing-2-49a-installer-zip-windows-xp/451698 | CC-MAIN-2021-10 | refinedweb | 1,205 | 83.25 |
Py2MASS 0.1.5
Py2MASS is used for accessing a locally hosted copy of 2MASS PSC/XSC======= Py2MASS =======
| Py2MASS is used for accessing a locally hosted copy of 2MASS.
| More information on 2MASS is available at:
Full copies of the 2MASS point source catalog (PSC) are large: ~40Gigs
compressed
(The extended source catalog (XSC) is modest by comparison at <800megs.)
Both are available for download from:
::
Note that the PSC contains some sources out of order, so you will need
to reprocess the PSC using the included:
::
py2mass_process_original_psc.py
A typical usage to fetch a region of the catalog is:
::
#!/usr/bin/env python
from py2mass import fetch_2mass_psc_box
ra_range = [281., 281.05] # RA is in degrees
dec_range = [-30.6, -30.55] # Dec is in degrees
stars = fetch_2mass_psc_box(ra_range, dec_range)
from py2mass import fetch_2mass_xsc_box
ra_range = [281., 281.05] # RA is in degrees
dec_range = [-30.6, -30.55] # Dec is in degrees
sources = fetch_2mass_xsc_box(ra_range, dec_range)
Note that in all cases the returned object is a ``pandas.DataFrame``.
A command line script is also installed that allows direct access via,
e.g.:
::
py2mass [psc|xsc] minRA maxRA minDEC maxDEC [pickle]
psc - 2MASS Point Source Catalog xsc - 2MASS Extended Source Catalog
Default output is a nicely formatted text table. Optional keyword
(pickle) will dump a pickle of that table, which can then be read back
in from file within python, e.g.:
import pickle stars = pickle.load(open(filename, 'r'))
========
Originally written 2014-03-28 by Henry Roe (hroe@hroe.me)
- Author: Henry Roe
- Keywords: 2MASS catalog
- License: MIT License
- Categories
- Requires Distributions
- Package Index Owner: hroe
- DOAP record: Py2MASS-0.1.5.xml | https://pypi.python.org/pypi/Py2MASS | CC-MAIN-2018-13 | refinedweb | 271 | 63.59 |
Python API deployment with RStudio Connect: FastAPI
Want to share your content on python-bloggers? click here.
This is part two of our three part series
- Part 1: Python API deployment with RStudio Connect: Flask
- Part 2: Python API deployment with RStudio Connect: FastAPI (this post)
- Part 3: Python API deployment with RStudio Connect: Streamlit (to be published). RStudio Connect also supports a growing number of Python applications, including Flask and FastAPI.
FastAPI is a light web framework and as you can probably tell by the name, it’s fast. It provides a similar functionality to Flask in that it allows the building of web applications and APIs, however it is newer and uses the ASGI (Asynchronous Server Gateway Interface) framework. One of the nice features of FastAPI is it is built on OpenAPI and JSON Schema standards which means it has the ability to provide automatic interactive API documentation with SwaggerUI. You also get validation for most Python data types with Pydantic. FastAPI is therefore another popular choice for data scientists when creating APIs to interact with and visualize data.
In this blog post we will go through how to deploy a simple machine learning API to RStudio Connect.
Do you use RStudio Pro? If so, checkout out our managed RStudio services
First steps
First of all we need to create a project directory and install FastAPI. Unlike Flask, FastAPI doesn’t have an inbuilt web server implementation. Therefore, in order to run our app locally, we will also need to install an ASGI server such as uvicorn,
# create a project repo mkdir fastapi-rsconnect-blog && cd fastapi-rsconnect-blog # create and source a new virtual environment python -m venv .venv source .venv/bin/activate # install FastAPI and uvicorn pip install fastapi pip install "uvicorn[standard]"
Lets start with a basic “hello world” app which we will create in a file called
fastapi_hello.py.
touch fastapi_hello.py
Our hello world app in FastAPI will look something something like,
# fastapi_hello.py from fastapi import FastAPI # Create a FastAPI instance app = FastAPI() @app.get("/") async def root(): return {"message": "Hello World"}
This can be run with,
uvicorn fastapi_hello:app --reload
You will get an output with the link to where your API is running.
INFO: Uvicorn running on (Press CTRL+C to quit)
You can check it is working by navigating to in your browser.
Example ML API
Now for a slightly more relevant example! In the pipeline of a data science project, a crucial step is often deploying your model so that it can be used in production. In this example we will use a simple API which allows access to the predictions of a model. Details on the model and creating APIs with FastAPI are beyond the scope of this blog, however this allows for a more interesting demo than “hello world”. If you are getting started with FastAPI this tutorial covers most of the basics.
We will need to install a few more packages in order to run this example.
pip install scikit-learn joblib numpy
Our demo consists of a
train.py script which trains a few machine learning models on the classic Iris dataset and saves the fitted models to
.joblib files. We then have a
fastapi_ml.py script where we build our API. This loads the trained models and uses them to predict the species classification for a given iris data entry.
First we will need to create the script in which we will train our models:
touch train.py
and then copy in the code below.
# train.py import joblib import numpy as np from sklearn.datasets import load_iris from sklearn.naive_bayes import GaussianNB from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import SVC # Load in the iris dataset dataset = load_iris() # Get features and targets for training features = dataset.data targets = dataset.target # Define a dictionary of models to train classifiers = { "GaussianNB": GaussianNB(), "KNN": KNeighborsClassifier(3), "SVM": SVC(gamma=2, C=1), } # Fit models for model, clf in classifiers.items(): clf.fit(features, targets) with open(f"{model}_model.joblib", "wb") as file: joblib.dump(clf, file) # Save target names with open("target_names.txt", "wb") as file: np.savetxt(file, dataset.target_names, fmt="%s")
We will then need to run this script with:
python train.py
You should now see a
target_names.txt file in your working directory. Along with the
<model name>_model.joblib files.
Next we will create a file for our FastAPI app,
touch fastapi_ml.py
and copy in the following code to build our API.
# fastapi_ml.py from enum import Enum import joblib import numpy as np from fastapi import FastAPI from pydantic import BaseModel from sklearn.datasets import load_iris from sklearn.naive_bayes import GaussianNB from sklearn.neighbors import KNeighborsClassifier from sklearn.svm import SVC # Create an Enum class with class attributes with fixed values. class ModelName(str, Enum): gaussian_nb = "GaussianNB" knn = "KNN" svm = "SVM" # Create a request body with pydantic's BaseModel class IrisData(BaseModel): sepal_length: float sepal_width: float petal_length: float petal_width: float # Load target names with open("target_names.txt", "rb") as file: target_names = np.loadtxt(file, dtype="str") # Load models classifiers = {} for model in ModelName: with open(f"{model.value}_model.joblib", "rb") as file: classifiers[model.value] = joblib.load(file) # Create a FastAPI instance app = FastAPI() # Create a POST endpoint to receive data and return the model prediction @app.post("/predict/{model_name}") async def predict_model(data: IrisData, model_name: ModelName): clf = classifiers[model_name.value] test_data = [ [data.sepal_length, data.sepal_width, data.petal_length, data.petal_width] ] class_idx = clf.predict(test_data)[0] # predict model on data return {"species": target_names[class_idx]}
We can run the server locally with,
uvicorn fastapi_ml:app --reload
Now if you go to, you should see a page that looks like this,
You can test out your API by selecting the ‘POST’ dropdown and then clicking ‘Try it out’.
You can also test the response of your API for the KNN model with,
curl -X 'POST' '' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"sepal_length": 0,"sepal_width": 0,"petal_length": 0,"petal_width": 0}'
You can get the response for the other models by replacing ‘KNN’ with their names in the path.
Deploying to RStudio Connect
Deploying a FastAPI app to RStudio Connect is very similar to deploying a Flask app. First of all, we need to install
rsconnect-python, which is the CLI tool we will use to deploy.
pip install rsconnect-python
If you have not done so already, you will need to add the server that FastAPI
When we deploy we will also need to tell RStudio Connect where our app is located. We do this with an
--entrypoint flag which is of the form module name:object name. By default RStudio Connect will look for an entrypoint of app:app.
We are now ready to deploy our ML API by running,
rsconnect deploy fastapi -n <server nickname> . --entrypoint fastapi_ml:app
from the
fastapi-deploy-demo directory.
Your ML API has now been deployed! You can check the deployment by following the output links which will take you to your API on RStudio Connect.
Further reading
We hope you found this post useful!
If you wish to learn more about FastAPI or deploying applications to RStudio Connect you may be interested in the following links:
For updates and revisions to this article, see the original post
Want to share your content on python-bloggers? click here. | https://python-bloggers.com/2022/09/python-api-deployment-with-rstudio-connect-fastapi/ | CC-MAIN-2022-40 | refinedweb | 1,230 | 64.51 |
strpbrk() Prototype
const char* strpbrk( const char* dest, const char* breakset ); char* strpbrk( char* dest, const char* breakset );
The
strpbrk() function takes two null terminated byte string: dest and breakset as its arguments. It searches the null terminated byte string pointed to by dest for any character that is present in the string pointed to by breakset and returns the pointer to that character in dest.
It is defined in <cstring> header file.
strpbrk() Parameters
dest: Pointer to a null terminated string to be searched.
breakset: Pointer to a null terminated string containing the characters to search for.
strpbrk() Return value
- If the dest and breakset pointer has one or more characters in common, the
strpbrk()function returns the pointer to the first character in dest that is also in breakset.
- If no characters in breakset is present in dest, a null pointer is returned.
Example: How strpbrk() function works
#include <iostream> #include <cstdio> using namespace std; int main() { char digits[] = "0123456789"; char code[] = "ceQasieoLPqa4xz10Iyq"; char *pos; int count = 0; pos = strpbrk (code, digits); while (pos != NULL) { pos = strpbrk (pos+1,digits); count ++; } cout << "There are " << count << " numbers in " << code; return 0; }
When you run the program, the output will be:
There are 3 numbers in ceQasieoLPqa4xz10Iyq | https://www.programiz.com/cpp-programming/library-function/cstring/strpbrk | CC-MAIN-2020-16 | refinedweb | 207 | 56.89 |
(See history for list of changes.)
This is a library of 100% managed code that draws beautifully formatted HTML. It comes along with three WinForms controls:
And a static method ready to draw HTML:
static
HtmlRenderer.Render(Graphics g, string html, RectangleF area, bool clip)
Note: The drawing engine is based on the CSS Level 2 specification.
For years, I have been planning for a project like this. I prepared myself quite well. I went through the entire CSS Level 2 specification along with the HTML 4.01 specification.
One of the most interesting things I found is this: Drawing HTML is no more than laying out a bunch of boxes with borders margins and paddings. Once you overpass this paradigm, everything else is to help the code actually place the boxes on the right place, and then paint the string each box contains.
Imagine the power that drawing full-rich-formatted HTML on your controls can give to your applications. Use bold when you need it, italics on every message, and borders and fonts as you may like or need everywhere on the desktop application. One of the first projects where I will use it is on the tooltips of my Ribbon Project.
Although I have not tested it on mono yet, there should be no problem at all, since all of the code in the library is managed code and the methods it uses to paint are quite basic. It draws lines, rectangles, curves and text.
For now, the render looks really nice. Sometimes it can fool you to think you're using a real Web browser, trust me, download the demo, it is just an EXE and a DLL.
The library locates the code under the System.Drawing.Html namespace. The controls that render HTML are under the System.Windows.Forms namespace.
System.Drawing.Html
System.Windows.Forms
The renderer follows the CSS Box Model. Box model is nothing but a tree of boxes, just as the tree of HTML, each of these boxes is represented by a very used class called CssBox. The start node is represented by the class InitialContainer.
CssBox
InitialContainer
All the known CSS properties apply to each of these boxes. Each box may contain any number of child boxes and just one parent. The only box that has no parent at all is the so called Initial Container.
A typical use of an Initial Container to draw HTML would look like this:
//Create the InitialContainer
InitialContainer c = new InitialContainer("<html>");
//Give bounds to the container
c.SetBounds(ClientRectangle);
//Measure bounds of each box on the tree
c.MeasureBounds(graphics);
//Paint the HTML document
c.Paint(graphics);
You may never use it, since I provided controls and methods that create this object for you.
A panel that is ready to accept HTML code via its Text property. Its full name is System.Windows.Forms.HtmlPanel.
Text
System.Windows.Forms.HtmlPanel
The only properties you need to know are:
true
The panel will update the bounds of the elements as you scroll or resize the control.
A label that is ready to accept HTML code via its Text property. Its full name is System.Windows.Forms.HtmlLabel.
System.Windows.Forms.HtmlLabel
Some interesting things:
Works exactly like the ToolTip you already know, with the little difference that this tooltip will render HTML on it. It's full name is System.Windows.Forms.HtmlToolTip.
System.Windows.Forms.HtmlToolTip
There are no properties here to learn. Use it just the way you use the ToolTip that comes with the framework. Internally, it just handles the OwnerDraw event.
OwnerDraw
I took the liberty of adding a couple of features:
These are achieved through the following CSS properties:
background-gradient: (color)
background-gradient-angle: (number)
corner-ne-radius: (length)
corner-nw-radius: (length)
corner-se-radius: (length)
corner-radius: (length){1,4} (shorthand for all corners)
height
What can I say, this is one of the most fun projects I've ever been involved with. And so far, it runs beautifully and checks its original design goals.
I am planning to give it full rendering support, to the day that you may visualize a web page just as a good web browser would; and why not, make a WYSIWYG HTML editor to give amazing HTML editing power to your applications.
I'm also planning to make sure it runs perfectly well on Mono and on Mobile platforms.
In the next few days, I'll publish a list of supported HTML tags and CSS properties.
This article, along with any associated source code and files, is licensed under The BSD License
dir, hr, menu, pre, br { display: block }
General News Suggestion Question Bug Answer Joke Rant Admin
Math Primers for Programmers | http://www.codeproject.com/Articles/32376/A-Professional-HTML-Renderer-You-Will-Use?msg=3142470 | CC-MAIN-2013-20 | refinedweb | 792 | 62.88 |
Serverless Framework Intro Project
Tom McLaughlin
Feb 6
Originally published at serverlessops.io on Jan 30, 2018
Serverless is a cloud architecture that provides enormous benefits for operations engineers and Serverless Framework makes it easy to get started. It’s useful for operations and devops engineers who have been writing scripts to automate parts of their environment regularly and for those just beginning to write their automation. For those who have been writing automation regularly, periodic tasks that ran on a random AWS EC2 instance can now be turned into a standalone system with automation logic and accompanying infrastructure code that is tracked via AWS CloudFormation. For those new to writing automation, serverless architecture can lower the barrier to entry for infrastructure automation.
To demonstrate this, let’s build a simple service for our AWS environment. You may have a desire to track AWS console logins for reasons like compliance, auditing needs, or a desire to just have better visibility into your environment. We’ll build a Python 3 service that records console login CloudTrail events to an S3 bucket. We’ll extend this service with more features in future blog posts.
The project for this blog post, aws-console-auditor, is located on GitHub. Additionally, because aws-console-auditor will evolve, a fork of the repo specifically for this blog post is also available.
Getting started
To get started, install the Serverless Framework. It’s written in JavaScript and you’ll need to have NodeJS and NPM installed in order to do so.
npm install -g serverless
With Serverless Framework installed, we’ll go ahead and create a project. The serverless script can create projects of different types using templates. We’ll create a project using the AWS Python 3 template and also install a plugin for handling python dependencies.
serverless create -t aws-python3 -n serverless-aws-python3-intro -p serverless-aws-python3-intro cd serverless-aws-python3-intro serverless plugin install -n serverless-python-requirements
What will be created is a serverless.yml template file, a basic handler script (which we’ll discard), and a .gitignore.
Diagram the service
Rather than jumping right into building our service, let’s take a moment to draw a system diagram. This may seem unconventional to some, especially for simple services, but this forces us to be sure of what we’re about to build before we ever start any time consuming coding.
There are several options you can use:
I personally use Draw.io because it gives me access to the entire AWS icon set. This let’s me diagram a system with icons that are generally recognizable to people familiar with the AWS ecosystem.
This is the system about to be built. Contained in the rectangle on the right is the service to be built. On the left is the workflow that will trigger the service.
The flow of the system is as follows, a user logs into the console which generates a CloudTrail event and that event will trigger a Lambda that writes the event data to an S3 bucket.
Creating serverless.yml
Now that we know what system we’re about to build, we can start building it. Serverless Framework provides the ability to represent the system as code (well, YAML), deploy, and manage the system. The serverless.yml will need to define three things:
- AWS Lambda function (and define the event to trigger it)
- S3 bucket
- IAM policy (not pictured above) to allow the Lambda to write to the bucket.
Let’s go through the different sections of the serverless.yml now.
Initial Configuration
We’ll start with some initial configuration in the serverless.yml file. We’ll replace the existing serverless.yml created by the template with the following below. There’s nothing wrong with the template serverless.yml but this is just a little clearer to follow and explain.
service: serverless-aws-python3-intro plugins: - serverless-python-requirements provider: name: aws region: us-east-1 stage: dev environment: LOG_LEVEL: INFO iamRoleStatements: resources: functions:
First we start by providing the name of the service. In this case, it’s called serverless-aws-python3-intro. We’ll see the service name used in many of the resources created for this service.
The plugins section lists a single plugin, serverless-python-requirements. This plugin will handle building and installing python dependencies specified in a standard requirements.txt file. We don’t actually need this currently, but it’s useful to be introduced to the plugin now. We’ll probably use it later on as we evolve this service down the road. Also, if you go off after this to write a service of your own, knowing about this plugin is useful.
The provider section defines the serverless platform provider and its configuration along with other configuration for the service’s component resources. The section will create an AWS serverless system in us-east-1 using your locally configured default AWS credentials.
The stage attribute is how Serverless Framework namespaces deployments of the same service within the same environment. That can be used if development and production share a single AWS account or if you want multiple developers to be able to deploy their own system simultaneously.
The region, stage, and AWS profile name can be overridden on the command line using the --region, --stage, and_ --aws-profile_ arguments respectively. You can make region, stage, and profile more flexible using environmental variables but we’ll cover that in another blog post.
The LOG_LEVEL environment variable is a personal preference. This makes it easy to increase the logging level on functions for debugging purposes and decrease it when done. Below is how it’s used in our handler code.
We'll leave iamRoleStatements empty for now. We'll return to it after we've created our AWS resources and need to allow the Lambda function to write to the S3 bucket.
handlers/write-event-to-s3.py:
log_level = os.environ.get('LOG_LEVEL', 'INFO') logging.root.setLevel(logging.getLevelName(log_level)) _logger = logging.getLogger( __name__ )
S3 Bucket
Instead of moving directly onto the functions section, we’ll move down to the resources section. This section is for adding AWS resources. If you’re familiar with CloudFormation then good news, it uses the same syntax as CloudFormation YAML.
Adding our service's S3 bucket is trivial: just add a resource and set the Type attribute. Here’s what the configuration looks like for this service’s S3 bucket.
resources: Resources: LoginEventS3Bucket: Type: AWS::S3::Bucket Properties: AccessControl: Private
By default, the AccessControl policy will be Private. That should probably be set in order to be explicit, so we’ve added that property. Serverless Framework will name the bucket based on the service and resource name. S3 buckets are globally unique across AWS accounts, and Serverless Frameworks will append a random string to help assure that you won’t collide with a bucket in a different account that has deployed the same service.
How will your Lambda function know to write to this S3 bucket if the name is generated with a random string? We’ll show that later.
IAM Role Statements
All functions have an IAM role, and in this example, the role will include a policy that allows our function to write to the S3 bucket. IAM roles can be defined two different ways: in the provider section under iamRoleStatements or in the resources as an AWS::IAM::Role section.
Defining IAM roles in the provider section is the commonly accepted way to define IAM roles and assign permissions with Serverless Framework. However, a single IAM role will be created for and used by all Lambda functions in the service. In this example, that is not an issue. However in larger services that have chosen a monorepo approach to code organization, you may want to exercise tighter control and create a role per function. The decision is up to you.
Our iamRoleStatements in the provider section is as follow:
iamRoleStatements: - Effect: Allow Action: - s3:PutObject Resource: - Fn::Join: - '/' - - Fn::GetAtt: - LoginEventS3Bucket - Arn - '*'
The single IAM role statement gives the ability to write to the S3 bucket. Rather than giving the name of the S3 bucket, which will be auto generated on deployment, we use the CloudFormation built-in function to Fn::GetAtt to get the ARN of the bucket by resource ID.
Functions
With supporting resources in place, we start adding to the functions section to serverless.yml. Below defines.
functions: WriteEventToS3: handler: handlers/write-event-to-s3.handler description: "Write login event to S3" runtime: python3.6 memorySize: 128 timeout: 15 role: WriteEventToS3 events: # - cloudwatchEvent: event: source: - "aws.signin" environment: S3_BUCKET_NAME: Ref: LoginEventS3Bucket
The value for handler represents the handler() function in the file handler/write-event-to-s3.py in this repo. The runtime is python3.6 and has 128M of memory allocated with a 15 second execution timeout. The role value is the IAM role resource name (not the IAM role name to be created) in the resources section.
In the environment section, we set a shell variable called S3_BUCKET_NAME with a value of the S3 bucket’s name. Since the name is autogenerated, the CloudFormation built-in function Ref is used to get the bucket’s name. This environment value will be checked by the handler’s code to know what S3 bucket to use.
Lastly, there’s the event. This is where you define what will trigger the function. In this case, a single event type, a CloudWatch event from the event source aws.login, will trigger this function.
Putting it all together
With serverless.yml all put together, the system may not be functional, there’s no handler code, but it is deployable.
sls deploy -v
Handler
Now let’s dive into the handler. When a console login event is generated by CloudWatch, it will call the handler() function in the file handlers/write-event-to-s3.py.
Before we do the handler() function code, let’s add some code that will be executed on first invocation of the function. When a Lambda function is executed, the AWS infrastructure keeps the function instance warm for subsequent requests. For python objects and variables that don’t need to be initialized on each invocation, eg. logging and boto3 objects or setting variables from the shell environment, these can be initialized outside of handler() to speed up subsequent invocations of the function.
The handler should have some logging. It’ll get the LOG_LEVEL environment variable value, set in the provider section of serverelss.yml, and create a logging object of that level.
handlers/write-event-to-s3.py:
log_level = os.environ.get('LOG_LEVEL', 'INFO')logging.root.setLevel(logging.getLevelName(log_level))_logger = logging.getLogger( __name__ )
Next initialize the code’s boto3 S3 client object and get the name of the S3 bucket to use from the shell environment.
handlers/write-event-to-s3.py:
s3_client = boto3.client('s3')s3_bucket = os.environ.get('S3_BUCKET_NAME')
The handler function is executed on every function invocation. It’s passed two variables by AWS, the event that triggered the Lambda and the context of the invocation. The context variable stores some useful information, but isn’t needed in this example so we’ll just ignore it.
The handler function is pretty straight forward. If LOG_LEVEL were set to ‘DEBUG’, then the function would log the event received. It then gets the CloudWatch event detail, calls a function that returns an S3 object key path from the event detail. Next, it writes the event detail to the S3 bucket. A log message at our standard logging level, INFO, will log information about the event that will automatically be picked up by CloudWatch. Finally, the function returns
handlers/write-event-to-s3.py
def handler(event, context): '''Lambda entry point.''' _logger.debug('Event received: {}'.format(json.dumps(event))) # We're going to ignorethe CloudWatch event data and work with just the # CloudTrail data. event_detail = event.get('detail') # Get our S3 object name from the CloudTrail data s3_object_key = _get_s3_object_key_by_event_detail(event_detail) # Write the event to S3. s3_resp = s3_client.put_object( ACL='private', Body=json.dumps(event_detail).encode(), Bucket=s3_bucket, Key=s3_object_key ) _logger.info( 'Console login event {event_id} at {event_time} logged to: {s3_bucket}/{s3_object_key}'.format( event_id=event_detail.get('eventID'), event_time=event_detail.get('eventTime'), s3_bucket=s3_bucket, s3_object_key=s3_object_key ) ) return s3_resp
Once the code is in place, then the service can be deployed again.
sls deploy -v
Now, every time someone logs into the AWS Console, the login information will be recorded. You can check the cloudWatch logs for brief information and then S3 for the login details.
Conclusion
We’re now collecting AWS console login events from our environment, and storing them in S3 to give us an audit trail of who is accessing the console. But you probably want more. You may want to send a Slack notification to a channel so people are aware. You may want to send a PagerDuty notification if the login does not match certain criteria. How about searching through the event data to find trends in your logins? We can extend this service to add new features and we’ll do that in future blog posts.
If you want to see the code used in this blog, check it out on github here:
Or take a look at AWS Console Auditor here:
This originally appeared on the ServerlessOps blog. Visit to read more of our work!
The best questions to ask in your job interview
A resource for anyone wanting to stand out from other candidates while also getting information about the companies they might join.
Great article, thanks for writing and clearly explaining each part
Awesome! I have another one I'm preparing for next week and I'm glad to know my style is clear and understandable.
Tom, nice article. Pretty detailed and well explained. Looking forward to future posts.
I have more on their way. I did my writing calendar yesterday and I have one next week coming. | https://dev.to/tmclaughbos/serverless-framework-intro-project-192o | CC-MAIN-2018-22 | refinedweb | 2,327 | 56.25 |
Apr
13
PBS 33 of x – JS Testing with QUnit
Filed Under Computers & Tech, Software Development on April 13, 2017 at 2.
Listen Along: Chit Chat Accross the Pond Episode 482
Solution to PBS 32 Challenge
In the previous instalment we looked at using
throw,
try &
catch for error handling in JavaScript.
The assignment was to.
Below is my solution, which you’ll also find in this instalment’s ZIP file as
pbs32-challenge-solution/index.html:
My solution is largely similar to the example
pbs32a.html from the previous instalment’s zip file. The biggest difference being the addition of more dropdown menus to allow the time to be chosen as well as the date. One difference is that for clarity, I choose to group the date and time dropdown menus into separate list items, and, to mark them up as form groups using the relevant ARIA markup –
role="group" and the
aria-labelledby attribute.
Test Driven Development (TDD)
TDD is a methodology for writing code. The basic process involves repeating the following steps over and over again until the code is done:
- Write new tests
- Run the new tests and make sure they all fail – if a test passes before you’ve written the code, then that test is probably flawed!
- Write some code
- Run all your tests (repeat this step and the one above until all new tests pass)
- From time-to-time, refactor your code if it starts to get needlessly complicated
There are all sorts of advantages to TDD. Firstly, it forces you to stop and think before you write a single line of code. It makes you decide on what to do about edge cases as you write the tests, and, as your code base develops over time, the library of tests should prevent you from accidentally breaking things that worked before, i.e. to avoid regressions.
In order to make use of the TDD methodology, you need some kind of testing framework/API which allows you to define and run your tests in an orderly manner. You could write your own testing functions from scratch, but that would be re-inventing the wheel, and I’m not generally in favour of doing that – I think it’s much better to use an existing framework instead.
Introducing QUnit – a JS Unit Testing Framework
TDD is a design philosophy or process, unit testing is an approach to running tests. Unit Testing involves atomising your tests so that previous tests have no effect on future tests. Basically, you define a set of initial conditions, known as your fixture, and you run each test against a new clone of that fixture. A lot of the time, the fixture is actually totally empty BTW.
QUnit is an open source framework for unit-testing JavaScript code that has been developed by the jQuery people, who use it for all the various jQuery projects like the core jQuery library and jQuery UI. QUnit can be run in two modes – on the command line through NodeJS, or, in the browser. We’ll be using QUnit in the browser.
When doing testing, you don’t want to include your tests in the same file as your code – you don’t want your tests included in your live running code. Instead, you want to add your tests to a separate file, or set of files, that sits next to your code in your development environment, and is never copied to your live website.
When using QUnit in the browser you’ll end up with three files:
- A
.jsfile containing the API (or other JS code) you’re testing
- A
.jsfile containing your tests (for big projects you might split this file up into multiple files for convenience)
- A simple HTML page that imports QUnit, imports the
.jsfiles above, and, defines your fixture. QUnit will automatically inject a form into this page that that will allow you to run your defined tests, and, see the results
Assertions
Each of your tests will contain one or more assertions. You can think of assertions as statements of expected fact – if your code is working correctly, all your assertions will be true.
QUnit ships with an impressive collection of ready-to-use assertions, and, it provides the functionality for adding your own custom assertions too. For now, we’ll limit ourselves to just a few of the most basic assertions:
assert.ok(state [, message])
- This is the simplest of the assertions, it passes if the first argument evaluates to any truthy value of any kind.
assert.equal(actual, expected [, message])
- Tests
actualagainst
expectedusing the
==operator and if that comparison returns
true, the assertion passes.
assert.strictEqual(actual, expected [, message])
- Tests
actualagainst
expectedusing the
===operator and if that comparison returns
true, the assertion passes.
assert.notEqual(actual, expected [, message])
- This test is the inverse of
assert.equal()– it tests
actualagainst
expectedusing the
!=operator.
assert.notStrictEqual(actual, expected [, message])
- This test is the inverse of
assert.strictEqual()– it tests
actualagainst
expectedusing the
!==operator.
assert.deepEqual(actual, expected [, message])
- Like
assert.equal(), but for comparing nested data like arrays rather than single values.
throws(blockFn, [expected , message])
- Tests whether the callback
blockFnthrows the
expectederror. You can accept any error at all by omitting
expected. You can specify the error string you expect, a regular expression, or, the prototype of the expected error.
A Worked Example
Let’s work through a simple practical example – let’s develop a very basic API that collects together a few maths functions using the following specification:
The API should be named
pbs.math, and should provide the following functions:
-
factorial(n)
- The function should return the factorial of
n(the first argument) as an integer. The function should throw a new
Errorif
nis not a positive integer. You’ll find a definition of factorials on Wikipedia.
-
fibonacciSeries(n)
- The function should return the fibonacci series up to and possibly including
nas an array of integers. The function should throw an error if
nis not a number, and return an empty array if
nhas a value below 0. You should use the modern variant of the sequence which uses
[0, 1]as the starting point for the series. You’ll find a definition of the Fibonacci Series on Wikipedia.
We’ll start with by creating the following three blank files (paths relative to the base folder for the project):
pbs.math.js– the file that will contain our API.
test/index.html– the QUnit test runner.
test/pbs.math.test.js– the file that will contain our tests.
Remember, with TDD you shouldn’t write code until you’ve defined some tests for that code to pass, so once we have the three blank files created, the next step is to set up our QUnit test runner in
test/index.html:
You should now see a page like the following when you load
index.html in your browser (or run it within CodeRunner):
Next, we need to write some tests. Let’s start with a general test to be sure our namespace exists. Use the following as the initial content of
test/pbs.math.test.js:
Let’s take a moment to break this down. Firstly, we said earlier that tests consist of one or more assertions – in this case, you can see two assertions inside one test.
The function
QUnit.test() adds a test into the test suite. The first argument is the title of the test. The second argument is a callback or anonymous function which defines the code for the test. The anonymous function names the first argument
assert. The QUnit documentation specifies that the callback/anonymous function will be called with a reference to
QUnit.assert, an object that defines all the standard assertion functions. We could name this first argument anything we liked, but, what ever we chose to name it, we would have to use that name instead of
assert when calling any of the assertion functions. Hence, I strongly recommend you stick with QUnit convention, and name the first argument to the callback/anonymous function in calls to
QUnit.test
assert, or, at least something sensible like
a.
Finally, within our anonymous function we call two assertions, first, we check that the outer namespace
pbs exists using the simple
ok() assertion function, then we check that the nested namespace
pbs.math exists in the same way.
The
ok() assertion function expects two arguments, the value to test for truthiness, and a string describing the test.
OK – let’s refresh our test runner (
test/index.html) and see what we get:
As expected, we see a big red error message (since we haven’t added anything into
pbs.math.js yet, not even the namespace declaration). But, look a little closer and you might notice something unexpected – the summary says:
1 tests completed in 4 milliseconds, with 1 failed, 0 skipped, and 0 todo.
0 assertions of 1 passed, 1 failed.
The first line is fine, we do indeed only have one test. But the second line, that looks odd – it says 0 assertions of 1 passed. But there are two assertions in the test, what gives?
All QUnit assertions throw an error when they fail, so, because there was no
pbs namespace, the first assertion failed, an exception was thrown, and execution of the anonymous function ended there, with only one assertion seen by QUnit. To get sane error reporting, you need to tell QUnit in advance how many assertions to expect within a given test. You can do this with the
.expect() pseudo-assertion like so:
If you save the file and re-refresh the test suite you’ll now see the expected summary:
1 tests completed in 4 milliseconds, with 1 failed, 0 skipped, and 0 todo.
0 assertions of 2 passed, 2 failed.
OK – now that our tests are working as we want, we can finally start writing some code for our API. We need to start with the boiler-plate to set up our name spaces. Let’s start by setting up just the
pbs namespace. Use the following as the initial content of
pbs.math.js:
After saving
pbs.math.js, refresh your test runner page (you need to refresh or the test runner will not have a current copy of your
.js files). You should still see 1 test failing, but within that 1 test you should now have 1 assertion passing, and one failing.
Lets’s now add the definition of the
pbs.math nested namespace to
pbs.math.js:
After saving
pbs.math.js, refresh your test runner to see the current result of all your tests. All the evil red should have vanished from the interface, and the summary should read something like:
1 tests completed in 2 milliseconds, with 0 failed, 0 skipped, and 0 todo.
2 assertions of 2 passed, 0 failed.
Below that you will find a small subtle blue line with a 1 before it followed by the title of our only test, followed by 2 within parentheses. The number in parentheses is the number of assertions in the test. To save on space as your test suite grows, QUnit minimises passing tests. You can expand them out by clicking on the title of the test. When you do that you see the two assertions with a green bar in front of them, indicating they both passed.
We have now done our first cycle through the process – we have written some tests, then written code until those tests pass.
Let’s start the next cycle by defining our test for the first of our two functions by appending the following to
test/pbs.math.test.js:
This is our first use of the
.throws() assertion. This assertion expects three arguments, a callback/anonymous function containing the code that is expected to throw an error, the expected error, and a text description. The expected error can be defined in many ways including; a string to compare to the thrown error object’s
.message property, a regular expression to compare to the thrown error object’s
.message property, or the error prototype the thrown error object is expected to have. The above code uses the last of these, specifying the
Error prototype as the second argument.
Notice that we have not yet tested that valid values do not throw errors. That will be covered by our tests to make sure valid inputs give expected outputs.
OK, now that we have some more tests written, we can write some more code.
BTW, if you’re wondering how many tests it’s OK to write before writing the code that gets them to pass – that’s up to you, but TDD fundamentalists will insist it’s one test, then code, then one test etc.. I don’t find that at all practical – instead, I take what I consider a mouthful-sized number of tests approach – when I think the tests I’ve written make a nice easy to chew mouthful, I switch from tests to code. The exact number depends on the complexity of the tests. Basically, I make a judgement call each time.
Let’s add the stub of our function to our API, and include the code for argument validation. Add the following into
pbs.math.js by appending it to the self-exectuting anonymous function:
Well, that completes another cycle, so let’s define some more tests. This time, our tests should check that valid inputs give expected outputs. In this kind of testing, be sure to check the inside edges of the range of valid values (if that’s applicable in the given situation).
Append the following to the file
test/pbs.math.test.js:
This is our first use of the
.strictEqual() assertion. This assertion expects three arguments, the value to test, the expected answer, and a text description. To pass, the first argument must
=== the second. (BTW,
.equal() works the same way, but using
==.)
Now we can update our
pbs.math.factorial() function so it actually calculates factorials!
Below is the updated version of the
pbs.math.factorial() function in
pbs.math.js:
Refreshing the test suite shows that this function now works as expected, so we can move on to the next cycle, and develop some initial tests for the next function,
pbs.math.fibonacciSeries().
Append the following to
test/pbs.math.test.js:
With our tests written, we can now create the stub of our
pbs.math.fibonacciSeries() function, including the code for argument validation. Append the following to the self-executing anonymous function in
pbs.math.js:
All tests should now pass, so we are ready for the next loop of the cycle. Let’s write the tests for checking that valid inputs result in expected outputs.
Append the following to
test/pbs.math.test.js:
Notice that this test uses an assertion function we’ve not seen before –
.deepEqual(). This assertion function allows us to use more complex data structures in the expected field. The QUnit docs say the function supports potentially nested data of the following types: primitive types, arrays, objects, regular expressions, dates and functions. In this case, we are using
.deepEqual() because the
pbs.math.fibonacciSeries() returns an array of numbers.
The first argument is the values to test, the second is the expected value, and the final argument is a textual description of the test.
Now that we have our tests written, we can finish our implementation of the
pbs.math.fibonacciSeries() function in
pbs.math.js:
This implementation passes all our tests.
Asside – the JavaScript
.slice()Function
Notice that the function makes use of the
.slice()function from the
Arrayprototype. I know Allison has been using this function in her code for some time, but it’s not one we’ve ever discussed as part of the series.
What this function does is return a sub-set, or slice, of an array. You can use no arguments at all, in which case you’ll get the whole array back.
If you choose to pass it, the first argument will be interpreted as your starting point – use a value of 0 to begin at the start of the array. Positive integer values will move the starting array index forward, so
.slice(2)will exclude the first three items of the array from the result (remember, arrays are zero-indexed). You can also use negative numbers to work from the back of the array forwards when defining your start point. The last element in the array is considered to be at index -1. The returned array is still in the normal forward order. So,
.slice(-3)returns the last three elements in the array in the same order they were originally present in the array.
Finally, if you choose to pass it, the second argument sets the index before which to stop the returned array at. So,
.slice(1, 3)returns the second and third elements of the array (those at indexes 1 & 2). You can also use negative indexes in the second argument. To slice everything but the first and last elements, you could use
.slice(1, -1). If you don’t specify and second argument, the length of the array is used, i.e. the slice runs to the end of the array.
So far, because we’ve been working on quite simplistic code, there has been no need to do any refactoring at the end of any of our cycles. This time though, there is some room for refactoring, though it’s in the test code, not the API itself.
Grouping QUnit Tests
Right now, all our tests are together in one big group. It would be great if we could group the tests related to the factorial function into one group, and the tests for the Fibonacci function into another. Well, we can! QUnit calls groups of tests modules, and to define them you use the
QUnit.module() function.
QUnit.module() expects three arguments, a name for the module as a string, an object which can be used to define hooks (we’ll have a look at some of those in the next instalment), and a callback/anonymous function within which all the tests for the group should be defined. You can also define modules within the callback of another module to create nested modules, and your nesting can go as deep as you like. Obviously, the smaller the project the less need there is for nesting. A project as small as our sample here doesn’t require nesting of modules within modules.
So, let’s refactor our test suite so it groups the tests for each function together. Since we’ll only be editing
test/pbs.math.test.js, we’ll know we got it right if the same number of total tests and assertions are executed before and after we make our changes, and, if they all continue to pass.
While editing the code I’m also going to tidy up some other little cosmetic things that I’ve changed my mind on as I worked up the example.
So, this is the final version of our test suite:
Notice that because we have no need for any hooks, we use an empty function literal (
{}) as the second argument to
QUnit.module().
At this stage our three files are complete. You can find the final versions of all three in the instalment’s ZIP file in the
pbs33a folder.
Within our source code we now have our tests sorted into nice clear groupings. But, the benefits of creating those groupings also follows us into the test runner GUI.
Let’s have a more detailed look at the test runner now that we have a pretty full-featured test suite. Between the title of the test suite and the output of the tests is a toolbar, marked in red on the screenshot below:
The first thing I want to draw your attention to is the drop-down at the right of the tool bar labeled Module. Using this dropdown we can instruct QUnit to only run the tests for a given sub-set of modules, allowing us to cut down on clutter as we focus on specific parts of our code.
Next to that dropdown is a text box labeled Filter, this allows us to show only tests that match a given search string. You apply the filter by clicking the Go button next to the text box. Again, this is a mechanism to allow us to filter out clutter and help focus our attention. The bigger your code base, and hence your test suite, the more valuable this filter box becomes.
Finally, the tool bar contains a collection of three checkboxes:
- Hide passed tests
- Pretty self explanatory, again, a way of cutting down clutter so you can see all your failing tests more easily.
- Check for Globals
- If you’ve written your tests properly, then all test should be completely atomic, they should have no effect on the global scope at all. If you suspect one of your tests might be leaking stuff into the global scope, check this checkbox to test for that. How this works is that a snapshot is taken of the global scope before and after each test runs, if the global scope has changed, then that fact is flagged by failing the test, and appending a message to it specifying which variables within the global scope have been altered by the test. This checkbox comes with a bit of a health warning, it adds overhead to every test, so it could have a noticeable effect on the execution time of large test suites.
- No try-catch
- Ordinarily, QUnit wraps every test in a try/catch block so it can continue beyond tests that throw errors. If you check this text box, that wrapper is removed, so, the test runner will stop the first time an error is thrown. This can actually be a useful way to work through the failing tests one-by-one.
An (Optional) Challenge
If you’ve like a challenge, and it really is a challenge, write a test suite and test runner for the date and time prototypes we’ve been building up over recent instalments. If this seems like too much work (and it is a lot of work), perhaps just write tests for either one of
pbs.Date or
pbs.Time.
Final Thoughts
We now have an introduction to some testing concepts, and, some experience with the QUnit testing framework. So far, we’ve only used QUnit to test JavaScript code that does not interact with the DOM, and does not use the fixture, or, any hooks. In the next instalment we’ll take our testing up a notch by looking at how you can use QUnit to test code that interacts with the DOM using things like jQuery, and how you can save yourself a lot of code repetition within your test suite by using event handlers and hooks.
[…] PBS 33 of x – JS Testing with QUnit […] | https://www.bartbusschots.ie/s/2017/04/13/pbs-33-of-x-js-testing-with-qunit/ | CC-MAIN-2019-18 | refinedweb | 3,848 | 71.14 |
Python has its way to handle scopes. It's essential to understand it to get to the next level.
Local vs. global
Only global variables are available anywhere. Other variables belong to a specific area of the program.
For example, any variable created inside a function is a local variable:
def mydef() : a = "ah"
You cannot access
a outside the local scope of
mydef(). The following code throws a scope error :
def mydef() : a = "ah" print(a)
The correct code is :
def mydef() : a = "ah" print(a) mydef()
You might think that's relatively easy but look at this :
a = "ah" def mydef() : print(a) mydef()
Is it still working? (click the arrow to discover the answer)
Yes! I'm just teasing you a little bit ;)
Answer
Yes! I'm just teasing you a little bit ;)
Here comes the fun part, look at the following code now:
count = 0 def mycount() : count = count + 1 print(count) mycount()
Is it working? (click the arrow to discover the answer)
No! This time you get an "UnboundLocalError" with a message "local variable 'count' referenced before assignment".
Answer
No! This time you get an "UnboundLocalError" with a message "local variable 'count' referenced before assignment".
We'll cover that case in the next section.
Understanding the scope error
What the heck is this "UnboundLocalError" we got?
Sure there's an error, but which one? We call the following an assignment :
count = count + 1
Because we did that assignment inside a function, the compiler considers now
count as a local variable, not a global variable anymore. That's why you get an error "local variable 'count' referenced before assignment". The compiler reads
count before it's assigned.
In Python 3, you solve that problem by explicitly saying
count is a global variable :
count = 0 def mycount() : global count count = count + 1 print(count) mycount()
A little more about globals
In the previous section, we saw an example of a scope error. Now, let's have a look at the following :
count = 1 def mycount() : print(count) count += 110 mycount() print(count)
Is it working? (click the arrow to discover the answer)
Yes!
Answer
Yes!
I have another question for you. What is the result of the first print? (click the arrow to discover the answer)
Same as the second print: 111.
Answer
Same as the second print: 111.
Whaaaat....?
Yes, Python implicitly considers
count as a global variable unless you make an assignment inside your function.
It might seem weird at first, but this way, Python wants to prevent potential unwanted side-effects.
What is
nonlocal?
Python 3 introduced the
nonlocal statement for variables that are neither local nor global.
Again, what...?
You would use such variables typically inside nested functions :
def mydef() : a = "ah" def mynested() : nonlocal a a = "ho" mynested() return a print(mydef())
In this case, neither a global nor a local statement can resolve the naming conflict, but the
nonlocal statement can.
The LEGB Rule
Another common way of explaining scopes is to say it's the context in which variables exist.
The Python interpreter reads variables in a specific order :
Local -> Enclosing -> Global -> Built-in
Each scope is nested inside another scope. The final scope is the Built-In scope. Python raises a NameError if it does not found your variable after exploring each level in that specific order.
Bonus
You can use the built-in functions
globals() and
locals() to "see the Matrix" :
def mydef() : a = "ah" def mynested() : nonlocal a a = "ho" mynested() print(locals()) return a mydef() print(globals())
Which displays for global variables:
{'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x10c1f7550>, '__spec__': None, '__annotations__': {}, '__builtins__': <module 'builtins' (built-in)>, '__file__': 'scopes.py', '__cached__': None, 'mydef': <function mydef at 0x10c1ac1e0>}
and for local variables:
{'mynested': <function mydef.<locals>.mynested at 0x108d12048>, 'a': 'ho'}
Wrap up
I hope you enjoyed this post. Python has four scopes. It reads your variables according to the LEGB rule. It handles local and global variables in a pretty unique way compared to other languages such as Java, or even C.
IMHO, it's a good design.
Discussion (2)
I never use global variables, I am happy.
It's a good practice. Still it's important to know them. | https://practicaldev-herokuapp-com.global.ssl.fastly.net/jmau111/deep-dive-into-python-scopes-1786 | CC-MAIN-2021-21 | refinedweb | 709 | 64.71 |
> headset.rar > main.c
/* Main.c This file contains the main function, which kicks off the headset application. */ #include "demohs.h" #include "hal.h" #include
#include #include #include #include #include #include #include /* This is a global variable used to maintain the state of the headset device itself. The structure is defined in demohs.h and includes information such as which state the device is in (idle, connecting, etc.), whether or not it is paired, if there is a button press pending, and if there is a slave connection pending. All of these states are explained more in the structure definition of Headset in demohs.h. */ HeadsetState hsState; int main(void) { /* Initialize the timer subsystem. Now we can use timers in the application. */ PRINT(("This is headset!/n")); TimerInit(); /* Tell the button library we are interested in these buttons */ ButtonInit(HS_BUTTONS_USED, ButtonDirect); /* When the connection manager has indicated it is running, then this function is called to complete powerup procedures. The openReq() function only sets the duration of the ring indication for incoming calls. */ openReq(); /* Start polling the voltage level on TEST_A and deliver the readings to battery.c every 4 * 10sec = 40 seconds. */ BattInit(VM_ADC_TEST_A, BATT_MONITOR_PERIOD); #ifdef DEV_BOARD_HS /* init some flags we will use */ hsState.turnOffHs = 0; /* flash some lights */ flashInit(); /* use PIO to turn codec on and off initially its turned off */ PioSetDir(PIO_CODEC, ~0); PioSet(PIO_CODEC, CODEC_OFF); #endif /* Kick off the Virtual Machine scheduler. This is what calls each of the tasks in the application. */ Sched(); return 0; } /* This function is used to put a message in the message queue to be delivered to another task. In this case, the message is always delivered to task #1. In the scope of the Headset demo, task #1 is the Headset Framework Handler (hsf_handler.c). */ void putMsg(void *msg) { MessagePut(HEADSET_FRAMEWORK_TASK, msg); } /* This is the declaration of the headset task. This loop is called by the scheduler to process any incoming messages/events from external tasks. Many of the events may be the result of an action started by this task (the headset task). */ DECLARE_TASK(2) { /* Need a void msg pointer for incoming messages */ void * msg; /* Need to know what type of message was sent. This type may be different depending on the library used. */ MessageType type; /* Get the message, if any, from the queue so that we can process it. Notice that only one message is processed at a time. */ msg = MessageGet(HEADSET_TASK, &type); if(msg) { switch (type) { /* The actions taken by openReq(), which was called in main() have finished. */ case HS_OPEN_CFM: openCfm((HS_OPEN_CFM_T*) msg); break; /* The pairing operation has completed. Success or failure is not known until you look into the inner workings of pairCfm(). */ case HS_PAIR_CFM: pairCfm((HS_PAIR_CFM_T*) msg); break; /* The connect operation has completed. Success or failure is not known until you look into the inner workings of connectCfm() */ case HS_CONNECT_CFM: connectCfm((HS_CONNECT_CFM_T *) msg); break; /* Indication that the RFCOMM connection has been diconnected This can be due to a user action or to a failure resulting in the disconnection. */ case HS_CONNECT_STATUS_IND: connectStatusInd((HS_CONNECT_STATUS_IND_T*) msg); break; /* There is an incoming call. This is the indication that should cause the headset to "ring" or otherwise indicate to the user that there is an incoming call. */ case HS_RING_IND: ringInd((HS_RING_IND_T*) msg); break; /* This event indicates news about the SCO connection. Generally the news informs the application of a SCO disconnection. */ case HS_SCO_STATUS_IND: scoStatusInd((HS_SCO_STATUS_IND_T*) msg); break; /* This event relays information about volume/microphone gain adjustments. */ case HS_VGS_IND: vgsInd((HS_VGS_IND_T*) msg); break; /* This event relays information about an incoming command that is unrecognized. */ case HS_CMD_IND: cmdInd((HS_CMD_IND_T*) msg); break; /* This event indicates that an error has occurred and gives an error code to indicate what went wrong. */ case HS_ERROR_IND: errorInd((HS_ERROR_IND_T *) msg); break; /* This event informs the headset app that the software reset (i.e. writes to PS) has completed */ case HS_RESET_CFM: resetCfm(); break; case HS_MIC_IND: microphoneGainInd((HS_MIC_IND_T*) msg); break; default : PRINT(("headset: Unrecognised msg type 0x%x\n",type)); break; } /* Done with the message. Free the memory. */ MessageDestroy(msg); } } | http://read.pudn.com/downloads9/sourcecode/comm/30413/headset/main.c__.htm | crawl-002 | refinedweb | 670 | 56.25 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.