Skip to content

Instantly share code, notes, and snippets.

@BlackFoks
BlackFoks / slider-demo.html
Created January 16, 2011 21:47
Slider semo
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
</head>
<body>
@BlackFoks
BlackFoks / gist:768244
Created January 6, 2011 17:38
Пример получения роута до страницы с учетом иерархии
class PagesControler(Controller):
# Some code here
def get_route(self, page_entity):
if page_entity.parent:
# return page1/page2/page3
return "/".join([page_entity.parent.get_route(), page_entity.slug])
else:
# return page1
C:\Dev\Projects> hg clone "C:\Users\username\My Dropbox\project-name" project-name
$ hg push
$ hg pull
[paths]
default = /home/username/Dropbox/Hg/project-name/
~$ cd ~/Dropbox
~/Dropbox$ hg clone ~/project-name ~/Dropbox/Hg/project-name --noupdate
~/project-name$ hg init
~/project-name$ hg addremove
~/project-name$ hg commit -m "Initial commit."
--5. Кто из клиентов с годовым доходом более 10 миллионов долларов отправлял грузы весом менее 100 фунта или отправлял грузы в Балтимор?
select distinct k.naimenovanie
from dbo.klient k, dbo.perevozka p
where k.kod_klienta = p.kod_klienta and
k.godovoi_dohod > 10000000 and
(p.ves < 100 or p.punkt_naznachenija = 'Балтимор')
<EntityType Name="BookAuthors">
<Key>
<PropertyRef Name="BookId" />
<PropertyRef Name="AuthorId" />
</Key>
<!-- Закомментированные стоки - как было, незакомментированные - как стало. -->
<!--<Property Name="BookId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="AuthorId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />-->
<Property Name="BookId" Type="int" Nullable="false" />
<Property Name="AuthorId" Type="int" Nullable="false" />
//
// POST: /Book/Create
[HttpPost]
public ActionResult Create([Bind(Exclude = "Id")] Book bookToCreate, int[] authorIds)
{
if (!ModelState.IsValid)
{
return View();
}