Switching to triple-tilde in Markdown code blocks in IPython Notebooks
authorGreg Wilson <gvwilson@third-bit.com>
Sat, 21 Dec 2013 12:40:27 +0000 (07:40 -0500)
committerW. Trevor King <wking@tremily.us>
Tue, 11 Mar 2014 04:53:38 +0000 (21:53 -0700)
W. Trevor King: I removed everything except the sql/novice changes
from the original c6e5b9c [1].

[1]: https://github.com/swcarpentry/bc/commit/c6e5b9cb15e259680e413f289d9bb96c538e7ffd

sql/novice/01-select.ipynb
sql/novice/03-filter.ipynb
sql/novice/05-null.ipynb
sql/novice/06-agg.ipynb
sql/novice/07-join.ipynb
sql/novice/08-create.ipynb
sql/novice/09-prog.ipynb

index 42f461b14a7c94b6e10efef92179af59b0df33fd..4455598580c7b871485405e7f64c5798d7d20ad8 100644 (file)
       "\n",
       "2.  Many people format queries as:\n",
       "\n",
       "\n",
       "2.  Many people format queries as:\n",
       "\n",
-      "    ```\n",
+      "    ~~~\n",
       "    SELECT personal, family FROM person;\n",
       "    SELECT personal, family FROM person;\n",
-      "    ```\n",
+      "    ~~~\n",
       "\n",
       "    or as:\n",
       "\n",
       "\n",
       "    or as:\n",
       "\n",
-      "    ```\n",
+      "    ~~~\n",
       "    select Personal, Family from PERSON;\n",
       "    select Personal, Family from PERSON;\n",
-      "    ```\n",
+      "    ~~~\n",
       "\n",
       "    What style do you find easiest to read, and why?"
      ]
       "\n",
       "    What style do you find easiest to read, and why?"
      ]
index 018295463157f05802ae352d467daea5304b3ec6..c9a3e95fbef1df9423e2a9f8d052b6ff2fce1c8d 100644 (file)
       "1.  Suppose we want to select all sites that lie within 30&deg; of the equator.\n",
       "    Our first query is:\n",
       "\n",
       "1.  Suppose we want to select all sites that lie within 30&deg; of the equator.\n",
       "    Our first query is:\n",
       "\n",
-      "    ```\n",
+      "    ~~~\n",
       "    select * from Site where (lat > -30) or (lat < 30);\n",
       "    select * from Site where (lat > -30) or (lat < 30);\n",
-      "    ```\n",
+      "    ~~~\n",
       "\n",
       "    Explain why this is wrong,\n",
       "    and rewrite the query so that it is correct.\n",
       "\n",
       "    Explain why this is wrong,\n",
       "    and rewrite the query so that it is correct.\n",
index 8b02654db65317dea0d82a24c9662327a765611a..5173fb3b66b5d60992a418dd153c4ed58bfff0fc 100644 (file)
       "\n",
       "1.  What do you expect the query:\n",
       "\n",
       "\n",
       "1.  What do you expect the query:\n",
       "\n",
-      "    ```\n",
+      "    ~~~\n",
       "    select * from Visited where dated in ('1927-02-08', null);\n",
       "    select * from Visited where dated in ('1927-02-08', null);\n",
-      "    ```\n",
+      "    ~~~\n",
       "\n",
       "    to produce?\n",
       "    What does it actually produce?\n",
       "\n",
       "    to produce?\n",
       "    What does it actually produce?\n",
index 635a7f6dfe918016023ac0c54119d539324527c5..4982a975f6cce759478430f9bffdf39a73d7a7ed 100644 (file)
       "    and the average of all the radiation readings.\n",
       "    We write the query:\n",
       "\n",
       "    and the average of all the radiation readings.\n",
       "    We write the query:\n",
       "\n",
-      "    ```\n",
+      "    ~~~\n",
       "    select reading-avg(reading) from Survey where quant='rad';\n",
       "    select reading-avg(reading) from Survey where quant='rad';\n",
-      "    ```\n",
+      "    ~~~\n",
       "\n",
       "    What does this actually produce, and why?\n",
       "\n",
       "\n",
       "    What does this actually produce, and why?\n",
       "\n",
       "    Use this to produce a one-line list of scientists' names,\n",
       "    such as:\n",
       "\n",
       "    Use this to produce a one-line list of scientists' names,\n",
       "    such as:\n",
       "\n",
