public
fields.
Constants (fields marked with static
and final
) are not reported.
Example:
class Main {
public String name;
}
After the quick-fix is applied:
class Main {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Configure the inspection:
public final
fields
of the enum
type.


--- layout: apidoc title: Tile5 API Documentation ---
The T5.Shape class is simply a template class that provides placeholder methods that need to be implemented for shapes that can be drawn in a T5.ShapeLayer.
new T5.Shape(params);


An open source toolkit that helps Councils rapidly design and build responsive websites to support digital public services.
Council Toolkit is developed with a sound understanding of key user needs of citizens and other council users as well as a strong set of standards.
A range of standards compliant responsive templates are ready to roll, built on a solid foundation of Bootstrap and our experience.
To speed development, use our pre-rolled Umbraco instance. Or, if you have your own CMS, you can use just our front end templates.
Council Toolkit has been developed by Storm ID, one of Scotland's leading digital consultancies, inspired by our work with City of Edinburgh Council.
It is issued under the Creative Commons licence and may be used free of charge.
Storm ID has been working with City of Edinburgh Council to support them in the development of the ICT & Digital transformation programme. The focus has been on working in partnership to create a fit for purpose framework to deliver information and transactional digital services across all types and sizes of devices.
Storm ID developed a closed alpha version of the City of Edinburgh Council website using analytics data to focus on meeting the needs of different users and stakeholders of CEC. The alpha site, covered in The Scotsman, was developed using an agile methodology. A beta version is currently reaching completion based on the feedback and lessons learned from the alpha.
The City of Edinburgh Council will launch the new version of edinburgh.gov.uk in Spring 2014.


Projects
Click on any project to see details!
About Me
A passionate full-stack web developer seeking opportunities. I graduated from University of California, Los Angeles (UCLA) in 2015 with a degree in Mathematics. I love to learn advanced concepts, and I also enjoy teaching students in my free time.
After working as a Quality Assurance associate in a start-up environment, I enrolled in a fully-immersive web development bootcamp at UCLA Extension. Graduating as one of the top students of my class, I am ready to contribute as a developer.
Technical Skills
Contact Information
Location
Los Angeles, CA
Phone
+1<PHONE_NUMBER>
nhoon2002@ucla.edu


Input your ID and Password
ID
Password
Login
Find ID
Find Password
AXBOOT 2.0.0 - Web Application Framework © 2010-2016


| Constants |
| ALIGN_LEFT |
specifies how the output of the item is aligned in the bounding box of
the user interface element.
|
| ALIGN_CENTER |
specifies how the output of the item is aligned in the bounding box of
the user interface element.
|
| ALIGN_RIGHT |
specifies how the output of the item is aligned in the bounding box of
the user interface element.
|
| DRAW_OUT3D |
specifies how the implementation should draw the item.
|
| DRAW_IN3D |
specifies how the implementation should draw the item.
|
| DRAW_FLAT |
specifies how the implementation should draw the item.
|
| OWNER_DRAW |
specifies whether or not a item is displayed using an external function.
|
| AUTO_SIZE |
specifies whether or not the size of the item is set automatically by
the parent user interface element.
|
| RADIO_CHECK |
determines whether the item unchecks neighbor entries which have also this style set.
|
| ICON |
specifies if an icon is placed on left side of the text, like an entry in a taskbar.
|
| DROP_DOWN |
specifies that the item supports a dropdown menu or toolbar for additional functions.
|
| REPEAT |
indicates that the item continues to execute the command while you click and hold
the mouse button.
|
| DROPDOWN_ONLY |
indicates that the item only supports a dropdown menu or toolbar for
additional functions. There is no function on the button itself.
|
| TEXT |
indicates if icon, text or text+icon is displayed for the item.
|
| Constants' Details |
ALIGN_LEFT
const short ALIGN_LEFT = 1;
- Description
- specifies how the output of the item is aligned in the bounding box of
the user interface element.
This style is only valid for an item which describes a statusbar item.
Draw item with a left aligned output.
|
|
ALIGN_CENTER
const short ALIGN_CENTER = 2;
- Description
- specifies how the output of the item is aligned in the bounding box of
the user interface element.
This style is only valid for an item which describes a statusbar item.
Draw item with a centered aligned output.
|
|
ALIGN_RIGHT
const short ALIGN_RIGHT = 3;
- Description
- specifies how the output of the item is aligned in the bounding box of
the user interface element.
This style is only valid for an item which describes a statusbar item.
Draw item with a right aligned output.
|
|
DRAW_OUT3D
const short DRAW_OUT3D = 4;
- Description
- specifies how the implementation should draw the item.
This style is only valid for an item which describes a statusbar item.
Draw item with an embossed 3D effect.
|
|
DRAW_IN3D
const short DRAW_IN3D = 8;
- Description
- specifies how the implementation should draw the item.
This style is only valid for an item which describes a statusbar item.
Draw item with an impressed 3D effect.
|
|
DRAW_FLAT
const short DRAW_FLAT = 12;
- Description
- specifies how the implementation should draw the item.
This style is only valid for an item which describes a statusbar item.
Draw item without an 3D effect.
|
|
OWNER_DRAW
const short OWNER_DRAW = 16;
- Description
- specifies whether or not a item is displayed using an external function.
This style is only valid if the item describes a statusbar item.
|
|
AUTO_SIZE
const short AUTO_SIZE = 32;
- Description
- specifies whether or not the size of the item is set automatically by
the parent user interface element.
This style is only valid if the item describes a toolbar or statusbar item.
|
|
RADIO_CHECK
const short RADIO_CHECK = 64;
- Description
- determines whether the item unchecks neighbor entries which have also this style set.
This style is only valid if the item describes a toolbar item.
|
|
ICON
const short ICON = 128;
- Description
- specifies if an icon is placed on left side of the text, like an entry in a taskbar.
This style is only valid if the item describes a toolbar item and visible if
style of the toolbar is set to symboltext.
This style can also be used for custom toolbars and menus, in a custom toolbar an item's Style setting can used to override the toolbar container setting, the style can be bitwise OR-ed with TEXT to define text, text+icon or icon only is to be displayed. Similarly for menu items, an items Style can override the application setting to display either text or icon ( note: for menu an icon only setting interpreted as icon+text )
|
|
DROP_DOWN
const short DROP_DOWN = 256;
- Description
- specifies that the item supports a dropdown menu or toolbar for additional functions.
This style is only valid if the item describes a toolbar item.
|
|
REPEAT
const short REPEAT = 512;
- Description
- indicates that the item continues to execute the command while you click and hold
the mouse button.
This style is only valid if the item describes a toolbar item.
|
|
DROPDOWN_ONLY
const short DROPDOWN_ONLY = 1024;
- Description
- indicates that the item only supports a dropdown menu or toolbar for
additional functions. There is no function on the button itself.
This style is only valid if the item describes a toolbar item.
|
|
TEXT
const short TEXT = 2048;
- Description
- indicates if icon, text or text+icon is displayed for the item.
This style can be used for custom toolbars and menus, in a custom toolbar an item's Style setting can used to override the toolbar container setting, the style can be bitwise OR-ed with ICON to define text, text+icon or icon only is to be displayed. Similarly for menu items, an items Style can override the application setting to display either text or icon ( note: for menu an icon only setting interpreted as icon+text )
|
|
Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


{% extends "streamer.html" %} {% import "macros.html" as macros with context %} {% block content %}
We'll talk about ag, floobits, opensource and programming in general.
Geoff's website: geoff.greer.fm
Geoff's github: ggreer
Geoff's twitter: @ggreer
Floobits: Cross-editor real-time collaboration
Every episode I ask the same question: "What advice would you give to people who are just starting to learn programming?". What really surprised me is that people give very different advice! I took recordings, did some editing and combined 4 responses into single video
{{ macros.stream_macro(how_to_learn_programming, false, none) }}
We talked about ag, Floobits, opensource and programming in general.
Geoff's website: geoff.greer.fm
Geoff's github: ggreer
Geoff's twitter: @ggreer
Floobits: Cross-editor real-time collaboration
We talked about /r/thebutton , its technical aspects, culture
mncke's github: Abrackadabra
We talked about Servo, Rust, Mozilla, opensource and programming in general.
Josh's website: joshmatthews.net
Josh's twitter: @lastontheboat
Josh's github: jdm
We talked about Firefox, Mozilla, opensource and programming in general.
Mike's twitter: @mike_conley
Mike's youtube channel: mikeconleytoronto


| 1 |
Choi_2016 |
Infectious Complications during Tandem High-Dose Chemotherapy and Autologous Stem Cell Transplantation for Children with High-Risk or Recurrent Solid Tumors |
Choi, Young Bae; Yi, Eun Sang; Kang, Ji-Man; Lee, Ji Won; Yoo, Keon Hee; Kim, Yae-Jean; Sung, Ki Woong; Koo, Hong Hoe |
2016 |
2016-09-14 |
COMM-USE |
N |
PMC5023107 |
27627440.0 |
10.1371/journal.pone.0162178 |
irt30jl9 |
0.661994 |
Choi_2017 |
|
| 2 |
Law_A_2018 |
Reduced-Intensity Conditioning and Dual T Lymphocyte Suppression with Antithymocyte Globulin and Post-Transplant Cyclophosphamide as Graft-versus-Host Disease Prophylaxis in Haploidentical Hematopoietic Stem Cell Transplants for Hematological Malignancies |
Law, Arjun Datt; Salas, Maria Queralt; Lam, Wilson; Michelis, Fotios V.; Thyagu, Santhosh; Kim, Dennis (Dong Hwan); Lipton, Jeffrey Howard; Kumar, Rajat; Messner, Hans; Viswabandya, Auro |
2018 |
2018-11-30 |
PMC |
N |
PMC7110605 |
30009980.0 |
10.1016/j.bbmt.2018.07.008 |
r6xg9zts |
0.655997 |
Young_2020, Choi_2017 |
|
| 3 |
Diaz_2019 |
Haploidentical Stem Cell Transplantation in Children With Hematological Malignancies Using αβ(+) T-Cell Receptor and CD19(+) Cell Depleted Grafts: High CD56(dim)/CD56(bright) NK Cell Ratio Early Following Transplantation Is Associated With Lower Relapse Incidence and Better Outcome |
Diaz, Miguel A.; Zubicaray, Josune; Molina, Blanca; Abad, Lorea; Castillo, Ana; Sebastian, Elena; Galvez, Eva; Ruiz, Julia; Vicario, Jose Luis; Ramirez, Manuel; Sevilla, Julian; González-Vicent, Marta |
2019 |
2019-10-30 |
COMM-USE |
N |
PMC6831520 |
31736949.0 |
10.3389/fimmu.2019.02504 |
ibkx4lcy |
0.651204 |
Law_A_2018 |
Law_A_2018 |
| 4 |
Linder_2019 |
Infectious Complications After Umbilical Cord Blood Transplantation for Hematological Malignancy |
Linder, Kathleen A; McDonald, Philip J; Kauffman, Carol A; Revankar, Sanjay G; Chandrasekar, Pranatharthi H; Miceli, Marisa H |
2019 |
2019-02-22 |
NONCOMM |
N |
PMC6386816 |
30815505.0 |
10.1093/ofid/ofz037 |
qu20hqch |
0.601333 |
Choi_2017 |
|
| 5 |
Mohty_2016 |
Sequential regimen of clofarabine, cytosine arabinoside and reduced-intensity conditioned transplantation for primary refractory acute myeloid leukemia |
Mohty, Mohamad; Malard, Florent; Blaise, Didier; Milpied, Noel; Socié, Gérard; Huynh, Anne; Reman, Oumédaly; Yakoub-Agha, Ibrahim; Furst, Sabine; Guillaume, Thierry; Tabrizi, Resa; Vigouroux, Stéphane; Peterlin, Pierre; El-Cheikh, Jean; Moreau, Philippe; Labopin, Myriam; Chevallier, Patrice |
2016 |
2016-08-25 |
PMC |
N |
PMC5210249 |
27561720.0 |
10.3324/haematol.2016.150326 |
9bugn6yt |
0.577266 |
Young_2020, Muniz-Rodriguez_2020 |
Law_A_2018 |
| 6 |
Griffiths_2013 |
An exploration of social and economic outcome and associated health-related quality of life after critical illness in general intensive care unit survivors: a 12-month follow-up study |
Griffiths, John; Hatch, Robert A; Bishop, Judith; Morgan, Kayleigh; Jenkinson, Crispin; Cuthbertson, Brian H; Brett, Stephen J |
2013 |
2013-05-28 |
COMM-USE |
N |
PMC3706775 |
23714692.0 |
10.1186/cc12745 |
pb8y7qcu |
0.559605 |
|
|
| 7 |
Al‐Tawfiq_2017 |
Hematologic, hepatic, and renal function changes in hospitalized patients with Middle East respiratory syndrome coronavirus |
Al‐Tawfiq, J. A.; Hinedi, K.; Abbasi, S.; Babiker, M.; Sunji, A.; Eltigani, M. |
2017 |
2017-04-26 |
PMC |
N |
PMC7165514 |
28444873.0 |
10.1111/ijlh.12620 |
kzgpf2js |
0.494292 |
Bastien_2006, Sun_H_2018, Gorse_2015 |
|
| 8 |
Hutspardol_2015 |
Significant Transplantation-Related Mortality from Respiratory Virus Infections within the First One Hundred Days in Children after Hematopoietic Stem Cell Transplantation |
Hutspardol, Sakara; Essa, Mohammed; Richardson, Susan; Schechter, Tal; Ali, Muhammad; Krueger, Joerg; Fujii, Hisaki; Egeler, R. Maarten; Gassas, Adam |
2015 |
2015-10-31 |
PMC |
N |
PMC7110880 |
26117558.0 |
10.1016/j.bbmt.2015.06.015 |
h40uzfff |
0.470443 |
Choi_2017, Sun_H_2018, Bastien_2006, Kaplan_2006 |
|
| 9 |
Wohlfarth_2018 |
Microbiologic Diagnostic Workup of Acute Respiratory Failure with Pulmonary Infiltrates after Allogeneic Hematopoietic Stem Cell Transplantation: Findings in the Era of Molecular- and Biomarker-Based Assays |
Wohlfarth, Philipp; Turki, Amin T.; Steinmann, Joerg; Fiedler, Melanie; Steckel, Nina K.; Beelen, Dietrich W.; Liebregts, Tobias |
2018 |
2018-08-31 |
PMC |
N |
PMC7110883 |
29550627.0 |
10.1016/j.bbmt.2018.03.007 |
wx96quou |
0.467729 |
Sun_H_2018, Choi_2017, Bastien_2006, Khamis_2012 |
|
| 10 |
Piñana_2018 |
Epidemiologic and Clinical Characteristics of Coronavirus and Bocavirus Respiratory Infections after Allogeneic Stem Cell Transplantation: A Prospective Single-Center Study |
Piñana, José Luis; Madrid, Silvia; Pérez, Ariadna; Hernández-Boluda, Juan Carlos; Giménez, Estela; Terol, María José; Calabuig, Marisa; Navarro, David; Solano, Carlos |
2018 |
2018-03-31 |
PMC |
N |
PMC7110838 |
29155041.0 |
10.1016/j.bbmt.2017.11.001 |
8l6ehcu6 |
0.448069 |
Choi_2017, Sun_H_2018 |
|
| 11 |
Rebar_2010 |
CHAPTER 6 Body Cavity Fluids |
Rebar, Alan H.; Thompson, Craig A. |
2010 |
2010-12-31 |
PMC |
N |
PMC7152295 |
|
10.1016/b978-141604985-2.50011-6 |
l27nmahv |
0.342775 |
|
|


--- layout: post title: MUA Cream Blush Perfection Bittersweet Review and Swatch tags: - Make Up Academy(MUA) status: publish type: post published: true meta: _edit_last: '2' _aioseop_keywords: MUA Cream Blush Perfection Bittersweet Review and Swatch _aioseop_title: MUA Cream Blush Perfection Bittersweet Review and Swatch _yoast_wpseo_linkdex: '0' _thumbnail_id: '5264' _yoast_wpseo_focuskw: '' _yoast_wpseo_title: '' _yoast_wpseo_metadesc: '' _yoast_wpseo_metakeywords: '' _yoast_wpseo_meta-robots-noindex: '0' _yoast_wpseo_meta-robots-nofollow: '0' _yoast_wpseo_meta-robots-adv: none _yoast_wpseo_sitemap-include: ! '-' _yoast_wpseo_sitemap-prio: ! '-' _yoast_wpseo_canonical: '' _yoast_wpseo_redirect: '' --- If you get a blush for £2, you are bound to get excited specially when you want to try some shades and experiment with them. I recently picked this up in my latest MUA Haul. I was just too excited to see the price tag and wanted to pick up all the shades, but I restrained my self from doing that and picked up just one shade for trial... So am I going to get the other shades...?? Price: £2 Me not a fan of this packaging, its very cheap and easily breakable. Though the color looks very pretty and quite bold in the pan, but its a very sheer shade and gives a very healthy sheen to the cheeks without any color. With foundation this sheen lasts me 2-3 hours only and almost fades away. But the best part is it works great base for powdered blushes and MUA has a matching powder blush for each cream blush. So the question was am I going to pick this range again. I think I might pick up all the shades. I won't say its a great blush obviously, but definitely worth the price and good option to try out different shades for yourself, without breaking the bank.
For this I had to swipe like 5-6 times... so that camera can show up some color
Blended with fingers
Are you planning to try any MUA cream blushes ?


Our site uses cookies to maintain a user session.
Third party services such as google analytics, etarget, or facebook may store additional cookies when you visit this site.


IoT SOL runs on the Intel Edison Board, and operates all sensors/devices in DFRobot Starter Kits for Edison


Before Change
num_channels = 1
if num_channels != len(names) or num_channels != len(colors):
names = ["Label {}".format(n) for n in range(1, num_channels+1)]
colors = colortables.default16_new[1:num_channels+1]
// Use a slicer to provide a separate slot for each channel layer
opSlicer = OpMultiArraySlicer2( parent=opLane.viewed_operator().parent )
opSlicer.Input.connect( predictionSlot )
After Change
drange = channelSlot.meta.drange or (0.0, 1.0)
predictsrc = LazyflowSource(channelSlot)
predictLayer = AlphaModulatedLayer( predictsrc,
tintColor=QColor(*colors[channel]),
// FIXME: This is weird. Why are range and normalize both set to the same thing?
range=drange,
normalize=drange )


TextModel objects specify the general appearance of Text objects and of overlay objects that display text (OverlayText, OverlayClock, and BillboardText).
The inputs to the TextModel keywords set the default values for the corresponding keywords for Text, OverlayText, etc. A TextModel can therefore be used as a style for these objects. For example, changing the FontName input for a TextModel will change the font shown by all the objects that use that TextModel as their DisplayModel input.
TextModel Inputs
|
Keyword |
Description |
|
Key Inputs |
|
|
Description |
A free-form string describing the object. |
|
FontName |
The font to be used for the text. |
|
TextHeight |
The height of the text as displayed in the view window. |
|
TextHeightInPixels |
The height of the text in pixels, used by billboard text and overlay text. |
|
FontColour |
The colour of the text. |
|
FontStyle |
The font styles to be applied to the text, e.g. Bold, Italic. |
|
DropShadow |
If TRUE, then a drop shadow appears for the text. |
|
DropShadowColour |
The colour for the drop shadow. |
|
DropShadowOffset |
The { x, y, z } coordinates of the drop shadow's offset, expressed as a decimal fraction of the text height. |


Docker: Hands on🔗
How to run this ?🔗
We will discover the basics of docker and you will be able to manipulate your first images and containers !
First, you should be inside jupyter lab using the google cloud deep learning VM created previously
It's possible to do this from google cloud shell using code-server as well but you will be limited in disk space later on
Why only two of these ? That's because both have git and docker installed and installing docker is a pain.
If you are running linux on your laptop you may install docker and do everything from your computer
Otherwise... don't ;)
FIRST if you are using the deep learning vm
Disconnect from your instance and relaunch it while mapping 8888 as well. You should have the vm jupyter's lab on 8080, and 8888 free
Solution
`gcloud compute ssh user@machine-name --zone europe-west4-a -- -L 8080:localhost:8080 -L 8081:localhost:8081 -L 8888:localhost:8888`1. Manipulating docker for the 1st time🔗
Source: https://github.com/docker/labs
To get started, let's run the following in our terminal:
$ docker pull alpine
The pull
command fetches the alpine image from the Docker registry and saves it in our system. You can use the docker images
command to see a list of all images on your system.
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
alpine latest c51f86c28340 4 weeks ago 1.109 MB
hello-world latest 690ed74de00f 5 months ago 960 B
1.1 Docker Run🔗
Great! Let's now run a Docker container based on this image. To do that you are going to use the docker run
command.
$ docker run alpine ls -l
total 48
drwxr-xr-x 2 root root 4096 Mar 2 16:20 bin
drwxr-xr-x 5 root root 360 Mar 18 09:47 dev
drwxr-xr-x 13 root root 4096 Mar 18 09:47 etc
drwxr-xr-x 2 root root 4096 Mar 2 16:20 home
drwxr-xr-x 5 root root 4096 Mar 2 16:20 lib
......
......
What happened? Behind the scenes, a lot of stuff happened. When you call run
,
- The Docker client contacts the Docker daemon
- The Docker daemon checks local store if the image (alpine in this case) is available locally, and if not, downloads it from Docker Store. (Since we have issued
docker pull alpine
before, the download step is not necessary) - The Docker daemon creates the container and then runs a command in that container.
- The Docker daemon streams the output of the command to the Docker client
When you run docker run alpine
, you provided a command (ls -l
), so Docker started the command specified and you saw the listing.
Let's try something more exciting.
$ docker run alpine echo "hello from alpine"
hello from alpine
echo
command in our alpine container and then exited it. If you've noticed, all of that happened pretty quickly. Imagine booting up a virtual machine, running a command and then killing it. Now you know why they say containers are fast!
 Is that a bug? Well, no. These interactive shells will exit after running any scripted commands, unless they are run in an interactive terminal - so for this example to not exit, you need to docker run -it alpine /bin/sh
.
You are now inside the container shell and you can try out a few commands like ls -l
, uname -a
and others. Exit out of the container by giving the exit
command.
Ok, now it's time to see the docker ps
command. The docker ps
command shows you all containers that are currently running.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Since no containers are running, you see a blank line. Let's try a more useful variant: docker ps -a
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
36171a5da744 alpine "/bin/sh" 5 minutes ago Exited (0) 2 minutes ago fervent_newton
a6a9d46d0b2f alpine "echo 'hello from alp" 6 minutes ago Exited (0) 6 minutes ago lonely_kilby
ff0a5c3750b9 alpine "ls -l" 8 minutes ago Exited (0) 8 minutes ago elated_ramanujan
c317d0a9e3d2 hello-world "/hello" 34 seconds ago Exited (0) 12 minutes ago stupefied_mcclintock
What you see above is a list of all containers that you ran. Notice that the STATUS
column shows that these containers exited a few minutes ago. You're probably wondering if there is a way to run more than just one command in a container. Let's try that now:
$ docker run -it alpine /bin/sh
/ # ls
bin dev etc home lib linuxrc media mnt proc root run sbin sys tmp usr var
/ # uname -a
Linux 97916e8cb5dc 4.4.27-moby #1 SMP Wed Oct 26 14:01:48 UTC 2016 x86_64 Linux
run
command with the -it
flags attaches us to an interactive tty in the container. Now you can run as many commands in the container as you want. Take some time to run your favorite commands.
That concludes a whirlwind tour of the docker run
command which would most likely be the command you'll use most often. It makes sense to spend some time getting comfortable with it. To find out more about run
, use docker run --help
to see a list of all flags it supports. As you proceed further, we'll see a few more variants of docker run
.
1.2 Terminology🔗
In the last section, you saw a lot of Docker-specific jargon which might be confusing to some. So before you go further, let's clarify some terminology that is used frequently in the Docker ecosystem.
- Images - The file system and configuration of our application which are used to create containers. To find out more about a Docker image, run
docker inspect alpine
. In the demo above, you used thedocker pull
command to download the alpine image. When you executed the commanddocker run hello-world
, it also did adocker pull
behind the scenes to download the hello-world image. - Containers - Running instances of Docker images — containers run the actual applications. A container includes an application and all of its dependencies. It shares the kernel with other containers, and runs as an isolated process in user space on the host OS.  A list of running containers can be seen using thedocker ps
command. - Docker daemon - The background service running on the host that manages building, running and distributing Docker containers.
- Docker client - The command line tool that allows the user to interact with the Docker daemon.
- Docker Store - A registry of Docker images, where you can find trusted and enterprise ready containers, plugins, and Docker editions. You'll be using this later in this tutorial.
2.0 Webapps with Docker🔗
Source: https://github.com/docker/labs
Great! So you have now looked at docker run
, played with a Docker container and also got the hang of some terminology. Armed with all this knowledge, you are now ready to get to the real stuff — deploying web applications with Docker.
2.1 Run a static website in a container🔗
Note: Code for this section is in this repo in the website directory
Let's start by taking baby-steps. First, we'll use Docker to run a static website in a container. The website is based on an existing image. We'll pull a Docker image from Docker Store, run the container, and see how easy it is to set up a web server.
The image that you are going to use is a single-page website that was already created for this demo and is available on the Docker Store as dockersamples/static-site
. You can download and run the image directly in one go using docker run
as follows.
docker run -d dockersamples/static-site
Files:
Note: The current version of this image doesn't run without the
-d
flag. The-d
flag enables detached mode, which detaches the running container from the terminal/shell and returns your prompt after the container starts. We are debugging the problem with this image but for now, use-d
even for this first example.

Since the image doesn't exist on your Docker host, the Docker daemon first fetches it from the registry and then runs it as a container.
Now that the server is running, do you see the website? What port is it running on? And more importantly, how do you access the container directly from our host machine?
Actually, you probably won't be able to answer any of these questions yet! ☺ In this case, the client didn't tell the Docker Engine to publish any of the ports, so you need to re-run the docker run
command to add this instruction.
Let's re-run the command with some new flags to publish ports and pass your name to the container to customize the message displayed. We'll use the -d option again to run the container in detached mode.
First, stop the container that you have just launched. In order to do this, we need the container ID.
Since we ran the container in detached mode, we don't have to launch another terminal to do this. Run docker ps
to view the running containers.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a7a0e504ca3e dockersamples/static-site "/bin/sh -c 'cd /usr/" 28 seconds ago Up 26 seconds 80/tcp, 443/tcp stupefied_mahavira
Check out the CONTAINER ID
column. You will need to use this CONTAINER ID
value, a long sequence of characters, to identify the container you want to stop, and then to remove it. The example below provides the CONTAINER ID
on our system; you should use the value that you see in your terminal.
$ docker stop a7a0e504ca3e
$ docker rm a7a0e504ca3e
Note: A cool feature is that you do not need to specify the entire
CONTAINER ID
. You can just specify a few starting characters and if it is unique among all the containers that you have launched, the Docker client will intelligently pick it up.
Now, let's launch a container in detached mode as shown below:
$ docker run --name static-site -e AUTHOR="Your Name" -d -P dockersamples/static-site
e61d12292d69556eabe2a44c16cbd54486b2527e2ce4f95438e504afb7b02810
In the above command:
-d
will create a container with the process detached from our terminal-P
will publish all the exposed container ports to random ports on the Docker host-e
is how you pass environment variables to the container--name
allows you to specify a container nameAUTHOR
is the environment variable name andYour Name
is the value that you can pass
Now you can see the ports by running the docker port
command.
$ docker port static-site
443/tcp -> <IP_ADDRESS>:32772
80/tcp -> <IP_ADDRESS>:32773
If you are running Docker for Mac, Docker for Windows, or Docker on Linux, you can open http://localhost:[YOUR_PORT_FOR 80/tcp]
. For our example this is http://localhost:32773
.
If you are using Docker Machine on Mac or Windows, you can find the hostname on the command line using docker-machine
as follows (assuming you are using the default
machine).
$ docker-machine ip default
<IP_ADDRESS>
http://<YOUR_IPADDRESS>:[YOUR_PORT_FOR 80/tcp]
to see your site live! For our example, this is: http://<IP_ADDRESS>:32773
.
You can also run a second webserver at the same time, specifying a custom host port mapping to the container's webserver.
$ docker run --name static-site-2 -e AUTHOR="Your Name" -d -p 8888:80 dockersamples/static-site
To deploy this on a real server you would just need to install Docker, and run the above docker
command(as in this case you can see the AUTHOR
is Docker which we passed as an environment variable).
Now that you've seen how to run a webserver inside a Docker container, how do you create your own Docker image? This is the question we'll explore in the next section.
But first, let's stop and remove the containers since you won't be using them anymore.
$ docker stop static-site
$ docker rm static-site
Let's use a shortcut to remove the second site:
$ docker rm -f static-site-2
Run docker ps
to make sure the containers are gone.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2.2 Docker Images🔗
In this section, let's dive deeper into what Docker images are. You will build your own image, use that image to run an application locally.
 In the previous example, you pulled the dockersamples/static-site image from the registry and asked the Docker client to run a container based on that image. To see the list of images that are available locally on your system, run the docker images
command.
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
dockersamples/static-site latest 92a386b6e686 2 hours ago 190.5 MB
nginx latest af4b3d7d5401 3 hours ago 190.5 MB
python 2.7 1c32174fd534 14 hours ago 676.8 MB
postgres 9.4 88d845ac7a88 14 hours ago 263.6 MB
containous/traefik latest 27b4e0c6b2fd 4 days ago 20.75 MB
node 0.10 42426a5cba5f 6 days ago 633.7 MB
redis latest 4f5f397d4b7c 7 days ago 177.5 MB
mongo latest 467eb21035a8 7 days ago 309.7 MB
alpine 3.3 70c557e50ed6 8 days ago 4.794 MB
java 7 21f6ce84e43c 8 days ago 587.7 MB
Above is a list of images that I've pulled from the registry and those I've created myself (we'll shortly see how). You will have a different list of images on your machine. The TAG
refers to a particular snapshot of the image and the ID
is the corresponding unique identifier for that image.
For simplicity, you can think of an image akin to a git repository - images can be committed with changes and have multiple versions. When you do not provide a specific version number, the client defaults to latest
.
For example you could pull a specific version of ubuntu
image as follows:
$ docker pull ubuntu:12.04
If you do not specify the version number of the image then, as mentioned, the Docker client will default to a version named latest
.
So for example, the docker pull
command given below will pull an image named ubuntu:latest
:
$ docker pull ubuntu
To get a new Docker image you can either get it from a registry (such as the Docker Store) or create your own. There are hundreds of thousands of images available on Docker Store. You can also search for images directly from the command line using docker search
.
An important distinction with regard to images is between base images and child images.

-
Child images are images that build on base images and add additional functionality.
Another key concept is the idea of official images and user images. (Both of which can be base images or child images.)
-
Official images are Docker sanctioned images. Docker, Inc. sponsors a dedicated team that is responsible for reviewing and publishing all Official Repositories content. This team works in collaboration with upstream software maintainers, security experts, and the broader Docker community. These are not prefixed by an organization or user name. In the list of images above, the
python
,node
,alpine
andnginx
images are official (base) images. To find out more about them, check out the Official Images Documentation.  They build on base images and add additional functionality. Typically these are formatted as
user/image-name
. Theuser
value in the image name is your Docker Store user or organization name.
2.3 Create your first image🔗
Note: The code for this section is in this repository in the flask-app directory.
Now that you have a better understanding of images, it's time to create your own. Our goal here is to create an image that sandboxes a small Flask application.
The goal of this exercise is to create a Docker image which will run a Flask app.
We'll do this by first pulling together the components for a random cat picture generator built with Python Flask, then dockerizing it by writing a Dockerfile. Finally, we'll build the image, and then run it.

Start by creating a directory called flask-app
where we'll create the following files:
Make sure to cd flask-app
before you start creating the files, because you don't want to start adding a whole bunch of other random files to your image.
app.py🔗
Create the app.py with the following content:
from flask import Flask, render_template
import random
app = Flask(__name__)
# list of cat images
images = [
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr05/15/9/anigif_enhanced-buzz-26388-1381844103-11.gif",
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr01/15/9/anigif_enhanced-buzz-31540-1381844535-8.gif",
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr05/15/9/anigif_enhanced-buzz-26390-1381844163-18.gif",
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr06/15/10/anigif_enhanced-buzz-1376-1381846217-0.gif",
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr03/15/9/anigif_enhanced-buzz-3391-1381844336-26.gif",
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr06/15/10/anigif_enhanced-buzz-29111-1381845968-0.gif",
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr03/15/9/anigif_enhanced-buzz-3409-1381844582-13.gif",
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr02/15/9/anigif_enhanced-buzz-19667-1381844937-10.gif",
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr05/15/9/anigif_enhanced-buzz-26358-1381845043-13.gif",
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr06/15/9/anigif_enhanced-buzz-18774-1381844645-6.gif",
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr06/15/9/anigif_enhanced-buzz-25158-1381844793-0.gif",
"http://img.buzzfeed.com/buzzfeed-static/static/2013-10/enhanced/webdr03/15/10/anigif_enhanced-buzz-11980-1381846269-1.gif"
]
@app.route('/')
def index():
url = random.choice(images)
return render_template('index.html', url=url)
if __name__ == "__main__":
app.run(host="<IP_ADDRESS>")
requirements.txt🔗
In order to install the Python modules required for our app, we need to create a file called requirements.txt and add the following line to that file:
Flask==0.10.1
templates/index.html🔗
Create a directory called templates
and create an index.html file in that directory with the following content in it:

Cat Gif of the day

Courtesy: Buzzfeed

2.3.2 Write a Dockerfile🔗
We want to create a Docker image with this web app. As mentioned above, all user images are based on a base image. Since our application is written in Python, we will build our own Python image based on Alpine. We'll do that using a Dockerfile.
A Dockerfile is a text file that contains a list of commands that the Docker daemon calls while creating an image. The Dockerfile contains all the information that Docker needs to know to run the app — a base Docker image to run from, location of your project code, any dependencies it has, and what commands to run at start-up. It is a simple way to automate the image creation process. The best part is that the commands you write in a Dockerfile are almost identical to their equivalent Linux commands. This means you don't really have to learn new syntax to create your own Dockerfiles.
- Create a file called Dockerfile, and add content to it as described below.
We'll start by specifying our base image, using the FROM
keyword:
FROM alpine:3.5
- The next step usually is to write the commands of copying the files and installing the dependencies. But first we will install the Python pip package to the alpine linux distribution. This will not just install the pip package but any other dependencies too, which includes the python interpreter. Add the following RUN command next:
RUN apk add --update py2-pip
- Let's add the files that make up the Flask Application.
Install all Python requirements for our app to run. This will be accomplished by adding the lines:
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt
Copy the files you have created earlier into our image by using COPY command.
COPY app.py /usr/src/app/
COPY templates/index.html /usr/src/app/templates/
- Specify the port number which needs to be exposed. Since our flask app is running on
5000
that's what we'll expose.
EXPOSE 5000
- The last step is the command for running the application which is simply -
python ./app.py
. Use the CMD command to do that:
CMD ["python", "/usr/src/app/app.py"]
The primary purpose of CMD
is to tell the container which command it should run by default when it is started.
- Verify your Dockerfile.
Our Dockerfile
is now ready. This is how it looks:
# our base image
FROM alpine:3.5
# Install python and pip
RUN apk add --update py2-pip
# install Python modules needed by the Python app
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt
# copy files required for the app to run
COPY app.py /usr/src/app/
COPY templates/index.html /usr/src/app/templates/
# tell the port number the container should expose
EXPOSE 5000
# run the application
CMD ["python", "/usr/src/app/app.py"]
2.3.3 Build the image🔗
Now that you have your Dockerfile
, you can build your image. The docker build
command does the heavy-lifting of creating a docker image from a Dockerfile
.
The docker build
command is quite simple - it takes an optional tag name with the -t
flag, and the location of the directory containing the Dockerfile
- the .
indicates the current directory:
docker build -t myfirstapp:1.0
$ docker build -t myfirstapp:1.0 .
Sending build context to Docker daemon 9.728 kB
Step 1 : FROM alpine:latest
---> 0d81fc72e790
Step 2 : RUN apk add --update py-pip
---> Running in 8abd4091b5f5
fetch http://dl-4.alpinelinux.org/alpine/v3.3/main/x86_64/APKINDEX.tar.gz
fetch http://dl-4.alpinelinux.org/alpine/v3.3/community/x86_64/APKINDEX.tar.gz
(1/12) Installing libbz2 (1.0.6-r4)
(2/12) Installing expat (2.1.0-r2)
(3/12) Installing libffi (3.2.1-r2)
(4/12) Installing gdbm (1.11-r1)
(5/12) Installing ncurses-terminfo-base (6.0-r6)
(6/12) Installing ncurses-terminfo (6.0-r6)
(7/12) Installing ncurses-libs (6.0-r6)
(8/12) Installing readline (6.3.008-r4)
(9/12) Installing sqlite-libs (3.9.2-r0)
(10/12) Installing python (2.7.11-r3)
(11/12) Installing py-setuptools (18.8-r0)
(12/12) Installing py-pip (7.1.2-r0)
Executing busybox-1.24.1-r7.trigger
OK: 59 MiB in 23 packages
---> 976a232ac4ad
Removing intermediate container 8abd4091b5f5
Step 3 : COPY requirements.txt /usr/src/app/
---> 65b4be05340c
Removing intermediate container 29ef53b58e0f
Step 4 : RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt
---> Running in a1f26ded28e7
Collecting Flask==0.10.1 (from -r /usr/src/app/requirements.txt (line 1))
Downloading Flask-0.10.1.tar.gz (544kB)
Collecting Werkzeug>=0.7 (from Flask==0.10.1->-r /usr/src/app/requirements.txt (line 1))
Downloading Werkzeug-0.11.4-py2.py3-none-any.whl (305kB)
Collecting Jinja2>=2.4 (from Flask==0.10.1->-r /usr/src/app/requirements.txt (line 1))
Downloading Jinja2-2.8-py2.py3-none-any.whl (263kB)
Collecting itsdangerous>=0.21 (from Flask==0.10.1->-r /usr/src/app/requirements.txt (line 1))
Downloading itsdangerous-0.24.tar.gz (46kB)
Collecting MarkupSafe (from Jinja2>=2.4->Flask==0.10.1->-r /usr/src/app/requirements.txt (line 1))
Downloading MarkupSafe-0.23.tar.gz
Installing collected packages: Werkzeug, MarkupSafe, Jinja2, itsdangerous, Flask
Running setup.py install for MarkupSafe
Running setup.py install for itsdangerous
Running setup.py install for Flask
Successfully installed Flask-0.10.1 Jinja2-2.8 MarkupSafe-0.23 Werkzeug-0.11.4 itsdangerous-0.24
You are using pip version 7.1.2, however version 8.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
---> 8de73b0730c2
Removing intermediate container a1f26ded28e7
Step 5 : COPY app.py /usr/src/app/
---> 6a3436fca83e
Removing intermediate container d51b81a8b698
Step 6 : COPY templates/index.html /usr/src/app/templates/
---> 8098386bee99
Removing intermediate container b783d7646f83
Step 7 : EXPOSE 5000
---> Running in 31401b7dea40
---> 5e9988d87da7
Removing intermediate container 31401b7dea40
Step 8 : CMD python /usr/src/app/app.py
---> Running in 78e324d26576
---> 2f7357a0805d
Removing intermediate container 78e324d26576
Successfully built 2f7357a0805d
If you don't have the alpine:3.5
image, the client will first pull the image and then create your image. Therefore, your output on running the command will look different from mine. If everything went well, your image should be ready! Run docker images
and see if your image (<YOUR_USERNAME>/myfirstapp
) shows.
2.3.4 Run your image🔗
The next step in this section is to run the image and see if it actually works.
$ docker run -p 8888:5000 --name myfirstapp myfirstapp:1.0
* Running on http://<IP_ADDRESS>:5000/ (Press CTRL+C to quit)
Head over to http://localhost:8888
and your app should be live. Note If you are using Docker Machine, you may need to open up another terminal and determine the container ip address using docker-machine ip default
.
Hit the Refresh button in the web browser to see a few more cat images.
2.3.5 Dockerfile commands summary🔗
Here's a quick summary of the few basic commands we used in our Dockerfile.
-
FROM
starts the Dockerfile. It is a requirement that the Dockerfile must start with theFROM
command. Images are created in layers, which means you can use another image as the base image for your own. TheFROM
command defines your base layer. As arguments, it takes the name of the image. Optionally, you can add the Docker Cloud username of the maintainer and image version, in the formatusername/imagename:version
. -
RUN
is used to build up the Image you're creating. For eachRUN
command, Docker will run the command then create a new layer of the image. This way you can roll back your image to previous states easily. The syntax for aRUN
instruction is to place the full text of the shell command after theRUN
(e.g.,RUN mkdir /user/local/foo
). This will automatically run in a/bin/sh
shell. You can define a different shell like this:RUN /bin/bash -c 'mkdir /user/local/foo'
-
COPY
copies local files into the container. -
CMD
defines the commands that will run on the Image at start-up. Unlike aRUN
, this does not create a new layer for the Image, but simply runs the command. There can only be oneCMD
per a Dockerfile/Image. If you need to run multiple commands, the best way to do that is to have theCMD
run a script.CMD
requires that you tell it where to run the command, unlikeRUN
. So exampleCMD
commands would be:
CMD ["python", "./app.py"]
CMD ["/bin/bash", "echo", "Hello World"]
EXPOSE
creates a hint for users of an image which ports provide services. It is included in the information which can be retrieved via$ docker inspect <container-id>
.
Note: The
EXPOSE
command does not actually make any ports accessible to the host! Instead, this requires publishing ports by means of the-p
flag when using$ docker run
.
PUSH
pushes your image to Docker Cloud, or alternately to a private registry
Note: If you want to learn more about Dockerfiles, check out Best practices for writing Dockerfiles.
3. Containers Registry🔗
Remember Container Registries ? Here as some explainers
The main container registry is dockerhub, https://hub.docker.com/
All docker engines that have access to the internet have access to this main hub, and this is where we pulled our base images from before
Example, the Python Image
Google Cloud has a Container Registry per project, which ensures the docker images you build are accessible for the people who have access to your project only.
However, it requires naming the image in a specific fashion: eu.gcr.io/${PROJECT_ID}/name:tag
- Use the docker cli to tag your previous myfirstapp image to the right namespace
docker tag myfirstapp eu.gcr.io/{PROJECT_ID}/myfirstapp:1.0
-
Upload it on container registry
docker push [HOSTNAME]/[PROJECT-ID]/[IMAGE]:[TAG]
-
If you have a problem of authentification,
gcloud auth configure-docker
Hint
to get your project id: PROJECT_ID=$(gcloud config get-value project 2> /dev/null)
- Go to container registry https://console.cloud.google.com/gcr, you should see your docker image :)
4. Data Science Standardized Environment🔗
4.1 Intro🔗
Those of us who work on a team know how hard it is to create a standardize development environment. Or if you have ever updated a dependency and had everything break, you understand the importance of keeping development environments isolated.
Using Docker, we can create a project / team image with our development environment and mount a volume with our notebooks and data.
The benefits of this workflow are that we can:
- Separate out projects
- Spin up a container to onboard new employees
- Build an automated testing pipeline to confirm upgrade dependencies do not break code
4.2 Kaggle Docker Image🔗
For this exercise we will use Kaggle Docker Image which is a fully configured docker image that can be used as a data science container
Take a look at the documentation and the repository
4.3 Get the algorithm in ML git in your Virtual Machine🔗
-
From your vm, run
git clone https://github.com/erachelson/MLclass.git
, this should setup your AML class inside your VM -
Using code-server is not mandatory now
4.4 Mounting volumes and ports🔗
Now let's run the image. This container has a jupyter notebook accessible from port 8080 so we will need to map the host port 8888 (the one accessible from the ssh tunnel) to the docker port 8080, we will use port forwarding
We will also need to make available the notebooks on the VM to the container... we will mount volumes. Your data is located in /home/${USER}/MLClass
and we want to miunt it in /tmp/workdir
docker run --rm -it \
-p 8888:8080 \
-v /home/${USER}/MLclass:/home/Mlclass \
--workdir /home/ \
gcr.io/kaggle-images/python \
/bin/bash /run_jupyter.sh
Note: this image is very large !
Options breakdown:
* --rm
remove the container when we stop it
* -it
run the container in interactive mode
* -p
forward port from host:container
* other: options from the kaggle container
You should now see a jupyter lab with mlclass accessible if you connect your browser (in your laptop) to port 8888 (localhost:8888)
So basically, we mapped the ports local 8888 to vm 8888 and vm 8888 to docker 8080
5. Bonus - Using Google Cloud Tools for Docker🔗
Using cloud shell you should be able to do the Hello World Dockerfile exercise except that instead of using docker build you use Google Cloud Build
Tutorial: https://cloud.google.com/cloud-build/docs/quickstart-docker
Example command :gcloud builds submit --tag eu.gcr.io/$PROJECT_ID/{image}:{tag} .
Help
to get your project id: PROJECT_ID=$(gcloud config get-value project 2> /dev/null)
Example
Try to build the hello world app
6. Bonus - Docker Compose🔗
https://hackernoon.com/practical-introduction-to-docker-compose-d34e79c4c2b6
https://github.com/docker/labs/blob/master/beginner/chapters/votingapp.md


Increment
When floating intervals are used, the increment is the angle of overlap of sectors of a rose diagram . This value should be a divisor of the interval angle.


Season's greetings
This is KPMG, and this is our Story
"The Nutcracker and the Mouse King" is a story written in 1816 by German author E. T. A. Hoffmann. In the famous fairytale brothers Clara and Fritz have a very special godfather who makes inventions out of clockwork and his Christmas presents are always amazing!
The Nutcracker story
This year he gives them something rather small and simple - a nutcracker-doll in the form of a soldier. It's rather ugly, and soon it is broken, but Clara loves it all the same. And then it comes to life and proves himself to be a true hero. The Nutcracker after defeating the evil Mouse King in battle, whisks her away to a magical kingdom populated by dolls.
To us the Nutcracker is more than a beloved Christmas story. It is our source of inspiration for our Christmas wishes this year.
The Nutcracker’s story as an iconic hero who fights and protects Clara, symbolizes and illustrates care for those in need.
In KPMG we do care for people. Care is very important for us and a crucial part of our DNA.
We don’t only care about companies we work with, but we also cherish the bond they have with their people and the wider society and we are by their side helping them respond to changes in the global economy.
Regardless of our individual role in KPMG, we make a positive impact in society through the work we do. By staying focused on what really matters, and acting as stewards for the next generation, we aim to inspire confidence and empower change.


This is the left para.
Spicy jalapeno alcatra salami bacon ham hock, beef jowl corned beef. Biltong ribeye shankle jowl beef pork kevin corned beef brisket t-bone. Porchetta strip steak biltong, meatball kielbasa ham hock kevin chuck pork loin doner shank.
Tongue sausage swine cupim cow beef turducken salami strip steakdrumsticktenderloin
turkey shank pork chop hi boudin.


callCall for Bookings
To know the best offers and bookings contact-us, click on number below to call directly.
Email us and we will revert back to you with all the information,also visit our instagram page.


class GoogleDriveYAMLParser
Attributes
google_drive_data[RW]
Public Class Methods
new(username=nil, password=nil, site_config)
click to toggle source
# File lib/google_drive/parse_to_yaml.rb, line 11 def initialize(username=nil, password=nil, site_config) @session = GoogleDrive.login(username,password) @site_config = site_config end
Public Instance Methods
read_sheet(key, sheet, object_type, parameters)
click to toggle source
# File lib/google_drive/parse_to_yaml.rb, line 16 def read_sheet(key, sheet, object_type, parameters) #That is, name of workbook and then sheet title ws = @session.spreadsheet_by_key(key).worksheet_by_title(sheet) #Load the previous value, if it exists begin puts "Attempting to load previous data file for #{object_type} of type #{sheet}" prev_file = YAML::load(File.open("#{@site_config['data_directory']}/#{sheet.downcase}.yml")) || [] puts "Successfully loaded previous data file" rescue puts "No previous data file for #{object_type}, no problem, just make sure all google data exists" prev_file = [] end #print prev_file objects = [] #Assumes that 3rd row is header (Which it is by design) (4..ws.num_rows.to_i).to_a.each do |r| # Iterate through every row object = {} # Make an empty hash for a row (1..ws.num_cols).to_a.each do |c| # Iterate over columns, load hash object[ws[3,c]] = ws[r,c] end #Account for empty cells if object['name']=="" #As long as name is empty, object doesn't parse next end #Evaluate the object type (Must actually exist!) begin this_object = eval(object_type).new(object['name'], sheet.capitalize) rescue puts "Error! The object type #{object_type} may not exist" end #Now add keys as instance variables to the person... Cool! object.each do |k,v| unless v=='' this_object.instance_variable_set("@#{k}", v) end end previous_data = [] unless prev_file.empty? if prev_file.collect{|item| item['name']}.include? this_object.name previous_data = prev_file[prev_file.index {|h| h['name'] == this_object.name }] end end this_object.validate(parameters, previous_data) objects << this_object #Add the object to the objects array end return objects end
write_to_yaml(objects, directory, filename)
click to toggle source
# File lib/google_drive/parse_to_yaml.rb, line 75 def write_to_yaml(objects, directory, filename) to_write = [] objects.each do |object| this_object = {} object.instance_variables.each do |k| this_object[k.to_s.gsub('@','')] = object.instance_eval(k.to_s) end to_write << this_object end #Actually write the file begin unless File.directory?(directory) Dir.mkdir directory end File.open(directory+'/'+filename.downcase+'.yml', 'wb') {|f| f.write(to_write.to_yaml) } puts "file: '#{directory}/#{filename.downcase}.yml' written sucessfully" rescue => error puts "Failed to write YAML file:" puts error.inspect puts error.backtrace end return to_write end


You selected a pizza with sauce
Price: $
If you need to make any changes, resubmit your size/sauce/toppings selections before completing your order.
Delivery is only available within Portland
Delivery is only available within Portland, OR.
Order a pizza for pick-up instead.
, be ready to receive your order at Portland, OR .
Your pizza will be in approximately 25 minutes.
Please show your confirmation number, , when you arrive to pick up your order.
Click here to order another pizza!


[ all classes ]
[ org.jsoup ]
Coverage Summary for Class: Jsoup (org.jsoup)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| Jsoup | 100% (1/ 1) | 6.2% (1/ 16) | 4% (1/ 25) |
1 package org.jsoup;
2
3 import org.jsoup.nodes.Document;
4 import org.jsoup.parser.Parser;
5 import org.jsoup.safety.Cleaner;
6 import org.jsoup.safety.Whitelist;
7 import org.jsoup.helper.DataUtil;
8 import org.jsoup.helper.HttpConnection;
9
10 import java.io.File;
11 import java.io.IOException;
12 import java.io.InputStream;
13 import java.net.URL;
14
15 /**
16 The core public access point to the jsoup functionality.
17
18 @author Jonathan Hedley */
19 public class Jsoup {
20 private Jsoup() {}
21
22 /**
23 Parse HTML into a Document. The parser will make a sensible, balanced document tree out of any HTML.
24
25 @param html HTML to parse
26 @param baseUri The URL where the HTML was retrieved from. Used to resolve relative URLs to absolute URLs, that occur
27 before the HTML declares a {@code <base href>} tag.
28 @return sane HTML
29 */
30 public static Document parse(String html, String baseUri) {
31 return Parser.parse(html, baseUri);
32 }
33
34 /**
35 Parse HTML into a Document, using the provided Parser. You can provide an alternate parser, such as a simple XML
36 (non-HTML) parser.
37
38 @param html HTML to parse
39 @param baseUri The URL where the HTML was retrieved from. Used to resolve relative URLs to absolute URLs, that occur
40 before the HTML declares a {@code <base href>} tag.
41 @param parser alternate {@link Parser#xmlParser() parser} to use.
42 @return sane HTML
43 */
44 public static Document parse(String html, String baseUri, Parser parser) {
45 return parser.parseInput(html, baseUri);
46 }
47
48 /**
49 Parse HTML into a Document. As no base URI is specified, absolute URL detection relies on the HTML including a
50 {@code <base href>} tag.
51
52 @param html HTML to parse
53 @return sane HTML
54
55 @see #parse(String, String)
56 */
57 public static Document parse(String html) {
58 return Parser.parse(html, "");
59 }
60
61 /**
62 * Creates a new {@link Connection} to a URL. Use to fetch and parse a HTML page.
63 *

64 * Use examples:
65 *

66 *
Document doc = Jsoup.connect("http://example.com").userAgent("Mozilla").data("name", "jsoup").get();

67 *
Document doc = Jsoup.connect("http://example.com").cookie("auth", "token").post();

68 *

69 * @param url URL to connect to. The protocol must be {@code http} or {@code https}.
70 * @return the connection. You can add data, cookies, and headers; set the user-agent, referrer, method; and then execute.
71 */
72 public static Connection connect(String url) {
73 return HttpConnection.connect(url);
74 }
75
76 /**
77 Parse the contents of a file as HTML.
78
79 @param in file to load HTML from
80 @param charsetName (optional) character set of file contents. Set to {@code null} to determine from {@code http-equiv} meta tag, if
81 present, or fall back to {@code UTF-8} (which is often safe to do).
82 @param baseUri The URL where the HTML was retrieved from, to resolve relative links against.
83 @return sane HTML
84
85 @throws IOException if the file could not be found, or read, or if the charsetName is invalid.
86 */
87 public static Document parse(File in, String charsetName, String baseUri) throws IOException {
88 return DataUtil.load(in, charsetName, baseUri);
89 }
90
91 /**
92 Parse the contents of a file as HTML. The location of the file is used as the base URI to qualify relative URLs.
93
94 @param in file to load HTML from
95 @param charsetName (optional) character set of file contents. Set to {@code null} to determine from {@code http-equiv} meta tag, if
96 present, or fall back to {@code UTF-8} (which is often safe to do).
97 @return sane HTML
98
99 @throws IOException if the file could not be found, or read, or if the charsetName is invalid.
100 @see #parse(File, String, String)
101 */
102 public static Document parse(File in, String charsetName) throws IOException {
103 return DataUtil.load(in, charsetName, in.getAbsolutePath());
104 }
105
106 /**
107 Read an input stream, and parse it to a Document.
108
109 @param in input stream to read. Make sure to close it after parsing.
110 @param charsetName (optional) character set of file contents. Set to {@code null} to determine from {@code http-equiv} meta tag, if
111 present, or fall back to {@code UTF-8} (which is often safe to do).
112 @param baseUri The URL where the HTML was retrieved from, to resolve relative links against.
113 @return sane HTML
114
115 @throws IOException if the file could not be found, or read, or if the charsetName is invalid.
116 */
117 public static Document parse(InputStream in, String charsetName, String baseUri) throws IOException {
118 return DataUtil.load(in, charsetName, baseUri);
119 }
120
121 /**
122 Read an input stream, and parse it to a Document. You can provide an alternate parser, such as a simple XML
123 (non-HTML) parser.
124
125 @param in input stream to read. Make sure to close it after parsing.
126 @param charsetName (optional) character set of file contents. Set to {@code null} to determine from {@code http-equiv} meta tag, if
127 present, or fall back to {@code UTF-8} (which is often safe to do).
128 @param baseUri The URL where the HTML was retrieved from, to resolve relative links against.
129 @param parser alternate {@link Parser#xmlParser() parser} to use.
130 @return sane HTML
131
132 @throws IOException if the file could not be found, or read, or if the charsetName is invalid.
133 */
134 public static Document parse(InputStream in, String charsetName, String baseUri, Parser parser) throws IOException {
135 return DataUtil.load(in, charsetName, baseUri, parser);
136 }
137
138 /**
139 Parse a fragment of HTML, with the assumption that it forms the {@code body} of the HTML.
140
141 @param bodyHtml body HTML fragment
142 @param baseUri URL to resolve relative URLs against.
143 @return sane HTML document
144
145 @see Document#body()
146 */
147 public static Document parseBodyFragment(String bodyHtml, String baseUri) {
148 return Parser.parseBodyFragment(bodyHtml, baseUri);
149 }
150
151 /**
152 Parse a fragment of HTML, with the assumption that it forms the {@code body} of the HTML.
153
154 @param bodyHtml body HTML fragment
155 @return sane HTML document
156
157 @see Document#body()
158 */
159 public static Document parseBodyFragment(String bodyHtml) {
160 return Parser.parseBodyFragment(bodyHtml, "");
161 }
162
163 /**
164 Fetch a URL, and parse it as HTML. Provided for compatibility; in most cases use {@link #connect(String)} instead.
165

166 The encoding character set is determined by the content-type header or http-equiv meta tag, or falls back to {@code UTF-8}.
167
168 @param url URL to fetch (with a GET). The protocol must be {@code http} or {@code https}.
169 @param timeoutMillis Connection and read timeout, in milliseconds. If exceeded, IOException is thrown.
170 @return The parsed HTML.
171
172 @throws java.net.MalformedURLException if the request URL is not a HTTP or HTTPS URL, or is otherwise malformed
173 @throws HttpStatusException if the response is not OK and HTTP response errors are not ignored
174 @throws UnsupportedMimeTypeException if the response mime type is not supported and those errors are not ignored
175 @throws java.net.SocketTimeoutException if the connection times out
176 @throws IOException if a connection or read error occurs
177
178 @see #connect(String)
179 */
180 public static Document parse(URL url, int timeoutMillis) throws IOException {
181 Connection con = HttpConnection.connect(url);
182 con.timeout(timeoutMillis);
183 return con.get();
184 }
185
186 /**
187 Get safe HTML from untrusted input HTML, by parsing input HTML and filtering it through a white-list of permitted
188 tags and attributes.
189
190 @param bodyHtml input untrusted HTML (body fragment)
191 @param baseUri URL to resolve relative URLs against
192 @param whitelist white-list of permitted HTML elements
193 @return safe HTML (body fragment)
194
195 @see Cleaner#clean(Document)
196 */
197 public static String clean(String bodyHtml, String baseUri, Whitelist whitelist) {
198 Document dirty = parseBodyFragment(bodyHtml, baseUri);
199 Cleaner cleaner = new Cleaner(whitelist);
200 Document clean = cleaner.clean(dirty);
201 return clean.body().html();
202 }
203
204 /**
205 Get safe HTML from untrusted input HTML, by parsing input HTML and filtering it through a white-list of permitted
206 tags and attributes.
207
208 @param bodyHtml input untrusted HTML (body fragment)
209 @param whitelist white-list of permitted HTML elements
210 @return safe HTML (body fragment)
211
212 @see Cleaner#clean(Document)
213 */
214 public static String clean(String bodyHtml, Whitelist whitelist) {
215 return clean(bodyHtml, "", whitelist);
216 }
217
218 /**
219 * Get safe HTML from untrusted input HTML, by parsing input HTML and filtering it through a white-list of
220 * permitted tags and attributes.
221 *
The HTML is treated as a body fragment; it's expected the cleaned HTML will be used within the body of an
222 * existing document. If you want to clean full documents, use {@link Cleaner#clean(Document)} instead, and add
223 * structural tags (html, head, body etc) to the whitelist.
224 *
225 * @param bodyHtml input untrusted HTML (body fragment)
226 * @param baseUri URL to resolve relative URLs against
227 * @param whitelist white-list of permitted HTML elements
228 * @param outputSettings document output settings; use to control pretty-printing and entity escape modes
229 * @return safe HTML (body fragment)
230 * @see Cleaner#clean(Document)
231 */
232 public static String clean(String bodyHtml, String baseUri, Whitelist whitelist, Document.OutputSettings outputSettings) {
233 Document dirty = parseBodyFragment(bodyHtml, baseUri);
234 Cleaner cleaner = new Cleaner(whitelist);
235 Document clean = cleaner.clean(dirty);
236 clean.outputSettings(outputSettings);
237 return clean.body().html();
238 }
239
240 /**
241 Test if the input body HTML has only tags and attributes allowed by the Whitelist. Useful for form validation.
242
The input HTML should still be run through the cleaner to set up enforced attributes, and to tidy the output.
243
Assumes the HTML is a body fragment (i.e. will be used in an existing HTML document body.)
244 @param bodyHtml HTML to test
245 @param whitelist whitelist to test against
246 @return true if no tags or attributes were removed; false otherwise
247 @see #clean(String, org.jsoup.safety.Whitelist)
248 */
249 public static boolean isValid(String bodyHtml, Whitelist whitelist) {
250 return new Cleaner(whitelist).isValidBodyHtml(bodyHtml);
251 }
252
253 }


We,ve assembled some links for you to get started.
View All Posts
View All Images
View All Videos
View All Pages
View All Reports
View All Users
Add Posts
Add Images
Add Videos
Add Pages
Add Reports
Add Users
Webtrickshome.com The ultimate home for prospective web developers.


Cayuga Lake:
-Cayuga Lake is 37.9 miles long.

-Widest point is 3.5 miles long, near Aurora.
-The Finger Lakes are said to be carved by glaciers during the last ice age.
-Cayuga is connected to Seneca Lake by the Seneca River and to Lake Ontario by the Erie Canal.
-Includes Boy Scout Camp Barton at Frontenac Point on the Western Shore.
-Also along the Western Shore is Taughannock Falls State Park, featuring a 215 foot waterfall; the tallest single-drop waterfall east of the Rocky Mountains.


#include <ipcp.h>
Definition at line 94 of file ipcp.h.
Definition at line 95 of file ipcp.h.
Definition at line 100 of file ipcp.h.
Definition at line 90 of file ipcp.h.
Definition at line 102 of file ipcp.h.
Definition at line 101 of file ipcp.h.
Definition at line 99 of file ipcp.h.
Definition at line 87 of file ipcp.h.
Definition at line 92 of file ipcp.h.
Definition at line 88 of file ipcp.h.
Definition at line 93 of file ipcp.h.
Definition at line 91 of file ipcp.h.
Definition at line 89 of file ipcp.h.
Definition at line 96 of file ipcp.h.
Definition at line 97 of file ipcp.h.
Definition at line 98 of file ipcp.h.
Definition at line 103 of file ipcp.h.


Sanadkan is a busy port on Boreo's north east coast. It lies at the head of a wide bay facing the Coral Sea. It is a pleasant town which was rebuilt after being destroyed in World War II.
Position 5°50.5'N,118°07.5'E
See Malaysia Formalities for detailed information on clearing into Malaysia.
Information on clearance can be obtained from the yacht club. All officials are reported to be very friendly.
Harbourmaster (Jabatan Laut) is next to the Esso Service Station, one block back from the waterfront.
Immigration and Customs are a taxi ride west of town at the international ferry terminal. Use this Immigration office rather than the one at the airport.
For the latest on visa information see Malaysia/Immigration.
Last updated September 2014.
This is a pleasant, sheltered anchorage, although a little noisy from the number of water taxis. There is an exclusion zone for anchoring off the town.
The yacht club is very welcoming, however reports from cruisers in 2014 are that prices have increased here substantially for docking and using just the dinghy dock. Advice is to go ashore first and enquire about pricing before using the facilities.
When anchoring, beware of some foul ground directly in front of the yacht club as there is a cable running out from the slipway next door. Another anchorage can be found on the other side of the Exclusion Zone, just west of the Coastguard jettyand before the fishing fleet wharves. There is approx. 8 M depth here with good holding.
Dinghies can be parked at the Yacht Club if you pay for temporary membership (annual rate and reported to be high).
There have been a number of reports of outboards being stolen from yachts anchored here, even when the engines have been locked and chained in the cockpit. Incidents have been reported to the local police and some outboards recovered but visiting yachts should take care.
Last updated September 2014.


BANG
By Harvey Karten, Ph.D. Eagle Eye Director: Ash Writer: Ash Cast: Darling Narita, Peter Greene, Michael Newland, David Allen Grafs, Luis Guizar
The most shocking four-letter word in the English language is a three-letter word: GUN. In the November 10, 1997 issue of The New Yorker magazine, a police officer writes "....Short of gunfire, nothing has as strong an effect on a cop as the word 'gun.' Guns are unique in their ability to change nobodies and wanna-bes into genuinely bad men in an instant." Long before that article appeared, Mao Tse-tung said that all political power emanates from the barrel of a gun. What's more, Ash's movie, "Bang"--shot for $20,000 but looking much better--both agrees and disagrees with that gem from The Red Book. In a single, event-filled day his principal character, named simply "Woman" (Darling Narita), accumulates quite a bit of empowerment through her use of a gun. Ultimately, though, she realizes that she doesn't really need a piece to flex her muscles, and manages to put down corrupt people in various walks of life who use their authority to get what they want.
While probably not an Oscar contender, this sleeper of a movie is in some ways the most exciting contribution of the year, partly because of the way it treats its subject matter but mostly because of the way it was filmed. A cinematic example of "guerrilla theater," "Bang" was filmed without official approval. In hit-and-run fashion, the production team quickly zipped through scene after scene (some improvised) and disappeared before they could be rounded up, handed summonses, or arrested for impersonation of a police officer and working without authorization.
Ash divides a section of Los Angeles society into two groups: the powerful and the impotent. The former camp includes a landlord, a Hollywood producer, a police officer, a cold-blooded killer, and a pimp. The latter group include a homeless man, a fun-loving and helpful pair of Latinos, a desperate drug peddler, a coterie of black street people, and most of all an Asian-American woman who is kicked around by all elements of the power structure.  Reporting for an acting audition to a Hollywood producer (David Allen Grafs) who barks into his cordless phone and may or not be actually in the movie business, she is put off by his sexual coming-on. She discovers a homeless man (the remarkable Peter Greene), who lives in a tree, represents the good guys, and serves as her mentor-for-a- day. When the homeless man trashes the producer's garden, she is chased by a cop (Michael Newland), who is willing to drop his plans to arrest her if she would take two minutes to alleviate the distress of a lonely man. She gets the jump on the officer, handcuffs him to a tree, puts on his uniform, and notices almost immediately how differently people respond to her. It's unfortunate that the great playwright Bert Brecht did not live to see this movie: "Bang" astutely demonstrates that writer's Shakespearean view that the apparel oft proclaims the man.
To their credit, the actors performed in this guerrilla movie for free. The entire crew go through their roles with verve and sincerity, but Greene and Narita are standouts. The funniest scene, a rather tense one, has two police officers asking to join the Woman at a coffee shop, thinking that she is one of their own. Luckily for her they are more involved in recounting an anecdote involving the theft of a kidney from a sleeping victim than in looking her over to discover her real identity. In one poignant moment a charming young Latino, Jesus, is gunned down by a drug dealer, an incident which both infuriates and frustrates the Woman--who is unable to help the casualty but instead goes after his killer.
Unlike Sal Stabile's vigorous, no-budget indie "Gravesend," "Bang" does not look at all messy but rather comes across as well planned despite the chaos of its production, the mise-en- scene delightfully composed and vivid. It's just amazing how many experiences a would-be cop can go through in a single day: running out of fuel and getting a lift to a gas station from a couple of guys; showing her benefactors that she's a regular person despite her badge by sharing a beer with them and looking with amusement on their stash of weed; running into a couple making love and giving them her blessing once she discovers that they love each other; handing out money to street people (actual folks playing themselves who almost riot as the bills are delivered to their hands).
You wonder just how much cooperation the police might really get if they all acted like the Woman: genuinely friendly, compassionate, and generous, rather than brutal, cold or indifferent. Ash plays close attention to detail and by doing so has made a film that is poignant, humorous, tense, and all- around fun. Not Rated. Running Time: 98 minutes. (C) 1997 Harvey Karten
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Publics are welcome to play with us.
• Teamspeak 3 is required - we don't bite you.
• TaskForceRadio is required.
• We play tactically and coordinated - Lonewolfs will be kicked.
You find us at www.teamkommando.net.
Our Teamspeak is at voice.teamkommando.net:9987.
We are always looking for new members. If you like teamwork, then talk to us.
As we are a german speaking clan, it might take a while to regroup to an english speaking squad. So please be patient, we will do our very best.


Powered by Dawid Stelmach and Piotr Pasza Storozenko
If you want to find out more scan QR code and look for BiModal


Help Manual -CREATE COMMAND
Name
peg-create - Creates an empty repository or reinitialize an existing one.
Syntax
peg create [project-name]
Description
Peg create command - This command creates an empty Pegit repository - basically a .peg
directory with subdirectories for objects, refs/heads, refs/tags, and template files.
Peg- create is the first command , that a user is supposed to give before connecting his/her
project with the pegit database. It initializes the contents of the database with
default values and adds a new entry corresponding to the given project name in the database
of the project.
Running the peg-create command on already existing pegit repository is
safe and will not duplicate the pegit repositories.
Examples
- Start a new pegit repostory for the given source code base.
$ cd
path/to/your/source-code
$ peg create project_name
# you can provide any name for your project


I’ve have it in my head to extract/rewrite parts of Paste lately. Tempita was one example.
The request and response functions in Paste grew very organically. I wasn’t trying to create a framework, so I studiously avoided anything that might look like a request or response object. I felt that would be stepping on toes or something. Eventually, though, Ben Bangert really wanted a request object for Pylons, and it went in paste.wsgiwrappers. And at a certain point I decided that the class-based access was really just fine, and doing lots of function(environ, ...) was no better than Request(environ).function(...).
So I started WebOb. WebOb has Request, Response, and some exceptions, incorporating the functionality of Paste’s paste.request, paste.response, paste.wsgilib, paste.httpexceptions, and paste.httpheaders. And some extra stuff.
I’ve included a comparison with a few other framework request/response objects. What this doesn’t note, though, is that WebOb has a much larger Request and Response objects. I’ve taken almost all the HTTP headers and mapped them to parsed attributes. So req.if_modified_since returns a datetime object, and req.if_none_match returns a somewhat set-like object, as a few examples. I created a lot of view-like objects for this, representing the canonical form of the information in several other forms (the WSGI request environment, and the status/headers/body of the response).
It’s fairly well tested and includes almost everything I think it should include, but I reserve the right to change the API any way I want until 1.0; this means if you have any opinion on the API I have nothing to stop me from taking your opinions into account.
Oh, and it has docs, really. They may not be the best docs, but they mention most everything and are automatically tested for accuracy. If you just want a sense of the feel, maybe the file-serving example would be a good place to start (though really you’ll only read about the Response object there).
Automatically generated list of related posts:
- WebOb decorator Lately I’ve been writing a few applications (e.g., PickyWiki and...
- What Does A WebOb App Look Like? Lately I’ve been writing code using WebOb and just a...
- JSON-RPC WebOb Example I just saw this json-rpc recipe go by as a...
- WebOb Do-It-Yourself Framework My old do-it-yourself framework tutorial was getting a bit long...
- WebTest HTTP testing I’ve yet to see another testing system for local web...
Hm. I’ve always resisted making a separate attribute for each header, for two reasons: 1) it makes dir(req) or help(req) insanely long, and 2) it hides one API vocabulary behind another, in the simple fact that
if_none_match
(the Request attribute name) is now not the same set of characters as"If-None-Match"
(the request header key). That sort of API-to-API translation step has always seemed to me to be something worth minimizing. Of course, if you could writeRequest.If-None-Match
there’d be no issue, but that’s not a legal Python identifier. So I’ve preferredRequest.headers['If-None-Match']
instead, even though it’s more keystrokes.Comments on either of those design pressures?
It does make
dir()
very long, as well as the extracted docs. I can imagine perhapsreq.headers.if_none_match
might be a way of partitioning out those headers. I don’t know if the value of that outweighs the extra typing.req.headers['if-none-match']
(case-insensitive) gives you the actual header value.req.if_none_match
gives you a parsed form. So there is a distinct difference between the two. There’s no genericreq.x_y_z
map toreq.headers['X-Y-Z']
; only explicit attributes I’ve setup with explicit parsing.I think the name mismatch isn’t much of an issue. It’s pretty obvious how the names map; everything in the API is the PEP 8 preferred lower-case underscore form, and headers are an obvious translation to that.
It would be great if you’ve provided an example of how to use these objects CherryPy / RhubabTart style. This is done via
paste.registry
middleware IIRC, so I suppose I can implement that myself, but an example from the author would be much appreciated. Thanks.Ian:
Sure, gotta have both. CherryPy solves the huge-namespace problem via a
headers.elements(key)
method, soreq.headers['if-none-match']
gives you the actual header value, andreq.headers.elements('if-none-match')
gets you the parsed value. There are plenty of variations on that theme–evenreq.headers.if_none_match
might be an improvement.(btw, your Markdown parser doesn’t seem to do blockquotes?)
I really don’t like the idea of parsed values coming out of a dictionary-like object. The parsed headers supported are limited and constrained and have different types, which is exactly the place where attributes fit and a dictionary interface doesn’t. Dictionaries are right when there might be arbitrary keys, and the values are generally of the same type or meaning.
(Markdown uses leading
>
for blockquotes; seems to work for me, but sometimes WordPress has pre- or post-filters that can mess up markup)I’ve been talking to both Ben Bangert and James Gardner about the possibility of making the Django and Pylons/Paste request/response objects compatible with each other in some way – either through changes to the API or just by ensuring they are similar enough that a very simple bi-directional conversion could be possible. This would make code written against Django and code written against Paste interchangeable, which would be a massive boost for Web programming on Python in general.
Would you be interested in helping out with this? I should probably start a mailing list dedicated to the effort.
I’ve got something very similar to this, so thank you, you’ve enabled me to delete code :).
One thing I would like to see though, is proper decoding of incoming cookies. They aren’t necessarily plain strings, they can have various properties attached to them, like expiry dates and comments. The Cookie module in the stdlib can handle this.
Do clients send structured cookie information? I haven’t seen this; outgoing cookies can have comments and whatnot, and I guess theoretically incoming cookies could have this, but they don’t.
If you are in a weird situation where you are getting more information in Cookie headers than what a normal browser sends, you can always parse the cookies yourself using
req.header['Cookie']
> Do clients send structured cookie information?
Yes. At the very least, multiple values are incredibly common (e.g. Cookie: foo=bar;baz=qux). Clients are also supposed to include the path and domain attributes when they are specified by the server (but they often don’t).
Multiple values are of course supported (it’s a dictionary). Because no clients I know of include the path and domain attributes, I’m not that interested; I find the Cookie objects really lousy, and I don’t want to expose them when they don’t carry any meaningful information for the majority of user agents. If you are in an environment where there are unusual user agents that send more information you can parse it yourself easily enough (
c = Cookie.SimpleCookie(); c.load(req.headers.get('Cookie', ''))
).Simon: “I’ve been talking to both Ben Bangert and James Gardner about the possibility of making the Django and Pylons/Paste request/response objects compatible with each other in some way – either through changes to the API or just by ensuring they are similar enough that a very simple bi-directional conversion could be possible.”
Of course, such things should be possible: WebStack shows that very few request/response object features are so exotic that such objects cannot be manipulated using a common abstraction.
Simon: “This would make code written against Django and code written against Paste interchangeable, which would be a massive boost for Web programming on Python in general.”
This is probably possible already with WebStack in that Django is supported (unless the API is changing a lot in recent snapshots) along with WSGI (but not Paste explicitly).
Hey Paul – I hadn’t seen WebStack. Is there any chance you could put the readme.txt and docs/ files online so they can be viewed without downloading the archive? Makes it much easier to link to things.
The charset attribute is a bit of a misnomer. You aren’t looking at the character set, you are looking at the character encoding. For example, UTF-8 and UTF-16 are the same charset but a different encoding. Any chance of changing it to be more accurate?
Jim: charset is meant to match
text/html; charset=utf8
, where the name is “charset”. To me this felt like the most obvious name as a result. If it’s something of a misnomer then I’m only copying the misnomer (which I didn’t even realize — I suppose there’s really just one charset in Python, unicode, and it treats everything as an encoding, so I don’t really have a distinction in my head between the two concepts).I understand why you did it, but most other Python refers to character encodings properly. For example u”".encode(…), genshi.core.Stream.render(encoding=…), # -*- encoding: … -*-, etc. IMHO it’s better to have all the Python consistent and keep the charset an unfortunate artefact of the file format rather than have the Python disagree. Maybe just provide both?


Homepage
Welcome to Prism.
00/00/0000 00:00:00
🔎
Programming
GitHub
GitLab
StackOverflow
Community
Discord
Facebook
YouTube


This is a paragraph shown in serif font.
This is a paragraph shown in sans-serif font.
This is a paragraph shown in monospace font.
This is a paragraph shown in cursive font.
This is a paragraph shown in fantasy font.