Wednesday, November 28, 2012
EW Hornung - Raffles
The Ides of March
Series 1 Episode 1 of 6
Bunny Manders makes his first acquaintance with the amateur cracksman and cricketer. Stars Michael Cochrane and Jeremy Clyde.
http://www.bbc.co.uk/programmes/b01p0twv
Monday, November 19, 2012
Command pattern
- Command pattern
command pattern is a behavioural design pattern in which an object is used to represent and encapsulate all the information needed to call a method at a later time. This information includes the method name, the object that owns the method and values for the method parameters.
Three terms always associated with the command pattern are client, invoker and receiver. The client instantiates the command object and provides the information required to call the method at a later time. The invoker decides when the method should be called. The receiver is an instance of the class that contains the method's code.
http://en.wikipedia.org/wiki/Command_pattern
- Rules of thumb
Chain of Responsibility, Command, Mediator, and Observer, address how you can decouple senders and receivers, but with different trade-offs. Command normally specifies a sender-receiver connection with a subclass.
Chain of Responsibility can use Command to represent requests as objects.
Command and Memento act as magic tokens to be passed around and invoked at a later time. In Command, the token represents a request; in Memento, it represents the internal state of an object at a particular time. Polymorphism is important to Command, but not to Memento because its interface is so narrow that a memento can only be passed as a value.
Command can use Memento to maintain the state required for an undo operation.
MacroCommands can be implemented with Composite.
A Command that must be copied before being placed on a history list acts as a Prototype.
Two important aspects of the Command pattern: interface separation (the invoker is isolated from the receiver), time separation (stores a ready-to-go processing request that’s to be stated later)
http://sourcemaking.com/design_patterns/command
Thursday, November 15, 2012
les conjonctions
A) l’insu de
B) En dépit de
C) A force de
D) Afin de
E) A l’exception de
A) without the knowledge of
B) In spite of
C) A force
D) To
E) With the exception of
----------------------------------
A) De peur que
B) Après que
C) Pourvu que
D) Bien que
E) Puisque
A) Lest
B) After
C) Provided
D) Although
E) Since
----------------------------------
A) à moins que
B) à tel point que
C) de sorte que
D) si bien que
E) à mesure que
A) unless
B) to the extent that
C) such that
D) such that
E) as
----------------------------------
Dans tous les pays et quelle que soit leur appartenance politique,
In all countries, regardless of their political affiliation,
A) Grâce à
B) En dépit de
C) Du fait de
D) Quant à
E) En faveur de
A) With,by means of
B) In spite of
C) Because of
D) As to
E)in favor of
----------------------------------
puisque
avant que
après que
jusqu’à ce que
depuis que
since
until
after
until
since
----------------------------------
à moins qu’
alors qu’
de peur qu’
pour qu’
de sorte qu
unless that
so that
fear that
for that
so that
----------------------------------
tant qu’
bien qu’
pour qu’
sans qu’
jusqu’à ce qu’
(for) as long as, while
although, even though conj |
in order to
unless
until that
----------------------------------
au cours de l’hiver.
during the winter.
----------------------------------
au fur et à mesure que
"as one goes along"
'Au fur et à mesure' can be translated in various ways in English. It all depends on the context.
For example:
- progressively
- gradually
- little by little
- as you go along
- as and when
Au fur et à mesure que la mondialisation devient un phénomène non pas seulement économique mais aussi culturel et politique
As globalization as a phenomenon is not only economic but also cultural and political
----------------------------------
Alors que beaucoup d’historiens et d’économistes réservent ce terme à l’époque contemporaine
While many historians and economists reserve the term in contemporary
----------------------------------
pour que conj | in order to | |
pour que phrase | so that |
----------------------------------
afin de | with an eye to | |
afin de | so as to | |
afin de adv | so | |
afin de conj | in order to |
Afin de promouvoir la croissance financière dans le secteur automobile
To promote financial growth in the automotive sector
----------------------------------
Pour pouvoir surmonter les contraintes techniques provenant de la situation de l’automobile
In order to overcome the technical constraints arising from the situation of the automobile
----------------------------------
Dans le but de favoriser la mobilité routière dans les pays en voie de développement
In order to promote road mobility in developing countries
but (m)
----------------------------------
à tout moment adv
any time
qui risquent à tout moment de percuter les satellites en activité.
which may at any time strike active satellites.
----------------------------------
De fait, le jeu vidéo touche toutes les catégories
In fact, the game affects all categories
----------------------------------
auprès
expliquer combien les jeux de guerre sont populaires auprès des jeunes générations
explain how war games are popular amongst the younger generations
----------------------------------
dans l’ensemble
dans l’ensemble des pays développés,
in all developed countries,
----------------------------------
Contrairement
Contrairement à une idée très répandue,
Contrary to popular belief,
la question 5
- prend soin du
- met au profit du
- a envie du
- est au courant du
- fait partie du
- takes care of
- is in favor of
- wants the
- is aware of
- is part of the
------------------------------
A) fait face au
B) fait partie du
C) fait échange du
D) fait envie au
E) fait l’expérience du
A) faces the
B) is part of the
C) is the exchange
D) to envy
E) experienced the
A) fait face au
B) fait partie du
C) fait échange du
D) fait envie au
E) fait l’expérience du
A) faces the
B) is part of the
C) is the exchange
D) to envy
E) experienced the
A Cure for Death
A Cure for Death
Murder West One Episode 1 of 4
The detective faces a medical mystery behind the discovery of a dumped body. Nick Fisher's thriller with Imelda Staunton.
http://www.bbc.co.uk/programmes/b007jsh0
Friday, November 9, 2012
OKEK, OBEB
Aralarinda asal sayilarin OKEK' i, bu sayilarin çarpimlarina esittir. Yani, a ile b sayisi aralarinda asal sayilar ise,
(a, b)OKEK = a . b dir.
a ve b iki dogal sayi olmak üzere, bu iki dogal sayinin OBEB' i ile OKEK' inin çarpimi, bu iki dogal sayinin çarpimina esittir. Yani, a ve b dogal sayisi için
a . b = (a, b)OKEK . (a, b)OBEB dir.
a ve b iki dogal sayi olmak üzere,
(a, b)OKEK = x ve (a, b)OBEB = y
ise, a ile b sayilarinin toplaminin en büyük degeri
x + y dir.
Friday, November 2, 2012
nested,inner queries, subqueries
- Nested,inner,subquery, Sql Queries
select *
from Customers
where CustomerID in
(select customerID
from Orders
where OrderID in
(select orderID
from [Order Details]
where ProductID = 1
)
)
- How subqueries work
Subqueries, also called inner queries, appear within a where or having clause of another SQL statement or in the select list of a statement. You can use subqueries to handle query requests that are expressed as the results of other queries. A statement that includes a subquery operates on rows from one table, based on its evaluation of the subquery's select list, which can refer either to the same table as the outer query, or to a different table.
For example, this subquery lists the names of all authors whose royalty split is more than $75:
select au_fname, au_lname
from authors
where au_id in
(select au_id
from titleauthor
where royaltyper > 75)
select statements that contain one or more subqueries are sometimes called nested queries or nested select statements.
Multiple levels of nesting
"Find the names of authors who have participated in writing at least one popular computing book:"
select au_lname, au_fname
from authors
where au_id in
(select au_id
from titleauthor
where title_id in
(select title_id
from titles
where type = "popular_comp") )
Subqueries in update, delete, and insert statements
The following query doubles the price of all books published by New Age Books.
update titles
set price = price * 2
where pub_id in
(select pub_id
from publishers
where pub_name = "New Age Books")
You can remove all records of sales of business books with this nested select statement
delete salesdetail
where title_id in
(select title_id
from titles
where type = "business")
An equivalent delete statement using a join is:
delete salesdetail
from salesdetail, titles
where salesdetail.title_id = titles.title_id
and type = "business"
http://manuals.sybase.com/onlinebooks/group-as/asg1250e/sqlug/@Generic__BookTextView/13332;pt=13262
the name of every song by Metallica that contains the lyric “justice” with the following subquery
SELECT song_name FROM Album
WHERE band_name = ‘Metallica’
AND song_name IN
(SELECT song_name FROM Lyric
WHERE song_lyric LIKE ‘%justice%’);
all Metallica songs in the “And Justice for All” album that do not contain the word “justice” by way of the following code:
SELECT song_name FROM Album
WHERE album_name = ‘And Justice for All’
AND band_name = ‘Metallica’
AND song_name NOT IN
(SELECT song_name FROM Lyric
WHERE song_lyric LIKE ‘%justice%’);
a list of Metallica songs performed by Damage, Inc. from my Cover table
SELECT Album.song_name FROM Album
WHERE Album.band_name = ‘Metallica’
AND EXISTS
(SELECT Cover.song_name FROM Cover
WHERE Cover.band_name = ‘Damage, Inc.’
AND Cover.song_name = Album.song_name);
For example, I want to verify Album table entries for every Metallica song. Also, I want to return the album names that have missing tracks. Conveniently, the AlbumInfo table contains a column (album_tracks) signaling how many tracks there should be.
SELECT AlbumInfo.album_name FROM AlbumInfo
WHERE AlbumInfo.band_name = ‘Metallica’
AND album_tracks <>
(SELECT COUNT(*) FROM Album
WHERE Album.album_name = AlbumInfo.album_name);
The next example will return every Metallica album, the number of tracks it should contain, and how many entries are included in the Album table:
SELECT AlbumInfo.album_name, album_tracks,
(SELECT COUNT(*) FROM Album
WHERE Album.album_name = AlbumInfo.album_name)
FROM AlbumInfo
WHERE AlbumInfo.band_name = ‘Metallica’;
changing the album_tracks value in the AlbumInfo table to the actual number of entries in the Album table:
UPDATE AlbumInfo SET album_tracks =
SELECT COUNT(*) FROM Album
WHERE AlbumInfo.album_name = Album.album_name)
WHERE AlbumInfo.band_name = ‘Metallica’;
Subselect comparison keywords (ALL, SOME, ANY)
SELECT * FROM AlbumSales
WHERE album_gross >
ALL (SELECT album_costs FROM AlbumProduction);
http://www.techrepublic.com/article/use-sql-subselects-to-consolidate-queries/1045787
Subscribe to:
Posts (Atom)