-      "    ```\n",
+      "    ~~~\n",
       "    William Dyer, Frank Pabodie, Anderson Lake, Valentina Roerich, Frank Danforth\n",
       "    William Dyer, Frank Pabodie, Anderson Lake, Valentina Roerich, Frank Danforth\n",
-      "    ```\n",
+      "    ~~~\n",
       "\n",
       "    Can you find a way to order the list by surname?"
      ]
       "\n",
       "    Can you find a way to order the list by surname?"
      ]
index 2481db48de2b5e9e386c5fb4f7580086c9a5eeb6..a5afa8f0410cef6036584f2ff6c8daef8c95f75c 100644 (file)
       "\n",
       "3.  Describe in your own words what the following query produces:\n",
       "\n",
       "\n",
       "3.  Describe in your own words what the following query produces:\n",
       "\n",
-      "    ```\n",
+      "    ~~~\n",
       "    select Site.name from Site join Visited\n",
       "    on Site.lat<-49.0 and Site.name=Visited.site and Visited.dated>='1932-00-00';\n",
       "    select Site.name from Site join Visited\n",
       "    on Site.lat<-49.0 and Site.name=Visited.site and Visited.dated>='1932-00-00';\n",
-      "    ```"
+      "    ~~~"
      ]
     }
    ],
      ]
     }
    ],
index b3e9c3e865c7aee124b0483c21aa49378dde6ba9..c695563abd3f134f5f9fabba1af853dd34b45154 100644 (file)
       "For example,\n",
       "the following statements create the four tables in our survey database:\n",
       "\n",
       "For example,\n",
       "the following statements create the four tables in our survey database:\n",
       "\n",
-      "    create table Person(ident text, personal text, family text);\n",
-      "    create table Site(name text, lat real, long real);\n",
-      "    create table Visited(ident integer, site text, dated text);\n",
-      "    create table Survey(taken integer, person text, quant real, reading real);\n",
+      "~~~\n",
+      "create table Person(ident text, personal text, family text);\n",
+      "create table Site(name text, lat real, long real);\n",
+      "create table Visited(ident integer, site text, dated text);\n",
+      "create table Survey(taken integer, person text, quant real, reading real);\n",
+      "~~~\n",
       "\n",
       "We can get rid of one of our tables using:\n",
       "\n",
       "We can get rid of one of our tables using:\n",
-      "  \n",
-      "    drop table Survey;\n",
+      "\n",
+      "~~~\n",
+      "drop table Survey;\n",
+      "~~~\n",
       "\n",
       "Be very careful when doing this:\n",
       "most databases have some support for undoing changes,\n",
       "\n",
       "Be very careful when doing this:\n",
       "most databases have some support for undoing changes,\n",
       "we can specify several kinds of constraints on its columns.\n",
       "For example,\n",
       "a better definition for the `Survey` table would be:\n",
       "we can specify several kinds of constraints on its columns.\n",
       "For example,\n",
       "a better definition for the `Survey` table would be:\n",
-      "  \n",
-      "    create table Survey(\n",
-      "        taken   integer not null, -- where reading taken\n",
-      "        person  text,             -- may not know who took it\n",
-      "        quant   real not null,    -- the quantity measured\n",
-      "        reading real not null,    -- the actual reading\n",
-      "        primary key(taken, quant),\n",
-      "        foreign key(taken) references Visited(ident),\n",
-      "        foreign key(person) references Person(ident)\n",
-      "    );\n",
+      "\n",
+      "~~~\n",
+      "create table Survey(\n",
+      "    taken   integer not null, -- where reading taken\n",
+      "    person  text,             -- may not know who took it\n",
+      "    quant   real not null,    -- the quantity measured\n",
+      "    reading real not null,    -- the actual reading\n",
+      "    primary key(taken, quant),\n",
+      "    foreign key(taken) references Visited(ident),\n",
+      "    foreign key(person) references Person(ident)\n",
+      ");\n",
+      "~~~\n",
       "\n",
       "Once again,\n",
       "exactly what constraints are avialable\n",
       "\n",
       "Once again,\n",
       "exactly what constraints are avialable\n",
       "`insert` and `delete`.\n",
       "The simplest form of `insert` statement lists values in order:\n",
       "\n",
       "`insert` and `delete`.\n",
       "The simplest form of `insert` statement lists values in order:\n",
       "\n",
-      "    insert into Site values('DR-1', -49.85, -128.57);\n",
-      "    insert into Site values('DR-3', -47.15, -126.72);\n",
-      "    insert into Site values('MSK-4', -48.87, -123.40);\n",
+      "~~~\n",
+      "insert into Site values('DR-1', -49.85, -128.57);\n",
+      "insert into Site values('DR-3', -47.15, -126.72);\n",
+      "insert into Site values('MSK-4', -48.87, -123.40);\n",
+      "~~~\n",
       "\n",
       "We can also insert values into one table directly from another:\n",
       "\n",
       "We can also insert values into one table directly from another:\n",
-      "  \n",
-      "    create table JustLatLong(lat text, long TEXT);\n",
-      "    insert into JustLatLong select lat, long from site;\n",
+      "\n",
+      "~~~\n",
+      "create table JustLatLong(lat text, long TEXT);\n",
+      "insert into JustLatLong select lat, long from site;\n",
+      "~~~\n",
       "\n",
       "Deleting records can be a bit trickier,\n",
       "because we have to ensure that the database remains internally consistent.\n",
       "\n",
       "Deleting records can be a bit trickier,\n",
       "because we have to ensure that the database remains internally consistent.\n",
       "For example,\n",
       "once we realize that Frank Danforth didn't take any measurements,\n",
       "we can remove him from the `Person` table like this:\n",
       "For example,\n",
       "once we realize that Frank Danforth didn't take any measurements,\n",
       "we can remove him from the `Person` table like this:\n",
-      "  \n",
-      "    delete from Person where ident = \"danforth\";\n",
+      "\n",
+      "~~~\n",
+      "delete from Person where ident = \"danforth\";\n",
+      "~~~\n",
       "\n",
       "But what if we removed Anderson Lake instead?\n",
       "Our `Survey` table would still contain seven records\n",
       "\n",
       "But what if we removed Anderson Lake instead?\n",
       "Our `Survey` table would still contain seven records\n",
       "    containing temperature readings by Robert Olmstead,\n",
       "    which is formatted like this:\n",
       "\n",
       "    containing temperature readings by Robert Olmstead,\n",
       "    which is formatted like this:\n",
       "\n",
-      "    ```\n",
+      "    ~~~\n",
       "    Taken,Temp\n",
       "    619,-21.5\n",
       "    622,-15.5\n",
       "    Taken,Temp\n",
       "    619,-21.5\n",
       "    622,-15.5\n",
-      "    ```\n",
+      "    ~~~\n",
       "\n",
       "    Write a small Python program that reads this file in\n",
       "    and prints out the SQL `insert` statements needed\n",
       "\n",
       "    Write a small Python program that reads this file in\n",
       "    and prints out the SQL `insert` statements needed\n",
index e743ffbccd392e24cff690a8b750ec924bb4f09e..6105f8c62b0f51b014eb8d87bd5e49e7149eaf03 100644 (file)
       "This seems simple enough,\n",
       "but what happens if someone gives us this string as input?\n",
       "\n",
       "This seems simple enough,\n",
       "but what happens if someone gives us this string as input?\n",
       "\n",
-      "    dyer'; drop table Survey; select '\n",
+      "~~~\n",
+      "dyer'; drop table Survey; select '\n",
+      "~~~\n",
       "\n",
       "It looks like there's garbage after the name of the project,\n",
       "but it is very carefully chosen garbage.\n",
       "If we insert this string into our query,\n",
       "the result is:\n",
       "\n",
       "\n",
       "It looks like there's garbage after the name of the project,\n",
       "but it is very carefully chosen garbage.\n",
       "If we insert this string into our query,\n",
       "the result is:\n",
       "\n",
-      "    select personal || ' ' || family from Person where ident='dyer'; drop tale Survey; select '';\n",
+      "~~~\n",
+      "select personal || ' ' || family from Person where ident='dyer'; drop tale Survey; select '';\n",
+      "~~~\n",
       "\n",
       "If we execute this,\n",
       "it will erase one of the tables in our database.\n",
       "\n",
       "If we execute this,\n",
       "it will erase one of the tables in our database.\n",