text
stringlengths 454
608k
| url
stringlengths 17
896
| dump
stringlengths 9
15
⌀ | source
stringclasses 1
value | word_count
int64 101
114k
| flesch_reading_ease
float64 50
104
|
---|---|---|---|---|---|
# Patroni cluster (with Zookeeper) in a docker swarm on a local machine
Intro
-----
There probably is no way one who stores some crucial data (in particular, using SQL databases) can possibly dodge from the thoughts of building some kind of safe cluster, distant guardian to protect consistency and availability at all times. Even if the main server with all the precious data gets knocked out deadly - the show must go on, right? This basically means the database must still be available and data be up-to-date with the one on the failed server.
As you might have noticed, there are dozens of ways to go and Patroni is just one of them. There is plenty of articles providing a more or less detailed comparison of the options available, so I assume I'm free to skip the part of luring you into Patroni's side. Let's start off from the point where among others you are already leaning towards Patroni and are willing to try that out in a more or less real-case setup.
As for myself, I did try a couple of other solutions and in one of them (won't name it) my issue seems to be still hanging open and not answered on their GitHub even though months have passed.
Btw, I am not a DevOps engineer originally so when the need for the high-availability cluster arose and I went on I would hit my bones against the bottom of every single bump and every single post and rock down the road. Hope this tutorial will help you out to get the job done with as little pain as it is possible.
If you don't want any more explanations and lead-ins, jump right in.
Otherwise, you might want to read some more notes on the setup I went on with.
One more Patroni tut, huh?### Do we need one more Patroni tut?
Let's face it, there are quite enough tutorials published on how to set up the Patroni cluster. This one is covering deployment in a docker swarm with Zookeeper as a DCS. So why zookeeper and why docker swarm?
#### Why Zookeeper?
Actually, it's something you might want to consider seriously choosing a Patroni setup for your production.
The thing is that Patroni uses third-party services basically to establish and maintain communication among its nodes, the so-called DCS (Dynamic Configuration Storage).
If you have already studied tutorials on Patroni you probably noticed that the most common case is to implement communication through the 'etcd' cluster.
The notable thing about etcd is here (from its faq page):
```
Since etcd writes data to disk, its performance strongly depends on disk
performance. For this reason, SSD is highly recommended.
```
If you don't have SSD on each machine you are planning to run your etcd cluster, it's probably not a good idea to choose it as a DCS for Patroni. In a real production scenario, it is possible that you simply overwhelm your etcd cluster, which might lead to IO errors. Doesn't sound good, right?
So here comes Zookeeper which stores all its data in memory and might actually come in handy if your servers lack SDDs but have got plenty of RAM.
### Why docker swarm?
In my situation, I had no other choice as it was one of the business requirements to set it up in a docker swarm. So if by circumstances it's your case as well, you're exactly in the right spot!
But for the rest of the readers with the "testing and trying" purposes, it comes across as quite a distant choice too as you don't need to install/prepare any third-party services (except for docker of course) or place on your machine dozens of dependencies.
Guess it's not far from the truth that we all have Docker engine installed and set up everywhere anyway and it's convenient to keep everything in containers. With one-command tuning, docker is good enough to run your first Patroni cluster locally without virtual machines, Kubernetes, and such.
So if you don't want to dig into other tools and want to accomplish everything neat and clean in a well-known docker environment this tutorial could be the right way to go.
Some extra
----------
In this tutorial, I'm also planning to show various ways to check on the cluster stats (to be concrete will cover all 3 of them) and provide a simple script and strategy for a test run.
Suppose it's enough of talking, let's go ahead and start practicing.
Docker swarm
------------
For a quick test of deployment in the docker swarm, we don't really need multiple nodes in our cluster. As we are able to scale our services at our needs (imitating failing nodes), we are going to be fine with just one node working in a swarm mode.
I come from the notion that you already have the Docker engine installed and running. From this point all you need is to run this command:
```
docker swarm init
//now check your single-node cluster
docker node ls
ID HOSTNAME STATUS AVAILABILITY
a9ej2flnv11ka1hencoc1mer2 * floitet Ready Active
```
> The most important feature of the docker swarm is that we are now able to manipulate not just simple containers, but services. Services are basically abstractions on top of containers. Referring to the OOP paradigm, docker service would be a class, storing a set of rules and container would be an object of this class. Rules for services are defined in docker-compose files.
>
>
Notice your node's hostname, we're going to make use of it quite soon.
Well, as a matter of fact, that's pretty much it for the docker swarm setup.
Seem like we're doing fine so far, let's keep up!
Zookeeper
---------
Before we start deploying Patroni services we need to set up DCS first which is Zookeeper in our case. I'm gonna go for the 3.4 version. From my experience, it works just fine.
Below are the full docker-compose config and some notes on details I find that it'd be reasonable to say a few words about.
docker-compose-zookeeper.yml
```
version: '3.7'
services:
zoo1:
image: zookeeper:3.4
hostname: zoo1
ports:
- 2191:2181
networks:
- patroni
environment:
ZOO_MY_ID: 1
ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
deploy:
replicas: 1
placement:
constraints:
- node.hostname == floitet
restart_policy:
condition: any
zoo2:
image: zookeeper:3.4
hostname: zoo2
networks:
- patroni
ports:
- 2192:2181
environment:
ZOO_MY_ID: 2
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=0.0.0.0:2888:3888 server.3=zoo3:2888:3888
deploy:
replicas: 1
placement:
constraints:
- node.hostname == floitet
restart_policy:
condition: any
zoo3:
image: zookeeper:3.4
hostname: zoo3
networks:
- patroni
ports:
- 2193:2181
environment:
ZOO_MY_ID: 3
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=0.0.0.0:2888:3888
deploy:
replicas: 1
placement:
constraints:
- node.hostname == floitet
restart_policy:
condition: any
networks:
patroni:
driver: overlay
attachable: true
```
DetailsThe important thing of course is to give every node its unique service name and published port. The hostname is preferably be set to the same as the service name.
```
zoo1:
image: zookeeper:3.4
hostname: zoo1
ports:
- 2191:2181
```
Notice how we list servers in this line, changing the service we bind depending on the service number. So for the first (zoo1) service server.1 is bound to 0.0.0.0, but for zoo2 it will be the server.2 accordingly.
```
ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
```
This is how we control the deployment among nodes. As we have only one node, we set a constraint to this node for all services. When you have multiple nodes in your docker swarm cluster and want to spread services among all nodes - just replace node.hostname with the name of the desirable node (use 'docker node ls' command).
```
placement:
constraints:
- node.hostname == floitet
```
And the final thing we need to take care of is the network. We're going to deploy Zookeeper and Patroni clusters in one overlay network so that they could communicate with each other in an isolated environment using the service names.
```
networks:
patroni:
driver: overlay
// we need to mark this network as attachable
// so that to be able to connect patroni services to this network later on
attachable: true
```
Guess it's time to deploy the thing!
```
sudo docker stack deploy --compose-file docker-compose-zookeeper.yml patroni
```
Now let's check if the job is done right. The first step to take is this:
```
sudo docker service ls
gxfj9rs3po7z patroni_zoo1 replicated 1/1 zookeeper:3.4 *:2191->2181/tcp
ibp0mevmiflw patroni_zoo2 replicated 1/1 zookeeper:3.4 *:2192->2181/tcp
srucfm8jrt57 patroni_zoo3 replicated 1/1 zookeeper:3.4 *:2193->2181/tcp
```
And the second step is to actually ping the zookeeper service with the special Four-Letter-Command:
```
echo mntr | nc localhost 2191
// with the output being smth like this
zk_version 3.4.14-4c25d480e66aadd371de8bd2fd8da255ac140bcf, built on 03/06/2019 16:18 GMT
zk_avg_latency 6
zk_max_latency 205
zk_min_latency 0
zk_packets_received 1745
zk_packets_sent 1755
zk_num_alive_connections 3
zk_outstanding_requests 0
zk_server_state follower
zk_znode_count 16
zk_watch_count 9
zk_ephemerals_count 4
zk_approximate_data_size 1370
zk_open_file_descriptor_count 34
zk_max_file_descriptor_count 1048576
zk_fsync_threshold_exceed_count 0
```
Which means that the zookeeper node is responding and doing its job. You could also check the zookeeper service logs if you wish
```
docker service logs $zookeeper-service-id
// service-id comes from 'docker service ls' command.
// in my case it could be
docker service logs gxfj9rs3po7z
```
Okay, great! Now we have the Zookeeper cluster running. Thus it's time to move on and finally, get to the Patroni itself.
Patroni
-------
And here we are down to the main part of the tutorial where we handle the Patroni cluster deployment. The first thing I need to mention is that we actually need to build a Patroni image before we move forward. I'll try to be as detailed and precise as possible showing the most important parts we need to be aware of managing this task.
We're going to need multiple files to get the job done so you might want to keep them together. Let's create a 'patroni-test' directory and cd to it. Below we are going to discuss the files that we need to create there.
* **patroni.yml**
This is the main config file. The thing about Patroni is that we are able to set parameters from different places and here is one of them. This file gets copied into our custom docker image and thus updating it requires rebuilding the image. I personally prefer to store here parameters that I see as 'stable', 'permanent'. The ones I'm not planning to change a lot. Below I provide the very basic config. You might want to configure more parameters for a PostgreSQL engine, for example (i.e. max\_connections, etc). But for the test deployment, I think this one should be fine.
patroni.yml
```
scope: patroni
namespace: /service/
bootstrap:
dcs:
ttl: 30
loop_wait: 10
retry_timeout: 10
maximum_lag_on_failover: 1048576
postgresql:
use_pg_rewind: true
postgresql:
use_pg_rewind: true
initdb:
- encoding: UTF8
- data-checksums
pg_hba:
- host replication all all md5
- host all all all md5
zookeeper:
hosts:
- zoo1:2181
- zoo2:2181
- zoo3:2181
postgresql:
data_dir: /data/patroni
bin_dir: /usr/lib/postgresql/11/bin
pgpass: /tmp/pgpass
parameters:
unix_socket_directories: '.'
tags:
nofailover: false
noloadbalance: false
clonefrom: false
nosync: false
```
DetailsWhat we should be aware of is that we need to specify 'bin\_dir' correctly for Patroni to find Postgres binaries. In my use case, I have Postgres 11 so my directory looks like this: '/usr/lib/postgresql/11/bin'. This is the directory Patroni is going to be looking for an inside container. And 'data\_dir' is where the data will be stored inside the container. Later on, we'll bind it to the actual volume on our drive so that not to lose all the data if the Patroni cluster for some reason fails.
```
postgresql:
data_dir: /data/patroni
bin_dir: /usr/lib/postgresql/11/bin
```
I also list all the zookeeper servers here to feed them to patronictl later. Note that, If you don't specify it here we'll end up with a broken patroni command tool (patronictl). Also, I'd like to point out that we don't use IPs to locate zookeeper servers, but we feed Patroni with 'service names' instead. It's a feature of a docker swarm we are taking advantage of.
```
zookeeper:
hosts:
- zoo1:2181
- zoo2:2181
- zoo3:2181
```
* **patroni\_entrypoint.sh**
The next one is where most settings come from in my setup. It's a script that will be executed after the docker container is started.
patroni\_entrypoint.sh
```
#!/bin/sh
readonly CONTAINER_IP=$(hostname --ip-address)
readonly CONTAINER_API_ADDR="${CONTAINER_IP}:${PATRONI_API_CONNECT_PORT}"
readonly CONTAINER_POSTGRE_ADDR="${CONTAINER_IP}:5432"
export PATRONI_NAME="${PATRONI_NAME:-$(hostname)}"
export PATRONI_RESTAPI_CONNECT_ADDRESS="$CONTAINER_API_ADDR"
export PATRONI_RESTAPI_LISTEN="$CONTAINER_API_ADDR"
export PATRONI_POSTGRESQL_CONNECT_ADDRESS="$CONTAINER_POSTGRE_ADDR"
export PATRONI_POSTGRESQL_LISTEN="$CONTAINER_POSTGRE_ADDR"
export PATRONI_REPLICATION_USERNAME="$REPLICATION_NAME"
export PATRONI_REPLICATION_PASSWORD="$REPLICATION_PASS"
export PATRONI_SUPERUSER_USERNAME="$SU_NAME"
export PATRONI_SUPERUSER_PASSWORD="$SU_PASS"
export PATRONI_approle_PASSWORD="$POSTGRES_APP_ROLE_PASS"
export PATRONI_approle_OPTIONS="${PATRONI_admin_OPTIONS:-createdb, createrole}"
exec /usr/local/bin/patroni /etc/patroni.yml
```
Details: Important!Actually, the main point of even having this ***patroni\_entrypoint.sh*** is that Patroni won't simply start without knowing the IP address of its host. And for the host being a docker container we are in a situation where we somehow need to first get to know which IP was granted to the container and only then execute the Patroni start-up command. This indeed crucial task is handled here
```
readonly CONTAINER_IP=$(hostname --ip-address)
readonly CONTAINER_API_ADDR="${CONTAINER_IP}:${PATRONI_API_CONNECT_PORT}"
readonly CONTAINER_POSTGRE_ADDR="${CONTAINER_IP}:5432"
...
export PATRONI_RESTAPI_CONNECT_ADDRESS="$CONTAINER_API_ADDR"
export PATRONI_RESTAPI_LISTEN="$CONTAINER_API_ADDR"
export PATRONI_POSTGRESQL_CONNECT_ADDRESS="$CONTAINER_POSTGRE_ADDR"
```
As you can see, in this script, we take advantage of the 'Environment configuration' available for Patroni. It's another way aside from the patroni.yml config file, where we can set the parameters. 'PATRONI\_*RESTAPI\_*CONNECT*ADDRESS', 'PATRONI\_RESTAPI\_*LISTEN', 'PATRONI\_*POSTGRESQL*CONNECT\_ADDRESS' are those environment variables Patroni knows of and is applying automatically as setup parameters. And btw, they overwrite the ones set locally in patroni.yml
And here is another thing. Patroni docs do not recommend using superuser to connect your apps to the database. So we are going to this another user for connection which can be created with the lines below. It is also set through special env variables Patroni is aware of. Just replace 'approle' with the name you like to create the user with any name of your preference.
```
export PATRONI_approle_PASSWORD="$POSTGRES_APP_ROLE_PASS"
export PATRONI_approle_OPTIONS="${PATRONI_admin_OPTIONS:-createdb, createrole}"
```
And with this last line, where everything is ready for the start we execute Patroni with a link to patroni.yml
```
exec /usr/local/bin/patroni /etc/patroni.yml
```
* **Dockerfile**
As for the Dockerfile I decided to keep it as simple as possible. Let's see what we've got here.
Dockerfile
```
FROM postgres:11
RUN apt-get update -y\
&& apt-get install python3 python3-pip -y\
&& pip3 install --upgrade setuptools\
&& pip3 install psycopg2-binary \
&& pip3 install patroni[zookeeper] \
&& mkdir /data/patroni -p \
&& chown postgres:postgres /data/patroni \
&& chmod 700 /data/patroni
COPY patroni.yml /etc/patroni.yml
COPY patroni_entrypoint.sh ./entrypoint.sh
USER postgres
ENTRYPOINT ["bin/sh", "/entrypoint.sh"]
```
DetailsThe most important thing here is the directory we will be creating inside the container and its owner. Later, when we mount it to a volume on our hard drive, we're gonna need to take care of it the same way we do it here in Dockerfile.
```
// the owner should be 'postgres' and the mode is 700
mkdir /data/patroni -p \
chown postgres:postgres /data/patroni \
chmod 700 /data/patroni
...
// we set active user inside container to postgres
USER postgres
```
The files we created earlier are copied here:
```
COPY patroni.yml /etc/patroni.yml
COPY patroni_entrypoint.sh ./entrypoint.sh
```
And like it was mentioned above at the start we want to execute our entry point script:
```
ENTRYPOINT ["bin/sh", "/entrypoint.sh"]
```
That's it for handling the pre-requisites. Now we can finally build our patroni image. Let's give it a sound name 'patroni-test':
```
docker build -t patroni-test .
```
When the image is ready we can discuss the last but not least file we're gonna need here and it's the compose file, of course.
* **docker-compose-patroni.yml**
A well-configured compose file is something really crucial in this scenario, so let's pinpoint what we should take care of and which details we need to keep in mind.
docker-compose-patroni.yml
```
version: "3.4"
networks:
patroni_patroni:
external: true
services:
patroni1:
image: patroni-test
networks: [ patroni_patroni ]
ports:
- 5441:5432
- 8091:8091
hostname: patroni1
volumes:
- /patroni1:/data/patroni
environment:
PATRONI_API_CONNECT_PORT: 8091
REPLICATION_NAME: replicator
REPLICATION_PASS: replpass
SU_NAME: postgres
SU_PASS: supass
POSTGRES_APP_ROLE_PASS: appass
deploy:
replicas: 1
placement:
constraints: [node.hostname == floitet]
patroni2:
image: patroni-test
networks: [ patroni_patroni ]
ports:
- 5442:5432
- 8092:8091
hostname: patroni2
volumes:
- /patroni2:/data/patroni
environment:
PATRONI_API_CONNECT_PORT: 8091
REPLICATION_NAME: replicator
REPLICATION_PASS: replpass
SU_NAME: postgres
SU_PASS: supass
POSTGRES_APP_ROLE_PASS: appass
deploy:
replicas: 1
placement:
constraints: [node.hostname == floitet]
patroni3:
image: patroni-test
networks: [ patroni_patroni ]
ports:
- 5443:5432
- 8093:8091
hostname: patroni3
volumes:
- /patroni3:/data/patroni
environment:
PATRONI_API_CONNECT_PORT: 8091
REPLICATION_NAME: replicator
REPLICATION_PASS: replpass
SU_NAME: postgres
SU_PASS: supass
POSTGRES_APP_ROLE_PASS: appass
deploy:
replicas: 1
placement:
constraints: [node.hostname == floitet]
```
Details. also important The first detail that pops-up is the network thing we talked about earlier. We want to deploy the Patroni services in the same network as the Zookeeper services. This way 'zoo1', 'zoo2', 'zoo3' names we listed in ***patroni.yml*** providing zookeeper servers are going to work out for us.
```
networks:
patroni_patroni:
external: true
```
As for the ports, we have a database and API and both of them require its pair of ports.
```
ports:
- 5441:5432
- 8091:8091
...
environment:
PATRONI_API_CONNECT_PORT: 8091
// we need to make sure that we set Patroni API connect port
// the same with the one that is set as a target port for docker service
```
Of course, we also need to provide all the rest of the environment variables we kind of promised to provide configuring our entry point script for Patroni, but that's not it. There is an issue with a mount directory we need to take care of.
```
volumes:
- /patroni3:/data/patroni
```
As you can see '/data/patroni' we create in Dockerfile is mounted to a local folder we actually need to create. And not only create but also set the proper use and access mode just like in this example:
```
sudo mkdir /patroni3
sudo chown 999:999 /patroni3
sudo chmod 700 /patroni3
// 999 is the default uid for postgres user
// repeat these steps for each patroni service mount dir
```
With all these steps being done properly we are ready to deploy patroni cluster at last:
```
sudo docker stack deploy --compose-file docker-compose-patroni.yml patroni
```
After the deployment has been finished in the service logs we should see something like this indicating that the cluster is doing well:
```
INFO: Lock owner: patroni3; I am patroni1
INFO: does not have lock
INFO: no action. i am a secondary and i am following a leader
```
But it would be painful if we had no choice but to read through the logs every time we want to check on the cluster health, so let's dig into patronictl. What we need to do is to get the id of the actual container that is running any of the Patroni services:
```
sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a0090ce33a05 patroni-test:latest "bin/sh /entrypoint.…" 3 hours ago Up 3 hours 5432/tcp patroni_patroni1.1.tgjzpjyuip6ge8szz5lsf8kcq
...
```
And simply exec into this container with the following command:
```
sudo docker exec -ti a0090ce33a05 /bin/bash
// inside container
// we need to specify cluster name to list its memebers
// it is 'scope' parameter in patroni.yml ('patroni' in our case)
patronictl list patroni
// and oops
Error: 'Can not find suitable configuration of distributed configuration store\nAvailable implementations: exhibitor, kubernetes, zookeeper'
```
The thing is that patronictl requires patroni.yml to retrieve the info of zookeeper servers. And it doesn't know where did we put our config so we need to explicitly specify its path like so:
```
patronictl -c /etc/patroni.yml list patroni
// and here is the nice output with the current states
+ Cluster: patroni (6893104757524385823) --+----+-----------+
| Member | Host | Role | State | TL | Lag in MB |
+----------+-----------+---------+---------+----+-----------+
| patroni1 | 10.0.1.93 | Replica | running | 8 | 0 |
| patroni2 | 10.0.1.91 | Replica | running | 8 | 0 |
| patroni3 | 10.0.1.92 | Leader | running | 8 | |
+----------+-----------+---------+---------+----+-----------+
```
HA Proxy
--------
Now everything seems to be set the way we wanted and we can easily access PostgreSQL on the leader service and perform operations we are meant to. But there is this last problem we should get rid of and this being: how do we know where is that leader at the runtime? Do we get to check every time and manually switch to another node when the leader crashes? That'd be extremely unpleasant, no doubt. No worries, this is the job for HA Proxy. Just like we did with Patroni we might want to create a separate folder for all the build/deploy files and then create the following files there:
* **haproxy.cfg**
The config file we're gonna need to copy into our custom haproxy image.
haproxy.cfg
```
global
maxconn 100
stats socket /run/haproxy/haproxy.sock
stats timeout 2m # Wait up to 2 minutes for input
defaults
log global
mode tcp
retries 2
timeout client 30m
timeout connect 4s
timeout server 30m
timeout check 5s
listen stats
mode http
bind *:7000
stats enable
stats uri /
listen postgres
bind *:5000
option httpchk
http-check expect status 200
default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions
server patroni1 patroni1:5432 maxconn 100 check port 8091
server patroni2 patroni2:5432 maxconn 100 check port 8091
server patroni3 patroni3:5432 maxconn 100 check port 8091
```
DetailsHere we specify ports we want to access the service from:
```
// one is for stats
listen stats
mode http
bind *:7000
// the second one for connection to postgres
listen postgres
bind *:5000
```
And simply list all the patroni services we have created earlier:
```
server patroni1 patroni1:5432 maxconn 100 check port 8091
server patroni2 patroni2:5432 maxconn 100 check port 8091
server patroni3 patroni3:5432 maxconn 100 check port 8091
```
And the last thing. This line showed below we need if we want to check our Patroni cluster stats from the Haproxy stats tool in the terminal from within a docker container:
```
stats socket /run/haproxy/haproxy.sock
```
* **Dockerfile**
In the Dockerfile it's not much to explain, I guess it's pretty self-explanatory.
Dockerfile
```
FROM haproxy:1.7
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
RUN mkdir /run/haproxy &&\
apt-get update -y &&\
apt-get install -y hatop &&\
apt-get clean
```
* **docker-compose-haproxy.yml**
And the compose file for HaProxy looks this way and it's also quite an easy shot comparing to other services we've already covered:
docker-compose-haproxy.yml
```
version: "3.7"
networks:
patroni_patroni:
external: true
services:
haproxy:
image: haproxy-patroni
networks:
- patroni_patroni
ports:
- 5000:5000
- 7000:7000
hostname: haproxy
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.hostname == floitet]
```
After we have all the files created, let's build the image and deploy it :
```
// build
docker build -t haproxy-patroni
// deploy
docker stack deploy --compose-file docker-compose-haproxy.yml
```
When we got Haproxy up running we can exec into its container and check the Patroni cluster stats from there. It's done with the following commands:
```
sudo docker ps | grep haproxy
sudo docker exec -ti $container_id /bin/bash
hatop -s /var/run/haproxy/haproxy.sock
```
And with this command we'll get the output of this kind:
![](https://habrastorage.org/r/w1560/getpro/habr/upload_files/452/1b0/deb/4521b0deba997c927cbba7586aadbb9c.png)To be honest, I personally prefer to check the status with patronictl but HaProxy is another option which is also nice to have in the administrating toolset. In the very beginning, I promised to show 3 ways to access cluster stats. So the third way of doing it is to use Patroni API directly, which is a cool way as It provides expanded, ample info.
Patroni API
-----------
Full detailed overview of its options you can find in Patroni docs and here I'm gonna quickly show the most common ones I use and how to use 'em in our docker swarm setup.
We won't be able to access any of the Patroni services APIs from outside of the 'patroni\_patroni' network we created to keep all our services together. So what we can do is to build a simple custom curl image to retrieve info in a human-readable format.
Dockerfile
```
FROM alpine:3.10
RUN apk add --no-cache curl jq bash
CMD ["/bin/sh"]
```
And then run a container with this image connected to the 'patroni\_patroni' network.
```
docker run --rm -ti --network=patroni_patroni curl-jq
```
Now we can call Patroni nodes by their names and get stats like so:
Node stats
```
curl -s patroni1:8091/patroni | jq
{
"patroni": {
"scope": "patroni",
"version": "2.0.1"
},
"database_system_identifier": "6893104757524385823",
"postmaster_start_time": "2020-11-15 19:47:33.917 UTC",
"timeline": 10,
"xlog": {
"received_location": 100904544,
"replayed_timestamp": null,
"replayed_location": 100904544,
"paused": false
},
"role": "replica",
"cluster_unlocked": false,
"state": "running",
"server_version": 110009
}
```
Cluster stats
```
curl -s patroni1:8091/cluster | jq
{
"members": [
{
"port": 5432,
"host": "10.0.1.5",
"timeline": 10,
"lag": 0,
"role": "replica",
"name": "patroni1",
"state": "running",
"api_url": "http://10.0.1.5:8091/patroni"
},
{
"port": 5432,
"host": "10.0.1.4",
"timeline": 10,
"role": "leader",
"name": "patroni2",
"state": "running",
"api_url": "http://10.0.1.4:8091/patroni"
},
{
"port": 5432,
"host": "10.0.1.3",
"lag": "unknown",
"role": "replica",
"name": "patroni3",
"state": "running",
"api_url": "http://10.0.1.3:8091/patroni"
}
]
}
```
Pretty much everything we can do with the Patroni cluster can be done through Patroni API, so if you want to get to know better the options available feel free to read official docs on this topic.
PostgreSQL Connection
---------------------
The same thing here: first run a container with the Postgres instance and then from within this container get connected.
```
docker run --rm -ti --network=patroni_patroni postgres:11 /bin/bash
// access to the concrete patroni node
psql --host patroni1 --port 5432 -U approle -d postgres
// access to the leader with haproxy
psql --host haproxy --port 5000 -U approle -d postgres
// user 'approle' doesn't have a default database
// so we need to specify one with the '-d' flag
```
Wrap-up
-------
Now we can experiment with the Patroni cluster as if it was an actual 3-node setup by simply scaling services. In my case when patroni3 happened to be the leader, I can go ahead and do this:
```
docker service scale patroni_patroni3=0
```
This command will disable the Patroni service by killing its only running container. Now I can make sure that failover has happened and the leader role moved to another service:
```
postgres@patroni1:/$ patronictl -c /etc/patroni.yml list patroni
+ Cluster: patroni (6893104757524385823) --+----+-----------+
| Member | Host | Role | State | TL | Lag in MB |
+----------+-----------+---------+---------+----+-----------+
| patroni1 | 10.0.1.93 | Leader | running | 9 | |
| patroni2 | 10.0.1.91 | Replica | running | 9 | 0 |
+----------+-----------+---------+---------+----+-----------+
```
After I scale it back to "1", I'll get my 3-node cluster with patroni3, the former leader, back in shape but in a replica mode.
From this point, you are able to run your experiments with the Patroni cluster and see for yourself how it handles critical situations.
Outroduction
------------
As I promised, I'm going to provide a sample test script and instructions on how to approach it. So if you need something for a quick test-run, you are more than welcomed to read under a spoiler section. If you already have your own test scenarios in mind and don't need any pre-made solutions, just skip it without any worries.
Patroni cluster testSo for the readers who want to put their hands-on testing the Patroni cluster right away with something pre-made, I created [this script](https://pastebin.com/p23sp83L). It's super simple and I believe you won't have problems getting a grasp of it. Basically, it just writes the current time in the database through the haproxy gateway each second. Below I'm going to show step by step how to approach it and what was the outcome from the test-run on my local stand.
* **Step 1.**
Assume you've already downloaded the script from the link and put it somewhere on your machine. If not, do this preparation and follow up. From here we'll move on and create a docker container from an official Microsoft SDK image like so:
```
docker run --rm -ti --network=patroni_patroni -v /home/floitet/Documents/patroni-test-script:/home mcr.microsoft.com/dotnet/sdk /bin/bash
```
The important thing is that we get connected to the 'patroni\_patroni' network. And another crucial detail is that we want to mount this container to a directory where you've put the script. This way you can easily access it from within a container in the '/home' directory.
* **Step2.**
Now we need to take care of getting the only dll we are going to need for our script to compile. Standing in the '/home' directory let's create a new folder for the console app. I'm gonna call it 'patroni-test'. Then cd to this directory and run the following command:
```
dotnet new console
// and the output be like:
Processing post-creation actions...
Running 'dotnet restore' on /home/patroni-test/patroni-test.csproj...
Determining projects to restore...
Restored /home/patroni-test/patroni-test.csproj (in 61 ms).
Restore succeeded.
```
And from here we can add the package we'll be using as a dependency for our script:
```
dotnet add package npgsql
```
And after that simply pack the project:
```
dotnet pack
```
If everything went as expected you'll get 'Ngsql.dll' sitting here:
'patroni-test/bin/Debug/net5.0/Npgsql.dll'.
It is exactly the path we reference in our script so if yours differs from mine, you're gonna need to change it in the script.
And what we do next is just run the script:
```
dotnet fsi /home/patroni-test.fsx
// and get the output like this:
11/18/2020 22:29:32 +00:00
11/18/2020 22:29:33 +00:00
11/18/2020 22:29:34 +00:00
```
> Make sure you keep the terminal with the running script open
>
>
* **Step 3.**
Let's check the Patroni cluster to see where is the leader using patronictl, PatroniAPI, or HaProxy, either way, is fine. In my case the leader status was on 'patroni2':
```
+ Cluster: patroni (6893104757524385823) --+----+-----------+
| Member | Host | Role | State | TL | Lag in MB |
+----------+-----------+---------+---------+----+-----------+
| patroni1 | 10.0.1.18 | Replica | running | 21 | 0 |
| patroni2 | 10.0.1.22 | Leader | running | 21 | |
| patroni3 | 10.0.1.24 | Replica | running | 21 | 0 |
+----------+-----------+---------+---------+----+-----------+
```
So what we need to get done at this point is to open another terminal and fail the leader node:
```
docker service ls | grep patroni
docker service scale $patroni2-id=0
```
After some time in the terminal with the script we'll see logs throwing error:
```
// let's memorize the time we got the last successfull insert
11/18/2020 22:33:06 +00:00
Error
Error
Error
```
If we check the Patroni cluster stats at this time we might see some delay though and patroni2 still indicating a healthy state running as a leader. But after some time it's going to fail and cluster, through a short stage of the leadership elections, will come to the following state:
```
+ Cluster: patroni (6893104757524385823) --+----+-----------+
| Member | Host | Role | State | TL | Lag in MB |
+----------+-----------+---------+---------+----+-----------+
| patroni1 | 10.0.1.18 | Replica | running | 21 | 0 |
| patroni3 | 10.0.1.24 | Leader | running | 21 | |
+----------+-----------+---------+---------+----+-----------+
```
If we go back to our script output we should notice that the connection has finally recovered and the logs are as follows:
```
Error
Error
Error
11/18/2020 22:33:48 +00:00
11/18/2020 22:33:49 +00:00
11/18/2020 22:33:50 +00:00
11/18/2020 22:33:51 +00:00
```
* **Step 4.**
Let's go ahead and check if the database is in a proper state after a failover:
```
docker run --rm -ti --network=patroni_patroni postgres:11 /bin/bash
psql --host haproxy --port 5000 -U approle -d postgres
postgres=> \c patronitestdb
You are now connected to database "patronitestdb" as user "approle".
// I set the time a little earlier than the crash happened
patronitestdb=> select * from records where time > '22:33:04' limit 15;
time
-----------------
22:33:04.171641
22:33:05.205022
22:33:06.231735
// as we can see in my case it required around 42 seconds
// for connection to recover
22:33:48.345111
22:33:49.36756
22:33:50.374771
22:33:51.383118
22:33:52.391474
22:33:53.399774
22:33:54.408107
22:33:55.416225
22:33:56.424595
22:33:57.432954
22:33:58.441262
22:33:59.449541
```
**Summary**
From this little experiment, we can conclude that Patroni managed to serve its purpose. After the failure occurred and the leader was re-elected we managed to reconnect and keep working with the database. And the previous data is all present on the leader node which is what we expected. Maybe it could have switched to another node a little faster than in 42 seconds, but at the end of the day, it's not that critical.
I suppose we should consider our work with this tutorial finished. Hope it helped you figure out the basics of a Patroni cluster setup and hopefully it was useful. Thanks for your attention and let the Patroni guardian keep you and your data safe at all times! | https://habr.com/ru/post/527370/ | null | null | 5,638 | 52.09 |
29 August 2012 11:59 [Source: ICIS news]
SINGAPORE (ICIS)--?xml:namespace>
Jiangsu Sopo made a net profit of CNY7.47m in the same period a year earlier.
The company’s operating loss for the period was down by more than four times at CNY27.2m, according to the statement.
Jiangsu Sopo produced 52,400 tonnes of caustic soda from January to June this year, which represents 44.4% of its yearly target in 2012, down by 3.5% compared with the same period in 2011, according to the statement.
Furthermore, the company invested CNY28.5m in the construction of various projects in the first half of this year. An 80,000 tonne/year ion-exchange membrane caustic soda project cost CNY19.7m and it is 70% completed, according to the statement.
Jiangsu Sopo Chemical Industry Shareholding is a subsidiary of Jiangsu Sopo Group and its main products include caustic soda and bleaching powder.
( | http://www.icis.com/Articles/2012/08/29/9590649/chinas-jiangsu-sopo-swings-to-h1-net-loss-on-weak-demand.html | CC-MAIN-2014-10 | refinedweb | 154 | 68.97 |
The new features, bug fixes and improvements for PHP and the Web, and takes on the latest improvements in IntelliJ Platform.
New code style setting: blank lines before namespace
We’ve added a new code style setting to specify the minimum blank lines before namespace. Now you are able to tune this part according to your preferred code style. The default value is set to 1.
Align assignment now affects shorthand operators
Now the option Settings|Code Style|PHP|Wrapping and Braces|Assignment Statement|Align consecutive assignments takes into account shorthand operators.
“Download from…” option in deployment
On your request, we’ve implemented an option “Download from…” in deployment actions that allows choosing from which server file or folder should be downloaded. Before the introduction of this option, files could be downloaded only from a default deployment server.
New “Copy Type” and “Jump to Type Source” actions from the Debugger Variables View
We’ve added two new actions to Debugger Variables View: Jump to Type Source and Copy Type. Jump to Type Source allows you to navigate directly to the class of the current variable to inspect its code. While Copy Type action copies the type of the variable into the clipboard for later usage in your code or for sending it as a reference to your colleague.
See the full list of bug-fixes and improvements list in our issue tracker and the complete release notes.
Download PhpStorm 2017.1 EAP build 171.2152 for your platform from the project EAP page or click “Update” in your JetBrains Toolbox and please do report any bugs and feature request to our Issue Tracker.
Your JetBrains PhpStorm Team
The Drive to Develop | https://blog.jetbrains.com/phpstorm/2017/01/phpstorm-2017-1-eap-171-2152/ | CC-MAIN-2020-10 | refinedweb | 281 | 61.67 |
Prerequisites
- You must have an Amazon Web Services account ().
- You must have signed up to use the Alexa Site Thumbnail ().
- Assumes python 2.4 or later.
Running the Sample
- Extract the .zip file into a working directory.
- Edit the ThumbnailUtility.py file to include your Access Key ID and Secret Access Key.
- Open up the python interpreter and run the following (or you can include this in some app):
from ThumbnailUtility import *And for a list:
create_thumbnail('kelvinism.com', 'Large')from ThumbnailUtility import *
all_sites = ['kelvinism.com', 'alexa.com', 'amazon.com']
create_thumbnail_list(all_sites, 'Small')
Note: I think most people use Python (for doing web things) in a framework, so this code snippet doesn't include the mechanism of actually displaying the images, it just returns the image location. However, take a look in readme.txt for more examples of actually displaying the images and more advanced usage.
If you need help or run into a stumbling block, don't hesitate contacting me: kelvin [-at-] kelvinism.com | http://aws.amazon.com/code/Python/818 | CC-MAIN-2015-22 | refinedweb | 165 | 60.41 |
[[!img Logo]
[[!format rawhtml """
!html
"""]]:
* [[!format txt """
void good_function(void) {
if (a) { printf("Hello World!\n"); a = 0; } } """]]And this is wrong: [[!format txt """ void bad_function(void) { if (a) { printf("Hello World!\n"); a = 0; } } """]]
- Avoid unnecessary curly braces. Good code:
* [[!format txt """
if (!braces_needed) printf("This is compact and neat.\n"); """]]Bad code: [[!format txt """ if (!braces_needed) { printf("This is superfluous and noisy.\n"); } """]]
- Don't put the return type of a function on a separate line. This is good:
* [[!format txt """
int good_function(void) { } """]]and this is bad: [[!format txt """ int bad_function(void) { } """]]
- On function calls and definitions, don't put an extra space between the function name and the opening parenthesis of the argument list. This good:
- [[!format txt """ double sin(double x); """]]This bad: [[!format txt """:
* [[!format txt """
typedef enum pa_resample_method { / ... / } pa_resample_method_t; """]]
- No C++ comments please! i.e. this is good:
* [[!format txt """
/ This is a good comment / """]]and this is bad: [[!format txt """ //:
* [[!format txt """
void good_code(int a, int b) { pa_assert(a > 47); pa_assert(b != 0);
/ ... / } """]]Bad code: [[!format txt """ void bad_code(int a, int b) { pa_assert(a > 47 && b != 0);
}
"""]]
1. Errors are returned from functions as negative values. Success is returned as 0 or positive value.
1. Check for error codes on every system call, and every external library call. If you you are sure that calls like that cannot return an error, make that clear by wrapping it in
pa_assert_se(). i.e.:
* [[!format txt """
pa_assert_se(close(fd) == 0);
"""]]Please note that
pa_assert_se() is identical to
pa_assert(), except that it is not optimized away if NDEBUG is defined. (
se stands for side effect)
1. Every .c file should have a matching .h file (exceptions allowed)
1. In .c files we include .h files whose definitions we make use of with
#include <>. Header files which we implement are to be included with
#include "".
1. If
#include <> is used the full path to the file relative to
src/ should be used.
1..
1.:
[[!format txt """ A few of us had an IRC conversation about whether or not to localise PulseAudio's log messages. The suggestion/outcome is to add localisation only if all of the following points are fulfilled:
1) The message is of type "warning" or "error". (Debug and info levels are seldom exposed to end users.)
2) The translator is likely to understand the sentence. (Otherwise we'll have a useless translation anyway.)
3) It's at least remotely likely that someone will ever encounter it. (Otherwise we're just wasting translator's time.):
[[!format txt """ )) """]] | http://freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/CodingStyle/?action=SyncPages | CC-MAIN-2013-20 | refinedweb | 424 | 78.14 |
Lexical Dispatch in Python
A recent article on Ikke’s blog shows how to emulate a C switch statement using Python. (I’ve adapted the code slightly for the purposes of this note).
def handle_one(): return 'one' def handle_two(): return 'two' def handle_three(): return 'three' def handle_default(): return 'unknown' cases = dict(one=handle_one, two=handle_two, three=handle_three) for i in 'one', 'two', 'three', 'four': handler = cases.get(i, handle_default) print handler()
Here the
cases dict maps strings to functions and the subsequent switch is a simple matter of looking up and dispatching to the correct function. This is good idiomatic Python code. When run, it outputs:
one two three unknown
Here’s an alternative technique which I’ve sometimes found useful. Rather than build an explicit
cases dict, we can just use one of the dicts lurking behind the scenes — in this case the one supplied by the built-in
globals() function. Leaving the
handle_*() functions as before, we could write:
for i in 'one', 'two', 'three', 'four': handler = globals().get('handle_%s' % i, handle_default) print handler()
Globals() returns us a
dict mapping names in the current scope to their values. Since our handler functions are uniformly named, some string formatting combined with a simple dictionary look-up gets the required function.
A warning: it’s unusual to access objects in the global scope in this way, and in this particular case, the original explicit dictionary dispatch would be better. In other situations though, when the scope narrows to a class or a module, it may well be worth remembering that classes and modules behave rather like dicts which map names to values. The built-in
getattr() function can then be used as a function dispatcher. Here’s a class-based example:
PLAIN, BOLD, LINK, DATE = 'PLAIN BOLD LINK DATE'.split() class Paragraph(object): def __init__(self): self.text_so_far = '' def __str__(self): return self._do_tag(self.text_so_far, 'p') def _do_tag(self, text, tag): return '<%s>%s</%s>' % (tag, text, tag) def do_bold(self, text): return self._do_tag(text, 'b') def do_link(self, text): return '<a href="%s">%s</a>' % (text, text) def do_plain(self, text): return text def append(self, text, markup=PLAIN): handler = getattr(self, 'do_%s' % markup.lower()) self.text_so_far += handler(text) return self
Maybe not the most fully-formed of classes, but I hope you get the idea! Incidentally,
append() returns a reference to
self so clients can chain calls together.
>>> print Paragraph().append("Word Aligned", BOLD ... ).append(" is at " ... ).append("", LINK) <p><b>Word Aligned</b> is at <a href=""></a></p>
By the way, “Lexical Dispatch” isn’t an official term or one I’ve heard before. It’s just a fancy way of saying “call things based on their name” — and the term “call by name” has already been taken | http://wordaligned.org/articles/lexical-dispatch-in-python | CC-MAIN-2015-32 | refinedweb | 466 | 62.58 |
Say I am reading an xml file using SAX Parser : Here is the format of xml file
<BookList> <BookTitle_1> C++ For Dummies </BookTitle_1> <BookAurthor_1> Charles </BookAuthor> <BookISBN_1> ISBN -1023-234 </BookISBN_2> <BookTitle_2> Java For Dummies </Booktitle_2> <BookAuthor_2> Henry </BookAuthor_2> <BookISN_2> ISBN - 231-235 </BookISN_2> </BookList>
And then I have class call Books:
public class Book { private String Name; private String Author; private String ISBN; public void SetName(String Title) { this.Name = Title; } public String getName() { return this.Name; } public void setAuthor(String _author) { this.Author = _author; } public String getAuthor() { }
And then I have an ArrayList class of type Book as such:
public class BookList { private List <Book> books ; BookList(Book _books) { books = = new ArrayList<Book>(); books.add(_books); } }
And lastly I have the main class,
where I parse and read the books from the xml file. Currently when I parse an xml file and say I read the tag <BookTitle_1> I call the SetName() and then call BookList() to create a new arraylist for the new book and add it to the arraylist.
But how can I create a dynamic setters and getters method so that whenever a new book title is read it calls the new setter and getter method to add it to arraylist.
Currently my code over writes the previously stored book and prints that book out. I have heard there is something called reflection. If I should use reflection, please can some one show me an example?
Thank you.
This post has been edited by jon.kiparsky: 28 July 2013 - 04:37 PM
Reason for edit:: Recovered content from closed version of same thread | http://www.dreamincode.net/forums/topic/325810-how-can-i-create-dynamic-setters-and-getters-accessors-and-mutators/page__pid__1880640__st__0 | CC-MAIN-2016-07 | refinedweb | 268 | 66.78 |
Alex Karasulu wrote:
> Hi all,
>
> On Jan 16, 2008 5:26 AM, Emmanuel Lecharny <[email protected]
> <mailto:[email protected]>> wrote:
>
> Hi Alex, PAM,
>
> if we are to go away from JNDI, Option 2 is out of question.
> Anyway, the
> backend role is to store data, which has nothing in common with
> Naming,
> isn't it ?
>
>
> Well if you mean the tables yes you're right it has little to do with
> javax.naming except for one little thing that keeps pissing me off
> which is the fact that normalization is needed by indices to function
> properly. And normalizers generate NamingExceptions. If anyone has
> any idea on how best to deal with this please let me know.
Well, indices should have been normalized *before* being stored, and
this is what we are working on with the new ServerEntry/Attribute/Value
stuff, so your problem will vanish soon ;) (well, not _that_ soon, but ...)
>
>
> and I
> see no reason to depend on NamingException when we have nothing to do
> with LDAP.
>
>
> We still have some residual dependence on LDAP at higher levels like
> when we talk about Index or Partition because of the nature of their
> interfaces. Partitions are still partial to the LDAP namespace or we
> would be screwed. They still need to be tailored to the LDAP
> namespace. There are in my mind 2 layers of abstractions and their
> interfaces which I should probably clarify
>
> Partition Abstraction Layer
> --------------------------------
> o layer between the server and the entry store/search engine
> (eventually we might separate search from stores)
> o interfaces highly dependent on the LDAP namespace
>
> BTree Partition Layer
> -------------------------
> o layer between an abstract partition implementation with concrete
> search engine which uses a concrete search engine based on a two
> column db design backed by BTree (or similar primitive data structures)
> o moderately dependent on the namespace
>
> Note the BTree Partition Layer is where we have interfaces defined
> like Table, and Index. These structures along with Cursors are to be
> used by this default search engine to conduct search. We can then
> swap out btree implementations between in memory, JE and JDBM easily
> without messing with the search algorithm.
This is where things get tricky... But as soon as we can clearly define
the different layers without having some kind of overlap, then we will
be done. The pb with our current impl is that we are mixing the search
engine with the way data are stored. Your 'cursor' implementation will
help a lot solving this problem.
--
--
cordialement, regards,
Emmanuel Lécharny
directory.apache.org | http://mail-archives.apache.org/mod_mbox/directory-dev/200801.mbox/%[email protected]%3E | CC-MAIN-2014-42 | refinedweb | 423 | 59.13 |
A very practical version of an Action Menu Item (AMI) is a variant that will run an application or a script on your local computer. For this to work you need to set up a connection between your browser and the script or application you wish to run. This link is called a custom browser protocol.
You may want to set up a type of link where if a user clicks on it, it will launch the [foo] application. Instead of having ‘http’ as the prefix, you need to designate a custom protocol, such as ‘foo’. Ideally you want a link that looks like:
foo://some/info/here.
The operating system has to be informed how to handle protocols. By default, all of the current operating systems know that ‘http’ should be handled by the default web browser, and ‘mailto’ should be handled by the default mail client. Sometimes when applications are installed, they register with the OS and tell it to launch the applications for a specific protocol.
As an example, if you install RV, the application registers
rvlink:// with the OS and tells it that RV will handle all
rvlink:// protocol requests to show an image or sequence in RV. So when a user clicks on a link that starts with
rvlink://, as you can do in Shotgun, the operating system will know to launch RV with the link and the application will parse the link and know how to handle it.
See the RV User Manual for more information about how RV can act as a protocol handler for URLs and the “rvlink” protocol.
Registering a protocol
Registering a protocol on Windows
On Windows, registering protocol handlers involves modifying the Windows Registry. Here is a generic example of what you want the registry key to look like:
HKEY_CLASSES_ROOT foo (Default) = "URL:foo Protocol" URL Protocol = "" shell open command (Default) = "foo_path" "%1"
The target URL would look like:
foo://host/path...
Note: For more information, please see.
Windows QT/QSetting example
If the application you are developing is written using the QT (or PyQT / PySide) framework, you can leverage the QSetting object to manage the creation of the registry keys for you.
This is what the code looks like to automatically have the application set up the registry keys:
// cmdLine points to the foo path. //Add foo to the Os protocols and set foobar to handle the protocol QSettings fooKey("HKEY_CLASSES_ROOT\\foo", QSettings::NativeFormat); mxKey.setValue(".", "URL:foo Protocol"); mxKey.setValue("URL Protocol", ""); QSettings fooOpenKey("HKEY_CLASSES_ROOT\\foo\\shell\\open\\command", QSettings::NativeFormat); mxOpenKey.setValue(".", cmdLine);
Windows example that starts a Python script via a Shotgun AMI
A lot of AMIs that run locally may opt to start a simple Python script via the Python interpreter. This allows you to run simple scripts or even apps with GUIs (PyQT, PySide or your GUI framework of choice). Let’s look at a practical example that should get you started in this direction.
Step 1: Set up the custom :// protocol to launch the
python interpreter with the first argument being the script
sgTriggerScript.py and the second argument being
%1. It is important to understand that
%1 will be replaced by the URL that was clicked in the browser or the URL of the AMI that was invoked. This will become the first argument to your Python script.
Note: You may need to have full paths to your Python interpreter and your Python script. Please adjust accordingly.
Step 2: Parse the incoming URL in your Python script
In your script you will take the first argument that was provided, the URL, and parse it down to its components in order to understand the context in which the AMI was invoked. We’ve provided some simple scaffolding that shows how to do this in the following code.
Python script
import sys import urlparse import pprint def main(args): # Make sure we have only one arg, the URL if len(args) != 1: return 1 # Parse the URL: protocol, fullPath = args[0].split(":", 1) path, fullArgs = fullPath.split("?", 1) action = path.strip("/") args = fullArgs.split("&") params = urlparse.parse_qs(fullArgs) # This is where you can do something productive based on the params and the # action value in the URL. For now we'll just print out the contents of the # parsed URL. fh = open('output.txt', 'w') fh.write(pprint.pformat((action, params))) fh.close() if __name__ == '__main__': sys.exit(main(sys.argv[1:]))
Step 3: Connect the:// URL which will be redirected to your script via the registered custom protocol.
In the
output.txt file in the same directory as your script you should now see something like this:
('processVersion', {'cols': ['code', 'image', 'entity', 'sg_status_list', 'user', 'description', 'created_at'], 'column_display_names': ['Version Name', 'Thumbnail', 'Link', 'Status', 'Artist', 'Description', 'Date Created'], 'entity_type': ['Version'], 'ids': ['6933,6934,6935'], 'page_id': ['4606'], 'project_id': ['86'], 'project_name': ['Test'], 'referrer_path': ['/detail/HumanUser/24'], 'selected_ids': ['6934'], 'server_hostname': ['patrick.shotgunstudio.com'], 'session_uuid': ['9676a296-7e16-11e7-8758-0242ac110004'], 'sort_column': ['created_at'], 'sort_direction': ['asc'], 'user_id': ['24'], 'user_login': ['shotgun_admin'], 'view': ['Default']})
Possible variants
By varying the keyword after the
// part of the URL in your AMI, you can change the contents of the
action variable in your script, all the while keeping the same
shotgun:// protocol and registering only a single custom protocol. Then, based on the content of the
action variable and the contents of the parameters, your script can understand what the intended behavior should be.
Using this methodology you could open applications, upload content via services like FTP, archive data, send email, or generate PDF reports.
Registering a protocol on OSX
To register a protocol on OSX you need to create a .app bundle that is configured to run your application or script.
Start by writing the following script in the AppleScript Script Editor:
on open location this_URL do shell script "sgTriggerScript.py '" & this_URL & "'" end open location
Pro tip: To ensure you are running Python from a specific shell, such as tcsh, you can change the do shell script for something like the following:
do shell script "tcsh -c \"sgTriggerScript.py '" & this_URL & "'\""
In the Script Editor, save your short script as an “Application Bundle”.
Find the saved Application Bundle, and Open Contents. Then, open the info.plist file and add the following to the plist dict:
<key>CFBundleIdentifier</key> <string>com.mycompany.AppleScript.Shotgun</string> <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>Shotgun</string> <key>CFBundleURLSchemes</key> <array> <string>shotgun</string> </array> </dict> </array>
You may want to change the following three strings:
com.mycompany.AppleScript://, the
.app bundle will respond to it and pass the URL over to your Python script. At this point the same script that was used in the Windows example can be used and all the same possibilities apply.
Registering a protocol on Linux
Use the following code:
gconftool-2 -t string -s /desktop/gnome/url-handlers/foo/command 'foo "%s"' gconftool-2 -s /desktop/gnome/url-handlers/foo/needs_terminal false -t bool gconftool-2 -s /desktop/gnome/url-handlers/foo/enabled true -t bool
Then use the settings from your local GConf file in the global defaults in:
/etc/gconf/gconf.xml.defaults/%gconf-tree.xml
Even though the change is only in the GNOME settings, it also works for KDE. Firefox and GNU IceCat defer to gnome-open regardless of what window manager you are running when it encounters a prefix it doesn’t understand (such as
foo://). So, other browsers, like Konqueror in KDE, won’t work under this scenario.
See for more information on setting up protocol handlers for Action Menu Items in Ubuntu. | https://support.shotgunsoftware.com/hc/en-us/articles/219031308-Launching-Applications-Using-Custom-Browser-Protocols | CC-MAIN-2020-24 | refinedweb | 1,259 | 53.21 |
#include <sys/conf.h> #include <sys/ddi.h> #include <sys/sunddi.h> int ddi_dev_is_sid(dev_info_t *dip);
Solaris DDI specific (Solaris DDI).
A pointer to the device's dev_info structure.
The ddi_dev_is_sid() function tells the caller whether the device described by dip is self-identifying, that is, a device that can unequivocally tell the system that it exists. This is useful for drivers that support both a self-identifying as well as a non-self-identifying variants of a device (and therefore must be probed).
Device is self-identifying.
Device is not self-identifying.
The ddi_dev_is_sid() function can be called from user, interrupt, or kernel context.
1 ... 2 int 3 bz_probe(dev_info_t *dip) 4 { 5 ... 6 if (ddi_dev_is_sid(dip) == DDI_SUCCESS) { 7 /* 8 * This is the self-identifying version (OpenBoot). 9 * No need to probe for it because we know it is there. 10 * The existence of dip && ddi_dev_is_sid() proves this. 11 */ 12 return (DDI_PROBE_DONTCARE); 13 } 14 /* 15 * Not a self-identifying variant of the device. Now we have to 16 * do some work to see whether it is really attached to the 17 * system. 18 */ 19 ...
probe(9E) Writing Device Drivers for Oracle Solaris 11.2 | http://docs.oracle.com/cd/E36784_01/html/E36886/ddi-dev-is-sid-9f.html | CC-MAIN-2016-40 | refinedweb | 195 | 60.41 |
Elvis Chitsungo1,817 Points
Can someone help.
Can someone help
public class Spaceship{ public String shipType; public String getShipType() { return shipType; } public void setShipType(String shipType) { this.shipType = shipType; }
6 Answers
Calin Bogdan14,623 Points
There is a ‘}’ missing at the end of the file, the one that wraps the class up.
Calin Bogdan14,623 Points
One issue would be that shipType property is public instead of being private.
Elvis Chitsungo1,817 Points
U mean changing this ''public void'' to private void.
Elvis Chitsungo1,817 Points
After changing to private in now getting below errors.
./Spaceship.java:9: error: reached end of file while parsing } ^ JavaTester.java:138: error: shipType has private access in Spaceship ship.shipType = "TEST117"; ^ JavaTester.java:140: error: shipType has private access in Spaceship if (!tempReturn.equals(ship.shipType)) { ^ JavaTester.java:203: error: shipType has private access in Spaceship ship.shipType = "TEST117"; ^ JavaTester.java:205: error: shipType has private access in Spaceship if (!ship.shipType.equals("TEST249")) { ^ 5 errors
Calin Bogdan14,623 Points
That's because you have to use ship.getShipType() to get its value and ship.setShipType(type) to set its value. It is recommended to do so to ensure encapsulation and scalability.
Here are some solid reasons for using encapsulation in your code:
- Encapsulation of behaviour.
Elvis Chitsungo1,817 Points
This is now becoming more complicated, i don't know much about java. But with the first one i was only having one error. i am referring to my first post. Let me re-type it again
./Spaceship.java:9: error: reached end of file while parsing } ^ 1 error
Elvis Chitsungo1,817 Points
Calin Bogdan thanks, u have managed to give me the best answer.
Calin Bogdan14,623 Points
Calin Bogdan14,623 Points
This is correct:
The only change you have to make is public String shipType -> private String shipType.
Fields (shipType) have to be private, their accessors (getShipType, setShipType) have to be public. | https://teamtreehouse.com/community/can-someone-help-13 | CC-MAIN-2020-40 | refinedweb | 321 | 60.01 |
evalFunction
This example shows how to evaluate the expression
x+y in Python®. To evaluate an expression, pass a Python
dict value for the
globals namespace parameter.
Read the help for eval.
py.help('eval')
Help on built-in function eval in module builtins:.
Create a Python
dict variable for the
x and
y values.
workspace = py.dict(pyargs('x',1,'y',6))
workspace = Python dict with no properties. {'y': 6.0, 'x': 1.0}
Evaluate the expression.
res = py.eval('x+y',workspace)
res = 7
Add two numbers without assigning variables. Pass an empty
dict value for the
globals parameter.
res = py.eval('1+6',py.dict)
res = Python int with properties: denominator: [1×1 py.int] imag: [1×1 py.int] numerator: [1×1 py.int] real: [1×1 py.int] 7 | https://nl.mathworks.com/help/matlab/matlab_external/call-python-eval-function.html | CC-MAIN-2019-35 | refinedweb | 134 | 63.86 |
Sharepoint foundation 2010 webpart jobs
.. experience
urgent requirement for SharePoint developer who knows the office 365
..,
...speakers are welcomed ! The work can be
I am looking to learn advanced MS access
I am looking for a help with my database with Query / Report /etc"
My Windows Small Business Server 2011 needs a Maintenance/Update. Update Exchange 2010 with SP2 / Check for Errors Update SSL certificates. Check System for Errors.
...useful for website Support the web site for next 3 months after delivery Set up a preliminary project plan in qdPM ( Although this is small project but this would be a foundation for future collaboration ) Setup Matomo and configure the dashboard for web data analytics What is not our purpose or goal of this web site: Ecommerce Blog Product
..
I have MS Access application file(*.accdb). There are many tables on this file. Freelancer should convert these tables into mysql database. Please contact me with writing proper solution on bid text. Thanks.
We need foundation details sketch to be drafted in AutoCAD. The drawing should be done accurately.
Hi, We have hotel system so we need to modify us some forms and reports, our system developed VB.net 2010 and SQL Server 2008.
Zlecenie polega na przepisaniu na nowo kodu JS i CSS w celu
We did an interview with the trevor noah foundation that has been transcribed and needs to be written into a captivating article that attracts the reader and references his autobiography "born a crime" in regard to his mission
Microsoft Access Advanced 2010
.. at the start and end of each month. By start I
I would like to isolate bootstrap v3.3.7 to avoid css conflicts with SharePoint online. New namespace would be 'bootstrap-htech'. and user will see a result according to his answers. For example if user have 40 point from his answers he will get Answer A, if it's more than 60 he will get "Answer B". Please contact me if you can make...
We are a small construction company interested in having someone work with us to set up our SharePoint site, give instruction concerning use, & do some programming for custom functionality. The right person must be an expert in SharePoint design & able to communicate slowly & clearly.
I am trying to find someone that can create a brochure for me. I will need it base of my website which is [login to view URL] Please let me know if you are available to do it. Thank you!
need help on sharepoint small requirement.
I would like to Advanced Microsoft Access 2010/2013 ( report, Query, Search)
Sharepoint expertise... Look for a proposal on Sharepoint applications All default application from Microsoft migration to 2016. One has to list the features and functionalities of each module. Migration steps we plan to do when we migrate from sharepoint 2013 to sharepoint 2016. My price is 50$.
...com/watch?v=YAyc2bYRYP4 Background:
I would like the three documents: 1. 26.02.2015 Meditsiiniseadmed...At this URL: [login to view URL] Converted to Microsoft Excel format - so that they can be opened in Microsoft Excel 2010. Please start your response with the word "Rosebud", so that I know you have read what is required.
...existing emails with the same originator and titles and automatically merge incoming emails as they come in. Requirements and limitation: - Project must work on Outlook 2010 and Outlook 2016. - Must be develop using Yeoman, CANNOT be develop using Visual Studio. - Build as custom Outlook Add-in. - The Add-in allows two modes (can can activated.
Preaching and Teaching self and others. First Prize in Poetry Competition, ManMeet 2010 at IIM-Bangalore Paper presented at Annamalai University, sponsored by UGC, entitled “Innovative Time Management”
For Police Dept. Heavy on the collaboration/social media aspect. Announcements, Calendars, Outlook email (if possible), Workflows, Projects, Tableau Dashboards (already developed, just display), possibly Yammer [login to view URL]
Fiberglass pole calculations and foundation drawings.
...Your server will not need to support any methods beyond GET, although there is extra credit available for supporting other methods. The project template provides the basic foundation of your server in C++ and will allow you to focus more on the technical systems programming aspect of this lab, rather than needing to come up with a maintainable design
I need a developer to recreate the following assessment and build it...[login to view URL] I will provide the text and the maturity model categories and the method for scoring (e.g. 2/5). Must be able to set up foundation so that we can add maturity categories, questions and scores based on answers to those questions.. | https://www.freelancer.com/work/sharepoint-foundation-2010-webpart/ | CC-MAIN-2018-22 | refinedweb | 773 | 64.41 |
Synopsis edit
-
- lassign list varName ?varName ...?
Documentation edit
- official reference
- TIP 57
- proposed making the TclX lassign command a built-in Tcl command
Description editlassign assigns values from a list to the specified variables, and returns the remaining values. For example:
set end [lassign {1 2 3 4 5} a b c]will set $a to 1, $b to 2, $c to 3, and $end to 4 5.In lisp parlance:
set cdr [lassign $mylist car]The k trick is sometimes used with lassign to improve performance by causing the Tcl_Obj hlding $mylist to be unshared so that it can be re-used to hold the return value of lassign:
set cdr [lassign $mylist[set mylist {}] car]If there are more varNames than there are items in the list, the extra varNames are set to the empty string:
% lassign {1 2} a b c % puts $a 1 % puts $b 2 % puts $c %In Tcl prior to 8.5, foreach was used to achieve the functionality of lassign:
foreach {var1 var2 var3} $list break
DKF: The foreach trick was sometimes written as:
foreach {var1 var2 var3} $list {}This was unwise, as it would cause a second iteration (or more) to be done when $list contains more than 3 items (in this case). Putting the break in makes the behaviour predictable.
Example: Perl-ish shift editDKF cleverly points out that lassign makes a Perl-ish shift this easy:
proc shift {} { global argv set argv [lassign $argv v] return $v }On the other hand, Hemang Lavana observes that TclXers already have lvarpop ::argv, an exact synonym for shift.On the third hand, RS would use our old friend K to code like this:
proc shift {} { K [lindex $::argv 0] [set ::argv [lrange $::argv[set ::argv {}] 1 end]] }Lars H: Then I can't resist doing the above without the K:
proc shift {} { lindex $::argv [set ::argv [lrange $::argv[set ::argv {}] 1 end]; expr 0] }
Default Value editFM: here's a quick way to assign with default value, using apply:
proc args {spec list} { apply [list $spec [list foreach {e} $spec { uplevel 2 [list set [lindex $e 0] [set [lindex $e 0]]] }]] {*}$list } set L {} args {{a 0} {b 0} {c 0} args} $LAMG: Clever. Here's my version, which actually uses lassign, plus it matches lassign's value-variable ordering. It uses lcomp for brevity.
proc args {vals args} { set vars [lcomp {$name} for {name default} inside $args] set allvals "\[list [join [lcomp {"\[set [list $e]\]"} for e in $vars]]\]" apply [list $args "uplevel 2 \[list lassign $allvals $vars\]"] {*}$vals }Without lcomp:
proc args {vals args} { lassign "" scr vars foreach varspec $args { append scr " \[set [list [lindex $varspec 0]]\]" lappend vars [lindex $varspec 0] } apply [list $args "uplevel 2 \[list lassign \[list$scr\] $vars\]"] {*}$vals }This code reminds me of the movie "Inception" [1]. It exists, creates itself, and operates at and across multiple levels of interpretation. There's the caller, there's [args], there's [apply], then there's the [uplevel 2] that goes back to the caller. The caller is the waking world, [args] is the dream, [apply] is its dream-within-a-dream, and [uplevel] is its dream-within-a-dream that is used to implant an idea (or variable) into the waking world (the caller). And of course, the caller could itself be a child stack frame, so maybe reality is just another dream! ;^)Or maybe this code is a Matryoshka nesting doll [2] whose innermost doll contains the outside doll. ;^)Okay, now that I've put a cross-cap in reality [3], let me demonstrate how [args] is used:
args {1 2 3} a b c ;# a=1 b=2 c=3 args {1 2} a b {c 3} ;# a=1 b=2 c=3 args {} {a 1} {b 2} {c 3} ;# a=1 b=2 c=3 args {1 2 3 4 5} a b c args ;# a=1 b=2 c=3 args={4 5}FM: to conform to the AMG (and lassign) syntax.
proc args {values args} { apply [list $args [list foreach e $args { uplevel 2 [list set [lindex $e 0] [set [lindex $e 0]]] }]] {*}$values }both versions seem to have the same speed.PYK, 2015-03-06, wonders why lassign decided to mess with variable values that were already set, preventing default values from being set beforehand:
#warning, hypothetical semantics set color green lassign 15 size color set color ;# -> greenAMG: I'm pretty sure this behavior is imported from [foreach] which does the same thing. [foreach] is often used as a substitute for [lassign] on older Tcl.So, what to do when there are more variable names than list elements? I can think of four approaches:
- Set the extras to empty string. This is current [foreach] and [lassign] behavior.
- Leave the extras unmodified. This is PYK's preference.
- Unset the extras if they currently exist. Their existence can be tested later to see if they got a value.
- Throw an error. This is what Brush proposes, but now I may be leaning towards PYK's idea.
Gotcha: Ambiguity List Items that are the Empty String editCMcC 2005-11-14: I may be just exceptionally grumpy this morning, but the behavior of supplying default empty values to extra variables means you can't distinguish between a trailing var with no matching value, and one with a value of the empty string. Needs an option, -greedy or something, to distinguish between the two cases. Oh, and it annoys me that lset is already taken, because lassign doesn't resonate well with set.Kristian Scheibe: I agree with CMcC on both counts - supplying a default empty value when no matching value is provided is bad form; and lset/set would have been better than lassign/set. However, I have a few other tweaks I would suggest, then I'll tie it all together with code to do what I suggest.First, there is a fundamental asymmetry between the set and lassign behaviors: set copies right to left, while lassign goes from left to right. In fact, most computer languages use the idiom of right to left for assignment. However, there are certain advantages to the left to right behavior of lassign (in Tcl). For example, when assigning a list of variables to the contents of args. Using the right to left idiom would require eval.Still, the right-to-left behavior also has its benefits. It allows you to perform computations on the values before performing the assignment. Take, for example, this definition of factorial (borrowed from Tail call optimization):
proc fact0 n { set result 1. while {$n > 1} { set result [expr {$result * $n}] set n [expr {$n - 1}] } return $result }Now, with lassign as currently implemented, we can "improve" this as follows:
proc fact0 n { set result 1. while {$n > 1} { lassign [list [expr {$result * $n}] [expr {$n - 1}]] result n } return $result }I'm hard-pressed to believe that this is better. However, if we changed lassign to be lassign vars args, we can write this as:
proc fact0 n { set result 1. while {$n > 1} { lassign {result n} [expr {$result * $n}] [expr {$n - 1} ] } return $result }To my eye, at least, this is much more readable.So, I suggest that we use two procedures: lassign and lassignr (where "r" stands for "reverse"). lassign would be used for the "standard" behavior: right to left. lassignr would then be used for left to right. This is backwards from the way it is defined above for TclX and Tcl 8.5. Nonetheless, this behavior aligns better with our training and intuition.Also, this provides a couple of other benefits. First, the parallel to set is much more obvious. lassign and set both copy from right to left (of course, we are still left with the asymmetry in their names - I'll get to that later). And, we can now see why assigning an empty string to a variable which doesn't have a value supplied is bad form; this is not what set does! If you enter set a you get the value of $a, you don't assign the empty string to a. lassign should not either. If you want to assign the empty string using set you would enter:
set a {}With lassign, you would do something similar:
lassign {a b c} 1 {}Here, $a gets 1, $b gets the empty string, and $c is not touched. This behavior nicely parallels that of set, except that set returns the new value, and lassign returns the remaining values. So, let's take another step in that direction; we'll have lassign and lassignr return the "used" values instead.But this destroys a nice property of lassign. Can we recover that property? Almost. We can do what proc does; we can use the "args" variable name to indicate a variable that sucks up all the remaining items. So, now we get:
lassign {a b args} 1 2 3 4 5 6$a gets 1, $b gets 2, and args gets 3 4 5 6. Of course, we would make lassignr work similarly:
lassignr {1 2 3 4 5 6} a b argsBut, now that we have one of the nice behaviors of the proc "assignment", what about that other useful feature: default values? We can do that as well. So, if a value is not provided, then the default value is used:
lassign {a {b 2}} one$b gets the value 2. This also provides for the assignment of an empty list to a variable if the value is not provided. So, those who liked that behavior can have their wish as well:
lassign {a {b {}}} oneBut simple defaults are not always adequate. This only provides for constants. If something beyond that is required, then explicit lists are needed. For example:
lassign [list a [list b $defaultb]] oneThis gets to be ugly, so we make one more provision: we allow variable references within the defaults:
lassign {a {b $defaultb}} oneNow, this really begins to provide the simplicity and power that we should expect from a general purpose utility routine. And, it parallels other behaviors within Tcl (proc and set) well so that it feels natural.But we're still left with this lassign/set dichotomy. We can't rename lassign to be lset without potentially breaking someone's code, But notice that lassign now provides features that set does not. So, instead, let's create an assign procedure that provides these same features, but only for a single value:
assign {x 3} 7Sets x to 7. If no value is provided, x will be 3.So, we now have three functions, assign, lassign, and lassignr, that collectively provide useful and powerful features that, used wisely, can make your code more readable and maintainable. You could argue that you only "need" one of these (pick one) - the others are easily constructed from whichever is chosen. However, having all three provides symmetry and flexibility.I have provided the definitions of these functions below. The implementation is less interesting than the simple power these routines provide. I'm certain that many of you can improve these implementations. And, if you don't like my rationale on the naming of lassignr; then you can swap the names. It's easy to change other aspects as well; for example, if you still want lassign to return the unused values, it's relatively easy to modify these routines.
proc assign {var args} { if {[llength $var] > 1} { uplevel set $var } uplevel set [lindex $var 0] $args } proc lassign {vars args} { if { ([lindex $vars end] eq "args") && ([ llength $args] > [llength $vars])} { set last [expr {[llength $vars] - 1}] set args [lreplace $args $last end [lrange $args $last end]] } #This is required so that we can distinguish between the value {} and no #value foreach val $args {lappend vals [list $val]} foreach var $vars val $vals { lappend res [uplevel assign [list $var] $val] } return $res } proc lassignr {vals args} { uplevel lassign [list $args] $vals }slebetman: KS, your proposal seems to illustrate that you don't get the idea of lassign. For several years now I have used my own homegrown proc, unlist, that has the exact same syntax and semantics of lassign. The semantics behind lassign is not like set at all but more like scan where the semantics in most programming languages (at least in C and Python) is indeed assignment from left to right. The general use of a scanning function like lassign is that given an opaque list (one that you did not create) split it into individual variables.If you really understand the semantics lassign was trying to achieve then you wouldn't have proposed your:
lassign vars argsTo achieve the semantics of lassign but with right to left assignment you should have proposed:
lassign vars listOf course, your proposal above can work with Tcl8.5 using {*}:
lassign {var1 var2 var3} {*}$listBut that means for 90% of cases where you would use lassign you will have to also use {*}. Actually Tcl8.4 already has a command which does what lassign is supposed to do but with a syntax that assigns from right to left: foreach. Indeed, my home-grown unlist is simply a wrapper around foreach as demonstrated by sbron above. With 8.4, if you want lassign-like functionality you would do:
foreach {var1 var2 var3} $list {}Kristian Scheibe: slebetman, you're right, I did not get that the semantics of lassign (which is mnemonic for "list assign" should match those of scan and not set (which is a synonym for assign). Most languages refer to the operation of putting a value into a variable as "assignment", and, with only specialized exception, this is done right-to-left. I'm certain that others have made this same mistake; in fact, I count myself in good company, since the authors of the lassign TIP 57
set {x y} [LocateFeature $featureID]or
mset {x y} [LocateFeature $featureID]So, you see, when TIP #57
## Using [scan] set r 80 set g 80 set b 80 scan $rgb #%2x%2x%2x r g b set resultRgb [list $r $g $b] ## Using [regexp] regexp {$#(..)?(..)?(..)?^} $rgb r g b if {! [llength $r]} {set r 80} if {! [llength $g]} {set g 80} if {! [llength $b]} {set b 80} set resultRgb [list $r $g $b]As you can see, the idioms required are different in each case. If, as you're developing code, you start with the scan approach, then decide you need to support something more sophisticated (eg, you want to have decimal, octal, or hex numbers), then you need to remember to change not just the parsing, but the method of assigning defaults as well.This also demonstrates again that providing a default value (eg, {}) when no value is provided really ought to be defined by the application and not the operation. The method of using defaults with scan is more straightforward (and amenable to using lassign or [lscan]) than the method with regexp.The solution that I proposed was to make applying defaults similar to the way that defaults are handled with proc: {var dflt}. In fact, I would go a step farther and suggest that this idiom should be available to all Tcl operations that assign values to variables (including scan and regexp). But, I think that this is unlikely to occur, and is beyond the scope of what I was discussing.The real point of my original posting was to demonstrate the utility, flexibility, power, and readability or using this idiom. I think it's a shame to limit that idiom to proc. The most general application of it is to use it for assignment, which is what I showed.slebetman: I agree with the defaults mechanism. Especially since we're so used to using it in proc. I wish we have it in all commands that assigns values to multiple variables:
lassign $foo {a 0} {b {}} {c none} scan $rgb #%2x%2x%2x {r 80} {g 80} {b 80} regexp {$#(..)?(..)?(..)?^} $rgb {r 80} {g 80} {b 80} foreach {x {y 0} {z 100}} $argv {..}I think such commands should check if the variable it is assigning to is a pair of words of which the second word is the default value. Assigning an empty string have always seemed to me too much like the hackish NULL value trick in C (the number of times I had to restructure apps because the customer insisted that zero is a valid value and should not signify undefined...).The only downside I can think of is that this breaks apps with spaces in variable names. But then again, most of us are used to not writing spaces in variable names and we are used to this syntax in proc.BTW, I also think lassign is a bad name for this operation. It makes much more sense if we instead use the name lassign to mean assign "things" to a list which fits your syntax proposal. My personal preference is still unlist (when we finally get 8.5 I'll be doing an interp alias {} unlist {} lassign). lscan doesn't sound right to me but lsplit sounds just right for splitting a list into individual variables.DKF: The name comes from TclX. Choosing a different name or argument syntax to that very well known piece of code is not worth it; just gratuitous incompatability.
fredderic: I really don't see what all the fuss is about. lassign is fine just the way it is, lset is already taken, anything-scan sounds like it does a heck of a lot more than just assigning words to variables, and the concept of proc-like default values just makes me shudder... Even in the definition of a proc! ;)Something I would like to see, is an lrassign that does the left-to-right thing, and maybe some variant or option to lassign that takes a second list of default values:
lassign-with-defs defaultsList valuesList ?variable ...?where the defaults list would be empty-string-extended to the number of variables given (any extra defaults would simply be ignored), the values list wouldn't (any extra values would be returned as per usual), so you'd end up with:
lassign-with-defs {1 2 3} {a {}} w x y zbeing the equivalent of:
set w a ;# from values list set x {} ;# also from values list set y 3 ;# 3rd default value carried through set z {} ;# empty-string expanded defaults # with both arguments consumed, and empty string is returnedThe old filling-with-empty-strings lassign behaviour would thus be achieved by simply giving it an empty default values list, and the whole thing would be absolutely fabulous. ;)Of course, the catch is that if you simply take away the filling-with-empty-strings behaviour from lassign, then the defaults capability is created by simply doing two lassigns. A little wasteful, perhaps (possibly problematic if variable write traces are involved), but still better than most of the alternatives. (Perhaps a third argument to lrepeat would fulfill the empty-string-filling requirement by accepting an initial list, and repeatedly appending the specified item until the list contains at least count words? I can imagine several occasions where that could be handy.)
Ed Hume: I think the syntax of lassign is not as useful as having the value list and the variable name list being of similar structure:
vset {value1 value2 value3 ...} {name1 name2 name3 ...}I have provided an lset command since Tcl 7.6 in my toolset which was renamed to vset with Tcl 8.4. Having both the names and values as vectors allows you to easily pass both to other procedures without resorting to a variable number of arguments. It is a common idiom to assign each row of table data to a list of column names and work with it:
foreach row $rows { vset $row $cols # now each column name is defined with the data of the table row # ... }A second significant advantage of this syntax is that the structure of the names and the values are not limited to vectors. The vset command is actually a simplified case of the rset command which does a recursive set of nested data structures:
rset {1 2 3} {a b c} # $a is 1, $b is 2, ... rset {{1.1 1.2 1.3} 2 {3.1 3.2}} {{a b c} d {e f}} # $a is 1.1, $b is 1.2, $f is 3.2,....The syntax of vset and rset lend themselves to providing an optional third argument to provide default values in the case where empty values are not desired. So this is a cleaner implementation of frederic's lassign-with-defaults - the defaults values can have the usual empty string default.Now that Tcl has the expansion operator, the difference between lassign and vset is not as important as it was, but I do think vset is a lot more powerful.DKF: Ultimately, we went for the option that we did because that was what TclX used. However, a side-benefit is that it also makes compiling the command to bytecode much easier than it would have been with vset. (Command compilers are rather tricky to write when they need to parse apart arguments.)
Script Implementation editBoth the built-in lassign and the TclX lassign are faster than the scripted implementations presented below.KPV: For those who want to use [lassign] before Tcl 8.5, and without getting TclX, here's a tcl-only version of lassign:
if {[namespace which lassign] eq {}} { proc lassign {values args} { set vlen [llength $values] set alen [llength $args] # Make lists equal length for {set i $vlen} {$i < $alen} {incr i} { lappend values {} } uplevel 1 [list foreach $args $values break] return [lrange $values $alen end] } }jcw: Couldn't resist rewriting in a style I prefer. Chaq'un son gout - a matter of taste - of course:
if {[info procs lassign] eq {}} { proc lassign {values args} { while {[llength $values] < [llength $args]} { lappend values {} } uplevel 1 [list foreach $args $values break] lrange $values [llength $args] end } }KPV: But from an efficiency point of view, you're calling llength way too many times--every iteration through the while loop does two unnecessary calls. How about this version -- your style, but more efficient:
if {[namespace which lassign] eq {}} { proc lassign {values args} { set alen [llength $args] set vlen [llength $values] while {[incr vlen] <= $alen} { lappend values {} } uplevel 1 [list foreach $args $values break] lrange $values $alen end } }jcw interjects: Keith... are you sure llength is slower? (be sure to test inside a proc body)kpv continues: It must be my assembler/C background but I see those function calls, especially the one returning a constant value and wince. But you're correct, calling llength is no slower than accessing a variable. It guess the byte compiler is optimizing out the actual call.DKF: llength is indeed bytecoded.sbron: I see no reason to massage the values list at all. foreach will do exactly the same thing even if the values list is shorter than the args list. I.e. this should be all that's needed:
if {[namespace which lassign] eq {}} { proc lassign {values args} { uplevel 1 [list foreach $args $values break] lrange $values [llength $args] end } }RS: Yup - that's the minimality I like :^)This version does not work as described in the documentation for lassign for this case:
% lassign [list] a b c % set a can't read "a": no such variablesbron: You are right, I just noticed that myself too. Improved version:
if {[namespace which lassign] eq {}} { proc lassign {values args} { uplevel 1 [list foreach $args [linsert $values end {}] break] lrange $values [llength $args] end } }AMG: I prefer to use catch to check for a command's existence. Not only will catch check if the command exists, but it can also check if it supports an ensemble subcommand, an option, or some syntax. Plus it works with interp alias, a clear advantage over info commands.
if {[catch {lassign {}}]} { proc lassign {list args} { uplevel 1 [list foreach $args [concat $list {{}}] break] lrange $list [llength $args] end } }
Open Questions editJMN: tclX doesn't seem to use a separate namespace for its commands so if we do a 'package require tclX' in Tcl 8.5+, which version of a command such as lassign will end up being used?
% lassign wrong # args: should be "lassign list ?varName ...?" % package require Tclx 8.4 % lassign wrong # args: lassign list varname ?varname..?It would seem that Tcl's lassign is replaced with TclX's.AM Most definitely, Tcl is very liberal in that respect. You can replace any procedure or compiled command by your own version. That is one reason you should use namespaces. But I think the origin of TclX predates namespaces. | http://wiki.tcl.tk/1530 | CC-MAIN-2017-22 | refinedweb | 4,128 | 65.76 |
Angular 2 [hidden] is a special case binding to hidden property.
It is closest cousin of ng-show and ng-hide.
It is more powerful to bind any property of elements. Both the ng-show and ng-hide are used to manage the visibility of elements using ng-hide css class. It is also set the display property “display:none”.
Stayed Informed - Angular 2 @Inputs
All the above features are supported in Angular 2 but added some extra feature like animations etc.
Syntax:-
<div [hidden]="!active"> Hello, this is active area! </div>
Note: - Don't use hidden attribute with Angular 2 to show/hide elements.
Question: - Don't use hidden attribute with Angular 2. Here is why?
The hidden attribute is used to hide elements. Browsers are not supposed to display elements that have the hidden attribute specified. Browsers attach "display: none" styles to elements with hidden attribute.
Example,
import { Component } from 'angular2/core'; @Component({ selector: 'demo', templateUrl: 'app/component.html' }) export class MainComponent { Ishide: true; }
<div [hidden]="Ishide"> Hey, I’m using hidden attribute. </div>
Works great but some time its override hidden attribute with some css and that time behave wrong!..
For example,
Be sure to don't have a display css rule on your <p> tags who override hidden behaviour like i.e.
p { display: inline-block !important; }
The above hidden html attributes acts like display: none;
Stayed Informed - Angular 4 vs. Angular 2
I hope you are enjoying with this post! Please share with you friends. Thank you so much!
You Might Also Like | http://www.code-sample.com/2016/04/angular-2-hidden-property.html | CC-MAIN-2017-39 | refinedweb | 258 | 61.33 |
I am trying to write a check to determine whether a number is pentagonal or not. The pentagonal numbers are numbers generated by the formula:
Pn=n(3n−1)/2
1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...
from math import sqrt
def is_pent(n):
ans = any((x*((3*x)-1))/2 == n for x in range(int(sqrt(n))))
return ans
According to Wikipedia, to test whether a positive integer
x is a pentagonal number you can check that
((sqrt(24*x) + 1) + 1)//6 is a natural number. Something like this should work for integers that aren't very big:
from math import sqrt def is_pentagonal(n): k = (sqrt(24*n+1)+1)/6 return k.is_integer() | https://codedump.io/share/LiPUSxmuaq/1/python---is-pentagonal-number-check | CC-MAIN-2016-50 | refinedweb | 121 | 55.27 |
Learn how to get started with image processing on your Raspberry Pi 3!
This guide will get you all set up for Python-based image processing on your Raspberry Pi 3! You can also use this guide with other hardware if you apply some slight tweaks (e.g. pick another architecture when downloading software). You should also be familiar with basic usage of your system's terminal. Let's get started!
sudo apt-get update
sudo apt-get dist-upgrade
sudo raspi-update
Pylon contains all the software we need for interacting with Basler cameras. Builds are provided for multiple platforms.
INSTALLfile. Do not attempt to run the pylon viewer as it is not bundled with ARM releases
Samples/Grabdirectory and execute
make, then run
./Grab, you should see some text scrolling with information about pictures being grabbed
In this step we'll set up Python 3 and the OpenCV image processing library. Just follow the instructions over here.
The only missing part is connecting Python to your camera now. PyPylon takes care of this task.
cvvirtualenv you created while installing OpenCV
python --versionfrom within your virtualenv
..cp34-cp34m-linux_armv7l.whl)
whlfile with pip via
pip3 install *path-to-whl*
pythonand check that running
import pypylon.pylondoes not yield any errors
Done! You can either try out our example projects now or create some cool stuff of your own. Have fun!
Report comment | https://imaginghub.com/projects/100-from-zero-to-image | CC-MAIN-2020-05 | refinedweb | 233 | 66.94 |
explain_lchown_or_die - change ownership of a file and report errors
#include <libexplain/lchown.h> void explain_lchown_or_die(const char *pathname, int owner, int group);
The explain_lchown_or_die function is used to call the lchown(2) system call. On failure an explanation will be printed to stderr, obtained from explain_lchown(3), and then the process terminates by calling exit(EXIT_FAILURE). This function is intended to be used in a fashion similar to the following example: explain_lchown_or_die(pathname, owner, group); pathname The pathname, exactly as to be passed to the lchown(2) system call. owner The owner, exactly as to be passed to the lchown(2) system call. group The group, exactly as to be passed to the lchown(2) system call. Returns: This function only returns on success. On failure, prints an explanation and exits.
lchown(2) change ownership of a file explain_lchown(3) explain lchown(2) errors exit(2) terminate the calling process
libexplain version 0.19 Copyright (C) 2008 Peter Miller explain_lchown_or_die(3) | http://huge-man-linux.net/man3/explain_lchown_or_die.html | CC-MAIN-2017-13 | refinedweb | 161 | 56.76 |
23 May 2012 04:16 [Source: ICIS news]
SINGAPORE (ICIS)--Global road vehicle tyre production will hit about 2bn in 2020, up from around 1.2bn/year currently, spurred by strong demand growth from emerging markets, a senior executive at French tyre maker Michelin said on Tuesday.
The number of tyres produced for trucks and buses will grow to 200m in 2020, up from about 120m currently, said Michel Rollier, managing chairman and managing general partner at the Michelin group.
This increase in tyre production will need to develop in tandem with concerns over environmental protection and sustainability, Rollier said, speaking at the World Rubber Summit 2012 which runs from 22-24 May in ?xml:namespace>
"Changing customer values are making them more aware of their actions and its impact on the environment... this makes them more demanding," he said.
"Sustainability and preservation is not a topic to discuss about, it’s a necessity," Rollier said.
"We have to also keep in mind that 18m tonnes of tires are being discarded each year... we have to believe in recycling... as these can be collected as raw materials," Roll | http://www.icis.com/Articles/2012/05/23/9562520/global-road-vehicle-tyre-output-to-hit-2bn-in-2020.html | CC-MAIN-2014-52 | refinedweb | 188 | 61.56 |
-
=> in def vs. val
hi,
am i the only one who finds it hard to learn and grok the ways to
specify functions (val) with or without types vs. methods (def)? i'm
totally just cargo-cult pattern-match programming when it comes to
this. any pointers to cheat-sheets / exhaustive yet clear and concise
summaries would be appreciated. (yes, i've been trying to grok the
language spec about this as well as googling around.)
thanks.
Re: => in def vs. val
In general, in Java you write
ReturnType myMethodName(ParameterType1 p1, ParameterType2 p2, ...)
whereas in Scala you write
def myMethodName(p1: ParameterType1, p2: ParameterType2, ...): ReturnType
So far so good. The type of the *equivalent function* is
(ParameterType1, ParameterType2, ...) => ReturnType
and if you want to specify a particular function of that type, then you specify the parameter names and give a code block:
(p1: ParameterType1, p2: ParameterType2, ...) => {
/* code */
myReturnValue // Should have type ReturnType
}
Now, you can easily convert a method into a function:
myObject.myMethodName _
So, putting this all together
object UntestedExample {
def isPositive(i: Int): Boolean = (i > 0)
val posTestA: (Int) => Boolean = (i: Int) => { (i > 0) }
val posTestB = (i: Int) => (i>0)
val posTestC = isPositive _
def thresholdFunctionGenerator(i:Int): (Int) => Boolean = {
(j: Int) => (i > j)
}
val posTestD = thresholdFunctionGenerator(0)
val threshFuncFuncA = (i:Int) => { (j: Int) => (j>i) }
val threshFuncFuncB = thresholdFunctionGenerator _
val posTestE = threshFuncFuncA(0)
val posTestF = threshFuncFuncB(0)
}
Here I've defined a method isPositive and six equivalent functions (stored in vals). Hopefully you can follow how each one is being created. (Note that I haven't always used either the most pedantically long or the most concise version possible.)
Now, in addition to the story I've already told, there are three wrinkles.
(1) Methods with multiple parameter lists.
You can write these in Scala:
def multiMethodThreshold(i: Int)(j: Int): Boolean = (j>i)
When you call them, you call them with multiple parameters. However, you can break in at any point and convert the remainder to a function:
val posTestG = multiMethodThreshold(0) _
Or, you can convert the whole thing to a function that returns a function that returns the result:
val threshFuncFuncC: (Int) => ( (Int) => Boolean) = multiMethodThreshold _
(2) Methods and functions with no parameters vs. by-name parameters.
You can write a method that takes a function without any parameters at all:
def check(value: => Int) = (value > 0)
This is called a "by-name parameter", and basically says that instead of passing the actual value, if you pass a variable, it will be passed by reference and looked at every time you call the method (functions of the type () => stuff work too, typically). This construct can be used in very many places, but not everywhere.
Or, you can write a method that takes a function with an empty parameter list:
def check(value: () => Int) = (value() > 0)
Here, you *must* pass a function, and you call it by using (). But otherwise it works a lot like the by-name parameter version, and it can be used everywhere.
(3) Partial functions.
These are most often used where you need a case statement. This is a little beyond the scope of what I want to get into right now, but for now just keep in mind that you can write your very own methods that you use like so:
myObject.myMethod {
case this:ThatType => stuff
case _ => differentStuff
}
by using a PartialFunction[TypeToPassIntoCase,TypeReturnedFromCase]. (The code block above is actually the definition of such a partial function.)
I hope this helps somewhat.
--Rex
On Tue, Jan 26, 2010 at 9:03 PM, Raoul Duke <raould [at] gmail [dot] com> wrote:
Re: => in def vs. val
cf. Rex's long answer, some of which works for me, and malheursement
some of which didn't, at least as far as i understood it, but it all
helped me start to get more of a clue. here's another way i'd answer
what i was wondering about. pretty please offer corrections to my
cluelessness here below.
A. Things To Be Aware Of wrt Your Previous Mental Models.
0) Methods and functions are similar, but of course not exactly the
same beasts in Scala (or, well, most places). You can make one "point
to" an implementation of the other, so you can sorta convert them back
and forth if need be, tho I'm not sure how scopes might come in to
play.
1) Scala's type inference only works for the return type at best. You
must specify argument types.
a) So the type spec might appear to oddly be only "half" vs. if you
are thinking Java or Haskell (since the former has no type inference,
and the latter since it lacks OO has "complete" type inference).
b) One way of specifying functions requires that you also specify the
return type.
2) When defining a method vs. a function, the delimiters used to
separate Name, Arguments, Result, and Body are kinda different. This
might have something to do with needing the syntax to support
anonymous functions (lambdas)? In particular, be aware of how ":"
changes the syntax for a function.
B. Examples, Trying To Work Our Way Up From Simple To More Complex.
def F() = 4
val F = () => 4
val F:()=>Int = () => 4
def F(x:Int) = x
val F = (x:Int) => x
val F:(Int)=>Int = (x) => x
def F(x:Int, y:Int) = x+y
val F = (x:Int, y:Int) => x+y
val F:(Int,Int)=>Int = (x,y) => x+y
val Ff = (x:Int) => x
def Df(x:Int) = Ff(x)
def Df(x:Int) = x
val Ff = (x:Int) => Df(x)
sincerely.
Re: => in def vs. val
On Tue, Jan 26, 2010 at 7:59 PM, Rex Kerr wrote:
> I hope this helps somewhat.
i bet it will be, thank you for the detailed response! i am parsing! | http://www.scala-lang.org/node/5061 | CC-MAIN-2013-20 | refinedweb | 975 | 61.87 |
Class that implements helper functions for the pure virtual PHX::Evaluator class. More...
#include <Phalanx_Evaluator_WithBaseImpl.hpp>
Class that implements helper functions for the pure virtual PHX::Evaluator class.
This class implements code that would essentially be repeated in each Evaluator class, making it quicker for developers to add new evaluators. All field evaluators should inherit from this class if possible instead of the base class so they don't have to code the same boilerplate in all evaluators, but this is not mandatory.
Evaluate all fields that the provider supplies.
Input:
Implements PHX::Evaluator< Traits >.
This routine is called after each residual/Jacobian fill.
This routine is called ONCE on the provider after the fill loop over cells is completed. This allows us to evaluate any post fill data. An example is to print out some statistics such as the maximum grid peclet number in a cell.
Implements PHX::Evaluator< Traits >.
Allows providers to grab pointers to data arrays.
Called once all providers are registered with the manager.
Once the field manager has allocated all data arrays, this method passes the field manager to the providers to allow each provider to grab and store pointers to the field data arrays. Grabbing the data arrays from the varible manager during an actual call to evaluateFields call is too slow due to the map lookup and FieldTag comparison (which uses a string compare). So lookups on field data are only allowed during this setup phase.
Implements PHX::Evaluator< Traits >.
This routine is called before each residual/Jacobian fill.
This routine is called ONCE on the provider before the fill loop over cells is started. This allows us to reset global objects between each fill. An example is to reset a provider that monitors the maximum grid peclet number in a cell. This call would zero out the maximum for a new fill.
Implements PHX::Evaluator< Traits >. | http://trilinos.sandia.gov/packages/docs/r10.4/packages/phalanx/doc/html/classPHX_1_1EvaluatorWithBaseImpl.html | CC-MAIN-2014-35 | refinedweb | 314 | 58.08 |
How Scroll Views Work
Scroll views act as the central coordinator for the Application Kit’s scrolling machinery, managing instances of scrollers, rulers, and clipping views. A scroll view changes the visible portion of the displayed document in response to user-initiated actions or to programmatic requests by the application. This article describes the various components of a scroll view and how the scrolling mechanism works.
Components of a Scroll View
Cocoa provides a suite of classes that allow applications to scroll the contents of a view. Instances of the
NSScrollView class act as the container for the views that work together to provide the scrolling mechanism. Figure 1 shows the possible components of a scroll view.
The Document View
NSScrollView instances provide scrolling services to its document view. This is the only view that an application must provide a scroll view. The document view is responsible for creating and managing the content scrolled by a scroll view.
The Content View
NSScrollView objects enclose the document view within an instance of
NSClipView that is referred to as the content view. The content view is responsible for managing the position of the document view, clipping the document view to the content view's frame, and handling the details of scrolling in an efficient manner. The content view scrolls the document view by altering its bounds rectangle, which determines where the document view’s frame lies. You don't normally interact with the
NSClipView class directly; it is provided primarily as the scrolling machinery for the
NSScrollView class.
Scroll Bars
The
NSScroller class provides controls that allow the user to scroll the contents of the document view. Scroll views can have a horizontal scroller, a vertical scroller, both, or none. If the scroll view is configured with scrollers, the
NSScrollView class automatically creates and manages the appropriate control objects. An application can customize these controls as required. See “How Scrollers Interact with Scroll Views” for more information.
Rulers
Scroll views also support optional horizontal and vertical rulers, instances of the
NSRulerView class or a custom subclass. To allow customization, rulers support accessory views provided by the application. A scroll view's rulers don’t automatically establish a relationship with the document view; it is the responsibility of the application to set the document view as the ruler's client view and to reflect cursor position and other status updates. See Ruler and Paragraph Style Programming Topics for more information.
How Scrolling Works
A scroll view's document view is positioned by the content view, which sets its bounds rectangle in such a way that the document view’s frame moves relative to it. The action sequence between the scrollers and the corresponding scroll view, and the manner in which scrolling is performed, involve a bit more detail than this.
Scrolling typically occurs in response to a user clicking a scroller or dragging the scroll knob, which sends the
NSScrollView instance a private action message telling it to scroll based on the scroller's state. This process is described in “How Scrollers Interact with Scroll Views.” If you plan to implement your own kind of scroller object, you should read that section.
The
NSClipView class provides low-level scrolling support through the
scrollToPoint: method. This method translates the origin of the content view’s bounds rectangle and optimizes redisplay by copying as much of the rendered document view as remains visible, only asking the document view to draw newly exposed regions. This usually improves scrolling performance but may not always be appropriate. You can turn this behavior off using the
NSClipView method
setCopiesOnScroll: passing
NO as the parameter. If you do leave copy-on-scroll active, be sure to scroll the document view programmatically using the
NSView method
scrollPoint: method rather than
translateOriginToPoint:.
Whether the document view scrolls explicitly in response to a user action or an
NSClipView message, or implicitly through a
setFrame: or other such message, the content view monitors it closely. Whenever the document view’s frame or bounds rectangle changes, it informs the enclosing scroll view of the change with a
reflectScrolledClipView: message. This method updates the
NSScroller objects to reflect the position and size of the visible portion of the document view.
How Scrollers Interact with Scroll Views
NSScroller is a public class primarily for developers who decide not to use an instance of
NSScrollView but want to present a consistent user interface. Its use outside of interaction with scroll views is discouraged, except in cases where the porting of an existing application is more straightforward.
Configuring an
NSScroller instance for use with a custom container view class (or a completely different kind of target) involves establishing a target-action relationship as defined by
NSControl. In the case of the scroll view, the target object is the content view. The target object is responsible for implementing the action method to respond to the scroller, and also for updating the scrollers in response to changes in target.
As the scroller tracks the mouse, it sends an action message to its target object, passing itself as the parameter. The target object then determines the direction and scale of the appropriate scrolling action. It does this by sending the scroller a
hitPart message. The
hitPart method returns a part code that indicates where the user clicked in the scroller. Table 1 shows the possible codes returned by the
hitPart method.
The target object tracks the size and position of its document view and updates the scroller to indicate the current position and visible proportion of the document view by sending the appropriate scrollers a
setFloatValue:knobProportion: message, passing the current scroll location. The knob proportion parameter is a floating-point value between 0 and 1 that specifies how large the knob in the scroller should appear.
NSClipView overrides most of the
NSView
setBounds... and
setFrame... methods to perform this updating. | http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/NSScrollViewGuide/Articles/Basics.html | CC-MAIN-2013-20 | refinedweb | 979 | 51.58 |
Middlewares with react context and hooks
Vanderlei Alves da Silva
・4 min read
Continuing the idea explored in the previous article of having a global state management using pure react (with react context and hooks), we’re going to explore now how to take advantage of the middlewares concept, implementing for that a loger and localStorage middleware to our todo app, check here the live demo and here the source code
About middlewares
The term can slightly differ from each depending on the middleware type (Database Middleware, Integration Middleware, Application Middleware, Object Middleware, Remote Procedure Call (RPC) Middleware, Message Oriented Middleware ...) but essentially they have the idea of a composable peace of code running in the middle of to distincts processes improving their communication, and by process we could use more specific terms according to the scenario that we are talking about.
In the web development niche this term is spreedly used in server side technologies such as Laravel, ExpressJS, nestJS among others as:
A composition of functions that are called, in a given order, before the route handler and that usually each one of them have access to the request information and a reference to the next function in this chain
This idea was taken by the front-end fellows, mainly applied by the state management libraries: redux, mobx, vuex (the last even though with a different nomenclature “plugin” the idea is the same), and what they all do is to provide a way of running some code between dispatching an action, and the moment it changes the application state.
Of course this concept can be used in other scenarios, this article explores its usage attached to the router change in angular, getting closer to the above mentioned server-side ones. But for now we’re going to explore the first one.
Show me the code
import { initial, final } from './log'; import localStorage from './localStorage'; export default ({ state, action, handler }) => { const chain = [initial, handler, localStorage, final]; return chain.reduce((st, fn) => fn(st, action), state); };
That’s all what matters, we need a function to create a middleware chain and execute all them in a given order and of course call our handler (the reducer function called by a given action in our application).
const chain = [initial, handler, localStorage, final]
Here we define the middlewares that will be called and in which order they will, the ones that comes before handler are the pre-middlewares (you put here all middlewares that you want to run something before the state have changed) and the others the post-middlewares (the ones that execute something with the new state).
The middleware function signature follows the same pattern of the reducers:
(state, action) => newState
As an example here is the initial log middlewares:
const initial = (state, action) => { console.log(action); console.log(state); return state; };
The middleware just log the initial state (before the state have being change by the reducer) on the console.
Here we have a more interesting one:
import store from 'store2'; export default state => { store.set(state.storeId, state); return state; };
This middleware saves the current state on the local storage, I’m using for this a small library store2 just to make sure retrocompatibility with old browsers and also avoiding working with try catch statements.
I have on the app state an storeId property with the name of the key that will be saved on the local storage, so basically in this call:
store.set(state.storeId, state);
I store in the given key the given state. If you check the app again, play around and refresh the page, the information will still be there.
And lastly we have:
return chain.reduce((st, fn) => fn(st, action), state);
We use the reduce array method to iterate over each item of the chain getting the result of the previous and passing to the next item.
There it is
We have now returned to the basics and explored how the main state management libraries conceptually work with middlewares, giving us the same results with less dependencies and less complexity. We now understand what happens, instead of just blindly using them.
What do we got from it!? A better reasoning of when to use these state libraries.
What do we go from now!? More hooks on the way, check here the new custom hooks from react-router-v5.1 and see you soon. ;)
References
Advice for Developers in the Early Stage of their Career
I have been asked this a couple of times and will love to hear from others too....
| https://practicaldev-herokuapp-com.global.ssl.fastly.net/vanderleisilva/middlewares-with-react-context-and-hooks-2gm1 | CC-MAIN-2019-47 | refinedweb | 760 | 52.43 |
Important: Please read the Qt Code of Conduct -
Clang CodeModel
why clang codemodel still doesn't work in 3.5.x QtC builds?
is it ok because of experimental build or something wrong in a settings?
I mean , unlike of builtin model, clang model doesn't allow to expand available members/fields/namespaces/etc by dot/arrow (ctrl+space doesn't work for this model as well)?
- SGaist Lifetime Qt Champion last edited by
Hi,
If you are having trouble with the clang-code-model, you should check with the Qt Creator folks on the Qt Creator mailing list You'll find there Qt Creator's developers/maintainers (this forum is more user oriented) | https://forum.qt.io/topic/62206/clang-codemodel | CC-MAIN-2021-43 | refinedweb | 114 | 59.84 |
Vahid Mirjalili, Data Mining Researcher
2. Methodology Description
Clustering algorithms has a wide range of applications. Several methods are proposed so far, and each method has drawbacks, for example in k-means clustering the knowledge of number of clusters is crucial, yet it doesn't provide a robust solution to datasets with clusters that have different sizes or densities.
In this article, an implementation of a novel clustering algorithm is provided, and applied to a synthetic dataset that contains multiple topologies. See the reference publication by Alex Rodriguez and Alessandro Laio.
The most important feature of this algorithm is that it can automatically find the number of clusters.
In the following sections, first we provide a clustsred dataset, then illustrate how the algorithm works. At the end, we conclude with comparison of this algorithm with other clustering algorithm such as k-means and DBScan.
A syntethic dataset is provided that can be downloded here. This dataset contains 2000 points of 2 features and a ground truth cluster. The dataset is generated by random normal and uniform numbers. Several noise points were also added. Total if 6 clusters exist.
%load_ext watermark %watermark -a 'Vahid Mirjalili' -d -p scikit-learn,numpy,matplotlib,pyprind,prettytable -v
Vahid Mirjalili 18/10/2014 CPython 2.7.3 IPython 2.0.0 scikit-learn 0.15.2 numpy 1.9.0 matplotlib 1.4.0 pyprind 2.6.1 prettytable 0.7.2
## Implementation of Density Peak Clustering ### Vahid Mirjalili import numpy as np import urllib import csv # download the data #url = '' #content = urllib.urlopen(url) #content = content.read() # save the datafile locally #with open('data/synthetic_data.csv', 'wb') as out: # out.write(content) # read data into numpy array d = np.loadtxt("../data/synthetic_data.csv", delimiter=',') y = d[:,2] print(np.unique(y))
[ 0. 1. 2. 3. 4. 5. 6.]
In this dataset, 0 represents noise points, and others are considered as ground-truth cluster IDs. Next, we visulaize the dataset as below:
from matplotlib import pyplot as plt %matplotlib inline plt.figure(figsize=(10,8)) for clustId,color in zip(range(0,7),('grey', 'blue', 'red', 'green', 'purple', 'orange', 'brown')): plt.scatter(x=d[:,0][d[:,2] == clustId], y=d[:,1][d[:,2] == clustId], color=color, marker='o', alpha=0.6 ) plt.title('Clustered Dataset',()
import pyprind def euclidean_dist(p, q): return (np.sqrt((p[0]-q[0])**2 + (p[1]-q[1])**2)) def cal_density(d, dc=0.1): n = d.shape[0] den_arr = np.zeros(n, dtype=np.int) for i in range(n): for j in range(i+1, n): if euclidean_dist(d[i,:], d[j,:]) < dc: den_arr[i] += 1 den_arr[j] += 1 return (den_arr) den_arr = cal_density(d[:,0:2], 0.5) print(max(den_arr))
579
def cal_minDist2Peaks(d, den): n = d.shape[0] mdist2peaks = np.repeat(999, n) max_pdist = 0 # to store the maximum pairwise distance for i in range(n): mdist_i = mdist2peaks[i] for j in range(i+1, n): dist_ij = euclidean_dist(d[i,0:2], d[j,0:2]) max_pdist = max(max_pdist, dist_ij) if den_arr[i] < den_arr[j]: mdist_i = min(mdist_i, dist_ij) elif den_arr[j] <= den_arr[i]: mdist2peaks[j] = min(mdist2peaks[j], dist_ij) mdist2peaks[i] = mdist_i # Update the value for the point with highest density max_den_points = np.argwhere(mdist2peaks == 999) print(max_den_points) mdist2peaks[max_den_points] = max_pdist return (mdist2peaks)
mdist2peaks = cal_minDist2Peaks(d, den_arr) def plot_decisionGraph(den_arr, mdist2peaks, thresh=None): plt.figure(figsize=(10,8)) if thresh is not None: centroids = np.argwhere((mdist2peaks > thresh) & (den_arr>1)).flatten() noncenter_points = np.argwhere((mdist2peaks < thresh) ) else: centroids = None noncenter_points = np.arange(den_arr.shape[0]) plt.scatter(x=den_arr[noncenter_points], y=mdist2peaks[noncenter_points], color='red', marker='o', alpha=0.5, s=50 ) if thresh is not None: plt.scatter(x=den_arr[centroids], y=mdist2peaks[centroids], color='blue', marker='o', alpha=0.6, s=140 ) plt.title('Decision Graph', size=20) plt.xlabel(r'$\rho$', size=25) plt.ylabel(r'$\delta$', size=25) plt.ylim(ymin=min(mdist2peaks-0.5), ymax=max(mdist2peaks+0.5)) plt.tick_params(axis='both', which='major', labelsize=18) plt.show() plot_decisionGraph(den_arr, mdist2peaks, 1.7)
[[954]]
As shown in the previous plot, cluster centroids stand out since they have larger distances to density peaks. These points are shown in blue, and can be picked easily:
## points with highest density and distance to other high-density points thresh = 1.0 centroids = np.argwhere((mdist2peaks > thresh) & (den_arr>1)).flatten() print(centroids.reshape(1, centroids.shape[0]))
[[ 266 336 482 734 954 1785]]
Further, we show the cluster centroids and non-centroid points together in figure below. The centroids are shown in purple stars. Surprisingly, the algorithm picks one point as centroid from each high-density region. The centroids have large density and large distance to other density-peaks.
%matplotlib inline plt.figure(figsize=(10,8)) d_centers = d[centroids,:] for clustId,color in zip(range(0,7),('grey', 'blue', 'red', 'green', 'purple', 'orange', 'brown')): plt.scatter(x=d[:,0][d[:,2] == clustId], y=d[:,1][d[:,2] == clustId], color='grey', marker='o', alpha=0.4 ) # plot the cluster centroids plt.scatter(x=d_centers[:,0][d_centers[:,2] == clustId], y=d_centers[:,1][d_centers[:,2] == clustId], color='purple', marker='*', s=400, alpha=1.0 ) plt.title('Cluster Centroids', size=20) plt.xlabel('$x_1$', size=25) plt.ylabel('$x_2$', size=25) plt.tick_params(axis='both', which='major', labelsize=18) plt.xlim(xmin=0, xmax=10) plt.ylim(ymin=0, ymax=10) plt.show()
In this figure, cluster centers are shown in dark triangle, and the remaining points are shown in grey, since we don't know their cluster ID yet.
After the cluster centroids are found, the remaining points should be assigned to their corresponding centroid. A naive way is to assign each point simply to the nearest centroid. However, this method is prone to large errors if data has some weird underlying topology.
As a result, the least error prone method is to assign points to the cluster of their nearest neigbour, as given in algorithm below:
Algorithm:
1. Assign centroids to a unique cluster, and remove them from the set
Repeat until all the points are assigned to a cluster:
2. Find the maximum density in the remaining set of points, and remove it from the set
3. Assign it to the same cluster as its nearest neighbor in the set of already assigned points
def assign_cluster(df, den_arr, centroids): """ Assign points to clusters """ nsize = den_arr.shape[0] #print (nsize) cmemb = np.ndarray(shape=(nsize,2), dtype='int') cmemb[:,:] = -1 ncm = 0 for i,cix in enumerate(centroids): cmemb[i,0] = cix # centroid index cmemb[i,1] = i # cluster index ncm += 1 da = np.delete(den_arr, centroids) inxsort = np.argsort(da) for i in range(da.shape[0]-1, -1, -1): ix = inxsort[i] dist = np.repeat(999.9, ncm) for j in range(ncm): dist[j] = euclidean_dist(df[ix], df[cmemb[j,0]]) #print(j, ix, cmemb[j,0], dist[j]) nearest_nieghb = np.argmin(dist) cmemb[ncm,0] = ix cmemb[ncm,1] = cmemb[nearest_nieghb, 1] ncm += 1 return(cmemb)
clust_membership = assign_cluster(d, den_arr, centroids)
plt.figure(figsize=(10,8)) for clustId,color in zip(range(0,6),('blue', 'red', 'green', 'purple', 'orange', 'brown')): cset = clust_membership[clust_membership[:,1] == clustId,0] plt.scatter(x=d[cset,0], y=d[cset,1], color=color, marker='o', alpha=0.6 ) plt.title('Clustered Dataset by Density-Peak Algorithm',()
The new clustering algorithm presented here, is capable of clustering dataset that contain
It is important to note that this method needs minimum number of parameters, which is eps for finding the density of each point. The number of clusters is found by analyzing the density peaks and minimum distances to density peaks. The application of this clustering algorithm is not limited to numeric data types, as it could also be used for text/string data types provided that a proper distance function exist. | http://vahidmirjalili.com/static/articles/densityPeak_clustering.html | CC-MAIN-2017-30 | refinedweb | 1,303 | 52.36 |
Created on 2014-01-14 00:43 by rmsr, last changed 2014-03-01 07:16 by koobs. This issue is now closed.
recvfrom_into fails to check that the supplied buffer object is big enough for the requested read and so will happily write off the end.
I will attach patches for 3.4 and 2.7, I'm not familiar with the backporting procedure to go further but all versions since 2.5 have this bug and while very highly unlikely it's technically remotely exploitable.
Quickie trigger script, crash on interpreter exit:
--------- BEGIN SEGFAULT ---------
import socket
r, w = socket.socketpair()
w.send(b'X' * 1024)
r.recvfrom_into(bytearray(), 1024)
Everything before 2.7 is already out of even security maintenance, so you've already checked off everything it will get fixed in.
New changeset 87673659d8f7 by Benjamin Peterson in branch '2.7':
complain when nbytes > buflen to fix possible buffer overflow (closes #20246)
New changeset 715fd3d8ac93 by Benjamin Peterson in branch '3.1':
complain when nbytes > buflen to fix possible buffer overflow (closes #20246)
New changeset 9c56217e5c79 by Benjamin Peterson in branch '3.2':
complain when nbytes > buflen to fix possible buffer overflow (closes #20246)
New changeset 7f176a45211f by Benjamin Peterson in branch '3.3':
merge 3.2 (#20246)
New changeset ead74e54d68f by Benjamin Peterson in branch 'default':
merge 3.3 (#20246)
New changeset 37ed85008f51 by Benjamin Peterson in branch 'default':
merge 3.3 (#20246)
One test fails on FreeBSD 9.0 and 6.4:
======================================================================
ERROR: testRecvFromIntoSmallBuffer (test.test_socket.BufferIOTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_socket.py", line 259, in _tearDown
raise exc
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_socket.py", line 271, in clientRun
test_func()
File "/usr/home/db3l/buildarea/3.x.bolen-freebsd/build/Lib/test/test_socket.py", line 4690, in _testRecvFromIntoSmallBuffer
self.serv_conn.send(MSG*2048)
BrokenPipeError: [Errno 32] Broken pipe
Perhaps the test is sending an infeasibly large message. If you remove the '*2048' does it pass? (I set up a FreeBSD 9.2 amd64 VM but all tests are passing here).
MSG*1024 passes. I did not look at this issue: Would changing the value to 1024
invalidate the test?
The send part of the test doesn't matter, since what's being tested happens before any reads. The MSG multiplier should be removed completely, since none of the other tests do that.
Patch attached.
New changeset 5c4f4db8107c by Stefan Krah in branch '3.3':
Issue #20246: Fix test failures on FreeBSD. Patch by Ryan Smith-Roberts.
New changeset 9bbc3cc8ff4c by Stefan Krah in branch 'default':
Issue #20246: Fix test failures on FreeBSD. Patch by Ryan Smith-Roberts.
New changeset b6c5a37b221f by Stefan Krah in branch '2.7':
Issue #20246: Fix test failures on FreeBSD. Patch by Ryan Smith-Roberts.
Thanks Ryan. As you say, the original segfault is also triggered with the
shortened message.
I just came across . Now I wonder why this bug was neither reported to PSRT nor get a CVE number. It's a buffer overflow...
I'm going to contact MITRE right away.
Branch status:
Vulnerable (last release prior to patch):
2.7.6
3.1.5
3.2.5
Fixed (latest release post patch):
3.3.4+
3.4
So my reading is that 2.7.7 needs to be brought forward, and source only releases of 3.1.6 and 3.2.6 should be published.
It also sounds like there's a missing trigger that automatically notifies PSRT when someone else classifies a bug as a security bug.
Confirming the fix is in the 3.3.4 tag:
And the 3.4rc1 tag:
This issue has already been assigned CVE-2014-1912
Reference:
We don't currently have the capability to set an email trigger when the type is set to security. That should be submitted as a request on the meta tracker. (It will require a new reactor, which is easy, and a tweak to the database schema, which I don't offhand remember how to deploy, but it shouldn't be hard.)
Is there an ETA for a 2.7.7 release with this fix?
I notified [email protected] and waited for the go-ahead (from Guido I think) before opening this bug. If today is the first that the PSRT is hearing about this, then the issue is broader than just the bugtracker.
Yes, your message reached PSRT on Jan 12th.
Sorry, you are right and I was wrong. :(
Your mail *was* delivered to PSRT. But it failed to reach me because I was having issues with my @python.org account. The server-side spam filter is now deactivated and I receive all mails again.
A recently posted proof of concept exploit got a lot of attention:
I suggest some Python core developer should clarify here whether people running some publically available python based web service
(Zope, Plone, Roundup, MoinMoin, or whatever) are vulnerable or not.
recvfrom_into() is hardly ever used, including in the stdlib itself.
People using third-party software should check that the software itself doesn't call this method (chances are it doesn't).
Antoine Pitrou:
> recvfrom_into() is hardly ever used, including in the stdlib itself.
Thank you for the quick clarification.
This will certainly help to calm down nervous people.
Best regards, Peter.
Can somebody backport the fixes for the test breakages to 3.1 and 3.2 please, it seems they were forgotten.
The original CVE fix includes changes to test_socket.py so I cant imagine security-only-fix policy applies.
Thanks!
New changeset c25e1442529f by Stefan Krah in branch '3.1':
Issue #20246: Fix test failures on FreeBSD. Patch by Ryan Smith-Roberts.
New changeset e82dcd700e8c by Stefan Krah in branch '3.2':
Issue #20246: Fix test failures on FreeBSD. Patch by Ryan Smith-Roberts.
Thank you Stefan | http://bugs.python.org/issue20246 | CC-MAIN-2016-22 | refinedweb | 981 | 69.79 |
Pre-lab
- Get the project 2 starter files using
git pull skeleton master
- Watch the lab 5 video.
Introduction
In this lab, you will get started on project 2. Project 2 is a solo project — no partners. Your work must all be your own. It will be long, arduous, and at times frustrating. However, we hope that you will find it a rewarding experience by the time you are done.
More than any other assignment or in the course, it is extremely important that you begin early. A significant delay in starting this project will leave you most likely unable to finish.
The project 2 spec will be released in beta form 2/17 (Wednesday), and should be effectively complete 2/19 (Friday). However, it will be possible to start the project even before its final release.
Project 2
In this project, you will build a text editor from scratch. It will support a variety of non-trivial features (scroll bars, arrow keys, cursor display, word wrap, saving to files), but you will not be building any of those features in lab today.
In this lab, you'll take a simple example
SingleLetterDisplaySimple.java and use it to build a simple barely-usable text editor with the following features:
- The text appears starting at the top left corner.
- The delete key works properly.
- The enter key works properly.
HelloWorlding
In this project, you will work with a massive library with a very complex API called JavaFX. It will be your greatest ally and most hated foe. While capable of saving you tons of work, understanding of its intricacies will only come through substantial amounts of reading and experimentation. You are likely to go down many blind alleys on this project, and that's fine and fully intentional.
When working with such libraries, there is a practice I call "Hello Worlding." Recall that the very first thing we ever did in Java in this course was write a program that says "Hello World".
public class Hello { public static void main(String[] args) { System.out.println("Hello world!"); } }
Here, the goal was to give us a foundation upon which all else could be built. At the time, there were many pieces that we did not fully understand, and we deferred a full understanding until we were ready. Much like learning sailing, martial arts, swimming, mathematics, or Dance Dance Revolution, we start with some basic actions that we understand in isolation from all else. We might learn a basic throw in Judo, not imagining ourselves in a match, but focused entirely on the action of the throw. Only later will we start trying to use a specific throw in a specific circumstance. This is the nature of abstraction.
Programming is no different. When we are learning new things, we will need to keep our learning environment as simple as possible. Just as you probably should not try to learn a new swimming kick in 10 foot waves, you should learn about the features of a new library using the simplest test programs possible.
However, we musn't go too far: one must still be in the water to truly learn to swim. Practicing the arm movements for the butterfly stroke on dry land may lead to little understanding at all. Finding the right balance between a "too-simple" and "too-complex" experimentation environment is an art that we hope you'll learn during this project.
I call this art HelloWorlding. HelloWorlding is the practice of writing the simplest reasonable module that shows that a new action is even possible.
For example, the SingleLetterDisplaySimple module described in the next section of this lab is about the simplest possible example that shows all of the strange features of JavaFX that we'll need to use to complete this lab.
Likewise, the bare-bones Editor that you'll be building in this lab is itself a HelloWorld — a stepping stone to the glorious editor you'll build by week 8. This is learning to swim in calm seas.
Examples
SingleLetterDisplaySimple
Kay Ousterhout (lead developer on this project) has created a number of example files for you to use to learn the basic actions that you'll need to succeed in using JavaFX.
Try compiling and running
SingleLetterDisplaySimple. Things to try out:
- Typing letters.
- Using the shift key to type capital letters.
- Using the up and down keys to change the font size.
If you get "package does not exist" messages, this means you installed the OpenJDK (an open source alternative to Oracle's implementation of Java). You will need to install Oracle's version of Java (see lab 1b), which will let you use JavaFX.
Once you've had a chance to play around with the demo, it's time to move on to building our editor.
Creating a Crude Editor
Head to your
proj2/editor folder. In this folder, there should be a file called
Editor.java. This is the file that we'll edit today. We'll be adding three new features to our editor:
- Task 1: The ability to show all characters typed so far (instead of just the most recent).
- Task 2: Display of text in the top left corner of the window (instead of in the middle).
- Task 3: The ability to delete characters using the backspace key.
This lab is graded on effort and you'll receive full credit even if you don't complete all 3 of these features by Friday. However, we strongly recommend that you do so if at all possible.
Depending on whether you're using the command line or IntelliJ, follow the directions below.
Command Line
Let's start by making sure you can compile and run the skeleton file. If you're using the command line, head to the editor subfolder of your proj2 directory.
$ cd proj2 $ cd editor $ javac Editor.java
This should compile your Editor. However, because Editor is part of a package, you'll need to run the code from one folder up, and using the full package name:
$ cd .. $ java editor.Editor
This should start up your program, which at the moment, doesn't do anything. Press control-C in order to quit.
IntelliJ
Let's make sure we can compile our file in IntelliJ. Open up the Editor.java file that came as part of the proj2 skeleton. Try to compile the file. Compilation should complete successfully. Don't bother running the file at this point, since it won't display anything.
Task 1: Multiple Characters
Your first goal is to make it so that your Editor is just like SingleLetterDisplaySimple, except that it displays all characters typed so far, as shown in the lab5 video. Copy and paste the relevant parts of SingleLetterDisplaySimple demo over to your Editor.java file. Now modify this code in such a way that your editor shows everything that has been typed so far. Don't worry about the delete/backspace key for now.
This will probably take quite a bit of experimentation!
Hint: You'll need to change the argument of setText.
Recommendation: If at any point you need a list-like data structure, use the java.util.LinkedList class instead of one of your Deque classes from project 1.
Task 2: Top Left
Now modify your code so that the text is displayed not in the center of the screen, but in the top left.
Task 3: Backspace
Now modify your code so that backspace properly removes the most recently typed character. Once you're done with this, you're done with the lab.
Our First Blind Alley
It turns out that the approach we've adopted so far is doomed. See the video explanation or read the text below.
The issue is that there is no easy way that we can support an important later feature of the project: Clicking. This feature is supposed to allow us to click on a certain part of the screen and move the cursor to that postiion. JavaFX can tell us the X and Y coordinates of our mouse click, which seems like it'd be plenty of information to suppose click-to-move-cursor.
However, the problem is that we're deferring all of the work of laying out the text to the setText method. In other words, if our entered text is:
I really enjoy eating delicious potatoes with the sunset laughing at me, every evening.
Our current approach lets the JavaFX figure out how to display all of these letters on the screen. If we clicked on the line right after the word "with", JavaFX would dutifully tell us the X and Y coordinate. However, we'd have no way of figuring out that this is position #48 in the text.
You'll need to come up with an alternate approach. There is a way to do this without using any new JavaFX features. However, it means you're going to need to build a text layout engine. This might be a good next step in the project.
Note: While JavaFX does support allowing you to click on a letter to get the position of this letter, in this example, the place we are clicking is not on a letter, but just on whitespace in the middle of the text.
Running the 61B Style Checker
Remember that all code submitted from this point forward.
Some of these style rules may seem arbitrary (spaces vs. tabs, exact indentation, must end with a newline, etc.). They are! However, it is likely that you'll work with teams in the future that have similarly stringent constraints. Why do they do this? Simply to establish a consistent formatting style among all developers. It is a good idea to learn how to use your tools to conform to formatting styles.
Submission
Submit Editor.java and MagicWord.java. If you're submitting before 10 PM on Wednesday, use the magic word "early". | http://sp16.datastructur.es/materials/lab/lab5/lab5.html | CC-MAIN-2020-50 | refinedweb | 1,655 | 73.17 |
NAME
getnewvnode - get a new vnode
SYNOPSIS
#include <sys/param.h> #include <sys/vnode.h> #include <sys/mount.h> int getnewvnode(const char *tag, struct mount *mp, vop_t **vops, struct vnode **vpp);
DESCRIPTION
The getnewvnode() function initializes a new vnode, assigning it the vnode operations passed in vops. The vnode is either freshly allocated, or taken from the head of the free list depending on the number of vnodes already in the system. The arguments to getnewvnode() are: tag The file system type string. This field should only be referenced for debugging or for userland utilities. mp The mount point to add the new vnode to. vops The vnode operations to assign to the new vnode. vpp Points to the new vnode upon successful completion.
RETURN VALUES
getnewvnode() returns 0 on success. There are currently no failure conditions - that do not result in a panic.
AUTHORS
This manual page was written by Chad David 〈[email protected]〉. | http://manpages.ubuntu.com/manpages/hardy/man9/getnewvnode.9.html | CC-MAIN-2014-41 | refinedweb | 158 | 59.9 |
LightSwitch has always had support for storing pictures in a database through its “Image” business type. However, often it is not feasible to store images in a database, due to size and/or accessibility. In this post I’ll show you how you can leverage Azure blob storage to store images used in your HTML client applications. This is a good architecture particularly if your application is hosted in an Azure Website already. It’s also pretty easy to do.
Setting up Azure Blob Storage
Setting up storage is easy, just follow these directions: Create an Azure Storage account
That article also explains how to access storage programmatically from .NET and how to store settings in your web.config so I encourage you to read through all of it. For the purposes of this post, I’m going to focus on the pieces needed to integrate this into your LightSwitch HTML app.
After you create & name your storage account, click “Manage Access Keys” to grab the access key you will need to supply in your connection string.
Once you have the storage account set up, you can programmatically create containers and save blobs to them from your LightSwitch .NET Server project. Let’s take a look at an example.
Setting up the Data Model
To get this to work elegantly in LightSwitch, we’re going to utilize a couple business types: Image and Web Address. The Image type will only be used to “transport” the bytes into storage for us. We’ll use the Web Address for viewing the image. We can set up the blog container so that we can address blobs directly via a URL as you will see shortly.
For this example, assume a User can have many Pictures. Here’s our data model. Notice the Picture entity has three important properties: Image, ImageUrl, and ImageGuid.
The ImageGuid is used to generate a unique Id that becomes part of the addressable URL of the image in Azure blob storage. It’s necessary so we can find the correct blob. Of course you can come up with your own unique naming, and you can even store them in different containers if you want.
Creating the Screens
When you create your screens, make sure that the ImageUrl is being used to display the picture and not the Image property. A Web Address business type also allows you to choose a Image control to display it. For instance, I’ll create a Common Screen Set for my User table and include Pictures.
Then open up the ViewUser screen and on the Pictures tab, remove the Image and instead display the ImageUrl as an Image control.
Then add a tap action on the Tile List to viewSelected on the Picture. Choose a new screen, Select View Details Screen and select Picture as the screen data. On this screen, you can display the picture as actual size using the same technique as above, but setting the ImageUrl image control to “Fit to Content” in the appearance section of the properties window. You can also set the Label position to “None”.
Finally, we’ll want to allow adding and editing pictures. On the ViewUser screen, add a button to the Command Bar and set the Tap action to addAndEditNew for the Picture. Create a new screen, add a new Add Edit Details screen and set the screen data to Picture. On the View Picture screen, add a button and set the Tap action to edit for the Picture and use the same Add Edit Picture Screen.
Custom JavaScript Control for Uploading Files
Now that our screens are in place and are displaying the ImageUrl how we like, it’s time to incorporate a custom JavaScript control for uploading the files. This utilizes the Image property which is storing the bytes for us on the client side. I’ll show you in a minute how we can intercept this on the Server tier and send it to Azure storage instead of the database, but first we need a control to get the bytes from our users.
Luckily, you don’t have to write this yourself. There’s a control that the LightSwitch team wrote a wile back that will work swimmingly with modern browsers as well as older ones that don’t support the HTML5 method of reading files. It’s part of a tutorial, but you can access the files directly and copy the code you need.
image-uploader.js
image-uploader-base64-encoder.aspx
Put them in your HTMLClient\Scripts folder. Then add a reference to the JavaScript in your default.htm file.
<script type="text/javascript" src="Scripts/image-uploader.js"></script>
Finally, add the custom control to the Add Edit Picture screen. This time, make sure you use the Image property, not ImageUrl. We will be setting the bytes of this property using the image-uploader control.
While the custom control is selected, drop down the “Write Code” button from the top of screen designer and set the code in the _render method like so:
myapp.AddEditPicture.Image_render = function (element, contentItem) { // Write code here. createImageUploader(element, contentItem, "max-width: 300px; max-height: 300px"); };
Now for the fun part. Saving to Azure blob storage from your LightSwitch Server tier.
Saving to Blob Storage from the LightSwitch Update Pipeline
That’s all we have to do with the client – now it’s time for some server coding in .NET. First, we’ll need some references to the Azure storage client libraries for .NET. You can grab these from NuGet. Right-click on your Server project and select “Manage NuGet Packages”. Install the Windows.Azure.Storage 3.1 package.
Now the trick is to intercept the data going through the LightSwitch update pipeline, taking the Image data and saving it to storage and then setting the Image data to null. From there, LightSwitch takes care of sending the rest of the data to the database.
Open the Data Designer to the Picture entity and drop down the Write Code button in order to override a couple methods “Picture_Inserting” and “Picture_Updating” on the ApplicationDataService class. (We could also support Delete, but I’ll leave that as an exercise for the reader – or a follow up post :-)).
On insert, first we need to create a new Guid and use that in the URL. Then we can save to storage. On update, we’re just checking if the value has changed before saving to storage.
VB:
Private Sub Pictures_Inserting(entity As Picture) 'This guid becomes the name of the blob (image) in storage Dim guid = System.Guid.NewGuid.ToString() entity.ImageGuid = guid 'We use this to display the image in our app. entity.ImageUrl = BlobContainerURL + guid 'Save actual picture to blob storage SaveImageToBlob(entity) End Sub Private Sub Pictures_Updating(entity As Picture) 'Save actual picture to blob storage only if it's changed Dim prop As Microsoft.LightSwitch.Details.IEntityStorageProperty =
entity.Details.Properties("Image")
If Not Object.Equals(prop.Value, prop.OriginalValue) Then SaveImageToBlob(entity) End If End Sub
C#:
partial void Pictures_Inserting(Picture entity) { //This guid becomes the name of the blob (image) in storage string guid = System.Guid.NewGuid().ToString(); entity.ImageGuid = guid; //We use this to display the image in our app. entity.ImageUrl = BlobContainerURL + guid; //Save actual picture to blob storage SaveImageToBlob(entity); } partial void Pictures_Updating(Picture entity) { //Save actual picture to blob storage only if it's changed Microsoft.LightSwitch.Details.IEntityStorageProperty prop = (Microsoft.LightSwitch.Details.IEntityStorageProperty)entity.Details.Properties["Image"]; if(!Object.Equals(prop.Value, prop.OriginalValue)){ SaveImageToBlob(entity); } }
Working with Azure Blob Storage
The article I referenced above walks you through working with blob storage but here’s the basics of how we can create a new container if it doesn’t exist, and save the bytes. First, include the Azure storage references at the top of the ApplicationDataService file.
VB:
Imports Microsoft.WindowsAzure.Storage Imports Microsoft.WindowsAzure.Storage.Blob
C#:
using Microsoft.WindowsAzure.Storage; using Microsoft.WindowsAzure.Storage.Blob;
Next, get the connection string, the container name, and the base URL to the container. You can read these from your web.config, but for this example I am just hardcoding them in some constants on the ApplicationDataService class.
VB:
'TODO put in configuration file Const BlobConnStr = "DefaultEndpointsProtocol=https;AccountName=mystorage;AccountKey=*****" Const BlobContainerName = "pics" Const BlobContainerURL =
C#:
const string BlobConnStr = "DefaultEndpointsProtocol=https;AccountName=mystorage;AccountKey=****"; const string BlobContainerName = "pics"; const string BlobContainerURL = "";
Next create a static constructor to check if the container exists and if not, create it. It will also set the container’s blobs so they are publically accessible via direct URLs. This will only run once when the web application is first started (or restarted).
VB:
Shared Sub New() 'Get our blob storage account Dim storageAccount As CloudStorageAccount = CloudStorageAccount.Parse(BlobConnStr) 'Create the blob client. Dim blobClient As CloudBlobClient = storageAccount.CreateCloudBlobClient() 'Retrieve reference to blob container. Create if it doesn't exist. Dim blobContainer = blobClient.GetContainerReference(BlobContainerName) If Not blobContainer.Exists Then blobContainer.Create() 'Set public access to the blobs in the container so we can use the picture
' URLs in the HTML client. blobContainer.SetPermissions(New BlobContainerPermissions With {.PublicAccess = BlobContainerPublicAccessType.Blob}) End If End Sub
C#:
static ApplicationDataService() { //Get our blob storage account CloudStorageAccount storageAccount = CloudStorageAccount.Parse(BlobConnStr); //Create the blob client. CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); //Retrieve reference to blob container. Create if it doesn't exist. CloudBlobContainer blobContainer = blobClient.GetContainerReference(BlobContainerName); if(!blobContainer.Exists()) { blobContainer.Create(); //Set public access to the blobs in the container so we can use the picture
// URLs in the HTML client. blobContainer.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob }); } }
Now that we have created the container on our storage account, the saving is pretty easy. Notice the “trick” here. After we save the image to storage, set the Image property to null so that it isn’t saved into the database.
VB:
Private Sub SaveImageToBlob(p As Picture) Dim blobContainer = GetBlobContainer() 'Get reference to the picture blob or create if not exists. Dim blockBlob As CloudBlockBlob = blobContainer.GetBlockBlobReference(p.ImageGuid) 'Save to storage blockBlob.UploadFromByteArray(p.Image, 0, p.Image.Length) 'Now that it's saved to storage, set the Image database property null p.Image = Nothing End Sub Private Function GetBlobContainer() As CloudBlobContainer 'Get our blob storage account Dim storageAccount As CloudStorageAccount = CloudStorageAccount.Parse(BlobConnStr) 'Create the blob client Dim blobClient As CloudBlobClient = storageAccount.CreateCloudBlobClient() 'Retrieve reference to a previously created container. Return blobClient.GetContainerReference(BlobContainerName) End Function
C#:
private void SaveImageToBlob(Picture p) { CloudBlobContainer blobContainer = GetBlobContainer(); //Get reference to the picture blob or create if not exists. CloudBlockBlob blockBlob = blobContainer.GetBlockBlobReference(p.ImageGuid); //Save to storage blockBlob.UploadFromByteArray(p.Image, 0, p.Image.Length); //Now that it's saved to storage, set the Image database property null p.Image = null; } private CloudBlobContainer GetBlobContainer() { //Get our blob storage account CloudStorageAccount storageAccount = CloudStorageAccount.Parse(BlobConnStr); //Create the blob client CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); //Retrieve reference to a previously created container. return blobClient.GetContainerReference(BlobContainerName); }
That’s all here is to it. Run the application and upload a picture.
Then go back to your Azure Management Portal and inspect your storage account. You will see the pictures in the storage container. And if you check your database, the Image will be null.
Desktop Client Considerations: Reading from Blob Storage from the LightSwitch Query Pipeline
If you want this to work with the Desktop (Silverlight) client, you’ll need to retrieve the Image bytes from storage into the Image property directly. This is because the built-in LightSwitch control for this client works with bytes, not URLs. You can use the same code to save the images above, but you’ll also need to read from blob storage anytime a Picture entity is queried from the database by tapping into the query pipeline. Here’s some code you can use in the same ApplicationDataService class.
VB:
Private Sub Query_Executed(queryDescriptor As QueryExecutedDescriptor) 'This would be necessary if using the Silverlight client. If queryDescriptor.SourceElementType.Name = "Picture" Then For Each p As Picture In queryDescriptor.Results ReadImageFromBlob(p) Next End If End Sub Private Sub ReadImageFromBlob(p As Picture) 'Retrieve reference to the picture blob named after it's Guid. If p.ImageGuid IsNot Nothing Then Dim blobContainer = GetBlobContainer() Dim blockBlob As CloudBlockBlob = blobContainer.GetBlockBlobReference(p.ImageGuid) If blockBlob.Exists Then Dim buffer(blockBlob.StreamWriteSizeInBytes - 1) As Byte blockBlob.DownloadToByteArray(buffer, 0) p.Image = buffer End If End If End Sub
C#:
partial void Query_Executed(QueryExecutedDescriptor queryDescriptor) { //This would be necessary if using the Silverlight client. if(queryDescriptor.SourceElementType.Name == "Picture") { foreach (Picture p in (IEnumerable<Picture>)queryDescriptor.Results) { ReadImageFromBlob(p); } } } private void ReadImageFromBlob(Picture p) { //Retrieve reference to the picture blob named after it's Guid. if (p.ImageGuid != null) { CloudBlobContainer blobContainer = GetBlobContainer(); CloudBlockBlob blockBlob = blobContainer.GetBlockBlobReference(p.ImageGuid); if (blockBlob.Exists()) { byte[] buffer = new byte[blockBlob.StreamWriteSizeInBytes - 1]; blockBlob.DownloadToByteArray(buffer, 0); p.Image = buffer; } } }
Wrap Up
Working with Azure Blob Storage is really easy. Have fun adapting this code to suit your needs, making it more robust with error logging, etc. I encourage you to play with storing other types of data as well. It makes a lot of sense to utilize Azure blob storage, particularly if your LightSwitch app is already being hosted in Azure.
Enjoy!
Join the conversationAdd Comment
Hi Beth
Nice Post. But instead of using Public access permission for blobs, Is it possible to view the images on demand by using the blob Shared Access Signature.
I think public blobs access may be a security leak for the application.
Regards
@babloo1436 – The client in this case is the .NET server so it's probably easier to just use the AccessKey and read the images from storage via the middle-tier query interceptor.
FWIW though, that's why I just made the blobs themselves public and not the container. Trying to guess at GUIDs is pretty tough so this solution may suit some situations just fine and it avoids the read in the middle-tier.
Hi Beth
Really nice. Would you look at returning the selected file URL and Type as well. I can see its in the Data at the end as 'type=' but no source URL?
I have successfully used this to download any file Type to the local Db as well and its AWESOME. .xlsx .docx .pdf and I need Type to unpack it from there.
In fact I would have thought this to be a tutorial for any file which is what we need in this great product Lightswitch HTML.
I need to customize the UI of my app, is there any guide that give more than just changing font or background colors? I'm seriously considering using LS as a BackEnd solution and Bootstrap as a FrontEnd… I don't know why I can't have other Libraries instead of JQuery Mobile… it just does not work for me since I use the Silverlight UI for my App…. JQuery Mobile is just too big for my forms…
Thanks Beth for sharing.. hope you can read and comment my sugestion.
[email protected], [email protected]
Hi Beth,
This is how we can upload the image in the blob. If I want to upload any other format of file like .pdf, .txt then what should we have to change in this code?
Thanks.
I would like to retain the original file name and extension as a field in the database. How can you pass that from the file uploader to the database? I'm sure there is a way but I'm just not seeing it clearly.
Hi,
I have my LS desktop application already hosted in Azure but I need to save two files to a Blob storage (.xml (Stringbuilder) and .jpg (binary field)) when the users execute a private sub button for use these files from an external application. Is any way to do that from the client?
Hi Beth
Nice – I'm using the idea for all sorts of files in Silverlight Client but as size increase, update time is increasing as well.
How can I change the code so I only execute ReadImageFromBlob on the selected item instead of the complete table (Query_executed)?
Kind regards
I already have the images stored in Azure blob. I need to Display images in Datagrid row from Azure storage. Images name stored in Database. I am using LightSwitch Desktop application with Visual Studio 2013. Could you please guide how to show the images into Grid column.
Thanks Bath, Nice article.
Now I am able to show the image inside DataGrid of Desktop Application. Can you guide me how to open the large image on click of small image on Grid Column.
Hi, Beth
on Pictures_Updating Orignanl value is null for Image. Can you give me the idea
Hello All,
Nice post Champion,
I can see some of the comment has said they can use this to the LightSwitch desktop client, but i am not able to figure out how i can use this in desktop client.
So Can Beth/Anyone else can show me a step by step configuration to add different type of files to blob and download the file to browser or client machine on button click.?
Kindly reply to this comment.
Thank you.
Regards,
Nirav
Beth, thank you much!
I'm confused on where to place the static constructor. If we have the Solution Explorer open, which file to we open and place that code? I understand where to put the Pictures_Inserting and Pictures_Updating code, but I'm a little lost after that.
Hi,
It worked but just save buttom doesnt work .is a part code need for fix it?
thx | https://blogs.msdn.microsoft.com/bethmassi/2014/05/01/storing-images-in-azure-blob-storage-in-a-lightswitch-application/ | CC-MAIN-2016-30 | refinedweb | 2,942 | 57.47 |
This example shows how to generate code that exchanges data with external, existing code. Construct and configure a model to match data types with the external code and to avoid duplicating type definitions and memory allocation (definition of global variables). Then, compile the generated code together with the external code into a single application.
Create the file
ex_cc_algorithm.c in your
current folder.
#include "ex_cc_algorithm.h" inSigs_T inSigs; float_32 my_alg(void) { if (inSigs.err == TMP_HI) { return 27.5; } else if (inSigs.err == TMP_LO) { return inSigs.sig1 * calPrms.cal3; } else { return inSigs.sig2 * calPrms.cal3; } }
The C code defines a global structure variable named
inSigs. The code also
defines a function,
my_alg, that uses
inSigs
and another structure variable named
calPrms.
Create the file
ex_cc_algorithm.h in your
current folder.
#ifndef ex_cc_algorithm_h #define ex_cc_algorithm_h typedef float float_32; typedef enum { TMP_HI = 0, TMP_LO, NORM, } err_T; typedef struct inSigs_tag { err_T err; float_32 sig1; float_32 sig2; } inSigs_T; typedef struct calPrms_tag { float_32 cal1; float_32 cal2; float_32 cal3; } calPrms_T; extern calPrms_T calPrms; extern inSigs_T inSigs; float_32 my_alg(void); #endif
The file defines
float_32 as an alias of the C data type
float. The file also defines an enumerated data type,
err_T, and two structure types,
inSigs_T
and
calPrms_T.
The function
my_alg is designed to calculate
a return value by using the fields of
inSigs and
calPrms,
which are global structure variables of the types
inSigs_T and
calPrms_T.
The function requires another algorithm to supply the signal data
that
inSigs stores.
This code allocates memory for
inSigs, but not for
calPrms. Create a model whose generated code:
Defines and initializes
calPrms.
Calculates values for the fields of
inSigs.
Reuses the type definitions (such as
err_T and
float_32)
that the external code defines.
So that you can create enumerated and structured data in the
Simulink® model, first create Simulink representations of the data types that the external code
defines. Store the Simulink types in a new data dictionary named
ex_cc_integ.sldd.
Simulink.importExternalCTypes('ex_cc_algorithm.h',... 'DataDictionary','ex_cc_integ.sldd');
The data dictionary appears in your current folder.
To inspect the dictionary contents in the Model Explorer, in your
current folder, double-click the file,
ex_cc_integ.sldd.
The
Simulink.importExternalCTypes function
creates
Simulink.Bus,
Simulink.AliasType, and
Simulink.data.dictionary.EnumTypeDefinition
objects that correspond to the custom C data types from
ex_cc_algorithm.h.
Create a new model and save it in your current folder as
ex_struct_enum_integ.
Link the model to the data dictionary. On the Modeling tab, under Design, click Data Dictionary.
Add algorithmic blocks that calculate the fields of
inSigs.
Now that you have the algorithm model, you must:
Organize the output signals into a structure variable
named
inSigs.
Create the structure variable
calPrms.
Include
ex_cc_algorithm.c in the
build process that compiles the code after code generation.
Add a Bus Creator block near the existing Outport blocks. The output of a Bus Creator block is a bus signal, which you can configure to appear in the generated code as a structure.
In the Bus Creator block, set these parameters:
Number of inputs to
3
Output data type to
Bus:
inSigs_T
Output as nonvirtual bus to selected
Delete the three existing Outport blocks (but not the signals that enter the blocks).
Connect the three remaining signal lines to the inputs of the Bus Creator block.
Add an Outport block after the Bus Creator block. Connect the output of the Bus Creator to the Outport.
In the Outport block, set the Data
type parameter to
Bus:
inSigs_T.
On the Modeling tab, click Model Data Editor.
On the Inports/Outports tab, for the
Inport blocks labeled
In2 and
In3, change Data Type from
Inherit: auto to
float_32.
Change the Change View drop-down list from
Design to
Code.
For the Outport block, set Signal
Name to
inSigs.
Set Storage Class to
ImportFromFile.
Set Header File to
ex_cc_algorithm.h.
Inspect the Signals tab.
In the model, select the output signal of the Multiport Switch block.
In the Model Data Editor, for the selected signal, set
Name to
err.
Set the name of the output signal of the Gain block to
sig1.
Set the name of the output signal of the Gain1 block to
sig2.
When you finish, the model stores output signal data (such as
the signals
err and
sig1) in
the fields of a structure variable named
inSigs.
Because you set Storage Class to
ImportFromFile,
the generated code does not allocate memory for
inSigs.
Configure the generated code to define the global structure variable,
calPrms, that the external code needs.
In the Model Explorer Model Hierarchy pane, under the dictionary node ex_cc_integ, select the Design Data node.
In the Contents pane, select the
Simulink.Bus object
calPrms_T.
In the Dialog pane (the right pane), click Launch Bus Editor.
In the Bus Editor, in the left pane, select
calPrms_T.
On the Bus Editor toolbar, click the Create/Edit a Simulink.Parameter Object from a Bus Object button.
In the MATLAB Editor, copy the generated MATLAB code and run the code
at the command prompt. The code creates a
Simulink.Parameter object in the base workspace.
In the Model Explorer Model Hierarchy pane, select Base Workspace.
Use the Model Explorer to move the parameter object,
calPrms_T_Param, from the base workspace to the
Design Data section of the data dictionary.
With the data dictionary selected, in the
Contents pane, rename the parameter object as
calPrms.
In the Model Data Editor, select the Parameters tab.
Set the Change view drop-down list to
Design.
For the Gain block, replace the value
13.8900013 with
calPrms.cal1.
In the other Gain block, use
calPrms.cal2.
While editing the value of the other Gain block, next
to
calPrms.cal2, click the action button
and select calPrms > Open.
In the
calPrms property dialog box, next to the
Value box, click the action button
and select Open Variable
Editor.
Use the Variable Editor to set the field values in the parameter object.
For the fields
cal1 and
cal2, use the numeric values that the
Gain blocks in the model previously
used.
For
cal3, use a nonzero number such as
15.2299995.
When you finish, close the Variable Editor.
In the property dialog box, set Storage class to
ExportedGlobal. Click
OK.
Use the Model Explorer to save the changes that you made to the dictionary.
Configure the model to include
ex_cc_algorithm.c in
the build process. Set Configuration Parameters > Code Generation > Custom Code > Additional build information > Source files to
ex_cc_algorithm.c.
Generate code from the model.
Inspect the generated file
ex_struct_enum_integ.c.
The file defines and initializes
calPrms.
/* Exported block parameters */ calPrms_T calPrms = { 13.8900013F, 0.998300076F, 15.23F } ; /* Variable: calPrms
The generated algorithm in the model
step function
defines a local variable for buffering the value of the signal
err.
err_T rtb_err;
The algorithm then calculates and stores data in the fields of
inSig.
inSigs.err = rtb_err; inSigs.sig1 = (rtU.In2 + rtDW.DiscreteTimeIntegrator_DSTATE) * calPrms.cal1; inSigs.sig2 = (real32_T)(calPrms.cal2 * rtDW.DiscreteTimeIntegrator_DSTATE);
To generate code that uses
float_32 instead
of the default,
real32_T, instead of manually specifying
the data types of block output signals and bus elements, you can use
data type replacement (Configuration Parameters > Code Generation > Data Type Replacement). For more information, see Replace and Rename Data Types to Conform to Coding Standards.
Simulink.importExternalCTypes | https://au.mathworks.com/help/ecoder/ug/exchange-structured-and-enumerated-data-between-generated-and-external-code.html | CC-MAIN-2021-21 | refinedweb | 1,207 | 50.84 |
.
Hey!
Read all your tutorials, and they are great.
One question here though.
Instead of using the following:
#ifndef
#define
#endif
Is it OK to use #pragma once?
Dont they do the exact same thing? If not, whats the difference?
I heard somewhere that #pragma once i OS-spesific, and if you wanna make portable code, you should use #ifndef.........?
Sincerely
I discuss #pragma once in the next lesson. Short answer, you're better off using explicit header guards even though #pragma once will probably work in most places.
My dear c++ Teacher,
Please let me following question:
In subsection "Conditional compilation" 2nd paragraph, by "value" I understand "identifier", e.g. PRINT_JOE, PRINT_BOB. Is it correct?
With regards and friendship.
Yes.
I am getting an error message like this.Can you please help me out with this?
You have code that lives outside of a function. This isn't allowed. Move the #ifdefs and associated code inside main(), or put them inside another function that you're calling from main().
Okay Thanks Alex for helping me out on this issue.
My dear c++ Teacher,
Please let me say you that example
implies suggestion to use japanese money!
also that by chance I found following program works and outputs 9.
With regards and friendship.
In "scope of defines" section, I was wondering is there any specific reason for you to put #include<iostream> in funcition.cpp not main.cpp?
And I wrote same coding as mentioned above, but my computer did not print out "printing". I am using CLion instead of Visual Studio and just wondering that cout works differently from editors.
Each code file should include all of the headers that contain declarations for the functionality it is using.
function.cpp uses std::cout and operator<<, therefore it needs to include iostream itself. If you omit it, the compiler will probably complain it doesn't know what std::cout is.
Each code file is compiled separately, and the compiler doesn't remember anything from the previous file. So if you had included iostream in main.cpp and not in function.cpp, the compiler would not remember that you had done so.
std::cout should work fine in clion. Perhaps your output window is either closing immediately, or going to a different window than the one you're looking at?
Hey Alex! You said that "almost anything [function-like macros] can do can be done by an (inline) function.". Then what is something a macro can do but a function can't?
The only good use case I can think of for using a function-like macro over a normal function is for implementing asserts. If you're not familiar with asserts, I cover them here:
Asserts typically display the code file and line of code causing the assert. This can't be done via a normal function, because calling a function changes the line of code being executed (and maybe the file). And it can't be done via an inline function because inline functions don't have access to the line of code or name of the file. But it can be done via the preprocessor.
HEY ALEX!
HERE WHAT I NEED TO
KNOW:;
WHAT IS THIS
g++ -o main -I /source/includes main.cpp
AND WHERE TO PLACE IT WHAT IT DO”’
‘
‘
‘AND A QUESTION ARE YOU A SOFTWARE ENGINEER?
AND HOW LONG YOU TAKE TO LEARN C++?
PLEASE ONE MORE ? YOU ALSO LEARN C++ ONLINE?
PLEASE ANSWER IT
WITH DUE RESPECT TO YOU:]
> g++ -o main -I /source/includes main.cpp
This tells g++ to compile main.cpp into a program called main, from the command line. If you're using an IDE, you don't need to know this.
> AND A QUESTION ARE YOU A SOFTWARE ENGINEER?
Not any more.
> AND HOW LONG YOU TAKE TO LEARN C++? PLEASE ONE MORE ? YOU ALSO LEARN C++ ONLINE?
I dunno, I learned it a long time ago, before they had online courses.
THANK YOU VERY
MUCH TO LET ME KNOW ABOUT
YOUR EXPERIENCE WITH C++?
;
;
AND FINALLY YOU ARE MY GREAT
TEACHER.
HEY ALEX!
AM A NEW LEARNER OF THIS LANGUAGE:
HERE WHAT I WANT TO KNOW
WHAT IS DIRECTORY AND WHAT ITS FUNCTION!!
CAN YOU PLEASE REPLY WITH A EXAMPLE ;
ITS VERY IMPORTANT
FOR ME.............;)
A directory is a folder that holds files, that exists as a part of the operating system file system. If you're not familiar with the role of files and directories as part of the operating system, I'd suggest doing some separate reading on those topics.
wher i can learn more about it?
wikipedia is always a good starting point. You can also try google searching for "file system tutorial".
thanks my great teacher
where to put this code? on the header file ??
What code?
I have a promblem on a last example (The scope of defines) , I am getting this log in an output field:
1>------ Build started: Project: 0110, Configuration: Debug Win32 ------
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>0110.cpp
1>c:\users\agencija\documents\visual studio 2005\projects\0110\0110\0110.cpp(11) : error C3861: 'doSomething': identifier not found
1>function.cpp
1>c:\users\agencija\documents\visual studio 2005\projects\0110\0110\function.cpp(13) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
1>Generating Code...
1>Build log was saved at ":\Users\Agencija\Documents\Visual Studio 2005\Projects\0110\0110\Debug\BuildLog.htm"
1>0110 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
What am I doing wrong?
In 0110.cpp, do you have a forward declaration for function doSomething?
In function.cpp, it looks like #include "stdafx.h" is either missing or isn't the first line of the file.
thanks a lot!
First of all, thank you for this site! You make the world a better place.
Now, the boring stuff. This can be ignored by experienced programmers. I was trying to get fancy and created a function called input() that would ask the user for a number and then return that number back to the caller. Then I put this function on a separate file, just as we did with the add() function. To my surprise, the compiler complained about std::cin and std::cout from the input() function despite the fact that I had #include <iostream> in the main.cpp file. I thought the main.cpp file gets compiled first :) Of, course, I put another #include <iostream> in the input.cpp file and everything worked out fine. But I was wondering, isn't it a waste to use #include <iostream> multiple times? Then I learned about header guards and with a little Google-Fu I even found out about #pragma once, a directive that prevents <iostream> from being included multiple times.
A few things:
1) The C++ compiles each file individually. It does not remember anything from files it's previously compiled. So if you use std::cout in a given file, that file needs to include iostream.
2) Header guards do _not_ prevent a header from being included into multiple different files. They prevent a header from being included more than once into the same file.
In you example of print, sometimes it really changes the desicision like:
Alex: Hi, not sure if you still maintain this site. When discussing the preprocessor, instead of saying that it makes changes to the text of a file, I think, isn't it more accurate to say that the preprocessor creates a new temporary file where the contents of the original source file has changes from the preprocessor merged into this 'working copy', and then the 'working copy' is what actually gets compiled by the compiler, not the original source file?
The distinction is important because none of the original files (either .cpp or .h files) are ever actually changed. They will be exactly the same after compilation as before, and so this might confuse new programmers.
Yeah, I can see how this might have been unclear. I've updated the lesson text to explicitly indicate that the original code files are not modified. Thanks for the feedback.
#include "stdafx.h"
#include <iostream>
#define anything "hello the world"
void hi()
{
std::cout << "say hi to me" << std::endl;
}
int main()
{
#ifdef anything
std::cout << anything << std::endl;
#endif // anything
#ifndef myname
#define myname
#endif
#ifdef myname
std::cout << "I am Jay " << std::endl;
#endif
#ifndef sayhi
hi();
#endif
return 0;
}
basically, I understand this lesson.
I am just wondering whether we are going to have more use of #defines in future lessons. Can't wait to read more.
In C++, defines are mostly used for header guards and conditional compilation. I talk about both of these shortly. Beyond that, most of what the preprocessor can do isn't used, because there are better, safer ways to do the same things.
My dear c++ Teacher,
Please let me say my problem with
I save (by Ctrl-s) code of function.cpp and give this name, but when run main.cpp, output is:
/home/WBEnb0/cc58Mmhf.o: In function `main':
prog.cpp:(.text.startup+0x12): undefined reference to `doSomething()'
collect2: error: ld returned 1 exit status
What is going wrong?
With regards and friendship.
It looks like codechef may be treating each tab as a separate program, rather than as separate files to be compiled into a single program. If that's actually the case, then it's not suitable for compiling programs that use multiple files.
My dear c++ Teacher,
Please let me say that term "preprocessor" is confusing with integrated circuit "processor". So I think term "precompiler" is better fit for it.
With regards and friendship.
Agreed, but they didn't ask me for my opinion on what it should be called. :)
My dear c++ Teacher,
Please let me be glad for you agree with that I said!
With regards and friendship.
My dear c++ Teacher,
Please let me point out that in example:
color of first and second comments is same to directives. Is it mean something?
With regards and friendship.
The preprocessor line comments being brown instead of green is due to a limitation of the syntax highlighter used on this website.
All comments in the source code are removed before the preprocessor runs, so there's no difference between a comment on a preprocessor line or elsewhere.
it worked ...
i was trying to compile the same code as your's but it is not working.....it shows this error
g++ -std=c++11 -o main *.cpp
main.cpp:4:10: error: 'cout' in namespace 'std' does not name a type
std::cout << FOO; // This FOO gets replaced with 9 because it's part of the normal code
^
sh-4.3
#define FOO 9 // Here's a macro substitution
int main()
{
#ifdef FOO // This FOO does not get replaced because it’s part of another preprocessor directive
std::cout << FOO; // This FOO gets replaced with 9 because it's part of the normal code
#endif
}
It looks like you forgot to #include the iostream header.
"When the preprocessor encounters this directive, any further occurrence of ‘identifier’ is replaced by ‘substitution_text’ (excluding use in other preprocessor directives)."
What do you mean with "(excluding use in other preprocessor directives)" ??????
And: "when the identifier is encountered by the preprocessor (outside of another preprocessor directive), it is removed and replaced by nothing!"
What do you mean with "(outside of another preprocessor directive)" ??????
Preprocessor directives don't affect other preprocessor directives. So, for example, if you had the following:
For normal code, any occurrence of FOO (such as the one being std::cout above) would be replaced by 9. However, other preprocessor statements are immune to this text substitution, so the FOO in #ifdef FOO is not replaced.
I've added this bit to the lesson, since it might be helpful for other readers.
Thank you Alex.
Thank you so much Alex, I have learned a lot from your tutorials
The best tutorials I have come across so far...
My question is do you have similar tutorials for any other language like java or python?
If yes,please reply and let me know.
Sorry, I don't.
hi
thanks alex
i have reached here since 5 days ago (going a bit slow but i test and learn every bit of it) :)
one question i have is:
1_i heard by some that C++ is the mother language and you can learn others very fast if you learn C++..true??
2_i have also seen an extension for C++ named Xamarin (spelled correctly?) that makes you to make android apps and im going to buy it but i wonder that how it works...you code in C++ and it converts them to java?? or a java support for C++??
Many languages that came after C++ use a similar syntax to C++, so once you know C++, it is a lot easier to learn other languages. I don't know if I'd say you can learn them fast, but certainly a lot faster than trying to learn them from scratch.
I've never heard of Xamarin before, so I can't comment on how it works.
I guess I can't reply to a specific comment without an account? Anyway, in reply to the immediately above:
That makes more sense. To be fair, nowhere else I looked mentioned that caveat either. There's one more thing that isn't clear now, though; from the section on object-like macros without substitution text, I got the impression that the fact that they replace later appearances of their identifiers with nothing is what makes them useful for conditional compilation, but since that mechanic doesn't affect other preprocessor directives, and the only place the macro's identifier necessarily reappears in that context is inside other preprocessor directives, it seems that it doesn't in fact come into play at all there. Is that right?
There are no accounts on this site. All functionality is available to anonymous users. Just click the reply link next to the comment you want to reply to.
Object-like macros without substitution text are pretty much never used outside of conditional compilation directives (which are exempt from the substitution effects).
Huh, I could have sworn the reply buttons weren't there last time. They probably were there, but I did look.
Does that mean that one could also use an object-like macro with substitution text for conditional compilation (even though the substitution text would be pointless) and it would work just the same?
Thanks for the clarifications! This is a very helpful site.
I'd never thought to try it before. So I just tried it with Visual Studio 2015, and it does work (though as you note, the substitution text isn't used in this case).
You say an object-like macro without substitution text replaces each subsequent appearance of its identifier with nothing. I understand this to mean that in the example under "conditional compilation," the preprocessor changes line 3 from
to
. That, in turn, suggests that the specific circumstance under which code after #ifdef is compiled is when there is no identifier after the #ifdef. In that case, I would expect it to also be possible to get rid of the identifier myself, so that the code
would cause the code after the #ifdef to be compiled, but it seems that having an #ifdef without an identifier in the first place isn't allowed. Is the preprocessor allowed to cause it to happen, but I'm not?
No. I realize I didn't mention in the lesson that object-like macros don't affect other preprocessor directives. I've updated the lesson to mention that.
So when you #define PRINT_JOE, any occurrences of PRINT_JOE outside of preprocessor directives are removed, but any occurrences of PRINT_JOE inside of preprocessor directives (such as #ifdef PRINT_JOE) are left alone.
If this weren't the case, #ifdef would be useless.
hey,
I'm using visual studio 2015 and had some problems with this code.
Even if I copy pasted it in, it would give 2 errors.
Could it be that you just have to add ";" after "printing!" and "not printing!" in the function.cpp?
thnx
Yep, typo. Thanks for pointing that out. I've fixed the examples.
Thnx,
Just glad I found the solution myself :)
Great guide btw!
void doSomething()
{
#ifdef PRINT
std::cout << "Printing!"
#endif
#ifndef PRINT
std::cout << "Not printing!"
#endif
}
void doSomething(); // forward declaration for function doSomething()
int main()
{
#define PRINT
doSomething();
If directives defined in one code can't be used by other then why didn't we include iostream directive in the main.cpp as we did in function.cpp?
main.cpp doesn't use anything in the iostream header, so it doesn't need to be included.
However, if main.cpp did print something using std::cout, it would need to #include iostream itself.
HEY guys, i am unable to get the output for this code. What is wrong? Pls explain.
Codeblocks in main.cpp
[#include<iostream>
#define PRINT_JOE
int main()
{
#ifdef PRINT_JOE
std::cout << "Joe" << endl;
#endif
#ifdef PRINT_BOB
std::cout << "Bob" << endl;
#endif
return 0;
}]
I am getting this error
||=== Build: Debug in Chapter1.10
(compiler: GNU GCC Compiler) ===|
s Folder\C++ Programs Practice\Chapter1.10\main.cpp|| In function 'int main()':|
s Folder\C++ Programs Practice\Chapter1.10\main.cpp|8| error: 'endl' was not declared in this scope|
s Folder\C++ Programs Practice\Chapter1.10\main.cpp|8| note: suggested alternative:|
C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\
mingw32\4.9.2\include\c++\ostream|564| note: 'std::endl'|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
endl should be std::endl. I've fixed the examples.
Hi guys . why we #define ADD_H in the following code ? this code is about previous examples . I deleted #define ADD_H and my codes still work , Can you explain exactly what happend when we invoke ( include "add.h") ?
This is answered in the very next lesson 1.10a -- Header guards.
Is there a way to set a variable that is available within every function? For example, say I wanted to load a variable from a .txt file and have that variable used within a function that uses that number to produce a new digit? This is basically what I have so far.
Many File Program.cpp
test.txt
Yes, global variables are available to serve this purpose, though most programmers would argue you shouldn't use them unless necessary. We cover global variables and the reasons they are problematic in chapter 4.
Name (required)
Website | https://www.learncpp.com/cpp-tutorial/introduction-to-the-preprocessor/comment-page-2/ | CC-MAIN-2019-13 | refinedweb | 3,137 | 66.33 |
Introduction
Make sure to check out my Timer CodeSandbox first. Play around with the timer, fork the sandbox, examine the code, and even refactor to make it better!
The previous two articles in my React Hooks Series broke down useState and useEffect. This post will focus on useRef, one of my favorite hooks. I readily admit that I am not a useRef expert by any means, and this article only covers how I implement the useRef hook in relation to my Timer example.
A Quick Detour
Let's discuss WHY I need the useRef hook in my Timer app.
It has to do with the
PAUSE button and how it behaves. Initially I did not have useRef tied to my pause functionality. When the user tried to pause, there was often a delay and the timer would still tick down an additional second.
We should look at that specific behavior, because we can gain better understanding of useEffect and setTimeout also.
As a reminder, I conditionally render the
PAUSE button when both
start === true AND
counter does not equal exactly
0.
{ start === true && counter !== 0 ? <button style={{fontSize: "1.5rem"}} onClick={handlePause}>PAUSE</button> : null }
In other words, while the timer is running, the pause button is rendered.
const handlePause = () => { setStart(false) }
As you can see,
handlePause sets
start to
false which makes our pause button disappear (null is rendered) and our start button is rendered in its place.
The state of
start has changed from true to false, triggering our first useEffect (remember to ignore
pauseTimer.current for now):
useEffect(() => { if (start === true) { pauseTimer.current = counter > 0 && setTimeout(() => setCounter(counter - 1), 1000) } return () => { clearTimeout(pauseTimer.current) } }, [start, counter, setCounter])
When the user hits
PAUSE, useEffect checks to see if
start === true (which it doesn't anymore) but the setTimeout from the previous render is still running until our useEffect determines that in fact
start does NOT equal
true will not run another setTimeout. But the delay happens because the prior setTimeout will complete its run. By then it is often too late and another second has passed.
Want to see this behavior in action? Open the Timer CodeSandbox and delete
pauseTimer.current = from line 19, run the timer and try to pause it a few times. You will notice the timer not pausing immediately.
Now that we understand the problem, we can fix it!
Enter the useRef hook to save the day!
Part Three - useRef
Understanding useRef might take some time. I know it did for me. First let's see what the React docs have to say:
useRef returns a mutable ref object whose .current property is initialized to the passed argument (initialValue). The returned object will persist for the full lifetime of the component.
Okay, say what?
If you are not sure what any of that means, you are not alone!
I found this blog post written by Lee Warrick very helpful, particularly his explanation for useRef:
Refs exist outside of the re-render cycle.
Think of refs as a variable you’re setting to the side. When your component re-runs it happily skips over that ref until you call it somewhere with .current.
That was my lightbulb moment. A ref is a variable you can define based on an object in state, which will not be affected even when state changes. It will hold its value until you tell it to do something else!
Let's see it in action in our Timer app.
Add useRef to our React import:
import React, { useState, useEffect, useRef } from "react";
From the docs:
const refContainer = useRef(initialValue);
Defining an instance of an object to "reference" later.
Ours looks like:
const pauseTimer = useRef(null)
Make sure to give it a meaningful name, especially if you're using multiple useRefs. Mine is
pauseTimer because that is what I want it to do when called.
null is my intial value inside
useRef() because it doesn't really matter what the initial state of
pauseTimer is in my function. We only care what the reference to pauseTimer is once the timer starts ticking down.
pauseTimer is an object with a property of
current. EVERY ref created by useRef will be an object with a property of
current.
pauseTimer.current will be a value which we can set.
Let's take a look at our useEffect one more time, now paying special attention to
pauseTimer.current. Here we are setting our conditional (is
counter greater than
0?) setTimeout as the value to
pauseTimer.current. This gives us access to the value of setTimeout anywhere!
useEffect(() => { if (start === true) { pauseTimer.current = counter > 0 && setTimeout(() => setCounter(counter - 1), 1000) } return () => { clearTimeout(pauseTimer.current) } }, [start, counter, setCounter])
From here it's pretty straight forward. When the user selects
PAUSE now,
start updates to
false and the useEffect can't run the setTimeout so it runs the clean-up function:
return () => { clearTimeout(pauseTimer.current) }
If we didn't have
pauseTimer.current inside our clearTimeout, the timer would continue to tick for another second, just as before because our setTimeout inside the conditional block
if (start === true) will run its full course even if we set
start to
false a second before.
BUT! Since we have
pauseTimer.current (a reference to our current setTimeout value) inside clearTimeout, useEffect will skip over
if (start === true) and immediately run its cleanup function and stop our setTimeout in its tracks!
And that's the power of useRef! Ability to access a reference to a value anywhere (you can even pass them down from parent to child!) and those references won't change until you tell it to (like we do with our timer every second it updates).
Bonus
This is just the tip of the useRef iceberg. You might be more familiar with useRef and interacting with DOM elements.
In my portfolio website, useRef dictates how I open and close my animated navigation screen.
Inside my component function SideNavBar:
I define my ref
const navRef = useRef()
Create functions to close and open the navigation
function openNav() { navRef.current.style.width = "100%" } function closeNav() { navRef.current.style.width = "0%" }
And set the React
ref attribute of
div to
navRef
<div id="mySidenav" className="sidenav" ref={navRef}>
And my CSS file with the
sidenav class
.sidenav { height: 100%; width: 0; position: fixed; z-index: 2; top: 0; left: 0; background-color: #212121; overflow-x: hidden; transition: 0.6s; padding-top: 5rem; }
Pretty cool, right?
navRef interacts with the DOM element
div className="sidenav" because it has the attribute
ref={navRef} and when
openNav() is called,
navRef.current.style.width gets updated to
"100%".
And vice versa when 'closeNav()' is called.
Wrapping up
I hope you enjoyed reading the third installment in my React Hooks Series! If you've made it this far, first
and second
I plan to continue this series on React hooks. I might cover different aspects of the same hooks or explore all new hooks. So stay tuned and as always, thank you again. It really means so much to me that ANYONE would read anything I write.
Please leave comments, feedback or corrections. I am SURE that I missed something or maybe explained concepts incorrectly. If you see something, let me know! I am doing this to learn myself.
Until next time...
HAPPY CODING
Discussion (6)
This was well written, but I often worry about framework overuse.
What I mean specifically is that you don't really need the
useRefto stop the timer, rather, using the
useEffecttogether with a local variable to clear the time out.
Perhaps a better use case would've been to show how to have two different effects interact with the same timer, for instance, in your example there can be a
useEffecthandler which has a single responsibility to clear out timers, which might be needed in production a few times, in spite of growing complexity, while another effects take care of starting it.
Even better use case are audio/video tags which can be started/paused, or how to deal with stale values.
Good article anyway! Keep them coming!
Thank you for reading and the feedback, Joseph!
Funny that you mention using useEffect to also stop the timer, with a local variable, because I tried that several different ways, and couldn't get the timer to stop immediately on pressing pause. I am sure there is a better way, I just don't know what that is (yet)!
I think for me the issue is having the setTimeout inside the conditional block (start === true) and accessing that variable to clearTimeout isn't possible.
That's why useRef made a lot of sense to me. Accessible basically anywhere!
But I am open to new ideas and solutions! If there is a better way, I would love to know what that is!
Mmm perhaps I am missing something, did you try this?
And we could even get rid of
counter:
Nice Article well explained. But I think even the React Doc's mention to not overuse useref. Didn't played around it much personally so I can't really judge the up and down sides.
That was a very nice explanation. Thank you very much.
Thank you, Yash! | https://dev.to/jamesncox/react-hooks-series-useref-27mk | CC-MAIN-2021-43 | refinedweb | 1,532 | 65.93 |
Results 1 to 2 of 2
Thread: modify pyton script to parse rss
- Join Date
- Apr 2008
- Location
- Scotland
- 41
- Thanks
- 12
- Thanked 1 Time in 1 Post
modify pyton script to parse rss
I use this script: (from this )
Basically it searches myepisodes.com for what programmes I watch, and then uses that search criteria to download .nzb files from newzleech.com (it doesnt actually download any tv shows, just .nzb files which are just xml information files)
But its been broken for some time now - the way it searches newzleech.com is just to append the search string to the rss part of their page, which no longer works. I was looking to change the code so instead it would parse a proper rss feed (eg: )for the search string..
Ive come up with this snippet:
Code:
import feedparser d = feedparser.parse("") for entry in d['entries']: if entry['title'] == "INSERT MYEPS EP HERE": goGetTheURL(entry['link'])
Any pointers would be much appreciated...
Simple hack. Maybe there's a better way?
Code:
import feedparser # List of the titles you're interested in. my_eps = ["Something"] d = feedparser.parse("") for entry in d['entries']: # Old if. # if entry['title'] == "INSERT MYEPS EP HERE": # New if. Look for the entry title in your list of titles. if entry["title"] in my_eps: goGetTheURL(entry['link'])I am a Man of Truth. I am a Free Human Person. I am a Peacemaker.
** Independent Multimedia Artist in Pasig **
AdSlot6 | http://www.codingforums.com/python/178607-modify-pyton-script-parse-rss.html | CC-MAIN-2015-40 | refinedweb | 245 | 76.22 |
User talk:Aburton
From OLPC
Sorry about the blip with the Main Page.
Here are a few suggestions that would minimize wasted space at the top.
- get rid of the OLPC macro. It really goes without saying on that page but if it must be said, say it at the bottom.
- get rid of redirects. Hunt down any refs to The OLPC Wiki and point them at the main page. It saves the space taken up by the redirect message.
- Get rid of the heading OLPC News. That isn't true because there is a separate news page. Since this is the opening page, just get right into the content.
- Please keep the Negroponte quote at the top because that is the major misunderstanding out there about the project.
GW Carver
Sorry, but I must disagree about George Washington Carver. When he was teaching children he tried to teach them real science by having them build real scientific apparatus and do real experiments applying the scientific method. Much of what passes for science in today's educational system is memorization of facts discovered by others or history of science. The OLPC could potentially be used as a tool to involve students in the scientific method which is the core of science. For that to happen we need people to produce content (both texts and applications) that is adpated to this approach. And in particular, since the targetted kids will have no scientific equipment of any kind available, the content needs to begin by instructing students how to scrounge up stuff much like G.W. Carver did. If you know of better examples to illustrate this principle, please add them. --Memracom 16:33, 23 June 2006 (EDT)
< includeonly > considered harmless
To keep categories and other metadata in templates from being associated with the template itself, use <includeonly> and </includeonly>. All text between those tags will be discarded except on transclusion. (Note that I had to stick them inside <nowiki> tags to get that text to show up here). (When you consider that all wiki pages -- not only Template: namespace pages -- can be transcluded into other pages, this opens the door to some elaborate obfuscated wikitext...) Cheers, Sj 12:19, 26 June 2006 (EDT) | http://wiki.laptop.org/index.php?title=User_talk:Aburton&oldid=187562 | CC-MAIN-2014-35 | refinedweb | 372 | 63.8 |
Opened 5 years ago
Closed 5 years ago
#9990 closed defect (fixed)
DeprecationWarning : the md5 module is deprecated - Causes tab-completion to fail in trac-admin
Description (last modified by )
Pressing tab in trac-admin causes this warning generated by clientsplugin:
Trac [/var/projects/frontend]> /usr/local/lib/python2.6/dist-packages/clients-0.4-py2.6.egg/clients/events.py:1: DeprecationWarning: the md5 module is deprecated; use hashlib instead Completion error: AttributeError: 'WorklogAdminPanel' object has no attribute 'get_admin_commands'
I guess it's time to go to hashlib instead :) There info about some patch supposedly done on trac core on a prolem like this a few years back. The first time I've seen it pop up though (other trac/worklog combo's seem to be silent about it).
Thanks for whatever effort you put in this, I've seen it's been a long time that any updates on this plugins came in, I sure like it. I've been looking for that start/stop logic forever.
Attachments (0)
Change History (8)
comment:1 follow-up: 3 Changed 5 years ago by
comment:2 Changed 5 years ago by
comment:3 Changed 5 years ago by
Replying to [email protected]:
Actually, I messed up the module, the fix for WorkLogPlugin problem is this:
Usually tickets are left open until a fix is applied to the trunk. No harm though.
I'd previously implemented a similar fix for the GraphvizPlugin in comment:15:ticket:5747.
comment:4 Changed 5 years ago by
comment:5 follow-up: 6 Changed 5 years ago by
Oh, I'm sorry. I didn't realize this is actually picked up in that manner. I see many plugins missing the get_admin_commands part...
the reason I closed directly (should perhaps have used invalid) is because the trac-admin error wasn't the reason that pressing tab on the console threw an error, it just showed up along with the plugin. The plugin was the real reason it blew up. But the md5 issue is indeed still there. Tx for caring.
comment:6 Changed 5 years ago by
Replying to [email protected]:
Oh, I'm sorry. I didn't realize this is actually picked up in that manner. I see many plugins missing the get_admin_commands part...
If this is an issue for other plugins, I'd be happy to apply a fix to those as well. Most plugins aren't maintained, but if you open a ticket and cc me on it, I'll get it applied to the trunk.
Thanks for reporting and providing a fix!
comment:7 Changed 5 years ago by
The issue you point out with
events.py is in the ClientsPlugin, and that will be fixed in a moment. WorkLogPlugin doesn't
import md5 and doesn't implement
IAdminCommandProvider, so I don't see any problems with it.
Please reopen if I'm missing something that you can clarify. Thanks!
Actually, I messed up the module, the fix for WorkLogPlugin problem is this:
events.py
and for clients plugin which is my mistake here , in webadminui.py add to class WorklogAdminPanel. | https://trac-hacks.org/ticket/9990 | CC-MAIN-2017-09 | refinedweb | 523 | 64.41 |
#include <PollThread.h>
List of all members.
Definition at line 13 of file PollThread.h.
[inline]
constructor
Definition at line 16 of file PollThread.h.
true
[inline, explicit]
Definition at line 18 of file PollThread.h.
destructor
Definition at line 25 of file PollThread.h.
[virtual]
requests that the thread be started, if not already running (you need to create a separate instances if you want to run multiple copies)
Reimplemented from Thread.
Definition at line 9 of file PollThread.cc.
Referenced by PollThread().
[inline, virtual]
returns trackPollTime
Definition at line 34 of file PollThread.h.
sets trackPollTime
Definition at line 35 of file PollThread.h.
[protected, virtual]
this is the function which will be called at the specified frequency, override it with your own functionality
Definition at line 15 of file PollThread.cc.
Referenced by run().
called if a signal is sent while sleeping, should reset delay to indicate remaining sleep time, relative to startTime
On return, delay should be set such that delay-startTime.Age() is remaining sleep time. In other words, simply set delay to the period to maintain previously requested timing.
This default implementation will set delay to the remaining time needed to maintain current period setting. Feel free to override and reset period (or other member variables) if you need to change timing dynamically. If the period is shortened such that poll() should have already occurred based on time of previous call and the new period (plus any delay value), then poll() will be called immediately upon return.
Definition at line 23 of file PollThread.cc..
Definition at line 36 of file PollThread.cc.
[static, protected]
called if a SIGALRM is sent (generally, by a call to interrupt())
[protected]
amount of time to delay between call to start() and first call to poll(), or if interrupt occurs after first poll(), amount of time to re-sleep
Definition at line 61 of file PollThread.h.
Referenced by interrupted(), and run().
amount of time between calls to poll() -- if zero or negative, no delay will be made between calls (other than a call to testCancel())
Definition at line 62 of file PollThread.h.
Referenced by interrupted(), poll(), and run().
the time at which start() was called or the current period began
Definition at line 63 of file PollThread.h.
Referenced by interrupted(), run(), and start().
if true, the time spent in poll() is subtracted from the next sleep time so frequency is fixed; if false, period is added onto whatever time poll() takes
Definition at line 64 of file PollThread.h.
Referenced by getTrackPollTime(), run(), and setTrackPollTime().
set to true after start until after first call to poll has completed
Definition at line 65 of file PollThread.h. | http://www.tekkotsu.org/dox/classPollThread.html | crawl-001 | refinedweb | 451 | 56.35 |
borderlayout problem
I try to make a borderlayout. I have a working example. But in another place I get the following error and I really don't know the answer.
Code:
Layout = function(){ return { init: function(){ var layout = new YAHOO.ext.BorderLayout(document.body, { hideOnLayout: true, layoutheader: { split:false, initialSize: 80 } }); layout.add('header', new YAHOO.ext.ContentPanel('layoutheader', {fitToFrame:true})); } } }(); YAHOO.ext.EventManager.onDocumentReady(Layout.init, Layout, true);Code:
this.regions[target] has no properties add("header", Object closable=false loaded=false active=false)yui-ext-debug.js (line 12343) init()layout.js (line 11) namespace()utilities.js (line 2) fireDocReady()yui-ext-debug.js (line 3386) CustomEvent(DOMContentLoaded )event-min.js (line 1) [Break on this error] return this.regions[target].add(panel);
- Join Date
- Mar 2007
- Location
- Notts/Redwood City
- 30,603
- Vote Rating
- 60
Where in the documentation and examples do you see "header" as the name of a Region?
Damn, I thought I could give it any name I want. Not very smart.
Can you give me a hint where I can find that in the documentation? Just to solve such stupid mistakes by my self the next time.
- Join Date
- Mar 2007
- Location
- Notts/Redwood City
- 30,603
- Vote Rating
- 60
Go to the main page. Jack's blog has a lot of worked examples. And the "DOCUMENTATION" link works, and has examples.
Similar Threads
BorderLayout : Z-index problemBy saasira in forum Ext 3.x: Help & DiscussionReplies: 9Last Post: 10 Mar 2010, 8:34 AM
Possible BorderLayout problem?By salix in forum Ext 1.x: BugsReplies: 11Last Post: 26 Mar 2007, 10:13 AM
BorderLayout Problem.By fsuguinness in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 20 Mar 2007, 6:09 AM
Newbie problem with BorderLayoutBy dotnetCarpenter in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 10 Mar 2007, 10:25 AM
Newbie with a problem with BorderLayout and TabsBy ElGranAzul in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 24 Nov 2006, 11:29 AM | https://www.sencha.com/forum/showthread.php?2156-borderlayout-problem | CC-MAIN-2016-22 | refinedweb | 333 | 53.78 |
Full Stack Web Development Internship Program
- 3k Enrolled Learners
- Weekend/Weekday
- Live Class
Errors arise unexpectedly and can result in disrupting the normal flow of execution. This is something that every programmer faces at one point or the other while coding. Java, being the most prominent object-oriented language, provides a powerful mechanism to handle these errors/exceptions.
When an exception occurs, and if you don’t handle it, the program will terminate abruptly (the piece of code after the line causing the exception will not get executed).
Through this article on Java Exception Handling, I will give you a complete insight into the fundamentals and various methods of Exception Handling.
In this article, I will be covering the following topics.
An exception is a problem that arises during the execution of a program. It can occur for various reasons say-
Exception Handling mechanism follows a flow which is depicted in the below figure. But if an exception is not handled, it may lead to a system failure. That is why handling an exception is very important.
You may also go through this recording of Java Exception Handling where you can understand the topics in a detailed manner with examples.
Next, begin by understanding the of such an exception..
Sometimes, the built-in exceptions in Java are not able to describe a certain situation. In such cases, a user can also create exceptions which are called ‘User-Defined Exceptions’.
Key points to note: Java Exception Handling blog to understand various methods for handling these exceptions.
As I have already mentioned, handling an exception is very important, else it leads to system failure. But how do you handle these exceptions?
Java provides various methods to handle the Exceptions like:
Let’s understand each of these methods in detail."); } }
A catch block is where you handle the exceptions. This block must follow the try block and a single try block can have several catch blocks associated with it. You can catch different exceptions in different catch blocks. When an exception occurs in a try block, the corresponding catch block that handles that particular exception executes.
public class Testtrycatch1{ public static void main(String args[]){ int data=50/0;//may throw exception System.out.println("rest of the"); } }
A finally block contains all the crucial statements that must be executed whether an exception occurs or not. The statements present in this block will always execute, regardless an exception occurs in the try block or not such as closing a connection, stream etc..
Similarly, throw & throws sound alike, but they are different from each other. Let’s see how, with the help of the below table.
/"); }
This brings us to the end of our blog on Exception Handling “Exception Handling” blog and we will get back to you as soon as possible.
edureka.co | https://www.edureka.co/blog/java-exception-handling | CC-MAIN-2022-21 | refinedweb | 470 | 55.03 |
Don't you need to cast the first parameter to (const void *) in fwrite.
Type: Posts; User: stumpster123
Don't you need to cast the first parameter to (const void *) in fwrite.
Oh boy I am sorry, definately should have done that. I fixed it here.
#include <stdio.h>
#define MASK 0x80000000
int main()
{
int x, t, i;
for(x =1; x <= 256; x++)
This is a good beginner tutorial it has basics on classes and file I/O
Tutorial
You would need a hash function too, that will generate the key.
Here is a good hash function
int hash_example (char *s, int T)
{
int h = 0;
for (; *s != 0; s++)
h = (h << 5) ^ (*s)...
Yeah that's my biggest question why does it matter what the name of the class. If a user is using a program he doesn't need to know the details like the name of a variable or a class. I mean maybe...
I Don't understand why you would want to do that. Is there a specific reason?
He means if you divide by 0 your program will crash. Try going from 1 to 7 or something by incrementing fight after it is generated.
You could do this too,
#include <stdio.h>
#define MASK 0x00000001
int main()
{
Yeah I was just too lazy to look it up but it still wouldnt fit
Well thats the problem there are no data types that can fit numbers that large especially double. I know there is a quad type, which is 128 bits, but its only for special machines and i dont even...
I don't know of any data type that can hold a value as large as 5e60 that is a gigantic number and a double will never be able to hold that it goes to like 2e9 about. Maybe you could just take away...
you should write a function to insert each node into the list. If you want to insert into the front of the list it isnt too hard. Heres some pseudocode.
void new_node(struct list ** pHead, ...
Well fseek just moves around the file pointer you would still need to use fscanf or fread to read in the integer.
Try using this call instead
student::readfile(filename, &ctr, ARRAY);
Well when you use fscanf with a char array u can just send the variable not the address.
fscanf(f, "%s", line);
That will only read until it reaches white space so Fri will be put into line.
...
Easy if you want to print an integer in hexadecimal you don't need to use any function just use printf with the %x flag as follows.
printf("%x\n", int);
If you want to convert it from binary...
I would say you can't do this because it is a function not a data type and is not accessed like a data type.
You can type cast the variable to an int or just save it to an integer variable for example.
(int)charvariable
int iVar = cVar;
The only problem with that is when the char is representing...
Yea but remember a string is an array of characters so technically it is a 2d array still. Even though it is malloced and not a specified length to begin with you would still access a single char...
You are going to have to use a 2 dimension array to do that.
Because if you think about it the array of strings is also a 2 dimensional array also it is just initialized differently.
Thanks dave that worked perfectly.
Yeah that is what read info is doing before it reads anything. It opens the file and uses the file pointer that is sent from main function. I am using an array so the function call is in a for loop...
In my main function I have an array of File pointers like this:
FILE *fInfile[MAXFILE]
and my functions header is
int read_info(FILE *fA, FILE *fI);
{
lol got back to the post too slow otherwise I would have posted it. Don't worry i can do it but quzah beat me to the punch.
Ok i see sorry i read the initial question wrong. You want to break the list in half where the even nodes go into on sublist and the odd go into another. This can be done like this
for(i = 0;... | https://cboard.cprogramming.com/search.php?s=07001192074783a05e27a44979447d0c&searchid=2963361 | CC-MAIN-2020-10 | refinedweb | 730 | 80.51 |
0
Hello ladies and gents,
I'm trying to copy two words, for instance test and word into an array of characters and have this:
#include <iostream> int main() { char word[10]= ""; char *wordArr[10]; for(size_t i = 0; i < 2; i++) { std::cin >> word; *(wordArr + i) = word; } for(size_t i = 0; i < 2; i++) std::cout << wordArr[i] << '\n'; std::cin.ignore(2); return 0; }
Thing is, it prints the last word twice as if it doesn't store the first word, what am I doing wrong, can anyone point me in the right direction?
I know I could use strings or even a vector, but, my idea is to work out a version using characters first, then strings and then a vector. | https://www.daniweb.com/programming/software-development/threads/62913/copying-words-into-an-array-of-char | CC-MAIN-2018-17 | refinedweb | 124 | 59 |
Implementing Blit in PyGame using Python
In this module, we are going to discuss the blit() method that helps us to draw images, text, characters onto the screen of pygame. When we want to perform operations like drawing an image it displays a blank screen if we don’t use blit.
Usage of Blit() in pygame
Generally, blit() refers to portraying contents on to the surface. The general syntax for creating blit() is as follows
pygame.Surface.blit(source,dest)
pygame.Surface is a constructor that helps us to draw images onto the screen.
- source- Represents the image or text name that is to be loaded on to the screen
- dest- Represents the tuple or single value used to position the image or text on the screen.
Example:
Let us take a simple example to demonstrate the functionality of blit().
import pygame import sys pygame.init() sur_obj=pygame.display.set_mode((400,300)) pygame.display.set_caption("Rectangle") sta_img=pygame.image.load("star.png") sur_obj.blit(sta_img,(1,2)) while True: for eve in pygame.event.get(): if eve.type==pygame.QUIT: pygame.quit() sys.exit() pygame.display.update()
If we run the above Pygame code, we will be able to see something like you can see below:
The output will be a blank screen containing the image at pixel coordinates (1,2).
sta_img=pygame.image.load("star.png")
We loaded the image using a PyGame function called pygame.image.load(). This function helps us to load png, jpg files into our code. However, loading doesn’t mean we loaded the image onto a screen. To achieve this we used blit().
sur_obj.blit(sta_img,(1,2))
Here,sur_obj refers to the surface object we have created where we are going to display our image.
Note: The code file and image file must be in the same folder.
The star.png file is given below:
Also, read: Play Video in Python Using Pygame | https://www.codespeedy.com/implementing-blit-in-pygame-using-python/ | CC-MAIN-2021-43 | refinedweb | 320 | 64.61 |
Some code in AOSP10 seems to violate ODR:
source 1:
struct ExtentsParam { void init (const OT::cff1::accelerator_t *_cff) { path_open = false; cff = _cff; bounds.init (); } void start_path () { path_open = true; } void end_path () { path_open = false; } bool is_path_open () const { return path_open; } bool path_open; Bounds bounds; const OT::cff1::accelerator_t *cff; };
from:
source 2:
struct ExtentsParam { void init () { path_open = false; min_x.set_int (0x7FFFFFFF); min_y.set_int (0x7FFFFFFF); max_x.set_int (-0x80000000); max_y.set_int (-0x80000000); } void start_path () { path_open = true; } void end_path () { path_open = false; } bool is_path_open () const { return path_open; } void update_bounds (const Point &pt) { if (pt.x < min_x) min_x = pt.x; if (pt.x > max_x) max_x = pt.x; if (pt.y < min_y) min_y = pt.y; if (pt.y > max_y) max_y = pt.y; } bool path_open; Number min_x; Number min_y; Number max_x; Number max_y; };
from:
build script:
... srcs: [ ... "src/hb-ot-cff1-table.cc", "src/hb-ot-cff2-table.cc", ], ...
These too sourses are built into the same shared library. Both sources have the definition of "struct ExtentsParam" and the content are absolutely different. Both struct seems to be used only locally.
The two source have similiar names so the chance of unintentinal name duplication is low. And the chance of ODR violation in Google could be low.
Does it?
Yes: as these are both in the global namespace, this absolutely violates the ODR.
There is no exemption for class types used only within the translation unit in which they're defined; a program may only contain one class type with any given name.
It falls at the very first requirement for meeting criteria for exemption from this rule:
There can be more than one definition of a [..] class type [..] in a program provided that each definition appears in a different translation unit, and provided the definitions satisfy the following requirements. [..] Given such an entity named
Ddefined in more than one translation unit, all of the following requirements shall be satisfied. [..] Each definition of
Dshall consist of the same sequence of tokens [..] (ref)
The developers are just "getting lucky" that the linker didn't try to do any antics that result in symptoms for this violation.
This is what namespaces are for. For example, if the class type is only used within the translation unit in which it's defined, it could have been defined inside an anonymous namespace.
User contributions licensed under CC BY-SA 3.0 | https://windows-hexerror.linestarve.com/q/so60376420-does-this-code-violate-one-definition-rule | CC-MAIN-2021-39 | refinedweb | 388 | 67.45 |
Mercurial > dropbear
view libtommath/bn_fast_s_mp_sqr.c @ 475:52a644e7b8e1 pubkey-options
* Patch from Frédéric Moulins adding options to authorized_keys. Needs review.
line source
#include <tommath.h> #ifdef BN_FAST_S_MP_SQR], */ /* the jist of squaring... * you do like mult except the offset of the tmpx [one that * starts closer to zero] can't equal the offset of tmpy. * So basically you set up iy like before then you min it with * (ty-tx) so that it never happens. You double all those * you add in the inner loop After that loop you do the squares and add them in. */ int fast_s_mp_sqr (mp_int * a, mp_int * b) { int olduse, res, pa, ix, iz; mp_digit W[MP_WARRAY], *tmpx; mp_word W1; /* grow the destination as required */ pa = a->used + a->used; if (b->alloc < pa) { if ((res = mp_grow (b, pa)) != MP_OKAY) { return res; } } /* number of output digits to produce */ W1 = 0; for (ix = 0; ix < pa; ix++) { int tx, ty, iy; mp_word _W; mp_digit *tmpy; /* clear counter */ _W = 0; /* get offsets into the two bignums */ ty = MIN(a->used-1, ix); tx = ix - ty; /* setup temp aliases */ tmpx = a->dp + tx; tmpy = a->dp + ty; /* this is the number of times the loop will iterrate, essentially while (tx++ < a->used && ty-- >= 0) { ... } */ iy = MIN(a->used-tx, ty+1); /* now for squaring tx can never equal ty * we halve the distance since they approach at a rate of 2x * and we have to round because odd cases need to be executed */ iy = MIN(iy, (ty-tx+1)>>1); /* execute loop */ for (iz = 0; iz < iy; iz++) { _W += ((mp_word)*tmpx++)*((mp_word)*tmpy--); } /* double the inner product and add carry */ _W = _W + _W + W1; /* even columns have the square term in them */ if ((ix&1) == 0) { _W += ((mp_word)a->dp[ix>>1])*((mp_word)a->dp[ix>>1]); } /* store it */ W[ix] = (mp_digit)(_W & MP_MASK); /* make next carry */ W1 = _W >> ((mp_word)DIGIT_BIT); } /* setup dest */ olduse = b->used; b->used = a->used+a->used; { mp_digit *tmpb; tmpb = b->dp; for (ix = 0; ix < pa; ix++) { *tmpb++ = W[ix] & MP_MASK; } /* clear unused digits [that existed in the old copy of c] */ for (; ix < olduse; ix++) { *tmpb++ = 0; } } mp_clamp (b); return MP_OKAY; } #endif /* $Source: /cvs/libtom/libtommath/bn_fast_s_mp_sqr.c,v $ */ /* $Revision: 1.3 $ */ /* $Date: 2006/03/31 14:18:44 $ */ | https://hg.ucc.asn.au/dropbear/file/52a644e7b8e1/libtommath/bn_fast_s_mp_sqr.c | CC-MAIN-2022-21 | refinedweb | 376 | 61.5 |
pywordform is a python module to parse Microsoft Word forms in docx format, and extract all field values with their tags into a python dictionary.
The archive is available on the project page.
BSD, open-source. See LICENCE.txt for more info.
Open the file sample_form.docx (provided with the source code) in MS Word, and edit field values. You may also add or edit fields, and create your own Word form (see below).
From the shell, you may use the module as a tool to extract all fields with tags:
> python pywordform.py sample_form.docx field1 = "hello, world." field2 = "hello," field3 = "value B" field4 = "04-03-2012"
In a python script, the parse_form function returns a dictionary of field values indexed by tags:
import pywordform fields = pywordform.parse_form('sample_form.docx') print fields
Output:
{'field2': 'hello,\nworld.', 'field3': 'value B', 'field1': 'hello, world.', 'field4': '04-03-2012'}
For more information, see the main program at the end of the module, and also docstrings.
The code is available in a Mercurial repository on bitbucket. You may use it to submit enhancements or to report any issue.
To report a bug, please use the issue reporting page, or send me an e-mail. | http://www.decalage.info/python/pywordform | CC-MAIN-2016-22 | refinedweb | 201 | 67.25 |
#include <gperl.h>
gperl.h includes for you all the headers needed for writing XSUBs (EXTERN.h, perl.h, and XSUB.h), as well as all of GLib (via glib-object.h).
in a perl extension which uses several xs files but only one pm, you need to bootstrap the other xs files in order to get their functions exported to perl. if the file has MODULE = Foo::Bar, the boot symbol would be boot_Foo__Bar.".
domain may not be 0, and package may not be NULL; what would be the point? error_enum may be 0, in which case you'll get no fancy stringified error values..
In order for this to make sense, another package name should be registered for type with gperl_register_fundamental or gperl_register_fundamental_full..
These functions should be used instead of newSVpv and SvPV_nolen in all cases which deal with gchar* types..
In order for this to make sense, another package name should be registered for type with gperl_register_boxed.
registered_gtype must have been registered with gperl_register_boxed already.
This function might end up calling other Perl code, so if you use it in XS code for a generic GType, make sure the stack pointer is set up correctly before the call, and restore it after the.
In order for this to make sense, another package name should be registered for type with gperl_register_object..
Returns the id of the installed callback.. | https://www.commandlinux.com/man-page/man3/Glib__xsapi.3pm.html | CC-MAIN-2017-43 | refinedweb | 230 | 72.36 |
Setting pose of Viz3d changes camera parameters
When I call
Viz3d::setViewerPose, the camera parameters of the
Viz3d window change. In particular, it seems to zoom out significantly, even when the pose that I set is unchanged, i.e., when I set the one I can obtain with
Viz3d::getViewerPose. The following code illustrates the issue:
#include <iostream> #include <opencv2/viz.hpp> using namespace std; using namespace cv; using namespace cv::viz; int main() { Viz3d visualization("Test"); visualization.showWidget("Test object", WCone(1, 0.5, 100)); /*const auto pose = visualization.getViewerPose(); visualization.setViewerPose(pose);*/ //Uncomment this line and the one above it to see the described effect //cout << visualization.getCamera().getClip() << endl; //Debugging (uncomment this for an even stranger effect) visualization.spinOnce(1, true); while (!visualization.wasStopped()) visualization.spinOnce(1, true); return 0; }
When the two lines of code above are commented, the window looks like this:
When the two lines of code above are uncommented, the window looks like this:
To pinpoint the issue, I added a line that outputs the changing camera parameter (which I found after some debugging). Printing this camera parameter gives different results, depending on whether
setViewerPose is called, i.e., whether the two lines above it are commented. The strange thing, however, is, that just calling
Viz3d::getCamera() (here, for printing) makes the "zoom" effect I described above disappear.
I don't know whether either of the two effects are identended and I don't know how to make them go away. In a more complex example, I tried to adjust the pose in the same way, but I could not do so because the camera kept "zooming" when I just read some parameters, making it impossible to set or change values in a meaningful way. Is this a bug, perhaps? | https://answers.opencv.org/question/171661/setting-pose-of-viz3d-changes-camera-parameters/ | CC-MAIN-2022-40 | refinedweb | 297 | 55.24 |
.
First things first, we need to specify what kind of data structure our tree's nodes will hold. For this demo, it'll be a tuple of names and ages.
type alias Node = ( String, Int ) exampleNode = ( "Frank", 54 )
We can then use the
Arborist.Tree module to construct a tree structure:
import Arborist.Tree as Tree tree = Arborist.node ( "Frank", 54 ) [ Arborist.node ( "Mark", 36 ) [] , Arborist.node ( "Sally", 31 ) [ Arborist.node ( "Robert", 14 ) ] ]
The tree is defined recursively, with each node holding an arbitrary number of children. This is similar to the binary tree example on the Elm website.
Anyway, we can now define a model Arborist can work with:
import Arborist type alias Model = Arborist.Model Node init : Model init = Arborist.init tree
Notice how the model needs to know what data structure it holds, hence the type variable reference to the
Node structure defined above.
The rest is pretty much standard Elm architecture:
type Msg = ArboristMsg Arborist.Msg update msg model = case msg of ArboristMsg arboristMsg -> Arborist.update arboristMsg model view model = Arborist.view nodeView [] model
The final missing piece is
nodeView. It specifies how a node should be displayed, and has the following form:
-- Ignore `Context` for now view : Context -> Maybe Node -> Html msg view _ maybeNode = -- The node is not always available, because we also need to -- specify how placeholders are rendered. case maybeNode of Just ( name, age ) -> div [] [ span [] [ text name ], span [] [ text (toString age) ] ] Nothing -> div [] [ text "Insert node" ]
That's it - your very own tree editor is ready.
The context object provides, as its name suggests, contextual information to the node when it is rendered, including their parent node and list of siblings (see
Arborist.Context docs for details). for it yourself.
Replace
init with
initWith [ Arborist.Settings.canvasWidth 800, Arborist.Settings.nodeHeight 40, Arborist.Settings.gutter 20 ] to add all kinds of customizations to the editor. See
Arborist.Settings.
Using the
Arborist.subscriptions, you can smoothly animate to center a node when it is activated. See example for details.
You can use
styledView instead of
view, taking
StyledNodeView instead of
NodeView if you wish to use elm-css to style your view.
Arborist uses
elm-css under the hood, as it was necessary for most realistic use-cases that came up with the library.
Please open an issue if first-class style-elements support is essential to your project. | https://package.frelm.org/repo/1077/4.0.0 | CC-MAIN-2019-09 | refinedweb | 397 | 68.26 |
1.1.8. Mac OS, 10.9-15 (via command line)¶
The essential system setup
What to do?¶
These setup instructions are for Mac OS versions 10.9-15.
Note
If you are seeking the new App version of install instructions, *and have a Mac OS version 10.13-15, please click HERE. open a text file, you can type
open -t FILENAME. For example, to open the bash “rc” file:
open -t ~/.bashrc
Setup terminal¶
Copy+paste:
defaults write org.macosforge.xquartz.X11 wm_ffm -bool true defaults write org.x.X11 wm_ffm -bool true defaults write com.apple.Terminal FocusFollowsMouse -string YES
Purpose: This sets the policy where “focus follows mouse” for relevant applications. After this, clicks on a new window are directly applied, without needing to “pre-click” it. You’re welcome.
Install Xcode and XQuartz¶
Copy+paste:
xcode-select --install
For …
- … OS X >= 10.11, click on this link:Then click on the “Quick Download” DMG, and follow the instructions to install.
… OS X 10.9 and 10.10, copy+paste:
/Applications/Utilities/X11.app
Purpose: These install Xcode command line tools (needed for the gcc compiler et al.) and XQuartz (the desktop manager needed to run X11 programs, such as
afni!).
Setup Mac env variables¶
Copy+paste the following:
touch ~/.cshrc echo 'if ( $?DYLD_LIBRARY_PATH ) then' >> ~/.cshrc echo ' setenv DYLD_LIBRARY_PATH ${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace' >> ~/.cshrc echo 'else' >> ~/.cshrc echo ' setenv DYLD_LIBRARY_PATH /opt/X11/lib/flat_namespace' >> ~/.cshrc echo 'endif' >> ~/.cshrc touch ~/.bashrc echo 'export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/opt/X11/lib/flat_namespace' >> ~/.bashrc
Purpose: This adjusts the library format variable for XQuartz in both
tcshand
bash. Sigh.
Install AFNI binaries¶
For …:
… (default) installing the binaries from online, copy+paste:
cd curl -O tcsh @update.afni.binaries -package macos_10.12_local /macos_10.12_local.tgz -do_extras
Purpose: Download and unpack the current binaries in your
$HOMEdirectory; set the AFNI binary directory name to
$HOME/abin/; and add that location to the
$PATHin both
~/.cshrcand
~/.bashrc.
Reboot¶
Please logout and log back into your system.
Purpose: This deals with system updates, any change in login shell, and path updates.
Install R¶
- Click on this link:Purpose: Get R-3.6.3 (a recent, but not the most recent, version of R).
Copy+paste:
sudo rPkgsInstall -pkgs ALL
Purpose: Get specific R packages needed for AFNI programs.
Install Netpbm¶
Copy+paste:
/bin/bash -c "$(curl -fsSL)"
Copy+paste:
brew install netpbm
Purpose: Install “netpbm”, which has functionality for converting
image formats (such as to PNG) and is used in several programs like
@snapshot_volreg,
@chauffeur_afni and others. Uses the
package manager
homebrew to do the installation. these:
echo 'set filec' >> ~/.cshrc echo 'set autolist' >> ~/.cshrc echo 'set nobeep' >> ~/.cshrc echo 'alias ls ls -G' >> ~/.cshrc echo 'alias ll ls -lG' >> ~/.cshrc echo 'alias ltr ls -lGtr' >> ~/.cshrc echo 'alias ls="ls -G"' >> ~/.bashrc echo 'alias ll="ls -lG"' >> ~/.bashrc echo 'alias ltr="ls -lGtr"' >> ~/.bashrc echo 'alias ls="ls -G"' >> ~/.zshrc echo 'alias ll="ls -lG"' >> ~/.zshrc echo 'alias ltr="ls -lGtr"' >> ~/.zshrc
Purpose: The first command block sets up
tab autocompletion
for
tcsh (which should already be enabled for
bash users by
default). The second set of commands make aliases for the main shells.
Enable more SUMA keypresses (recommended)¶
Some of Mac’s default keyboard shortcuts hijack basic SUMA GUI keypresses. You can unset those from the Mac list, and therefore use them in SUMA.
Click your way to “System Preferences” -> “Keyboard” -> “Shortcuts”.
In the “Mission Control” tab, change or deselect:
ctrl+up,
ctrl+down,
ctrl+left,
ctrl+right
F10
Other key combinations to leave free include:
shiftplus any arrows
ctrl+shiftplus any arrows
ctrl+r,
ctrl+s,
ctrl+h,
ctrl+n | https://afni.nimh.nih.gov/pub/dist/doc/htmldoc/background_install/install_instructs/steps_mac.html | CC-MAIN-2022-40 | refinedweb | 608 | 70.09 |
:
03/06/1841
Subjects
Genre:
newspaper
(
sobekcm
)
Record Information
Rights Management:
All applicable rights reserved by the source institution and holding location.
Resource Identifier:
oclc
-
2260099
System ID:
UF00073214:00033
Full Text
^1n
'atwnIL- t
VOL. XXIX.
WASHINGTON: SATURDAY, MARCH 6, 1841.
~f6q'2i
U
i PUBLISHED BY GALES & SEATON.
PaitEc-ten dollars a year-less than a year, one dollar a month
PAYABLE IN ADVANCE.
ROYAL MAIL FOR LIVERPOOL.
ARNDIEN & CO'S Fe,; ; Leneir Office, and Gene
rdl Foreign P'Fw'irJ...ga''i I L'.C...1 ..... i louse.-Office
Southwest corner of Third and Chestnut streets, nest door to the
Ledger Offies, Philadelphia.
LETTER BAGS will be kept at this ofce fre Cunard's Royal
Mail Line qf Steamships, from BOSTON, via HALIFAX, for
LIVERPOOL.
Also fior the steamers GREAT WESTERN, BRITISH
QUEEN, and PRESIDENT, and the Sailing Packets from New
York.
TAKE NOTICE.-The whole Postage on Letters to the .Con-
tinent of Europe must be paid in advance,
I he full pasage on letters to any part of the United Kingdom or
Prance can (if requested) be paid here, or they may be sent from
Boston and the foreign poRtage paid in England.
Packages, Samples, and Bundles of Goods will be received at
this office, and forwarded to any part of the United Kingdom or
the Continent.
TAKE NOTICE.-There mut be no letters concealed in any
package or bundle left at this office.
J. W. LAWRENCE, Agent, Philadelphia.
No. 4, Lower Castle st Liverpool.
HARNDEN & CO. No. 27, Bucklesbury, London.
SNo. 8, Court street, Boston.
felb 22-di 3m
THE MARLBORO' AND ANNAPOLIS MAIL-
STAGE will leave Washington every Monday, Wed-
nesday, and PFriday at 6 o'clock A. M.
The PORT TOBACCO AND LEONARDTOWN MAIL-
STAGE will leave Washington every Monday and Thursday at 6
o'clock A. M.
Forseats apply at the Steamboat Hotel, opposite the Centre
Market, on Seventh street.
JAS. A. WILLIAMS & CO., Owners.
jan 6-d6'&eo3m BIRCH & SHEKELL, Agents.
HOUR OF STARTING CHANGED.
STEAMBOAT LINE FOR PHILADELPHIA.
On and after Wednesday, 17th instant, thie steamboat CON-
STITU ION will leave Bowly'a wharf for Philadelphia every
morning, (except Sundays,) precisely at 6 o'clock; returning
same day, with tihe passengers froin Philadelphia; putting those
bound South on board the Norfolk boats in the river, and those for
Washington and the West at Baltimore, in time for the evening
train of cars. Passage 64. Meals as usual.
1 S Dally Excursion to Frenchitown and back.
The CONSTITUTION, going up and down the
sams day, affords a pleasant and cheap excursion through the
beautiful scenery of the Chesapeake Bay,enjoying the seabreesae
for about nine hours.
Excursion tickets, including breakfast and dinner, 82.
june 27 T. SHEPPARD, Agent.
FCINE ENGLISH MAPS.-Just received and for sale
S by W. M, MORRISON, fourdoors west of Brown's Hotel,
Gilbert's new map ef thire World, rnaps of London, of British
North America, of Upper and Lower Canada, of the West Indies,
of Mexico, of South America, of Europe, of Asia, of Africa, and of
China.
Also, for sale as above, the Rocky Mountains, or Adventures in
the Far West, by Washington Irving.
Also, tlie Hour and the Man, an historical romance, by Harriet
Martineau, author ofDeerbirook. a, jan 29
.L'OR SALE.--Two small Farms.-The subscriber has
S for sale two small faras, one just beyond the borders of this
city. 'he. tli.r ...,uti I..)n sI.I hi 1- f miles from the Centre Market;
ihe lirst c.riairrng i .cire, .1. litter i3 a'res, with a convenient
d*.llrng ir.j .-th r inre f..v, ,ient.. Apply to
JAS. HOBAN, Attorrney-at-Law,
feb 22-2aw2w Pentn. avenue, between 41 and 6fih streets.
^ TO LET.-A new two-story and basement brick
building on I, between 6th and 7th streets.
SApply to J. C. MeKELDEN,
dec 31-Stawtf Seventh street.
FOR aALE OR Rt ENT, he house at thecorner of
21st and H streets west, formerlyy thire residence of Gen.
Parker. The premises are very convenient in all res-
pects; good stable, carriage- house, and out-houses, with a large
garden and many fruit trees.
Possession may be had on the 1st of April next. Inquire of
J. P. KELLER
feb 12-3tswtf F street, near the Treasury.
P PICTURE OF PHILAD)ELPHIA.-Just received
for sale at Stationers' Hall, a now Picture of Philadelphia,
or the Stianger's Guide to the City and adjoining Districts, in
which are described the public building, literary, scientific, com-
minercial, and benevolent institutions, places of amusement, places
of worship, principal cemeteries, andl every otler object worthy
of attention; with a plan of the zity and map of its environs.
felb 24 W. FISCHER.
BY THE HOUSE OF DELEGATES, JANUARY 22, 1841.
R ESOLVED by the General Assembly of Mary-
land, That the Treasurer of thire Western Shore proceed
forthwith to call a General Meeting of thire Stockholders of the
Chesapeake and Ohio Canal Company at Frederick upon the
earliest convenient day, in pursuance of the resolution unanimous-
ly adopted for the regulation and government of said Company by
the Stockholders thereof on thire tilh day of July, eighteen hun-
dred and twenty-eight, to investigate the affairs anl
Mi ryland at December session, 1840.
Given under our hands at the city of Annapolis, this 26th day
of January, 1841.
GEORGE G. BREWER,
Clerk of the House of Delegates, Md.
JOS. H. NICHOLSON,
Clerk of the Senate, Maryland.
WESTERN SHORE TREASURY OF MD.,
ANNAPOWtS, JANVUAntV 27, 1341.
I N OBEDI ENCE to a resolution ot the General As-
sembly of Maryland of December session, 184t, of which the
foregoing is a copy, and in pursuanrce o the resolution of the Stock-
a holders therein referred to, a General Meeting of thire Stockhold-
ers ofthe Chesapeake and Ohio Canal Company is hereby called,
to assemble and be held at the Company's Office in the city of
Frederick, in Frederick county of Maryland,on Monday, (ihe 8th
day of March next, at 12 o'clock, M., to investigate the affairs
of the Company and their past management, and to take such fur-
ther order in the premises as the interest of the stockholders may
require." GEORGE MACKUBIN,
jan 30-tl8thMar Treasurer W. .. Maryland.
Ir|0 FISHERMUEN.--BOOTS AND SHO.6S.-
U- The subscriber has on hand a large assortment of coarse
pegged and sewed Boots, Brogans: &, !.etitable for persons about
entering tire fishing business. 1 Itll s:11 them for cost, or very
near, for the sake of disposing of them. To all who wish to sup-
ply themselves for the season, before going down the rivar, I
would say, give me a call, and save 10 per cent.
ANDREW HOOVER,
feb 19-6teo No. 10 Penn. Av opposite Brown's Hotel.
A SMALL FARM FOR SALE within four miles of
Washington and two miles from Bladensburg, containing
92 acres of land, upon which is a fine orchard of young peach
and apple trees, and a comfortable two-story frame house. The
whole place is now in a good state of cultivation, and is favorably
licated for a market farm. For particulars, &c. inquire of J. F.
CALLU.AN, at his Drug and Seed Store, corner of E and Seventh
streets, or to the subscriber, on the- premises.
feb 22-eo-t o t J." C. KLAMROTH.
OUI E-FUR N ISHIN G WARE-ROOMS. Penin.-
Iylvattla avenue, opposite Brawn's Hotel.-
BOTELER & DONN would respectfully inform their customers
and the Public that they have just received, in addition to their
*tock, which embraces a general assortment of HOUSE-FUR-
NISHING GOODS, viz.
'Mahogany Furniture and Chairs
Beds, Mattresses, and Bedsteads on hand, and made to order
Plated and German Silver Goods, Knives and Forks
China, Glass, and Crockery Ware
Gilt and Mahogany frame Looking Glasses
Baskets and Brushes
Britannia Ware and Bead Baskets
Astral, Hall, and Glass Lamps
Iron, Tin, and Wooden Ware
,Stone Ware, &c. besides a variety of fancy and useful arti-
cles, which they will sell at fair prices, and to which they invite
the attentions of persons furnishing.
Their object has been to com;bina every necessary article used
In house-keeping in the same establishment, and, after an expe-
rience of ten years, they have sueeeeded to a considerable extent,
and are now prepared to furnish house complete at a short no-
tice. feb 27-eod2w
T HE STATESMAN, by John Holmes,.of Maine,
or, Principlea of Legislation and Law, in 1 volume. The
design of ths work is to state, with as much brevity as possible,
the principles and progress of legislation of the State- and Fede-
ral Governments,and an abstract of the statute and common law,
as regards civil and criminal jurisprudence, excluding, as much
as possible, all technical expressions and phrases, end explaining
whatever might be considered professional to the comprehension
of general readers."
Lately published and for sale by
mir 8 P. TAYLOR.
Al-u, lost palhshed, History of the Federal Government for
Fifty Years fgTm March, 1769, to March, 1839, by Alden Brad-
ford, LL. D. I vol. ocIavo; anda large variety of works of the
me c-las ad obar-I ter as the botve,
CABINET, CHAIR, AND SOFA MANUFAC-
S 'IORY.-EDWIN GREEN, at the old establishment,
corner of C and lOth streets, has now on hand a very large stock
of Cabinet Furniture, of every variety, from the lowest price sub-
stantial to thie most elegant and fashionable, of the bust workman-
ship and materials, which he will sell at very low prices. His
stock is comprised, in part, of the following:
Sofas and Lounges of every variety
Centre and Pier Tables, with mahogany and marble tops
Winged, plain and common Wardrobes
Sideboarns and Pedestals, with mahogany and marble tops
Dining, Card, and Breakfastr Tables of every variety
MarUle, mahogany, and painted Washstands
French Scroll, high and low-post Bedsteads, of mahogany,
munle, and other woods
Bureaus, with marble and mahogany tops, with and without
mirrors
Chairs of mahogany, walnut, and other woods, with hair, cans,
Sand wood seats
Crit.s, Cradles, Work stands, Music Stools, Candle Stands,
Ottomans, Fo.t-stools
Also, Beds, Mattresses of best curled hair always on hand
or made to order
Upholstering ald every description of repairs done promptly.
Mahogany, in the board, plank, and veneer, suitable for cabinet-
makers and builders, arwxys for sale.
Furniture wagons, with careful drivers, accustomed to moving
furniture, always for hire.
mar 4-eo3t [Globej E. GREEN.
" One single ounce of facts, wel sted, is worth more than a
ship loid of arguments."
"MURDDOCH'S VERNA tLAR TOOTH-ACH
Vl EM EDY.--A certain, safe, and speedy cure for that
most agonizing of all pains. The following are attested facts,
certified to by some of our most eminent men ; among them are
Dhysiciasri-,nt'mt-, '.p r, .-,.- n Ie.I
It was never ki1, i,,, In i vie.re it could be applied and the
directions were followed. It is used by dentists in preference to
all other remedies.
n" If 5 or 6 drops are put into 2 tableapoonfulls of water, and
used as a Tooth-Wash, it will cure gum-bites, and correct fetid
breath.
It possesses thie most salutary virtues in cleansing and beautify-
ing the teeth; it strengthens tie giumins, eradicates thie scurvy,
sweetens the breath, preserves the teeth from decaying, and pre-
vents them from achinir. Price 25 cents per vial.
Agents, CHAS. STOTT, Washington; 0. M. LINTHICUM,
Georgetown. mar 5-7t
THE SUBSCRIBER OFFERS FOR RENT
",Evermay," the residence of the late Lcwis Grant
frJ.s n i..,,, itu mii-m: .1 ii ih. i irer-' i.'i- ..tir l IHeights of George-
t.- ;, a. i n si i.- ira- I L,C .' m J..bn M.lason, jr. Tiledwol-
ling-house comprises every, advantage of structure and position
most desirable in a private residence. It. is substantially built pf
brick, is two stories high, with neatly finish-ed garrets, and has
four large rooms on each floor, separated by a central and spa-
cious passage, running north and south, the whole length of the
house, togetherr with wing for kitchen, servants' rooms, pantry,
&c.; stables, carriage-house, cow-shed, dairy, gardener's house,
and other offices, all of brick, 9ie attached. The lit covers ar
area of twenty acres and more, which is nuw nnder fine cultiva-
tion, as garden, orchard, grass fields, and woodland. The house
faces the south, and is located on a lofty eminence, commanding
a panorama of the extensivyoand beautiful Frispect in front, while
it embraces in the rear a delightful northern view, of which the
entire range of tha Heights west is, perhaps, deprived. That
portion of the grounds which lies immediately before the dwel-
ling forms a slope of a natural terrace not only very agreeable to
the eye and susceptible of tlie highest embellishment, but, oa ac-
count of the f,-rtility of the soil and the excellent exposure, ad-
mirably adapted to horticultural purposes, to which it has for a
series of years been very profitably applied under the manage-
ment of professional gard ,.r r, TI,.- r..m- i.m.. ,. 'f -if ;, i.; .-
to the metropolis, and its tim, I. -7 .....ri,. I n- h ....n ..,,.,' .1 IIb '
comforts of a rural seat, .!,,i I ii'- i i Ain r. i.:- r,. ,
(the chutuches, schools, markets, and other resortsof business he-
ir.,; ,t i, .: i,. ,iient distance,) present a rare opportunity to For-
,ui MI..-ma, rp,, Memnbers of the Cabinet or of Congress to secure
an Pegtsnr aud commodious abode upon satisfactory terms.
r. o p 'r,, with whom economy may be an inducement, and
who may not be aware of the fact, it is respectfily suggested
that sie comparative cheapnnss' of rents in Goorgetown is very
important and well worthy of their attention.
lPossesslou willbea pi-en on the first d.y of April next ensuing.
For father information inquire of the ; fi- p, i.. i th wsteu-
corner of Gay ani Montgomery streets,, :-r-.r., ,, D. C.
feb 11-wtf ELIZA G. IDAVIDSON.
CIHAPMA.
so celebrate
well-corked, and
day received, fur
of and 7th stroe
Hotel keepers
this delightful he
mar 3-ee3t
DOTTERY
PREMIUM WIGS ANM S'ALt.PS.-CLIREHUGH, J -&c. meanu
No. 207, Broadway, New York, announces his arrival of 8th and I stre,
n Washington, and during his sisit will be found at Mr. Brooks', Also, c.-.,,.,,nil
ennsylvaria avenue, between 41 and 31 streets, or at Parker's and oval r.i, jr.
Dressing-room, Gadsby's Hotel. with all a- iI .....
The many attempts that ore daily making to imitate these cele- will be ,it-.. .1
rated Wigs and Scalps arejust somany proofsofthe highcharac- *l '-, 1,.-l
ur they have attained, and the est'imdation they are held in by the rnai'3-.i ...
trade. But tlne Public will observe that Clirehugh is the original lli Nii \-
maker, in this country, of the Ventilating and Gossamer Wigs t .-, ,
nd Scalps, (without inetallic springs,) and that all ethers are but importdtion il.-
ne hie attempts at imitation-wanliug the genius to divine or di- He also lhau
rect the principle on which they are made to fit, and the skill and Wines, of hia ow
practice to execute. casks, and in boti
All wearers andl connoisseurs are invited to inspect his Heads packed so as to ci
I Hair, which, for elegance, lightness, and durability, may be mar 4-3t
passed aumion the first productions of modern art.
Senators, Members of Coagress, anti Gentlemen from every 'I..UIDE T
late of the Union who are now wearing Clirehughi's Wigs can G Offices, au
e referred to. feh 22-d2w diagram plans, c
tie relative positi
r Wint) FARMS FOR SALe-.-The subscriber has for officers' rooms, l
U sale a tract of land containing 116J acres, nrine miles north Robert Mills, Arc
f Washington, well watered, land of good quality, and fifty-five saleat thebook ae
r sixty acres in timber; na buildings, but will obe sold as a
bargain. I a, 12
The other farm contains 130 acres; has tolerable buildings, and r t.siUlASlUB
art well improved, having about 22 acres well set in clover, ML. The subs(
tome choice fruit and good water, and timber land in abundance funds andl Virgir
ir the support of the farm. Either of the above places will be New York funds.
isposed of on easy terms, or sold united, as they adjoin each Apply at his *fl
other. For conditions, apply (if by letter postage free) to mar 2-2w
WM. THOMPSON,
Guerenl Agent, VFIRAN SPA
feb 19-9t Office Louisiana avenue, op. Unitarian Church. ,Tire s0wb"t
he is now prepar
D R. AMOS G. MULL'S TRUSSES I-Every va- Land.c pes, Ru
riety of Hull's Trusses sold and applied at C. H. JAMEs's is competent to e
Drug store, Pennsylvania avenue, tronrge which hi,
I)r. HULL'S RADICAL CUR TRuses, a recent invention, and his Transparencies
SnDOMINAL SUPPORTER, or Lsdies' Truss, received the Gold Me- will be executed
bl from the American Institute in October last, and were report- of every style of
d by there Medical Commission of that body as "entirely superior ed nto order.
Small other Trusses in use." It is the only Truss patronized by 3 HoStts P)
e Medical profession generally.
jan 29-d2m AMOS G. HULL & CO. feb 12-eolm
S ALE OF VALUABLE PROPERTY.-By virtue
of a deed of trust, recorded in litter W B, No. 60, folios 216,
217, 218, 219, of the land records for Washington county, in the
District of Columbia, and for the purposes mentioned in the said
deed, I shall, on Saturday, the 6th day of February next, proceed
to sell, at public auction, to the highest bidder, for cash, one full
undivided third part of lots numbered 1,2, 7, 8, 9, 12, and 13, in
square 219, as laid down and distinguished on the plan of the city
of Washington.
This valuable property is in the n'ei lt,.rl ,-..I of St. John's
Church, the President's House, and tl..: L%. ,. offices. A plat
of it is left with the Auctioneers. Thire title is believed to be un-
questionable, but such only will be conveyed to tire purchaser or
purchasers as is vested in thire Trustee.
Sale to be made at 4 o'clock, at the auction rooms of E. Dyer&
Co. PHILIP R. FENDALL. Trustee.
EDWARLi [DYElR & CO.
jan 7-lawts&ds. Auctioneers.
nr The above sale is postponed to ltur.l,. ie 6fth March
next, same hour end place. P. R. FENI' 'tL I., Trus!ee.
feb 6-law&ds EDW. DYER& CO. Auclts.
In- The above sale is further postponed to Saturday, April
3d, at the same hour and place, vhent and where it will positively
he made. lfb24i-h -wts
G O)OD LETTER PAPER, faint lined, at 3 dollars
per ream, a most excellent and cheap article. Also,a great
variety of Paper at the lowest prices, at thie Bookstore of
R. FARNHAM,
sept28 Between 9th and 10th sts. Penn.avenue.
PAUL PRESTON'S Voyages, Travels, and Re-
S markable Adventures, as related by himself, with en-
gravings, just received and for sale at the Bookstore of
R. FARNHAM,
jan 1 between 9th andt 10th streets, Penn. avenue.
State of North Carolina, County of Wake, In the
Court of Equity.
Duncan Camcrrn and George W. Mordecai, plaintiffs,
against
The Commissioners of the city of Raleigh and others, defendants.
T H .L Pliintiffs in their bill state that John Rex, late of Wake
E .-.,,v, by his will, appointed then his executors, and de-
vis-.-l i.i t..p *' I ..I to them all his property, real and personal,
in ".1 t :.r. Ii.,ni ; .ipon trust, as to his slaves, to cause them to
be removed to some colonyin Africa underthe charge ofthe Amoe-
rican Colonization Society ; upon trust, as to certain of his other
property, to defray the charges of such removal, and of Ithe sup-
port and establishment of such slaves in Africa ; and as to the
whole residue of tris estate, upon truot, for the erection and endow-
ment of an infirmary or hospital for the sick and afflicted poor of
the city of Raleigh. That the plaintiffs have caused to be remov-
ed to, and established in, the Coloniy of Liberia, in Africa, negroes
Hulibard, Dick, Ben, Ass, Ellick, Abram, Sampson, Henry, Lin-
dy, Hagar, Jenny, Martha, Becky, Creasy, Ruth, and Eliza, who
are named defendants in thie bill, snd are -now free inhabitants of
Africa. That questions have arisen on the testator's will as to llre
amount afthe fund set apart for the removal of the said negroes,
and whether the whole interest therein is given by the will to the
said negroes, or whether the remainder thereof, now in the hands
ofthe plaintiffs, belongs to the said negroes or falls into and passes
with the general residue devised and bequeathed in trust for the
erection and endowmentof the charity mentioned in the will. And
the bill prays the opinion and advice of the court, exhibits an at-
count of the administration of the plaintifli, and ofthe state of the
fund in their hands, submits to any accounts or reference which
the court may deem proper, or the parties may desire, and prays
that their accounts may be aud ted, settled, and passed, under the
direction of the court, and the plaintiffs protected by a decree,
and for general relief. And the plaintiffs having filed with tujeir
said bill an affidavit, in writing, showing that the defendants Hub-
bard, Dick, Ben, Asa, Ellick, Abram, Sampson, Henry, Lindy,
Hagar, Jenny, Martha, Becky, Greasy, Rut!-h, and Eliza, are not
residents of North Carolina, but of Liberia, in Africa, beyond the
jurisdiction of this court, and having thereupon desired an adver-
tiseniment to be made for tie appearance of the said defendants,
according to the act of Assembly in that case lately made, thire said
defendants, Hubbard, Dick, Ben, Asa, Ellick, Abram, Sampson,
Henry, Lindy, Hagar, Jenny, Martha, Becky, Creasy, Ruth, and
Eliza, are accordingly hereby warned and notified, personally, or
by some solicitor of thie said court of equity, toi be and appear at
the court to be holden at the court-house in the city of Ra-
leigh, on the first Monday after thie fourth Monday of March, A. D.
1841, and plead, answer, or demur to the plaintiffs' said bill, other-
wise the said bill as against the said defendants, or such and so many
of them as shall fail to appear aa aforesaid, will be taken for con-
fessed, and be heard, according to the course of the court, expartle.
Witrtess Thomas L West, Clerk and Master of the said court,
at office this 28th January, A. D. 1841.
"feb 5-wfiw T. L. WES7, C. & M. 0.
PUBLIC LANDS, LAND LAWS, &eC., in two
S volumes, with maps, &e. ; containing the general public
acts of Congress respecting tihe sale and disposition of the public
lands, with the instructions issued from time to time from the
Treasury Departmnent and General Land Office, nd the official
opinions.of the Attorney General on all questions arising under
the land laws.
Published by order of the United Slates Senate-a scarce and
valuable book. For sale (a few copies only) by
mar 3 F. TAYLOR.
OTS FOR SALE.-The following Iota will be sold on
S accommodating terms, viz.
Lot No. 2, in square 263.
Do 6, 9, 10,10, do 264.
Do 12, do 317.
Do 14, 17, 18, 19, do 529. "
Do 5, 6, 7, 14, 15, do 530.
Do 9, 13, do 534.
Persons wishing to build an any of them can obtain several
years' credit. Apply to
p ar 3-2w3w GEO, GILLISS, Agent,
N'IS .I)A WATER--This Sida Water,
ed in Baltimore, may be had, in handsomnie bottles
equalling that just drawn froin the fountain, to-
sale, by the dozen ot sins Ie bottle, at the corner
sis.
and families are invited to call and make trial of
.verye.
vr"i. _J. P. CALLAN.
'.- Sr i.. Ware, Jugs, Jars, Pirchers, Milk Paes,
factored by JAMES E. JONES & CO. corner
eta, Washington.
i ii ,.t-Red and Black China Ware round
.-_ .-il-. Pots, ditmontl Pittchers, Creams, &c.
iii ,in, .1 C.ommou Earthen Ware, all of which
.I ar I'. lowest factory prices.
ri.-, i, ti. of cartage to any part of the city.
,l|a. N L.Y, r.\ ,ndria, has on land, and offers
.'.'.. kTi,k -: H -I ia" Champagne, of his own
:.*r .?r a I.- r.j[r- I.; office old Madeira and Port
in ispartation, in pipes, hogsheads, end quarter-
tes Iteiup in boxes of one and twodozen each,
arry in safety to any part of the United states.
i0 THE NAit)NAL EXECUTIVE
nd the Capitol of the United States, illustrated by
designating tire several Executive buildings, and
on of the different departments, their bureaus and
and also the committee rooms in the Capitol, by
hilect P-,blie Buildtings. Just published and for
ind stationery store of R. FARNHAM,
Peno. svenuuirihtwe'n 91hoan I t1011 Si
.Y NOTES, SPECIE, NEW a 0OR FUNDS.
criber will pay the highest premium in Baltimore
nia Bank Notes for Specie, Treasury Notes, and
fice, Georgetown.
W. S. NICHOT.LS.
KRENCIES AND SIGN PAINTING.
criber would respectfully inform the Public that
ed to execute Transparent Blinds for windows,
ins, &e. to order, having engaged a person who
xecute the satne. He wilt feel thankful for any pt-
s friends may feel disposed to give him i n this line.
for Clubs, Log Cabins, &c. Banners, Flags, &c.
I in the New York style. Gilding in oil, Signs
f letter, Flags and Banners of any design execut-
AINTING and GLAZING, in all its various branches.
M. T. PARKER,
E street, near the corner of 7rhstreot.
i IRUGS I DRUGS II DRUGSII--Tie subscriber,
Jr having disposed of his stock of Drugs, Medicines, Pdaiey
Articles, Paints, Oils, &e. &c. to Mr. Charles T. Jardella, with
the intention of leaving the city, avails himself of the occasion to
tender his hanks to his former customers for their kind patron-
age, and rilIit i [4 behalf of his successor a continuation thereof.
Tii, .,,.' ni I'l having determined to leave Wi-l.i.,t. n imme
diately after the first of March, desires that all lai-s against
him may be presented for settlement ; and all persons indebted
are hereby notified thatall accounts unsettled on the let of March
will necessarily be placed in the hands of a collector for settle-
ment. W. KIRKWOOD.
The subscriber would respectfully inform his friends and the
Public generally that hie has purchased of Mr. Wallace Kirkwood*
his entire stock of Dirugs, Medicines, Perfumery, Fancy Articles,
Paints, Oils, &c. &c. which, with an additional supply of goods
recently received, makes his stock complete.
The subscriber hopes, by strict attention to business, and care
to pleo>se all those who may favor himin with a call, to merit a share
of I." ; F. .' ......
Pi. .-._-.i. r I I 'i '.:.1 t.'. illy compounded.
-feb 17-er,2w .C. T. JARDELILA.
C KCKLOFF, Merclha,t Tailor, respectfidly inlorms
S thie citizens generally and strangers visiting the city, that
they can flend at all times at his stores a large and select assort-
ment of Seasonable Goods, which will be made up to order in a
manner that cannot fail to give satisfaction to all who may be
pleased to give him a call.
He feels warranted in saying that Iris stock of Ready-made
Clothing is superior in quantity,' quality of goods, and finish, to
any ever offered in'the District.
He has also on hand a fashionable assortment of Fancy Articles
of every description.
Gentlemen in want of any of the above goods will find it to
their advantage, if they are in want of superior a ticles, to call at
his stores on Penn. avenue, nearly opposite Brown's Hotel and
between 12th and 13 streets. jan 2"2-eo2m
fI)OLD ANI) SILViAR PENCIIa CASES.-W.
%X FISCHER has just received foin the manuf-cturers,
Messrs. Addison, Witmarth, & Co. a n lirt- supply of their supr-
rior Gold and Silver Ever-fointed P,. .'- I cases and Pen holders,
the former at prices from $4 to $15, and the latter from 50 cents
to $2 50, each embracing a variety of patterns, with rings for
ladies' use. The best assortment is constantly kept frr sale, at
reasonable and uniForm prices, at Stationers' Hall. fob 24
OBBIINGi GARIJUINEIR.-R. WALKER, at Ithe re-'
quest of numerous patrons, takes this method of informing all
those that may require His services, that he still continues to un-
dertake the laying out of Flower G.,rdens and Grass Plate on the
most approved plans; also to primune Grape Vines, Fruit Trees,
&c. Those wishing such work performed, can always hear of me
on application tin Winm. BuHoist or John Douglass, Florists.
Shade Trees pruned, furnished, and planted, or asoy thing con-
nected with the above profession, feb I-eo4w
IIlIE GAME OF BILLIARDS scientifically explain
I- ed and practically set forth in a series of novel and extra-
erdinary games and positions, I vol. filled with engravings, dia.
grams, &e. to which are added the rules and regulations which
govern the numerous gamts as they are played at the present
day in all the countries in Europe, I vol. London, 1840. Asiogle
copy just imported and for sale by
fob 22 F. TAYLORt.
M AP O1" TEXAS.-Just received at Stationers' Hall a
Map and Description of Texas, containing sketches of its
History, Geology, G-. ,r i'j i, ani rri Statistics, with concise state-
ments relative to -i .1 ,, .: IIt, productions, facilities of trans-
portation, population oh the country, and some brief remarks upon
the character and customs of its inhabitants, by Francis Moore,
Esq. Editor of rthe Telegraph and Texas Register. feb 19
'l141C .IFE ANO TIMES OFt MARTIN LU-
STHER, by tihe author of Three Experiments of Living,
Sketches of the Old Painters, &c. Also, the Life and Times of
Thomas Cranumer, by lthe same author, are just published, and for
sale by VW. M. MORRISON,
feb 22 Pour doors west of Brown's Hotel.
NI1RMARY FOR THE GRAVEL.-Dr. S. H. P.
LEiE, for so many years known as the discoverer of the cele-
brated New London Bilious Pills, has removed to New Yoetk, and
has opened sn infirmary at 70 Nassau street. Dr. LEE is so well
known through this country, it is hardly necessary to speak of him.
We have been acquainted with him lbfor thirty years. He is a reg-
ular physician, of established reputation, a gentleman of intelli-
gence and character. Fora number of years he has been a suc-
cessful practitioner for that disease, which is said to be so excru-
ciatingly painful and dangerous. He ihas established himself here
to extend his sphere of usefulness, and has exhibited to us a great
number of private letters from highly respectable persona, who
state that they have been entirely cured under his treatment.
Dr. LEa is a gentleman in whom tihe Public may place entire
confidence.
S3 Application by letter, describing symptoms, (post paid,) ad-
dressed to the Doctor as above, will be duly and confidentially at
tended to, and the modi-ine sent to order, with directions, to any
part of the world.
New York, January, 1841. jainn 28-peo7w
(NUFF, SEGARS, AN I) TOBACCO.-Thesubscri-
IZ! ber respectfully informs his friends and customers thathe has
added to his stock an entire fresh supply of Snuff, Segars, and To-
bacco, which he intends to keep constantlyon hand. The Segars
are ofeuperior brands, and the Snuffs put up by an old established
house-such as Congress, Demi-Gros, Senators' Mixtire, Ameri-
can Gentleman, Maccaboy, Rappee, &c. Ho respectfully solicits
a share of public patronage.
GARRET ANDERSON,
jan 15-3taw4w Penn. av. between llth and 12th sts.
ULWER'S NEW NOVEL-Nisht aid Morning, by
the author of Pelham, &c. is just publiabed and for sale by
L W, M. MORRISON, four door west ofBrowi's Hotel.
ITO0 THE rSTOCKHOLDERS OF THE UNITED
S. TATESBANK IN MARYLAND, VIRGINIA,
AND DIILAWARIE.-You are aware that an adjourned
meetingg of the Sockholders of tihe United States Bank is to be
held io Philud-ephia on the lst Monday of April next, when a
committee of investigation is to report on its actual situation.
Preparatory'o this meeting, sand with a view, if necessary, to a
concert of acting at thIe same, a meeting of Stockholders to a large
amount was held at the Exchange in Bahltitoore on the 17th ult.
anil the under;goned were appointed by them a committee to col-
lectas accurate information onthe subject as possible, and to ne-
pirt to a meeong of Maryland Stockholders, and others who may
choose to units with them, at a meeting to be held in Baltimore
on the 25th March next, with such plans fir consideration with
reference to vhat is to be done at the meCeting in Philadelphia, in
April, as theymay deem advisable, and ti take the necessary steps
in the mean tine to further the objects in view. The proceedings
fm it... ,,.,-ri., 11, H .tt;,,, -r- rave been published, and the under-
irr.i .-l. ...,i e r I ".'i i j[ recommend that ihe Stockholders
in Virginia, Maryland, and Delaware attend or be reprn sented at
the meeting in HBaltimore on the 25th March next, and that they
furnish their agents, or, if they choose, this committee, with pow-
ers of a'torney properly prepared and nu henwi'ated to act for
then at the meeting of April in Philadelphia, andi with instruc-
tions as to their wishes. J. S. NICHOLAS,
J. S. DONNFLL,
mar 3-3t R.A. TAYLOR.
UNION BANK OF GEOnSRTOWN.
T H8 President and Directors have declared a farther divi
-dead on the Capital Stock of this institution of 6 per cent.
which will be paid to the stockholders, or to their duly authorized
att rneys5 at their office, in Georgetown, when called for.
JNO. MARBURY,
feb 27-6t Pr, sident Uoion Bank.
AlUABL s I N VK'.TM fcNT.-A few tracts of Land
foir sale, near the junction of the Ohio and Mississippi rivers,
a few miles from theo city of Cairo, anti situated on and near the
line of tire Central Railroad of Illinois, which has been more em
less coumnpletie fior forty miles. The tend is of the richest quality,
dry, and chiefly covered with timber f the finest kind. The im-
provements now in progress, under the influence of foreign capi-
tal, "rill rkeim Caiio city one of the moast admirable town sites in
tho West, and it is rapidly advancing to the importance, in a com-
mercial point of view, for which its geographical situation so eni-
nently fits it. For further particulars ii.quire of KING & WIL-
SON, Land Agents, F -treet, near the Treasury. mar 3-3t
W EBST'ERI'S OrCTAVo U ICr'IlONARY.-Recom-
inmeiatimons:
Prom officers of Yale antd Middleburg Colleges.--" The
merits of Dr. WVebster's American Dictionary of the English lan-
guage are very extensively acknowledged. We regard it as a
'it l '.,. in -. ooI .:.n all thie works which have preceded it: the
i.- i,,., ., i.,. ,1 i,"I'racter of discrimination, copiousness, per-
spicnity, and accuracy not found, we believe, in any other diction-
aryof tihe I I.'..: i ,.,- '
Front J."* F, ... i t' ; officers of the Wesleyan Univer-
sity, Middletsn, Conn.-"We have seen and examined your
Amuerican Dictoarry, and we think it unrivalled by any work of
the kind in the English language."
Fro'mi E .4.' ', i -f r. \,-: i.'., .-.ridgeladependent Press.-
When this Work is as well known in Blritain as it is in America,
it will supersede every other book of the kind in the same de-
partment of letters. Its excellence is obvious and indisputable."
Perom the London Examiner.-" The veteran Webster's
work is new to this country ; but, as far as we can judge, it seems
to justify the highly favorable character it has long maintained in
America, and our view is corroboratedL by that of a learned friend
and cr iti-, who does not hesitate to say th it it is the best and most
useful dictionary of the English language lie has ever seen."
Many more testimonials might be added from highly distin-
guishied men and institutions in England and America.
The work may be had of the booksellers in most of the princi-
pal towns and cities in the United States, and is published by
WHITE & SHEFFIELD,
dec 28-2aw3m 29 Libertvstreet, New York.
11PlENDI) BOSTON lIlANO.--Mr. W. PRATT,
Professor of Music, 12thstreet, soutir of Pennsylvania ave-
nue, has for sale a rich variety of Gilbert & Co.'s superior Piano
Fortes, to which he respectfully invites the attention of ladies andt
gentlemen wishing to procure a first-rate instrument on reasrona-
ble terms. Second hand Pianoas taken in exchange. Several
packages without extra charge.
Mr. P. gives instruction on the Piano, Guitar, anud Vocal Music.
mar 2-eo2w [Madisonian]
JEADY FOR TRiE IIES OF MARCH! HitN-
J OR TO WHOM HONOR IS DUEI-Eight living
wonders of the world ("' Monsters") captured and will be over-
thrown and slaughtered by the indomiitable perseverance, public
spirit, and courage, ofsine man, who, in clearing away the "spoils
of his victory," desires not to leave a trace"-no, not a "grease
spot"-behind, which can give them a locall habitation and a
ntrme." But HOOVER will address himself at ones to the
"business and bosoms" of his fellow-citizens, an-Il in a matter-
of frct way, too, which he is sure must touch or awaken every
chord of their kindest sympathy aud fellow-feeling. Ever anx
bous (as hie is known always to have been) to minister to the most
pressing wants of his follow-citizcns, and to enable them, now, on
this present auspicious and happy occsaion, to hold high festi-
val," with credit and honor, in the presence ofthe assembled wis-
dom of the world, and of ilt. .l-... .,i guests of the Metrooulis of
the only free nation on ti ,,t., H ..... r icspecfuilly announces to
the ladies and gentlemen of Washington that lI ihas taken great
pains to procure, and will expose for sale, at the most accomimo-
idating prices, at his repository of choice viands in the Centre
Market, on Thumsday and Saturday mornings next,
EIGHT SUPERB BEEVES, OF THE LARGEST SIZE AND
OF THE FINEST POINTS.
Thise 8 cattle, -'a .i-;r, ;rn, the aggregate 18,500 pommnds, were
raised by James IP.-.-.r, i of Lao.caster county, upon the no-
ble soil of patriotic old Pennsylvania (God bless her! fir what
shie has done, and, still more, for what she intends to do t)--a State,
we all know, second to none upon eaith in the superiourity of its
useful productions in the Animal, Vegetable, and M.n. rl ik. i.e,.'
donis. It is said Tihe great Buffoa never visited thl ii a'-. H.
certainly never could have seen these cattle., Animoated na-
ture," he says, "i of diminutive siz, sand dwindles in the New
World." Indeed ! Good God i! what lies some people will utter
to promote theirselfi.h interest Virgil, hi his Georgics, says no
such thing : Ibuthe, probably, never saw any other than the mean
little black Chivikanuixon-looking cattle, to be found 580 or 1,000
miles found his owun residence. Hoover invites all the world to
call audl see liiii, by ocular demonstration, put down this national
1l.-.,,%m of thegreat naturalist. AAnd, particularly, all French,
i.'r.-.", Portuguese, and Italian gentlemen, and of the isles of the
Mediterranenanand, if arny, the diplomatic functionaries of Mo-
roccp, Tripoli, IhTinis, Algiers, Constantinople, Persia, Siam, Mus-
cat, &c., &c, residing "nrar the United States." Brag is a
good dog, but lfoldfast is a better." The which writing, the en-
-i ..-,r .,.i i ..I support ofin my fellow-citizens will prove true.
ur-,-,r .-. > _n JOHN HOOVER.
MONUMENTS OF WASIIINGION'S PATRI-
lOTSll[.-This 'work, which has been got p at much
expense, is now offered to the Public for sale, for the purpose of
( .to -hi, ti i the District of Colmubia a free instimtion to be de-
lnrnirtd 1 AeSHINGTON'S MANUAL LABOR SCHOOL AND MALE
ORPHAN AsvytiM.
Its object is to educate and train up boys who, from their desti-
tute situation are peculiarly exposed to ruin, and prepare them to
become useful members of soincty. In the work is a fit. simile of
Washington s expendli-., P .1.1-r.i,, : h. li i. .ii -r.r.. 'r, with
many other valuable d ''. ir o.., n . lik. -ne .ikr ... r.,. -t-'s paint-
ing at the Stlate Chamber, and Views ef Mount Vernon.
Copies of the work may be had at most of the Bookstores in
Wv ,n.t'i n ar..-I i the Rotundo at the Gapitol; also, in Alexan-
.1r.a l (.-.!r, --..u,,. P. W. GALLAUDET,
unar I-ea3t General Agent.
W AV HIE Y- NOV ELS.-Castle Dangerous and Tales
ofa Grand.aither, first series, being a further supply ofthe
cheap edition of the Waverley Novels, iust received, and for sale
by W. M. MORRISON,
jan 6 Four doors west of Brown's Hotel.
C .HAMPAGN ., WIlE SPER _M CANDLES.
100 baskets of the well-known Anchor brand
G0 do highly esteemed Cabinet do
100 boxes Sperm Candles, of superior quality.
Just received for sale ay
SEMMES & MURRAY.
fhb i5i-2w'tw (Glo
If AUaB ' Ht9'l'll.--Warnted ininnedmarely by tie tmb-
secribers, men and women servants, either white or colored,
to th.m-, ..'--1 wages will be given.
a-". -.. (Balt. Amer ) NEWTON & GADSBY.
r' l4 E SCtIOOL DOR POLITICIANS, orm N)N-
U- Ct)MMITTAIa," a Comedy in 5 acts, translated from the
French of SCsnBz, just-published, and for sale by
jan 22 F. TAYLOR.
; 'JEW MUSICa-Just received, tne following pieces oh
1L1New Music, at the old established store, two doors east of
the City Post Office. W. FISCHER.
0 touch for me thy Harp again ; 0 ever thus from Childhood's
Hou:r 'Tis merry to hear at evening time ; The Pilgim'os Rest,
(with beautiful vignette;) Ye jolly voung Whigs of Ohio; Del,!
Conte, Conte, li prendi, (duet from La Normr ;) My dwelling is
no lordly hall ; She would not know me, by T. H. Bayly, Esq.;
the Farewell, (duet as sung by Mr. and Mrs. Wood;) Luise
Wali, by Krugell; The Grasshopper's Wals, by Nolcinit; Eagle
Gallopocle, by Endligh; 0 K Quiek Step, by J. K. Oph ; Fanta-
sie brillnnte, by Herz; Le Petit Tambour, for 2 performers;
Grand Fantasie Introduction and brilliant Variations to the Rus-
sian Dance; Le Reodezvouz de Chasse, by Rossini ; Bertini's
favorite easy Lessons for young Pupils, arranged and fingered
for the Piano Forte by the Atthor feb 22
IMMI' NEW NOVEl., The KI-smern, or the
mC! Black Riders of Congaree, and Walsh's Sketches of
the Conspiemouns Living Ciaracters of France, are just received
fir sale by F. TAYLOR, or for circulation among the subsm-rilrs
to the Waiverley Circulating Library. feb 15
G ORUION'S DIGEST OF THE LAWn toF THE
UNITED STATES, including an abstract of the ju-
dicial decisions relating to the constitutional and statutory law.
Just received for sale by
feb 22 P. TAYLOR.
SPIC'rACLEiS LOOST.-A few days since a pair of gold
Spectacles. The finder will be liberally rewarded by leav-
ing them with Dr. G. W. CRUMP, at the Pension Office.
P SUII4ORDINATION, a Story of Baltimore, by the au-
thor of The Subordinate, in one volume. .....
Just received and for sale at the Bookstore of
R. FARNHAM,
feb S7 Penn. avenue, between 9th and 10th streets,
B EHOLD THE OLD DOMINION TRIUMPH-
ANT OVER TIlE KEY-STONE STATEI-
Never was honor more richly inerited and j istly due tian in the
'.ni r : ,..ll -, .1 H .sh t. .aitilu l cattle that were exhibited
.J l'.,r..t-d jlgP I' r, i. ii.i Avenue by Mr. WALKER, the
most indefatigable victualler is Washington. Whatever a Buffn
may assert, it must be evident hlie never visited South Branch, Po-
tomar, in Virginia, where all cavilling about superiority of .-r..-,r.g
would be put to flight, and the old Keystone be left as far out of
sight as Biutlon was int his imagination. It is generally admitted
on all hands, and by the most competent judges, that Virginia pro-
duces uniformly as good beef as any portion of this country, and
at no time do we witness Chickamuxen cattle coamning from her.
As truth is mighty and will prevail, those who freast.i hepir eyes
on those extraordinary productions of animal nature, jr,.j &cured
a portion of it, were truly gratified. Walker feels grateful to his
fellow-citizens for their liberal encouragement; and, as he spares
no pains to give general satisfaction, what hie represents to be good
you have found by ocular demonEtratin to excel, even beyond
your own expectations. Walker still has one piece, which was
too fat to be disposed of. Mr. Jesse Brown has also a piece, which
Walker begs strangers and other interested in grazing to call
and witness, at hiis stalls, Centre Market, or at the above place,
and they will find no mistake about the superiority of those ex-
traordinary cattle. It would be unjust not to say that th. -e .tdid-
were purchased of Mr. Hezekiah Ciagett, who was deisr:,*i to
show that Virginia ihas no superior.
mir 4-3t W.
SOIST, about sunset last evening, out of lay buggy, either onr
R 4J or 5th street, between Pennsylvania avenue and the new
jail, a new pair of BLACK PANTALOONS.
A suitable reward will be paid by the subscriber, if left at Mr.
J. R. Thompson's, utinder Newton & Gadsby's. The pantaloons
had my name on the watch-pocket.
mar 4-3t HENRY QUEEN.
X-I IuN IEY Fu)IND.- Was picked up in the street, a silk
Il. purse, containing a small sum of money and a miemoran-
dumo in pencil, which thire owner can have returned to hrim on ap-
plication at the office of the National lIntelligencer and paying for
Iris advertisement. mar 4
]] LMOVAL.-MARRIO PV & HAltUEkTY have renrov-
i e oil their store to 209, Baltimore street, second door eastof
Sharp street, and adjoining Mr. Israel Griffith's, Baltimore, where
they offer for sale a large and valuable assortment of Foreign
and Domestic Dry Goods, consisting of in part, as follows:
Suoer blue, black, and medley cloths
1)) blue, black, and mixed cassimeres
Super and common drab do., fashionable striped do
Srtirels, assorted, 3 4 and 6-4 colored merinoea
5 8 and 5-4 super and common black bombaaires
black bombazils
Plain and twilled black ar.d assorted summer cloths
Back princeetas
5 8 and 7-8 drr and olive hangup cords
Beaverteens and moleskins
Plain and striped white and brown linen drills
Plain and printed gambroons
Blue and yellow nankeens
Brown Irish and German linens
Biown hollandls and Irish linens and lawns
Blue and Cadet mixed Kentucky leans
Irish table and birdseye diaper
Super damask table andl piano covers
Burlaps and tieklenburgs
Russia diapers antd sheerings
Marseilles and royal robbed vestings
Plain and figu ed silk vestings
Bick Itldian lutestrings, plain and figured gros do naps
Florences, assorted, blue and assorted sewings
A large assortment of British and American prints, seersuck
er ginghiams, French and English lawns/,and mrnousselines
de la ines
4-4 and 6.4 cambrics, jaconet do
Figured and plain Swiss miuslins
Plaid and striped do
Plain and figured bobbinet, bishop lawns
Black ani colored silk velvets
Black and colored cambrics
Sdk Spitalfieldssind Pongee handkerchiefs
-Silk firas and B rtidanna handkerchiefs
Black Italian cravats, black silk handkerchiefs
Ladies' fancy silk and gauze handkerchiefs
Paddings and huckrams
Worsted and cotton hose
Ladies' and gentlenmtn's gloves
And many other articles not necessary to mention.
Also, a general a-sortmrent of Domestic Goods, which theyaore
disposed to sell at tIre lowest rates for cash, or to punctual dealers
,,n their usual e-edit. (Winchester Repub) mar 4
I OTICE.-The sub-cther, having received the balance ol
L the superior lot of Beea recently purchased of James Par-
sons, E-q. of Soith Branch of Potomrac, Virginia, will offer the
same fior sale at h s stall, No. 53, new Centre Market, on Satur-
(lay, February 27, and Tuesday, the 2d, and Thursday, the 4th
of March nest, at prices suited to the times, by which he hopes
to secure the ,r..i. .r- ..f Iris cstomers and the Public, to whom
Ire feels and .. ,Ii t i el thankful.
fob 26- 6t G. W. KEATING.
IW E BOOBK.-Graphie Skeichesfromn Old and Authentic
-L' Works, idlustrating the Costumes, Habits, and Character of
there Aboriwinea of America, together with rare and curious frag-
mients relating to the discovery and settlement of the country, io
tis day ...I.., b-.l and for sale by W. M. MORRISON, 4 doers
west of Brown's Hotel. feb 19
16HE POLITICIAN'S REGISTER FOR 1841,
being a compilation of the returns of votes cest in the
several Slates during the years 1836, 1838, and 1840 for Presi-
dlent, Members of Congres-, and State officers, arranged by woun-
ties alphabetically. Just published 1841, price 25 cents, for sale
by F. TAYLOR. mar 1
11I1.1IItOULiTTE LIKENESSE.S, for a few lays
IS-.1ll,, 3 doors east of the City Post Office, Peonn-
sylvanitla Avenue.-Monsieur EDOUART, frort Paris, Lon-
don, and New York, returns Iris most sincere thanks for there lib.
eral patronage Ihia works have received during his stay in Wa :h-
ington, having taken about 1,000 likenesses, anrongat which are
thire members of the Cabinet and many o the Senate and House
c" l: It . 1. ,.,;. -. Likewise a great number of family groups,
i,.r. l. 'itir, ., ,i:-r, and children are represented in their most
characteristic manners, actions, and expressions.
Mona. E.'s extensive gallery of 85,0010 likenesses from Europe,
and about 5 000 in tire United States, of the most eminent men of
the day, who have honored him wih sittings, and have given
i-' .. cr -.p.= as approval, is open gratis for inspection.
P,.,e..-5, "-, fior likenesses sitting
1 25 for do standing
87 fior children under 8 yearsof age.
)Duplicates at reduced prices.
A volume is devoted to likenesses of members of Congress of
both House-; they are tiken tree of expense, and Mons. E.
begs tihe favor of those members who have not culled to do so
without delay ; or, if tore convenient, Mona. E. will call upon
them at their boarding-houses in the evening.
Mons. E. has none ,of his work exhibited before his door nor in
the Capitol, but only in his show room.
An approved likeness of Gen. Harrison, taken by Iris permis-
asion, to be sold at 50 cents, mar 1-dlw
( ORCORAN A RIGGS have lor sate-
6 per cent. Washington Corporation stock
5 do do do
Treasury notes
Bank of Wa.hington stock
Do the Metropolis do nov 14-tf
UNGLISON'S NEW REMEDIES, 3d edition,
with numerous modifications and additions.
Diseases of the Organs of Respiration, being a continuation
of the Library of Practi'cal Medicine, edited by Alexander Twee-
die, M. D.
The above just published and for sate by
W. M. MORRISON,
jan 18 4 doors west of Brown's Hotel.
R1RAPHIC SKETHIIES FROM OLD AND AU-
^A thentic Works, illustrating tire costume, habits, and charac.
tee of the Aborigines of America, together with rare and curious
firagrrents relating tithe discovery and settlement of tire country.
Just published and for sale at the book and stationery store of
it. FARNHAM,
feb 15 Penn. avenue, between 9th and 10th sta.
ALBERT GAI.LATINON THE MAINEBOUN-
DARY, l vol. with 8 maps, an additional supply this day
received and for prle by F- TAYLOR,
Also. Memoir, Historical and Political, on the Northwest coast
of North America end the adjacent territories, illustrated by a
map and g, ographical view of those countries, 1 vol. by Robert
Greeohow, Translator and Librarian to the Department of State.
mar 3
A PICTURE OF WASHINGTON, giving descrip-
tion of all tire public buildings, grounds, dc. with the prin.
cipal officers of the General and City Governments, Committees
of Congress, resident foreign Ministers, United States Ministers
abroad, d6c. &c. to which are added plans of the floors of both
Houses and a Corgressional Directory, by George Watterstonr is
for sale by W. M. MORRISON,
mar 3 4 drors west of Brown's Hotel.
UR FUTURE POLrcY, by 0. A. Brownson, Editor
of the Boston Qtrarterly Review. Also, by the same writer,
"Defence of the Article on the 'Laboring Classes,' which ap.
pared in tre Boston Qoarterly Review." Just published, in
pamphlet, and this day received for sale by
feb19 P. TAYLOR
B"TILWER'S NEW NOVEL, "Night and Morning,"
just published, this day received for sale by
feb i2 F. TAYLOR.
'U'tHE TEN MILES SQIUARE, or Picture oftheDis-
U trict of Columbia, I pocket volume, containing a map of the
Ten Miles Square, engravings of the Capitol and President's
House, interior and exterior, with a full account and general de-
scription of every thing of interest relating to the Federal Metro-
polis, its history, laws, public buildings, paintings, statuary, archi-
tecture, its botany, mineralogy, &c. in one volume of 310 pages,
with eight engravings. Price S1. For sale by
mar 3 P. TAYLOR.
rTHE PICTURE OF THE BAPTISM OF PO-
CAHONTAS, painted by order of Congress for the ro-
tundo ofl the Capitol, by J. G. Chapman, with an engraved key
and historical sketch, together with extracts from contemporary
writers relating to thetsubject of the picture.
Published and for sale by R. PARNHAM,
de0 7 Peonn, avenue, between 9th and 10th street#.
LITTELL'S MUSEUM OF FOREIGN IITERA-
TUORE.-cO0TNTaT oF THEri MACH NUTBInE.
I. Lifeand Characterol OliverC,.n, ell Eclectic Rrvirns.
2. The Young Pretender N' r ,llinrtty ,lasg.
3. Annuals for 1841 Ezirelic Rarsew.
4. Cafe de l Regence, by a Ch.As Plavcr P'ras r's Mag.
5. Africa BlacAiwrood i Mag.
6. American Orators and Statesmen: Pa-
tr'ck Henry-John Adams-Jas. Otis-
Fisher Ames-John Q, Adams-Josiahi
Quincy-Win. Wirt-Justice Story-
J. C. Calhotn-John Randolph-Henry
Clay-Edw. Everett-Daniel Webster Quarterly w itt.
7. The Protestant Annual Britannia.
8. Scottish Melodies: Old Scotland's La-
ment-The Beacon Light Blackuseod' Mag.
9. Master Humphrey's Clock,chap. 56 to59 By Mr. Dickens.
1t0. Turkish Government By Sir C. Napitr.
11. Ten Thousand a Year, part XIV. Blackwood* A Mag.
12. The President Elect of America Britannia.
13. Charles O'Malley, the Irish Dragoon,
chap. 56 to 64 Dublin Unit.Mao.
14. Hop Gathering By Miss Mtlforid.
15. Napoleon: Character, Life, Deathr, and
Funeral Britannia.
16. Master Humphrey's Clock,ehap.60 to 65 By Mr. Dicken#.
17. A Bear Hunt ia the Pyrenees Chambers Journal.
18. Satan in Love Spectator.
19. LfL's Value Chambers' Journal.
20. POETRY.
21,.MS MISCBLLANYV.
Price-Six dollars a year, in advance. Published by
E. LITTELL & CO.
mar 2-6t 297 Chestnut street, Philadelphl.
ANCY AND STAPLE DRY GOtODS.-HAMIL-
TON EASTER & CO., No. 1471 Baltimore street, Balti-
more, have now on hand a complete assortment ol Spring Goods,
selected from the most recent importations, viz.
SILK GOODS; yard wide Silks fourr own imnpoitltion) ina
great variety rf new style striped, figured, Brecha, Chene, &c.
narrow Silks, of striped and checked Chenie, figured, &c.
Jet and blue-black Silks, of all widths
Extra rich jet-black Italian Mantua, 22 a 36 inches.
White, pink, and Iblue Gios d'Afrique, Poult de Sole, &c.
SILK SHAWLS; a most splendid assortmentef plain black I
plain rich corded Glacia, rich figured ; embroidoted Brocade
large plaid ; Chene in every variety of colors, with heavy fringe
to match.
CRAPE SHAWLS, of the richest style, of various sizes and
colors.
SHAWLS of various other fabrics, such as Mousseline de Laine,
Thibet and Ceshmere, Merino, large Net, &c.
MOUSSELINE DE LAINE; plain of every, color; extra rich
embroidered; new style printed; satin striped, plaid, &e. I jet
and bluo-lblack Shalley and Moisseline deLainc, some extra fine.
BOMBASINS; a complete assortment of Lupin's manufac-
ture.
CHINTZES, &c.; latest patterns of single colored French
Chintzes, bright colors of English and French Chintizes; Scotch
and Manchester Ginghams; Leopard Chintz Furniture; Merri-
mack and other American Calicoes &c.
FANCY HANDKERCHIEFS, AtARFS; embroidered, plain
and hemmed linen cambric and lawn Handkerchiefs ; gentlemen's
rich neck Scarfs ; Cravats, pocket Handkerchiefs, &c.
GLOVES and HOSIERY; a complete assortment of ladies'
light, dark, and black kid, eilo, and filet Glovescand Mits; gmn-
tiemen's kid, silk, and coton Gloves; silk, raw silk, white and
colored cotton, Moravian and Casrmere Hose and hall Hose.
THREAD LACES and EDGINGS; a veiy large assormentL
of superior English Thread Laces, Edgings, and
INuERTINGS, at extremely hlw prices; t.'a :k In,'and filet
Veils; Fidrt Net for veils; green Barege; lihis and figured
Bobbinet, Qttliings, &c.
NEEDLE WORK GOODS, viz. niew style Fretch Collars,
(with lappels;) Swiss and Jaconet Bands; superior style ofjaco-
net and Swiss EIgingsand Insertings, or all widths.
WHITE MUSLIN GOODS; a complete assortment tf plain,
(some 2 yards wide;) striped, checked; figured andt dotted awmi
Muslim; cambric, book, jaconet, mull, and nansook MuslinI
Friends' Book and Bishop Lawns, &c.
HOUSE-KIEEPING GOODS, of all kinds, vix. super. impe-
rial Marseilles Q ilts; 9 to 12 qr. Linen Sheei g ; i 6 and 6 qr.
Pillow-cease Li'. ,1; I t.t- hu. r, of all %;.ih.. i all s;zedo ufIt-
mask Table (.'a.s a'..I Njpli..ns; white, 'ar., -, a,.d c.-ared How-
las; colored .-i..ie L..i r.. .t rC. to0 n; linen and worsted and all
worested Crumb Cloths; Stair Linen; fringed Towels, at Slj to
$4 per dozen ; Linen Toselling; figured Scotch Diaper, 18 to 25
inches wilde; Curtain Mrslins; Bulf Marichester Bollan I (for
window shadess) extra fine Flannels for infants; Rogers' Patent
and Gauze Flannels; Barklies' superior Irsh Liaiens; Lawms;
best Aruerican and Englis.l Shirting Cotters, &c.
Cloths, Cassimeres,Vestings, Gmmbroons, Drillings, Erialnets,
Brown Linens, Fancy Plaids for boys, &c.
Purchasers of goods by wholesale or retail will do v-pll to el.
amine our extensive stock of goods, which will be found of the
most approved fabrics and at very moderate prices.
mar 3-- dft
NJ EW YORK PREMIUM HATS.-Just received from
our establishment at New York a full assortment ofBeaaver
and Moleskin Hats of the celebrated manufacture of OrlanduoFish,
who liras tbr several successive years received the first premium sr
the Fairs of the American Institute.
These Hats are manufactured of the choicest material, and in
the newest and most approved style; they are commended to the
connoisseur for theirsuperiorsynmmetrical proportions,elegant short
nap, splendid lustre, and unfading colors ; in a word, they will be
found to be decidedly superior to any thing of this kind in this
city, asd at prices corresponding with the state ofthe times, in
proof of this statement, gentlemen, either before or after purchas-
ing elsewhere, are invited to call in order to examine and com-
pare. ROBERTS & FISH,
Penn. Avenue, 2 doors west of the main entrance of
feb 27-6t Brown's Hotel.
PPLES, ORANGES, LEMONS, &C.-Just land-
ing from schooner Alexandria, Captain Britten, from New
York-
50 barrels prime Pippin Apples
50 boxes Oranges
50 do Lemnons it, prime order
10 birreis Cranberries
100 drums Smyrna Figs
101 boxes bunch Raisins
100 half do
30 kegs Malaga Grapes
1,000 Ibs new Currants
5 cases P. unes in glass
5 boxes Cocoa Paste
Vl baskets Anchor Champagne, &a.
For sale by
feb 27-d6t GEO. & THOS. PARKER.
[ ARY STUART, translated from the German of Sdhil.
S ler, by William Peter, Esq. British Consul at Philadel-
phia, I volume ; and
Schiller's William Tell, translated by the same author, just
published, are this day received for sale by
mar 3 P. TAYLOR.
NEW SPRING GtuODS.-HALL &BROTHERhave
I just opened a large assortment of new goods, consisting, in
part, of, viz.
500 yards Plaid Silk, handso'ue colors, at 62 cita
600 do do extra rich do at 75 eta
600 do Chines do at 50 eta
10 pieces very rich Stripe Silk
10 do Plain do
10 do Matteoni Lustring do
10 do Blue Black Poult de Sote
1000 yards Plain Mousseline de Laine at 40 eta
60 Dress Patterns, rich stripe, at $3 25
500 pards silk stripe Mousseline de Laine, very fine
10 pieces embroidered do very sheep
6 do double width Blue Black MoursseliredeLaine
2 dozen rich Spring Shawls
2 do black net do
5 do Plaid Silk Handkerchi,-fe
5 cartoons splendid Embroidered Ribsnds
2 do Thread Edgings and Laces
5 dozen hemstitch Liues Cambric Handkerchiefsl
30 do plain do do
10001yards new style Printed Lawns
1000 do rich stripe Chintzes
"20 pieces Irish Linen
2000 yards Calico, at e* eta
5 pieces Ingrain Carpetinge, at 87j cta
10 do Hemp do s" s cr
A variety of other articles, too numsrc'u to nertioa.
The most of the above goods were I ur.r:has.-, at auction, and
great bargains can be had. We invite customers in general to
favor us with a call before they buy; it will be greatly to their
advantage.
mar l-2aw2w HALL & BROTHER.
t.tate ot Maryland, Cl'harle, rru.rty, t-ct:
O N THli APPLI(ATION, by petnin in writing, of
Richard B. Mitchell, to the sul scrihM*, Chief Judge oh the
Orphans' Court ol Charles county, (being in the reessre of rhe
County Cuurt of said county,) praying for the benefit of the act of
Assembly, passed at November session, eighteen hundred and five,
and the several supplements thereto, a schedule of his property
and a list of hIis creditors on oath, as far as ascertained, r being an-
nexed to his petition, and the said Richard B. Mi'chell having as.
tisfied me by competent testimony that he has resided in the State
of Maryland two years immediately preceding the tierle of bis
application : it is tlreref~r- ..r.ti.rd ly m..i t.an he sa~d Ric a'd
B. Mitchell be and he ms hrre>.y dri.l, ,ngnd : prmr~ded err| y of
this order be inserted in sorme ni -f.5-f' r publ'-hed in the Ditriel
of Columbia once in each week forr two month prior to the third
Monday in August next, notifying the creditors of the said RIchard
B. Mitchell to he and appear in Charles County Court en the aid
third Monday in August forr the purpose of recommending a trus-
tee for their benefit, and to show cause, if any they have, why the
said Richard B. Mitchell shall not have the benefit of the said act
nf Assembly and the several supplements thereto as passed.
Given under my hand this thirteenth day of February, in the
year of our Lord 1841.
True copy. Test:
feb 15-w2m
RICJHARD BANKS.
JOHN BARNES,
Clerk of Charles County Court.
G tOLD THIMBLE.-A Gold Thimble, with initials, was
found by my man servant. The owner, by des-ritling the
same and leaving one dollar, canohtain it at Stasioeera' Hall.
W ATER COLOItS.-Just received at Siatoirons' Hall
an additional supply of Osborne's superior water colors,
comprising every sizt, in bhses1 and all kinds of colors in cokes,
deeo W W, FISCIRI
If
No. 8754
-111.
I il
ilk
NATIONAL INTELLIGENCE.
EUROPEAN CORRESPONDENCE.
FROM THE PARIS CORRESPONDENT OF THIS PAPER.
PARIs, JANUARY 11, 1841.
The festivities of the last week deprived me of
the aid of my amanuensis, and you of my usual
contribution. But my notes are the more abund-
ant. After the present short session of Congress,
you will have room for the various topics on which
I have collected memoranda. The transactions
of the several worlds, or grand divisions of actors
in this capital, furnish materials, apart from the
occurrences and opinions of the day, well worth
a regular digest or notice for our country ; but the
aggregate would be too large for any American
journal, even one so ample in its plan and dimen-
sions as the National Intelligencer.
We hear daily of devastating hurricanes in all
the European and Oriental seas, and along all the
coasts. From the South, as well as the North,
the accounts are alike of the extreme severity of
the winter: rivers ribbed, mountains covered
with snow, roads impassable, vessels, even steam-
ers, wrecked, migratory flocks of birds repelled by
storms, or killed by extraordinary temperature-all
nature benumbed or disordered. Since my arri-
val in Europe, I have not been fully reminded of
Americanw December and January, except in the
present season. Some days, it has been impossi-
ble to warm with the ordinary fires apartments of
the best exposition; the trees are still bending under their
loads of snow and icicle; the Paris roofs and the borders of
the streets are white; the comparatively few sleighs, must of
them exceedingly fantastical, have been brought out for the
Champs Elys6es and the Bois de Boulogne. The mixture
of mud in the narrow streets, with the masses of snow, rer-
deis them difficult for any sledge. As the horses, even
those kept for exercise or pleasure, are not rough-shod, a
curious spectacle of slipping and falling is presented each
morning until rain or the sun, and the ploughing of so many
hoofs, have broken the glassy surface of the Boulevards.
At Court, during the last week, the utmost bustle prevail-
ed, what with deputations and addresses of the public bodies,
and the annual presentations and crowded assemblages in the
evening. Twenty-six American gentlemen--four clergymen
of the number-and twenty-nine American ladies, made
their debut. They were accompanied by others who had
done so in former years. The Ministers of the Gospel ap-
peared in their canonicals, the rest in the Court finery which
was especially devised, A. D. 1837, for the North American
Republicans, and against which I could urge what I think
sound considerations, if the matter deserved a paragraph. A
list of the gentlemen, official I presume, appeared in Gal-
ignani's Messenger of the 9th. I have not before seen
or remarked this mode of publication. If the first instance,
it may be for good reasons. The British presentees, about
forty, were dluly gazetted the day previous. The political
editor of the Messenger premises that the King showed
much affability to them." lIam sorry to say that the Eng-
lish, wherever they figure, experience considerably less of
this from the French in general, than they did before the
treaty of July. The disposition to ridicule and quiz them
has revived as strongly as the fighting mood. For example,
see the sentences which I translate for you from the Siecle.
"The reception at the Tuilleries on the 1st inst. was rather
'dull; not that the multitude and eagerness of the courtiers
were less, but from the paucity of strangers, especially the
'queer-the red-coats, so offensive [in their glare to the
French eye, and those female caricatures that formerly
S' thronged the Palace halls. We could not discover a single
one of the tall, stiff, starched English.Women whose toilette
'indicated the approach of the Carnival." You will learn
by some of the paragraphs which I enclose, that the Dramatic
Censors and the police have interfered to suppress or modify
productions for the stage by which the British might feel them-
selves outraged or assailed, and the renascent prejudices and
animosities between the two nations be prematurely aggra-
vated. The license to ridicule and abuse the French being
indefinite and unmolested on the other side of the channel, it
seems to me hard and unfair that the hrnmarou,
of the Parisians should be obstructed by the Government at
the moment that they hear of the London after-pieces and
caricatures about the French Frog and the British Ox, and
the Gallic Cock that croas but wonf fight, &c. The obser-
vation of Lord PALMERSTON that the French would at first
raise a prodigious noise about the treaty and its execution
but finally acquiesce, and that he could make Louts Put-
LiPPe pass through the eye of a needle; and Lord MELt.-
BOURNE'S threat to sweep away the French armaments, have
loft stings many inches deep in the French national soul.
The frequent allusions to them, not merely in the journals
and theatres, but the debates of both Chambers and social
talk, show how they fester. They have contributed in their
way to reconcile the French palate to that scheme of a Rus-
sian alliance which is now recommended from so many mouths
and pens, whence it could have been expected scarcely ever
or under any circumstances. If ODILON BARROT declared in
a committee of the Chamber that he would prefer a despotic
government to the loss of national independence, he meant
that nothing could be worse than a system which'submitted
to national insignificance, or brooked the spirit and tone of
the British Cabinet. The New Year's Day addresses and
answers at the Tuilleries continue to affect public opinion un-
favorably for the Court and Cabinet. The exclusive stress
which is laid upon peace, and the emphasis of amiable pro-
fession towards the foreign Powers, seem excessive and quite
unsuitable to the new relative position and policy of France,
such as they have been proclaimed even by M. GUtzoT. They
indicate a resolution-of the Monarch particularly-to avoid
war by all possible means; to acquiesce in any external trans-
actions. I am sure that he has been too lamb-like and phi-
lanthropic in his strain for the temper and purposes of the
Chambers; of both Peers and Deputies, who, however, are
moderate, perhaps humble, in comparison with most of the
parties out of doors. No doubt, the King and his Ministers
are persuaded that the most perilous extreme is the other, to-
wards which public sentiment, justly excited in several re-
spects, has been inordinately impelled for the ends of revolu-
tion and reconquest. In his reply to the compliments of the
Institute, delivered by'Rosst, Louis PHILIPPR returns to a
topic upon which ho has seized every opportunity to dwell. I
mean the evil of Republican theories, causing youthful or too
sanguine intelligence to concur in attempting what must
prove baneful in practice. In my long career,"he remarks,
how many upright men have I known urged forward by il-
'lusive abstractions. and general reasoning, who were them-
selves astonished, in the end, at the mischief which they had
accomplished, instead of the good which they designed and
desired." The spectre or vision that haunts and nearly
engrosses the eye of every monarchical statesman is that
Democracy predicted by CHATEAUBRIAND and DE Toccute-
ViLLE; and the situation of Spain causes it to loom from the
top of the Pyrenees on the French royalty of July. The
British press has been lavish of panegyric on Louis Pan-
LIPPE'S philanthropic meekntiess and philosophical patriotism;
and the more lively its accents of gratification, the sharp-
er the discontent in his realm. The London Morning
Chronicle takes the lead in applauding and rejoicing ; which
is, for the Paris politicians, as it my Lord PALM RSTON him-
self clapped his hands. The President of the Chamber of
Deputies abstained, in his address, from the topic of peace or
war; and properly, because he knew the feelingsofthe Cham-
ber too well to join the chorus, as its organ. But the Chron-
icle scolds at him for his unmeaningg language," his "timid
silence," and then adds: The King heard the President
with some impatience, and broke forth into a frank, clear,
'and courageous reply" against war, conquest, and glory.
Now, in regard to the breaking forth, every one here knows,
or should know, that the addresses and replies are concerted;
that what M. SAUZET read was submitted to the King before-.
hand; and that the topics-the virtues of the Queen, the ser-
vices and merits of the heir apparent, the admirable qualities
of all the scions of the National Dynasty, the union of the
Chambers with the Crown, &c. are precisely those to which
Louis PImLtPPE would listen with exemplary endurance. I
cite this as a specimen of the misrepresentation of French
scenes, common to the London papers. The Chronicle's
editorial accounts (4th instant) of Count MoLt's inaugural
IlNCdui.O Djad DWI'o reply, At the 1Il pfuoing oftt 4e4 d4-
tiq Fran alse, may Nl pronounced the very reverse of the
truth, in the principal passages.
Last week, a copy of Captain BAsiL. HALL's new publica-
tion, in three volumes, entitled Patchwork, fell by chance into
my hands. I turned over some of the pages relating to Paris,
and read his account of the cold of this capital, which he re-
presents to be such as he could not remember to have seen in
Great Britain or any where else. He says:
If summer in Paris is had for man and beast, winter is
even less bearatle; the cold, ,% atn I was there, subdued all
mankind alike-natives and -tian.'r [a, and at times entirely
cleared the streets f .erq.pI lh.-aving the capital like one of
those mysteriously d-'tie, ci.ot- in Hindostan described by
travellers in the East, Which, with all their palaces and tem-
ples complete, have been left for ages without a single inha-
bitant in them! I walked once, the day after Christmas, from
end to end of Paris, and literally met only a stray gendarme
or two. How the wretched coachmen manage to live at all
in such weather as I have seen in Paris, is to me inconceiv-
able: for even to the inside passengers the cold becomes at
times so severe that, with all the contrivances, they can think
of-warm furs, hot water bottles, greatcoats, boat cloaks, and
shaAls-they can scarcely go from one house to another with-
out being frozen to death-a fate which actually befel two
poor sentries and an unfortunate donkey one bitter night of
the winter alluded to. The soldiers were found, at the hour
of their relief, as it is called, with their muskets shouldered,
standing as stiff and erect at their post, at the palace gate. as
when their corporal had planted them. The honest donkey
was found standing across the path in the Boulevards at day-
break, with his tail straight on end, as rigid as a bar. In his
death the poor old fellow retained his wonted look of patience
and contentment so completely that the people, thinking him
still alive, drubbed him soundly as they passed, for being in
the way."
This is the fifth winter that I have resided in Paris, with
a constitution peculiarly sensitive to cold, and yet I have
neither seen nor felt what warrants, in any degree, the cap-
tain's wonderful yarn. It is very many years since the
weather has been so pinching, searching, hyperborean, as
within the month past, yet no one has witnessed any thing
like his phenomena, not even an honest donkey frozen to the
life In regard to the desertion of the streets, the captain's
Patch-work must be absolute fancy-work. It could net have
occurred without an entire revolution in the nature and habits
of the Parisians. In general, they have seemed to me invin-
cible by atmosphere of any description. I have rarely ob-
served the streets to be more crowded than since the com-
mencement of this Siberian spell. According to the London
meteorological diaries, the thermometer has fallen lower there
than in Paris. We survive and even enjoy ourselves within
and without doors. If Captain BASIL HALL'S Loo Choo ro-
mance and his book on the United States had not procured
for him a Munchausen degree, his German anecdotes, ex-
ploded as they were, and the present Patch-work, would enti-
tle him to a diploma consummate. When we have seen and
heard, we can scarcely credit our eyes as we read the London
statements of what has occurred or is filt in this capital, yet
those statements are, unavoidably, the first circulated by the
American press. The Boston and Ney York editors must
copy them at once on the arrival of the British steamers.
Reason has some share in the strictures of the French Op
position writers on the custom of making and publishing offi-
cial harangues and Royal responses at each new year. It is
peculiar to the French monarchy. The kissing of hands at
the Court of Madrid is not followed by a solemn publication
of the mutual compliments. Every snate, juridical or muni-
cipal body-all the branches of the administration-present
themselves with a set of phrases, more or less voluminous and
ambitiously elaborated. The sovereign's acknowledgments
are generally intended to be significant for the nation or the
world; but, like the addresses, they consist, in the main, of
trite matter repeated to satiety, and often bordering on the ri-
diculous. In the succession of dynasties and rulers, as nearly
the same immutable devotion has been professed, with the
same fulsome flattery to all, the grossest self-contradiction has
been incurred, which the antagonists of the existing powers,
or of the old dignitaries who have topped their part in this
ceremonial through the several changes, do not fail to signal-
ize by easy collation of texts. On tAe recent occasion, the
burden of the song on each side was the weal of mankind
ever promoted by peace, and so happily rescued by the efforts
and resolution of this Government to prevent a general war.
The palace homily smacked, in reality, more of excuse than
of the generous and confident love of our whole species upon
which they found Louis PHILIPPE's submission to events.
Without forgetting the aims and campaigns in Algeria, I
prefer them, however, to the cant of the British -press about
moderation, disinterestedness, philanthropy, and so forth,
when I contemplate the Syrian, Chinese, and Indian wars of
cupidity, aggression, carnage, and rapine. Pharisaism has
never been carried further than by the chief British journals,
with their moral and religious pretensions, and their lectures
to the French, in the articles to which the Treaty of London
has given birth. Curious examples hereafter.
The French official harangues touching the excellence and
obligation of the anti-belligerent system contain no reference
to the special spirit, maxims, and precepts of Christianity
about peace. DupeN,.in his draught of an address to the
King from the Chamber of Deputies, ventured to mention
religion as an object of protection and favor for the Govern-
ment. The very term excited ridicule and resistance; it was
altogether new, and seemed incongruous in the business of
the Chamber. At different times several members have
moved the repeal of a law, of 1814, which renders penal cer-
tain gross profanations of the Sabbath, although it has been
a dead letter, owing more to the indifference of the authori-
ties than tke refractoriness of the People. I was struck with
a dialogue arid scene relating to positive religion, which oc-
curred in the Chamber of Deputies on the 26th ultimo, the
day after Christmas! The principal subject under considera-
tion was the bill for regulating the labor of children in the
manufactories. A member proposed that the Jewish children
should have, for rest, the option between Saturday and Sun-
day; the employment of any under sixteen years of age, on
the Sunday, being forbidden in the bill. The Minister of
Justice and Public Worship argued thus: I cannot admit
that the present text of the bill would be contrary to reli-
gious liberty. There are not more than three hundred thou-
sand Jews in all France; it would, therefore, be inconsist-
'ent and anti-religious to make a law with reference to that
immense minority. [Commotion in the Chamber.] The
Christian religion is that of thirty millions of the French;
be not afraid of declaring for it; I beseech you not to imi-
'tate those who labor daily to undermine religion; adapt
your law to the religion predominant in the country; if the
Hebrew minority will not conform, let them take two days
'of rest instead of one." The Minister was understood to
allude to PORTALtS, the Deputy who had taken the lead
against the law of 1814. PoeTrAis rushed into the tribune,
and the Deputies raised a chorus of laughter. "Gentlemen,"
he cried, "you have just been told that same of us labor to
undermine religion '! That, unhafrpily, is too true," ex-
claimed FtLCHERON, the honest member for Lyons. PORTA-
LtS. "Verily, there is quite a revival in the Chamber. We
have become a pious body." Several voices : So much the
better; so much the better." PoRTaLIS, with an ironical
smile and wsnk: "Indeed, there is here a great, a wonderful
resurrection of faith." Several voices again: "It would be
a blessing." A number of other voices: "It has happened
since DuPI''S address." PoRTaLtS. "It may be good, if you
please to think so; but, if we must be brought back toreli-
gious intolerance, l say that it is evil. You should force no
'man to remain idile on Sunday, whose children may starve
for it." Exclamations of oh oh rose from most divisions
of the Chamber, as every one sees how both Sunday and
Monday are sacrificed to dissipation by the majority of French
operatives. PO0TaLIm continued: As I am en my legs, I
will advert to a recent report by a deputy, a Judge of the
Court of Appeals, wherein it is written that the law con-
cerning the observance of the Sabbath subsists, and must
be held applicable. On the other hand, M. DuPINm informed
us, recently, in answer to my motion for its repeal, that the
measure would be superfluous, inasmuch as the law was
unexecuted-defunct. Let it be acknowledged at once that
the authorities will dare to cftry it into effect; let this be
' only avowed, and I will ester, forthwith, a new protest."
Cries of disapprobation from various deputies. At length the
motion in behalf of the Jews was negatived. FOULD, tihe
Jew banker and deputy, stated that bethought his brethren
sufficiently protected by the Charter, which disclaims a state
religion.
From all that passed I could collect that there was among
the Deputies, and on the ministerial bench in particular, a
sense of shame and regret that religion counted so few follow-
ers or abettois in the assembly, er in any branch of the Gov-
ernment. But all branches, and the whole hierarchy, besides
the mass of the priesthood, have been awakened to the mani-
fold, pregnant evil of the general desecration of the Sabbath.
In the autumn, we heard a familiar sermon (prone) from the
worthy and eloquent curate of the church of St. Roch, upon
the French use and abuse of the Lord's day. I copy for you
the heads of it which I noted, because they illustrate the case
and the severe frankness with which it may be treated from
Oil pulpit, The tFInI4 n0ti91 1 I only ae thal djqC*
garded Sunday. He (the Curate) had'tever travelled out of works already obsolete. The case, however, is the reverse.
'France without hearing the same remark from persons wor- A prestige still attends the title of Academician. Ten or
Sthy of credit. In Great Britain, Switzerland, Italy, even in fifteen members are either illustrious in authorship or
America, the land of unbounded liberty in all matters, the retain a popularity variously operative; and it is much to be-
Sabbath was kept with a reverence bartering on superstition. come co-ordinate and associate with them. Installation in
In the United States, as he had learnt, petitions, with thirty the sanctuary serves as a consecration of literary pretensions.
thousand signatures, fol.the stoppage o'the mails, had been The school of which Huo has long been the Magnus ApJlo,
'presented to Congress ; some Americas had even calculated triumphed, after a severe struggle; was formally recognized
the number of persons engaged in the ?ost-offices and there- with all its sins and imperfections on its head; when the
by deprived of the advantage of attending Divine service; doors were thrown open to him by the highest suffrages. A
'he would recommend such examples to the French; his Conservative editor, who pardons the Radical and licentious
'countrymen seemed to think that there Nas no judgment for poet, in consideration of his imagined genius and fame, con-
'Nations; (here a splendid passage of "osSUET on the sub- firms what I have just said by this remark: This election
'ject.) They thought much of their glry as a people, but 'is fortunate for VICTOR Huuo, for the mere title of Acade-
how could they preserve it without rendering homage to the mician will suffice to dissipate the absurd prejudices which
Almighty Dispenser, obeying his positive precepts, stnctify- 'yet cloud his name." By the prejudices is meant the sense
'ing his dayI He could recognize no real Christianity, he which so many entertained of the questionableness of his
anticipated a heavy visitation from above,unless the general literary deserts and the two-fold mischief of his performances,
dissipation and vice that reigned on the Rabbath should be A more general and important reflection belongs to this in-
corrected. He did not ask the people to spend the whole in stance. Nowhere and never has the power of the pen, the
Sthe churches, but wished more time to bh given to public faculty of authorship, acquired so diffusive a sway, and en-
worship than was usually allotted even by the professing tered so largely into the management of public affairs, as in
Christians. He argued that dissipation destroyed the secu- France. How and by whom it is wielded-how and in what
lar as well as the evangelical reasons for the institution of degree it is acknowledged and vivified in individuals-mustt
the Sabbath-repose of body and intellect-concentration of therefore, be momentous points. Politics, morals, religion,
spirit; a diversion of the mind's eye from the present to the are deeply involved, as well as taste, style, cast of thought,
'future life," &c. What I have myself witnessed in Europe and composition. "We live," says an able French essayist,
has reconciled me more than I supposed I should ever be to "at an epoch when it would be neither just nor prudent to
the rigidity of the New England doctrine and practice; and 'contest the fitness of men of letters for the administration
I speak too in the worldly not less than in the scriptural sense. of the public weal. The time has long since gone by when
The northern and middle States may be ttrict and ritual to 'a poet could fret himself to death because his project of ad-
excess, but the extreme of utter laxity is vastly worse. ministrative reform was coldly repelled. Nowadays, what-
Having travelled into the subject of religion, I cannot stop 'ever poet conceives a plan of that or any other kind may
without touching on the inconsistency with which the con- boldly bring it forth. He is sure of being heard-perhaps
duct of some of the highest patrons and preachers, among 'applauded. If not already a Deputy, he will be. If he
the literati and statesmen, of Christianity and morals, may should, as some fools have done, abandon himself to despair,
be taxed. On the 26th, the Abb6DE LAMrNNAIS was tried at 'with his pockets full of verses, it can be only from want of
the Court of Assizes, for his last treasonable and anti-social, 'comprehending his epoch. In good sooth, this age is not
incendiary pamphlet. You know that, as a priest and author, hard to men of letters. It enriches some-aggrandizes
he stood prominent in 1826, proclaiming that all truth and 'others exorbitantly. It opens the legislature to many-the
all power appertained to the Holy See. Ere long, having 'cabinet to not a few. It exalts mediocrity to the summit of
become, on a visit to Rome, discontented with the Pope and the luftlest pretensions. In these times, every man who
the Papal Government, he published a very able and plausi- 'holds a pen may get along, and very high. Even the least
ble book of a purport entirely opposite, which brought him 'celebrated, or the most modest, have their hands upon our
under ecclesiastical interdict. He finally abandoned the Chris- national concerns; they edit or furnish matter for the jour-
tian pale altogether. He undertook to teach the French pen- 'nals. The ablest of them, the pushing, rule the State.
pie democracy of the widest compass and strongest complex- Examine who are the men that, for the ten years past, have
ion ; he associated himself, in the editorship of a daily paper, played the first parts, and exercised the greatest influence
with Madame GEotOE SANn, the most libertine of female 'over our destinies; doubtless, the men pf letters rather than
writers. He issued lately, in three large octaves, a sketch of the lawyers, though the contrary idea prevails. GuizoT,
a system of Philosophy-his theory and code for mankind. I 'THiERs, VILLEMAINsr, SALVANDY, DUPIN, et id omne genus,
have turned over the leaves of those volumes, andi attentively 'are of the Academy. Every writer, every lecturer, every
read some of the chapters which might afford me insight into paragraphist, now looks to political life and distinction."
his general design and philosophical notions. He labors to VICTOR HUGO will probably pass from the Institute to the
disprove the fall and the redemption of man; in short, the Chamber of Deputies, and thence, perhaps, to the Cabinet,
work is directed against Christianity ; he would explode all where, like Tinims, he may undertake all the interests, all
revealed religion. The jury were unable to resist the evi- the fortunes of this nation of thirty-three millions. If a re-
dence of the atrocious texts which the Attorney General cited publican revolution should be achieved, what a medley in the
from his pamphlet ; they brought him in guilty on three of Government-savans, literati, lawyers, journalists, socialists,
the four counts of the indictment; and the Court dealt with leaders of clubs, military demagogues, &c.! The first Di-
him leniently in consideration of his age, apparent feebleness, rectory may consist of ARAoo, THEnas, Htoo or LAMENNAIS,
and literary renown. He was sentenced to a fine of four CLAUZEL, and the chief editor of the National.
hundred dollars and imprisonment for one year. We beheld RENaissANcE-We had expected to-day to have announc-
him, in court, escorted, surrounded, fondly countenanced, by ed the re-opening of this theatre, and to have described the
a multitude of literati, judges, lawyers, fine ladies, artists, new piece of M. Lhon Goslan; but fate, or fortune, or cir-
deputies; and M. DE CnHiTEAUBRIAND-the author of the Ge- cumstances have ordained it otherwise, and we have, instead
nius of Christianity and the Martyrs I-conspicuous in posi- of recounting the entrances and exits of 1 tait une fois un
d l e o y d s i e o Rol et une Reine, to state that, at the hour appointed for
tion, and still more so by loud sobbing in behalf of the arch- opening the doors, a notice was exhibited announcing a post-
Deist and Anarchist. At the reception of Count MOLE at ponement par ordre. We subjoin the account given by the
the Academie Francaise, we had the Viscount again, as the Gazette des Tribunaux of the causes of this interruption,
great Catholic Legitimist, todo homage byhis presence to the merely observing that we strongly doubt the interference of
memoyof his pious friend Archbishop DE UELN, whose the British Ambassador in any such matter.
memory of his pious friend Archbishop D ULN, whose t nSaturday evening, at six o'clock, there was a great
panegyric the new member was to pronounce, crowd waiting for admittance at the doors of the Renaissance
Last week, VICTORn Huoo was, at length, elected into the Theatre, which had announced its re-opening with a drama
Academy by a majority of two-17 to 15 votes. He certain- entitled It etait une fois un Roi et une Reine. Some minutes
ly enjoys what I would call popular infatuation rather than before the time for opening the door-, a band, with the words
a fe t y w h d r mc fm s Reliache, par ordre, was placed over the bills.. Agents were
critical fame ; temporary clat, which differs much from solid sent at the same time to disperse the crowd, which withdrew
repute. He is the heresiarch in the French drama, which he without committing any excess, but with manifestations
has sadly corrupted and debased ; his productions form in of dissatisfaction. For several days previously, some of the
every respect the worst and the most pestilent models; they political journals had announced that the representation had
have the deepest taints of every kind. His muse has lavish- been prohibited by the censorship, under pretext that it con-
tained allusions against the husband of the Queen of England
ed incense to whomsoever and to whatsoever has gained the and the English Government. Some had even stated that the
ascendant in French affairs. In reference to this versatility, hesitation of the censorship was the result of diplomatic con-
one of his blind worshippers exclaims, with absolute simpli- ferences with the English Ambassador. We do not know
city, "How prodigious the fecundity of lyric creation, that what truth there was in the rumors given by the political jour-
which, for twenty years, has sufficed for all the various pub. nals, but it appears certain that, after much negotiation, andt
'li, e ortionvcistudeas, trals rmsf revsall thea reb- some changes in the two principal characters, the rehearsal of
'lie emotions, vicissitudes, trials, triumphsreverses-all the re- the drama had been authorized, and that the manuscript was
volutions and glories of so wonderful a period in human an- two days ago given -definitively to the author, with the visa
'nals! Read his effusions, and you find that he has adopted, of the censorship, and the approval of the Directeur des
'indifferently, all conceptions, creeds, and passions. VICTOR Beaux Arts. On F.iday,this personage asked for the manu-
lToo has opened his bosom, like God, to all the ideas that script again, on the pretext of making some new changes;
'luv had opened his bosom, niutke God, to all the ideas hatbut, in the evening, he declared that it would not be returned,
live and move in any quarter or direction ; to all the senti- and forbade the representation. It is added, that several de-
ments in vogue at any time; his philosophy, his choice of puties having waited upon the Minister of the Interior to de-
forms and topics,has been perfectly impartial; the monstrous, mand the explanation of this proceeding, the Minister order-
thegrotesque, pessimism, optimism, infidelity, philanthropy, ed the restitution of the manuscript, and authorized the per-
'sensut, rr a r formance. In consequence of this decision, the performance
sensuality, refinement-every appetite,everyaspiration,every was about to commence, when a new order from the Directeur
dream," &c. The panegyrist whom I here quote is a precep- des Beaux Arts arrived for closingthetheatre. Suchwas the
tor to the King's younger children. But it is not extreme report current amongst the disappointed groups in the Place
licentiousness and hideous abortion which I would designate Ventadour. We give it without guarantying its authenti-
in the works of Hoo, so much as elaborate, and ye gratu city ; but, if true, it is of a nature seriously to compromise
in the works of gratuit- Ministerial responsibility."
ous blasphemy, of which I could furnish hundreds of revolt- The Siicle says that M, Cav6, director of the department
ing instances. An admirer, canvassing for him, begged a of Fine Arts, under the Minister of the Interior, has offered
member of the Academy to concede to their idol one at least his resignation on account of the affair." The Ministerial
of the several vacant places. There may be," was thejust evening journal, in adverting to this circumstance, says:
y, e h in h w t e i Se b veral journals, faithful to their system of attacks against
reply,1 "enough in his works to entitle him to one, but I ,he Cabinet, pretend that it was on the demand of a foreign
know there is more than enough to exclude him from four." ambassador that the representation did not take place. The
Nevertheless, ihe received the zealous suffrages of thegreatre- assertion is completely false, and we give it the most formal
ligious spirits, the special moralists, the exalted teachers, philo. contradiction."
sophers, and statesmetn-the Catos and Platos of the Acade- The Cltharvari states that Messrs. Eugene Sue and Dinaux
d t r having prepared for the Theatre de la Gaild a drama called
niy-CHATEAUeRIAND, RoocaER, COL.LARD, COUsIN, VILLEMAIN, Les Pontons Anglais, in which the sufferings attributed to
MoLE, LAMARTINE, SOUMET, DUPiN, SALTANDvy; and GUIzoT the French prisoners on board the English hulks during the
himself had pledged his vote, but arrived too late to crown last war formed the subject of the piece, the dramatic censors
the sacrifice. The literary Olympus of forty" will, per- would not allow the play to be represented unless the scene
hars, be further graced by the admisioi, under thes was shifted from England to some other country; and that, in
has, be fure y t ace he admission, under the same consequence of this, Spain having been chosen, the name of
lofty ethic and esthetic auspices, BERANGER, superior in lyric the piece has been altered to Les Ptonton de Cadiz.
genius, though not in trangression as an author, to Huo,
BALSAc, A. DUMAS, and others of like celebrity, whosupply the iPRING GOODS.-Received this day-
stage and the circulating libraries with monstrous compounds 6 pieces 4 4 Silks, very rich
of extravagance and turpitude. If a woman were eligible, 8 do 4s-4redn Cuhseline
Madame GEoe. SaND could not fail to succeed, with her 1t do plain colored do
new Radical novel, Le Compagnon du tour de la France, S do 6 4 French Bombasin
duly seasoned from her rich vein of libidinisre. and impiety, 2 cartons ThraLd Vceils and dgngker
held up in her fair hand as a fresh and irresistible title. I 5 do Ladies' and Gentlemen's Kid Gloves
cannot discover, after the cases of THaies and Huo, why 2 do Plaid Ribands
the Abbe DE LAttsieAs, on or before his release from jail, 1 as hlfesscedbrishan chief .
should not be welcomed into both the French Academy and The above goods will be offered low by
that of Moral and Political Science. His literary talents, mar6-eo3iif ADAMS, McPHERSON & CO.
fame, and influence equal at least those of the new Acade- A CARI).-If Ccl. A. P. Field, of Springfield, Illinois, will
micians-his revolutionary and infidel principles and labors call on the subscriber, he will receive a large package of
fl s t of n ; hs s m of p y is e i papers doubtless valuable to him, and which it is presumed were
fall short of none; his system of philosophy is exalted, in stolen from his pocket on Inauguration day.
most of the Liberal journals, into a sublime monument of pc- A. COYLE,
tent reason and metaphysical discovery. He vindicates, they mar 6 Nearly opposite Brown's Hotel.
say, in his grand sketch of a System, &c. the dignity ofhu- C' HEMISTHY APPLIED TO AGRICULTURE,
man nature in maintaining that it could not fall, and that, if, by Chaptal, translated frog, the French. Busll's Cultiva-
by pssiiliy, i ha falen it oul no hae nededanysu-tdr, four years bound together in one quearto volume, for sale low.
by possibility, it had fallen, it would not have needed anyu-Low's Practical Agricuture, London, 1840, iuatimported. The
peenatural intervention to rise again and re-enter upon that Complete Grazier or Farmers' and Cattle Breeders' and Dealers'
career of perfection which it is able to accomplish by its own Assistant, 1 volume octave, London. Cattle, their Breeds! Man-
complete intelligence and firm volition alone. In 1753, the ae:mevi. Di..eaos,5 vol.e-o.puabtistedby.this tritishhSciety
Cr mb ltlueD,ff,.n ,of Useful Knowledge. Blackleck on Shesep, Lon-
old Academy elected Prane, whose dramatic chefs d'oeuvres don, 1540. Boswellon Poultry, London, 1840. Hog on the Car-
are pure and trancendent in every point, and will long sur- nation, with colored engravings, London. The American Oreh-
vive those of Hunoi but even the debauched Louis XV, at artist. Cobbett's American Gardener. Buents Farmers' Com-
the instance of a venerable bishop and in spite of the con- partner. CAild on the CBrere of the Beet and Manufacture of
trary entreaties of Madame DE POMPADOUn, refused the ne- Beet Sugar. Mclntosh's Practical Gardener and Modern Horni-
cessary Royal sanction, on account of the extreme libertin- culiurist, I vol. London, l839. Muhlenberg on Grasses. tultin
Potupv-' ,i_ on Calcareous Manures. Lotiln's Encyclopaedia of Agriculture,
ism of some of his productions. Louts PHILIPPE'S position Gardening, Botany, &e. and many others on the same class of
and the temper and tendency of the times did not allow him subjects, are for sale by F. TAYLOR, Bookseller,
to expunge also, from the list, a name to which, I am sure, asar 6 Near Gadsby'a Hotel.
he must feel a strong repugnance,moral, literary, and political. FRANCE'S OLDI ESTABLIsHED PRIZE
One of the earnest voters for Huoo, ALEXANDER SOUMZT, AR OIFFICE. Washington.-The most magnificent
the author of sundry didactic and descriptive Poems i Lottery ever offered to the Public.
the author of sundry didactic and descriptive poems and UNION LOTTERY-CLAss I.
highly wrought tragedies, which nobody now reads, has To be drawn in Alexandria, Va. 6th March.
just sent forth his grand poem, the fiuit of many lustres and Capital prize $60,000.
intense toil, with the title T1he Divine Epopee, being the Re- Fourteen drawn ballots out of seventy-eight.
GRaANIqD eCHIRMl.K
demption of Hell! Christ, after having become man to save I prize of o$50,000 0 prizes of -$1,000
our world, is supposed by the Paris Milton to have been 1 do 25,000 20 do 600
smitten with pity for the reprobates below, and to have de- 1 do 15,000 40 do 500
scended into the abyss, there to expiate with his blood the I do l .,,.', 50 do 250
1 do ,,]0", 100 do 200
guilt of the damned. The regions of despair are converted l do '8,000 100 do 150
to faith and joy, and penitent Satan reascends finally to the 1 do 7,000 128 do 100
foot of the throne of God, to wash away with his tears all I do 5,172 128 do 80
trace of the sufferings undergone for his ransom. The sub- 4 do f 2,500 128 do 60
lime epic is extolled to the skies in some of the higher Paris 20 do -. 2,000
journals. I think that it will have about as many readers as Besides a large number of $50, $40, $30, &e.
Whole Tickets $1 5-Halves $7 50-Quarters $3 76-
the Abb6 DR LAMENrNAIS'S three octavos of Philosophy, and Eighths St 87J.
no more. The quotations of Monsieur SoumteT's eulogists Certificate of package of 26 Whole Tickets, $200
have filled me with terror at the idea of such a penalty as the Do do 26 Half do 100
Do do 26 Q~uarter do so
perusal of the whole poem. Do 0 do 26 Eighth do 25 .
You might suppose that a choice of the Academy. would The above scheme is one ofthe best that has ever been offered,
be an affair merely of letters, and the author's gain of dignity and persons at a distance Wishing tickets can have their or-
d c, c t a l ders promptly and faithfully filled by ad-reasing R. FRANCE,
and consequence meager enough, considering that at least Washington, who bh 8od mCer caplltal prizes than any office In
i~id of theA whol body tSig quite outer vogu" fnd thb* ib s0 catBy feo 11--powlf
... _______ ________ ___________' lsion of 1834-'5, when no printer was chosen for the next
IN SEN ATE. Congress; iand ever since that period, the House has parp rint-
IN SEN E edits printer for the then existing Congress, and has wholly
THURSDAY, FEBRUARY 18, 1841. disregarded, and refused to be gover-qed by, either of the
-j.int resolutions. On February 11, 1833, a motion was made
The following resolution, offered by Mr. HUBaaBARD,ofNew and carried, to proceed, on the 14th of the same month, to the
Hampshire, beirg under consideration, viz. election of a printer to the House of Representatives for tie
Resolved, That the Senate will, to morrow, at one o'clock, pro- 23d Congress. On the 14th, ten ballots were taken, and ro
ceed to the election of a Public Printer for the Senate for the I person had a majority of the votes given in. On the 15th,
twenty-saventh Congress. thirteen ballots were taken, and no choice having been made,
Mr. HUNTINGTON rose and addressed the Senate: a motion was made by Mr. HALL, of North Carolina, that
Mr. HUNTINGTON rose and addressed the Senate the election of printer be postponed until Thursday after
The professed object of the resolution offered by the Senator the first Monday jn the next session of Congress; and,
from New Hampshire (Mr. HUBBARD) is to execute, on the th mt Mondbin menx Mr. WiLLIAs thatit lie
partof this body, hjitrsltosapoe ac-, 1819, upon a motion being made by Mr. WiLrLiaaIS that it lie
partofthisbodejtbeiointiresolutiuonsap(,rovedMarch3, 18 o the table, Mr. HALL withdrew it. Mr. Boos then
and February 5, 1829-it is to elect, at this session, a printer me tha th frrH balloting for a printer e post-
for the Senatefor the next Congress-it is to select now a oved that the further balloting for a printer e post-
person to perform services for the Senate, which will consist poned until t-Ayes 92, he s1 day of March (then) next, whichto
of individuals a portion of whom can have no voice in the se- ws l fourteenth ballotyes 9, whnoes 101. The House then weproceeded to
actin. t wuldsee resonble o pesue tat he di-the fourteenth ballot, when Gales & Seaton were duly elect-
lection. It would seem reasonable to presume that the indi- ed printers. At the session of 1835-'5, the House refused to
viduals composing the Senate which is to meet after the 3d sus pend the rules relative to the priority of business, for the
of March next will be quite as competent to elect a printer as p o consering a resolution offered by Mr. McKiN-
others are to perform this duty for them ; and it would also L, that the House will proceed to the election of a printer
seem to be quite as suitable for the body tor whom the work lthe House of Representatives for the next Congress,n and
is to be done to make the appointment as for others to do it no printer was appointed by that body at that session. But
in their behalf and without their co-operation. Reasonable, at the succeeding session of the new Cotngress, the Ho use,
however, as these views are, the alleged motive for the intro- on the 7th of December, 1835, appointed "their printer" for
duction of this resolution and for its adoption is,'not that Congress. At the session of 1836-7, there was no mo-
each House ought to be deprived of the power of electing its tion made to elect a printer for the next Congress; but when
printer, but that the law is imperative, and requires us to the new Congress commenced,rf the House.elected on the 7h
choose one for the Senate for the next Congress. It seems of Sep temper, 1837, their printer for that Congress. At the
important, therefore, to examine the provisions of the resolu- session of 1838-'9, a resolution was offered to proceed, on the
lions on which the present motion is based, and the practical second Monday of February (then) next, to the election of an
construction put on them by each House, so as to ascertain printer tonM ona o r the Hose for the 26th Congress; which was laid
whether the Senate is required now to proceed in this matter. p rner there, fo te2hgan gres whc wat session.
There are two resolutions relating toth is subject : one was over under the ru'e, and not again taken up at that session.
There dar9e two resolutions relating thhe F bjectrone w And on the 30th of January, 1840, at the next Congress, the
approved March 3, 1819; the other February 5, 1829. The House appointed its own printer.
former, after making provision for the form and manner of the And now, M r. President, in view of these resolutions, and
printing, and the prices to be allowed for the composition and the practice under them, three questions arise and deserve our
press-work, declares as follows: consideration, with reference to the present motion.
"That, as soon as this resolution shall have been approved by i. Is the Senate bound to proceed, at this session, to elect
the President of the United States, each House shall proceed to their printer for the next Congreasl Are these joint resolu-
ballot for a printer to execute its work during the next Congress; tions, or is ith of them, compulsory on the body to make
ancd the person having th Lgreatest number of votes shall be conto- or i ite n o t
sidered duly elected, ai~- all give band, with securities, to the the appoittmert
satisfaction of the Seco of the Senate and the Clerk of the 2. If not, isthere any necessity which creates an obligation
House ofRepresentativ!esepectively, for the prompt, accurate, on us, and makes it our duty now to appoint this officer 1
and neat execution of the work; and in case any inconvenient de- 3 If there be no such necessity, is there any ground ofex-
lay should be at any time experienced by either House in the do- pediency which makes the adoption of the pending motion
livery of its work, the Secretary and Clerk, respectively, may be proper and suitable '1
.Il, ';: .-J -.. :...i a,. T I :-.. r i. ... "r. ..., r,, 1. Are the resolutions such, connected with the proceed-
"-.rl, .i I.. ..: ., ..1 ,,...n. .... . .. .. togs under them, as to makeit animperativeduty on the Sen-
of such printer fr c 1... .'. -., t, r 1 l '.e, I i.., .. ate, now, toelect a printer'I
lowed, to the printer guilty of such negligence and delay : Pro On this point, several reasons may be urged against the ob-
-ided, That nothing heroin contained shall preclude the choice ligatory force of these resolutions.
of the s-,nie printer by the Senate and by the Honae of Represen- One is, that the office of printer to the Senate is an office
tatiees." within the meaning of that clause of the Constitution of the
The latter resolution is in the following words: United States which declares that the Vice President shall be
"That, within thirty days before the adjournment of every Con- President of the Senate, and that the Senate shall choose
gress, each House shall proceed to vote tor a printer to execute their other officers, and also a President pro tempore, in the
its work for and during tle succeeding Congress; and the person absence of the Vice President, or when he shall exercise the
having the majority of all the votes given shall be considered duly office of President of the United States. This will be quite
elected; and that so much of the resolution approved the 3d day obvious, when the Senate consider what an office is (as that
of March, 1819, entitled a resolution directing tho manner in n ic i h
which rthe printing of Congress shall be executed, fixing the prices term is understood in a constitutional and legal sense)-the
thereof, and providing for the appointment of a printer or printers, nature of the office of printer to such a body as this-and the
as is altered by this resolution, be and the same is hereby re- legal duration of it. An officer of the Senate is one who is
scinded." appointed by the body to perform for it certain appropriate du-
tll will be perceived, from an examination and comparison ties. The Secretary is an officer; the Sergeant-at-Arms is
of the two resolutions, that they differ in several respects, an officer-because each receives his appointment from the
That of March 3,1819, neither requires nor authorizes the Senate, and each is required to discharge certain duties in re-
Senate, at one Congress, to appoint a printer for the body for ference to the Senate. The Secretary keeps our files andt re-
the ensuing Congress, except for the then ensuing Congress. cords, makes up our journal, records our proceedings. The
They must have appointed, at that time, for the Congress Sergeant-at-Arms has also 'is appropriate duties to be per-
which was to succeed, or not have appointed at all; because formed for the Senate. The printer also is appointed by the
the resolution was not approved until the 3d day of March, Senate, to perform certain acts for them. He is to make co-
which was the day of the constitutional termination of the pies for us of what we may order. He transcribes for us,
then Congress, and if that Congress appointed any printer, it through his press, our bills, reports, Executive communica-
must be one for their successors. Besides, as I shall have oc- lons, &c. He may be viewed as a copying clerk, who does
casion hereafter to mr nation more particularly, in no other not indeed write for us with pen and ink, nor engrave, but
way could the processed object of the resolution be then at- who, in effect, does that which is equivalent to it, through the
trained. That object is clearly alluded to and sufficiently spe- medium of his types and press. He is a confidential officer
cifled in the report of the committee to whom was referred also, in some respects. He prints in confidence, for the use
the subject of the public printing. The committee say they of the Senate, such papers as are ordered to be so printed.
have regarded "the subject committed to them as connected He is as much an officer of the body as our Secretary. The
with the convenience of the members, the information of the duties of the two are indeed different, but both receive their
community, theeconomy of time and money, and the charac- appointment from us, and both perform certain acts in our
ter of the country." And in reference to the then existing service, and for the benefit of the body. He is not a mere
mode of procuring the printing of Congress to he executed, agent, employed under a contract, bet he is selected and ap-
viz. by offering the work by advertisement to the lowest bid- pointed by the vote of the Senate, (as our Secretary is,) with
der, they remark that, under this mode- defined duties. To both we pay an equivalent for the services
,, " , ,rendered--one in the shspe of an annual salary--the other in
Both Houses have frequently to wait long for interesting andI irenered-ont manner. If, thenin the prishape of an annual salary-the be othfficer con-
important communications from the President or heads of De- a
apartments, reports, bills, resolutions, &c., upon which they were templated by the Constitution, he of course, according to the
called to act, and the loss of time thus incurred, considering the acknowledged and settled law on the subject, holds his office,
daily expense at which Conress sits, costs the nation ,much more generally, at.the will and pleasure of the body which appoints
than the dilference between the present price and a liberal allow- him. And such an officer, according to the language arid
dance which would justify the application of a greater capital to spiritof the Constitution,islobesppointed by the Senate; aind
ensure the desprtch ofthe work." by reasonable inference he is to be appointed by the Senate
Now, to enable the printer to prepare himself to perform the for.whom he is to perform the service; or, at least, that Senate
printing of the Senate promptly, by procuring the necessary has a constitutional right to make the appointment; and, if
materials asd contracting for the necessary labor in advance so, the Senate at a previous Congress cannot deprive them of
of the session of Congress, he was appointed in advance; and that right. And any and every joint resolution which pur-
the resolution having been adopted on the last day of one ports to authorize an appointment of such officer byene branch
Congress, if any appointment was made, and the beneficial of Congress for its successors, has not the force of law to bind
results contemplated by the resolution were to follow, it must those successors: for it is controlled by the paramount autho-
be made for the ensuing Congress; and, accordingly, an ap- rity of the Constitution. "The Senate shall choose tAseir
poiniment was then made. But the resolution, so far as it (other) officers." If the Senate can appoint the printer for
related to the appointment of a printer for another Congress, the next succeeding Congress, they can elect one for a more
was confined to that which immediately followed. Such is its remote Congress. If they can appoint for two years, in ad-
language, and no known and authorized role of construction vance, they can appoint for twenty years; and the Senate in
can carry it further. Each House shall proceed to ballot session in 1841 may choose a printer for that body,to continue
for a printer to execute its work DURING THE NEXT CONGRESS." in office until 1861. But will it be claimed that such an sp-
It is only for the ensuing Congress that a printer is to be ap Pinirnent-whether under t joint resolution or otherwise-
pointed. There is not the slightest allusion to any subsequent would bind the Senate of 1850 so that it could not be revoked 1
proceeding of a like character. Both the right and duty to The joint resolution is not, therefore, binding and compulsory
elect for another Congress are confined to an election for the on us, at the present time.
then next Congress; and it is certainly somewhat surprising But another reason why the resolution is not obligatory is,
thai any other interpretation should ever have been given to that each House may remove its printer. This is incident to
this resolution. The report of the committee limits the ac- the nature of the office, and may bq indispensable to the pre-
lion of Congressin the same manner. The following is the servation of the just rights of the appointing body. If he is
language of the report: an officer, he holds his office ordinarily during, the pleasure
"Under all circumstances, the committ-e have deemed it their of the Senate, and, of course, may be removed: or if not
duty to ,ecommcnd that a tariff of prices for every kind of print- strictly an officer, he is subject to removal, else the power of
ing required to be done for Congress be fixed by a joint resolution the Senate over him, in all cases and under all circumstances,
of the two Houses, to continue in force for two years; and that, is gone. Suppose, then, he should insult the Senate while
before the close of the prese t session, each House make choice, in session, or suppose he should print libels upon them, and
by ballot, of a printer to execute its own work DUaRIN THE NEXT place them upon our tables, or suppose he should divulge the
CosNGaES." contents of confidential papers, or suppose he should call us
The power, therefore, to appoint biennially, for a new Con- traitors, or bestow upon us other opprobrious epithets, should
gress, never was conferred on either House by the resolution we be obliged to continue to employ him because he had been
of 1819. When one appointment was made under it, the appointed under a joint resolution 1
power to appoint was fully executed-it was spent, and could A third reason why the resolution does not bind a subse-
not be revised except by some new act. But the resolution quent Congress is, that each House may appoint a printer for
of 1829 went much farther. That not only justified, but di- itself, notwithstanding the joint resolution, and both Houses
reteled an appointment at one Congress fur a succeeding Con- may agree to rescind that resolution without the approbation
gress. This was to be done biennially. The power was to of the President. Has not the printer of tho House, who has
continue as long as the resolution continued operative, (if it been elected for several years, regardless of this resolution,
ever had any legal existence.) Such is the language of the been the lawful printer '1 Was he merely the printer de facto,
resolution. Within thirty days before the adjournment of and not de jure ? And must both Houses obtain the consent
every Congress, each House shall proceed to vote for a print- of the President to appoint their own printer, unless two-
er to execute ihs work for and during the succeeding Con- thirds of each concur, against his consent It they should
grosss" agree to rescind this resolution, and the President should re-
The two resolutions differ in another respect. That of fuse his signature, would it require two-thirds of each House
1819 conferred the office of printer on the individual who to repeal it for every practical purpose I These questions
should receive "the 'greatest number of votes" of the body furnish their own answer. I do not think the doctrine could
making the election; that of 1839 required a majority of all be maintained here, that this resolution cannot be repealed, it
the votes given" to make a valid election. effect, without passing through all the forms of a law. But if
There is still another difference in these resolutions. By we must appoint under it, then it follows that we can ap-
that of the earliest date no precise time is specified within point in no other way, nor at any other time, nor remove for
which the election was to be made. It was to be made, how- any cause, nor repeal, by our joint act, the resolution of 1829.
ever, immediately after the resolution should have been ap- If we should fail to make an election at this sesilon, could
proved by the President. But it did not authorize an elec- we elect at the next t And if the person elected should case
tion at any subsequent Congress, nor, of course, did it desig- to be an officer deserving our confidence, we could not remove
arateany time at which a future election should be made. But him. Such would be the consequences of holding this rese-
the resolution of 18"29 declares that "each House shall pro- lotion compulsory: end they show, in a very clear tight,
ceed to vote for a printer within thirty days before the ad- the unsoundness of ,the doctrine which makes it obligatory.
journment of every Congress." There is, however, another reason which makes it quite
Such, substantially, are the provisions of the two resolu- clear that the Senate is not bound to consider the resolution
tions under which the power is now attempted to beexercised as now binding on them; and that is, that it has been, for
of electing a printer for oursuccessors. It is entirely obvious several years, treated as a dead letter tly the House. That
that the one of 1819, so far as it relates to an appointment, is body has abrogated and annulled it. They have refused to
now destitute of any legal force. It spent its power at the be governed by it in practice; and it has had no binding firee
first election, and byvirtueof it no election could now be held. in that branch of Congress for some time. Now, ii is quite
The second resolution, in its terms, provides for successive obvious that it was intended to regulate the action of both
appointments. branches, or neither. This is in the form of a joint reso-
It becomes important, now, to refer to the practice under lution. It purports to create an obligation on both, and
both resolutions, in both Houses of Congress, to ascertain the reason heretusaro sefed to, for its enactment, vix.
whether tuey have been uniformly treated by the parties to that it would enable the printer, in advance, to prepare
them, and upon whom they were to operate, as valid subsist- himself for the prompt and faithful performance of his duties,
ing resolutions, having the force of law and binding upon the shows that both Houses were to act under it, and not one only.
respective branches of the Legislature. It was, then, substantially a mere arrangement between the
In the Senate, the practice has been uniform and consistent two Houses as tothe manner and time of appointing a lunner
with the resolutions, unless the proceedings in March, 1827, for each; and, if one ceases to be governed by il, no legal ,.r
and December, 1827, constitute an exception. On March 1, moral or just principle requires the uther t,) perform it. The
1827, on the motion of Mr. Ct.AYTON, it was resolved that, in neglect, by one party, to execute the arrangement, justifies
the election of the public printer, (this day,) a majority of all the other in refusing to act alone. To insist upon the per-
the votes given shall be necessary to a choice. A ballot was formance of a contract which, in its very nature, requires to
taken, and no person had a majority. Duff Green had a plu- be executed by each, by the one which refusrs to act at all,
reality. The state of the votes was ordered to be entered at would be clearly unjust. It would not be more so than to
large upon the journal. The Senate proceeded to a second require the Senate to proceed to elect a printer, by virtue of
ballot. Duff Greet had the greatest number of votes, but the joint resolution, when the House have, in effect, informed
not a majority. No further proceedings appear to have taken us, that they will not, on their part, proceed to such an elec-
place in the Senate, at that session, on the subject. At the tion.
next session, on December 4,1827, the following motion was 2. Having thus, as I believe, satisfactorily answered the
submitted by Mr. EATON, read, considered, and adopted- objection that the resolutions of 1819 and 1829 are obligatory,
Yeas 25, nays 19 : and shown that they ought not to control the free action of
In pursuance of a joint resolution of the Senate and House of the Senate, the next inquiry is, does any necesity exist for
Representatives, passed in 1819, regulating the subject of print- proceeding at this session to the appointment of printer for
ing for the two Houses, respectively, an election having been bad those who are to come after us 1
by the Senate, during the last session, for a printer to the Senate, I am sure there is nothing of a personal nature which has
and Duff Green having, according to the provisions of said reso- led the Senator from New Hampshire to present this resolu-
lution, received the greatest number of votes, therefore tion and press its adoption. He cannot have any desire to
".Rtaolted, That, in the opinion of the Senate, the said Duff assist in making a printer for a body of which he will soon
Green is duly elected printer to the Senate." cease to be a member. He certainly does not feel that any
On February 28, 1835, a motion was made, and adopted, duty devolves upon him particularly to move in thin matter.
(yeas27, nay s 18,) to proceed to the election of a printer on And if he-feels any great weight of r.-sp'nsihtlitv resting
its part for the 24th Congress. The ballot was taken, and no upon him to see that this- joint resolution iW fully executed and
person received a majority of the votes given in. It was then carried into effect, I think he can easily obtain absolution for,
moved that the election be postponed until the first Monday the offence of refraining from any action on the subject; and
in December (next:) which was not agreed to-yeas 18, nays if we should now refuse to elect a printer, I do not believe
28. After the fourteenth ballot had been counted, and no that his conscience need be much disturbed, on account of
person having received a majority of the votes given in, a mo- the failure of the Senate to regard a.resoluiion which has
tionwas made to postpone the election indefinitely; which was been so long disregarded by the other branch of the Legisla-
determined in the negative-Yeas 18, nays 29. And on the ture. Is there then any necesaiiy for proceeding now to an
seventeenth ballot, Gales & Seaton, having a majority of the election'l Must we elect now, to effect theobjectof the j lint
whole number of votes given in, were declared duly elected resolution, vig. to enable the printer who may be chosen to
printers to the Senate for and during the24th Congress. prepare to do our priming at the neat Congresse It is obvious.
In the House of Representatives, the practice commenced no such necessity iiitsI fur we now have a printer, who will
n cg9fo!lmii' 19 the r8olutions*'and tclinted ntii the seo-. maiti lI offic untill the 4th of Mibuba5 9oI hotu dg s htI
'~'a
S nente convenes, when an appointment can be made, if it be
necessary. And the experience of this Hiouse, which, for
several years, have not appointed in advance, shows that no
essential injury has been occasioned by reason of the delays ;
S at least I have not heard any serious complaint made that the
L..^.Afnling has not been done with sufficient despatch in conse-
,,r- qaienee of the failure to appoint a printer at the previous
i session.
S 3. There being no necessity for it, does expediency require
S the passage of the resolution before us 7 If so, what are the
grounds of the supposed expediency I Will the Public gain
any thing by immediate action, or lose any thing if it be omit-
ted? Can we make a wiser or better selection than our suc-
cessors'7 Are they not as comp tent as we arc to select an
individual to perform service for them Will the character
or honor of the Senate be put at hazard if we delay a choice
for two weeks Will the nation gain any thing in a pecu-
niary point of view if we now elect a printer, or lose any thing
if the election, bh postponed I Surely, there can be but one
opinion on this point. Why, then, should it be urged upon
the Senate now? Is nothing due to the opinions of those who
are to succeed us in these seats Would it not be quite as
delicate in us to leave the appointment to be made by those
for whom thl work is to be done'? Shall we act as if we
deemed ourselves more competent to make a proper appoint-
ment than the Senate which will convene in a few days'?
But if nothing is due to them, is there not something due to
public sentiments Will not that be condemnatory of the
proposed measure'! And however pure the motives of every
Senator are, will it not be said by the Public that an opportu-
nity was taken by a defeated party to use the brief authority
they now possess to distribute the last of the loaves and fishes
to a political favorite, and to choose for an officer of the Sen-
ate one who may be obnoxious to the majority which will
meet in this Chamber in a few days ? Will not such be the
expression of public sentiment ? Now, in view of the consi-
derations to which I have referred-viewing the joint resolu-
tions as not obligatory, and an appointment under them not
compulsory nor binding upon our successors, I take leave to say
that, should the resolution be adopted, and an election take
place under it, I shall not consider myself bound to regard it
as an act which the Senate cannot hereafter rescind. And I
hope and trust that one of the earliest acts which the Senate
will perform at its session on the 4th of March next will be to
assert its constitutional right, and perform its constitutional
duty of appointing its own printer.
Regarding, therefore, the adoption of the pending resolu-
tion as wholly unnecessary and inexpedient, and as impro,
perly interfering with the rights and duties of those who are
to succeed us here, I move that the further consideration of it
be postponed to the fourth day of March next.
APPOINTMENTS BY THE PRESIDENT,
By and with the advice and consent of the Senate,
JUDGES.
PHILEMON DICKERSON, to be Judge of the United States
for the district of New Jersey, in the place of Mahlon Dick-
erson, resigned.
PETER V. DANIEL, of Virginia, to be one of the As-ociate
Justices of the Supremo Court of the United States, in the
place of Philip P. Barbour, deceased.
JOHN Y. MASON, of Virginia, to be Judge of the United
States for the eastern district of Virginia, in the place of Pe-
ter V. Daniel.
JUSTICES OP THE PEACE.
JOSEPH N. FEARsoN and BENJAMIN FRANKLIN MACKALL,
for the county of Washington, in the District of ColuItbia.
ISAAC KELL, senior, for the county of Alexandria, in the
District of Columbia.
DEPUTY POSTMASTER.
SOLOMON WESTCO-rT, to be Deputy Postmaster at Hud-
son, in the State of New York.
JOHN F. KACKLER, Collector of the Customs for the dis-
trict of St. Mark's, in the Territory of Florida, vice Francis
S. Beattie removed.
SUPREME COURT OF THE UNITED STATES.
MONDAY, MARCH 1, 1841.
On motion ofAttorney General AUSTIN, of Massachusetts,
FRANCIS BRINL.EY, Esq., of New York, was admitted an at-
torney and counsellor of this Court.
TRANSPORTATION OFFICE,,
WASHINGTON BRANCH RAILROAD, MARCH 4, 1841.
_NOTICE.-An additional train of Passen.
ger Cars will be despatched from this depot
daily, until further notice, at 12 o'clock non.
The regular trains will start as usual at 6 A.
M. and 4P.M.
By order: SAML. STETTINIUS,
mar 5 Agent.
NOTICE.-The tail-boat SYDNEY, for the
Soilh, will change liar hour of departure fromin
Washington to 5 o'clock, on the mornings of the 5th, 6tn, and
7th of March only. All persons on board by that hour will be in
time. mar 4-3t
D DRAWN NUMBERS OF POKOMOK E RI
VER LOTTERY, Class 31.
Drawn March 3, 1841.
10 24 8 5 11 26 68 71 12 13 33 27
Drawn Numbers of Poeomoke River Lottery, Class 32.
55 5-3 37 23 3 641 1 61 30 11
JAMES PHALEN & CO.
mar 6 Manasers.
N EW AND RICH FANCY GOODS.-We are now
daily receiving a great variety of goods suitable for the
spring trade, some of which are already received, viz.
Rich plain and figured blue black Puult de Soio
Plaid Silks, very rich
Plain Silks, light colors
French Chintzes
Black Brussels net Shawls
Cotton and silk Hosiery in great variety
BRADLEY, CATLETT & ESTEP.
mar 6-3t [Globe]
TrHREAD LACES AND EDGINGS, 6iC.-This
day received-
2 cartoons thread laces and edgings, very cheap
6 pieces fine French linen lawns
50 dozen linen cambric handkerchiefs.
mar6-3t [Globel BRADLEY, CATLETT, & ESTEP.
SARGE AND CONVENIENT BRICK HOUSE
tort Rent.-Por rent an excellent large and airy Brick
House, on the corner of Green and Gay streets, Georgetown,
north of the old Union Tavern. The house is very handsomely
furnished, and the furniture can be had with the house at a fair
price. The hose would be very desirable for any of the heads of
Departments or foreign Ministers, and can be had on the lest of
April, or sooner if desired. There is also for sale, at the same
place, a very superior family Coach. For further information
apply to EDWARD DYER & CO.
mar 6--St Auctioneers and Commission Merchants.
ILKWORMS' EGGS of the Pen Nut variety, warranted
good. Inquire of CHtARLES STOTT, Apothecary, corner
of Pennsylvania avenue, near Brown's Hotel. mar 6-3td
ALUABLE LANDS FOR SALE.-In pursuance
of a decree of the Circuit Superior Court of Law and
Chancery for Frederick county, in a suit wherein the Farmers'
Bank of Virginia is plaintiff, an beat land; a fine stream of water passes through the
lands, and there are two fine orchards on the estate. Before the
day of sale the lands will be surveyed and the corners marked.
In the mean time, Lewis A. Smith, Esq. residing on bhe lands, will
show them to any one disposed to purchase. Possession, except
the lands sown in grain last fall,will be given immediately.
Terms of sale, one fourth of the purchase money to be paid in
cash, and the reside in three equal annual payments, with interest
from the day of sale. Sale to commence at II o'clock A. M.
A.S. TIDBALL,
J. M. MASON,
mar 6-opts Commissioners.
O9 fb DOLLARS REWARD.-Ran away from the
J %71 subscriber, about the slet July last, a man named
SGCIPIO GANTT, supposed to be from 48 to 50 years old, 5 feet
8 to 9 inches high, dark complexion, and spire ; had on when he
left, domestic cotton shirt and pantaloons, and took with him one
hblue cloth coat, dark loth pantaloons, and old fur while hat. He
has been seen at different times in the Pomonkey and Mattawo-
man neighborhood within the last three weeks. He has acquaint-
ances in Washington and Alexandria, D. C. The above reward
will be given if taken and secured so the undersigned gets him,
in a free State; fifty dollars if taken in Virginia, the District of
Calumbis, or Maryland, excepting Charles county,and twenty-five
dollars in that. ROBERT GRAY,
mar 6--2awlmo Charles county, Md.
Capital prize of 50,000 dollars.
ON SATURDAY, (MARCH 6.)
UNION LOTTERY,
No. 1,
Will be drawn at Alexandria, D. C.
14drawn Nos.
GRAND SCHEME.-
1 prize of $50,000 1 prize of $7.000
I do 25,000 1 do 5,172
1 do 15,1000 2 prizes of 4,000
1 do 10,000 4 do 2,500
1 do 9,000 20 do 2,000
1 do 8,000 20 do 1,000, &c.
Tickets $15-Halves 87 50-Quarters $3 75--Eighths $187.
Certificate of package ef 26 wholes, $200
Do do 26 halves 100
Do do 26 quarters 50
Do do 26 eighths 25
For sale by
D. S. GREGORY & CO., Managers,
Penn. avenue, next door east of Gadsby's, Washinglon.
mar 4-ilfStd
FAUlUIER AND ALEXANDRIA TURNPIKE
ROAD LOTTERY,
CLASS 10.
Draws Saturday, March 6th, at Alexandria, Vs. at 5 o'clock P. M.
I prize of $15.000 2 prizes of $1,000
2'prizes of 2,00i 5 do 700
2 do 1,5501 6 do 600
2 do 1,260 40 do 500
&c. &o. Ac.
72 number Lottery-12 drawn ballots.
Whole tickets five dollars-shares in proportion.
For whieh, apply to or address
JAS. PHALEN & CO. Managers,
lKr |-Sf Penn, Aveual n@ar 4j street,
VERY LATE FROM EUROPE.
The Steamer PRESIDENT, Lieut. ROBERTS, R. N.
arrived at New York on Wednesday morning last,
bringing very late news, of which the following,
which we copy from the New Yolk Commercial
Advertiser, are the most important particulars :
FROM THE FAR EAST.
The overland mail from India arrived on the 6th of Feb-
ruary, bringing advices from Macao to the 3d of November,
from Chusan to the 27th of October, and from Bombay to
the 1st of January.
The news will probably astonish those of our contempo-
raries who, on the arrival ofthe Boston steam-ship, were so
ready to cry out the news from China is confirmed-the
dispute is settled." All agree now in saying, as we did then,
that Admiral Elliot had made no progress-or, if any, a pro-
gress backward. The squadron was still at Chusan, where
sickness was making fearful ravages; out of 3,650 men land-
ed there, only 2,036 were fit for duty.
At Canton nothing had been done, but the prospect that
any thing would or could be done was looked upon as hope-
less. But we will allow writers on the spot, or in the imme-
diate vicinity, to tell the story.
FROM THE BOMBAY TIMES.
Our contemporaries concur with the universal voice that a
great calamity has befallen us-that for the present the ob-
jects of the expedition are stultified by our own deed, and the
date of the conclusion of amicable arrangements and the re-
newal of commercial intercourse indefinitely postponed.
While the deputy of the Emperor was negotiating with all
humility and condescension with Admiral Elliot at Peiho,
his master, the Etrperor, had caused the proclamation which
we now publish ts be issued at Canton, proclaiming his sue-
cess and our defeat in terms as arrogant and insolent as any
which he has h. roem..r s-,.l..oed. If the Chinese seek fir
proof of the Inpi.-- Mjl, nit. .t.., he may point to the fleet re-
turning from ii,.- Yoloi Sd, and sailing to meet a commis-
sioner, who is believed by Admiral Elliot to be authorized to
make a conclusive treaty, but whose powers theimperial chop
limits to reporting proposals to the Emperor.
The Admiral, so far as we can gather, has made no de-
mand of compensation for our destroyed merchandise, or re-
paration to our injured merchants; and if we were to endea-
vor to discover the objects of the expedition from the charac-
ter ot the transactions which have already taken place, we
should say that the armament haid been sent to tell the Em-
peror of China what a deal of expense its outfit and despatch
had cost us, and to insist on his Maj'sty defraying the charge,
and then to sail back again and tell the People of England
what a deal of money we hadil got from the Emperor of China
-as much as nearly covered the whole cost of our going to
ask for it-and what a reasonable fellow he was compared to
*what he was represented to hbe.
The first application sent to Ningpo for the release of the
crew of the Kite and Capt. Anstruther was unsuccessful;
and the Blenheim and two other vessels of war had been sent
across to renew the demand : the result of the second appli-
cation was not known when the last accounts came away-
the answer to the first was, that they would not be give up
until all differences were arranged.
The mortality prevailing among the troops meanwhile is
fearful. Out of 3,650 men who landed in China on the 4th
of July, 26i2 were dead by the 22d of October, and 1,614 rea-
dered unlit for duty by disease. On the voyage, in which
nearly as much time was occupied as that during which we
have held possession of Chusan, only 60 died; and of the
4,000 troops who left with the expedition, 300 have already
found unhonored graves. Nearly one-twelfth is a fearful di-
minution of strength before operations are commenced.
BOMBAY, Jan. 1.-The month of December has been by
no leans so prolific of news as that which immediately pre-
ceded it. The Red Rover arrived at Calcutta on the 16th
ult. from Macao, bringing intelligence from that place to the
3d November, and from Chusan to the 24th October. Up to
the latter date very little change appears to have taken place
in the position of the squadron. The admiral was still at
Tinghae, but was expected to sail for Canton about the mid-
dle of November. The repairs of her Majesty's ship Mel-
ville have been completed, and the commander-in-chief will
again hoist his flag in that vessel. The admiral has directed
a fort to be erected near Tinghan, and outposts to be estab-
lished round the whole island. This seems as if he contem-
plated the permanent occupation of Chusan as a British pos-
session; though it has been hitherto supposed that its surren-
der to the Chinese would constitute the basis of future nego-
tiations. Nothing is as yet known relative to the demands
which the eom'nisaioners have made on the Chinese Govern-
ment, and all that hass been said on the subject is but conjec-
ture. It will probably be two months before we get any cer-
tain information. Lieut. Douglass, Capt. Anstruther, and
the other prisoners at Hingpoo, have written to Chusan, stat-
ing that they are kindly treated, but much in want of cloth-
ing. Her Majesty's ships Samarang and Calliope, from
South America, have gone on to join the admiral, so that the
naval force now consists of 19 ships of war, besides four arm-
ed steamers.
At Macao every thing has been quietsince the affair at the
barrier. Mr. Stanton is still detained at Canton, where an
imperial edict has been issued depriving Lin of all authority,
in consequence of which the Lieut. Governor has assumed
charge of the province. The Viceroy has been ordered to re-
main at Cantoan until the arrival ofthe imperial commissioner
Keshen, who was expected to reach that place in a few
weeks. Opium 'is still disposed of in large quantities, and
fetches from 450 to 500 dollars per chest. The regular
trade is at a stand still, the regular merchants not being de-
sirous of purchasing until the result of the expected negotia-
tions be known. The consequence is, that immense quanti-
ties of c-tton, etc. are lying on hand, and becoming a com-
plete drug in the market. Should hostilities recommence,
which is extremely probable, it is supposed that the Chinese
will nevertheless carry on a considerable export trade in a
clandestine manner, as they appear willing to bring any thing
down to the shore for which money may be offered.
MACAO, Nov. 3.-Both the ChIinese authorities and mer-
chants appear to feel certain that there will bo an immediate
settlement ofdifferences and reopening of trade. But among
foreigners the impression is still general that this arises from
a confidence of being able, as usual, to circumvent by nego-
tiation, and that, without a heavier blow than has yet been
struck, it is impossible they can really intend to grant at once
the heavy demands of the British.
It is therefore expected that much difficulty and delay will
be experienced in the negotiations about to commence, and
that a resort to force will be ultimately requisite.
MACAO. Nov. 3.-In exports a limited trade goes on, ex-
cept in tea and Nankin silk, which continue rigidly interdict-
ed. The Louisa Baillie is taking in the last of the former
season's teas, which have been awaiting a conveyance to
England.
TOONKOO, Oct. 14.-A brig, the Kite, was wrecked up
the coast, and the Chinese have got the crew in their posses-
sion, and say they will give them up when we give up Chusan.
From India the accounts are more favorable to British pol-
icy. Another victory bad been gained over the Belooches in
Scinde, some five hundred of them being killed. Confident
hopes were entertained that both Scinde and Affghanistan
would be tranquilized in a few months.
In the Punjab family dissensions between the widow and
brothers of the late No Metal Singh were apparently opening
the way for British intervention. All was quiet in Burmah,
but in Nepaul military preparations and suspicious movements
were still going on, and it was thought that in case of renew-
ed hostilities with China there would be a war also with the
Nepaulese.
TURKEY AND EGYPT.
The Turkish fleet, having been given up by Mehemet All,
sailed from Alexandria on the 21st of January. Commodore
Napier had returned to Alexandria, with the treaty, which
was agreed to by the Pacha. Ibrahlm had left Damascus for
Gaza, and preparations were going on for embarking his
troops.
THE CASE OF McLEOD.
This case was briefly touched upon in the House of Lords
on the 8th. It was introduced by the Earl of MOUNTCASn-
EL, who, after some remarks on the enormity of the proceed-
ings had in the State of New York, inquired of Lord MEL-
BOURNE whether the Government had any information, and
what steps had been taken.
The VISCOUNT replied, briefly, that information had been
received that Mr. McLeod's liberation had been demanded
by Mr. Fox, &c. As to the steps, he was sure that the House
would not expect him to give any atiswer at present. He
would only say that ministers had taken every means in their
power to secure the safety of her Majesty's subjects, &c.
In the House of Commons the same matter waa called up
by Lord Stanley, who said,
Seeing the noble Lord the Secretary for Foreign Affairs in
his place,he (Lord S.) should ask that question of which he had
given notice. This being a subject of so important a nature, and
coming forward at so critical a period, he was compelled to pre-
face the question he was about to put by a short statementof facts;
hut it should be only such a statement as thie rules of the House
permitted."
[Here his Lordship stated the facts relating to the destruc-
tion of the Caroline, which, by the way, he called a schooner;
and then proceeded as follows :]
A representation of these proceedings was made by the nutho
rifles ofthe State of New York and the President of the United
States, and at the same time a counter-statement was drawn up
by the British authorities in Upper Ganada,and transmitted through
Mr. Pox, our Minister in th e United States, to the Government of
that country. In consequence of the conflicting nature of the evi-
dence thus produced, the President entered into communication
with Mr. Fox, and forwarded to him a copy ofthe evidence trans-
mitted froi9 the authorities of New York for the purpose of being
laid before her Majesty's Government. These papers were ac-
companied by a demand of reparation for what the despatch called
an outrage on the neutrality of the American territory.
A counter-statement from the Canadian authorities, containing a
strong euuoater-ri.prssenstaiun, having been made byher Majesty's
Mlni*t(r it WashigtaL, tbe whole of thJeGrrespoliI4Bt woo ltI
January or February, 1838, transmitted toher Majesty's Govern- can Government had disavowed their citizens in the other case,
meant, accompanied by the demand for reparation made by the he conceived that the American Government had adopted an in-
Government of the United States. But, from that period to the tlernattonal responsibility in the late detention of Mr. McLeod,
present, ni',) information had been laid before the House by the and could not therefore change their ground upon this question.
PrF-.'e.i ri, i:.- respecting the affair. The Colenial office, in 1838, [Hear, hear.]
gave stme information to the House on the subject, and after that Sir R. PxELt wi-hed to ask the noble lord a question relating to
it firnished various papers, including the proceedings of the matter of fact.l He believed that, in the expedition which had
House of A'semblyand the Lieutenant Governor of Upper Cana- been formed for the destruction of the Caroline, certain officers
da, who, in those ocunments, strongly supported the views of the who held commissions in Her Majesty's army and n'ivy were con-
Canadian authorities, and referred in terms of the highest appro- corned in that affair, and that some of these officers had, in the
baton to the conduct of those who participated in the attack on and execution of the orders which were issued, received wounds.
i;i- n ,h. :. 1 ,..,,r. The question hlie wished to ask was, whether or not tier Majes-
H.. I... ,:i .J *1h .1 i o 1en the public had considered the affair ty's Government had thought proper to award pensions tI those
entirely settled between the two countries; but, on the 12th of officers corresponding in amount with those which were usually
November last, as he understood, a gentleman of the name of Me- granted for wounds received in the regular service of her Majesty?
Leol, who had been engaged in the service of her Majesty in Lard J. RUSSELL said that he was not aware of any pensions
Upper Canada as sheriff of a county, and who undoubtedly had having been granted to those officers who were waunded in the
taken an active part on several occasious in .. l--: invasions of expedition against lie Caroline.
the province, but who, however, so far ab he ,L .I I ) know, had Mr. O'CONNELL was sorry that Ihis honorable friend [Mr.Hume]
had nothing whatever to (ito with the affair of the Caroline, was ar- bad taken such a course, because he [Mr. O'Connell] thought that
rested in the State of New York by the command of the local au- upon this subject, at all events, there ought to be a unanimity of
thorilies on a charge of murder and arson. He was committed to feeling-[lhear, hear.J He thought that every exertion should be
jail on this charge, for so it appeared the seizure of the Caroline made to have Mr. McLeod saved, as he had acted under the cornm-
was considered, although tho act had been done inder the orders maud of the officers of her Majesty's Governiment, and it was in
of the Canadian authorities, and in repelling an invasion of the the strict performance of hiis duty that hlie had incurred the danger
Canadian territo, ies, and under the directions of a gentleman to with, which he was threalened-[hear, hear.] Whether those or-
whom the coinmanl of the military forces was then entrusted. ders had been right or wrong, this Government was bound to give
Mr. McLeod was apprehended on this charge, and was about to him every protection possible. [Cheers from all parts of the
be tried by a jury of citizens of New York. He (Lord S.) hoped House.]
he was stating these facts correctly. He desired at present to ab A vote of thanks to Admiral STOPFORD, Commodore NA-
stain from comments, but if hie should misrepresent, he hoped the PIER, Admiral VWALKER, and the officers and men employed
noble lord would correct him. In the mean time Congress mnet. o e o Cm
and the members requested the President to lay before them the on the coast of Syria, was passed in the House of Commons
communications which the United States Government had had with on the 5th. Both sides of the House united in laudation of
the British Government'on this subject. The President, in cort- the Syrian heroes. Lord JOHN RUSSELL moved the vote, and
plying, laid before the Congress the strong remonstrances which Lord STANLEY seconded it.
Mr. Fox, as representative of the British Sovereign, had msde on The House voted against the second reading of Mr. Tal-
the apprehension by the authorities of New York of a British sub- fourd's copy-right bill. It was opposed by Mr. MACAULEY.
ject for an Iffence (if it were an offence) committed under the The French authorities at Havre have released the steam-
sanction of British authorities, whose act was at that momenIt un- ship James Watt, of whose detention we gave an account
der the consideration of the two Governments, anid had been for the other day. The Court at Rouen, to which the English
three years the subject o- i.re-: .;.1; ... owners appealed, decided against the right to seize and de-
The answer of the Pi.. .- ri .,. a refusal to recognize the tain her
claim of Mr. McLeod, for these reasons, partly because the Fed- The cold weather had set in again with extreme severity.
eral Government had no grounds for interfeiing with the authonri- The papers mention several cases in which persons were a-
ty of the several States, and if they had grounds for interfering, mention several cases in wich persons were a-
this was not a ccse to exercise any right or authority which such most, and some in which they were actually frozen to death.
grounds might give them, inasmuch as the question of iaterna- FRANCE.
tional right was here deeply involved, which should precludeany Our Paris correspondent" informs us that the fortification
interference. Mr. Fox closed this correspondence by expressing
in the strongest manner his deep regret at the view which tlie bill had passed in the Chamber of Deputies by a vote of 237
President had taken of th;i matter, and that he [Mr. Foi] was against 162; and that the editor and publisher of La France
not authorized to expreus the opinions which her Mj sty's Gee- had been arrested on a charge of forgery-for fabricating the
ernment entertained upon the subject, but on his own part lie
should enter his pretest in the strongest manner that lay in his letters said to have been written by the King.-Com. Adv.
power against this proceeding, and he would further, without loss AMERICAN STOCKS, LONDON, Feb. 5.--Alabama sterling
of time, lay the whole correspondence before her Majesty's Gov- fives 78; Indiana fives 67 ; do. sterling 75; Illinois sixes 75
ernment. Kentucky dio. 84 a 85 ; Louisiana sterling fives 87; Maryland
Mr. McLeod was arrested last November, and in the month of do. ido. 82; Massachuset's fives 86 1-2 ; do. r'1.... 100; New
February the assizes take place, the presentmonth, and it is this York fives 851 a$8Si ; Ohio sixes 90- a 91 ex-div.; Pennsylvania
fact whichhe i(ihe no ble Lord) hoped wou'd furnish a sufficient fives 84; South Carolina do. 89 a 90; Tennessee sixcs 81 a 82;
vindication for now interposing in a matter which was calculated Virginia do, 89 a 90; New York city fives 83*. United States
to place two great nations in a mtst serious and critical position- Bank shares .l11.5s. a 12a ll.10s. ; do. debenture 100.
(hear, hear ) It should be considered that at this moment the life ,,,11111__111 ___________________
of a British subject inay be placed in the greatest jeopardy, in
consequence of his having acted by the authority of her Majesty's SENATE OF THE UNITED STATES.
Government, and by orders of ithe military authorities, to obey TA E IO
which it was his necessary and bounden duty. EXTR_______A SE'-3SION.
The question, then, which lie (Lord Stanley) wished to put was
this, that, inasmuch as -i... ; ,1; t. had commenced upon the sub- TIURSDAY, MARCn 4, 1611.
jeot of the burning of -i., ',-...I, since Janutary. 1838, between n i t
hter Majesty's Government and the Government of the United In addition to those Senators appearing under
States, he wished to ask, in the first place, whether her Majesty's their unexpired terms of service, the following new
Government would have any objection to lay on the table the en-
tire of the correspondence which hiad taken pi,'e upon the sub- members attended, were qualified, and took their
ject of the destruction of the Caroline ; and, also, whether the seals viz.
despatches had all been received, which had been referred to by
Mr. Fox in the recent accounts, and particularly that which had From Maine, the Hlon. GEORGE EVANS.
been transmitted in the 29th of I)Decenmbfr last, announcing the From inois, the Non. SAMUEL MRoBERTS.
apprehension of Mr. M; Leod. He (Lord Stanley) begged to ask ts the Hon SAUEL MRoEt.
further, whether her Majesty's Government had taken any steps From Rhode land, the Hon. JAMES F. SIMMONS.
toward Frocuring the release of Mr. MoLeod from his present From Michigan, the Hon. WILLIAM WVOODBRIDGE.
confinement, and, if so, whether they would lay upon the table From New Jersey, the Hon. JACOB V. MILLER.
the nature of those steps, and the correspondence which had
passed upon this s object between the Governmcnt of the United From Louisiana, the Hen. ALEXANDER BARROW.
States and her Majesty's Ministeis 7 From New Hampshire, the Hon. LEVIt WOODBURY.
Viscount PALMERaSTON rose ad said, the'eoble lord hadadvert- From Georgia, the I-Ion. JOHN MCPHERSON BERIEN.
ed at much length to a svhi|et of extreme interest, and which, From Ko the n. J MS M O R EH .
from the great delicacy, -i m .,, involved considerations of a From Kentucky, the Hon. JAMES T. MOREHEAD.
grade and serious character to two great coontries. [Hear, hear.J Alr. MANOUM moved the following resolution,
lie (Viscount Palmerston) was sure that this House would think
with him, that this suiject should be touched very lightly and which lies on the table one day :
with great delicacy. [Hear, hear.] With reference to the
statement which bad just been made by the noble lord, the mem- "Resolved, T.'hat Blair & Rives be dismissed as Painters
her for north Lancashire, as to the proceedings which hadL taken to the Senate for the Twenty-Seventh Congress."
place relating to the subject before them, and the particular cir-
coumstances which preceded -.: ..: r.-I. t%..ir.M... .i, i,. ,, FRIDAY, MARCH 5, 1811.
were strictly correct. He( 0 N -.- ..' P.1.... i ..Th ....Ho. .i ,I .AH p t a Sea
swer the question which the neble lord (Sianley) had put to him, The Hon. W. S. ARCHER, appointed a Senator
before he would state one word in explanation. He thouglat it from the State of Virginia, appeared, was quali-
woull not. be expedient in thie present state of the question to lay i
upon the table the correspondence relating to the capture and led, and took his seat.
destruction ofthe Caroline, until that correspondence was brought On motion of Mr. MANOGUM, that the Senate pro.
to a final close. [ltear, hear.]
He begged to Inform the noble lord that despatches had been ceed to consider the resolution submitted yester-
received, enclosing cpic of the correst)ondence which had taken
place between Mr. Fox and Mr. Forsyth, the Foreign Minister day, in relation to the Printer to the Senate, it was
of the United States Government. These notes had been already determined by yeas and nays, as follows :
published in the American papers, and he (Viscount Palmerston)
would, ot course, have no objection to lay those documents which YEAs-Messrs. Archer, Barrow, Bates, Bayard, Berrien,
had been already published on the table. fLaughter. I But this Cheate, Clay, of Kentucky, Clayton, Dixon, Evans, Gra-
was a departure from what he considered an important rule in ham, Henderson, Huntinglon, Kerr, Mangum, Merrick,
regard to international affairs, [heir, hear,] and one which might Miller, Morehead, Phi los, Porter, Prentias, Preston, Rivrs,
operate irjeriously to national interests, to lay before Parliament Simulons, Smith, of Indiana, Southard, Tallmadge, White,
documents relating to pending discussions. He thought it iampor- WVoodbridge--29.
tant to make, with reference ta the notice to Mr. Forsyth, one ob- NAvs-Messrs. Allen, Benton, Buchanan, Calhoun, Clay,
servation. The noble lord (Stanley) bad said that he believed of Alabama, Cuthbert, Fulton, King, Linn, McRoberts,
Mr. McLeed was not one of the party by whom thu Caroline had M holson, Pierce, Sevir, Smith, ofConnectiemt,
been attacked. Mouton, Nicholson, Pierce, Sevir, Smith, of Connetit
His (Lord Palmersten's)information went precisely to the same Sturgeon, Tappan, Walker, Williams, Woodbury, Wright,
conclusion-that hlie, Mr. McLeod, was not a member of the party Young-22.
that was concerned in the destruction of the Caroline; but with The resolution being thus brought under consi.
regard to the ground taken by Mr. Forsyvth in replying to Mr.
Fox, he (Lord Palmerston) thought itright to say that the Ameri- deration, a debate arose upon it, which had not
can Government undoubtedly might have considered this transac- concluded, when a confidential Message being re-
tion either as 0 transaction t, be dealt with between the two Gov- e wen con en l essag ein re-
ernments, by demands for redress, on the one hand to be granted, ceived from the President of the United States,
or refused on the other, and to be dealt with accordingly ; or it the Se So
might have been considered, as the Biitish authorities consider the Senate went into Executive Session, and so
proceedings between American citizens on the British side of the continued sitting with closed doors until the usual
bord-r, as matter to be dealt with by tlihe local authorities.
But the American Government had chosen thie former course, hour of adjournment.
by treating this matter as one to ba decided between the two Go-
vermenwv, and this was the ground on which they were eSot tied to y- Fourth Presbyterian Church Fair :-The new
demand redress from the British Government fior the acts of its church edifice is yet unfinished. To aid in its completion, the
subjects. Ite was sure the IIouse would think wilh him that in a Ladies will offer for sale, at Boteler & Donnr' room, opposite
matterofsuch extreme difficulty it Would be improper for him tao en- Brown's Hotel, Pennsylvania Avenue, this evening, March 1, and
ter into any further remarks or observations, and he would there- every day anid evening during the week, a variety of useful and
fore content himself with answering the noble lord's questions by fancy articles. Hours 10 A. M. to 10 P. M.
stating thoso important facts which hlie had then mentioned. Citizens and visitors are invited to attend.
Lord STANLEY saud Ithat the noble lord who had just sat down ice Creama, Jellies, &c. in abundance, mar 1-dlw
had omitted to answer one question which he (Lord Stanley) con- arIsemv.ro th L
sidered to be of the deepest interest. That question was, whether Tle Oplan air s removed frm te Lg
the nobla lord (Palmerston) had taken any sters, and if so, what Cabin to the north side of the Market Square, on the northeast
those steps were, for the protection and liberation of Mir. McLeod? corner of Seventh street and Loisiana avenue, where it will be
[Hear, hear.] kept open from 12 o'clock till 10 P. M. each day of this week.
ViscountPALMEnsTON saidthata cease somewhat similarin prin- The condition of the Orphan Asylum presents a pressing chim
cipletothe present was expected about a yearanda half ago, and uion the benevolence of the community, and an appeal is made
instructions were sent at that time to Mr. Fox, on which he found- to their liberality.
ed the communications, he made to thi American authorities. Of Many articles of fancy and utility are offered upon reasonable
course the House would suppose, he trusted, that her Maifrsty's terms. Refreshments will be provided. imar 4
Government had already sent certain instructions ; bat until the 11- UNITARIAN CIIURCI[.-A Discourse will,
correspondence upon this-subject had concluded, it was impossible with Divine permission, be delivered to-morrow afternoon, on
to send any instructions that could be final. Hlie hored the House the doctrine of two natures in our Saviour. mar 6
would believe that the Government would send to Mr. Fox such -- ,
further instructions as they might think it their duty to do; at the The Washingto City Total Abstiece society
saene time he wau not prepared to state what the nature of these whiehhaa been in successful operation for several yeors, and
instructions was. [llear.] which is designed, in its r,:,,.; ui. ,, to be in fact what its name
Mr. HuMi said that the nobm e lord (Palmerston)badjst made ndicatas, a city s"ciey, 11.t hI .1 meeting nest Sabbath, the
a speech in answer to certain questions which had been pnt to him 71h instant, at 3 o clock P. M. in the Fonidry Church, corner of
by the noble lord the member for North Lancashire ; but he (Mr 14th and G streets, at which meeting several lectures may be
Hume) wished to ask the House to suspend their opinion upon the expected, showing the national and municipal disadvantages re-
subject until they had the whole of the papers laid before the sulting from the use of intoxicating liquors. The citizens gener-
House. Ho had himself papers in his possession that would ex- ally are respectfully invited to attend. mar 6
plain many things connected with this question, and which, by the - Rev. aS. N. Sawtell, Chaplain t 'American sea-
bye, were nut exactly consistent with the statement which had just men in Havre, France, will preach next Sabbath ma .rr.-n,. at 11
been mruds. htappeared by the papers which he hsd in hispos- o'clock, in the 4th Preshyterian Chi'ch, tRev. Mi Sii,,ut,'s,) of
session that in January, 1838, a menion was made in the House of this city, and has consented, at the urgent requestcof many friends,
Representatives, calling upon the President to place upon the ta- to repeat in substance his discourse on the character and influence
ble of the House all the papers respecting the Caroline, and all the of American seamen, which produced such thrilling interest when
correspondence which had passed between the Governmentof the he delivered it in the Capitol.
United States and the British Government on the subject ofithe de- Members of Congress and strangers generally in the city are
struction of lhe Caroline. respectfully requested to attend, mar 6
In consequence of that motbn, certain papers were laid upon the pectful yrequestdatoatte.--nd.e r
table, iacludine one from Mr. Stevenson, the present Minister here S (ithsolic Total AbstienceAssociatton.-A regular
for the United States. TIhese were accompanied by a long letter meeting of this Association will be held at the Medical College on
dated the 15th of May, 1838, from that gentleman, and in that let- Sunday next, at 4 o'clock. The emle,lers are requested to attend.
ter the burning of the Caroline was characterized in very strong N B A S JOHN A. LYNCH, Secretary.
language. He also stated that, agreeably to the orders of the Pro- N.-B A Sern opon the subject of Temperance will be de-
sident, he had laid before the British Governmett the whole of the tivred in Sairt Patrick's Church, on P street, at 7* o'clock P. M.
evidence relating to time subject which had been taken upon the by the Rev. Mr. Van Horseigh, after which the pledge of total
spot, and Mr. Stevenson denied he had ever been informed that absti,,ence will be solemnly administered. rime friends of the
the expedition against the Caroline was authorized or sanctioned cause and the Public generally are invited to attend, mar 6
by the British Government. Now, from May, 1838, the time g^g Natioiallnstltutlontrir the Promotion of Sclence.
when that letter had been written, up to this hour, no answer had A s ated meeting will lbe held at the rooms of the Institution, situ-
been given to that letter, nor had any satisfaction been given by ated at the corner of 17th street westand Pennsylvanis avenue, on
the British Government upon ila subject. Monday evening next, the S h instant, at 7 o'clock. At this meet-
In a letter dated from London, the 2d of July, Mr. Stevenson ing an election will be held of the President, Vice President, and
stated that he had not received any answer upon the subject, and twelve- D'irectors, for the current year, agreeably to the provisions
he did net wish to press the subject further; bht if the Govern oftho amended Conytitution. Resident members are particularly
meant of the United States wished him to do so, he prayed to be requested to attend. P1SHEY THOMPSON,
informed of it. By the statement which had taken place in the mar 6-2t Recording Secretary.
House of Congress, itappearedthat the Government of the Unitedus Tne Fair for St. Matthew's Church-and-Free
States had been ignorant of any information that could lead them air for St. Matthew's Church and P ree
to suppose that the enterprise against the Caroline had been un- School, noiw open at ihe corner of 4 street and Pennsylvania
dertaken by the orders of the British Government, or by British avenue, will close to-night, at 10 o'cock. All the articles, use-
authority. That, he believed, was the ground upon which Mr. ful and faocy, will be disposed of by lottery at or before that hour.
Porsyth hadactedsatheihad done. A band of good music is in attendance, and refreshments are serv-
He takes his objections, and denies the allegation of Mr. Foxd p at every _r__________________mar 6
that neither he nor her Majesty's Governmnent made any commn- tf A stated meeting ot the Columbia Typographical
nication to him, or the authorities of the United States, that the Society will be held thia (Saturday) evening, at half past 7
British Government had authorized the destruction of the Caro- o'clock, in the room of the Washington Lyceum, on C street,
line. He (Mr. Hume) therefore hoped that no discussion would opposite Carusi's Saloon. A. T. CAVIS, Secretary.
take place until all the papers connected with the matter were mar 6
laid before the House. He wished to know what the nature ofBAKOWSHNT -6, 1.
those communications was with Mr. Stevenson and her Mjesty's BANK OF WAS HIN TON, MASt CH 6 1841.r
Government, which had induced him to actas he had done. A GENERAL MEETING of thme Stockholders of this
Vouernnt, wcad indudh imth he i ta he ghaionre. t he Bank will be held on Monday, the 5th day of April next, for
Viscount PALMERSTON said that he ratherthought his honorable the purpose of electing four Directors, in conformity with the law
friend would find in that correspondence that instructions had been pr ofCgrets pased on the 3d day of July, 1840.
given by the American Government to Mr. Stevenson to abstain The poll to be opened at 10 o'clock A. M. and closet 3 o'clock
front, pressing the subject further. [Hear.J With regard to the p. M. JAS. ADAMS,
setter of Mr. Forsytb, he (Viscount Palmerston) begged leave to mar 6S-3 Cashier.
eay that the case stood thus. In the case of the American citizens
engaged in invading Canada, the American Government disa- "UOARDING.-Notice to strangers visiting Washington
lowed the acts of those citizens, antd staled that the British an- 11 and citizens. The boarding establishment of Mrs. WIM-
thorities might deal with them as they pleased; f hear, hear SATT, situated on the south side of Pennsylvania avenue, four
and that there were persons concerned in this undertaking who doors east of 4J street, having several of its best rooms unoccu-
were not in any degree entitled to the protection of the United pied at this time, is prepared to receive and accommodate board-
States. [Hear.] ers by the day, week, or month with board in handsome and carn-
But, in the other case, they treated the affair ofthe Caeroline as portable style on moderate terms. mar 6-d3t
one to be considered as that of the Government, and, in fact, as- &PRING FASHION$.-The spring fashion for Hats, a
suned it to be altogether a Government transaction, and not to be 3 la d'Orsay, will be introduced at our sales-room this day, 6th
left upon the responsibility of individuals. Until, therefore, the March. ROBER CS & FISH,
British Government disowned those persona s aoMorpod in lthe Penn, avtnte, two doors wlt of the main entrance
le04trtioR of fh Cit Cniagii tihe sath e m e 4 r i thg ii AJ Me. 6--a of -rown' Hotel,
WASHINGTON.
"Liberty and Union, now and forever, one and
Inseparable."
SATURDAY, MARCH 6,1841.
The vast crowd of strangers whom a determina-
tion to witness the Inauguration brought to the
Seat of Government, has already considerably thin-
ned, and what remained of it was less visible yes-
terday than it would have been in consequence of
the spell of cold and keen weather which set in
on Thursday night. A great many strangers yet
remain, however, and of these a considerable pro-
portion will, no doubt, remain until after the end
of the extra session of the Senate.
Among the very many distinguished strangers
whom we have seen in the city, within the last
three days, ought to be mentioned the honorable
Gov. MOREHEAD, of the State of North Carolina ;
Ex-Governor OWEN, of the same State, and Ex-
Governor RlrNEn, of Pennsylvania.
It is understood that the PRESIDENT of the Uni-
ted Slates yesterday nominated to the Senate for
Secretaries of State, Treasury, War, and Navy, and
for Attorney-General and Postmaster-General, the
individuals whose selection by him for those trusts
has been heretofore announced. A part of these
nominations were confirmed, but not having time
to go through the consideration of the whole of
them before the usual hour of adjournment, the
decision upon the residue was postponed until
to-day.
The Inaugural Address of the PRESIDENT was
carried to Baltimore on Thursday in the very quick
time of an hour and a quarter.
Among the gratifying incidents of Inaugu-
ration Day, was the assemblage of some of the
surviving officers and soldiers of the late war, who
were placed immediately in front of the President
in the procession, and conducted by Gen. LESLIE
COMBS, of Kentucky, in the costume of a Ken-
tucky volunteer, and such a one as Gen. HARRI-
SON himself generally wore while commanding on
the Northwestern frontier,
Tippecanoe, Mississinewa, and the Thames,
River Raisin and Dudley's Defeat, Fort Meigs,
and Fort Erie, Chippewa, Lundy's Lane, Bridge-
water, Queenstown, &c. were all represented by
the few veterans present; a majority of whom bore
honorable marks upon their persons of their dan-
gerous proximity to the enemy in war long time
ago."
After partaking of refreshments at the Presiden-
tial mansion, they returned to Gadsby's, and took
leave of each other in a most feeling manner, after
a brief address front Gen. COMBS. It is to be re-
gretted that the names of all present were not ob-
tained in time for this notice. We have been en-
abled to obtain only the following list:
Gen. JAMES MILLER, of Massachusetts.
Major JOHN G. CAMP, of Virginia.
Col. CHARLES S. CLAItKSON, oiKentucky.
Col. JOHN McELVAiN, of Ohio.
Major THOMAS STOCK ro N, of Delaware.
Major BACON.
Dr. PENDERORAST, of Kentucky.
Dr. J. PERRINE, of Virginia.
Gen. JOHN PAYNE, of Kentucky.
Major JOHN WILLOCK, of Pennsylvania.
RICHARD S. CHINN, Esq. of Kentucky.
JAMES V. REDDEN, Esq. of Kentucky.
Capt. JOHN A. ROGERS, of Tennessee.
LATE FROM FLORIDA.
Gen. Armistead to the Secretary of War.
HEADQUARTERS ARMY OF FLORIDA,
TAMPA, (FL.) FEB. 14,1841.
SIR : Your communication of the lst instant was received
yesterday. I am gratified with the approbationyou have been
pleased to express of my measures, and shall use every exer-
tion to merit its continuance.
Since I had the honor of addressing you on the 1st instant,
thirty Seminoles have come in at Fort Armistead. A mixed
party has arrived here from Fort Clinch-about thirty Tal-
lahassees and forty Mickasukies-among the latter a sub-
chief.
Yesterday, there came in the brother of a principal Micka-
sukie sub-chief, Coosa Tustenuggee, and several of his war-
riors. His avowed purpose is to treat, and he has sent a run-
ner to Halich Tustenuggee, who is expected daily. These
chiefs are expected to return for their people, who may be
expected by the last of the month. Should this desired oc-
currence take place, which is more than probable, I can but
conjecture that the remaining hostiles will sue for peace, par-
ticularly as there exists a strong peace party among them, and
runners are now out to induce them to come in.
West of the Suwanniee river five runners are now out.
With their return I expect the most favorable intelligence, as
I presume many of the runaway Creeks will accompany them,
with the small remaining party of the Tallahassees.
To the chiefs who have come in I have promised two to
five thousand dollars; to the common men thirty dollars and
a rifle. I most earnestly request the sanction ot these offers,
as will as immediate means to fulfil my promises, either by
despatching the sum to the agent at New Orleans, or forward
ing it here to Captain Page, in whom I have found every de-
sire to aid me il collecting these people.
There are now about two hundred and "seventy Indians at
this place, and between thirty and forty of the Seminoles at
Sarssota. A vessel is now preparing to convey one hundred
and fifty to New Orleans, and will sail in a few days; an-
other will follow shortly after. I shall retain some for ne-
cessary purposes; among the number, Echo-Emathla, the
Tallahassee chief.
I am, sir, very respectfully, your obedient servant,
W. K. ARMISTEAD,
Brig. Gen. Comn. Army of Florida.
Hon. SECRETARY OF WAR, Washington.
FROM THE PHILADELPHIA AMERICAN SENTINEL.
The age of toilsome industry is gone-an evil of sadder
import and consequence than the exit of the age of chivalry.
Two advertisements were recently published in a newspaper;
one for a clerk in a store, the other for an apprentice to learn
the blacksmith's trade. The number ot applicants in one
day for the former place was fifty, for the latter not one; upon
which the New York Sun judiciously remarks, what a sad
illustration is this of the mischievous effect that has been
produced upon the young men of the day by the inflated,
ruinous course which the business of the country and the af-
fairs of life generally have taken during late years. The
mechanical pursuits of life have got to be regarded pretty
much through the whole country, and especially in the North-
ern Atlantic States, in nearly the same light as labor is look-
ed upon in the Southern slave States; and, with a majority of
our young men, want, if not beggary-artifice, if not knave-
ry, is regarded as preferable to the comparative competence
which can at all times be procured by honest industry, em-
ployed in those laborious occupations which give to the coun-
try its wealth, and to society its most useful and brightest or-
naments. When a different state of feeling prevails on this
subject, then-and not till then-shall we see less of idletass,
with its attendants, dissoluteness, poverty, and dishonesty,
poisoning the minds of the thousands of youth into whose
keeping, ere long, the interests and support of society and of
the country will fall.
D-OYLE & M'NEELY, LeathrlMAanufaceturers, have
for ole at their store, No. 35, North Third street, Philadel-
phia, third door below the City Hotel, a large assortment of Mo-
rocco Leather, suitable for shoemakers, hatters, bookbindeis,
coachmakers, saddlers, pocket-book,bellows, suspender, and trunk
manufacturers, &o.
Also, Chamois and Buck:Skins, suitable for glovers, coachma-
kers, printers, suspender manufacturers, silver plates, &c.
White Leather,ers, shoe binding, shoe lining, aprons, suspenders, saddlers,
pocket book, bellows, and card manufacturers, &c.
mar 6 -2aw6mo
B OOKS- BY AUCTION.-This evening, March 6, we
will sell at public vendue, at our rooms, the remainder of
the valuable invoice of Books recently received from New York.
Gentlemen wishing bargains will do well to attend, as the sale
will be peremptory, and will he the last chance they will have
this season of sd-lig standard books to their libraries.
ir 9 D0Y RR Q00. A404tlon141,
EDITORS' CORRESPONDENC9.
NEW YORK, MARcH 4.
The ships in port are gaily decorated with flags,
and at the Whig head-quarters and all the public
places the National ensign is displayed. A salute
of two hundred and thirty-four guns-one for each
electoral vote General HARISON received-was
fired this morning. A grand ball, which a thou-
sand persons are expected to attend, will be giv-
en to-night.
Our new Collector retains all Mr. HoYT's de-
puties, clerks, &c. Not one removal, I believe,
has been made, and the men whose principal
business for years has notoriously been elec-
tioneering for Mr. VAN BUREN, now laugh at the
idea of being disturbed.
Two bearers of despatches, one from Mr. STE-
VENSON, and the other from the British Govern-
ment, came out in the President.
The news from England has had very little-
effect on our markets. Cotton is a trifle lower,
but holders are not disposed to sell. Flour is not
affected. There has been no demand for export
for some time.
The great depreciation in the value of State
stocks,particularly those ofIndiana and Illinois, has
had the effect to create distrust as to the solvency of
some of the free bantiks in this State that have
pledged those stocks for the redemption of their
circulating notes, and the notes of such as have
not made provision for their redemption here are
selling to-day at.3 per cent. discount. It has been,
another blue day in WallP street. All stocks are
down. U. S. Bank closed at 161. New York,
Indiana, and Illinois bonds fell about 1 per cent.
each.
Mr. BRowNsoN, editor of the Boston Quarterly
Review, lectures here to-night on the Democra-
cy of Christianity."
Mr. HOYT has published a correspondence be-
tween himself, Mr. WOODBURY, and Mr. BUTLER,
relative to the difficulty between himself and the
'Treasury. Mr. Butler, it appears, has commenc-
ed a suit against Mr. Hoyt's sureties. In the cor-
respondence published there is no mention of the
sums received by Mr. Hoyt from importers for com-
promises. Is the whole correspondence published?
FOR THiE NATrONAL INTELLIGENCER.
Messrs. EDITORS: The inauguration of the venerable Pa-
triot and Pioneer of the West into the office of Chief Magis-
*rate of this Union, on yesterday, was well calculated to pro-
duce in the mind the most pleasurable sensations. To my-
self, the moment was one of the moat intense interest I ever
remember to have experienced. Forty-eight years ago I first
saw Gen. HARRISON, then a subaltern in the army of Gen.
WAYNE, on the banks of the Ohio river, where the city of
Cincinnati now stands ; and of all the immense multitude who
witnessed the exercises of yesterday, as far as I am informed,
only three of these were, in 1793, living within the limits of
the Northwestern Territory, namely, the PRESIDENT himself,
Gen. S. VAN RENSSELAER, of New York, then a Captain of
Dragoons in WAYNE'S Army, and the undersigned. And it
is also worthy of remark, that among the first white children
born within the bounds of Gen. HARRISON'S government of
Indiana, was my son, Lieut. STEPHEN JOHNSTON, fur near
twenty years past an officer of the United States Navy, and
who was present on yesterday, witnessing the inauguration.
I served in the Indian department under Gov. HARRISON,
down to the period of his quitting the army in 1815. None
will hear of his elevation with more pleasurethan the Indians.
Several of the Chiefs have already sent messages to myself
expressive of this feeling. His government over them was
merciful and liberal, wise and just.
JOHN JOHNSTON,
WASHINGTON, MARCH 5,1841. of Piqua, Ohio.
TO THE EDITORS OF THE NATIONAL INTELLIGENCE.
Messrs. EDITORS: I was in the House of Representatives
last evening, (26th February,) and enjoyed the rich treat of
hearing the eloquent HOFFMAN upon an amendment of his
to the Naval Bill, lprovidting for the erection of barracks at
certain points for the accommodation of the Marine Corps.
He gave a glowing description of the indispensable import-
ance of the marine to the naval service, and portrayed, in
language that touched every patriotic heart, the valor that
had been displayed by the Marine Corps on the land as well
as on the ocean. My object in intruding upon your atten-
tion is to request that your Reporter will carefully prepare the
remarks of Mr. HOFFMAN, and that you will give them a
conspicuous place in your paper, that the country may duly
appreciate the much-neglected and much-abused Marine
Corps.
WASHINGTON, FEE. 27. JUSTICE.
NATIONAL THEATRE.-WASHINGTON.
HERR CLINE'S benefit and last appearance.
On which occasion be will out-do all former efforts; among whilh
his Grand Ascension from the stage to the height of the
Theatr c.
THIS EVENING, MARCH 6, 1541,
Will be performed the cooiedy of the
SOLDIER'S DAUGHTER.
The Widow Chevely, -. Miss V.lMonier.
After which, HERR CLINE'S wonderful performance s; which
will be different from any thing as yct done by him in this cily.
The whole to conclude with
THE LOAN OF A LOVER.
Gertrude, (with songs,) Miss Helen Matthews.
Doors open before 7-performnances commence I past 7.
GEOIBGETOWN GRAND VOCAL anid INSTRU-
MENTAL CONCERT--IFor one night only.
DONA DOLORSe nx GoNs, the celebrated Guitarists from Spain,
will appear in the costume of her country, snd perform several of
her moot celebrated Solos and Spatniash Songs. Also, Miss ST.
LoKs, the celebrated Vocalist; Master ST. LUiE, the youthful
Paganini ; and Mr. DOuNAS ; at Mr. Slack's Bank Saloon, on SA-
TURDAY, MARCH 6.
Programme in small bills.
Tickets 75 cents, to be had at the door of the Hall.
Concert to commence at 7* o'clock, mar 5-3t
NATIVE AMERICAN- BALL.
IN consequence of the fatigue naturally expected on an Inaugu-
ration oueasion, the Managers and friends oftheBall dee-med
it expedient to postpone it to TuasDAY EvEarol next, the 9th of
March.
3^' Tickets 82, to be bad of the same persons as in former ad-
vertisements, and at the door on the evening of the Ball.
The room is fitted up inna neat and approprIate style, and a snf-
ficiency of refreshments will hI provided therelor. We hope the
friends of the cause will favor us with their attendance. The room
can be seen at any time mar 6--3t
D R. BIGELOW continues to be consulted daily at his
roams, Pennsylvania avenue, between 3d and 4) streets,
opposite the Ame'ican Hotel, by those who desire the beauty, du-
rability, and preservation of tleir teeth. Diseases originatirg
from decayed teeth, extraneous matter in the mouth, scurvy in the
gums, and nervous affections, may be entirely removed by judi-
cioas and eflacientoperations.
Directions for toothpicks, looth brushes, and tooth powder given
or supplied of the very best quality.
Ladies and gentlemen, citizens and strangers, are most respect-
fully inviited, &., mar 6-3t
OR SALTiu.--Five head of Darhamn Short liorned Cattle,
S two of them" imported, the remainder descendants from tha
most celebrated stock in Englusn, sn.l have alltaken premiums.
Inquire at Joh n Brown': Iti l.l, Sth street, opposite Gadaby's
Hotel, where certificates and diplomas will be exhibited.
mar 6--3t
C LOVER AND TIMOTHY SEDU.-Just receiv-
ed-
125 bushels prinmes Pennsylvania Clever Seed
30 bushels new Timothy Seed
For sale low by J. T. RYON & CO.
mar 6--3t Louisiana ave. nearly opposite Centre Market.
F IVE DOJOLULARS REWARD.--Lost, on Thursday
X evening, the 4th instant, in this city, a morocco pocket-book,
much worn, containing sundry judgment ,,-.icas, promiofiery aiutes,
due-bills, receipts, &d. Some of the juignie a'~ n--Ir are as tel.
lows: Three on William C. Smith and -atsueI Smith, frIr Il(0")
two on John Hurst and Constantine M..rr1; ,r.e on Clemnert L.
Sharp and John M. Darby one on Covington Reynolds i oe"ona
Wiliam Ross & Cn. iundry promissory notes, Akc. all paI oble to
the subscriber. The finder will please leave the p.r-'ket t..b,.k,
with its contents, at the office of the National Intelligence,,Iordo-
liver it to Thomas Clayton, Esq. at his residence, at Mrs. Young's,
on Capitol Hill, who will pay the above reward.
mar 6-3t DAVID TAYLOR.
FOR SAL OR RENT.-A good two-story frame
1D Houese, with back building, and porches front and back.
uLlll contains nine rooms handsomely finished and vry
convenient. Attached are good wood-houses end wash-toom, and
a pump of excellent water in the yard. The house is situated on,
H street, 3 doors from 6th.
Inquire of the sabgsriber, net 4wor.
94is 6-91 4m 8I, PHILLIPS,
i--
IT ia a rare occurrence in the history of popular remedies, that
anyarticle should be found to maintain a good reputation for
twenty years together, and continue to receive fresh testimony in
its favor from gentlemen of known intelligence and integrity.
Such, however, is the fortune ofBECKWITH'S ANTI DYSPEP-
TIC PILLS, as will appear from the following letters, in addition
to the large mass of evidence heretofore published:
From Dr. E. Markets, President of the Female Institution near
Columbia, S. C.
BARHAMSVILLE, (S. C.) JuNE 15, 1840.
DEAa SIR : 1 beg leave to offer you my testimony in favor of a
iredicine calculated to do much good in itself, and to supersede
the introduction into families of pernicious quack medicines.
Your Anti-Dyspeptic Pills were prescribed by me for a lady
in whose case the usual remedies hiad failed to afford any relief.
The affection came under the class of what is usually called Tic
Dolorous, affecting one or more sound teeth, with severe headache,
visual derangement, nervous spasms and numbness, the latter to
so alarming an extent as to render the patient for some time in-
eensible to the most stimulating external applications. I directed
three or more of your pills to be taken as soon as approaches of a
pas'oxysm were observed. The result was, that in every instance
where timely administered, they either warded off the attack, or
rendered it very mild. In a few weeks after using the pills, the
patient, from a state of much languor and comparative exhaustion,
increased in strength, flesh, and spirits, and now enjoys excellent
health.
Since witnessing the above cases, I have prescribed your Pills
in many cares of derangements of the stomach attended with sym-
pdhetjc headache ; the result has been in every instance favora-
ble. n giving you these facts, I believe I am contributing to the
cause of umanauty, and do not hesitate to say that I know of no
family medicine more calculated to afford relief in abnormed af-
fection of the stomach, end sympathetic affections thence arising.
I ant, dear sir, yours, &c. E. MARKS.
P. S I ite-nd to intrduce them into our Institution.
Dr. J. LzCKWITH, Raleigh, N. C.
From Maj. Samuel McComb.
GaREENVILLE, (GA ,)JULY 7,1840.
DEAR Sin : A simple acknowledguent of benefits is certainly
due froui those who receive, and buta reasonable return to those
who confer them ; as such, please to receive this letter containing
a very brief ac-count of tny sufferings, and of the relief I obtained
from the use of Bickwith a AuLti-Dyspeptic PIle.
When I resided in the western part of North Carolins, I was long
and severely afflicted with a diseased liver and dyspepsia; my
nerves were it a wretched condition, my mind weakened and da-
pressed, wilt occasional attacks of ulindness, pain, and lightness
in the head; stomach and bowels greatly deranged; alternate cos-
tiveness and painful diarrhea; strength and flesh wasted, so
that I was reduced in weight from 195 to 120. In 1834 your Pills
were recommended to me, and 1 commenced taking them, three
a day; and I cnntinetd them for some months before any material
change in my health took place. 1 then began toimprove,and I
am happy to say that I recovered the tone of my stomach and
bowels, ate any timing I liked, and now weigh 160 lbs. and have as
much health and yrcngth as could be expected in one at the age
of 61. 1 believe lowe my relief from that dreadful disease and a
lengthening of my days to the use of your pills, for which please
to accept my best titanks, and wishes for your happiness.
Respectfully, yours, &c. SAMUEL MoCOMB.
Dr. JOHN BECKWITH.
From Mr. Wan. Irving Hyslop.
NEW YOnK, JULY 11, 1840-220 PEARL ST.
MY DEAR SIR : I have delayed for several months sending to
you the acknowledgments which I have felt to be due from me for
the benefits I have received at your hands.
I had been in a low state of health nearly two years, suffering
from indig-stion, palpitation at the heart, iheadach, &o. &e. ren-
dering rme extremely nervous, and experiencing all the many
changing and distressing symptoms in mind and body attendant
upon this malady. I haid the advice of several eminent physicians,
which I followed without any seeming benefit, and was induced
to visit the South and pass my winters there, with the hope of pro-
trictinp an uncomfortable life. At Columbus, Ga. on my way out,
I met with a friend, who, on hearing my complaints, advised me
to give Beckwith's Anti-Dyspeptic Pills a fair trial. I resolved
to follow his advice, and took four boxes according to the dirpe-
tions. Tht effect produced was most happy, giving me ease and
comfort unknown before for years. And now, sir, I am enjoying
health and elasticity of both mind and body, for which you have
my most sincere thanks, and the best regard of a friend.
Very truly, WILL. IRVING HYSLOP.
To Dr. J. BICKWITH.
Raleigh, Nov. 27, 1840.
e They may be had wholesale of the proprietor, Raleigh, N.
Carolina, of H. D. TURNER, No. 180 Broadway, New Yolk, and
of R.S. PATTERSON,
dec 7-wlw Corner 9th street and Penn. av. Washington.
SOUTHERN LITERARY MESSENGER.-Sub-
scribers who have experienced any irregularity in the re-
ceipt of this praiseworthy periodical may now remove the diffi-1
cuty by applying for their numberstn FRANCK TAYLOR, who
i been appointed its sole agent in this District. The February
No. is nnioially interesting, feb 16
FEMALE af Surgeons. Illustrated by col-
ored drawings of heads and figures. Revised and amended by
an American author. Just published and for sale at the Book and
Stationery Store of R. PARNHAM, between 9th and l10th streets.
Penn. avenue, oct 2
N EGROES WANTED.-Cash andthe highest market
prices will he paid for any number of likely young negroes
of both sexes,(familiesand mechanics included.) All ommunica-
tions addressedto meat the old establishment ofArmfield, Frank-
lin & Co., west end of Dukestreet, Alexandria, D. C., will meet
with prompt attention.
inlly (--'wR.n&iaw uptf GFA ORGE KEPHART.
N1EW BOOK.- Just published, and for sale by WM. M.
MORRISON, four doors west of Brown's Hotel, Heads of
the Peuople, or Portraits of the English, drawn by Kenny Mea-
dows, wibh original essays by distinguished writers.
The Flying Dutchman, a Legend of the High Seas, by the au-
thor of Cavendish, "Gentleman Jack," .&c.
Also, Insubordination, aStory of Baltimore, by the author of the
Suhbordiate. feb 26
C NTRAL UNITED) STATES.-Just published a
Geographical, Historical, and Statistical Viewofthe Central
or Middle United States, containing accounts oftheir early settle-
ment, natural features, progress of improvement, form of govern-
ment; civ:l divisions and internal improvements ofPennsylverania,
New Jersey, Delaware, Maryland, Virginia, District of Columbia,
and parts of New York and the other adjoining States ; toge-
ther with particular descriptions of the cities, towns, and villages,
public buildings, obiecta of curiosity, literary, scientific, and
other institutions, &c. by H. S. Tanner, and for ealo at Station-
ero' H-ti I.feb 19
B -AU nMONT A'N) FLETCHER, new edition,
B in 2 octavo volumes, London, 1840, edited by George Dar-
luy, isjumnt imported by F. TAYLOR.
Also, Ben Jonson's complete works, in I volume, same series,
with memoir of his life and writings, by Barry Cornwall, and the
coutplete Idranatic works of Massinger and Ford, both complete
in I octatvo volu-ne, London, 1839, edited by Hartley Coleridge,
and being oneu of tIhe sain series ; Shakspeare, complete in 1 vol-
umne edited by Tiounmas Campbell. feb 15
Ia riieui. ( r-':"'- Csunity Court, sittii.;, as a Court
nf 'i_..i. ,, Jatnuary Term, ISt1,
Singleton Mitchell end others, vs. Sarah Mitchell amd others.
r HE 1 -bj-'ct of tho bill filed inu this case is to obtain a decree
r for the uale of two houses end lots in the village ofBladens-
hurg, Mil ulan1. Thle bill states thai a certain Elizabeth D. Mit-
chull, of Prince Gnrge's county, Maryland, died seized and
po-ses.edi of said property ; that she leitS sundry heirs, among,
wlioait are Saah, R-becca, John Alexander, Maria Ellen, and
Thimuas Morltinmir Mirhell, who reside out of the State of Mary-
lind, in the State ef Missouri, and who are children of the late
Tighmau M Itchell, son of said Elizalbeth Mitchell. It is theie-
upou, this 17th day of February, 1841, by Priunce Georgus
Comuuty Couirt, situig as a Court of Equity, ordered, that notce
bto given to the said absent defendants of the substance and ob
ject-,f thisbill, warning them to he and appear in this court, either
in p-rson or by solicitor, and answer the some, on or before the
second m-tiay in 'July next, otherwise the bill will be taken
pro cinfesso andI a decree pass, as prayed ; provided a copy of
this ord-r be inscrted in some newspaper published in the Dis-
trict of Columbia once a week for four months before the said
second Moniday in July next.
True copy. Test:
feb 23-ltaw4m
EDMUND KEY.
JOHN B. BROOKE,
Clerk of Prince George's Co. Court.
In Charles County Court, situlng as a Court of Equity,
January 12,1841.
HRDERED, That the sale as made and reported by John
Bornes, trustee for the sale of the real estate of Barnes
Compton, infant son of William P. Compton, deceased, be ratified
and -onfimned. unless cause to the contrary be shown on or before
time third Monday in March next: Provided, That a copy of this
order be publish, d in some newspaper in the District of Columbia
once a week for three successive weeks before the day aforesaid.
The report states the amount of sales to be five thousand five
hundred and twenty dollars, current money.
CLEM. DORSEY.
True copy. Test: JOHN BARNES,
feb 22-law3w Clerk of Charles County Court.
Orp-hans' Court Washington County, District of Cu-
I lumbla,Feb. 23, 18 1.
N' the case nf Ann Shieckels, admiisratit ix ofThos. H. Shock-
wa, decessoed, the adminiatratrix of said deceased, with the
aoftrobation of the Orphans' Court, has appointed the third Tues-
day in Mircb next, at the Orphans' Court, between the hours of
12 o'clock M. and 3 P. M. for the purpose of payment and discri-
butiln, uider the Court's direction and control, of the assets in
sai l administratrix's hands to thie creditors of said deceased; at
whash time and place said creditors are notified to appear: provi-
ded a c'lpy of this order be published once A week for three weeks
previous to the said third Tuesday in March next, in the National
Inttelligencer.
Test. ED. N. ROACH,
feb 27-w3w Regis'er of Wills.
L AW BOt)KS.-Condensed Reports of Cases in the Situ-
preme Court of the United States, containing the whole
series of the decisions of the Court, from ils organization to the
cumnmencement of Peters's Reports; at January Terms, 1827, with
c)>ious notes of parallel cases in the supreme and circuit courts
of the United States, edited by Richard Peters, Esq. reporter of
the Decisions of the Supreme Court of the United States, 6 vols.
octavo, this book ii now out ofprint and hard to be got. Oae
copy only for sale by W. M. MORRISON, four doors west of
Brown's Hotel.
American Diplomatic Code, embracing a collection of treaties
and conventions between the United States and foreign Powers,
from 1778 to 1834, with an abstract of important judicial deci-
sions on points connected with our foreign relations. For sale as
above.
Also, K-ent's Commentaries, Durnford and East's Reports,
Cruise's Divest, Smith's Chancery Reports, Raymond's Digested
Chancery Reports, Maddox's Chancery Reports, Haitiisn's Di-
edit .e. 0, All f,r sale t abov0f. ft 17
SRANM13AN"PS COMPOSITIONSF POR THE
lHAI1.t-Notunfrequently have we had reason rtocommend
to public notice the talents and skill of M. Anguste Grandjean, of
No. 1, Barclay street. His treatise on the Hair is a production
both learned and eloquent; it shows that he has studied deeply,
and that he has full ability satisfactorily to make known the result
of his investigations. It is an old the
Compositions to which we refer, and we feel confident that all
future experiment will butserve to establish their great reputation.
The preparation known as "Grandjean's Composition" has
been so long a favorite, that it is almost useless to praise it; but
the "Eau Lustrale" is a recent invention, and deman-Is that faith-
ful notice to which its merits aspire. It cleanses, and at the same
time beautifies the hair, giving it a rich curl and an exquisite gloss.
One of its chiet properties (and this will recommitend it especially
to the ladies) is, that it keeps the hair safely in whatever style it
may be dressed, resisting both motion and moisture. Thus much
have we thought proper to say, but if we were to go on u,; ir.- t.,
a month, we could not present such convincing arguments in favor
of the Compositions as the use of them would speedily furnish.-
Evening Signal, N. Y.
The above Composition is constantly kept for sale at Stationers'
Hall, by W. PISCHER,
dec 9 Sole agent for the District.
M ACAULAY'S MISCELLANIEIS, in 2 volumes,
containing the articles, chiefly historical, which have most
attracted attention of those originally appearing in the Edinburg
Review since 1825, being the productions ofT. Bib hvby P. TAYLOR.
S AT'ENT PEItRYIAN FILI'EK INKS 'rAND.-
S This novel and useful invention ensures an instantaneous
supply of Clear Filtered Ink, in the cup of the filter, which can
be returned into the inkstand ao. iftk, generally found
in ordinary inkstands, are completely ohviated by the use of the
Filter Inkstand. One of moderate size willcoutain sufficient ink
for six or twelve months' writing.
A further supply, of various sizes, just imported, and will be sold
at reduced prices by R. FARNHAM, between 9th and 10th
streets, Pennsylvania avenue, oct 5
0'1100 .,suti Ar% ('.-5'KAL% USA. a1)Ck4N&1 otititecity
-l of Washington, having resigned the appointment held by
him for several years in the .: ..r, n,.I taxes.
Persons having, or supposing themselves to have claims, on
transmitting a statement of the facts,will be advised of the proper
course of proceeding. His charge will be moderate, depending
upon the amount of the claim and the extent of ths service.
He is also agent for the American Life Insurance and Trust
Company, which has a capital of two millions of dollars paid in,
and for the Baltimore Pire Insarance Company.
Mr. P. A. DICKINAs is known to most of those who have been
in Congress within the last few years, or who have occupied any
public situation at Washington.
His office is on Pennsylvania avenue,between Fuller'sHotel
and Fifteenth street.
SAll letters must be post paid. sept 12-lyd
N EW BOOKS for the huolydays.-WM. M. MORRI-
SON, four doors west of Brown's Hotel, has a large assort-
ment of Books suitable for the holidays, among which are just re-
ceived beautiful editions of the Book of Common Prayer, rluri-
eated editions, &c ; Rural Life in England, by Win. Howitt;
Visits to Remarkable Places, Old Halls, Battle Fields, and Scenes
illustrative of striking passages in English History and Poetry,
hy Win. lHowitt; The Dream, and other Poems, by the Hon. Mrs.
Norton. dec 26
TEW BOOKS.-Thre Heart's-Ease, or a Remedy against
- all Troubles, with a Consolatory Discourse, particularly di
reacted to those who have lost their friends and dear relations, by
Simon Patrick, 1). D. The Dew of Israel and the LiuyofGod,
or a Glimpse of the Kingdom of Grace, by Dr. F. W. Krumma
eher, author of Elijah the Tishbite, Elisha, &e. Also, The Recog-
nition of Friends in Another World, by the Rev. Benjamin Dorr,
D. D)., Rector af Christ Church, Philadelphia, third edition, are for
sale by 0 W. M. MORRISON,
dec 16 Four doors west of Brown's Hotel.
D ]ESILVER'S POCKET-BOOK ALMANAC tor
1841, containing also a diary, ruled pages for prospec-
live memoranda, (one fop"r each day in the year,) an almanac, va-
rious useful tables, &c. ec. combining, also, all the utility of a
pocket-book. Just received for sale by
P. TAYLOR.
An additional supply of the valuable Boston American Almanac
for 1841 just received, jan 6
1 tik[ DOLLARs BtEWARD.-Dr. storm's Spe-
1 S' elfic Compountd, for the cure of Gonorrhema, Gleets,
Strictures, Diabetes or difficulty in making water, and all other tin-
natural discharges from the urethra of either sex.-in no case has
this medicine been known to fail to effect a permanent cure, and,
too,? One
hundred dollars will be paid to any one who will produce a medi-
cine to equal this compound, or who will prove that it contains any
mineral suhstance whatever.
Per sale by H. WADE, 7th street, between D and E ; CHAS.
STOTT, corner of 7th and the avenue; and by ROBERT PAT-
TERSON ; in Georgetown by J. L. KIDWELL.
jan 8-3tawly
'_ON PARENTS AND TE iCHERS.-SCHIOOL
-- BOOKS.-The subscriber having lately received Ircm
the North a very large supply of School Books, and all that are
used in the District, and having selected those thatare well bound,
and the besteditions, those who wish to purchase will find it to their
interest to examine them. School Books will be sold at reduced
prices, and a liberal discount made to those who purchase by the
quantity.
Also, Blank Books and Stationery of every kind, of the best
quality in tire market, and will be sold at the lowest prices.
R. FARNHAM.
r WO THOUSANDCARDS I' ERRYIAN PENS.
S The subscriber has just imported from the manufacturer
2,000 cards of the Patent Perryian Pens, which will be sold
wholesale at the agent's prices in New York. Also, 3,000 cafds
of Gillott's and other Steel Pens, which will be sold as above.
Those who are desirous -f c:u-.i u- nuine pens will please ex-
amine the above, which .-i I..I. I -i.J the most extensive assort-
ment in the United States.
STATIONERY, warranted the best, both foreign and domes-
tic, will be sold as low as s- any establishment in the country.
R. FARNHAM,
dec 7 Between 9th and 10th streets, Penn. avenue.
GOETHE'S NOVIEL OF WIILHf'LM MEl-
TER, translated from tihe German, by Carlvel, author of
Carlyle's French Revolution. Humphrey's tm' .. k, N ... 13. The
Lady's Book, for November, 1840. Juotreceived by
nov 9 F. TAYLOR.
Charle< county Court, August ierm, 1840.
R DER ED by thre Court, that the creditors of Alexander
P Co., a peiioner lor the bens-fitof the insolvent laws of Ma-
ryland, be and appear before the judges ef Charles county court
oth de ihird Monday of March next, and show cause, if uny they
have, why the said Alexander Cox shall not have thIe benefit of
the laws aforesaid; provided a copy of this order be inserted in
some newspaper published in tihe District of Columnbia, once a
week fir two months before the said third Monday in March next.
Test: JOHN BARNES,
jin 5-law2mr Clerk ofChnrlescounty court.
VIKGIN IA-At a Circuit Superior Court of Low and Chance-
ry fur thie will annexed, of Charles Pierer, deceased, Row-
land Florence, William J. Weldon, and James B. T. Thornton,
and John S. Mason, executors of Thomas P. Hose, deceased,
defendants.
HE BILL in this cause, being exhibitedYfor the purpose
of recovering whatever balance may be due from the de-
fendants Daniel Ratcliffe and William F. Purcell, as administra-
tors de bonisnon with thie will annexed, of Charles Pierer, de-
ceased, late of the County of Prince Willinimn, in this Common-
wealth, on the ground that the same is vested in the Literary
Fund : on the motion of the Attorney General, the Court dosh
order that publication be made for three months successively in
the Richmond Enquirer, Richmond Whig, and the National In-
telligencer published in tie.
HISiT CARDS.- W. FISCHER hes recently received
S Whist Cards of white and fancy colored backs." The most
extensive assortment ofplayingcards is kept constantly for sale on
the best teims at btationers' Hall. feb t12
N EW BOOKS.-Sketches of Conspicuous Living Charac-
ters of France, trautslated by R. M. Walsh, with a portrait
of Thiers, just published and for sale by W. M. MORRISON, 4
doors west of Browun's Hotel.
Also, as above, the Kinsmen, or the Black Riders of Congaree,
a tale, by the author of the Partizan, Mellichampe, Guy Rivers,
the Yemassee, &c. feb 12
E YW BOO)KS.-Heroines of Sacred History, by Mrs.
S Steele. Bacchus, an Essay on the Nature, Causes, Ef-
fects, and Cure of Intemperance, by Ralph Barnes Grindrod,
first American from the third English edition, edited by Charles
A. Lee, A. M. M. D.; also, No. 16 of Master Humphrey's Clock,
are just received and far sale by W.M. MORRISON, 4 doors
west of Brown's Hotel, Penn. avenue, jtan 4
FFICIAl, ARMY AND NAVY REGISTERS
for I841 are just published and fir sale by
WM. M. MORRISON,
Jan 29 A doors west of Brown's Hotel.
,a1me6 POLITICIAN'S MANUAL, containing the
- Declaration of American Independence, the Constitutions of
the United States and of New York ; also, the formation of the
Judiciary, ec. together with general tables, political and statisti-
cal, by George L Lerow, published and for sale by
u W. M. MORRISON,
Jan 223 4 doors west of Browa's Hotel.
BOARD OP COMMIS1X6NEaS OF CLAMS Otq MXIC0,
FEBRUARY 13, 1841.
O FFICIAL notice is hereby given to the American citizens
%hose claims are submitted to the Mixed Commission, now
sitting at Washington under the Convention of the IIlh ofApril,
1839, that, by a rule of the Board, the memoitals and the docu-
ments on which they rely to substantiate those claims are required
to be inboth the Spanish and English languages; and thatall drocu-
menits, communications, and petitiios designed to be laid before
the said Board will be received by it, if sent through the State
Department. As tile duration of the Board is limited by the con-
vention, it is important to such claimants as have not yet appeared,
that there should be no delay in preparing and presenting their
cases for its consideration, feb 15-3w2aw
PNiHE AIR-TIGHT ilSTOVE.-Known aid warranted
i to be superior to every other, in economy of lime and ex-
pense ; in case of management; in comfort, convenience, safety,
neatness ; in exemlition from dust anti smoke; and in the healthi-
ness, pleasantness, uniformity, and certainly of its temperature.
One kind for wood, and another for coal; price $6 to 8$20; weight
30 to 60 pounds. It is new in structure, and still more new in
management; so that it MUST be made, set, andi used, strictly by
the printed directions, or it sinks, more or less, towards the bar-
barism of other stves. It has so far been brought into notice
and use almost wholly by the spontaneous efforts of lesdihg citi-
zens, chiefly professional, and no cane is known of tbeir turning
back or repenting. For students and invalids it is without a ri-
val. Colleges, &c. by early application, mtiay obtain terms highly
and permanently favorable for all connected with them.
Made and sold by Cuthmg & Mack, Lowell, Masschusetts, (five
or six hundreddoll irs worth las-t winter, and six hundred anti fifty
dollars worth in seven weeks, at Nashiville, Tennessee ;) by Whit-
ney & Ciuett, Albany, N. Y. ; L. V. Badger, New York city; S.
B. Sexton & Co. 40 Lightt street, Baltimore, Md. ; G. Hill and
H. W. Edwards, Georgetown, D. C.; D. & C. R. Weller, Rich-
mend, Va.; and by others, but not in these places. Purchasers
will of course be on their guard. For models or specimens, si-nd
to Bailtimiore, Albany, ao Lowell.
For information, rights, agencies, &c. apply (postage paid) to
E. C. Tracy, Windsor, Vt.; R. J. Meigs, Nashville, Termi.; or to
I. Orr, Georgetowi, D. C. each of whom lihas unlimited power on
the subject, and who should be notified forthwitl if the demand
for the stove any where is not well and promptly supplied by the
makers.
V1 R. J, Meigs, Esq. Nashville, Tennessee, says of this
stove : "Its performance is all that can be wished in a stove. I
think it scarcely possible to excel it, either in the agreeable tem-
perature of the air which it produces,, r in the economy and neat-
ness with whirh the effect is produced. In short, I am charmed
with it, and will ever be without it." After using it a year, he
says : "Its merits surpass, in my opinion, all that can be said of
it." Rev. J. N. Campbell, D). D. Albany, New York, says: "I
find it to answer your description, and to exceed my expectations
in every particular. I am entirely satisfied that it is in all re-
spects superior to any other stove in use." Again hlie says, (April
1, 1840,) 1 have used the Air-tight Stove for tie last 6 months,
in my study, equal, in its dimensions, to a room 14 feet square
and 10 feet high. 1 have burned, in that time, about two-thirds
of one cordeo wood. It is perfectly safe and neat. Itequ lizes
the temperature almost pertfeetly, and enables the user to regulate
the degree of it at pleasure. It fully equals, in my opinion, all
that the inventor says of it." J. T. Rice. Esq. of Albany, says:
I have had one in use about 4 months, (last winter,) in a room
of the dimensions of eleven feet by twelve, of ordinary height,
and during that time have kept fire dlay and night, with an
abundance of heat, with less than a half cord of (dry hickory)
wood. 1 consider it by far thie greatest improvement in stoveuu
for heating a room, of any that I have ever been acquainted with.'
Two business men in Albany used each a cord of mtuple wood in
their counting-rooms last winter, and they say : The equality of
heat is astonishing-a summer-like heat throughout iime room,
It hIs nearly quit its cost, and, from the comfort received from it,
[weJ could not be induced to part with it." Dr. S, Kidder,
Charlestown, Mass. says : I have .had this steve ia use about 7
years, have found it fully to answer the description ofl the itnsen-
tot, and, with proper attention to the doorand damper, I will ven-
ture to say it will be found tie most comfortable, convenien', anud
economical stove of any in use." (J..Salter, M. 1). of Boston,
supplied his stove with mel, last winter, only twice a week.) Rev.
E. C. lTracy, Editor of the Vermont Chronicle, says : Its per
feet safety at all times, the saving of fuel, the little attention that
it requires, the uniform and equable temperature that it keeps up
in all parts ol ithe romt, [the thermometer in the back part of a
large of en room keeping within half a degree of the same point
for 10 or 12 hours together,] ehL summer-like atmosphere that it
livess you in the severest winter day, are excellencies that render
it literally incomparable." Rev. H. Curties, Brandon, Vt. says:
"1 should be unwilling to dispense with it for any consideration.
I have found it an excellent article for a sick room, producing a
mild and equable temperature, night and day. I am confident
that no convenience heretofore possessed can compare with this
in cases of pulmonary affection as a substitute for removal to a
Southern climate during our severe winterseasons." Thie inven
tor says : The Air-tight Stove was invented in curing a very
dangerous pulmonary attack ; and, in two or three such attacks,
I have found it more effectual than every thing else by its allaying
the cough, (by mteans ofits uniformly soft and moist atmosphere,)
removing it entirely in a few days, and absolutely putting all
coughs and colds at defiance, more even than the best summer
weather, and without its weakening effects. I would not have
gone ten miles to the climate of Italy." nov f6-wtf
PICTORIAL ILLUSTRATIONS OF1" THE HI-
BLE, consisting of Views in the Holy Land, together with
many of the remarkable objects mentioned in the Old and New
Testaments, representing sacred historical events, &c. by Robert
Sears, third edition, is just received, and for sale by
W. M. MORRISON,
jan 20 Poor doors west of Brown's lIntel.
1[ KS. WALKIUsK ON B1CAUTY..
HINESE DICTIONARY.-A single copy, in 2 vols.
with English, French, Latin, and Chinese vocabularies,
dial, guess, atend other useful appendices, is just received for sale
by F. TA Y LOR, published at Serampoor, under the patronage of
the British Government. dec 4
OOKS oni Agriculture, Gardening, Cattle Ral-
ing, Agricultural Clhemilstry. &c. &c.-F. TAYLOR,
Bokselier, immediately east ofGadsby's Hotel, hIs for sale a
better collection of works on Agriculture than can be found else-
where in the United States, embracing every thing that is new, as
well as those of more established merit; te which additions are
constantly being made of ioth American and English writers on
the subject; all at the lowest prices.
*** Bhoks imported to order from London and Paris.
mar 3
LEXANDRIA FOUNDRY, Steam-engline tslid
Machine Factory.-Iron, brass, and composition cast-
ings of every description, high and low pressure steam engines,
fire engines, sheet-iron boats, mill and tobacco screws, turning
lathes, bells of all sizes, letter copying presses, &c. or other ma-
chinery, executed promptly, and on the most favorable terms by
T. W. & R. C. SMITH,
The above have a very large assortment of patterns for mill and
othergearing, &c. Also, a variety of handsome patterns for cast-
iron railings, &c.
They have for sale-
One locomotive engine
One 20 horse high pressure engine
Two 8 horse do do
One 3 horse do do
All of which are completed, and will be sold very low if early
application is made. oct 3-1y
-'UI1)U TO TiIl NATIONAL. EXECUTIVE
X OFt FIUES, by Robert Mills, Architect Public Buildings,
containing engraved Diagrams, designating the several Executive
buildings, their relative positions, bureau and officers' rooms,and
also the coinmiltee rooms in the Capitol; price 60 cents. Just
published, 1841, and this day received for sale by
feb 12 F. TAYLOR.
-j 'Hht; INAUGiURATION MAKItiI.-Just received
I. at Stationers' Ball, the Grand Inauguration Mareh cosmpos
ed by Mr. Dielman, which was presented toand accepted by Gen.
W.H. HBrrison, and will be played by the Marine Band on the day
of the leaugmsation. Persons can be supplied with copies by ap-
plying as above.
mar 3 W. FISCHER.
NAUGURATION BALLo.--Subocribers and others will
please spply at Stationers' Hall for their tickets of adomission
to the Grand ltauguration Ball at the New Washington Assembly
Rooms, (late American Theatre.)
mar 3 W. FISCHER.
A CARDo)-The subscriber hias for rent, on Pennsylvania
avenue, opposite the Seven Builings, a two story brick
house, furnished in first-rate style, which he will rent either with
or without board. It is well calculated for a gentleman and family
who desire to spend several months in Washington, or who may
be preparing to go to housekeeping in an establishment of their
owe, and will be rented on the most m easonable terms.
He also has ready furnished rooms on 19ih street, suitable for
families or individuals, which will be let on accommodating terms.
A. FAVIER.
P. S--A. F. continues to send out dishes amid to execute orders
far parties as heretofore, feb 12--oaf
W~ AbV L.EYo NOVELS COMPLEi' E.--Parkes'
beautiful Boston edition of Waverley Novels, which have
been in course of publication for the last twio years, is just com-
pleted, and can be found at MORRISON'S, four doors west of
Brown's hotel.
Complete sets can be had at the subscription price, 25 cents pet
volume. mar 3
OMMI S10NE OF I)EEDS ,&c. FtOK THE
STATES OF MASSACHUSETTS, CONNEC-
TICUT,ANID NEW YORK.-Theri.J-ers.n..e ;vesno-
tice that, by appointment of the Executives .f I, i',i.i.- above
named, he has tie power of a Commissioner in the District of Co-
lumbia to take Ithe acknowledgment of deeds and administer oaths
to be useI or recorded in either of the said States.
liis office is in the west wing of the City Hall, Washington.
D. A. HALL,
jan 16-3tawtf Autorneyat Law.
P CAHONTAS, A Legettid, with histoical and tradi-
tionary notes, by Mrs. M. M. Webster. Contents.-The
Wife, thte Mother, Matoa's lament at her mother's grave, Matos,
a family sketch, Nantu of
R. FARNHAM,
sept28 Between 9th and 10Oth streets, Penn.avenue.
Orphanls' Court, Washlington County, IDI)lstrict of Co-
lumbia, February 19, 1841.
SN the case of Samuel Stott, administrator of James Cole, de-
ceased, the administrator, with the approbation of the Or-
phans' Court, has appointed thie second Tuesday in April next for
the final settlement of said estate, and for payment and distribu-
tion under the Coutit's direction and control of the assets in said
administrator's hands to creditors and legal representatives of
said deceased, at which time the said creditors and legal repre-
senlativesare requested to attend: Provided a copy of this order be
published once a week for three weeks previous to said second
Tuesday in April next. EDWARD N. ROACH.
mar t4-w3w BRglter of Will,
A LBERI T LEH MAN & CO., Opticians, from Phil-
adelphia, respectfully inform the citizens of Washington
and its vicinity that they have opened a store in a room on Pnnayi-
vania avenue, between 3d and 4J streets, where they will offer for
sale Spectacles, with Gold, Silver, and Tortoise shell frames, with
new and improved assoitmentof Glasses of their own manufacture.
These Glasses are of the best kind for preserving and improving
the sight in continued reading and writing, whravein they do not tire
the eye, but strengthen and improve the vision. They are recom-
mended by the most celebrated Doctors and Professors.
Also, a new invention of Spectacles to discover objects at a dis-
tance or close at hand.
Also, Spy Glasses of every siz' and quality; Magnifying Glasses
of every description ; Microscopes wit, different magnifying pow-
ers, together with a variety of articles in the optical line not men
tioned
Optical and other Instruments and Glasses promptly and'care-
fully repaired on short notice.
They can always select Glasses to suit the sight of persons as soon
as they see them uroni first tiial. feb 22-eolm
F OR SALE OR LEASE.-That large and elegantly
finished house, with the lot on which it stands, situated at
the corner of C and 3d streets. Thie house hastwelve good rooms
in it, with fire-places, and some few smaller rooms without. A
large back building, between which and the main one is a private
stairway communicating wit lh both; an excellent kitchen, with a
well ol fine water, with a pump,justat the entrance intothe kitch-
en ; a beautiful back yard, enclosed with a brick wall 8 feet high,
containing fruit and shrubbery, with a fine stable, carriage and
stmuoke house, all in good order.
It is within a few minutes' walk of the Capitol, the City Hall,
and the Market-house, having a paved foot-walk all the way to
either, and possessing a full view of the railroad and tise cars as
they pass, corning in and going out, and not further than from 200
to 300 yarJs from the Depot.
Tihe subscriber will sell a great bargain in this property, and
give a reudit of one, two, and three years, for three-fourths of the
purchase money. He would prefer selling to leasing; but if any
good tenant will take it for four or five years, it will be disposed of
oun those terms, to be delivered on the 1st March next, and shall
be put in such order and repair as the lessee may desire.
Apply to the subscriber, living on the premises.
jan I I-tf- GARY SELDEN.
L ORD BACON'S W OIRKtS, Cheap.-A beautifuhhLon-
don edition in two large volumes of nearly 909 pages each,.
with engraved portrait, introductory essays, &c., is just imported
by F. 'TAYLORt directly front London. A few copiesonly for sale,
at the low price of ten dollars. jan 13
R. TAYLOR'S CELEBRATED BALSAM OF
D LIVERWORT, fir Consumptloni anid Lver
Complaltut.-F'ir the cure of these diseases no medicine can
equal Dr. 'Taylor's Balsam of Liverwort. Only look at the im-
mense multitude of the certificates of cures we have published-
cures this medicine has mads. when no other was of anyy use
Remember this is no quackery ; on the contrary, it is made by a
regular physician, who has spent twenty years in seeking a reinm-
edy for trut awful disease, consumption. This medicine is
supported by the whole Medical Faculty, to their eternal honor lie
it said. They throw aside prejudice and false practice, and own
publicly that this medicine alone can stay this deadly disease and
death. When such men as Drs. Rogers, Cheesman, Wilson, Au-
derson, Smnith, Hofftman, anid many others, who ornament their
profession, and honor society-when such men say )r. 'Taylor's
medicine is a certain remedy," who shall say no? No one. Let
the sick hope, then, for health, and use this vegetable remedy,
and they shall not hope in vain.
Wonderful cure of Consumption.-Altbough Di. Taylor's
Balsam of Liverwort has found hundreds of advocates, and has
produced so large a number of testimonials in its favor, I cannot
withhold my sniall meed of praise. BeDing predisposed to eon-
sumption, both by peculiar formation andt hereditary transmisa-
sion, I tried every means to cheek this disease, anid strengthen ai
naturally weak constitution. I spenout two years at Pisa, one in
Rome, two in Florence, and one in the south of France, seeking
meantime the advice of the best physicians. Two years since I
returned to this county y in about the same situation as when I left.
I had seen in tihe reading rooms in Europe much said in favor of
Dr. Taylor's Balsam of Liverwort, and as soon as I arrived in the
city of New York 1 used it, and in three months I was so well
that I concluded I could safely pass the winter here, and did so.
I have used an occasional bottle now and then during Ihe time,
but am now in as good health as is possible. My cough has wholly
ceased, and my lungs have every feeling of health. Dr. G. Snmih
and Dr. Post, of New York, were my physicians, and now say
they did believe mu incurable. J. PROUTY,
Western Hotel, Cuurtlandt street.
This medicine is sold geunine at 375 Broadway, New York,
and by J. P. MKEAN,
Successor to Lewis Johnson.
At his new Snuff, Tobacco, and Fancy Store, No. 11, east of
Gadsby's Hotel. feb 17-eolmo
bALA'IIMOUSlS I tl'JAI tnUItANUkfl IUMAIAN I,
JOHN J. DONALDSON, PReESIDNT,
NSURES LIVES forone or more years, r for life.
Rates for One Hundred Dollars.
Age. One year. Seventh 6.78
60 4 35 4.91 7.00
GRANTS ANNUITIES.
Ratesfor One Hundred Dollars
60 years of age, 10.65 percent.
65 do. 12.27 do. per annum.
70 do. 14.19 do. S
SELLS ENDOWMENTS.
For One Hundred Dollars deposited at birth of child,the Com-
pany will pay, if he attain 21 years ofage, $469
At six months, 408
One year, 375
The Company also executes trusts; receives moneyon deposit,
paying interest semi-annually, or compounding it, and makes
all kinds of contracts in which life or the interest of money is in.
evolved. WILLIAM MURDOCK, Secretary.
AGENTS.
James H. Causten, City of Washington.
D)r. B. R. Wellford, Predericksburg, Virginia.
H. Baldwin, Richmond, Va.
D. Robertson, Norfolk, Va.
A.S. ridball, Winchester, Va. -
George Richards, Leesburg. Va. mar 1-ly
7l3U1 HI OtOGICAt.L COLLOQ.UIES$, or a Compem,-
l dium ot Christian hby
W. M. MORRISON,
jan 22 4 doors west of Brown's Hotel.
PRINTING PAPER AND PRINTING INK may
always le had at the Wholesale and Retail Paper Ware-
house of R. FARNHAM, between 9th and 10thOL streets, Pennsyl-
sania avenue; who has for sale
500 reams 241 by 38 )
6500 reamns 24 by 34 PRINTING PAPER.
500 reams 22 by 32 )
knd all orders for paper of any size or quetity will be attended to
Orphans' Court, February 12, 1841.
District of Columbia, Washington county:
iT is, on this 12th day of February, 1841, ordered by the
I Court that letters of administration be granted to John Gor-
don on the estate of tHippohete Dumas, late of Wasbingorn coun-
ty, D. C deceased, unless caote to the contrary be shown on or
before Friday, thie 5th day of March next: Provided, A copy
of this order be published once a week for three successive
weeks in the National Iitelligencer previous to said 56h day of
March uext. NATH'L P. CAUSIN.
True copy. Test: ED. N. ROACH,
fi-b 13-ww3t Register of W'ills.
F AMILY BOARDING SCHOOL, 1
WIl/rON, FAsRFIEIiLD COUNTY, CONN.,
JAMES BETTS, Principal.-Tlme Principal of this school, who
has had an experience of five years in leaching, devotes iuis en-
tire attention to a number of pupils, not exceeding twenty, who
are expected to be undir twelve years of age when they are comn-
mitted to his care. The location ia pleasant ant healthful; being
about seven noiles from Norwalk, and fifty from the city of New
Yort, with which places it haes daily camuaunication by stages and
steamers. The pupils are all members of the family ofthe Prin-
cipal ; they board, lodge, and are instructed under thie same roof
with himself, and are ,.t all times under lis immediate supervi-
sion. The discipline of the school is mild and parental, such as its
peculiar character and thie age of its pupils naturally suggest.
Wile the Principal exacts implicit obedience, he at the same time
encourages his pupils to consider him as their friend as well as
their guide, and all hia requirements as having reference only to
their own ultimate good. Particular attention is paid to their ex-
ternal habits and deportment, as weul as mo their moral, mental,
social, and physic ml cuhlure.. Time
secholsastc year is divided into two sessions of 22 weeks each, com-
mencing on the first Mondays of November and May.
|TERMs.--For board, tuiuisn, washing, mending, fuel, lights,
towels, bed and bedding, $80 for winter, and $75 for summer ses-
sions, payubhe quarterly, in advance. Those who remain in vaca-
tion, are charged two-thirds the amountt per week required in
term time.
RvEnxENc s.-Rev. Jeremiah Day, S. T. D, LL. D., Presi-
dent, and Rev. Chauncey A. Goodrich, S T. D-, Benjamin Silli-
man, M. D., LL. D and Denison Olmsted, A. M Professors
of Yale College, Hawley Olmsted, Principal of the Grammar
School, New Haven, Rev. Samuel Whittlesey, Brick Church
Chapel, at the office of the Mother's Magazine, New York, and
Rev. E. C. Hutehinson, Alexandria, D. C.
mar 3-wtrnsylO
j ARM FOR RENT OR IjEASE.-Myrtle Grove
farm, situated near Port Tobacco, Charles county, Mary-
land.-This estate contains 1,800 acres of land, one-half of which
is in cultivation. The meadows are very extensive, and in fine
order, the late proprietor having designed to use this estate as a
grazing farm. It is well adapted to the growth of corn, wheat,
and rye, but especially for tobacco. The buildings on this estate
consist of a large and handsome mansion, mill, thrashing machine,
corn-houses, barracks, barns, tobacco-houses, granaries, hay-press,
and corn-mill, and every other out-house that can be useful. The
land and itt ..; ate all in excellent condition. It will bi leased
for a term of years to an approved tenant, with or without the
hands that are now employed in its cultivation. Bond with ap-
proved security will be required of the lessee for the performance
of his contract. Apply at ihe premises, wr by letter addressed to
ELIZABETH A. MITCHELL,
feb 15-2aw4w Near Port Tobacco, Chsrles co. Md.
LAW NOTICE.-The undersigned have connected them-
selves as partners in thIe practice of the law. They will
attend all the Courts held in Hamilton county, Ohio, and the Cir-
cuit and District Courts ef the United States at Columbus.
B STORER,
WM. KEY BOND.
CINCIFNsATI, (Ohio1) Sept, 1. 1840, Pept -12-oply
REV. rE t vt'ERT'S BITALM OP LIIE.-This is R. G. R. PH1LPS'S COMPOUND TOMATO
celebrated article, which, for the last two years, has proved JL. PILI9, the twe'alt.le re.. .-Ilv for diseases arising from
itself so valuable a remedy for Coughs, Colds, Consumption, 1tron- himpurities oi the Blood, IlycpepRos, 51crofalia, and all Chronicc lia-
chiis, Asthma, Whooping-cough, anid all diseases of the lungs and eases ; also a substitute forcalomnel as a cathartic in fevers and all&
windpipe, may now be had of druggists and merchants in most of bilious affections.
the towns in the Northern and Eastern States. These pills are no longer, if they ever were, amn-ng thosafe! -
Hoadley, Phelps, & Co. Wholesale Druggists, 142 Water at. doubtful utility. They have passed away from those that are daily '
New York, have been appointed general agents, and are prepared launched upon the title of experiment, and now stand before the \
to supply venders on the proprietor's best terms. Price $1 per Public as high in reputation, and extensively employed in all part \
bottle. A liberal discount miuade to venders, of the United States, the Canadae, and Texas, assany medicine eves'
From the Boston Medical Journal of Aug. 28, 1840. prepared for the relief t.f suffering man. They have been ex*'
The following is sn extract fiont an article in that paner on tensively prescribed by thle Medical Faculty wherever they hay
Morbus Laryngeus Concionatorum," or UBronchitis, by Frank been introduced ; and there are but few towns that cannot produce
H. Hamilton, M. I). Professor of Materia Medica and General Pa- some remarkable eases of their curative effects. Tile numenro, .
thology in Geneva Medical College: certificates which have been presented to the proprietor froe, pro-
"Time Rev. I. Covert's mixture, also now used so extensively fessional men erad others evince, in an extraordinary manner, the,
for this affection by clergymen, hbelongs to the same class of stim: .extensive applicability of this remedy in diseases generally. Pro-.
ulating expectoranta, being one of those lucky combinations of fessional men, and those of sedentary habits, loudly applaud their
medicinal agents which, while it promotes expectoration, does nt hygiene properties in obviating those evils incident to their oenu-
impair the tone of the stomach. Of this medicine we feel at lib- nation, and the want of exercise.
erty to speak, since its composition is not held from the profession, They are in general use as a family medicine, and there are
and we hope thi proprietor will soon see fit to give it to the Pub- thousands of faimiiies who declare they are never sati-sfied unless
lie. We venture to recomintnd it, therefore, having employed it they have a supply always on hand. They have no rival in curing
in our own ease, and in the cases of many others, with decided hbilious diseases, dyspepsia, liver complaints, sick-headach, jaun-
benefit." dice, rhrinmalism, heartburn, acid stomach, palpitation, loss of ap-
From the Auburn Conference and Family Recorder of Sep- petite, costiveness, &e.
tember 4 1839. Those persons liable to sore throat, swelling of the glands,
Covert's Balm of Life bids fuir to ran among the first ofspe- coughs, and other symptoms indicating scrofula, or consumption,
cities or mot cases of pulmonary disease. From having tested should take warning in season, and embrace a remedy which,
rifics for most cases of plmnonac~v disease. Froom having tested while it is searching out and eradicating disease, makes nodeduc-
its salutary tendency, and mome especially from the knowledge me f t ao o th y se
ihat it has won the confidence and received the recommendationIs ioons from the vital powers of thie system.
of many highly respectable medical gentlemen, scume of whom Recommendations from physicians in every variety of climate
are well known as the ornaments of their profession, we have no in the United States, Texas, and the Canadas, bear witness to the
hesitation in speaking well of it. We have reason to believe peculiar and potent effects of this medicine ; in fact, they are pre-
that it is employed in the practice of some of the most scientific scribed by physicians generally in preference to any other cathar-
ar.d judicious ol thie physicians of this place. The Rev. Mr. Co- tic and alternative medicine; and, having acquired an unprecedent-
vert, there inventor and proprietor of this valuable medicine, is a edl celebrity as an ANT1-D)YSPEPTIC and ANTI-BILIOUS
REMEDY-mind this reputation being fually sustained by the high,
respectable local minister of the Methodist Episcopal Church in cRMaerY-find this reputation being lly sustained y the high,
thisplace." character of its testimonials, and the increasing demand for the
The nature of thie composition of the'Rev. I. Covenrt's Balm of inedicine--it is only necessary hor the Proprietor to continue ue-
Life having been fully explained to the following medical gentle- caution, that the Public. may not mistake other medicines which
men, they have consented that they may be referred to as author- are introduced ans tomato preparations for the true COMPOUND,
ity foir its utility as an expectorant in those chronic cases of pul- OMATO PILLS.
mogary diseases in which that class of remedies is indicated : *** Iquire for PHELPS'S TOMATO PILLS, and be portiou,
I). M. Reese, M. D. Professor of the Theory and Practice of lacto observe that the label is signed G. R. PaL's, M. I. Prices
Medicine in the Albany Medical College. 371 cents.
J. M'Naughton, M. I). Professor of a nlUt,.,,, snl Physiology in G. R. PHELPS, M. D. Proprietor, Hartford, Connecticut;
the Pairfied Medical College. S PFor sale by most of the Druggists in the District of Colain,-
Mark Stevenson, M. D. New York city. bha, and by Merchants generally throughout the country.
Dr. M. M. Knight. nov30-eo4m
J. Mitchell, M. D. Philadelphia. "ARLEIY'S MAGAZINE FOR 184 boaultjd.-Also.
This certifies that, having examined the Rev. I. Covert's Balnm B the quarterly and single numbers, just received, and for sale
of Life in all its component parts, we do believe it tn be one of the at thie Bookstore of K. FAR NHAM,
best compounds for coughs, consumptions, chronic inflammations j h I between 9th arnd tih Strceus, Penn. avenue.
&c. of which we have any knowledge, and do most cordially re-
commend its use to all afflicted with the above named disease: B.EAUTIIFULLY BOUND 1& EMBELLISHED
Goruon Needham, MI. D. Onondaga; J. W. Daniels, M. D. and B Londons edltlons of the following Authors are juast
W.J. Lovejoy, M. D. SaUlina; E. Lawrence, M. D. Baldwinsville. opened and for sale by F. TAYLOR. Cowper's Poems, Young's
The following, flomw the Rev. L. Halsey, 1). D1). Professor of Ec- Night Thoughts, Bacon's Eisays, Goldsmith' Essays, Goldsmith's
elesiassical History, &c. in the Auburn Theological Seminary, has Poems, Thomson's Seasons, Gray's Poems, Lady otf tlis Lake,
just been received : Maruion, Campbell's Poems, Litiab s Rosamund Gray, Lamb's
A N THEOLOGICALS INA, MARCH 9,1840. Adventures of Ulysses, Beatlie's Minstrel, Gems from Ame, ican
Rev. I. COVERT.-MYO DtA SIRm: In eerence to yourdH 9, 180. Poets Gregory's Legacy, Rasselas, Scott's Ballads, Chapone's
iciRe,.I. Coiti r.-Mv DsAR Stuht: In h eaereonce t your mad- Letters, Warwick's Spare Minutes, Hemens, Lewis's Tales of
iciue, I deem it my duty to state that I had for a long limo been af- Wonder, Chtarles Lamb's Tales from Shakpecare, Elizabeth,
flirted with a chronic bronchitis andl its usual accompaniments, Woner' Charles Lamb'M Tales from Shan persr Elizbeth,
and was induced to try your preparation, on the assurance from WMilton, Rogers, Sterne, Spensre, Ossiaouthey, Wordsworth, CoeriPodge,.
medical men that it contained no hazardous ingredients. The re- Mlto, Rgery suernei o pedtns ourhey, Cruly s Briish Pees.
suit has been the allaying febrile irritations and the gradual resto- Also, very superior editions of ShakpeBre, Byron, GibHol,-
ration of healthy functions to the throat, so that 1 am enabled to t ine, Smollet, Robertson, Bacon, Burie, Ben Jonson, Claren,
return to the labors of the desk. I think th medicine entitled don, Burnett Godwin, and other standard authors handsomely
to tho attention of all persons similarly afflicted, hunmd; all fur sale at unusually lw pries., dec 26
"Yours truly, LUfHER HALSEY." ALR4lUND THE WOtRLD;a Natrativeofa Voyagein,
The following-named individuals have alsogiven theirtestimony the East India Squadron, under Comnmnodore George C.
in favor of the medicine, whose certificates, together with many Read; by an Officer in thie United States Navy, in 2 vols.
others, may be seen by application to any of the agents : Just published and for sale at thie Stationery store of R. PARN-
Rev. Isaac Stone, Lysander, N. Y.; Dr. Jose1ph T Pitney, Dr. HAM, between 9th and lOthstrees, @Pennsylvania Avenue.
E. Humphreys, N. Weaver, NM D. Auburn, N. Y ; Rev. T. Stow,
Elbridge, N. Y; J. 0. Slhinman, M D, Fayetteville; C. D). Town- SAPENSER'S POETICAL WORKS, with inutroduc-
scnd, NM D, Albany i; A.H. Newcomb, M D, Salina; Dr. Avery kZ tory observations on the Faerie Queene, and notes, by tbe
J. Skilton, Troy; Rev. I. Hopkiss, Auburn, N. Y; Rev. D. editor, first American edition, 5 vols. ; also, the Works of Elnmuand
Moore, Aurelins, N. Y; Rev. H. Bannister, Cazenovia, N. Y, Burke, in 9 vols. Are for sale by
Win. Morris, M D, Utica, N. Y; R. Glover, M Du, N. Y. City; W. M. MORRISON,
John Wilson, M Lt, Albany; R Kirby, M D, N. Y. City; A. jan 4 '4 doors west of Brown's Hotel:
Streeter, M D, anid L. Streeter, M D, Troy, N. Y; Dr. T. S. Bar---at -------- ---
ret, N. Y; Francis J Oliver, Esq. Boston. A NUT at WASHINUTOR.--JAMbEb UAUl-
This medicine may be had of most of the Druggists in the Dis.- TEN,(late of Baltimore,) having made this city his perma-
trictnf Columbia, and generally throughout the country, where nent residence, will undertake, with hisaccustomed zealand dil-
the circulars in reference to it may be had gratis, igence,the settlement of claims generally; and more particularly
nov 27-ceo4mo claims before Congress, against the United States, or the several
noe2-eir~otO.e.f.th- .17 n s- ..oc- a, f !*. --_..
M Ut Irritalien orAcid-
ity of the Stomach, particularly during pregnancy, febrile com-
plaints, infantile disorders, or sea-sickuess.
An ounce or two of the Solution speedily removes heartburn,
acid eructations, sourness, or irregular digestions of females and
2hitdre ni.
In the Army and 'avy,it has been found tocompose the stom-
ach in a few minutes, after any excess or hard drinking.
The Solution is of itself an agreeable aperient, but its laxative
properties can be much augmented bv taking with it, or directly
afier it, a little lemon juice mixed with sugar and water, or even
Cream of Tartar Tea; in this manner a very agreeable efervescent
draught can be safely taken at any time during fever or thiist.
"i The antiseptic qualities of this Solution, owing toa the presence
of so much carbonic acid, have been fiund very valuable in putrid
and other fevers. As a lotion for the mouth, it sweetens the breath,
and thie Magnesia clears time teeth from tartar.
For preventing the evolution or deposition of Uric Acid, in
gout or gravel, the efficacy of the dissolved Magnesia was long
since authenticated by Dra. M'Donnell and Richardson, and Sir
James Murray.
The Solution has almost invariably succeeded in removing
the fits, spasms, headaches, and gastric coughs to which deli-
cate persons are subject from acids and cruaities of the stomach
and bowels."
Extract from the Medico- Chirurgical Review for April, 1829,
edited by Dr. JAots JoHiasoN, Physician-extraordinary to the late
King, &c. &c. :
Pellucid Solution ef Magnesia.-This veryuseful and ele-
gant preparation we have been trying for some months, as an Ape-
rient ant-acid in dyspeptic complaints, attended with acidity and
constipation, and with very great benefit. It has the advantage
over common Magnesia in being dissolved, andtherefore not liable
to accumulate in thie bowels. It is decidedly superior to Soda or
Potash, on account of its saperient quality, and of its having no ten-
dency to reduction of ltieshtwoauthorized agents here."
Sir HtUMPHRYa DAVY testified that this Solution forms soluble
combinations with uric acid salts in cases ofgout and gravel,there-
by counteracting their injurious tendency when other alkalies and
even Magnesia itself had failed. For sale at
aug 31- TODD'S Drug stote.
FmWEEDIE'S LIBRARY OF PRACTICALME-
SDICINE, now in course of publication, edited by Alex-
ander Tweedie, may be procured at the Baokstore of F. TAY-
LOR. Vol. 1 contains Dissertations on Fevers, Inflammation,
Cutaneous Diseases, &c. by Doctors Symonds, Allison, ChriNti-
son, Schedel, Lacoek, Gregory, Burrows, and Shiapter. Vol. 2
contains Dissertations on Nervous Diseases, by Doctors Hope,
Prichard, Bennet, Tayhlor, Thomson, and Tweedie, edited by W.
W. Gerhard, M. D. of Philadelphia. The other volume will be
for sale as soon as published, by
nov 27 F. TAYLOR.
PRINCIPLES OF' STATISTICAL INQUIRY,
as illustrated in proposals far uniting an examination into
the resources ofthe United States with the census to be taken in
1840, by Archibald Russell. Also, an Historical Account of Mas-
sachusetts Currency, by Joseph B. Pelt. Are for sale by WV. M.
MORRISON, 4dooiswest of Brown's Hotel. dec 14
RYANT'S SELECTIONS P'ROM THE AME-
RICAN POETS, 1 volume, price 80 cents, just publish-
ed and this day received by F. TAYLOR. Also, Halleck's Se-
lections from the British Poets, 2 volumes, price 61. General
Armstrong's Notices of the Late War, 2 vols. Around the World,
being a Narrative of tie Voyage of the East IndiaSquadron under
Conmmodore Read, 2 vols. Chris ian Ballads, 1 vol. Ensenore,
a Poem, I vol. jan 1
OFFMAN'S COURSE OF LEGAL STUDY,
in two volumes octavo, price for the set $5, in calf binding.
An additional supply this day received fior sale by F. TAYLOR,
of the Course of Legal Study, addressed to students and the pro-
fession generally, by David Hoffman; second edition, re-written
and much enlarged, jan I
N AVY REGISTER of the coimmnissioed and warrant
S officers of the Navy of the United States, including officers
of the Marine Corps, for 1841, printed by order of the Secretary
of the Navy, in compliance with a resolution of the Senate of the
United States of December 13, 1815, is just published and fur sale
by W.M. MORRISON,
jan 8 4 doors west of Brown's Hotel.
I NHE RENUNCIATION, a romancee, by Miss Burney,
J- Travels to the City of 28 Immediately east of Gadsby's.
ONFESSIONS OF HARRY LORREQCUER,
- with numerous illustrations, by Phiz. A further supply is
just received, and for sale by W. M. MORRISON, 4 doors west
of Brown's Hotel. nov 30
aEW NOVELS.,-The Renunciation, a romance of pri-
vate life, by Miss Burney, in 2 volumes; Travels to the
City of the Caliphs, along the shores of the Persian Gulf and
the Mediterranean, including a voyage 'o the coast of Arabia and
a tour on the island of Scotra, by J. R. Weisted, Esq. F. R. S.
F. R. A. S. &c. &c. author of Travels in Arabia, in 2 volumes;
ate just published and for sale by
W. M. MORRISON,
4Ao- -r ors or D -'. Hm .
eu uiitJiUunts tuereof, anu ueor e any Board ot Commissioners that
may be raised for the adjustment of spoliation or other claims.
He has now in charge the entire class arising oat of French spo-
liations prior tothe year 1800; with reference to which, in addition
to a mass of documented mind proofs in his possession, he has ac-
cess to those in the archivesofthe Government.
Claimants and pensioners on the Navy fund,&c. bountylands,
return duties, &e. c. and those requiring life insurance, can
have their business promptly attended to by letter, (postpaid,)
and thus relieve themselves from an expensive and inconvenient
personal attendance.
Havingobtained onfdsd to his
care ; and that, to enable him to render his services and fat&Ritia
more efficacious, he has become familiar with all the lmsaed
office.
Office on F street, near the new Treasury Building.
feb 26-
Ataa, l~ra~ulta 5it Sms Aosts-sat 55*51 55 U ciatat ~Sftttma~ut
OFficus-No. 136 Baltimore street, Baltimore; and Wall
street, New Yark.
AoENcy-Pennsylvania Avenue, between Fuller's Hotel and
he Treasury Department, W'ashih,gi -m, iv.
CAPITAL PA li I I I I,,,,,trro.
PATRICK MACAULAY, President, Baltimore.
JOHN DUER, Vice President, New York.
I ONEY received daily on deposit, on which interest will be
allowed, payable semi-annually. The Company also In-
sures lives, grants annuities, sells endowments, and *,eats
trusts.
Of the rates ofinsurance ofpl0o on a single life.
ANNUAL PREMIUM.
Age. year. 7years. For life. Age. 1 year. 7yeeas. Forli.'e.
14 72 86 1 63 38 1 48 1 70 3 0#
Is 77 88 1 66 39 157 1 76 3 11
t6 84 90 1 62 40 169 1 83 3 20
17 86 91 1 665 41 178 1 88 a at
18 89 92 1 69 42 185 1 89 8 4
19 90 94 1 73 43 189 1 92 5 51
20 91 95 1 77 44 190 1 94 1 63
21 92 97 1 C2 46 1 91 1 96 3 73
22 94 99 1 88 46 192 1 98 3 87
23 97 1 03 1 93 47 193 1 99 4 01
24 99 1 07 1 98 48 194 2 02 417
26 1 00 1 12 2.04 49 195 2 04 449
26 1 07 1 17 2 11 50 196 2 09 460
27 1 12 1 23 2 17 51 197 2 20 4 75
28 1 20 1 28 2 24 62 2 02 2 37 490
29 1 26 1 35 2 31 53 2 10 2 59 524
30 1 31 1 36 2 36 54 2 18 2 89 549
31 1 82 1 42 2 43 55 2 32 3 21 578
32 1 33 1 46 2 50 56 2 47 3 56 f05
33 1 34 1 48 2 57 67 2 70 4 20 627
34 1 35 1 50 2 64 b8 3 14 4 31 6 60
35 1 36 1 63 2 76 69 38 67 4 63 6 7&
36 1 39 15 67 2 81 60 4 35 4 91 7 00
37 1 43 1 63 2 90
Applications, post paid, may be addressed to PATRICK
MACAULAY, EsFq., Pre-idea,,, Baltimore; or MORRIS ROB-
I'S'ON, %', Vce PrmesJen, New York; to which immediate
ster,'.mn jAll .e pa;d.
Appr.a-anfirs may also t,e rna-'!c personally, or by letter, post
pn,,,. .FKPANCI, A.Iil'. KINS, Es.. Ageni I.,r the Company In
'. f.n) I V.t.s1eTON. His oiTie- 1i on Pennsylvania Ave-
nue,between Fuller's Hotel and 15th street, ap 23-dly
TN OTICE.-The.right hand halves of the follnaing described
L bills of the Bank of the United States, Philadelphia, were
enclosed in a letter addressed to the subscribers and dep,.-ited in
the pnst office, Washington, on or about the 29th Ul-cember,
1840, by the Hon. W. S. Fulton, and have not come to hand ; all
persons are cautioned against receiving the same. "
810 letter A No. 33,834 $10 letter C No. 46,788
$10 letter C 34,127 Do 23,343
Do A 32,685 Do 31,293
Do 10,573 Do 43,737
Do 21,711 Do 34,692
Do 43,738 Do 10,167
Do 36,1s7 Do 684
Do 33,463 Do D 33,834
Do 43,737 Do 23,167
Do B 33,884 Do 33,835
Do 31l,267 Do 33,853
Do 20,477 B ,M1109
Do 17,276 Do 43,736
Do 13,760 Do E 48,606
Do 43.736 Do G 50,489
Do 33,164 Do 49,120
Do 28,429 $820 letter A 5,461
Do C 131 Do C 38,120
Do 33,834 Do 6.184
All the above named bills signed, for J. Cowperthwalt, Cashier,
S. MASON.
810 letter A No. 9,402 810 letter C 11,043
Do 18,166 Do 17,516
Do 15,153 Do D 17,375
Do 8,644 Do 14,005
Do 4,038 Do 9,137
Do 15,428 820 letter D 7,469
Db 16,100 Do 1,566
Do B 16,9156
All the last above specified bills signed, for S. Jaudon, Cashier,
S. MASON. -
Also, the left hand halves of the following :
810 letter A, No. 32,625; date, Dee. 1, 1838.
810 letter A, No. 3,383; date, June 1, 1838.
Signed, for N. Biddle, Preaident, G. W. PAIRMAN.
E. & C. ROBBINS & CO.
jan 25-w3m No. 134, Pearl street, New York.
dec 28 4-do.,,swe si t,,iolBwn iotel. F-IFTY DOLLARS REWARD.-My negro woman,
"MPROVED MOVEABLE BINDERS. forkeeping A CAMILLA DENT, went off on the night of the 9th Peb-
in a book-like form newspapers, pamphlets, letters, music, ruary, leaving behind her an-infant. She is nearly black, about
or any papers which should be kept in regular order, manufactur- 23 years old, well made, with full face, quite likely and genteel
ed by Win. Mann. Patent secured. For sale wholesale and re- in her appearance; her front teeth somewhat decayed on the
tail at the bookstore of R. FARNIHAM, sides, leaving a space between them. She is about 6 feet or3
dec 14 between 9th and 10th streets, Penn. av inches high, is a good seamstress endbhonse servant. I purchased
ENT'S COMMENTARI ES, seduced to Q her upwards of three years since, of George H. Keerl, eq. Bal-
U tis ad Answers, by Judge Kinne, second edition, timore, with whom she resided a number of ears, and was raised
enlarged and improved; the whole complete in I volume t by the late Thea. Mundell, Esq. near Piscatasay, in this county.
mended by Chancehlor Kent. I will give the above reward for her ahppe ireh ns if t.beyend
mended b iy hanellor K'ent.ithe limits of Prince Genrn. f'- .,MuntRf or D,-trnci of Colnunt.ls, snd
Also, Blackrstone's Commentaries, reduced to Questions and 30if in tsid county or [D reio, muaptn delisaye see or comait-
Aeswers, by the same writer, second edition, also complete inaone meet "toiai sothtyig t eri aaipny
volume.met to jail so that I get her again.
Just published and this dayreceived for saleby N.B. Camilla took a great vaniomy of clothing with her; I
jan 13 F. TAYLOR. only recollect a black atuff and a hia,:k calico draes, uwih red
spots, a plaid blanket shawl, and airiw hboinnct black m.d white
i''FHE AMERICAN ALMANAC' ufr 1841, am 'he striped. ff. C. SCOTr,
,2 Repuaiory of Utsefuml Knowle.dge, i for sale by %.V M. f)R-
RISON, 4 doors west of imown's liotel. dee 14 fob l-wfIw Uro
I
tl
r
p
f
dp.p, 28. | http://ufdc.ufl.edu/UF00073214/00033 | CC-MAIN-2016-26 | refinedweb | 44,074 | 68.7 |
Python – FTP
FTP or File Transfer Protocol is a well-known network protocol used to transfer files between computers in a network.
It is created on client server architecture and can be used along with user authentication. It can also be used without authentication but that
will be less secure. FTP connection which maintains a current working directory and other flags, and each transfer requires a secondary connection through which the data is transferred. Most common web browsers can retrieve files hosted on FTP servers.
The Methods in FTP class
In python we use the module ftplib which has the below required methods to list the files as we will transfer the files.
Below are the examples of some of the above methods.
Listing the Files
The below example uses anonymous login to the ftp server and lists the content of the current directory. It treates through the name of the files and directories and
stores them as a list. Then prints them out.
import ftplib ftp = ftplib.FTP("")("anonymous", "ftplib-example-1") data = [] for line in data: print "-", line
Changing the Directory
The below program uses the cwd method available in the ftplib module to change the directory and then fetch the required content.
import ftplib ftp = ftplib.FTP("")("anonymous", "ftplib-example-1") data = []('/pub/') change directory to /pub/ for line in data: print "-", line
When we run the above program, we get the following output −
>- lrwxrwxrwx 1 504 450 14 Nov 02 2007 FreeBSD -> os/BSD/FreeBSD - lrwxrwxrwx 1 504 450 20 Nov 02 2007 ImageMagick -> graphics/ImageMagick - lrwxrwxrwx 1 504 450 13 Nov 02 2007 NetBSD -> os/BSD/NetBSD - lrwxrwxrwx 1 504 450 14 Nov 02 2007 OpenBSD -> os/BSD/OpenBSD - -rw-rw-r-- 1 504 450 932 Jan 04 2015 README.nluug - -rw-r--r-- 1 504 450 2023 May 03 2005 WhereToFindWhat.txt - drwxr-sr-x 2 0 450 4096 Jan 26 2008 av - drwxrwsr-x 2 0 450 4096 Aug 12 2004 comp
Fetching the Files
After getting the list of files as shown above, we can fetch a specific file by using the getfile method. This method moves a copy of the file from the remote system to
the local system from where the ftp connection was initiated.
import ftplib import sys def getFile(ftp, filename): try:("RETR " + filename ,open(filename, 'wb').write) except: print "Error" ftp = ftplib.FTP("")("anonymous", "ftplib-example-1")('/pub/') change directory to /pub/ getFile(ftp,'README.nluug')
When we run the above program, we find the file README.nlug to be present in the local system from where the connection was initiated. | https://scanftree.com/tutorial/python/python-network-programming/python-ftp/ | CC-MAIN-2022-40 | refinedweb | 434 | 61.67 |
Hi!
I figured out how to make the player move while he's in the air.
I do it with this piece of code:
Vector3 airMove = new Vector3(moveInput.x * 6f, m_Rigidbody.velocity.y, moveInput.z * 6f);
m_Rigidbody.velocity = Vector3.Lerp(m_Rigidbody.velocity, airMove, Time.deltaTime * 2f);
Now how would I go about making it relative to the camera?
This question comes up a fair bit, be sure to search for your problem before asking a new question.
You will need to use the camera's orientation vectors to do this ( right with X, up with Y, forward with Z).
right
up
forward
I tried searching and didn't find the right answer that would help in my case. There's quite a few answers for doing the same thing but on ground. I want it in-air to control my jump direction after jumping.
Answer by RyanShackelford
·
Apr 30, 2018 at 05:40 PM
You could try attaching the camera directly to the player object. Also, standard assets might have a camera follow script in it.
The camera is already following my player. I want the movement to be relative to the camera so when I press W when I'm in the air i expect to go forward
using UnityEngine;
using System.Collections;
// Add a thrust force to push an object in its current forward
// direction (to simulate a rocket motor, say).
public class ExampleClass : MonoBehaviour
{
public float thrust;
public Rigidbody rb;
void Start()
{
rb = GetComponent<Rigidbody>();
}
void FixedUpdate()
{
rb.AddRelativeForce(Vector3.forward * thrust);
}
}
I tried using AddRelativeForce but couldn't get it to work either. I want to be able to change the direction of the jump mid-air
Import the Character's package in Unity, and look at the FPSController.prefab and the RigidbodyFPSController.prefab. Assets > Import Package > Characters I think you are going about movement in the air the wrong way. It should work the same way on the ground as in the air unless you have your code not adding force while in the air.
If that doesn't help with your script, I suggest looking for a character controller tutorial on YouTube or your favorite search.
Move player relative to camera
0
Answers
How to relative movement system based on camera direction
1
Answer
Character movement relative to the camera
1
Answer
Making a bubble level (not a game but work tool)
1
Answer
[C#] Movement Direction Change Multiple Times
1
Answer | https://answers.unity.com/questions/1500477/in-air-movement-relative-to-camera.html | CC-MAIN-2020-24 | refinedweb | 409 | 63.8 |
21 December 2012 23:03 [Source: ICIS news]
HOUSTON (ICIS)--As a central element in the financial crisis that started about five to six years ago, the US housing market is expected to continue to recover through the coming years, although remaining challenges will limit the industry to a slow but steady growth.
).
“However, stubbornly tight lending standards for home buyers and builders, inaccurate appraisals and proposals by policymakers to tamper with the mortgage interest deduction could dampen future housing demand,” Crowe said.
The expectation is also based on the assumption that US lawmakers will avoid the “fiscal cliff”, or over $600bn (€456bn) in tax increases and spending cuts that become effective on 1 January unless the president and Congress can come to an agreement on economic policy.
“While we’re hopeful that something can be accomplished, the alternative would be a likely recession, so automatically spending and tax increases need to be addressed quickly,” said Lawrence Yun, chief economist for the National Association of Realtors (NAR).
New Construction
The ?xml:namespace>
The nation’s population is growing by 3m people a year, and new housing is needed as older units are replaced and as new households continue to grow by 1.4m a year, said the NAR’s Walter Moloney.
“It has to grow because construction activity from the past years have been way below normal,” Moloney said. “If construction does not return to normal, we’ll see pressure on the housing level, and it’s going to create an imbalance, and we don’t want to see that happening.”
Housing starts in 2011 was 612,000 units, less than one-half of normal, Moloney said. For 2012, that number is expected to increase 28% to 786,000 units, closer to the halfway range.
“In looking at the percentage increase, they’re pretty dramatic, but they’re not where they should be,” Moloney said. “We’re expecting a 44% gain to 1.1m [units in 2013], getting back to a more healthy level.”
Single- vs Multi-Family Construction
Single-family home starts are expected to climb by 23% to 534,000 units in 2012, posting another 21% gain to 647,000 units in 2013, according to NAHB predictions.
As new households form at a growing rate, so does builder confidence, the trade group said. The NAHB/Wells Fargo Housing Market Index, which measures builder confidence in the single-family housing market, has posted gains for eight consecutive months.
Meanwhile, new single-family home sales are expected to increase by 20% to 367,000 units in 2012 and 22% to 447,000 units in 2013, the NAHB said.
“Single-family housing has been revving up quite strongly, said Ken Simonson, chief economist for the Associated General Contractors of America (AGC). “Where we’ve had impressive growth is in multi-family construction. I do think we’ll have another year of double digit [growth] from 10-20%.”
Multi-family production is expected to raise 31% to 233,000 units in 2012, posting another 16% gain to 270,000 units in 2013, according to NABH predictions.
“Rather than having a house in the suburbs, where people have more land but need to [commute] by car, some are choosing to live in apartments or condominiums, where they have less space, but are closer to work or amenities,” Simonson said.
Existing Homes
While new homes continue to be built, economists are also expecting growth in existing-home sales.
The NAR predicts existing-home sales to increase by 9.0% to 4.64m in 2012 and by 8.7% to 5.05m in 2013.
Low demand and tight supply could result in higher home prices as the national median existing-home price should rise by 6% to $176,100 for all of 2012 and increase another 5.1% to $185,200 in 2013, the NAR said.
“Real estate will be a hedge against inflation, with values rising 15% cumulatively over the next three years, also meaning there will be fewer upside-down home owners,” Yun said.
However, rising rents, qualitative easing, federal spending outpacing revenue and the national debt are all raising inflationary pressures, possibly raising mortgage interest rates to 4% in 2013, the NAR said.
Yun projects inflation to be in the range of 4-6% by 2015, but sees no immediate threat.
“Housing will strengthen in 2013 even if the economy weakens because there is a demand for more construction, and the demand for apartments is rising at a faster rate than the need for more single-family homes,” Yun said.
The housing market is a key downstream consumer for the chemical industry, driving demand for a variety of chemicals, resins and derivative products such as plastic pipe, insulation, paints and coatings, adhesives, roofing materials and synthetic fibres.
The American Chemistry Council (ACC) estimates that each new home represents $15,000 worth of chemicals and derivatives used in the structure or in production of component materials.
For existing homes, the renovation and additions category is quite large, Simonson said, and until a few months ago, more money was being spent on home improvement than on new single-family | http://www.icis.com/Articles/2012/12/21/9627042/outlook-13-us-housing-recovery-to-continue-at-slow-steady-rate.html | CC-MAIN-2015-22 | refinedweb | 855 | 58.42 |
Educational Codeforces Round 33 Editorial
What about using a persistent segment tree for F? We let version=depth and it should run in .
I'm assuming that by version = depth, you mean that T[i] in the k-th version will contain the k-block minimum for the subtree rooted at 'i'. Persistent segment trees get their memory and time complexity based on the fact that each version differs from the previous one by 1 position ie., O(LogN) nodes in the tree. But, in this case, the minimum for k+1 can be different from the minimum for k at every node.Correct me if I got it wrong, if that is not what you meant.
I was struggling with that for a while too, but since you can reindex the nodes in DFS order, keeping track of entry and exit index, before putting them in segment tree, it guarantees logn. The key thing is the segment tree is balanced even when the original tree isn't. Here's my submission:
EDIT: My bad, I didn't read carefully. The k-th version is all nodes with distance <=k from the root (using placeholders +INF for all the other nodes)
how to solve 3rd question rumor
The problem mainly can be modeled as a graph , where each group of connected vertices (connected component) represents some people which can share the rumor with each other so you can only tell one of them the rumor and he will spread it among all the group. so in order to minimize the cost you should select the cheapest one to tell him , and he will tell all the group , and you should do the same for all groups. Ans = summation of minimums in all groups.
This is my solution to this problem i did it as described in the editorial, i took given members as nodes and friendship between a pair of members as edge and constructed an undirected graph and simply traversed each connected component using bfs and took the minimum value of member from each connected component and added it to answer
An integer isn't always large enough to contain the final solution, as it can be up to c*n, which is 10^14.
So you have to take integer of 64bit to store final answer
in E — in O(1) (by precalcing factorials and inverse factorials)
in order to solve the problem you had to calculate s(n,k). How can you calculate this with O(1)?
U can precalcualte factorial and inverse factorial:
for(int i=0;i<=1e6;i++) { fact[i=fact[i-1]*i ifc[i]=ifc[i-1]*modularinverse(i) }
I think he means you can query/access value in O(1), but I'm sure the time to precompute takes longer.
Can someone please explain Div 2 F ? I am not able to understand it from the editorial ?
I made it using something like merge-sort tree. First, you need to do a dfs(euler tour tree) to store the time you processed the vertex u, store the depth of u and the size of subtree. Create an array V[] that on each position V[time[u]] stores a pair containing the depth and the cost of vertex u(V[time[u]] = <depth[u], C[u]>). Now, Build it like a normal segment tree, but each node keep an array that stores all the elements of V in the range(L,R). You can see that only O(nlogn) memory is used to store them. Do some preprocessing on the nodes of the tree: for each position i of the array of each node, do array[i].cost = min(array[i].cost, array[i-1].cost). Now, you just need to do a query on the segment tree: find the interval [time[u],time[u]+subtree_size[u]], and do a binary search on the array stored on the node searching the last value of depth less or equal than K and return its cost. Since we made that preprocess before, this cost will be the cost of the minimum cost vertex of the k-blocked subtree of u. I hope you understand, my english isn't that good.
Can you elaborate the pre -processing part? Also, can you explain the over-all logic behind your code?
The pre-processing: The answer for the k-blocked subtree of u is the minimum between the answer from 1-blocked to k-blocked subtree of u. So we need to get the minimum value c1 that has distance not more than k from u. Since the data structure is holding , in each node, an array containing pairs like <depth, cost> sorted by depth, we just need to propagate the minimum answer found to bigger depths in that range. Thats why i pre-process every node, to make this prefix minimum operation. Now, how do i know i am querying the subtree of u? Using time[u] (from the first dfs), we know that for all v with time[v] <= time[u]+subtree_size[u], v is in the subtree of u, so when i call my query to get the answer from time[u] to time[u]+subtree_size[u], with depth K+depth[u], i'm getting the minimum answer for the subtree of u. When i find the range of subtree of u, i do binary search on the array, getting the last pair <depth, cost> with depth < K+depth[u] (if depth[v] -depth[u] <= K, then v is on the k-blocked subtree of u). Since i made that prefix minimum operation in the array, the last pair satisfying the condition gives me the minimum answer for that range.
Can we build a segment tree inside every node of the original tree, to get the minimum cost, in the given range?
I believe would just be a 2D segment tree. But as the editorial says, it might be too slow since querying would be O(lg^2 n).
I solve using sqrt decompositon which answers queries in O(sqrt(N)), so I think, as editorial says, O(lg^2 n) per query is OK.
Problem C can be solved using disjoint set too!
it is saying TLE .I have used disjoint set .55217078
You are missing the path compression. Your parent function has $$$O(n)$$$ complexity.
Got it Thanx.
Can someone elaborate on solving Problem C. I understand that if we find the minimum of each group, it will give us the minimum gold in order to spread the rumor. However, how can we turn the list of pairings we are given as inputs into groups?
Build an undirected graph. If there is a pair (u, v) then there is an edge from node u to node v and from node v to node u. Two nodes are connected if there is a path between them.
You can build a graph from the list of pairs of friends. Then, every connected component will be a group. Run a dfs for each group and keep the minimum value from it. Sum this value to the ans after finishing a dfs on one group. Another solution(mentioned by the guy above) is to use disjoint set union. For each pair (u,v) , merge the group of u with the group of v, storing the minimum value for that group. Now just iterate over all disjoint groups adding to the ans the stored value for each group.
Thanks, your explanation was very clear. I'm still having trouble with the "Every component will be a connected group" part. How do you represent these groups? For example if 1 is friends with 2 3 4, then my adjacency lists look like:
But if I DFS starting with every node, I will find the minimum, but I will be quadruple counting this one group. Sorry if this seems silly, I am pretty new to graph problems.
You could use array of boolean to flag which node/vertex already visited. So it looks like this:
Can someone explain me please why C(y+cnti-1 ; cnti) is the corect formula? I can.t undertand from where we have this relation
I can't understand it too
I believe this article is about this combinatorics problem:
Thank you :D
Thank you!
in problem D a0<0 how it is possible because starting amount of account=0.
Good Contest
Can someone explain me "Segment Tree structure" solution for "F" ?
Hi, i explained my solution using segment tree here (on this same post)
thanks a lot, my inattention(
Can someone explain to me why my solution for D is wrong?
For each ai = 0 I supppose that I deposited the maximum amount of money that I am allowed to deposit. Then, if my money at bank is greater than d, I substract only the necessary from the last deposit; if after this update, my last deposit cant make my money at bank non-negative, print -1.
Accepted!
I was missing something important!
You can check my solution here: 32652462
Hi, what should be the output for 4 10 -10 -10 -10 0
Your solution gives output as 1. I think it should be 2 with final solution as 10 -10 10 0. Am I missing something here ?
In the given input they will check our account balance only last day.To make sure the money we have in the last day is non-negative, she should go to the bank in the last day and deposit some money between 30-40. Because she has -30 and the limit is 10. Answer is 1.
Okay got it, actually I thought that the amount of money that can be deposited also cannot be greater than the limit. Thanks !!
why does the code showing tap doesnot appear now in the tutorial ??? it hsould be there atleast for the hard problems along with specific comments at the right place .
Can someone provide a proof for editorial for E?
893F can be transformed into a 2D RMQ without assignments where there's only one element in each row, so I think 1D Sparse Table + 1D persistent segment tree/balanced tree can be used, which could also run in O(n log^2 n + m log n)... (Note: let dat[i][j] be the segment tree for elements from the i-th row to the (i+2^j-1)-th row, then the difference between dat[i][j] and dat[i+1][j] is only about two elements) Yet I'm not certain whether this solution will get Memory limit Exceeded. [sorry for my poor English]
Can someone explain the example input of F, why the output is "2 5"? I think I misunderstood the problem somehow...
In Problem C — Rumor, the editorial and comments mention describe a solution where one takes the sum of minimum gold for all connected components. In my solution 32587668, I sorted the characters by the amount of gold they need to spread the rumor. Then it is sufficient to process each character in order and run a DFS if not visited and sum up the gold required. There's no need to take the minimum anymore.
In problem E for every prime divisor i of n , we are calculating the number of ways of putting 'cnti' objects into 'y' boxes.
Or in other word the number of non-negative integral solution of equation x1+x2+x3+....+xY = cnti.
And this should be equal to (cnti+y-1)C(y-1) .
What is wrong in this logic? And if it is correct then how that formula came which you wrote over there?
nCr = nCn-r
Thanks bro
For f we can also use fractional cascading wich gives us a solution with (n+q)log
It's been a while since this contest, but could you explain this a bit more?
I have a solution for F that involves a 2D data structure (It's a Segment Tree with Treaps in each node). It runs in O((N+M)*Log^2(N)). Here's the submission: 32671104
hey codeforces !! can someone please explain the logic of the beautiful divisor question given above i do this ques by my way first genrating all the distinct divisors in o(sqrt(n)) time putting one by one in set and then from the right most element of set which is the largest (I calculated its binary in top-down fashion ) and i get accepted verdict. But this solution sucks me off any help will be appreciated ! I want to do this in O(1) time as explained above :)
Hello codeforces community .. can someone tell me that the rumor problem can be solved without using the dfs / bfs i am just trying to maintain the neighbours of each vertex in an vector of vectors but get stuck any help will be appreciated
You can do it without dfs/bfs. Check the union find algorithm or you can check my solution
hey u have also uses the iterative approach or the recursive one with dfs
Can someone post their approach for the problem D (Credit Card) in Div 2?
I suddenly come up with a interesting idea, problem F can be solved with KD-tree(2-dimension) ...and I tried just now, it was proven to be feasible and it's space complexity is nearly to O(n)^_^ 32738460
Actually, tests in F are really weak. I got AC with O(n) for minimum query (with default athor solution which is supposed to use sparse tables to process a query with O(log(n)) by going down from x with 2^k steps and taking minimum on segment of precalculated values each time).
In E, can someone explain this ? And why do we multiply answer every time when we encounter new prime?
Imagine each element in the array as a box, so we have y boxes with us. Now suppose we have 2 as a divisor and our number x is divisible m times by 2. So now we have m 2's which we can put in any of the boxes. So how do you arrange m (balls) into y (boxes) ? See here for the formula:
I got the first part(stars and bars one), but why do we multiply answer every time when we encounter new prime?
upd: i got it now.
Can someone tell me why my submission gets MLE in problem F . I think it uses Nlogn memory which is within the limits. What am I missing here ? PS. I made a typo in binary search in the get() function as typing (a<<step) instead of (1<<step) but i have no idea why did that cause MLE.
I am not able to understand problem D. Can anyone explain it?
In Problem E: My code works till 7th test case and then shows long long int overflow in diagonistics --
"signed integer overflow: 58062342303970488 * 835 " says the error message,
but in my code it must not happen because
pdt=((pdt%MOD)*(NCR(val+y-1,y-1)%MOD))%MOD;
I have already taken mod before multiplication!
My submission : 32953649
It refers to the code inside your NCR function.
In problem C I am doing it using DFS and summing up all minimums, I really don't know why it gives me TLE in test case 31. Can anyone help me please? Here is my solution:
my code is not working (rumor) can someone help me?
using namespace std;
vector v[10000009];
long long w,y,n,ans,MIN,l[10000009],k,i; bool a[10000009],ok; void bfs(long long o) { if(a[o]==false) { a[o]=true; if(l[o]<MIN) MIN=l[o]; if(v[o].size()-1!=0) for(k=1;k<v[o].size();k++) { if(a[v[o][k]]==false) bfs(v[o][k]); } } } int main() { long long m; cin>>n>>m; for(i=1;i<=n;i++){ v[i].push_back(1); } for( i=1;i<=n;i++) { cin>>l[i]; }
if(m>0)
for(i=1;i<=m;i++)
{
cin>>w>>y;
v[w].push_back(y);
v[y].push_back(w);
}
for(i=1;i<=n;i++)
{
if(a[i]==false)
{
ok=true;
MIN=l[i];
bfs(i);
ans+=MIN;
}
}
cout<<ans; } | https://codeforces.com/blog/entry/55989 | CC-MAIN-2020-16 | refinedweb | 2,722 | 69.82 |
Member
75 Points
Oct 04, 2019 03:27 PM|Prathamesh Shende|LINK
Hi,
i have two table
Country and State which is also connected to each other using FK PK.
I want to represent the data in this form
United States
California
NewYork
India
Delhi
Panjab
I think structure will be like this
Foreach (Country)
{
Foreach(State)
}
How can i code this ? I tried but its not work by me. please tell me how can i implement this.
All-Star
52961 Points
Oct 04, 2019 04:30 PM|mgebhard|LINK
The first step crafting an View Model that fits represents the UI you are trying to achieve.
public class Country { public int Id { get; set; } public string Name { get; set; } public List<State> States { get; set; } } public class State { public int Id { get; set; } public string Name { get; set; } }
Fill the view model and display the view model.
foreach(Country country in countries) { //Write Country Console.WriteLine(country.Name); foreach(State state in country.States) { //Write state Console.WriteLine($" {state.Name}"); } }
These concepts are covered in EF Core fundamentals.
Member
75 Points
Oct 04, 2019 06:07 PM|Prathamesh Shende|LINK
its not working sir. I think i made mistake while putting code.
can you please tell me where do i place this ? What is 'countries' ? I got this Country is coming from ViewModel
Please help me, I am new on .net core
Thank You
All-Star
18815 Points
Oct 07, 2019 05:07 AM|Nan Yu|LINK
Hi Prathamesh shende ,
I would suggest you first read how to enable relationship in EF Core :
Configuring One To Many Relationships in Entity Framework Core
So that you can read with navigation property easily :
Best Regards,
Nan Yu
3 replies
Last post Oct 07, 2019 05:07 AM by Nan Yu | https://forums.asp.net/t/2160376.aspx?Nested+Forloop+in+asp+net+core | CC-MAIN-2021-10 | refinedweb | 299 | 71.04 |
![endif]-->
Project Description:
Module scope:
To trigger a third party software based on data queried from a Mongo DB. The module should check from the MongoDB at regular interval (this should be configurable) for orders which are in a status of “PDF Ready” and not currently being processed by another thread.
If any order is found in that state, the PDF name, and preflight profile name (please note that if no preflight profile name is found against that particular item, then the profile information should be retrieved from the client config) should be retrieved for that particular item to be parsed in the Linux CLI.
On successful download of this data, the module should create a command line for the Linux CLI which contains the static path to the relevant profile file, the static path to the PDF file to be preflighted and the destination folder path for the processed file.
Once the command has been passed to the Linux CLI and the pdfToolbox engine returned a report xml, the status of the item is updated in the Mongo DB as “print ready”.
A report xml file will need to be processed and certain namespaces within the xml ingested back into the Mongo database so that we can enable some reporting services to the end user.
Sample of a Linux CLI command to be triggered:
./pdfToolbox /”root/preflightprofiles/DigitalPrintingHigh.kfpx” /”root/dropbox/PDF/Test.pdf” –report –outputfolder /”root/dropbox/preflighted/site1” –suffix “pref”
This should be written in Javascript and use node.js, we need to have the ability to multithread up to 8 instances of the pdfToolbox engine. | http://www.freelancer.com/projects/Javascript-Linux/Node-module-trigger-Linux-Commands.html | CC-MAIN-2014-23 | refinedweb | 269 | 50.8 |
I am trying to Link R and C in windows while following the instructions on this web page
I have R, RTOOLS and TurboC4 all in separate folders in C drive. My system is 64bits but I have tried it on both 32 and 64 bit R.
I have written the following code in C
#include <R.h> void hello(int *n) { int i; for(i=0; i<=*n; i++){ Rprintf("hello, world!this is hell though I'm enjoying it\n"); } }
and saved with name WORLD.C on separate file the path to which is C:\TurboC4\TC\BIN
I have also written the following R code
hello2 <- function(n) { .C("hello", as.integer(n)) } hello2(5)
and save it with name WORLD.R.
Now I have to prepare my window. I have downloaded RTools33.exe from here
and set the environment variables manually through this command
PATH=c:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin;c:\Program Files\R\R-3.2.2\bin\i386;
Then Reinstalled system
Before calling the C code in R I have to compile the C code in cmd. I write the following command to change the directory where WORLD.C is saved
cd C:\Users\TurboC4\TC\BIN
which is successful but when I try to compile
C:\Users\TurboC4\TC\BIN> R CMD SHLIB WORLD.c
I get the following error. " 'R' is not recognized as internal or external command, operable ". I have also tried to compile WORLD.C in C and got these two errors. "Unable to open #include R.h>" and "function Rprintf should have a prototype".
Setting Environment is a Problem I think this is where I am facing problem. I have ch
This problem is now solved. There was just a minor mistake of defining the environment variable. The correct definition is as follows.
c:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin;c:\Program Files\R\R-3.2.2\bin\i386; | http://www.devsplanet.com/question/35273473 | CC-MAIN-2017-04 | refinedweb | 329 | 68.47 |
Important: Please read the Qt Code of Conduct -
Import packages in PySide2 has dll load fail, but import PySide2 is ok
When I use PySide2 in Anaconda, if I import Pyside2, it i ok; But when I import packages in PySide2, just like import PySide2.QtCore, there will be dll load fail:
Python
import PySide2.QtCore
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: DLL load failed: The specified module could not be found.
But when I use PyQt5, there will be nothing. My python is 3.6.8, PySide2 is 5.9.0, but when I use python 3.6.4 and PySide2 5.11.0, it is same. Do anyone know how to solve it? Thanks!
- jsulm Qt Champions 2019 last edited by
@klyjm Please do not double post. | https://forum.qt.io/topic/104464/import-packages-in-pyside2-has-dll-load-fail-but-import-pyside2-is-ok | CC-MAIN-2020-34 | refinedweb | 135 | 93.74 |
Develop U-SQL with Python, R, and C# for Azure Data Lake Analytics in Visual Studio Code
Learn how to use Visual Studio Code (VSCode) to write Python, R and C# code behind with U-SQL and submit jobs to Azure Data Lake service. For more information about Azure Data Lake Tools for VSCode, see Use the Azure Data Lake Tools for Visual Studio Code.
Before writing code-behind custom code, you need to open a folder or a workspace in VSCode.
Prerequisites for Python and R
Register Python and, R extensions assemblies for your ADL account.
Open your account in portal.
- Select Overview.
- Click Sample Script.
Click More.
Select Install U-SQL Extensions.
Confirmation message is displayed after the U-SQL extensions are installed.
Note
For best experiences on Python and R language service, please install VSCode Python and R extension.
Develop Python file
Click the New File in your workspace.
Write your code in U-SQL. The following is a code sample.
REFERENCE ASSEMBLY [ExtPython]; @t = SELECT * FROM (VALUES ("D1","T1","A1","@foo Hello World @bar"), ("D2","T2","A2","@baz Hello World @beer") ) AS D( date, time, author, tweet ); @m = REDUCE @t ON date PRODUCE date string, mentions string USING new Extension.Python.Reducer("pythonSample.usql.py", pyVersion : "3.5.1"); OUTPUT @m TO "/tweetmentions.csv" USING Outputters.Csv();
Right-click a script file, and then select ADL: Generate Python Code Behind File.
The xxx.usql.py file is generated in your working folder. Write your code in Python file. The following is a code sample.
def get_mentions(tweet): return ';'.join( ( w[1:] for w in tweet.split() if w[0]=='@' ) ) def usqlml_main(df): del df['time'] del df['author'] df['mentions'] = df.tweet.apply(get_mentions) del df['tweet'] return df
Right-click in USQL file, you can click Compile Script or Submit Job to running job.
Develop R file
Click the New File in your workspace.
Write your code in U-SQL file. The following is a code sample.
DEPLOY RESOURCE @"/usqlext/samples/R/my_model_LM_Iris.rda"; DECLARE @IrisData string = @"/usqlext/samples/R/iris.csv"; DECLARE @OutputFilePredictions string = @"/my/R/Output/LMPredictionsIris.txt"; DECLARE @PartitionCount int = 10; @InputData = EXTRACT SepalLength double, SepalWidth double, PetalLength double, PetalWidth double, Species string FROM @IrisData USING Extractors.Csv(); @ExtendedData = SELECT Extension.R.RandomNumberGenerator.GetRandomNumber(@PartitionCount) AS Par, SepalLength, SepalWidth, PetalLength, PetalWidth FROM @InputData; // Predict Species @RScriptOutput = REDUCE @ExtendedData ON Par PRODUCE Par, fit double, lwr double, upr double READONLY Par USING new Extension.R.Reducer(scriptFile : "RClusterRun.usql.R", rReturnType : "dataframe", stringsAsFactors : false); OUTPUT @RScriptOutput TO @OutputFilePredictions USING Outputters.Tsv();
Right-click in USQL file, and then select ADL: Generate R Code Behind File.
The xxx.usql.r file is generated in your working folder. Write your code in R file. The following is a code sample.
load("my_model_LM_Iris.rda") outputToUSQL=data.frame(predict(lm.fit, inputFromUSQL, interval="confidence"))
Right-click in USQL file, you can click Compile Script or Submit Job to running job.
Develop C# file
A code-behind file is a C# file associated with a single U-SQL script. You can define a script dedicated to UDO, UDA, UDT, and UDF in the code-behind file. The UDO, UDA, UDT, and UDF can be used directly in the script without registering the assembly first. The code-behind file is put in the same folder as its peering U-SQL script file. If the script is named xxx.usql, the code-behind is named as xxx.usql.cs. If you manually delete the code-behind file, the code-behind feature is disabled for its associated U-SQL script. For more information about writing customer code for U-SQL script, see Writing and Using Custom Code in U-SQL: User-Defined Functions.
Click the New File in your workspace.
Write your code in U-SQL file. The following is a code sample.
@a = EXTRACT Iid int, Starts DateTime, Region string, Query string, DwellTime int, Results string, ClickedUrls string FROM @"/Samples/Data/SearchLog.tsv" USING Extractors.Tsv(); @d = SELECT DISTINCT Region FROM @a; @d1 = PROCESS @d PRODUCE Region string, Mkt string USING new USQLApplication_codebehind.MyProcessor(); OUTPUT @d1 TO @"/output/SearchLogtest.txt" USING Outputters.Tsv();
Right-click in USQL file, and then select ADL: Generate CS Code Behind File.
The xxx.usql.cs file is generated in your working folder. Write your code in CS file. The following is a code sample.
namespace USQLApplication_codebehind { [SqlUserDefinedProcessor] public class MyProcessor : IProcessor { public override IRow Process(IRow input, IUpdatableRow output) { output.Set(0, input.Get<string>(0)); output.Set(1, input.Get<string>(0)); return output.AsReadOnly(); } } }
Right-click in USQL file, you can click Compile Script or Submit Job to running job.
Next steps
- Use the Azure Data Lake Tools for Visual Studio Code
- U-SQL local run and local debug with Visual Studio Code
- Get started with Data Lake Analytics using the Azure portal
- Use Data Lake Tools for Visual Studio for developing U-SQL applications
- Use Data Lake Analytics(U-SQL) catalog
Feedback | https://docs.microsoft.com/en-us/azure/data-lake-analytics/data-lake-analytics-u-sql-develop-with-python-r-csharp-in-vscode | CC-MAIN-2019-47 | refinedweb | 831 | 60.01 |
After upgrading to System Center 2012 Configuration Manager Service Pack 1 or System Center 2012 R2 Configuration Manager, you may discover that the 'Add' and 'Remove' buttons for the Conditions in the Alerts tab of a device collection are grayed out, thus no new conditions can be created or existing conditions removed or modified.
This can occur if the CAS, the primary site and any secondary sites are not yet upgraded as well. Until the CAS, the primary site and any secondary sites are all upgraded, the setting in the Alert tab cannot be changed. This is by design.
NOTE When the Mode value of the WMI class SMS_Site is non-zero, editing of the Alerts tab of Device Collections will be disabled. This class is located in the WMI namespace root\sms\site_<sitecode>. Possible values in this field range from 0-7, with 0 being a site that is in the status of 'Normal'.
SiteStatus = 1 is the CAS or the site is in maintenance mode.
SiteStatus = 2 means the site is in recovery.
SiteStatus = 3 means the site is upgrading.
SiteStatus = 4 means the site is running an Evaluation license that has expired.
SiteStatus = 5 means the site is in expansion mode (attaching the primary to a new CAS).
SiteStatus = 6 or 7 means not all of the sites (CAS, primaries or secondaries) have been upgraded.
Larry Mosley | Senior:
greyed out | https://blogs.technet.microsoft.com/configurationmgr/2014/01/06/support-tip-cannot-add-or-remove-alerts-on-a-collection-after-upgrading-to-configmgr-2012-sp1-or-r2/ | CC-MAIN-2017-26 | refinedweb | 234 | 63.29 |
Dave Raggett [email protected].
These have been moved to the pending page, which includes all the suggestions for improvements and bug fixes. I am looking for volunteers to help with these as my current workload means that I don't get much time left to work on HTML Tidy..
Jacques Steyn says that Tidy doesn't know about the HTML4 char attribute for col elements. Now fixed..
Edward Zalta spotted that Tidy always removed newlines immediately after start tags even for empty elements such as img. An exception to this rule is the br element. Now fixed.
Edward Zalta sent me an example, where Tidy was inadvertently wrapping lines after an image element. The problem was a conditional in pprint.c, now fixed..
Fixed bug in NormalizeSpaces (== in place of =) on line 1699.
I have added a new config option "gnu-emacs" following a suggestion by David Biesack. The option changes the way errors and warnings are reported to make them easier for Emacs to parse..
Denis Barbier sent in details patches that suppresses numerous warnings when compiling tidy, especially:
Fixed memory leak in CoerceNode. My thanks to Daniel Persson for spotting this. Tapio Markula asked if Tidy could give improved detection of spurious </ in script elements. Now done.
My thanks to John Russell who pointed out that Tidy wasn't complaining about src attributes on hr elements. My thanks to Johann-Christian Hanke who spotted that Tidy didn't know about the Netscape wrap attribute for the text area element.
Sebastian Lange has contributed a perl wrapper for calling Tidy from your perl scripts, see sl-tidy
Henry Zrepa (sp?) reported that XHTML <param\> elements were being discarded. This was due to an error in ParseBlock, now fixed.
Carole E. Mah noted that Tidy doesn't complain if there are two or more title elements. Tidy will now complain if there are more than one title element or more than one base element.
Following a suggestion by Julian Reschke, I have added an option to add xml:space="preserve" to elements such as pre, style and script when generating XML. This is needed if these elements are to be correctly parsed without access to the DTD.
Randy Wacki notes that IsValidAttribute() wasn't checking that the first character in an attribute name is a letter. Now fixed.
Jelks Cabaniss wants the naked li style hack made into an option or at least tweaked to work in IE and Opera as well as Navigator. Sadly, even Navigator 6 preview 1 replicates the buggy CSS support for lists found in Navigator 4. Neither Navigator 6 nor IE5 (win32) supports the CSS marker-offset property, and so far I have been unable to find a safe way to replicate the visual rendering of naked li elements (ones without an enclosing ul or ol element). As a result I have opted for the safer approach of adding a class value to the generated ul element (class="noindent") to keep track of which li's weren't properly enclosed.
Rick Parsons would like to be able to use quote marks around file names which include spaces, when specifying files in the config file. Currently, this only effects the "error-file" option. I have changed that to use ParseString. You can specify error files with spaces in their names.
Karen Schlesinger would like tidy to avoid pruning empty span elements when these have id attributes, e.g. for use in setting the content later via the DOM. Done.
I have modified GetToken() to switch mode from IgnoreWhitespace to MixedContent when encountering non-white textual content. This solves a problem noticed by Murray Longmore, where Tidy was swallowing white space before an end tag, when the text is the first child of the body element.
Tidy needs to check for text as direct child of blockquote etc. which isn't allowed in HTML 4 strict. This could be implemented as a special check which or's in transitional into the version vector when appropriate.
ParseBlock now recognizes that text isn't allowed directly in the block content model for HTML strict. Furthermore, following a suggestion by Berend de Boer, a new option enclose-block-text has the same effect as enclose-text but also applies to any block element that allows mixed content for HTML transitional but not HTML strict.
Jany Quintard noted that Tidy didn't realise the width and height attribute aren't allowed on table cells in HTML strict (it's fine on HTML transitional). This is now fixed. Nigel Wadsworth wanted border on table without a value to be mapped into border="1". Tidy already does this but only if the output is XHTML.
Jelks Cabaniss wanted Tidy to check that a link to a external style sheet includes a type attribute. This is now done. He also suggested extending the clean operation to migrate presentation attributes on body to style rules. Done.
I have been working on improving the Word2000 cleanup, but have yet to figure out foolproof rules of thumb for recognizing when paragraphs should be included as part of ul or ol lists. Tidy recognizes the class "MsoListBullet" which Word seems to derive from the Word style named "List Bullet". I have yet to deal with nested lists in Word2000. This is something I was able to deal with for html exported from Word97, but it looks like being significantly harder to deal with for Word2000.
Tidy is now able to create a pre element for paragraphs with the style "Code". So try to use this style in your Word documents for preformatted text. Tidy strips out the p tags and coerces non-breaking spaces to regular spaces when assembling the pre element's content.
I would very much welcome any suggestions on how to make the Word2000 clean up work better!
Changed Style2Rule() in clean.c to check for an existing class attribute, and to append the new class after a space. Previously you got two class attributes which is an error
Changed default for add-xml-pi to no since this was causing serious problems for several browsers.
Joakim Holm notes that tidy crashes on ASP when used for attributes. The problem turned out to be caused by CheckUniqueAttribute() which was being inappropriate apply to ASP nodes.
John Bigby noted that Tidy didn't know about Microsoft's data binding feature. I have added the corresponding attributes to the table in attr.c and tweaked CanPrune() so that empty elements aren't deleted if they have attributes.
Tidy is now more sophistocated about how it treats nested <b>'s etc. It will prune redundant tags as needed. One difficulty is in knowing whether a start tag is a typo and should have been an end-tag or whether it starts a nested element. I can't think of a hard and fast rule for this. Tidy will coerce a <b> to </b> except when it is directly after a preceding <b>.
Bertilo Wennergren noted that Tidy lost <frame/> elements. This has now been fixed with a patch to ParseFrameSet.
Dave Bryan spotted an error in pprint.c which allowed some attributes to be wrapped even when wrap-attributes was set to no. On a separate point, I have now added a check to issue a warning if SYSTEM, PUBLIC, //W3C, //DTD or //EN are not in upper case.
Tidy now realises that inline content and text is not allowed as a direct child of body in HTML strict.
Dave Bryan also noticed that Tidy was preferring HTML 4.0 to 4.01 when doctype is set to strict or transitional, since the entries for 4.0 appeared earlier than those for 4.01 in the table named W3C_Version in lexer.c. I have reversed the order of the entries to correct this. Dave also spotted that ParseString() in config.c is erroneously calling NextProperty() even though it has already reached the end of the line.
I have added a new function ApparentVersion() which takes the doctype into account as well as other clues. This is now used to report the apparent version of the html in use.
Thanks to the encouragement of Denis Barbier, I finally got around to deal with the extra bracketing needed to quiet gcc -Wall. This involved the initialization of the tag, attribute and entity tables, and miscellaneous side-effecting while and for loops.
PPrintXMLTree has been updated so that it only inserts line breaks after start tags and before end tags for elements without mixed content. This brings Tidy into line with current wisdom for XML editors. My thanks to Eric Thorbjornsen for suggesting a fix to FindTag that ensures that Tidy doesn't mistreat elements looking like html.
<table border> is now converted to <table border="1"> when converting to XHTML.
I have added support for CDATA marked sections which are passed through without change, e.g.
<![CDATA[ .. markup here has no effect .. ]]>
A number of people were interested in Tidied documents be marked as such using a meta element. Tidy will now add the following to the head if not already present:
<meta name="generator" content="HTML Tidy, see">
If you don't want this added, set the option tidy-mark to no..
Johannes Zellner spotted that newly declared preformatted tags weren't being treated as such for XML documents. Now fixed.
Tidy now generates the XHTML namespace and system identifier as specified by the current XHTML Proposed Recommendation. In addition it now assumes the latest version of HTML4 - HTML 4.01. This fixes an omission in 4.0 by adding the name attribute to the img and form elements. This means that documents with rollovers and smart forms will now validate!
James Pickering noticed that Tidy was missing off the xhtml- prefix for the XHTML DTD file names in the system identifier on the doctype. This was a recent change to XHTML. I have fixed lexer.c to deal with this.
This release adds support for JSTE psuedo elements looking like: <# #>. Note that Tidy can't distinguish between ASP and JSTE for psuedo elements looking like: <% %>. Line wrapping of this syntax is inhibited by setting either the wrap-asp or wrap-jste options to no.
Thanks to Jacek Niedziela, The Win32 executable for tidy is now able to example wild cards in filenames. This utilizes the setargv library supplied with VC++.
Jonathan Adair asked for the hashtables to be cleared when emptied to avoid problems when running Tidy a second time, when Tidy is embedded in other code. I have applied this to FreeEntities(), FreeAttrTable(), FreeConfig(), and FreeTags().
Ian Davey spotted that Tidy wasn't deleting inline emphasis elements when these only contained whitespace (other than non-breaking spaces). This was due to an oversight in the CanPrune() function, now fixed..
I have fleshed out the table for mapping characters in the Windows Western character set into Unicode, see Win2Unicode[]. Yahoo was, for example, using the Windows Western character for bullet, which is in Unicode is U+2022.
David Halliday noticed that applets without any content between the start and end tags were being pruned by Tidy. This is a bug and has now been fixed..
Darren Forcier asked for a way to suppress fixing up of comments when these include adjacent hyphens since this was screwing up Cold Fusion's special comment syntax. The new option is called: fix-bad-comments and defaults to yes..
Richard Allsebrook would like to be able to map b/i to strong/em without the full clean process being invoked. I have therefore decoupled these two options. Note that setting logical-emphasis is also decoupled from drop-font-tags..
I have also added page transition effects for the slide maker feature. The effects are currently only visible on IE4 and above, and take advantage of the meta element. I will provide an option to select between a range of transition effects in the next release.
David Duffy found a case causing Tidy to loop indefinitely. The problem occurred when a blocklevel element is found within a list item that isn't enclosed in a ul or ol element. I have added a check to ParseList to prevent.
Emphasis start tags will now be coerced to end tags when the corresponding element is already open. For instance <u>...<u>. This behavior doesn't apply to font tags or start tags with attributes. My thanks to Luis M. Cruz for suggesting this idea..
Darren Forcier reports that Cold Fusion uses the following syntax:
<CFIF True IS True> This should always be output <CFELSE> This will never output </CFIF>
After declaring the CFIF tag in the config file, Tidy was screwing up the Cold Fusion expression syntax, mapping 'True' to 'True=""' etc. My fix was to leave such pseudo attributes untouched if they occur on user defined elements.
Jelks Cabaniss noticed that Tidy wasn't adding an id attribute to the map element when converting to XHTML. I have added routines to do this for both 'a' and 'map'. The value of the id attribute is taken from the name attribute..
A number of people have asked for a config option to set the alt attribute for images when missing. The alt-text property can now be used for this purpose. Please note that YOU are responsible for making your documents accessible to people who can't view the images!)
Change to table row parser so that when Tidy comes across an empty row, it inserts an empty cell rather than deleting it. This is consistent with browser behavior and avoids problems with cells that span rows.:
tidy --break-before-br true --show-warnings false
Kenichi Numata discovered that Tidy looped indefinitely for examples similar to the following:
<font size=+2>Title <ol> </font>Text </ol>
I have now cured this problem which used to occur when a </font> tag was placed at the beginning of a list element. If the example included a list item before the </ol> Tidy will now create the following markup:
<font size=+2>Title</font> <blockquote>Text </blockquote> <ol> <li>list item</li> </ol>
This uses blockquote to indent the text without the bullet/number and switches back to the ol list for the first true list item..
John Love-Jensen contribute a table for mapping the MacRoman character set into Unicode. I have added a new charset option "mac" to support this. Note the translation is one way and doesn't convert back to the Mac codes on output.><b><a href=foo>some text</i> which should be in the label</a></p> <p>next para and guess what the emphasis will be?<.
</br> is now mapped to <br> to match observed browser rendering. On the same basis, an unmatched </p> is mapped to <br><br>. This should improve fidelity of tidied files to the original rendering, subject to the limitations in the HTML standards described above.
I have fixed a bug on lexer.c which screwed up the removal of doctype elements. This bug was associated with the symptom of printing an indefinite number of doctype elements.
Added lowsrc and bgproperties attributes to attribute table. Rob Clark tells me that bgproperties="fixed" on the body elements causes NS and IE to fix the background relative to the window rather that the document's content.
Terry Teague kindly drew my attention to several bugs discovered by other people: My thanks to Randy Waki for discovering a bug when an unexpected inline end-tag is found in a ul or ol element. I have added new code to ParseList in parser.c to pop the inline stack and discard the end tag. I am checking to see whether a similar problem occurs elsewhere. Randy also discovered a bug (now fixed) in TrimInitialSpace() in parser.c which caused it to fail when the element was the first in the content. John Cumming found that comments cause problems in table row group elements such as tbody. I have fixed this oversight in this release.
Bjoern Hoehrmann tells me that bgsound is only allowed in the head and not in the body, according to the Microsoft documentation. I have therefore updated the entry in tags.c. The slide generation feature caused an exception when the original document didn't include a document type declaration. The fix involve setting the link to the parent node when creating the doctype node.
Jussi Vestman reported a bug in FixDocType in lexer.c which caused tidy to corrupt the parse tree, leading to an infinite loop. I independently spotted this and fixed it. Justin Farnsworth spotted that Tidy wasn't handling XML processing instructions which end in ?> rather than just > as specified by SGML. I have added a new option: assume-xml-procins: yes which when set to yes expects the XML style of processing instruction. It defaults to no, but is automatically set to yes for XML input. Justin notes that the XML PIs are used for a server preprocessor format called PHP, which will now be easy to handle with Tidy. Richard Allsebrook's mail prompted me to make sure that the contents of processing instructions are treated as CDATA so that < and > etc. are passed through unescaped.
Bill Sowers asks for Tidy to support another server preprocessor format called Tango which features syntax such as:
<b><@include <@cgi><appfilepath>includes/message.html></b>
I don't have time to add support for Tango in this release, but would be happy if someone else were to mail in appropriate changes. Darrell Bircsak reports problems when using DOS on Win98. I am using Win95 and have been unable to reproduce the problem. Jelks Cabaniss notes that Tidy doesn't support XML document type subset declarations. This is a documented shortcoming and needs to be fixed in the not too distant future. Tidy focuses on HTML, so this hasn't been a priority todate.
Jussi Vestman asks for an optional feature for mapping IP addresses to DNS hostnames and back again in URLs. Sadly, I don't expect to be able to do this for quite a while. Adding network support to Tidy would also allow it to check for bad URLs.
Ryan Youck reports that Tidy's behavior when finding a ul element when it expects an li start tag doesn't match Netscape or IE. I have confirmed this and have changed the code for parsing lists to append misplaced lists to the end of the previous list item. If a new list is found in place of the first list item, I now place it into a blockquote and move it before the start of the current list, so as to preserve the intended rendering.
I have added a new option - enclose-text which encloses any text it finds at the body level within p elements. This is very useful for curing problems with the margins when applying style sheets.
Added bgsound to tags.c. Added '_' to definition of namechars to match html4.decl. My thanks to Craig Horman for spotting this.
Jelks Cabaniss asked for the clean option to be automatically set when the drop-font-tags option is set. Jelks also notes that a lot of the authoring tools automatically generate, for example, <I> and <B> in place of <em> and <strong> (MS FrontPage 98 generated the latter, but FP2000 has reverted to the former - with no option to change or set it). Jelks suggested adding a general tag substitution mechanism. As a simpler measure for now, I have added a new property called logical-emphasis to the config file for replacing i by em and b by strong.
Fixed recent bug with escaping ampersands and plugged memory leaks following Terry Teagues suggestions. Changed IsValidAttrName() in lexer.c to test for namechars to allow - and : in names.
Chami noticed that the definition for the marquee tag was wrong. I have fixed the entry in tags.c and Tidy now works fine on the example he sent. To support mixing MathML with HTML I have added a new config option for declaring empty inline tags "new-empty-tags". Philip Riebold noted that single quote marks were being silently dropped unless quote marks was set to yes. This is an unfortunate bug recently introduced and now fixed.
Paul Smith sent in an example of badly formed tables, where paragraph elements occurred in table rows without enclosing table cells. Tidy was handling this by inserting a table cell. After comparison with Netscape and IE, I have revised the code for parsing table rows to move unexpected content to just before the table.
Tony Leneis reports that Tidy incorrectly thinks the table frame attribute is a transitional feature. Now fixed. Chami reported a bug in ParseIndent in config.c and that onsumbit is missing from the table of attributes. Both now fixed. Carsten Allefeld reports that Tidy doesn't know that the valign attribute was introduced in HTML 3.2 and is ok in HTML 4.0 strict, necessitating a trivial change to attrs.c.
Axel Kielhorn notes that Tidy wasn't checking the preamble for the DOCTYPE tag matches either "html PUBLIC" or "html SYSTEM". Bill Homer spotted changes needed for Tidy to compile with SGI MIPSpro C++. All of Bill's changes have been incorporated, except for the include file "unistd.h" (for the unlink call) which isn't available on win32. To include this define NEEDS_UNISTD_H
Bjoern Hoehrmann asked for information on how to use the result returned by Tidy when it exits. I have included a example using Perl that Bjoern sent in. Bodo Eing reported that Tidy gave misleading warning when title text is emphasized. It now reports a missing </title> before any unexpected markup.
Bruce Aron says that many WYSIWYG HTML editors place a font element around an hypertext link enclosing the anchor element rather that its contents. Unfortunately, the anchor element then overrides the color change specified by the font element! I have added an extra rule to ParseInline to move the font element inside an anchor when the anchor is the only child of the font element. Note CSS is a better long term solution, and Tidy can be used to replace font elements by style rules using the clean option.
Carsten Allefeld reported that valign on table cells caused Tidy to mislabel content as HTML 4.0 transitional rather than strict. Now fixed. A number of people said they expected the quote-mark option to apply to all text and not just to attribute values. I have obliged and changed the option accordingly.
Some people have wondered why "</" causes an error when present within scripts. The reason is that this substring is not permitted by the SGML and XML standards. Tidy now fixes this by inserting a backslash, changing the substring to "<\/". Note this is only done for JavaScript and not for other scripting languages.
Chami reported that onsubmit wasn't recognized by Tidy - now fixed. Chris Nappin drew my attention to the fact that script string literals in attributes weren't being wrapped correctly when QuoteMarks was set to no. Now fixed. Christian Zuckschwerdt asked for support for the POSIX long options format e.g. --help. I have modified tidy.c to support this for all the long options. I have kept support for -help and -clean etc.
Craig Horman sent in a routine for checking attribute names don't contain invalid characters, such as commas. I have used this to avoid spurious attribute/value pairs when a quotemark is misplaced. Darren Forcier is interested in wrapping Tidy up as a Win32 DLL. Darren asked for Tidy to release its memory resources for the various tables on exit. Now done, see DeInitTidy() in tidy.c
Darren also asks about the config file mechanism for declaring additional tags, e.g. new-blocklevel-tags: cfoutput, cfquery for use with Cold Fusion. You can add inline and blocklevel elements but as yet you can't add empty elements (similar to br or hr) or to change the content model for the table, ul, ol and dl elements. Note that the indent option applies to new elements in the same way as it does for built-in elements. Tidy will accept the following:
<cfquery name="MyQuery" datasource="Customer"> select CustomerName from foo where x > 1 </cfquery> <cfoutput query="MyQuery"> <table> <tr> <td>#CustomerName#</TD> </tr> </table> </cfoutput>
but the next example won't since you can't as yet modify the content model for the table element:
<cfquery name="MyQuery" datasource="Customer"> select CustomerName from foo where x > 1 </cfquery> <table> <cfoutput query="MyQuery"> <tr> <td>#CustomerName#</TD> </tr> </cfoutput> </table>
I have been studying richer ways to support modular extensions to html using assertions and a generalization of regular expressions to trees. This work has led a tool for generating DTDs named dtdgen and I am in the process of creating a further tool for verification. More information is available in my note on Assertion Grammars. Please contact me if you are interested in helping with this work. empty, i.e. has no content.
Betsy Miller reports: I tried printing the HTML Tidy page for a class I am teaching tomorrow on HTML, and everything in the "green" style (all of the examples) print in the smallest font I have ever seen (in fact they look like tiny little horizontal lines). Any explanation?..
Indrek Toom wants to know how to format tables so that tr elements indent their content, but td tags do not. The solution is to use indent: auto. omit, auto, strict, loose or a string specifying the fpi (formal public identifier)..
I have extended the support for the ASP preprocessing syntax to cope with the use of ASP within tags for attributes. I have also added a new option wrap-asp to the config file support to allow you to turn off wrapping within ASP code. Thanks to Ken Cox for this idea..
The new property indent-attributes.
Steffen Ullrich and Andy Quick both spotted a problem with attribute values consisting of an empty string, e.g. alt="". This was caused by bugs in tidy.c and in lexer.c, both now fixed. Jussi Vestman noted Tidy had problems with hr elements within headings. This appears to be an old bug that came back to life! Now fixed. Jussi also asked for a config file option for fixing URLs where non-conforming tools have used backslash instead of forward slash.
An example from Thomas Wolff allowed me to the idea of inserting the appropriate container elements for naked list items when these appear in block level elements. At the same time I have fixed a bug in the table code to infer implicit table rows for text occurring within row group elements such as thead and tbody. An example sent in by Steve Lee allowed me to pin point an endless loop when a head or body element is unexpectedly found in a table cell.
Another minor release. Jacob Sparre Andersen reports a bug with " in attribute values. Now fixed. Francisco Guardiola reports problems when a body element follows the frameset end tag. I have fixed this with a patch to ParseHTML, ParseNoFrames and ParseFrameset in parser.c Chris Nappin wrote in with the suggestion for a config file option for enabling wrapping script attributes within embedded string literals. You can now do this using "wrap-script-strings: yes".
Added check for Asp tags on line 2674 in parser.c so that Asp tags are not forcibly moved inside an HTML element. My thanks to Stuart Updegrave for this. Fixed problem with & entities. Bede McCall spotted that & was being written out as &. The fix alters ParseEntity() in lexer.c
Added a missing "else" on line 241 in config.c (thanks for Keith Blakemore-Noble for spotting this). Added config.c and .o to the Makefile (an oversight in the release on the 8th April).
All the message text is now defined in localize.c which should make it a tad easier to localize Tidy for different languages.
I have added support for configuring tidy via a configuration file. The new code is in config.h which provides a table driven parser for RFC822 style headers. The new command line option -config <filename> can be used to identify the config file. The environment variable "HTML_TIDY" may be used to name the config file. If defined, it is parsed before scanning the command line. You are advised to use an absolute path for the variable to avoid problems when running tidy in different directories.
Reports that the XML DOM parser by Eduard Derksen screws up on , naked & and % in URLs as well as having problems with newlines after the '=' before attribute values.
I have tweaked PrintChar when generating XML to output in place of and & in place of &. In general XHTML when parsed as well-formed XML shouldn't use named entities other than those defined in XML 1.0. Note that this isn't a problem if the parser uses the XHTML DTDs which import the entity definitions.
When tidy encounter entities without a terminating semi-colon (e.g. "©") then it correctly outputs "©", but it doesn't report an error.
I have added a ReportEntityError procedure to localize.c and updated ParseEntity to call this for missing semicolons and unknown entities.
Tidy warns if table element is missing. This is incorrect for HTML 3.2 which doesn't define this attribute.
The summary attribute was introduced in HTML 4.0 as an aid for accessibility. I have modified CheckTABLE to suppress the warning when the document type explicitly designates the document as being HTML 2.0 or HTML 3.2.
I have renamed the field from class to tag_class as "class" is a reserved word in C++ with the goal of allowing tidy to be compiled as C++ e.g. when part of a larger program.
I have switched to Bool and the values yes and no to avoid problems with detecting which compilers define bool and those that don't.
Andy would prefer a return code or C++ exception rather than an exit. I have removed the calls to exit from pprint.c and used a long jump from FatalError() back to main() followed by returning 2. It should be easy to adapt this to generate a C++ exception.
Sometimes the prev links are inconsistent with next links. I have fixed some tree operations which might have caused this. Let me know if any inconsistencies remain.
Would like to be able to use:
tidy file.html | more
to pause the screen output, and/or full output passing to file as with
tidy file.html > output.txt
Tidy writes markup to stdout and errors to stderr. 'More' only works for stdout so that the errors fly by. My compromise is to write errors to stdout when the markup is suppressed using the command line option -e or "markup: no" in the config file.
Writes asking for a single output routine for Tidy. Acting on his suggestion, I have added a new routine tidy_out() which should make it easier to embed HTML Tidy in a GUI application such as HTML-Kit. The new routine is in localize.c. All input takes place via ReadCharFromStream() in tidy.c, excepting command line arguments and the new config file mechanism.
Chami also asks for single routines for initializing and de-initializing Tidy, something that happens often from the GUI environment of HTML-Kit. I have added InitTidy() and DeInitTidy() in tidy.c to try to satisfy this need. Chami now supports an online interface for Tidy at the URL:.
Reports a problem when generating XML using -iso2022. Tidy inserts ?/p< rather than </p>. I tried Chang's test file but it worked fine with in all the right places. Please let me know if this problem persists.
When using -indent option Tidy emits a newline before which alters the layout of some tables..
Christian also reports that <td><hr/></td> caused Tidy to discard the <hr/> element. I have fixed the associated bug in ParseBlock.
Points out that an isolated & is converted to & in element content and in attribute values. This is in fact correct and in agreement with the recommendations for HTML 2.0 onwards.
Reports that Tidy loops indefinitely if a naked LI is found in a table cell. I have patched ParseBlock to fix this, and now successfully deal with naked list items appearing in table cells, clothing them in a ul.
Reports that Tidy gets confused by </comment> before the doctype. This is apparently inserted by some authoring tool or other. I have patched Tidy to safely recover from the unrecognized and unexpected end tag without moving the parse state into the head or body.().
Would love a version of Tidy written in Java. This is a big job. I am working on a completely new implementation of Tidy, this time using an object-oriented approach but I don't expect to have this done until later this year. DEFERRED
Reports that when tidying an XMLfile with characters above 127 Tidy is outputting the numeric entity followed by the character. I have fixed this by a patch to PPrintChar() for XmlTags.
Reports that Tidy thinks an ol list is HTML 4.0 when you use the type attribute. I have fixed an error in attrs.c to correct this feature to first appearing in HTML 3.2.
Reported problems when using comments to hide the contents of script elements from ancient browsers. I wasn't able to reproduce the problem, and guess I fixed it earlier.
Drew also reported a problem which on further investigation is caused by the very weird syntax for comments in SGML and XML. The syntax for comments is really error prone:
<!--[text excluding --]--[[whitespace]*--[text excluding --]--]*>?
Like a number of others would like list items and table cells to be output compactly where possible. I have added a flag to avoid indentation of content to tags.c that avoids further indentation when the content is inline, e.g.
<ul> <li>some text</li> <li> <p> a new paragraph </p> </li> </ul>
This behavior is enabled via "smart-indent: yes" and overrides "indent: no". Use "indent-spaces: 5" to set the number of spaces used for each level of indentation.
Has a few suggestions that will make Tidy work with XSL. Thanks, I have incorporated all of them into the new release.!).
One thing I can satisfy right away is a mailing list for Tidy. [email protected] has been created for discussing Tidy and I have placed the details for subscribing and accessing the Web archive on the Tidy overview page.
Reports that Tidy isn't quite right about when it reports the doctype as inconsistent or not. I have tweaked HTMLVersion() to fix this. Let me know if any further problems arise..
Notes that dir and menu are deprecated and not allowed in HTML4 strict. I have updated the entry in the tags table for these two. I also now coerce them automatically to ul when -clean is set..
Found that Tidy is confused by map elements in the head. Tidy knows that map is only allowed in the body and thinks the author has left out.
Reports that Tidy caused JavaScript errors when it introduced linebreaks in JavaScript attributes. Tidy goes to some efforts to avoid this and I am interested in any reports of further problems with the new release.
Would like Tidy to warn when a tag has an extra quote mark, as in <a href="xxxxxx"">. I have patched ParseAttribute to do.
Reports that Tidy sometimes wraps text within markup that occurs in the context of a pre element. I am only able to repeat this when the markup wraps within start tags, e.g. between attribute values. This is perfectly legitimate and doesn't effect rendering.
Notes that Tidy doesn't remove entities such as or © which aren't defined by XML 1.0. That is true - these entities.
Comments that he would like Tidy to replace naked & in URLs by &. You can now use "quote-ampersands: yes" in the config file to ensure this. Note that this is always done when outputting to XML where naked '&' characters are illegal.
Steven also asks for a way to allow Tidy to proceed after finding unknown elements. The issue is how to parse them, e.g. to treat them as inline or block level elements? The latter would terminate the current paragraph whereas the former would.
You can now declare new inline and block-level tags in the config file, e.g.:
define-inline-tags: foo, bar define-blocklevel-tags: blob.
Stuart is also interested in having Tidy reading from and writing back to the Windows clipboard. This sounds interesting but I have to leave this to a future release.
Points out that Tidy doesn't like "top" or "bottom" for the align attribute on the caption element. I have added a new routine to check the align attribute for the caption element and cleaned up the code for checking the document type..
Xavier wonders whether name attributes should be replaced or supplemented by id attributes when translating HTML anchors to XHTML. This is something I am thinking about for a future release along with supplementing lang attributes by xml:lang attributes.
Asks for headings and paragraphs to be treated specially when other tags are indented. I have dealt with this via the new smart-indent mechanism.!
Tidy no longer complains about a missing </tr> before a <tbody>. Added link to a free win32 GUI for tidy.
Added a link to the OS/2 distribution of Tidy made available by Kaz SHiMZ. No changes to Tidy's source code.
Fixed bug in ParseBlock that resulted in nested table cells.
Fixed clean.c to add the style property "text-align:" rather than "align:".
Disabled line wrapping within HTML alt, content and value attribute values. Wrapping will still occur when output as XML..
Rewrote parser for elements with CDATA content to fix problems with tags in script content.
New pretty printer for XML mode. I have also modified the XML parser to recognize xml:space attributes appropriately. I have yet to add support for CDATA marked sections though.
script and noscript are now allowed in inline content.
To make it easier to drive tidy from scripts, it now returns 2 if any errors are found, 1 if any warnings are found, otherwise it returns 0. Note tidy doesn't generate the cleaned up markup if it finds errors other than warnings.
Fixed bug causing the column to be reported incorrectly when there are inline tags early on the same line.
Added -numeric option to force character entities to be written as numeric rather than as named character entities. Hexadecimal character entities are never generated since Netscape 4 doesn't support them.
Entities which aren't part of HTML 4.0 are now passed through unchanged, e.g. &precompiler-entity; This means that an isolated & will be pass through unchanged since there is no way to distinguish this from an unknown entity.
Tidy now detects malformed comments, where something other than whitespace or '--' is found when '>' is expected at the end of a comment.
The <br> tags are now positioned at the start of a blank line to make their presence easier to spot.
The -asxml mode now inserts the appropriate Voyager html namespace on the html element and strips the doctype. The html namespace will be usable for rigorous validation as soon as W3C finishes work on formalizing the definition of document profiles, see: WD-html-in-xml.
Fixed bug wherein <style type=text/css> was written out as <style type="text/ss">.
Tidy now handles wrapping of attributes containing JavaScript text strings, inserting the line continuation marker as needed, for instance:
onmouseover="window.status='Mission Statement, \ Our goals and why they matter.'; return true"
You can now set the wrap margin with the -wrap option.
When the output is XML, tidy now ensures the content starts with <?xml version="1.0"?>.
The Document type for HTML 2.0 is now "-//IETF//DTD HTML 2.0//". In previous versions of tidy, it was incorrectly set to "-//W3C//DTD HTML 2.0//".
When using the -clean option isolated FONT elements are now mapped to SPAN elements. Previously these FONT elements were simply dropped.
NOFRAMES now works fine with BODY element in frameset documents. | http://www.w3.org/People/Raggett/tidy/release-notes.html | crawl-002 | refinedweb | 6,758 | 65.32 |
Is there a way to pass an argument from a class into an array individually (I am not sure how to word it correctly so let me try it with an example).
Suppose I have a class named
Lab and from this class there is an instance variable named
grade with a getter and setter. Also, there is an array.
public class Lab { private double grade; private double[] array = new double[10]; public void setGrade(double grade) { //sets grades for lab reports } public double getGrade() { return grade; }
Now, from a main class called
Teacher I want to call lab and pass students grades into
setGrade individually and for each grade passed into the parameter I want those grades to be placed in an array so that in a later class (that I will create) I can retrieve those lab grades.
Scanner input was my first thought but I was just wondering if there is another way to do this using getters, setters, constructors, etc. | http://www.howtobuildsoftware.com/index.php/how-do/UUq/java-parameters-setters-and-getters | CC-MAIN-2018-13 | refinedweb | 164 | 55.51 |
#include "llvm/ExecutionEngine/Orc/OrcABISupport.h"
I386 support.
I386 supports lazy JITing.
Definition at line 208 of file OrcABISupport.h.
Definition at line 214 of file OrcABISupport.h.
Definition at line 217 of file OrcABISupport.h.
Emit at least MinStubs worth of indirect call stubs, rounded out to the nearest page size.
E.g. Asking for 4 stubs on i386, where stubs are 8-bytes, with 4k pages will return a block of 512 stubs (4096 / 8 = 512). Asking for 513 will return a block of 1024 (2-pages worth).
Definition at line 475 415 of file OrcABISupport.cpp.
Write the requsted number of trampolines into the given memory, which must be big enough to hold 1 pointer, plus NumTrampolines trampolines.
Definition at line 462 of file OrcABISupport.cpp.
References I, and llvm::orc::OrcAArch64::TrampolineSize.
Definition at line 210 of file OrcABISupport.h.
Definition at line 212 of file OrcABISupport.h.
Definition at line 211 of file OrcABISupport.h. | http://www.llvm.org/doxygen/classllvm_1_1orc_1_1OrcI386.html | CC-MAIN-2019-35 | refinedweb | 160 | 61.83 |
1234567891011121314151617181920
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
using namespace std;
#define K 2000
void main(){
char array2[z]={"A gentle, dull flickering flame, burns in the marble hearth.\
Its dim light scarcely illuminates the small, cozy room with its\
The dismal light plays softly causing shadows over the solitary \
figure of a wooden desk at which Allen was roaming through his \
memories. Thinking back in the past where he once had a\
friendship which was out righteously incredible. \
She was the girl of his dreams, in a way which she \
had everything he had ever sought out in a beautiful and clever girl.\
Most of all she had his heart. Her style was incredible in the way\
the outfits she would wear would match perfectly\
giving a deep vibrant lively feeling."};
c 6
c
6
Twinkle Twinkle little star,
How I wonder what you are,
Up above the world so high,
Like a diamond in the sky,
Twinkle twinkle little star,
How I wonder what you are! | http://www.cplusplus.com/forum/general/128996/ | CC-MAIN-2015-32 | refinedweb | 169 | 64.14 |
So far, we’ve seen how to make basic visualizations related to the corona virus and how to look at the disease progression on the map. Be sure to check them out first, before delving into this one.
We are now heading towards somewhat more advanced visualizations that let us observe trends in the data. Just as a heads up: your results may be different, depending on the day you downloaded the data. We are working with confirmed cases up to April 13, on the previously mentioned data from the John Hopkins University.
Prerequisite: Timeseries add-on
The spread of the virus is influenced by many factors, time being one of them. Timeseries add-on specializes in manipulation of time-related data. If you followed our blogs, you should already have it installed. If you don’t, just take a peek in the second one.
Formatting the data As Timeseries
We’ll load our data as usual with the File widget. The data contains latitude and longitude columns, which are just getting in the way in our further analysis. We will use Select Columns to put them into meta columns and thus exclude them from any calculations. Then we’ll select some countries we are interested in with the help of the Data Table. You could also do it straight after inspecting the data in Geo Map.
Now we just need to tell Orange, which variable contains time stamps. Our dates are represented as columns instead of as rows, so we’ll use Transpose widget to make each row represent a datum and then connect it to As Timeseries Widget. In Transpose, we set the variable whose values will be used to name the rows when they are turned into columns. We’ll name them by the column Country, as shown in the image, since the Province field is mostly empty. In As Timeseries, we set sequence as implied by instance order.
Here is our chain of widgets. We should now be ready to start making some plots. Phew.
Line Chart and log plot
Make sure you’ve selected countries you are interested in the Data Table. I’ve chosen Italy, US, Iran, France and Chinese province Hubei. Then, connect As Timeseries widget and Line Chart and let’s get plotting. Once in Line Chart, we can select multiple countries by clicking Ctrl/Cmd and draw them on the same axis or we could compare multiple plots by clicking on Add plot.
Here, we see how the virus started its path in China, where the number of cases quickly rose but has since then stayed level. Other countries were hit later on. The slopes of the curves tell us how fast the numbers are growing, but more on that later. One thing to notice though: due to the fast growth of the virus in some countries, some smaller slopes are almost invisible. We can remedy that by checking the Logarithmic axis box just like this:
We can now see the first steps as well as the current situation.
Python Script
We can see from these plots, that different countries came into contact with the virus at different times. It seems it would be much easier to compare the curves if all of them started their climb at the same time. We can do that with just a few lines of code. Example snippet here aligns the curves with the moment where the country recorded 100 cases. You can set n to any other (positive) number if you will, though.
import numpy as np from copy import deepcopy n = 100 out_data = deepcopy(in_data) out_data.X[out_data.X < n] = 0 ar = np.argwhere(out_data.X) cols, shifts = np.unique(ar[:, 1], return_counts=True) out_data.X = np.array([np.roll(out_data.X[:, col], shift) for col, shift in zip(cols, shifts)]).T out_data.X[out_data.X==0]= np.nan
Copy these lines into Python Script widget, and plug it into our initial snake of widgets like so:
Look at the aligned curves now, they are much easier to compare.
Absolute growth with derivative
Let’s take a look at how fast the confirmed cases are spreading. Connect As Timeseries with Difference widget, choose Differencing and select countries of interest. Differencing order of 1 means we’ll be looking at derivative of first order, which just means daily change in our case. We’ll leave shift as is, on 1.
Again, we’ll view the transformed curves in Line Chart. Notice how the difference (and every other) transform adds a new column? That means we can compare our curves in different states, so be sure to always check what is being shown. For starters, try looking at, for example, China and its transformed version. See how easy it is to spot the daily spikes that are perhaps out of the ordinary and need to be checked? The most prominent spike here is probably due to the change in counting.
If we again compare multiple countries, we notice the US’s speedy climb and Iran seemingly being more successful in curbing the growth.
The difference could be only due to the difference in population and what is an overwhelmingly large number of patients for one country might be almost business as usual for another one.
Scale free growth with quotient
Difference widget also has the option to output the quotients. It will allow us to observe the relative growth and compare countries directly.
Let’s look at, for example, China (Hubei province) vs France.
It seems China is doing worse in the beginning and better later on, but it is impossible to tell at which point the trends start to shift. There are just too many jumps, due to noise in testing and reporting. So for our final step, let’s smooth things out.
Moving transform and smoothing
Smoothing is usually a part of preprocessing, so insert the Moving Transform widget between As Timeseries and Difference, and add some moving average transforms, like this:
Selecting now smoothened China and the France data in Difference widget, yields the following plot in Line Chart:
The trends now seem clearer. The countries have somewhat similar trends up to 15th day, when China’s growth falls decisively below the French.
Quotient plot obviously benefited from smoothing, as did the difference plot. For completeness, we added another Difference widget after Moving Transform, and plotted now smoothed difference between the two countries. Notice how the turning point is now seemingly further down the line. Orange prides itself on interactivity, so just by sliding the mouse over the plot, we get the exact information regarding the days and counts. The turning point seems to be on the 25th day.
This blog concludes our Corona virus series for now. Until our next blog, stay safe.! | https://orange.biolab.si/blog/2020/2020-04-15-covid-19-part-3/ | CC-MAIN-2020-40 | refinedweb | 1,132 | 72.16 |
While on a quest to learn how to build some of the most commonly requested animations by designers, the loading spinner seems like a rite of passage.
This time around, I wanted to see if I could use the awesome power of svgs to draw out a circle then animate that circle. This could be a lot cleaner than attempting to animate borders or place rotating circles on top of other circles in CSS.
We will be building today's spinner here with React. Thinking in terms of states, there are two main ones. We are either:
- Waiting for something - show the spinner
- That something has happened - no longer show the spinner
To make this feel more realistic, we will have the spinner wait for a response from the Fetch api. There are plenty of open apis for us to request from for the sake of this tutorial.
Take a look at the set up for our component.
import React, { useState, useEffect } from 'react'; import './Loading.scss'; export const Loading = () => { const [loading, hasLoaded] = useState(false); useEffect(() => { const timer = setTimeout(() => { fetch(' .then((response) => response.json()) .then((json) => { hasLoaded(true); }); }, 1100); return () => clearTimeout(timer); }, []); return ( <div className="spinner-container"> {loading ? ( <p>Content has loaded!</p> ) : ( <svg className="spinner" role="alert" aria- <circle cx="30" cy="30" r="20" className="circle" /> </svg> )} </div> ); };
Let's walk through what's going on here.
- First, we set up the two states I mentioned at the beginning. The only two states the spinner can be in: either we are waiting for something to happen, or it has already happened. A simple boolean does the trick.
- The handy
useEffecthook is where we can handle what it is that we're waiting for. It's likely you'll be waiting for some data to return, so I've set up a sample fetch request. You may also notice I have it wrapped inside of a
setTimeout. This is because the information comes far too fast for us to see the spinner in action, so for the purposes of delaying our response I've added a
setTimeoutthat you're welcome to adjust in order to see the spinner for longer. I have it set to 1100 milliseconds so that we can see the spinner for at least a second. In reality, you might not need a
setTimeoutsince the data you'll be requesting will likely take it's own time.
- In the return of the
useEffect, I clean up the
setTimeoutlike the responsible developer I am. 😇
- Now for the actual component. We have one
divthat holds everything. Inside, we set our two states: If the content has loaded already, print something that tells us this. If the content has not yet loaded, this is where we render our animated spinner.
- The spinner is a simple
circletag wrapped inside of an
svgtag. We define some attributes like height and width, as well as those that will make it accessible like
aria-liveand
role.
Ok! We have the skeleton of a spinner. But, there's nothing to see yet. The styles are where the actual magic happens. Let's take a look at them:
.spinner-container { .spinner { transform: rotate(-90deg); width: 60px; height: 60px; .circle { stroke-linecap: round; stroke-dasharray: 360; stroke-width: 6; stroke: blue; fill: transparent; animation: spin .6s ease-in-out 0s normal infinite; } } @keyframes spin { from { stroke-dashoffset: 360; } to { stroke-dashoffset: 40; } } }
Now, let's walk through the styles.
- We have the
.spinner-containerwrapped around everything. Pretty straightforward.
- The
svggets a class of
.spinnerwith height and width specified as well as the rotation that will occur while being animated.
- The
.circleclass is where I first define some stylistic qualities to the actual circle and then the
animationproperty is the key to it's movement. I set it to be the keyframe animation named
spin, which is simply pulling the filling of the circle forward.
Here is what it all looks like in action. Be sure to hit the 'rerun' button on the bottom right.
Voila! Just a few lines of scss to make the spinner come to life. Years ago before I knew this handy tactic of manipulating and animating the fill of svgs, I had built a different spinner. It used bulky, confusing styles to make the drawing of the border for a circle div seem fluid.
Makes you question coding patterns you might be unconsciously following now that could be done more efficiently. 🤔
Discussion (0) | https://dev.to/singhshemona/how-to-animate-an-svg-into-a-loading-spinner-4g40 | CC-MAIN-2022-21 | refinedweb | 741 | 65.22 |
I was recently playing around with some loan data and only happened to have the term (or length, or duration) of the loan, the amount of the recurring payment (in this case monthly) and the remaining principal owed on the loan. I figured there was an easy way to get at the interest rate, but wasn't sure how. After some badgering from my coworker +Paul, I searched the web and found a tool from CALCAmo (a site just for calculating amortizations).
Problem solved, right? Wrong. I wanted to know why; I had to go deeper. So I did a bit of math and a bit of programming and I was where I needed to be. I'll break the following down into parts before going on full steam.
- Break down the amortization schedule in terms of the variables we have and the one we want
- Determine a function we want to find zeros of
- Write some code to implement the Newton-Raphson method
- Utilize the Newton-Raphson code to find an interest rate
- Bonus: Analyze the function to make sure we are right
Step I: Break Down the Amortization Schedule
We can do this using the series of principal owed, which varies over time and will go to zero once paid off. In this series, is the principal owed currently and is the principal owed after payments have been made. (Assuming monthly payments, this will be after months.) If the term is periods, then we have .
We have already introduced the term (); we also need the value of the recurring (again, usually monthly) payment , the interest rate and the initial principal owed .
Time-Relationship between Principal Values
If after periods, is owed, then after one period has elapsed, we will owe where is some multiplier based on the length of the term. For example if each period is one month, then we divide our rate by for the interest and add to note that we are adding to existing principal:
In addition to the interest, we will have paid off hence
Formula for
Using this, we can actually determine strictly in terms of and . First, note that
since . We can show inductively that
We already have the base case , by definition. Assuming it holds for , we see that
and our induction is complete. (We bump the index since we are multiplying each by .) Each term in the series is related to the previous one (except , since time can't be negative in this case).
Step II: Determine a Function we want to find Zeros of
Since we know and , we actually have a polynomial in place that will let us solve for and in so doing, solve for .
To make our lives a tad easier, we'll do some rearranging. First, note that
We calculate this sum of a geometric series here, but I'll just refer you to the Wikipedia page instead. With this reduction we want to solve
With that, we have accomplished Step II, we have found a function (parameterized by and which we can use zeros from to find our interest rate:
Step III: Write some code to implement the Newton-Raphson method
We use the Newton-Raphson method to get super-duper-close to a zero of the function.For in-depth coverage, see the Wikipedia page on the Newton-Raphson method, but I'll give some cursory coverage below. The methods used to show that a fixed point is found are not necessary for the intuition behind the method.
Intuition behind the method
For the intuition, assume we know (and can compute) a function , its derivative at a value . Assume there is some zero nearby . Since they are close, we can approximate the slope of the line between the points and with the derivative nearby. Since we know , we use and intuit that
But, since we know that is a zero, hence
Using this method, one can start with a given value and compute better and better approximations of a zero via the iteration above that determines . We use a sequence to do so:
and stop calculating the either after is below a preset threshold or after the fineness of the approximation goes below a (likely different) preset threshold. Again, there is much that can be said about these approximations, but we are trying to accomplish things today, not theorize.
Programming Newton-Raphson
To perform Newton-Raphson, we'll implement a Python function that takes the initial guess () and the functions and . We'll also (arbitrarily) stop after the value drops below in absolute value.
def newton_raphson_method(guess, f, f_prime): def next_value(value): return value - f(value)*1.0/f_prime(value) current = guess while abs(f(current)) > 10**(-8): current = next_value(current) return current
As you can see, once we have
f and
f_prime, everything else is easy
because all the work in calculating the next value (via
next_value)
is done by the functions.
Step IV: Utilize the Newton-Raphson code to find an Interest Rate
We first need to implement and in Python. Before doing so, we do a simple derivative calculation:
With these formulae in
hand, we write a function which will spit out the corresponding
f
and
f_prime given the parameters (
principal),
(
term) and (
payment):
def generate_polynomials(principal, term, payment): def f(m): return (principal*(m**(term + 1)) - (principal + payment)*(m**term) + payment) def f_prime(m): return (principal*(term + 1)*(m**term) - (principal + payment)*term*(m**(term - 1))) return (f, f_prime)
Note that these functions only take a single argument (
m), but we are able
to use the other parameters from the parent scope beyond the life of the call
to
generate_polynomials due to
closure in Python.
In order to solve, we need an initial
guess, but we need to know the
relationship between and before
we can determine what sort of
guessmakes sense. In addition, once a value for
is returned from Newton-Raphson, we need to be able to
turn it into an value so functions
m and
m_inverse
should be implemented. For our dummy case here, we'll assume monthly
payments (and compounding):
def m(r): return 1 + r/12.0 def m_inverse(m_value): return 12.0*(m_value - 1)
Using these, and assuming that an interest rate of 10% is a good guess, we can put all the pieces together:
def solve_for_interest_rate(principal, term, payment, m, m_inverse): f, f_prime = generate_polynomials(principal, term, payment) guess_m = m(0.10) # ten percent as a decimal m_value = newton_raphson_method(guess_m, f, f_prime) return m_inverse(m_value)
To check that this makes sense, let's plug in some values. Using the bankrate.com loan calculator, if we have a 30-year loan (with months of payments) of $100,000 with an interest rate of 7%, the monthly payment would be $665.30. Plugging this into our pipeline:
>>> principal = 100000 >>> term = 360 >>> payment = 665.30 >>> solve_for_interest_rate(principal, term, payment, m, m_inverse) 0.0699996284703
And we see the rate of 7% is approximated quite well!
Bonus: Analyze the function to make sure we are right
Coming soon. We will analyze the derivative and concavity to make sure that our guess yield the correct (and unique) zero. | https://blog.bossylobster.com/2012/05/reverse-calculating-interest-rate | CC-MAIN-2017-26 | refinedweb | 1,190 | 57.1 |
Previously Robert van der Meulen wrote: > For the swapping part, you can use 'pivot_root', in the newer util-linux > distributions. As far as i know, pivot_root is not in the debian version > yet. It has been added in version 2.11b-2. For those of you running testing or stable I've attached a little pivot_root implementation I wrote for personal use a while ago. > A 'pivot_root . /tmp', when executed in /tmp will leave you with a /dev/sda5 > on /tmp, and /dev/sda9 on /. More importantly, it will also change the cwd for processes that had cwd set to root to the new root so you can safely unmount it. > I use this to mount a reiserfs root-filesystem on an lvm volume. Same |
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/syscall.h> void usage() { fprintf(stderr, "Usage:\n" " pivotroot <newroot> <oldroot>\n" "\n" "This will make <newroot> the new root filesystem and remount\n" "the old one at <oldroot>.\n"); } int main(int argc, char** argv) { int res; if (argc!=3) { fprintf(stderr, "Invalid number of arguments\n"); usage(); exit(1); } if ((res=syscall(SYS_pivot_root, argv[1], argv[2]))==-1) { perror("Error pivoting root"); exit(2); } else if (res!=0) { fprintf(stderr, "pivot_root failed with return code %d\n", res); exit(3); } return 0; } | https://lists.debian.org/debian-devel/2001/04/msg00971.html | CC-MAIN-2015-35 | refinedweb | 220 | 67.25 |
Hi All,
From within netbeans I can't compile the example code listed here:
Writing Simple JMS Client Applications
I get the error:
D:\PhD\My Development\development\JMS Example\src\SimpleTopicPublisher.java:50: package javax.jms does not exist
import javax.jms.*;
I get that the compiler can't locate the JMS file, but to my understanding the JMS file should be part of the JDK that I downloaded.
I get the high level stuff on how Pub/Sub works as I've written equivalent stuff in C++, I just can't figure out how to get JAVA to behave.
Any help extremely welcome.
Darryl | http://www.javaprogrammingforums.com/whats-wrong-my-code/9550-jms-example-netbeans-%3D-wont-compile.html | CC-MAIN-2017-47 | refinedweb | 106 | 56.05 |
Investors considering a purchase of Perficient Inc. (Symbol: PRFT) stock, but cautious about paying the going market price of $17.27/share, might benefit from considering selling puts among the alternative strategies at their disposal. One interesting put contract in particular, is the October put at the $15 strike, which has a bid at the time of this writing of $1.20. Collecting that bid as the premium represents a 8% return against the $15 commitment, or a 15.1% annualized rate of return (at Stock Options Channel we call this the YieldBoost ).
Selling a put does not give an investor access to PRFT Perficient Inc. sees its shares decline 13.5% and the contract is exercised (resulting in a cost basis of $13.80 per share before broker commissions, subtracting the $1.20 from $15), the only upside to the put seller is from collecting that premium for the 15.1% annualized rate of return.
Below is a chart showing the trailing twelve month trading history for Perficient Inc., and highlighting in green where the $15 strike is located relative to that history:. | https://www.nasdaq.com/articles/commit-purchase-perficient-15-earn-151-annualized-using-options-2014-04-07 | CC-MAIN-2021-25 | refinedweb | 184 | 67.15 |
This is for an App written in Python/PyQT...
I defined a double click event on a user created control (a cell of a QTable object).
But when I double click on it - it is sometimes responsive and brings up a sub-form on that event (as defined by a SLOT), sometimes it doesn't seem to react at all.
It seems very unpredictable. I have tried with slow taps, fast taps etc, but on the zaurus its just not predictable while on the desktop the same app behaves perfectly).
Any reasons for it, or any workarounds ???
Code snippets-----------------------------------------------
def mouseDoubleClickEvent(self, ev):
# --- dblClick event passes the currentIndex of widget dblclicked
curr_Idx = (self.currIndex(),)
self.emit(PYSIGNAL('dblClicked()'),curr_Idx)
and in the SIGNAL/SLOTS I defined
self.cControl.connect(self.cControl,PYSIGNAL('dblClicked()'),self.doDblClickSelect)
where self.DblClickSelect is a function to be called on double click. | http://www.oesf.org/forum/lofiversion/index.php/t14174.html | CC-MAIN-2018-17 | refinedweb | 147 | 58.48 |
Input is difficult because the world can make it happen at any time and you have to be ready for it. Simple input isn't so simple. This is an extract from our book all about the Raspberry Pi Pico in MicroPython.
Buy from Amazon.
<ASIN:1871962692>
<ASIN:B09522FQRY>
<ASIN:1871962684>
<ASIN:B093LT5W54>, you have no idea what your program is doing relative to the event you are trying to capture. Welcome to the world of input.
In this chapter we look at the simplest approach to input – the polling loop. This may be simple, but it is a good way to approach many tasks. In Chapter 8 we look at more sophisticated alternatives – events and interrupts.
GPIO input is a much more difficult problem than output from the point of view of measurement and verification. For output at least you can see the change in the signal on a logic analyzer and know the exact time that it occurred. This makes it, you read the input line 20µs after setting the output line high. But how do you know when the input line changed state during that 20 microseconds? The simple answer is in most cases you don’t.
In some applications the times are long and/or unimportant but in some they are critical and so we need some strategies for monitoring and controlling read events. The usual rule of thumb is to assume that it takes as long to read a GPIO line as it does to set it. This means we can use the delay mechanisms that we looked at with regard to output for input as well.
One common and very useful trick when you are trying to get the timing of input correct is to substitute.
The Pin object can be set to input mode using the constructor:
pin = Pin(22, Pin.IN)
You can also set the direction to input using the init method:
pin.init(mode=Pin.IN)
Once set to input, the GPIO line is high impedance so it won’t take very much current, no matter what you connect it to. However, notice that the Pico uses 3.3V logic and you should not exceed this value on an input line. For a full discussion of how to work with input see the previous chapter.
You can read the line’s input state using the value method:
result=pin.value()
Notice that this is an “overloaded” method. If you supply a value as a parameter then it attempts to set the value as output. If you don’t specify a value then it gets the GPIO level as a zero or a one.
This is all there is to using a GPIO line as an input, apart from the details of the electronics and the small matter of interrupts.
As introduced in the previous chapter you can also set the internal pull-up or pull-down resistors using one of:
Pin.PULL_UP = 1 Pull-up resistor enabled
Pin.PULL_DOWN = 2 Pull-down resistor enabled
in the constructor or the init method.
The pull-up/down resistors are between 50 and 80kΩ.
One of the most common input circuits is the switch or button. If you want another external button you can use any GPIO line and the circuit explained in the previous chapter. That is, the switch has to have either a pull-up or pull-down resistor either provided by you or a built-in one enabled using software.
The simplest switch input program using an internal pull-up is:
from machine import Pin
import time
pinIn = Pin(22, Pin.IN,Pin.PULL_UP)
pinLED = Pin(25, Pin.OUT)
while True:
if pinIn.value():
pinLED.on()
else:
pinLED.off()
time.sleep(0.5)
As the internal pull-up resistor is used, the switch can be connected to the line and ground without any external resistors:
The program simply tests for the line to be pulled high by the switch not being closed and then sets GP25 high. As GP25 is connected the on-board LED it will light up while it is not pressed. Notice GP22 goes low to indicate that the switch is pressed. | https://i-programmer.info/programming/hardware/15148-the-pico-in-micropython-simple-input.html | CC-MAIN-2022-40 | refinedweb | 695 | 73.07 |
This post was originally published on my website. Check it out for more awesome content!
I originally wrote this tutorial for Code Your Dreams, an incubator of youth voice, tech skills, and social justice. Their project-based and student-centered programs enable youth to be the change makers we know they are through code. To find out how to get involved, visit their website:
Replit is a free, collaborative, in-browser IDE for creating new projects without setting up any environments on your computer. With Replit, you don’t need to “deploy” your projects to any service; they’ll be instantly available to you as soon as you start typing. In this post, we’ll review how to create a Flask app, set up folders for HTML and CSS templates, and learn how to navigate your Flask app.
Before following these steps, you must first create an account on replit.
Creating a Flask Project
First, let’s create a blank Python project. On your replit homepage, create new project by clicking “Python” under the “Create” heading:
For the project name, type
my-first-flask-site and click “Create repl”:
Your new project will automatically create a file named
main.py and open a Python IDLE for you, but we need to install Flask before we can start writing our app. On the left sidebar, click the “Packages” icon, which looks like a hexagonal box:
From here, we can install any Python packages that you want to import in your app. Install the Flask package by typing “flask” and selecting the first item from the list named “Flask”:
Then, click the “Files” icon on the left sidebar to go back to the files list. You should see
main.py, which was already created for you.
Hello, World!
Our first Flask app will have one page—the index page—that says
Hello World! when we go to the home page. Copy the below code into the file named
main.py:
from flask import Flask, render_template # Create a flask app app = Flask( __name__ , template_folder='templates', static_folder='static' ) # Index page @app.route('/') def hello(): return "Hello World!" if __name__ == ' __main__': # Run the Flask app app.run( host='0.0.0.0', debug=True, port=8080 )
In this code, we have one page that’s controlled by the
hello() function. It’s route is
’/‘, which means that it is at the home page of our app.
For flask projects, Replit looks for a web server at the local URL, so we need set the
host to
’0.0.0.0' and the
port to
8080 in
app.run(…). We also set
debug=True so that any changes you make to files will be automatically updated when you refresh a page.
We’ll use
render_template,
template_folder, and
static_folder later in this tutorial, so don’t worry about those just yet.
Now, click the green “Run” button at the top of the page. Replit should install Flask, then open a browser with your first Flask app!
The bottom right window is the Python console, and will show any error messages or logs that are printed.
At any time, you can click the “Stop” button at the top and click “Run” again to restart your Flask app.
Sometimes, your app might have multiple pages. To go to a different URL (or
@app.route) in your app, click the icon “Open in a new tab” on the browser window. It will be to the right of the address bar:
You can type in a new path in the address bar of the new tab, such as. Right now, your server will return a 404 for that page because it doesn’t exist.
HTML Assets and CSS Styles
Next, let’s add an HTML file and a CSS file to our Flask app. HTML files are commonly put in a
templates folder in a Flask project, because they are usually templates to show information. Our Flask code will supply values to HTML templates via variables, so that our app can change via Python code.
Adding an Index Page
In
main.py, we already set up our Flask app to look in the
templates folder for HTML files:
# Create a flask app app = Flask( # ... template_folder='templates', # ... )
Now let’s create the
templates folder and create an
index.html file. Next to the “Files” header on the top left, click the “Add folder” button and name the new folder
templates. Then, click the three dot icon on the
templates folder and click “Add file”. Name the new file
index.html. To have both
index.html and
main.py open at the same time in your editor, right click
main.py on the files list and click “Open tab”.
Your editor should now look like this (note that there’s two tabs in the editor now: one for
templates/index.html and one for
main.py):
Copy the below code into the
templates/index.html file:
<!doctype html> <head> <title>My First Flask Website</title> <link href="/static/style.css" rel="stylesheet" type="text/css"> </head> <body> <h1>Hello, World!</h1> <p> Welcome to your first Flask website </p> </body>
And replace your contents in
main.py with the below code. This new version updates the
hello() function to
index(), and it returns the contents of
index.html to the user:
from flask import Flask, render_template # Create a flask app app = Flask( __name__ , template_folder='templates', static_folder='static' ) # Index page (now using the index.html file) @app.route('/') def index(): return render_template('index.html') if __name__ == ' __main__': # Run the Flask app app.run( host='0.0.0.0', debug=True, port=8080 )
Click the Refresh button in the browser window of the project ( not the refresh button in Chrome or Firefox, but the refresh button for the smaller window in your project), and you should see the contents of your index page with a large header:
Adding CSS Styling
Now let’s add a CSS file to change the color of the text of our app. The Flask app is set up to look inside a
static folder for CSS and JS assets:
# Create a flask app app = Flask( # ... static_folder='static' )
And the index page is set up to look for a file named
style.css inside the
static folder:
<!doctype html> <head> <!-- ... --> <link href="/static/style.css" rel="stylesheet" type="text/css"> <!-- ... -->
Click
main.py on the Files list, then click the “Add a folder” icon to the left of the “Files” header. Name the new folder
static. Next, click the three dot icon next to your new
static folder and click “Add file”. Name the file
style.css, and open it by right clicking the file and selecting “Open in tab”.
Your project should now look like this:
Let’s write some CSS to change the color of the “Welcome” message to red. Add the following code to your
static/style.css file:
p { color: red; }
Click the Refresh button in the project browser window ( not the refresh button in Chrome or Firefox, but the refresh button for the smaller window in your project), and the “Welcome” screen will turn red:
Congratulations, you’ve written your very first Flask app!
Discussion (0) | https://dev.to/nickymarino/create-python-web-apps-with-flask-and-replit-4g3d | CC-MAIN-2022-27 | refinedweb | 1,200 | 81.83 |
Quickly style and plot a GeoJSON file. Style the data based on the values in a column. Here, use OSM's 'highway' field to plot in different colors.
Use geojsonio.py to embed in the notebook.
import geopandas as gpd import geojsonio import pandas as pd
Use colors from. I'm using the qualitative, 7-class Set1 (and removed the yellow color since it doesn't work well for lines on this map).
# Set up the simple style spec mapping of highway to color and width highway = ['motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'residential'] # Colors pasted from colorbrewer2.org, qualitative, 7-class Set1 (removing the yellow color) colors = """ #e41a1c #377eb8 #4daf4a #984ea3 #ff7f00 #a65628 """.split() widths = range(len(highway), 0, -1) # Countdown so smallest is width 1 # 'stroke' and 'stroke-width' are the defined properties for line color/width: # style = pd.DataFrame({'stroke': colors, 'stroke-width': widths, 'highway': highway}) style
# Load up the OSM data df = gpd.read_file('cambridge_raw_osm.geojson') df_styled = gpd.GeoDataFrame(df.merge(style, on='highway'))
Now each row contains 'stroke' and 'stroke-width' based on the 'highway' tag.
Embed the map right in the notebook here.
geojsonio.embed(df_styled.to_json(na='drop')) | https://nbviewer.org/gist/jwass/c349bb0190e8dc3e251a | CC-MAIN-2022-40 | refinedweb | 194 | 58.48 |
Firing <efiring@...> writes:
Eric> I think that what you want to do requires something like the
Eric> mechanism in QuiverKey: a derived artist with a draw method
Eric> that figures out at draw time where to put the text; I don't
Eric> think there is any other way to handle zooming while keeping
Eric> the screen separation from a data point fixed.
You can do this using offsets -- see
matplotlib.axis.XTick._get_text1. This is how tick labeling is done
(a point offset from an x location in data coords and a y location in
axis coords). Here is an example -- you have to copy the default data
transform so that the offset doesn't affect the figure data
from matplotlib.transforms import Value, translation_transform,blend_xy_sep_transform
from pylab import figure, show
fig = figure()
ax = fig.add_subplot(111)
points = 7
pad = fig.dpi*Value(points/72.0)
# poor man's copy
trans = blend_xy_sep_transform(ax.transData, ax.transData)
# to the left and above
offset = translation_transform(Value(-1)*pad, pad)
trans.set_offset( (0,0), offset)
ax.plot([1,2,3])
t = ax.text(1,2, 'hi', transform=trans)
show()
View entire thread | https://sourceforge.net/p/matplotlib/mailman/message/12933870/ | CC-MAIN-2018-13 | refinedweb | 190 | 56.76 |
.
Note
The rest of this chapter is based on the Slick Plain SQL Queries template. The prefered way of reading this introduction is in Activator, where you can edit and run the code directly while reading the tutorial.
Scaffolding¶
The database connection is opened in the usual way. All Plain SQL queries result in DBIOActions that can be composed and run like any other action.
String Interpolation¶
Plain SQL queries in Slick are built via string interpolation using the sql, sqlu and tsql interpolators. They are available through the standard api._ import from a Slick driver:
import slick.driver.H2Driver.api._
You can see the simplest use case in the following methods where the sqlu interpolator is used with a literal SQL string:¶
The following code uses tbe sql interpolator which returns a result set produced by a statement. The interpolator by itself does not produce a DBIO value. It needs to be followed by a call to .as to define the row type::
// Case classes for our data case class Supplier(id: Int, name: String, street: String, city: String, state: String, zip: String) case class Coffee(name: String, supID: Int, price: Double, sales: Int, total: Int) // implicit val for Supplier.
Splicing Literal Values¶:
val table = "coffees" sql"select * from #$table where name = $name".as[Coffee].headOption
Type-Checked SQL Statements¶:
@StaticDatabaseConfig("file:src/main/resources/application.conf#tsql")
In this case it points to the path “tsql” in a local application.conf file, which must contain an appropriate configiration for a StaticDatabaseConfig object, not just a Database.
Note
You can get application.conf resolved via the classpath (as usual) by omitting the path and only specifying a fragment in the URL, or you can use a resource: URL scheme for referencing an arbitrary classpath resouce, but in both cases, they have to be on the compiler’s own classpath, not just the source path or the runtime classpath. Depending on the build tool this may not be possible, so it’s usually better to use a relative file: URL.
You can also retrieve the statically configured DatabaseConfig at runtime:
val dc = DatabaseConfig.forAnnotation[JdbcProfile] import dc.driver.api._ val db = dc.db
This gives you the Slick driver for the standard api._ import and the Database. Note that it is not mandatory to use the same configuration. You can get a Slick driver and Database at runtime in any other way you like and only use the StaticDatabaseConfig for compile-time checking. | https://scala-slick.org/doc/3.1.0/sql.html | CC-MAIN-2019-51 | refinedweb | 417 | 55.84 |
On Sat, 2006-12-16 at 19:18 +0000, Hugh Dickins wrote:
> On Sat, 16 Dec 2006, Martin Michlmayr wrote:
> > * Marc Haber <[email protected]> [2006-12-09 10:26]:
> > > Unfortunately, I am lacking the knowledge needed to do this in an
> > > informed way. I am neither familiar enough with git nor do I possess
> > > the necessary C powers.
> > I wonder if what you're seein is related to
> >
> >
> > You said that you don't see any corruption with 2.6.18. Can you try
> > to apply the patch from
> >;a=commitdiff;h=d08b3851da41d0ee60851f2c75b118e1f7a5fc89
> > to 2.6.18 to see if the corruption shows up?
>
> I did wonder about the very first hunk of Peter's patch, where the
> mapping->private_lock is unlocked earlier now in try_to_free_buffers,
> before the clear_page_dirty. I'm not at all familiar with that area,
> I wonder if Jan has looked at that change, and might be able to say
> whether it's good or not (earlier he worried about his JBD changes,
> but they wouldn't be implicated if just 2.6.18+Peter's gives trouble).
fs/buffers.c:2775
/*
*.
*/
Note the 3th paragraph. Would I have opened up a race by moving that
unlock upwards, such that it is possible to re-attach buffers to the
page before having it marked clean; which according to this text will
mark those buffers dirty and cause data corruption?
Hmm, how to go about something like this:
---
Moving the cleaning of the page out from under the private_lock opened
up a window where newly attached buffer might still see the page dirty
status and were thus marked (incorrectly) dirty themselves; resulting in
filesystem data corruption.
Close this by moving the cleaning of the page inside of the private_lock
scope again. However it is not possible to call page_mkclean() from
within the private_lock (this violates locking order); thus introduce a
variant of test_clear_page_dirty() that does not call page_mkclean() and
call it ourselves when we did do clean the page and call it outside of
the private_lock.
This is still safe because the page is still locked by means of
PG_locked.
Signed-off-by: Peter Zijlstra <[email protected]>
---
fs/buffer.c | 11 +++++++++--
include/linux/page-flags.h | 1 +
mm/page-writeback.c | 10 ++++++++--
3 files changed, 18 insertions(+), 4 deletions(-)
Index: linux-2.6-git/fs/buffer.c
===================================================================
--- linux-2.6-git.orig/fs/buffer.c 2006-12-16 22:18:24.000000000 +0100
+++ linux-2.6-git/fs/buffer.c 2006-12-16 22:22:17.000000000 +0100
@@ -42,6 +42,7 @@
#include <linux/bitops.h>
#include <linux/mpage.h>
#include <linux/bit_spinlock.h>
+#include <linux/rmap.h>
static int fsync_buffers_list(spinlock_t *lock, struct list_head *list);
static void invalidate_bh_lrus(void);
@@ -2832,6 +2833,7 @@ int try_to_free_buffers(struct page *pag
struct address_space * const mapping = page->mapping;
struct buffer_head *buffers_to_free = NULL;
int ret = 0;
+ int must_clean = 0;
BUG_ON(!PageLocked(page));
if (PageWriteback(page))
@@ -2844,7 +2846,6 @@ int try_to_free_buffers(struct page *pag
spin_lock(&mapping->private_lock);
ret = drop_buffers(page, &buffers_to_free);
- spin_unlock(&mapping->private_lock);
if (ret) {
/*
* If the filesystem writes its buffers by hand (eg ext3)
@@ -2858,9 +2859,15 @@ int try_to_free_buffers(struct page *pag
* the page's buffers clean. We discover that here and clean
* the page also.
*/
- if (test_clear_page_dirty(page))
+ if (__test_clear_page_dirty(page, 0)) {
task_io_account_cancelled_write(PAGE_CACHE_SIZE);
+ if (mapping_cap_account_dirty(mapping))
+ must_clean = 1;
+ }
}
+ spin_unlock(&mapping->private_lock);
+ if (must_clean)
+ page_mkclean(page);
out:
if (buffers_to_free) {
struct buffer_head *bh = buffers_to_free;
Index: linux-2.6-git/include/linux/page-flags.h
===================================================================
--- linux-2.6-git.orig/include/linux/page-flags.h 2006-12-16 22:19:56.000000000 +0100
+++ linux-2.6-git/include/linux/page-flags.h 2006-12-16 22:20:07.000000000 +0100
@@ -253,6 +253,7 @@ static inline void SetPageUptodate(struc
struct page; /* forward declaration */
+int __test_clear_page_dirty(struct page *page, int do_clean);
int test_clear_page_dirty(struct page *page);
int test_clear_page_writeback(struct page *page);
int test_set_page_writeback(struct page *page);
Index: linux-2.6-git/mm/page-writeback.c
===================================================================
--- linux-2.6-git.orig/mm/page-writeback.c 2006-12-16 22:18:18.000000000 +0100
+++ linux-2.6-git/mm/page-writeback.c 2006-12-16 22:19:42.000000000 +0100
@@ -854,7 +854,7 @@ EXPORT_SYMBOL(set_page_dirty_lock);
* Clear a page's dirty flag, while caring for dirty memory accounting.
* Returns true if the page was previously dirty.
*/
-int test_clear_page_dirty(struct page *page)
+int __test_clear_page_dirty(struct page *page, int do_clean)
{
struct address_space *mapping = page_mapping(page);
unsigned long flags;
@@ -872,7 +872,8 @@ int test_clear_page_dirty(struct page *p
* page is locked, which pins the address_space
*/
if (mapping_cap_account_dirty(mapping)) {
- page_mkclean(page);
+ if (do_clean)
+ page_mkclean(page);
dec_zone_page_state(page, NR_FILE_DIRTY);
}
return 1;
@@ -880,6 +881,11 @@ int test_clear_page_dirty(struct page *p
write_unlock_irqrestore(&mapping->tree_lock, flags);
return 0;
}
+
+int test_clear_page_dirty(struct page *page)
+{
+ return __test_clear_page_dirty(page, 1);
+}
EXPORT_SYMBOL(test_clear_page_dirty);
/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at
Please read the FAQ at | http://lkml.org/lkml/2006/12/16/144 | crawl-002 | refinedweb | 826 | 56.35 |
Important: Please read the Qt Code of Conduct -
ListView Select item based on some value
Hello i want to be able to select a item based on a stored database value, when the ListView is first loaded
Let's say i have something like this:
@
ListView {
id: myListView
anchors.fill: parent
model: SomePythonModel
delegate: Component {
Text {
id: Title
text: model.list.title
}
Text { id: uniqueID text: model.list.uniqueID visible: false }
}
@
My sulotion was to loop throu the items onCompleted and check if uniqueID == dbValue, like so
@
for(var i=0; i<myListView.contentItem.children.length; i++) {
var ID = myListView.contentItem.children[i].uniqueID;
if(ID == wrapper.dbValue) {
selectedIndex = i;
break;
}
}
@
But that only works if the item in question is one of the items that is visible on load.
Does anybody have an idée on how to achive this?
You can iterate on the myListView.model.
[quote author="dmcr" date="1352705848"]You can iterate on the myListView.model.[/quote]
I have tried to do something like this but with no success, and i havent found any information to help me out.
coud you provide a link or write a short example of iterating on myListView.model?
-You can iterate on the myListView.model.-
Well it's not so simple, however.
You can, but it depends on how you define your model.
It works with QDeclarativeListProperty, otherwise you had to add some code like in this "link": as you may already know.
You can be inspired as well with this "monologer": :)
Thanks for your answers but i can't find anything in those links that will help me with iterating the model how ever monologer had a link to "Chris' Blog": that defines a find function but no exampel use of that function, and i havent been able to find anymore, and i get function undefind when i tried to implement it. On the other hand i cant call any other function in the model so i guess they are not ment to be accessed that way.
here is an example of how my list model in python
@
class MyListModel(QtCore.QAbstractListModel):
COLUMNS = ('item',)
def __init__(self, items): QtCore.QAbstractListModel.__init__(self) self.items = items self.setRoleNames(dict(enumerate(myListModel.COLUMNS))) def rowCount(self, parent=QtCore.QModelIndex()): return len(self.items) def data(self, index, role): if index.isValid() and role == UserListModel.COLUMNS.index('item'): return self.items[index.row()] return None # This is newly implemented def find(self, title): return 1 #for i in range(len(self.items)): # if self.items[i].getTitle() == title: # return i #return -1
@
and it is exposed to qml with: self.rc.setContextProperty('SomePythonModel', MyListModel(itemsArray))
Hello,
I cannot help you really in python, just two things:
- If you add Q_INVOKABLE before the declaration of the rowCount() function for example, then you can access in javascript to the value.
- In your delegate, you can have for example @isLocalSelectedIndex = uniqueID == wrapper.dbValue /an outside value you can access/
@
and then
@onIsLocalSelectedIndexChanged :
if( isLocalSelectedIndex )
{ you can change the global value you want}@
So globally you can almost do everything you want with the model you have right now
Thanks so much for all your help, but in the end it was my stupid brain that couldn't see the simplest solution, instead of using selectedIndex to determinate the state I'm now using selectedUniqueID.
it came to me in a dream... for real =)
So for people with the same train wreck of a brain as me, I will give an example:
@
Page {
alias string selectedUniqueID: ""
ListView {
id: myListView
anchors.fill: parent
model: SomePythonModel delegate: Component { Text { id: Title text: model.list.title } Text { id: uniqueID text: model.list.uniqueID visible: false } MouseArea { onClicked: selectedUniqueID = uniqueID.text } states: State { when: selectedUniqueID == uniqueID.text ... } }
}
Component.onCompleted: {
selectedUniqueID = wrapper.dbValue
}
}
@
Don't know who wrote :"the best pieces i code i am proud of are not the ones i made in front of my computer, but under my shower!" :) | https://forum.qt.io/topic/21319/listview-select-item-based-on-some-value | CC-MAIN-2021-49 | refinedweb | 660 | 56.66 |
Greetings,
My brain is inoperable and I need a fresh set of eyes to hint me in the right direction? Any help to completing the code and additional help to start a day and year functions would help?
Any help is appreciated??? I stink at enumerators!!!!Any help is appreciated??? I stink at enumerators!!!!Code:#include<iostream> #include<string> using namespace std; enum month {JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC}; void months(); int main() { cout << "Enter the month\n"; string M; cin >> M; cout << M; return 0; { void months() { switch (M) { case JAN: cout << "January"; case FEB: cout << "February"; case MAR: cout << "March"; case APR: cout << "April"; case MAY: cout << "May"; case JUN: cout << "June"; case JUL: cout << "July"; case AUG: cout << "August"; case SEP: return "September"; case OCT: cout << "October"; case NOV: cout << "November"; case DEC: cout << "December"; default: cerr << "\n***TRY AGAIN!***\n"; return M; } }
cj | http://cboard.cprogramming.com/cplusplus-programming/28712-enum-code-problem.html | CC-MAIN-2015-48 | refinedweb | 154 | 62.78 |
pNodecom.ericsson.otp.erlang.OtpNode
public class OtpNode
Represents a local OTP node. This class is used when you do not wish to manage connections yourself - outgoing connections are established as needed, and incoming connections accepted automatically. This class supports the use of a mailbox API for communication, while management of the underlying communication mechanism is automatic and hidden from the application programmer.
Once an instance of this class has been created, obtain one or more mailboxes in order to send or receive messages. The first message sent to a given node will cause a connection to be set up to that node. Any messages received will be delivered to the appropriate mailboxes.
To shut down the node, call
close(). This will prevent the
node from accepting additional connections and it will cause all existing
connections to be closed. Any unread messages in existing mailboxes can still
be read, however no new messages will be delivered to the mailboxes.
Note that the use of this class requires that Epmd (Erlang Port Mapper Daemon) is running on each cooperating host. This class does not start Epmd automatically as Erlang does, you must start it manually or through some other means. See the Erlang documentation for more information about this.
public OtpNode(java.lang.String node) throws java.io.IOException
Create a- if communication could not be initialized.
public OtpNode(java.lang.String node, java.lang.String cookie) throws java.io.IOException
node- the name of this node.
cookie- the authorization cookie that will be used by this node when it communicates with other nodes.
java.io.IOException- if communication could not be initialized.
public OtpNode(java.lang.String node, java.lang.String cookie, int port) throws java.io.IOException
node- the name of this node.
cookie- the authorization cookie that will be used by this node when it communicates with other nodes.
port- the port number you wish to use for incoming connections. Specifying 0 lets the system choose an available port.
java.io.IOException- if communication could not be initialized.
public void close()
protected void finalize()
finalizein class
java.lang.Object
public OtpMbox createMbox()
mailboxthat can be used to send and receive messages with other, similar mailboxes and with Erlang processes. Messages can be sent to this mailbox by using its associated
pid.
public void closeMbox(OtpMbox mbox)
mbox- the mailbox to close. reason 'normal' will be
sent.
public void closeMbox(OtpMbox mbox, OtpErlangObject reason)
mbox- the mailbox to close.
reason- an Erlang term describing the reason for the termination. the given reason will
be sent.
public OtpMbox createMbox(java.lang.String name)
pid.
name- a name to register for this mailbox. The name must be unique within this OtpNode.
public boolean registerName(java.lang.String name, OtpMbox mbox)
Register or remove a name for the given mailbox. Registering a name for a
mailbox enables others to send messages without knowing the
pid of the mailbox. A mailbox can have at most one
name; if the mailbox already had a name, calling this method will
supercede that name.
name- the name to register for the mailbox. Specify null to unregister the existing name from this mailbox.
mbox- the mailbox to associate with the name.
public java.lang.String[] getNames()
public OtpErlangPid whereis(java.lang.String name)
pidcorresponding to a registered name on this node.
pidcorresponding to the registered name, or null if the name is not known on this node.
public void registerStatusHandler(OtpNodeStatus ahandler)
OtpNodeStatushandler object contains callback methods, that will be called when certain events occur.
ahandler- the callback object to register. To clear the handler, specify null as the handler to use.
public boolean ping(java.lang.String anode, long timeout)
Determine if another node is alive. This method has the side effect of setting up a connection to the remote node (if possible). Only a single outgoing message is sent; the timeout is how long to wait for a response.
Only a single attempt is made to connect to the remote node, so for example it is not possible to specify an extremely long timeout and expect to be notified when the node eventually comes up. If you wish to wait for a remote node to be started, the following construction may be useful:
// ping every 2 seconds until positive response while (!me.ping(him, 2000)) ;
anode- the name of the node to ping.
timeout- the time, in milliseconds, to wait for response before returning false.
public void setFlags(int flags) | http://www.erlang.org/doc/apps/jinterface/java/com/ericsson/otp/erlang/OtpNode.html | CC-MAIN-2015-18 | refinedweb | 745 | 59.7 |
#include <history.h> get_history(instr) put_history(outstr) app_history (s) string *ask_history() reset_history() void set_headline(s) string ask_headline() stream instr, outstr; string s;
get_history() appends history from a file instr (assumed to be in filestruct(5NEMO) format) to the internal history buffer. This is usually one of the first things a program should do before other input is attempted, as the data history is normally prepended to the data.
A program can add (append) arbitrary history by calling app_history(), where s points to the string to be added.
put_history() writes the current history to an output file outstr. If any headline had been set, it will also be written.
ask_history() returns a pointer to a NULL terminated array of strings that contain the full history status.
set_headline() is an old way to add user supplied to the history database. Only one string can be hold here. It is added to the data history when put_history is called.
ask_headline() returns the headline string, which would be output
~/src/kernel/io history.[ch] ~/inc history.h
9-mar-88 V1.0 created Peter Teuben 1-jun-88 V1.1 adapted to new filestruct, renamed names PJT 14-jun-88 V1.3 integrate at IAS, changed _hist to _history JEB 9-oct-90 V1.8b upgraded manual page PJT 7-may-92 V1.9 documented name change add_ to app_ PJT
Table of Contents | http://bima.astro.umd.edu/nemo/man_html/ask_history.3.html | crawl-001 | refinedweb | 230 | 59.19 |
28 December 2005 19:19 [Source: ICIS news]
HOUSTON (ICIS news)--US January benzene contract prices could settle up 20-25 cents/gallon within a $2.35-2.40/gallon free on board (FOB) range (Euro591-603/tonne FOB) due to rising spot prices in December, market sources said on Wednesday.
January spot business has been done within a wide spread of $2.29-2.52/gallon during 5-28 December, 11-34 cents/gallon above the $2.18/gallon FOB settlement for December benzene contracts.
January spot numbers have been no lower than the mid $2.30s/gallon ?xml:namespace>
Traders said January benzene contract prices were nominated at $2.60/gallon FOB and $2.70/gallon FOB, 19.3% and 23.9% above the $2.18/gallon FOB December contract agreement, | http://www.icis.com/Articles/2005/12/28/1031153/us-jan-benzene-contract-could-settle-up-20-25-cents.html | CC-MAIN-2015-18 | refinedweb | 133 | 62.75 |
Timeout Attributes In TestNG: When we are running an automation script, some scripts take a longer time to execution then expected. So in those cases, we need to mark such cases as fail and then continue. So in this post, we are going to see how we can mark fail such test cases, which are taking a long time to execute with the help of testNG time out.
TestNG allows us to achieve to do in 2 ways:
- Suite Level: If you define at suite level, then that is applicable for all the test methods in that TestNG suite.
- Test Method Level: If you define at the method level, then the timeout duration will apply to that method only. If previously suite level is declared, and later you specify at the method level, in that case, it will override the time mentioned at the suite level.
Time timeOut attribute within the @Test annotation method is assigned a value specifying the number of milliseconds. In case the test method exceeds the timeout value, the test method is marked as a failure with ThreadTimeoutException.
How to Define Timeout Attributes at Suite Level
In the below class, we have two methods, where in the first test method, we have put the wait time 1000ms, and in the second test method, the wait time is 400ms. But in the suite file, we have mentioned 500ms, so the first method will be failed because here we have put 1000ms, which is higher than the timeout millisecond.
TestNg Class:
public class TimeoutSuite { @Test public void timeTestOne() throws InterruptedException { Thread.sleep(1000); System.out.println("Time test method one"); } @Test public void timeTestTwo() throws InterruptedException { Thread.sleep(400); System.out.println("Time test method two"); } }
TestNg.XML
<suite name="Time test Suite" time- <test name="Timeout Test"> <classes> <class name="com.howtodoinjava.test.TimeoutSuite" /> </classes> </test> </suite>
Let us go to another way, which is using method level:
Timeout Attribute at Method Level
TestNg.class:
public class TimeoutMethod { @Test(timeOut = 500) public void timeTestOne() throws InterruptedException { Thread.sleep(1000); System.out.println("Time test method one"); } @Test(timeOut = 500) public void timeTestTwo() throws InterruptedException { Thread.sleep(400); System.out.println("Time test method two"); } }
Use the same testng.xml file to run the above TestNG class, and here we have mentioned the timeout duration is 500 for each test method and as the first test method takes more than the mentioned time, thats why that will fail. | https://www.softwaretestingo.com/timeout-attributes-testng/ | CC-MAIN-2019-47 | refinedweb | 410 | 59.74 |
[RFE][L3] l3-agent should have its capacity
Bug Description
Recently we meet some scale issue about L3-agent. According to what I'm informed, most cloud service provider does not charge for the neutron virtual router. This can become a headach for the operators. Every tenant may create free routers for doing nothing. But neutron will create many resource for it, especially the HA scenario, there will be namespaces, keepalived processes, and monitor processes. It will absolutely increase the failure risk, especially for agent restart.
So this RFE is aimming to add a scheduling mechanism, and for l3-agent, it will collect and report some resource usage, for instance available bandiwidth. So during the router scheduler process, if there is no more available, the number of routers can be under a controlled range.
First of all, to control number of resources used by tenants, there is quota mechanism. So it can be limited easily.
/github. com/openstack/ neutron/ blob/master/ neutron/ scheduler/ l3_agent_ scheduler. py ? Isn't LeastRoutersSch eduler (https:/ /github. com/openstack/ neutron/ blob/master/ neutron/ scheduler/ l3_agent_ scheduler. py#L344) something what You are describing here?
Second - is this rfe about adding new scheduler driver to https:/ | https://bugs.launchpad.net/neutron/+bug/1828494 | CC-MAIN-2022-27 | refinedweb | 200 | 58.69 |
<br />
Just tab bar of Flutter, without Ripple Effect
<br />
<br />
This widget has the same API as TabBar widget in Flutter TabBar API
example/README.md
This widget has the same API as TabBar widget in Flutter, without Ripple Effect
Add this to your package's pubspec.yaml file:
dependencies: flutter_tab_bar_no_ripple: ^0.0.2
You can install packages from the command line:
with Flutter:
$ flutter packages get
Alternatively, your editor might support
flutter packages get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:flutter_tab_bar_no_ripple/flutter_tab_bar_no_ripple.dart';
We analyzed this package on Feb 4, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.. | https://pub.dartlang.org/packages/flutter_tab_bar_no_ripple/versions/0.0.2 | CC-MAIN-2019-09 | refinedweb | 131 | 55.95 |
Amelia Bellamy-Royds: Okay. Welcome, all. We have a busy schedule today. So we're going to get started right away.
Amelia Bellamy-Royds: If you're not sure we're at the W3C OGC workshop on Maps for the Web. This is day three.
Amelia Bellamy-Royds: If you missed day one or day two. I think they are both now up on YouTube and we will get the links integrated into the agenda soon.
Amelia Bellamy-Royds: There is also the ongoing live chat on Gitter. And there are multiple links to it now, from the zoom chat and
Amelia Bellamy-Royds: More long form discussion on Discourse somebody can throw a link to that into the chat as well.
Amelia Bellamy-Royds: I would like to remind you that we are operating under the W3C's code of conduct and respectful behavior is expected from everyone.
Amelia Bellamy-Royds: Beyond that, I think we're gonna get started, our theme for the first hour is a native map viewer for the web platform. Can we add something to the web that tells browsers, how to display maps.
Amelia Bellamy-Royds: Are on that theme we have four different talks to start it off. We have Brian Kardell, Brian Kardell works at Igalia as a
Amelia Bellamy-Royds: Advocate and networker extraordinary. But even before that he's been involved in web standards in various capacities, he's going to be talking to us about extending the web with new features and something about pie. So I hope you brought enough for everyone, Brian.
Brian Kardell: Okay, I'm going to share my screen.
Brian Kardell: Let me know if you can see that
Amelia Bellamy-Royds: It's working.
Brian Kardell: Okay and I'm going to also drop in a link
And
Brian Kardell: If you open that link in your chromium or your browser tab, it should advance as we go. And you'll get a smoother experience, probably, if you prefer that
Brian Kardell: Okay. So yeah, I am Brian Kardell. This is my website you recognize it as a website because you see it in a web browser with the URL. But in that same browser, you can do pretty much anything that you would want to do on the computer, which is amazing.
Brian Kardell: But also, many of the desktop apps and mobile apps that you download and use as first class things on your devices are also under the covers using web engines.
Brian Kardell: And so are lots of embedded devices. Now your smart refrigerators, your TVs, car and airplane infotainment systems digital signage point of sale systems.
Brian Kardell: Basically, as long as there's a UI, you can bet that there's somebody working on trying to do that with web technology. In fact, even if there isn't a UI, we're using aspects of the web platform.
Brian Kardell: Even if US went on out into the forest or on a remote beach somewhere and read a paper book, there's a pretty good chance that
Brian Kardell: web technology and web standards were involved in the printing and creation of that book. So what I'm trying to say here is that the web platform is infrastructure. It's a huge commons on which we've built basically all of society at this point.
Brian Kardell: But if you're on the edges of that and you're trying to improve the platform and you don't work for a vendor. You're just a developer, you want to make things better.
Brian Kardell: It can feel a little bit frustrating sometimes it can feel like you've been put on hold and even though they might say your call is important to us. It sure doesn't feel that way sometimes
Brian Kardell: So part of my talk. I want to give a pep talk here. Yes, I think we could do this, but I would also like to explain the reasons why it can feel this way and the practical challenges and kind of keep us grounded in reality. So the reason is pie.
Brian Kardell: So that needs some explaining. So as an illustration. We're all here giving some amount of our finite time and energy pie to think about and discuss this topic.
Brian Kardell: Now we all have different amounts of pie. Some of us are here because it's a labor of love, we just really believe in it. We think it's the right thing to do and lots of others of us work for companies and our companies have obviously different amounts of pie.
Brian Kardell: We have very, very different budgets of pie, as we're coming into this discussion and some of us bring the most pie, we bring the most critical pie and the one to make a rendering engines are the most critical
Brian Kardell: But it's important to recognize that their pie is still finite and also it's voluntary.
Brian Kardell: It's not cheap. I want to point out that there are thousands of person years investment into each one of these rendering engines and that is just the code part that isn't the standards part which is really, really big.
Brian Kardell: The wants from folks like us as the commons grows are only accelerating and every want represents and ask for some slice of pie and
Brian Kardell: The slice, how much we're asking for differs from engine to engine because
Brian Kardell: These are different companies with different budgets and they have different constraints and priorities limited to staffing and talent.
Brian Kardell: And they also have different architectures. So things cost different amounts so realistically, we have to prioritize. There is absolutely no choice but lots follows from this, it has big domino effect.
Brian Kardell: The first one is in order to be involved in any discussions, they just like we do have to make some value judgment. We're not doing other things that we could be doing right now we're doing this.
Brian Kardell: And we're doing that, based on some judgment. But how do you estimate what it takes to be involved is very difficult if you're a vendor because you know what it really takes
Brian Kardell: And so lots and lots of stuff takes a really long time to get past 'Go' or some things never do, or maybe some things just haven't yet like maybe maps.
Brian Kardell: So the result of this is that in 30 years that the web's been around we have created about 130 elements for HTML.
Brian Kardell: And over half of those are just spicy dibs is how a friend of mine, Dave Rupert calls them. These are things like paragraph strong emphasis, they have very low implementation costs, but very, very high standardization costs while we discussed them.
Brian Kardell: But even if you make it past those steps now you get to where we have to actually get it done and we have to get it done everywhere. We have to get it done interoperably
Brian Kardell: Which we frequently learn along the way. We have to get it accessible and styleable, which are things that we frequently still get wrong, especially in early implementations
Brian Kardell: And costs go up very quickly with complexity. Like even a little bit of complexity. So to illustrate this in 30 years we have created one non form based interactive standard UI control element.
Brian Kardell: Like the sort of thing that you would find in a standard UI toolkit that isn't about collecting information and that is summary details which looks like this. It is probably the simplest UI widget in existence. It has been around as long as there have been GUIs
Brian Kardell: And this has been a work in progress for a long time. The last major browser added support in June or in January of this year and that was accomplished. Actually, the full parity was accomplished by one of the rendering engine disappearing when
Brian Kardell: Chrome(editor's note: Edge) switched their internal rendering engine from theirs to Chromium. They just got it by default.
Brian Kardell: And then finally, if you make it past all of those hurdles. It's finally real like it is actually literally everybody can use it. It works everywhere, it is by all definitions, the standard
Brian Kardell: But that doesn't mean that everybody knows that we've reached that point yet so it takes some time for people to learn about it.
Brian Kardell: And then it takes even more time for them to find a use case where they need to try it. And then finally, at that point, we get developers involved, way, way at the end.
Brian Kardell: And we asked them, hey, how is that super expensive pie taste that took a decade and millions of dollars and the response is frequently
Brian Kardell: It could be better, to be honest.
Brian Kardell: So that sounds very, very depressing. But that is sort of like the historical challenge, and that is why several years ago.
Brian Kardell: A group of us got together and discuss these problems and created this document called the extensible web manifesto and what it says basically is we can do better than this.
Brian Kardell: One way we can do better than this. Is that the cow paths currently aren't very clear, we say that we pave the cow paths, but really it's a little bit like reading the runes,
Brian Kardell: We're looking at many other cow paths and trying to build a new road that meets all of the same criteria in a completely different way.
Brian Kardell: So a better way to do this is to give developers mostly the same abilities that browsers have to create new elements.
Brian Kardell: And let developers, bring the early pie. They're the ones with all the ideas and they're the ones that are actually capable of testing things
Brian Kardell: They're the ones that are ultimately have to accept this solution as adequate and we can find out do developers actually like and use it or not, because very frequently we are wrong.
Brian Kardell: Because a failure in this model is a feature, right, like we can float lots of ideas and people can say what about this, this seems great and people can say no. But we can do better than that. And very quickly adjust
Brian Kardell: This also I think plays into the ability for us to explore adjacent possibles when we give people new tools they dream new dreams that we hadn't even thought of yet.
Brian Kardell: I think this is important because so many things wind up being fantastically successful at something they weren't even designed for
Brian Kardell: Including the web itself, actually. So this document suggests that we should get out of the way we should enable
Brian Kardell: Developers to explore these spaces we should give them the tools and we should not spend those precious resources debating
Brian Kardell: How developers might use things or what they might like in give them the tools to show us and focus on science to know when they're discovered something so that we can write it down. And that can work more like dictionaries.
Brian Kardell: There aren't committees for dictionaries that create words, they they write down the words. So this is all high level stuff.
Brian Kardell: But I think there are some important details at least they're important to me that I would like to discuss, which is that one of the goals here in my mind is for this to lay a nice bright unambiguous path.
Brian Kardell: That we can then pave that has proof that is accessible, that is acceptable to developers that it ticks all the boxes and it is estimable and it explains how does this map very well to the web platform.
Brian Kardell: So I think that what the extensive web manifesto is saying a lot of it is to break it down to reduce the magic required in anything, expose the parts and aim for the middle
Brian Kardell: So an example of this is dialog, dialog is this element that is in almost every UI toolkit and it creates this layer on top that you
Brian Kardell: Interact with, but it also does all these other subtle things and inside it is magic, lots of magic. It does things like prevent you from selecting the text behind it prevent your tab focus for moving out of it. Give you controls for styling that and so on.
Brian Kardell: Change the how things are exposed to accessibility.
Brian Kardell: So the original proposal for dialog is a big ask for a budget and if we succeed in delivering it will deliver that thing I showed on a few panels ago and will it be adequate? We don't know, but it will be helpful in solving only that problem.
Brian Kardell: But if you look a crack open the magic. There is this concept of inertness, that is used to define dialog, which is
Brian Kardell: All that other stuff that I said it does about managing text selection and ARIA and everything. And it's fundamentally necessary for dialogue, but it's also useful for lots of other UI.
Brian Kardell: Patterns and components that we haven't even started talking about standardizing yet maybe some that we never will like drawers.
Brian Kardell: So we split that out and made an exposed to developers and we focused on doing that, first, so that is delivers a lot of value.
Brian Kardell: For a lot of things that can explore the space and it reduces the overall amount of pie that is required for dialog that changes the calculus of whether it's worth the investment. It's much more estimable and it is very much follows basic software development ideas.
Brian Kardell: Then it allows developers to use inert to explore the space with other controls and the way to pay for those controls, then it's very clear because we know that is inert. We don't have to reinvent that
Brian Kardell: So exposing these middle layers actually helps build resilience and adaptability and helps make sure we're not biting too much off and as the web changes like we have the ability to adapt.
Brian Kardell: So what's all this got to do with maps. I know it feels like I'm a little bit off topic, but should the web have maps is the question we're asking and yes
Brian Kardell: It seems clear, sure.
Brian Kardell: But we need so much. There's so many things that the web should have that the web doesn't have. And there's just not enough pie.
Brian Kardell: So another thing you can do is you can bring more pie
Brian Kardell: My company Igalia. That's what we do. The reason that the current model the historic model exists is simply because that's what we let happen but
Brian Kardell: Igalia and other companies like Bocoup who's presenting also today can help you.
Brian Kardell: When you have prioritization problems where you can't get the attention that you need from somebody who has the expertise and the knowledge to help this move along. So we have done that for things like CSS grid.
Brian Kardell: And lots of lots and lots of features.
Brian Kardell: So for maps, though I think my advice, though, is that all of these things that I was just talking about apply, we have this problem of we have lots of maps sort of that have lots of commonalities and it feels like there's a path there. But how do you map it into HTML. And it's very difficult.
Brian Kardell: And which features should it include, and what is ultimately good enough, I think, despite the fact that we have lots of experts and we have libraries and things like that. I think we don't know what's good enough until
Brian Kardell: We try some things and developers will tell us like they'll know it when they see it and it might be shocking. What is good enough, HTML was certainly shockingly, you know, good enough, there were better solutions before HTML came along.
Brian Kardell: But also at the end of that when we have an answer, it's important that it fits well into the platform and that it's aware self aware of the pie it's asking for. So I think
Brian Kardell: Break it down and aim for the middle and improve the cost benefit analysis, find unlikely allies.
Brian Kardell: Like find ways that we can deliver parts of it and share the pie that we're asking for. So one way to do this is to ask what are the things that are making it hard technically today and are those things only hard for you and I would suggest maybe squint at it a little bit.
Brian Kardell: There are very similar course green needs for like video game maps or maps of fictional spaces. If you want to their maps of Mordor. For example,
Brian Kardell: If you squint even a little bit harder things that aren't maps at all that also have very similar needs product images for e commerce is a really big one that people aren interested in, technical drawings
Brian Kardell: So basically, the web is lacking lots of coarse grain features that we can that we can do and low level things like pan and zoom is a great one.
Brian Kardell: Lots of things need that. Offscreen canvas, maybe hardware accelerated SVG. This is one of the challenges that we don't know what the necessary parts are yet.
Brian Kardell: But I don't have the answers. I think there's probably a lot and I am here to hear your ideas and see how I can help. So thank you.
Sébastien Durand (Canada - NRCAN - CGP): I just want to say, Great presentation was very fun to watch good content too. Thanks.
Brian Kardell: Thank you.
Amelia Bellamy-Royds: Indeed, thank you, Brian.
was amazing.
Amelia Bellamy-Royds: Good way to start the day
Amelia Bellamy-Royds: We are going to continue now with something a little more map focused Peter Rushforth is going to present in more detail what he hinted at the other day, the proposal he built for a MapML a specific way of
Amelia Bellamy-Royds: Including map viewers in HTML using markup.
Peter Rushforth: Thanks, Amelia.
Peter Rushforth: I recorded my presentation. So it kind of auto plays, but that was great presentation Brian, and thank you very much for bringing your personal energy and effort to this and we definitely welcome your words of wisdom.
Peter Rushforth: And we'll try to follow them.
Peter Rushforth: So I'm going to go and share this and start my presentation.
Peter Rushforth: Thank you.
Good morning. In this presentation, I'll give an overview of the MapML proposal.
MapML is a proposal to extend HTML in the HTML namespace to include elements into attributes that implement maps and layers.
The objective of our proposal is to introduce a small set of HTML elements that will directly support maps and mapping applications with approximately the same authoring complexity as video or audio or image.
Why do we need a map element, exactly? We need a map element to provide a declarative semantic entry point in web standards for a few reasons. Above all, we need to standardize Web Map client technology because we should. It is the ethical thing to do.
We need to make standard web maps learnable by children, not by binding such an important facet of human existence, not to mention survival to proprietary frameworks.
Having made that decision. We need a map element to obtain more efficient rendering of spatial content.
Next we need to define and standardize what accessibility means for web maps and especially Web Map content.
Finally, we need to establish an organic, not based on metadata basis for spatially indexing web pages. So that search engines can return search results based
Not only on ranking the text of documents against search terms, but also based on spatial indexing of map elements in the page.
Like the PageRank algorithm. But instead of or as well as backlinks increasing a hits relevance, the pages literally nearer to the search term would raise the result rank.
We propose to extend the existing map element by adding attributes and new child layer elements.
The map element is a reasonable candidate for extension, not only because of the element name.
But mostly because of the elements processing model is already that of an interactive, albeit static map with layers represented by the image and area elements and the image map semantics potentially provide
A path to script lists accessible graceful degradation. This is the basis upon which other proposals to modify HTML have been successfully made, for example the image source set attribute, among others. This approach also seems to be encouraged by various HTML design principles.
The design principles aren't a license to propose changes to HTML, but they are a framework to help guide decisions, design discussions.
So if you have a concern about any of the design you hear about today, please consider joining the group and contributing those ideas.
If we consider a diversity of viewpoints and experience, we will achieve a stronger proposal.
The result of the proposed extension, whether it results in a map element or something else should be a map widget or viewer that is designed for accessibility and is progressively enhanceable. In other words, scriptable.
It's not the intention of the proposal to accommodate by means of native browser implementation all use cases of web maps today.
It is a key objective of the proposal to expose DOM APIs, events and other facilities such as styling that relate to loading, rendering and using and creating map content.
I've got more to talk about today than I have time for. So I'll cover some of the big ideas first. To begin, I'll talk about the key elements of the proposal, the map, layer and extent elements.
Then I'll spend time talking about titled coordinate reference systems or TCRS because understanding those concepts is key to making sense of most of the proposal.
Map projections define the coordinate systems in effect
In the scope of the map. So that coordinates of places on Earth or potentially other planets too maybe drawn on a 2D plane.
Every map has a coordinate system that is shared by its layers. So the proposed map element has a set of defined projection values. The default value if unspecified is OSM tile, which corresponds with Web Mercator
The set of projections is small yet extensible. In the same way that, for example, HTML rel values are extensible. In other words, by agreement.
I'm using the attribute name projection here as a user friendly term to describe the concept that I call tiled coordinate reference systems or TCRS
The term TCRS is defined in this proposal and represents a framework for naming and discussing the integrated concepts of tile caches,geospatial coordinate reference systems and Web Map client concerns.
Web maps all define their starting conditions, typically via a lat long coordinate pair representing the center of the map. So the map element has required lat long attributes describing it starting center point.
On the web as in real life, maps have scale. So the map element has a required to zoom attribute which define the starting scale.
This is actually a very important point, and one that can go unrecognized. Web maps are in fact real life maps in which paper or mylar has been exchanged for pixels. Everything that is represented must be represented according to an intended scale, including geographic features.
The Boolean controls attribute turns controls on or off. Controls are created by default in a closed shadow root. Like the video element, the controls list attribute can prune the set of native native controls provided
We need a layer element to be a child of the map element because map layer is a primitive abstraction that is shared by many, if not most maps, both on and off the web.
Layer elements represent map content and each must share the coordinates systems defined by the parent map elements projection attribute
Map Layers and their content are in the light DOM in the same way that SVG content is in the DOM.
Layers are added. According to the painters model in document order. Their label attribute will appear in document order in the layer control.
Layers are children of the map element only and do not nest. Content can be in line or located in a document at the source attribute URL.
A layer has a text label attribute
A 'checked' layer renders on the map.
A hidden layer is not shown in the layer control that is rendered on the map. This can be useful for preventing the user from turning off important content and becoming confused.
Layers can have inline content as shown here, that is loaded and rendered by the browser.
Web maps need a standard mechanism to load map data that does not involve knowing how to access server APIs beyond the strict uniform interface of HTTP.
Browsers standardized HTML forms as a means to flexibly request and transmit data to and from any server within the constraints of the HTTP uniform interface.
Web Map Server data comes in a wide and growing variety of formats and interfaces. This poses severe challenges for interoperability.
So, we designed a mechanism for loading and accessing server information based on established patterns, for example, URL templates and standards like WMS WMTS and OpenStreetMap Slippy tiles and informed by the HTML form element.
The extent element represents the part of the layers content that binds to the viewport of the map.
The extent element is somewhat analogous to the form element being the parent of various inputs and links the values of which are serialized during extent processing.
Extent processing differs from form processing in that the user is not expected to fill in input values manually because the extent being bound to the map viewport triggers content requests automatically as the map requires new content to paint.
New content is typically required as the user either manipulates the map by panning or zooming, or the device by rotating or moving it
The rel="tile" value, shown here associated to tile based URL templates reflects a core abstraction in modern web maps that of map tiles.
The rel value tells the browser what the purpose is of the resource that it is loading. So as the rendering engine iterate over the tiles that it needs the browser fires events which are serialized to variables identified by name.
Each input variable binds to one or more variable references in the URL template links within the extent elements scope.
Once all the variable references are resolved the URL template becomes an actual resource URL that is fetched and rendered
An extent can contain as many such URL template links as it needs to compose the map layer.
In the example shown above the geometry and labels of the layer are referenced by separate links.
Tiled Coordinate Reference System or TCRS is a term coined by me to standardize and describe a system of talking about spatial coordinate reference systems from the web clients and users point of view.
When working with maps and spatial information we inevitably need to talk about coordinate reference systems and especially scale and TCRS is my attempt to unify the vocabulary for coordinate reference systems so that this core concept can be made interoperable and teachable.
Historically geographic information systems have kept the concerns of map scale separate from those of the coordinate systems definition.
By maintaining intimate and detailed metadata about the coordinate systems of the data they manage so that data can be interoperable combined or overlaid at runtime.
Web architecture requires that resource metadata be encoded into media type specifications. So that runtime exchanges are not necessary or desirable. So we needed to develop the TCRS concept in order to encode it into the MapML or eventual HTML specification
A TCRS has a defined number of integers zoom levels.
A zoom level is an integer proxy for expressing a real world distance units per pixel ratio. In other words, the pixel size at a defined location, depending on the projection typically the projection origin.
The reason the set of zoom levels is defined and not infinite is because in some cases, there isn't a mathematical relation between zoom levels.
In other words they're not necessarily evenly spaced as shown. They may have been chosen for reasons, specific to the application.
And the fact that beyond a certain distance per pixel. It doesn't make real world sense. By agreement and specification, then the zoom levels are defined and known.
For each zoom level in a TCRS, there exists a pair of 2D coordinate systems in which the units are pixels and tiles, respectively.
These coordinate systems follow the conventions of coordinate systems in computer graphics having their origin at the top left of the screen.
With the vertical axis being positive down and the horizontal axis positive to the right of the screen.
The pixel based coordinate system is called a TCRS with axes named x and y, the tile based coordinate system is called a tile matrix. After the OGC concept of that name at its axes are named column and row.
Tiles are defined in 256 square aggregations of pixels and the pixels and tiles are geo referenced by a defined planar transformation to the coordinates space, defined by the projected coordinate reference system or PCRS
The coordinates and units of the PCRS are defined by a mathematical transfer of coordinates to and from a defined geographic coordinate reference system or GCRS according to defined parameters of the projection method.
To additional coordinate reference systems are defined to correspond with the same concepts from the WMS and WMTS standards.
The map coordinate system is defined by the maps dynamic viewport, and has its origin in the upper left corner of the map.
The horizontal axis is named I while the vertical axis is named J this coordinate system corresponds to the image coordinate system in HTML client side image maps.
It's also used by WMS Get feature info requests to record to to query server databases for features at a given pixel within a defined request.
The tilee coordinate system is created relative to each tile and also has I and J axes.
It is created in MapML in order to support MTS get feature info requests.
Thank you.
Amelia Bellamy-Royds: Thank you, Peter.
Amelia Bellamy-Royds: Lots of information there, but I hope it was enough to get people intrigued into looking more and the scope of the project.
Amelia Bellamy-Royds: Um,
Amelia Bellamy-Royds: Our next talk is going to
Amelia Bellamy-Royds: Take another look at MapML, specifically a more critical assessment from the web standard side.
Amelia Bellamy-Royds: Simon Pieters is been involved in web standards and browser development for many, many years. He currently works for Bocoup which is another sort of web browser development, web standards development for hire companies with a specific focus on
Amelia Bellamy-Royds: Testing and cross browser interoperability work and Simon was commissioned over the past few months to sort of assess the MapML proposal as it is and how it can be moved forward. Simon, why don't you take it away.
Simon Pieters: Thank you for that introduction.
Simon Pieters: I'm going to try to share my screen. So let's see if that successful
Simon Pieters: Can you see my screen.
Amelia Bellamy-Royds: Yep.
Yes.
Simon Pieters: Excellent.
Simon Pieters: So hi, everyone. I'm Simon Pieters, I'll talk a bit about Bocoup's review of MapML that we did earlier this year.
Simon Pieters: So again, a short introduction to Bocoup, we're a web consultancy, web platform consultancy firm. We participate in Ecma, W3C, WHATWG.
Simon Pieters: Work on improving the web platform through specifications and test suites, we have experienced standardizing both new and legacy features in HTML and CSS.
Simon Pieters: Also JavaScript and writing corresponding conformance tests for browsers.
Simon Pieters: So we can help with the standardizing new feature is for the web and collaborate with the browser implementers.
Simon Pieters: We participated in the OGC Testbed 16 program to review the technical specifications for MapML. So here are our findings and recommendations.
Simon Pieters: We reported 21 issues for MapML from minor to more fundamental
Simon Pieters: One of the fundamental issues is whether and how MapML should being be an extension to HTML.
Simon Pieters: My understanding is that it's the intent, but it's not really define the such currently.
Simon Pieters: If it is to extend HTML than it should be done properly, and ideally involve the maintainer of the HTML standard in the process.
Simon Pieters: Another aspect is integration with CSS. MapML that it should be scalable with CSS, but it's not defined how
Simon Pieters: I think CSS not does not yet have the necessary primitives to represent web maps without resorting to solutions that are working against the browser, which is not ideal for performance or accessibility as well as other aspects.
Simon Pieters: We reported an issue for the CSS Working Group to consider adding a new panning and zooming primitive
Simon Pieters: For use with web maps. This is one of the primitives or low level capabilities that
Simon Pieters: Brian mentioned. Web maps have
Simon Pieters: Many
Simon Pieters: Possible capabilities that are missing from the web platform, but this is
Simon Pieters: One that we identified.
Simon Pieters: So the CSS working group discussed this
Simon Pieters: In July, and agreed that it would be interesting to investigate, but they need a concrete proposal.
Simon Pieters: So David Baron is
Simon Pieters: from Mozilla
Simon Pieters: And
Simon Pieters: Said that it was interesting, but need a concrete proposal and Tab Atkins is
Simon Pieters: From Google, one of the editors of the many CSS specifications.
Simon Pieters: Essentially agreeing that
Simon Pieters: It's something that would make sense to solve but
Simon Pieters: There's no no proposal yet.
Simon Pieters: So again, going back to the extensible web manifesto that has been mentioned a couple of times.
Simon Pieters: I think the approach that is more likely to have success in changes in browsers at this time, is to start with specifying the primitives, or a low level capabilities that are needed to layer MapML on top.
Simon Pieters: Even if there is skepticism about adding maps to the web. People seem supportive
Simon Pieters: Of adding new primitives that benefits web maps and this approach is in line with the extensible web manifesto, which says to focus on primitives first and then develop high level solutions in JavaScript using those primitives.
Simon Pieters: Allowing web developers to iterate without breaking the web.
Simon Pieters: Another thing we think would be good is to better demonstrate the need for web maps in terms of impact for web developers.
Simon Pieters: One way to do this is to ask about web maps and the MDN developer needs assessment survey.
Simon Pieters: Which is currently in the final stages of preparation.
Simon Pieters: Last year, the survey had responses from 28,000 web developers and the results impacted the prioritization for browser vendors
Simon Pieters: Our summary of work for this review is available at the URL at the top of this slide bit.ly/bocoup-testbed16
Simon Pieters: And that's all I have. Thank you.
Amelia Bellamy-Royds: Thank you, Simon.
Simon Pieters: Thank you.
Amelia Bellamy-Royds: And I'm looking forward to creating the
Amelia Bellamy-Royds: Discussion page and we can get all those links and easily clickable forum so people can go look at and comment on the issues.
Amelia Bellamy-Royds: For our final talk on this theme we're going to switch over a little bit. Satoru Takagi of KDDI has been building maps using web technology for
Amelia Bellamy-Royds: Many years now using a base of SVG and
Amelia Bellamy-Royds: Has developed proposals for what needs to get added to SVG, to make it more Web Map friendly. So he and Peter Rushforth are going to be introducing some of the work they've done on that.
Amelia Bellamy-Royds: Peter, if you're talking, we cannot hear you.
Peter Rushforth: Yes, of course.
Peter Rushforth: Ah sorry Satoru Takagi-san and a colleague from Katie di corporation have developed
Peter Rushforth: Two papers for this workshop which are linked to their
Peter Rushforth: To their agenda item and I promised Satoru-san to to present the introduction, introduce these two
Peter Rushforth: Papers that are very, very interesting and expertly crafted and
Peter Rushforth: I promised to introduce them at the workshop. And I think that there is, in particular, well worth reading because Satoru has been working for years within the many years within the
Peter Rushforth: SVG community in the W3C Consortium to standardize web maps using web technology and
Peter Rushforth: I strongly believe that we share a lot of, you know, fundamental primitive understandings of how the web works and
Peter Rushforth: He has got some spicy commentary, spicy yet polite commentary in his in his papers and the first of them is on decentralized web mapping and it's very important to read them in order. Because decentralized web mapping sort of sets up the second paper and
Peter Rushforth: In decentralized web mapping,
Peter Rushforth: Layers are conceived of as the primitive feature of web maps and are accessible at their undifferentiated URLs, just as in the map ML proposal, but in the in the SVG map proposal
Peter Rushforth: In this framework, the, the target of those URLs is an SVG document that links to an HTML
Peter Rushforth: Logic bundle. And so each layer comes with its logic built into the actual document that is loaded. So what this means is that it can adapt, it's an adaptive framework to virtually any tiling system proprietary or otherwise. And I think that's there's a lot of genius in that in that
Peter Rushforth: Package right there.
Peter Rushforth: And that leads to the discussion of quad tree composite tiling and the standardization of tiling and which Satoru-san has applied the techniques of SVG map to use adaptive quad tree tiling to vector information which is
Peter Rushforth: Which is efficient very efficient and and so for raster data standard file system seem to make more sense plus or minus the different APIs that are
Peter Rushforth: used to access them. But for vector data, because vector data is meant to be efficient, an adaptive tiling system.
Peter Rushforth: Has real performance benefits. So I urge everyone to read those two papers and provide feedback and commentary to Satoru-san and his colleague
Peter Rushforth: Whose
Peter Rushforth: Links are here to their GitHub profiles, but there there are discourse entry for they're talking the agenda is in the agenda. So that's all. Thank you.
Amelia Bellamy-Royds: Thank you Peter for the introduction. Do you have anything to add Takagi-san, or just that we should read the papers.
Amelia Bellamy-Royds: Well, we've all got the papers and
Amelia Bellamy-Royds: The links are in Gitter and in Discourse, I think, then we will take 10 minutes to catch up on that and then start back up with our new theme and panel.
Amelia Bellamy-Royds: Recording again? Take it away, Doug.
Doug Schepers: Great. Hi everyone, welcome back. Thank you so much for joining.
Doug Schepers: Next up is our internationalization and security
Doug Schepers: Presentation and following we'll have 30 minutes, two talks in 30 minutes and following that we will have
Doug Schepers: Our world, our panel, which is worldwide web maps challenges in the global context. So with no further ado, I'd like to welcome Brandon Liu
Doug Schepers: Who is going to be talking to us today about multilingual text rendering and Brandon is the geospatial software engineer from. No, I'm sorry. He's a
Doug Schepers: He's the creator of Protomaps. It's just a new internationalisation focused system for maps on the web. He's been working on map rendering and data tools related to the Open Street Map project since 2013
Doug Schepers: He also created
Doug Schepers: 80s.nyc a Web Map based viewer for historical street views of New York which sounds really cool. Ready to take it away. Brandon, take it away, please.
Brandon Liu: Awesome. I'm going to try to share my screen right now. So please tell me if that's working.
Brandon Liu: Oops.
Brandon Liu: It's one window at a time.
Brandon Liu: Are you able to see that.
Doug Schepers: This weekend. Thank you.
Brandon Liu: Well, telling you will text rendering. Awesome. I'll get started then.
Brandon Liu: So hi, everyone. I'm Brandon, I'm going to talk about multilingual text. That doesn't sound initially like it has a lot to do with maps, but I'm going to explain more about that in just a moment.
Brandon Liu: So why text?
Brandon Liu: I know this
Brandon Liu: Topic this conference is mostly about MapML
Brandon Liu: I'm going to try to go a little bit outside of that scope for this short presentation and talk really about the essence of a map. So in my mind map has geometry
Brandon Liu: In some coordinate system, but it also has textual properties. This might be a data associated with map features. It might be a map labels even.
Brandon Liu: So even if things like putting labels onto maps are outside the scope of MapML, text is so essential to what a map is that is worthy of forward thinking
Brandon Liu: And you might think about this like if you have a vector data set and you want to render it in the browser, you have to show the texts in some way, whether that's canvas or SVG or some or some fashion.
Brandon Liu: And then why do I care about this? A little bit about me.
Brandon Liu: I work mainly with OSM
Brandon Liu: Right now my projects are mainly focused on East Asia, which is going to be relevant to this talk. I'm building a new web API called Protomaps. It uses the OpenStreetMap data set.
Brandon Liu: One interesting thing about OSM. It has a wealth of multilingual content. So it started in the UK in the 2000s, but it's now a truly global project.
Brandon Liu: And I also want to say for this short presentation, it's going to have a very narrow focus on Han or Chinese script.
Brandon Liu: Which is only one part of global text. So I'm not going to get into, you know, text that goes right to left or South Asian scripts, for example. Now that's a huge topic, but I'm only going to focus on one very narrow thing.
Brandon Liu: So sort of following the MapML proposed markup for data sets. I wanted to use this as sort of the illustrating example.
Brandon Liu: Which is a data set that has two features to point features. One of them is Hong Kong, and one of them is Minato which is a special municipality in Tokyo.
Brandon Liu: These are just two point features and you can see they have like a lat long or long lat they have some properties, which is the name in the native script and the population as a number
Brandon Liu: So this is like a pretty basic data set, you know, just as simple as it can get
Brandon Liu: And how might it look on a map. So I just made, you know, sort of these absolutely position divs on an HTML page.
Brandon Liu: That puts you know these place names and data onto the map. And even if you don't read Chine se or Japanese. You might notice something interesting about this map, which is that these two characters are very similar. So the second character in Hong Kong and the first character here.
Brandon Liu: And the interesting thing about this is, is that these are actually the same Unicode code point
Brandon Liu: So the design of Unicode is such that
Brandon Liu: There's a range of character is called the CJK Chinese, Japanese, and Korean unified ideographs and these are glyphs or not really glyphs, but these are characters that were that were unified between the different languages.
Brandon Liu: So there's no way in the data set to actually know that one of them is,
Brandon Liu: It should be rather than the Chinese style and the other one should be under the like in the Japanese style. On the left here, you can see that there is a slight difference between these two characters.
Brandon Liu: And these aren't really cherry picked like this. These variations are quite pervasive, especially in geographic data where certain components of characters
Brandon Liu: Have different conventions and how they're written and Unicode was designed to be legible to users where if you see a variant that is from a different region
Brandon Liu: It should make sense, but it is not really how it's written in that locale. And the other thing I want to say is that place names are proper nouns. And people might be more sensitive to how these are rendered than just body texts on the web.
Brandon Liu: And my main central point in this presentation is to push this idea that maps are inherently multilingual, they're not edge cases. Like I'm I think of documents on the web as being multilingual in some cases like for
Brandon Liu: you know, language education or for travel. But I think the special thing about maps is multilingual text is inherent to any map that you know goes beyond just one national boundary of, for example,
Brandon Liu: So web standards have a lot of things to say about multilingual content.
Brandon Liu: There's a link in this article or there's a link in this presentation to this article that's 'why use the language attribute?' So in HTML text
Brandon Liu: You can add a lang attribute which has it BCP 47 language tag to, you know, the top of the DOM, or even to any element within the DOM.
Brandon Liu: So you can have an individual span or div of text and that has a language attribute that will control how that text is rendered
Brandon Liu: So there's a very powerful solution that HTML already offers, which is to have the element level lang attributes and this is this kind of localization for text is supported directly by markup.
Brandon Liu: And also language attributes are needed for accessibility. If you wanted to have a screen reader, for example, that would pronounce text in a language. You need to know or have some tag about what spoken language.
Brandon Liu: Is associated with that text. This is especially important for Chinese, Japanese, and Korean
Brandon Liu: So overall, there is this sort of tension between the document view of the world, like HTML where documents have a language time versus maps, which is sort of a wild west of different standards or different libraries and you can see on the web, some
Brandon Liu: Some map services they have only one version for the entire world.
Brandon Liu: And if they're rendered on the client side they might still display the local name of a place. And I think that's sort of like a good target
Brandon Liu: For globalization, like if you have a map service in Japan, for example that shows that says Tokyo Bay, like Google Maps here, you still have the native language on the map, even for English speakers or
Brandon Liu: Or users of the website that are using English. And I think that's like sort of a good convention that we have.
Brandon Liu: So what's the state of these localization issues on web maps right now.
Brandon Liu: Firstly, do graphics elements in HTML like SVG or Canvas support element level language tagging.
Brandon Liu: How about web maps in general, if I go to, you know, like a Leaflet Web Map or a MapBox GL or a vector map are these language issues solved sufficiently. And how does this relate to web standards.
Brandon Liu: For SVG.
Brandon Liu: I sort of recreated that same HTML map with an SVG elements and you can see here that Safari, which I'm using right now does not actually handle this.
Brandon Liu: So you can see that these two characters are rendered the exact same way for different languages.
Brandon Liu: You can see the code on the top here. It's to text elements and actually the only major browser to support element level language rendering is Firefox. So Safari, Chrome and edge on they just, you know, they default to
Brandon Liu: One language or the other.
Brandon Liu: Canvas, for example, doesn't really have any localization features.
Brandon Liu: There's no way to specify a language when you are saying this, this run of text
Brandon Liu: In canvas is global, you know, there's sort of this global font property and you don't have any control over the language, there is some proposals on enhancements to the canvas standards to make this work.
Brandon Liu: How about server rendered maps like if you're using that MapML and you wanted to bring in a raster tiles layer, sort of like you would use Leaflet for right now.
Brandon Liu: It's sort of someone else's problem on the server side.
Brandon Liu: There.
Brandon Liu: Most common is to use a library like Mapnik to render maps and even Mapnik right now does not have great support for these locale variants, this is something I'm actively working on, for example, OpenStreetMap. The main
Brandon Liu: Like main tile set called OSM-carto
Brandon Liu: Sort of defaults to Japanese variants for Chinese place names, which is not ideal, something that can be improved.
Brandon Liu: But how about client rendered maps? So client, like most state of the art
Brandon Liu: Map vendors that are done in Web GL day sort of skip this problem completely by shipping their own stack.
Brandon Liu: They Signed Distance Fields which are really good for performance that can be scaled infinitely, rotated.
Brandon Liu: But this approach has very little in common with web standards and it doesn't really reach parity for some scripts such a South Asian scripts
Brandon Liu: These map render is don't really do a great job. The visual fidelity has some trade offs. If you're rendering complex character is like Chinese characters.
Brandon Liu: So I think that web standards have a lot of potential to improve the state of the art.
Brandon Liu: And you can see this in some hybrid app libraries. The one I'm focused mainly on right now is called Tangram, as it was a map sent project and now is by Linux Foundation, but it uses web standard text it renders text to Canvas first move that to the GPU and shows them on the map.
Brandon Liu: There's some performance trade offs here. You can't resize text, and I know OpenLayers it's a similar design. I'm working on a new library called Protomaps 2D, which is vector rendering for Leaflet.
Brandon Liu: In all these cases Offscreen Canvas would be important to make these faster.
Brandon Liu: As an aside, HTML video which we've talked about as sort of analog for making maps work well on the web.
Brandon Liu: Has an accompanying standard called WebVTT for subtitles.
Brandon Liu: Subtitles are exactly this, this problem, which is how to present texts on the web. And you can see here, I just have a video in this presentation.
Brandon Liu: And I put in these characters one rendered in, attempted to be better than Chinese one in Japanese style and it doesn't really handle that.
Brandon Liu: This does, however, working Firefox. So WebVTT has explicit element called Cue language spans to mark up different languages inside of the subtitles and that is implemented inconsistently across browsers, but it is part of that markup standard
Brandon Liu: I'm running out of time.
Brandon Liu: In conclusion, my main point is that multi-language or multi-script maps should not be treated as edge cases, we should think about multilingual out of the box for for for all map standards on the web.
Brandon Liu: text documents on the web with HTML have a good solution right now element level languages. This has potential to improve the state of the art for web maps
Brandon Liu: Graphical standards or anything that is responsible for a presentation to the user, whether that's SVG, Canvas video or a bad element should have those capabilities as well.
Brandon Liu: So you can find me via email or Twitter [email protected] or bdon on Twitter, that's all I have. Thank you.
Doug Schepers: Fantastic.
Doug Schepers: Thank you so much, Brandon.
Doug Schepers: Really a complex issue dealing with languages, especially when when Unicode sorta folded them all into one block.
Doug Schepers: Maybe that was a mistake.
Doug Schepers: We do have a quick question. How, how can we support the same label but multiple languages and offer the choice. I assume that the question is to offer the choice to the user to to to pick one of the labels.
Brandon Liu: I think that would require mapping libraries to have some notion of user language or it would need to be inferred from the user agent, but then that gets into very tricky issues, like for example
Brandon Liu: One common feature is for map labels to be sort of Romanized are transliterated into Latin characters for non Latin scripts and those would be common among different
Brandon Liu: Sort of Latin using languages. So you might need to have some kind of tree or fallback language that says if I'm browsing a map
Brandon Liu: In France that has an English alternative label set. Should I show the English one instead of French one if I don't have French, for example? And I think he gets into a very tricky subset of questions that maybe web standards is not prepared to have a complete solution.
Doug Schepers: Excellent. Thank you so much. That's very thoughtful answer.
Doug Schepers: And with that, it is time now to move on to our next presentation.
Doug Schepers: Thank you once again, Brandon. Excellent. Well done. So next we have Thijs Brentjens
Doug Schepers: He is a geospatial Software Engineer. He's from the Netherlands, he's specialized in open standards from the geospatial domain,
Doug Schepers: Develops applications based on those standards for Genova he has been active for several years and developing national profiles, international standards has been contributing to the development of the Inspire, which is a European infrastructure for spatial information
Doug Schepers: In the Netherlands and internationally. He's also active in the field of web accessibility for the geospatial domain and for and usability, and his presentation today is entitled
Doug Schepers: Excuse me, fuzzy geolocation Thijs. Do you want to take it away. Yeah.
Thijs Brentjens (Geonovum, NL): Thank you, Doug.
Thijs Brentjens (Geonovum, NL): thanks all for this opportunity. I'll
Thijs Brentjens (Geonovum, NL): Try to share my screen now.
Let me see where my mouse is
Thijs Brentjens (Geonovum, NL): Please let me know if you're not able to see this.
Doug Schepers: Looks great.
Doug Schepers: looks right. Okay.
Doug Schepers: Oh my zoom meeting itself is not
That
Thijs Brentjens (Geonovum, NL): Okay. Just one moment please.
Thijs Brentjens (Geonovum, NL): I have a list of participants participants in my screen just in front of my slides so sorry for that.
Thijs Brentjens (Geonovum, NL): Need to close this down. Okay, there we are.
Thijs Brentjens (Geonovum, NL): Yes, thanks.
Thijs Brentjens (Geonovum, NL): Thanks for this opportunity. I'm going to talk about fuzzy geolocation and
Thijs Brentjens (Geonovum, NL): I hope this concept will be clear through my sheets.
Thijs Brentjens (Geonovum, NL): But first, before. I'm going to talk about this how we are going to do this in the digital age. I'd like to
Thijs Brentjens (Geonovum, NL): Give you a thought.
Thijs Brentjens (Geonovum, NL): In the age of analog maps.
Thijs Brentjens (Geonovum, NL): We were, a user of a map was let's say he was alone, he or she was alone in looking at the map. And who else than this user knew exactly what the user was looking for on a map.
Thijs Brentjens (Geonovum, NL): And I think you can imagine now in this new digital age for maps and online resources, a lot of logging or tracking, tracing can be done
Thijs Brentjens (Geonovum, NL): Via user or what the user is doing so.
Thijs Brentjens (Geonovum, NL): The context for this concept of fuzzy geolocation, is that we have found out that the digital applications use geolocation more and more. It's very valuable.
Thijs Brentjens (Geonovum, NL): Especially with with mobile applications, your location is one of the main, let's say, characteristics sometimes for your personal environment. If you're looking at some website or applications and
Thijs Brentjens (Geonovum, NL): But there. There may be there are many use cases where your geolocation, your personal location
Thijs Brentjens (Geonovum, NL): May also be
Thijs Brentjens (Geonovum, NL): It may not be that you wish that it is shared. For example, you want to use a Web Map and navigate to a doctor, you don't want to use your navigation system because you don't want some tech company to trace you
Thijs Brentjens (Geonovum, NL): Or another one.
Thijs Brentjens (Geonovum, NL): A police officers investigation, is investigating some area.
Thijs Brentjens (Geonovum, NL): You don't want to that, that this let's say extra attention is somehow locked somewhere.
Thijs Brentjens (Geonovum, NL): Because it might be a security risk at some point or might may compromise privacy and it may sound a bit far fetched, but in the Netherlands, we have this we have had a very big debate on
Thijs Brentjens (Geonovum, NL): COVID-19 Tracing apps and also that the geolocation was not allowed to be part of it because of fear of people that their personal geolocation would be stored somewhere on servers owned by the government. So even this this let's say this privacy awareness that that many users have nowadays.
Thijs Brentjens (Geonovum, NL): It puts us for an extra assignment. We have to do better in communicating our geolocation. So yes, I think we can do better. We should just not send
Thijs Brentjens (Geonovum, NL): An exact geo location or area of interest to all kinds of online services, just like we have, for example, a privacy mode for
Thijs Brentjens (Geonovum, NL): browser tabs or do not track me kind of things. And now it's very, a binary you either provide your geolocation or you don't, and but still if you are using online data services, your, your, the area you are interested in is still communicated over
Thijs Brentjens (Geonovum, NL): To services so
Thijs Brentjens (Geonovum, NL): I think, and this is an idea we have in within Geonovum
Thijs Brentjens (Geonovum, NL): Originating from this COVID-19 discussion as well.
Thijs Brentjens (Geonovum, NL): We should do better. And the thing is, how can we do it. And I'm now going to present a sample. An example of an interaction pattern how we could maybe improve this, but I have a very either. I'd like to challenge you in sharing other ideas as well.
Thijs Brentjens (Geonovum, NL): So this is concept of fuzzy geolocation. We have been talking now in Geonovum.
Thijs Brentjens (Geonovum, NL): For example, as a user, I'd like to have a map around this specific location you see here.
Thijs Brentjens (Geonovum, NL): Very low, around my house I
Thijs Brentjens (Geonovum, NL): Currently, that this location is directly sent to some
Thijs Brentjens (Geonovum, NL): To some online service. I'm getting a notice here that my internet connection is unstable is am I still
It's still
Badita Florin: It's
Doug Schepers: You look and sound fine.
Amelia Bellamy-Royds: The audio is breaking up a little so if you have any other apps in the background that, closing them sometimes helps.
Thijs Brentjens (Geonovum, NL): So there's no there shouldn't be anything
Brian Kardell: Stopping your
Thijs Brentjens (Geonovum, NL): Problem is that my children are looking a movie now but
Thijs Brentjens (Geonovum, NL): Sorry for that.
Brian Kardell: Maybe, maybe.
Doug Schepers: Twice. Maybe you can stop your video.
Yeah.
But otherwise, just go ahead. Ah.
OK.
Thijs Brentjens (Geonovum, NL): I hope my slides are skewed are cleared and okay, what we can do, instead of sending the the area.
Thijs Brentjens (Geonovum, NL): Of interest directly, we cann also
Thijs Brentjens (Geonovum, NL): Change maybe the center of the map or enlarge the area or add random other areas. Before we engage other online services and use this kind of this kind of pattern to retrieve information from from APIs and then with some post processing, go back to the end user and
Thijs Brentjens (Geonovum, NL): filter out only the relevant part for the end user.
Thijs Brentjens (Geonovum, NL): It puts a burden, a bit more on some APIs, on our services. So we realized that, but as a thought that this might help in let's say we're putting more privacy, security or
Thijs Brentjens (Geonovum, NL): Or at least not compromise privacy that much and
Thijs Brentjens (Geonovum, NL): So this, this fuzzy, this fuzziness, it can be added by we think now into two points, for example by a third party, a broker, that adds all kinds of
Thijs Brentjens (Geonovum, NL): Smart algorithms or smart ways to add fuzziness and do all communication with all my services and it can also a broker can also provide additional services, for example, cache other map resources, add random requests, or maybe fake users
Thijs Brentjens (Geonovum, NL): To to not make clear where you are at that point.
Thijs Brentjens (Geonovum, NL): Another approach might be that the mapping clients or maybe user agents or maybe in browsers themselves. There may be smarter ways of preparing requests before you engage online services.
Thijs Brentjens (Geonovum, NL): So these are some ideas we have now. And I'd like to conclude this with with an invitation to collaborate on this idea. I know this this community I'm presenting for now is quite diverse
Thijs Brentjens (Geonovum, NL): And I hope that that many of you have ideas how we can
Thijs Brentjens (Geonovum, NL): Help or improve privacy and security for for these kind of geospatial applications.
Thijs Brentjens (Geonovum, NL): Our organization will create a proof of concept and we will share all the resources, I will put them on Discourse as well put pointers to them.
Thijs Brentjens (Geonovum, NL): We will provide some OGC APIs if you need them and you want to try some things for ourselves but but the main thing is I'd like to ask you to share your ideas, your criticism as well and and help us in improving this idea.
Thijs Brentjens (Geonovum, NL): I'll provide you my contact details later, we are also available to help. As I said, we will provide some OGC APIs is that you can use for testing or to demo the, the concept
Thijs Brentjens (Geonovum, NL): But if you need any other help, please contact us because we think that this community might be a very nice and powerful community and we'd like to
Thijs Brentjens (Geonovum, NL): Get the, bring this further together so
Thijs Brentjens (Geonovum, NL): That's about what I'd like to talk to you about fuzzy geolocation and privacy. I hope my message came across
Thijs Brentjens (Geonovum, NL): And that it was not disturbed too much.
Thijs Brentjens (Geonovum, NL): And I hope to hear from you.
Doug Schepers: Thank you Thijs. That was a really interesting presentation that I, I didn't have. I was able to see everything. Fine. I don't think you need to worry.
Doug Schepers: This I have, this reminds me of things like Tor and other sort of obfuscation techniques that have been used in non map tech on map domains. So it seems sensible to me. Uh, let's see if there are any questions, um,
Doug Schepers: Let's see.
Doug Schepers: What is the path that you recommend to see this done, should there be an OGC geolocation privacy/fuzzy API should maybe maybe be something in W3C. See, I know the W3C tackled this
Doug Schepers: Or tackled some of the controversy here when they, when they added the Geolocation API to the browser. So how do you, what do you think that the path forward is do you think this is something goes in the browser. Do you think this is a protocol thing.
What do you think
Thijs Brentjens (Geonovum, NL): Good question, in fact, I don't know yet. I think one of the things that we need to find out what's the appropriate place or the way to tackle this. But it might not be discussion whether we should do it either in browser or using some kind of other protocol. It might be an end as well.
Thijs Brentjens (Geonovum, NL): I think for the, let's say, the maximum reach out. I think it would be best if browsers would support some kind of some kind of pattern to
Thijs Brentjens (Geonovum, NL): Do, add this fuzziness geolocation, but I can imagine that for some organizations they are looking for other security measures and they will have their own
Thijs Brentjens (Geonovum, NL): Let's say their own brokers themselves.
Doug Schepers: Hmm.
Thijs Brentjens (Geonovum, NL): Be sure that they are in control of what is sent to other services. So let's find out together. I'd say, but
Doug Schepers: Some someone else notes, that asked a question. Could it be could user agent provide this in a privacy in a private map mode. In other words, in an incognito mode, could they, they could communicate that. So maybe it doesn't.
Doug Schepers: It isn't an always on things. So it doesn't always do the but if you're doing a something like Tor, for example.
Doug Schepers: If there are enough queries. Could you actually aggregate them through a third party and sort of allocates, allocate who gets what information based on this aggregation, sort of like the multiple users doing that.
Doug Schepers: Um
Doug Schepers: I didn't friend that as a question. Do you want to answer that?
Thijs Brentjens (Geonovum, NL): I think very powerful options will be
Thijs Brentjens (Geonovum, NL): If we use
Thijs Brentjens (Geonovum, NL): Let's say broker somehow
Thijs Brentjens (Geonovum, NL): Yeah, because then we can add some all kinds of additional services, we can, you can, if you do it in a user agent. There's always the trigger event coming from a user agent and if you do it using some kind of a broker. You can even add
Thijs Brentjens (Geonovum, NL): That's what I meant with fake users.
Doug Schepers: Yeah.
Doug Schepers: Yeah yeah
Thijs Brentjens (Geonovum, NL): If you are not using it, you can still interact a service or you can do caching or, you know, with all these more modern APIs and vector tiles, it's, it, it may be easier to build such a system.
Doug Schepers: That's great. That's really, really.
Thijs Brentjens (Geonovum, NL): Just a thought. It's not
Doug Schepers: Well, again, everyone, uh,
Doug Schepers: Both Thijs and Brandon ask you to reach out to them so
Doug Schepers: If this is a topic that interests you, please make sure to talk about it in our various channels for the workshop, but also reach out to them directly. And we'll
Doug Schepers: Hopefully some good things will happen from from the presentations, both really great presentations. Thank you so much. And I'm going to have the pleasure of joining you,
Doug Schepers: Having you join me again. We're going to start the panel now.
Doug Schepers: So the panel today is called
Doug Schepers: World Wide Web Maps: challenges in the global context. And I'm going to reintroduce
Doug Schepers: Brandon and Thijs. And there's two other participants as well Siva and Nicolas and so
Doug Schepers: Let's get started right now if that's all right.
Doug Schepers: So,
Doug Schepers: Let's start with Thijs, Thijs, you're already here. Again, Thijs is a geospatial software engineer from the Netherlands, he specialized in open standards and the geospatial domain.
Doug Schepers: And developing applications based on the standards for Geonovum. He's been active for several years in developing
Doug Schepers: National profiles of international standards and he's been contributing to the development of Inspire, which is the European infrastructure for spatial information in the Netherlands and internationally.
Doug Schepers: He's also active in the fields of web accessibility and usability in the geospatial domain. So Thijs you want to give us
Doug Schepers: Any additional words you seem to be frozen.
Thijs Brentjens: Frozen now?
Doug Schepers: Nope.
Doug Schepers: You're unfrozen now, go ahead
Thijs Brentjens (Geonovum, NL): Oh, okay. Oh, additional words.
That's my video, maybe it's better
Doug Schepers: That's better.
Doug Schepers: Thijs, Do you have any other anything else to say about what you're doing.
Thijs Brentjens (Geonovum, NL): Oh, no.
Thijs Brentjens (Geonovum, NL): No, I'm not saying nothing else to add, for now. No.
Doug Schepers: Okay. Great. Thanks. Okay.
Doug Schepers: So to reintroduce Brandon
Doug Schepers: Brandon is the creator of Protomaps, which is an internationalization focus system for maps on the web.
Doug Schepers: He's been working on a map rendering and Data Tools related to the OpenStreetMap projects, since 2013. He also created
Doug Schepers: That's 80s.nyc, a web map viewer for historical street views of New York and Brandon you want to say anything more about what you're working on right now.
Brandon Liu: I don't have anything to add now, thanks.
Doug Schepers: Okay. Wonderful. Okay, next we have Siva Pidaparthi, Siva is a software developer working at ESRI with a focus on mapping visualization building desktop applications and make mapping services on the server.
Doug Schepers: He works with design and development, OGC related mapping services in desktop clients, REST based services and clients and web maps stored as documents online, tools by various platforms.
Doug Schepers: Siva, can you say hi.
Siva: Hey,
Siva: Hi everybody. Can you hear me.
Doug Schepers: Yep, we can hear you fine. Good.
Doug Schepers: Thanks. I was just told that my internet connection is unstable if I drop off. Y'all know the questions so
Doug Schepers: And Brent and I also sent them to
Doug Schepers: Peter Rushforth and
Doug Schepers: Hopefully if if something happens to my connection. Peter can can step up.
Doug Schepers: And finally, we have Nicolas Palomino, Nicolas is relatively new to mapping,
Doug Schepers: He's more focused on the subsystems underlying the development of web maps and the utility for the industrial and for industrial uses like
Doug Schepers: Big data manipulation and observation, advanced analytics and AI integration and other upcoming telecommunications technologies for planetary observation and beyond.
Doug Schepers: Nicolas. Do you want to say hi.
Doug Schepers: Yeah.
Nicolas: Hello.
Okay.
Doug Schepers: All right. Wonderful. Um, hey y'all.
Doug Schepers: Excellent. Let's go ahead and get started.
Doug Schepers: The first question we have is,
Doug Schepers: OGC and W3C have spatial data on the web, best practices, you know, OGC is very actively working on new API specifications. It could facilitate better publication and easier use of geospatial data.
Doug Schepers: But that's the theory. How do you think we put this in practice on active projects and y'all can just jump in, everybody's free to answer the question.
Doug Schepers: Do we want to start with maybe a
Doug Schepers: Thijs
Thijs Brentjens (Geonovum, NL): Yeah, well,
Thijs Brentjens (Geonovum, NL): I think this is an interesting one because on the one end you say these APIs are quite new and
Thijs Brentjens (Geonovum, NL): There might be large interest, but what we see currently in at least in Netherlands says that there's not that much interest in really implementing them because of legacy constraints.
Thijs Brentjens (Geonovum, NL): One driver could have been that on the European level, we have a law prescribing, what kind of technology to use to exchange information between countries, and I don't know if this is solutions, but this might be
Thijs Brentjens (Geonovum, NL): I think one of the aspects, is that too, especially for governmental organizations, we might need stronger policy on using APIs.
Thijs Brentjens (Geonovum, NL): Knowledge that I think there are many challenges there but that's one of the things I'd like to propose and of course doing experiments in live environments. But that requires organizations. Okay, of course, are set up.
Doug Schepers: Siva, Nicolas, Brandon, any thoughts.
Siva: I'd like to pass.
Doug Schepers: Okay, Nicolas?
Nicolas: I'll pass on this one too
Doug Schepers: Okay, great. Brandon, you have any thoughts on this.
Brandon Liu: Yeah.
Brandon Liu: I think one interesting thing about sort of spatial especially for open source spatial is that that I know the landscape, really, it's not that large like, a lot of sort of developers are working with PostGIS,
Brandon Liu: And to have or fun sort of a reference implementation or a driver for some of these major special projects, things like PostGIS that and QGIS or yeah um and also doodle.
Brandon Liu: I think is having a good implementation that makes it into, you know, like a release has a big impact.
Brandon Liu: So I think like, it's sort of an advantage that it's not like JavaScript frameworks, where you know there's 101, you know there's a new JavaScript framework coming out every day.
Brandon Liu: I think a lot of this sort of open source spatial world is quite stable. So having a reference implementation in those is a pretty reasonable target. Okay, great. Yeah.
Doug Schepers: That makes a lot of sense. [alarm rings] Oops. Stop.
Doug Schepers: Okay.
Doug Schepers: Apologies. I'm just timing you
Doug Schepers: And my clock went off and you had a perfect timing.
Doug Schepers: Okay. So the second question I have is, there are many localization features of maps that would benefit from browser support.
Doug Schepers: Some examples are the ability to produce place names and the writing system that the user can use as we saw earlier and Brandon's presentation, designing or authoring a multilingual map based on the locale.
Doug Schepers: Handling dynamic formatting of numeric or time related data and other interesting cartographic practices from around the world that aren't yet widespread in digital mapmaking like vertical text.
Doug Schepers: Which is supported in some aspects in in the web. But how often is it using web mapping. So what should web browsers and web standards do to provide solutions. I'd like to start with Siva here.
Doug Schepers: Siva, any thoughts.
Siva: Can you hear, can you hear me. Yeah.
Siva: Yeah, sorry. Yeah, I like the Brandon's presentation on this topic.
Siva: The only additional thing I wanted to talk about in that respect is if I as an author want to support multiple languages within the same map.
Siva: Then I should be able to advertise or like, you know, provide the metadata of what the languages are that this particular map supports that way.
Siva: The browsers will allow the users to pick which language to use. For example, instead of just locking to one specific language that the browser is pointing to.
Siva: So yeah, that those were some of the thoughts I have. I always deal with the dynamic, dynamic rendering or like the server side rendering aspect of it. But I think for WMTS. For example, you could potentially use this tile, for example, for the language.
Siva: But do you will have to come up with some kind of a formalization of this language feature which in the metadata for the WMTS, for example.
Siva: Then you'll be able to use tile or other template parameters for language. For example, where you could make a given map multilingual
Dough Schepers: Hmm.
Doug Schepers: Yeah, that makes a lot of sense. Nicolas, do you have anything to say on this one.
Doug Schepers: If you do, you're muted, if not. Let's move on to
Doug Schepers: Brandon
Brandon Liu: Are you able to hear me.
Brandon Liu: Yes. Okay, cool. Um, some thoughts on maps and languages.
Brandon Liu: I think one thing you see common on the on web maps is I think I mentioned this earlier but transliteration of place names. For example, if a place name isn't an online script, then the backend might provide
Brandon Liu: Yeah, the backend might provide a Latin transliteration which should be able to be served to all users that use Latin scripts.
Brandon Liu: Now, like, in that case, that's kind of open ended. If you look at how BCP 47 language tags are structured. You wouldn't want to specify every single, you know, German, French
Brandon Liu: English, all those but there might need to be some intermediate sort of like scripts tag that defines certain languages as a lot like as using certain writing systems.
Brandon Liu: Like I haven't thought about this a lot, and there might be some fatal flaws to this approach, but I think that would get you part of the way there.
Brandon Liu: You know, in terms of being able to show maps to users in different locales. Now how much that that interacts with web standards, I think, is
Brandon Liu: Is a tricky question because I think for something that's for something to become a web standard, it's not good to give like a half-baked internationalisation solution, like it's not good if
Brandon Liu: If the internationalization solution is just minimum viable product that only works for languages like that. That only works for left to right, languages, for example.
Brandon Liu: Right, so I think like
Brandon Liu: There needs to be a lot of care in pushing something as a standard versus having a low level set of tools that can be used to accomplish something
Brandon Liu: And I think that's like one of the overall tensions between talking about you know Map ML versus here's a bunch of JavaScript do something with it.
Doug Schepers: Sure.
Brandon Liu: So I think that is
Brandon Liu: I don't really have
Brandon Liu: I guess the knowledge and know what the right approaches here.
Brandon Liu: The second thing I want to talk about that I mentioned is
Brandon Liu: Things like vertical text that's something I added to the question list.
Brandon Liu: It's something that I really like. Or it's a topic I'm interested in, and I think the browsers
Brandon Liu: Have a lot of good progress in making that work well on the web, even though it's not used.
Brandon Liu: Like for example for CJK, it's common for for print typesettings to use the vertical text on the web, sort of the status quo is for text to always be horizontal, it would be nice to have that as something that's well supported and web maps.
Brandon Liu: For example, if you look at print maps that are published in Chinese for features that are mostly a vertical from the perspective of, you know, the viewer.
Brandon Liu: They will label those vertically and that's like a very common practice in print maps, but on the web, there's only a couple of rendering libraries that support that.
Brandon Liu: So I'm curious if there's some way that
Brandon Liu: The things that have been built for
Brandon Liu: Web browsers already can influence broader cartographic possibility
Brandon Liu: For web maps.
Doug Schepers: That's, that's a definite definite that's definitely a
Doug Schepers: An area where we need to look at what the standards are already doing and what browsers already doing and have that inform what we're doing with maps
Brandon Liu: It's such a deep rabbit hole because a lot of web maps also need text on curved paths, and that's something that's
Brandon Liu: That's something that people want for SVG, for example, I'm not sure what the current status on curve text is
Doug Schepers: Yeah, I can tell you that curve text does work for SVG. So bringing that into
Doug Schepers: And that works across browsers. So bringing that into it should
Doug Schepers: Should be possible. I'm going to ask
Doug Schepers: Thijs if he has anything to jump in here.
Thijs Brentjens (Geonovum, NL): Nothing to add.
Doug Schepers: No. Okay. Um,
Doug Schepers: I'd love to go in in further, but we also have more questions, um, this is a fertile topic for conversation.
Doug Schepers: So the, the next question. Thank you all for for those thoughtful answers. What are the challenges for security and privacy for personal geospatial data in international context Thijs, can you start with this one.
Thijs Brentjens (Geonovum, NL): Yeah. Well, for those who heard my presentation before I think we, the main challenge in the end is that we need to
Thijs Brentjens (Geonovum, NL): Get in between the ears in our heads that that privacy and security may may become, you know all the benefits we have to geospatial data. They may also have a, we have to pay a price for it with privacy and security.
Thijs Brentjens (Geonovum, NL): So that, that's maybe the main challenge and then it comes down to, how can we
Thijs Brentjens (Geonovum, NL): act upon it. So I'd say propose experiments, but also share ideas and maybe like you have if you do a security tests in for web applications, you have this list of OWASP.
Thijs Brentjens (Geonovum, NL): OWASP? I'm not sure if I pronounced correctly, but there's just checklists, you need to check whether you are, you comply to them or not. It gives them new ideas, what you can do for security and privacy. We don't have that as far as I know, for geospatial applications.
Doug Schepers: Right
Thijs Brentjens (Geonovum, NL): And I think that that's one of the things that in an international context, we might try to
Thijs Brentjens (Geonovum, NL): Work on create such a list.
Doug Schepers: Right.
Thijs Brentjens (Geonovum, NL): And then of course we have the technology implementation, etc. But it should also start with creating all those kinds of risks and identifying them and share them and help each other out with that. Get in the awareness, let's say,
Doug Schepers: Absolutely. Siva, do you have anything to add here.
Siva: No, I don't have nothing much.
Nicolas?
Doug Schepers: Okay, Nicolas, we're not hearing you.
Doug Schepers: If you,
Doug Schepers: Okay and Brandon, do you have anything to add here.
Doug Schepers: Hopefully we still have Nicolas online.
Brandon Liu: Nope.
Doug Schepers: Okay, great.
Brandon Liu: Um,
Doug Schepers: Yeah, this is definitely a topic with, internationalization touches on law and
Doug Schepers: Ethics, privacy, security, all of these things are multifaceted international issues, um,
Doug Schepers: So,
Doug Schepers: Next question
Doug Schepers: We have here is Web Mercator
Doug Schepers: Is a defacto standard for the web. But as well and flaws, for example, like Pacific centered mapmaking. What's the right balance for web standards and making these choices for users and developers? Who wants to start off here.
Doug Schepers: Siva, Thijs, Brandon, Nicolas
Brandon Liu: I'll start.
Doug Schepers: Sure. Thank you.
Brandon Liu: Um, yeah, I think maybe it's a little bit of a gut reaction, but I think to sort of
Brandon Liu: Sort of. Sort of privilege Web Mercator as
Brandon Liu: You know, the first class frame of reference for web maps, I think that might get some pushback from parts of the world.
Brandon Liu: Especially like, you know, just like, because I think the truth is, for a lot of like map presentation layer is they will say,
Brandon Liu: If you have features that cross the integrity and you need to pre process them so that you know like the those features they only go to, you know, from whatever, to 180 and from -180 to whatever
Brandon Liu: And I think that it's it's a little bit tough because I feel like the number of applications that are affected by this issue is large
Brandon Liu: And the solutions are really non trivial because the solutions is essentially like you might author your GeoJSON to have coordinates that cross the entire meridian.
Brandon Liu: But then in order to make it work correctly, you need to bring it alive right like Turf.js that you know slices up your future is, for example, and that's already like approaching the level of developer sophistication that is that is not as simple as just putting some markup on a map.
Brandon Liu: So I think the entire issue of like of map coordinates, it does demand and inherent sophistication like mathematical sophistication.
Brandon Liu: That is, might be a hard sell for this. Imagine the audience of, you know, every web developer in the world can author, you know, spatial content.
Brandon Liu: I don't have a good answer. It might just mean that we need to
Brandon Liu: Like
Brandon Liu: You know, suggest a set of libraries to do spatial operations in the browser.
Brandon Liu: I'm not sure if anyone else has suggestions.
Brandon Liu: On this issue of map projections and you know different centers of projections. Like if you wanted to have a Pacific center Mercator maybe just adding that that other option might be a possible solution. I'm curious what other people have to say.
Doug Schepers: I think MapML tries to address this by actually having some projections built in. So that's, that's some ground for thought. Siva, Thijs, anybody else. By the way, folks, I'm, I apologize. Nicolas is
Doug Schepers: Apparently, having some sound, sound issues, unfortunately. So if he has an answer. He's just going to type it to me and and I'll read it out. But, I apologize, Nicolas, that this isn't working for you.
Doug Schepers: So Thijs, Siva, do you have any thoughts about the Web Mercator?
Thijs Brentjens (Geonovum, NL): Thijs here. I think I really like this topic as as a discussion topic because it's very hard one to crack this nut.
Thijs Brentjens (Geonovum, NL): And
Thijs Brentjens (Geonovum, NL): What we see now is that that many people and
Thijs Brentjens (Geonovum, NL): children growing up with Web Mercator they think that Greenland is
Thijs Brentjens (Geonovum, NL): Maybe as large as Africa is is all content know so it might distort even the image we have of
Thijs Brentjens (Geonovum, NL): Countries, or whatever. So it's, it's, I think it's a very important topic, and at the same point Just as Brandon pointed out, it's very hard to explain to others, not in the geospatial, not working in as a geospatial, with geospatial knowledge, projections are hard and
Thijs Brentjens (Geonovum, NL): Especially if all kinds of libraries support mainly a Web Mercator, if that's the Go To projection
Thijs Brentjens (Geonovum, NL): And you need to finish off a project, very quickly. That's what you do all kinds of resources are available in that projection only
Thijs Brentjens (Geonovum, NL): So I think there's a major challenge and can we find a reasonable alternative for some use cases somehow and and are we able to get all kind of software working. That easy, that we can use these
Thijs Brentjens (Geonovum, NL): Alternatives as easy as we cannot
Thijs Brentjens (Geonovum, NL): I don't have a real answer to that, but I think it's a very important topic with more impact than just let's say a mathematical discussion.
Doug Schepers: Yeah, absolutely. Definitely goes, I mean there's there's definitely goes to a social justice and international
Doug Schepers: And inclusiveness issue so and if anything, hopefully what maps are, maps will do is bring people together around the world.
Doug Schepers: So we have one more question. We prepared.
Doug Schepers: I don't see anything from Nicolas here, is Siva, did you, you did you have something to say Siva?
Siva: Nothing much. The only thing I would say about that is, like, like, you know, when we are looking at new standards, like, you know, we should also be thinking about other coordinate different systems, not just
Siva: Like you knowWweb Mercator like WGS84 or whatever, right, like, you know, which are good for the global data, but for local they are not very good. So I think it is just a mindful kind of a thing.
Siva: Where you know we should just take care of
Siva: Additional coordinare reference systems into the account. Yeah.
Doug Schepers: Yeah, I really liked the idea of
Doug Schepers: Perhaps promoting some other non Mercator projection that that could maybe catch in the public imagination. So it could be easy for people to, not just easy for them to do, but easy for it to be top of mind for them.
Siva: Exactly that.
Doug Schepers: That could be of help. Finally, the last of the prepared questions WPC is a leader and accessibility. Like, for example, you know, the Web Content Accessibility Guidelines and accessibility is now demanded by law in several countries, but is difficult and often not taken seriously.
Doug Schepers: To apply these guidelines for mapping and geospatial data.
Doug Schepers: I'll note that we have two upcoming panels later in this workshop on accessibility, but in an international context, what do you have any thoughts on how we can make this easier.
Doug Schepers: Siva, we'll start with you.
Siva: Um, I come from a desktop world, you know, where the standards are pretty like, you know, standard, I would say, in that sense, and we comply to a lot of
Siva: The standards and we pay attention to it. We make sure every bit of UX we have works well. But I can understand how this can be complicated for a browser or browser applications which has to deal with lots of generic you know controls and implementations are elements, basically. Yeah.
Siva: That's all I have to say I don't have much expertise on the website.
Doug Schepers: Okay.
Doug Schepers: Thijs?
Thijs Brentjens (Geonovum, NL): Well,
Thijs Brentjens (Geonovum, NL): Me personally, I think this is a very important topic in you see the on W3C conferences that that the attention for accessibility is there, always there and it's not in the geospatial work and then simply this, this idea that maps are visual and it's visual only, it's
Thijs Brentjens (Geonovum, NL): Just what we do. You can't make that accessible. So we just don't do it.
Thijs Brentjens (Geonovum, NL): And I think they're there are again we maybe we should share a more ideas of what we can do to make things accessible to make maps and the information on maps accessible and it requires is also to step or maybe it will step back and think of what maps are just as a representation
Thijs Brentjens (Geonovum, NL): Of some data. And there are other ways for that they may not be the ones you prefer as a geospatial developer or they may not be as user friendly as you might think. But I think we need to
Thijs Brentjens (Geonovum, NL): discuss that more and also try to have a common libraries, Brandon pointed out in an earlier question common use libraries, we, we should try to improve accessibility in these libraries.
Doug Schepers: Right
Thijs Brentjens (Geonovum, NL): That those are things I'm thinking of. But I'm for sure other experts in this in this workshop. Are they are there a lot of interesting things to say. Yeah. On this, I think,
Thijs Brentjens (Geonovum, NL): But, but it also start with the idea breaking down the idea that we wish that maps are not easy to make accessible because I think there are options and
Doug Schepers: Okay well we're going to explore some of those options. Later on in the
Doug Schepers: Workshop.
Doug Schepers: Brandon. Do you have any thoughts or Nicolas?
Doug Schepers: If not, we have another question. Oh, Brandon, did you have something to say.
Doug Schepers: No. Okay.
Brandon Liu: Thanks.
Doug Schepers: Yeah, uh,
Doug Schepers: So we have a couple of where we have actually several questions, we only have four minutes left. How are context menus handled internationally? And I think this came in, Brandon, while you were talking, so maybe do you want to handle that first
Brandon Liu: Context menus, is it specific HTML?
Doug Schepers: I don't Know, I think it's really thinking about
Doug Schepers: I'm not sure exactly
Peter Rushforth: What I was thinking about the maps or, you know, we have a layer control and there's some, you know, you have to have internationalization considerations in providing a widget. So there's going to be, you know, like challenges involved there. So I just wanted to see what
Doug Schepers: You mean like vertical versus horizontal, Peter?
Peter Rushforth: Yeah, okay.
Brandon Liu: Right. I think the good solution is just to say anything.
That
Brandon Liu: Like, that's just an HTML sub DOM within that thing that's rendered
Brandon Liu: I mean, that's the approach that I think Leaflet takes is you can just put whatever you want inside of an element that's rendered on the DOM. And if that's if that's a spec, you know, I have no idea how hard that is to implement
Brandon Liu: Because that seems like you could get into a lot of pathological cases.
Brandon Liu: But it seems like that is the best internationalize that that's the best internationalization solution because anything that's that is capable with regular HTML can just apply within that context menu. I mean that's ideal for my perspective.
Doug Schepers: We actually have Nicolas said
Doug Schepers: I'm going to read his reply here
Doug Schepers: For question three about privacy. He says, Privacy is one of one of the most important components of the system.
Doug Schepers: He doesn't know what challenges exactly what it could bring as as as we apply as we actively apply such applications because laws differ from country to country. Another important thing, I think, is that this could be possible.
Doug Schepers: Could possibly generate a large amount of data as it turns out, this data could be a matter of national security as well. And that actually leads into another question that we had,
Doug Schepers: Which was
Doug Schepers: From Fred Esch, if we have the time, in a global challenge how do data costs and performance get factored in Siva, have you, has ESRI
Doug Schepers: Looked into this. Have you thought about this.
Siva: Um, yeah, I'm not that much on the content side of the things so I might not be able to answer this, yeah.
Doug Schepers: Okay, any of the other any of the rest of you have thoughts about that.
Thijs Brentjens (Geonovum, NL): Thank you. So I don't understand fully understand the
Thijs Brentjens (Geonovum, NL): Question or the
Doug Schepers: Thijs, I think it is. I think you kind of touched on in your presentation.
Thijs Brentjens (Geonovum, NL): Data okay the data we
Thijs Brentjens (Geonovum, NL): We may or burden.
Doug Schepers: We only have we only have one minute left. So if you can just keep it very brief.
Thijs Brentjens (Geonovum, NL): Okay. I think it's a challenge, but if you use, for example, smart cacheing systems, you might be
Thijs Brentjens (Geonovum, NL): Able to reduce load.
Thijs Brentjens (Geonovum, NL): Maybe on some other services as well.
Thijs Brentjens (Geonovum, NL): But in the end, adding all those kind of extra things will add
Thijs Brentjens (Geonovum, NL): Asks something extra, somewhere.
Doug Schepers: Right.
Thijs Brentjens (Geonovum, NL): Either in processing vector tiles, either in, you know, it will it will
Thijs Brentjens (Geonovum, NL): It will be at some cost.
Doug Schepers: Y'all thank
Doug Schepers: You so much. This has been great.
Doug Schepers: Thank y'all so much for participating in this panel. Sorry for the technical snafus, especially to Nicolas. Thank you everybody for
Doug Schepers: For attending or for watching afterwards, and I hope that all these conversations, come back around, please contact the individuals who participated in this if if you have thoughts, either in the workshop or afterwards. And thank you so much and have a wonderful day.
Brian Kardell: Thank you.
Brian Kardell: You too.
Doug Schepers: Bye. Oh.
Thanks, everybody.
Amelia Bellamy-Royds: Thanks.
Amelia Bellamy-Royds: Okay, we're sliding into one of our breakout sessions. Peter and Gethin, do you want us set that up. I think we're just going to continue using the same
Amelia Bellamy-Royds: Chat. So if you're interested in extending GeoJSON for web applications. Please stay on. We've got a couple talks on that topic.
Peter Rushforth: Over to you Gethin.
Gethin Rees: Okay, thanks very much, Peter. So welcome to the first breakout
Gethin Rees: Group, I believe, of the
Gethin Rees: Workshop.
Gethin Rees: I'm a curator for digital mapping at the British Library and
Gethin Rees: We've got a couple of presentations from people that work with cultural heritage detail now. Um, I believe that this is a valuable perspective for the workshop in a couple of ways. Um, first, um, it was really interesting to hear about
Gethin Rees: people's thoughts about Mercator projection earlier, you know, I'm being a curator interest in history of cartography.
Gethin Rees: You know, I believe the, is really interesting. How big could test that when Mercator projection is and and i think working with cartography can help us understand
Gethin Rees: Projections going forward, but also second
Gethin Rees: Is the use, we encode your heritage, we use web maps a lot to present collections for discovery and interpretation.
Gethin Rees: Now here we have developed to open standards and within our relatively small community. That's why it's a good day to outline them. So we're going to just talk about a couple of the
Gethin Rees: Couple of on the extensions to GeoJSON that we've been working within that community. And we're not suggesting that these should be added to the MapML spec
Gethin Rees: But we are interested to see, hear about by views from a broader community here related to these developments and see what the reaction of a wider audience will be on
Gethin Rees: It is a breakout group. So these are going to be quite short presentations and afterwards and we're hoping to always, just in general about the relationship between a MapML and GeoJSON and we'll be taking, suppose if the organizers can
Gethin Rees: Run this but I think in the initial instance will be taking questions and the Gitter channel. Um, I think there's
Gethin Rees: You know the number of participants is quite manageable. So if participants is meant to be a breakout group. So if it's okay with the organizers of participants did want to
Gethin Rees: Mention the Gitter channel that they had something to see perhaps you could unmute themselves and speak as well. Is that is that is that okay?
Amelia Bellamy-Royds: That makes sense. I mean, we've got 16 people on the line right now so we can probably just open this up as a chat.
Amelia Bellamy-Royds: Presentations, of course, to start it off.
Gethin Rees: Yeah, that
Gethin Rees: Says, um, yeah. So this is
Gethin Rees: A couple of short presentations on first. In cultural heritage we deal with cultural information and so nuance, uncertainty and really the humanity
Gethin Rees: Of these data not peripheral concerns. Representations of place can be at odds with positive positive is systems like coordinates. And so that's what a lot of work to focus on data modeling -
Gethin Rees: The semantic structure here offers flexibility and complexity and the ability to model flexibility and complexity. This isn't without drawbacks either so know Brian
Gethin Rees: Haberberger who's a full stack software developer at the Walter J Ong SJ Center for Digital Humanities at St Louis University, is going to talk about this topic on and his work on expressing GeoJSON as
Gethin Rees: data 1.1. Thanks, Brian.
Bryan Haberberger: Thanks, Gethin thanks for the intro. Hi everybody, I'm going to stop sharing my video and share my screen and hope that kind of helps keep things smooth. So let's get going here.
Bryan Haberberger: Can you all see my screen.
Doug Schepers: Yes.
Great.
Bryan Haberberger: So again, my name is Brian Haberberger, along with being a full stack developer at the Walter J Ong SJ Center for Digital Humanities, I am also the IIIF maps technical specification group chair or one of multiple, and what that group is doing is sort of working within
Bryan Haberberger: The framework they have set up, which is very based on JSON and JSON-LD, and allowing away for standardized coordinate assertions to sort of enter the fray.
Bryan Haberberger: So why Linked Data. I think Gethin gave a good intro about it. But essentially, the semantics allow for interrelated data sets on the web. So if I have a data set that describes people, places and things and you do too,
Bryan Haberberger: I would like to be able to pull some of your vocabulary and direct meaning and use it to express that in my data set and in that way we can sort of enhance each other's data sets and encourage each other for the the well coded data for the future in cycle.
Bryan Haberberger: And so there's Linked Data, Linked Open Data, Linked Open Usable Data. It's all essentially the same. But in settings where the sources are open sources, that's when we say linked open data and usable is always just a hopeful.
Bryan Haberberger: But we like to use that word.
Bryan Haberberger: So how does this kak with GeoJSON-LD. We're not going to talk about the GeoJSON-LD spec directly
Bryan Haberberger: Instead, what I'm going to talk about is the Linked Data vocabulary and context that have been created for it.
Bryan Haberberger: JSON-LD is a W3C specification and like we just said it recently had an update as you can figure out GeoJSON is JSON and so there has been work to make a GeoJSON-LD context that's compatible with the JSON-LD 1.0 version.
Bryan Haberberger: That's sort of what allowed GeoJSON data notes to be a part of the Linked Data system going on and all the things we use
Bryan Haberberger: So, one important thing to note about GeoJSON-LD is that nested GeoJSON coordinate arrays are incompatible with the model. I'll show you exactly what that means and what that means for functionality here in a second.
Bryan Haberberger: But sort of at a top level concept. What this means is GeoJSON-LD is unable to express polygonol shapes.
Bryan Haberberger: Not that it can't but rather that when it does that, it's not able to process it as an LD. And so applications that are
Bryan Haberberger: Specifically, trying to be LD ignore what they can't process. So that would mean all of your polygons would be ignored, which is a massive problem for geography. Yeah, I'd assume you all like to be able to use polygons.
Bryan Haberberger: So the LD 1.1 release. The most important thing that came about, about it was that it allowed for list of lists structures so that things can actually be rendered. So I'll just give you a real small demo here real quick. Hopefully if the Internet
Bryan Haberberger: Will allow it.
Bryan Haberberger: So here's the JSON-LD playground and if I come in with that data, you'll see right away it tells me
Bryan Haberberger: This is not a valid syntax. I can't do lists of lists. What that means, sort of exactly is laid out a little better
Bryan Haberberger: In the spec to tell you why they chose not to do that.
Bryan Haberberger: But as people started specifically to work with GeoJSON and GeoJSON-LD, it became clear that the list of lists structure was going to be necessary for data.
Bryan Haberberger: And so that's when the LD 1.1 spec came out and just to show you that I'm not kidding.
Bryan Haberberger: It now specifically states that lists of lists are fully supported. So what that means is we would hope if I came into the LD 1.1 playground, that if I put that data in
Bryan Haberberger: It was successfully process, which it does. So just a super fast overview of what Linked Data does. You can see in the GeoJSON use terms like properties, geometry, type and coordinates.
Bryan Haberberger: And those are all directly mapped to a vocabulary or specific definition that that allows the keys to understand exactly what they are. So you can see by geometry, I mean, what GeoJSON says about geometry.
Bryan Haberberger: And so on and so forth. And you can see here how successfully can do. I'm a list, I contain a list that has a list, and that can go on forever, but it's obvious that that is is allowed now.
Bryan Haberberger: So that's mainly what I wanted to show you here. And then of course I'm sure you want to see it draw.
Bryan Haberberger: So if we go to the GeoJSON validator with that object we just had and paste it in and test it, you'll see that it draws my shape and it's my very crude a bounding area for the Eiffel Tower.
Bryan Haberberger: So we know it's GeoJSON compatible and now we know it's only 1.1 compatible. So we sort of have a way to properly describe these data sets, using Linked Data.
Bryan Haberberger: So now I'm going to talk about another
Bryan Haberberger: Another W3C specification called Web Annotation and specifically how that connects with Web Entities. So as I talked about earlier. I work in a Digital Humanities Center, and we are more of a dev shop than a content shop. We actually don't hold a lot of content.
Bryan Haberberger: So what my use cases is I need to be able to add descriptive information to content that's owned somewhere else and still
Bryan Haberberger: Be able to use the data connected with that data, know that I'm targeting
Bryan Haberberger: Trying not to go too much into it. I think it's a lot easier if I just show sort of a pipeline for for that looks like.
Bryan Haberberger: And sorry for clicking. So let's say I know a repository, a portal, as we've talked about earlier.
Bryan Haberberger: That I can go to to look for resources, Stanford has one of those. And it says that its resources are IIF so we'll go to something recent they had, like this Black Lives Matter memorial. And if I go into it.
Bryan Haberberger: If the Internet will load with me.
Bryan Haberberger: You'll see that loads up here and it has its the images that go along with it and probably other information about it.
Bryan Haberberger: I can specifically just asked for the data object that's in the background of this
Bryan Haberberger: So if I do...
Bryan Haberberger: And I just happened to know to use this because I work with these guys, so I know how their portal works.
Bryan Haberberger: You can see the object in the background. This is very IIIF I'm not going to go into it too much, but they have context and everything to sort of describe their keys in terms as well.
Bryan Haberberger: So if I bring this manifest and I say, I would like to say I know where that manifest is at
Bryan Haberberger: I Could bring it in here and say that's the URL I wanna use. There's the object, we know that it is. And I know it's somewhere over in California. So I'm just gonna kinda, Yes, sure. Probably not there. But let's go for it.
Bryan Haberberger: So what that does is generate a Web Annotation that connects that resource to the coordinate properties. And you can see here the body of the Web Annotation is GeoJSON. And so these contexts combined mean this works as a 1.1 Web Annotation and in particular because of some dumb luck.
Bryan Haberberger: This context actually has at version 1.1 which means process this as LD 1.1 and so the GeoJSON
Bryan Haberberger: Context, which does not contain that, sort of gets it for free, just by property of how combining contexts work. So now if I go ahead and create that annotation.
Bryan Haberberger: Great. It says go see it and Leaflet.
Bryan Haberberger: So I'll get to what that is in a second. So you can see there how it just provided a target, made JSON body for it, and made them relate to each other.
Bryan Haberberger: So now what I can do is ask data sets that I know we're doing this to just supply me with all of those coordinate assertions they've made.
Bryan Haberberger: And when I do, they'll show them here on a map for me.
Bryan Haberberger: So these are just those Web Annotations that I pulled out. And here you can see I never supplied a label. I never supplied a description, but the target data had it. And so I can just resolve that target lifetime.
Bryan Haberberger: And show data about that target lifetime without ever manipulating that data directly. So if anybody changes the label. If I refresh this page we're going to see that new label.
Bryan Haberberger: And that's sort of how we realize our pipeline. We don't have the content, but other people don't have the developers or the annotation systems to describe their content. How can we all still, you know, work in that in that process.
Bryan Haberberger: And so here's what I just showed you this is this is what what it looks like. And you can see here instead of using the
Bryan Haberberger: IIIF presentation context. I use the Web Annotation context, the IIIF context contains the Web Annotation context so that I don't have to include it as a third one.
Bryan Haberberger: I'll show you just super fast in a Linked Data context how you might go about doing that.
Bryan Haberberger: Oh, that is the wrong one. I'm sorry, my fault.
Bryan Haberberger: To see here they pulled in description for an annotation collection, annotation page in an annotation and say I use their context. But as we just described about when the new internationalization problem IIIF really deals with
Bryan Haberberger: International labels and so they needed to define a way to say I can provide multiple labels of a certain language.
Bryan Haberberger: More descriptive then just the label that that web the annotation wants to use. And so how that gets realized
Bryan Haberberger: One of the things IIIF maps community group is working on is providing recipes
Bryan Haberberger: For making these kinds of assertions and so you'll see here how we actually have to make the label. It's not just label colon string. It's actually an object containing arrays of information attached to language.
Bryan Haberberger: Which is what that lead contexts will need to do so that I know as the developer now to make my labels like this so that the viewers know to grab them and show them based on the language of they're in
Bryan Haberberger: It's just sort of an example of how Linked Data tries to connect that entire pipeline and then down here. Further, like we've shown you before. Here's what it looks like.
Bryan Haberberger: The IIIF
Bryan Haberberger: API uses annotations and inside those annotations are Web Annotations. So what this is right here is an actual Web Annotation, with its own coordinates.
Bryan Haberberger: That are outlining city to sort of fuzzy locate what resources being described here. And that was sort of how we realized that pipeline. So these recipes are up and and something you can go look at I've got notes included, links included in my notes and with the slides, when we get there.
Right.
Gethin Rees: It's now quarter past so could wrap up please.
Bryan Haberberger: Yes! So that was actually the end of it. So now the, I'm trying to Gethin. So now the future of GeoJSON.
Bryan Haberberger: IIIF community group is working to take that specification and get it somewhere where it can be maintained and we can add things like that version 1.1 property to the context to make this 1.1
Bryan Haberberger: Because we think GeoJSON will continue to be used in sort of like standards being promoted in this workshop and it should continue to have definition for it on the web.
Bryan Haberberger: And that's sort of our charge right now. And I think the next piece is what Carl, the next speaker is going to talk about is extending it even further to maybe include other dimensions.
Bryan Haberberger: And then hopefully, being able to take the sort of format here as JSON and realize it as a markup language in ways to connect with like WebML.
Bryan Haberberger: So that's it. Thank you.
Gethin Rees: Okay.
Gethin Rees: Thanks. Thanks, Bryan. Um, that's
Gethin Rees: A great explanation of how on we can use these Web Annotations to make assertions about
Gethin Rees: About documents on the web on and those can take to use the predicate, those can take a variety of forms. So for example, if we're talking about a place
Gethin Rees: We can say this is either this is within on the edge of outside that place and attached to your JSON-LD. In order to do that. So the next speaker Karl Grossner,
Gethin Rees: Is going to talk about bringing
Gethin Rees: Time into GeoJSON
Gethin Rees: GeoJSON-T, adding time into GeoJSON. He's technical director of the world historical gazetteer, and he's based in the University of Pittsburgh and
Gethin Rees: In cultural heritage, we've had a lot of success with sharing data using standards and this GeoJSON-T standard is certainly something we're using at the British Library and I'm trying to push it, the British Library.
Karl Grossner: Okay. Can y'all hear me.
Bryan Haberberger: Yeah, I can hear you.
Karl Grossner: Good.
Karl Grossner: Thanks.
Karl Grossner: I'd like to make a comment first before I share my screen and slides.
Karl Grossner: I wasn't until this session.
Karl Grossner: I haven't been aware of the map markup language and the extent as an extension HTML effort, and I'm not really sure how how that new technology would handle vector data and my where I'm coming from is entirely a
Karl Grossner: HTML and JavaScript world of making web maps which I've been doing for 15 years in the context of
Karl Grossner: Historical research and so on. So let me just race through these slides, guess I'll share my screen
Karl Grossner: And
Karl Grossner: So I'm assuming that everyone here is familiar with GeoJSON. It's really quite a standard and the universe of, in the admittedly messy universe of JavaScript mapping libraries that render maps to web screens.
Karl Grossner: It's in very common use, it's more or less a defacto standard. In fact, from my perspective, for making web maps for the data that
Karl Grossner: Web maps render
Karl Grossner: GeoJSON looks something like this. At its core, it's quite simple. You have feature collections, consists of features and features can have properties which can be anything at all. Say, and and they can have geometry.
Karl Grossner: Some conditions that I encounter routinely and people in the world of cultural heritage and historical research
Karl Grossner: Much more generally that spans many disciplines
Karl Grossner: And even modern applications, admittedly, I'm much more focused on historical application.
Karl Grossner: That has some features, for some features time is absolutely an essential aspect of them that it's not the answer to where is not some location, but it's a location that time. And this is an example in a little
Karl Grossner: Pilot demo thing I built a while back, indicating Poland.
Karl Grossner: As a very, very dynamic place, it even disappeared for a while.
Karl Grossner: Other cases that I encounter would include things like this. This is a
Karl Grossner: Map of the commodity flows between Venice and many forks over a period of several hundred years rendered
Karl Grossner: In a map, the geometry of it rendered in the map and the temporal attributes rendered in this case in the histogram.
Karl Grossner: Some other sorts of cases that
Karl Grossner: Me and I and people like me encounter routinely would be something like this, a trajectory, this is a particular journey taken sometime during the fourth century.
Karl Grossner: And
Karl Grossner: And in this case, and the temporal attributes are
Karl Grossner: A great interest both overall for the fact that occurred within some hundred years span.
Karl Grossner: But also each of those points follows each other in a sequence all of these cases are not handled at all by GeoJSON in any standard way people make do, they use the properties element to
Karl Grossner: To put in attributes that they want to render dynamically, and then they have JavaScript that interprets those properties and those things in the browser.
Karl Grossner: My proposal this, now, a few years old this to include a standardized 'when' in GeoJSON, they could appear in a couple of different locations. It can be used to temporally scope, a single feature, the way you see it here, which, for example, might apply to a single feature for
Karl Grossner: For, well for anything really.
Karl Grossner: A more complex case. In the case of Poland, for example, as you might have a single feature and this geometry is a geometry collection.
Karl Grossner: Each geometry of which has its own 'when' its own temporal scoping. This is a relatively simple thing to do and and it allows for doing some oddball-ish sorts of things. I think like journeys and flows and so forth.
Karl Grossner: And the question then becomes, what should be the structure of 'when' the idea is that there be some standard structure for a 'when' element wherever it appears in the GeoJSON feature.
Karl Grossner: That software that supports GeoJSON-T would know about with know where to look for it and know and have some idea what to do with it.
Karl Grossner: At this point I'm going to point you to some links that appear in the last slide of
Karl Grossner: Of this and are available to you and I'll display them also here.
Karl Grossner: A 'when' object can include any number of time spans. So that might be interrupted time spans that are relevant to a particular feature. Could be, it can include named periods. There are
Karl Grossner: Time period gazetteers in the world at least a couple in broad use within the domain I'm in,
Karl Grossner: And sometimes that's all we can say
Karl Grossner: About time and these other elements duration follows, which is intended to handle sequences and so
Karl Grossner: This is a bonus slide. It doesn't appear in the slide deck that's been uploaded I'm adding it because
Karl Grossner: The reason for my presentation is that Gethin's group at the British Library and Gethin particularly as instigated an effort called Web Maps-T
Karl Grossner: That attempts that is attempting to develop collaboratively.
Karl Grossner: Software modules as a open software modules for maps and timelines, taken together. Because for us, as Gethin mentioned in his library contexts and collections, this is a very common use case.
Karl Grossner: Geographic data is dynamic and this needs to be rendered in various ways it could be histograms and it could be stepped
Karl Grossner: points along the timeline that sort of thing. And there are many other things that creative people will undertake that so WebMaps-T is intended to work towards a set of
Karl Grossner: modules that developers of web maps in this realm can just plug in and customize to suit their particular situation.
Karl Grossner: The goal of my talk is simply to raise the question of time. As I said at the beginning, I don't really understand how
Karl Grossner: Vector data would be handled with the map element in HTML.
Karl Grossner: And this is very much about data models. So this is all happening before it arrives at the browser, I think, I don't know. I'm here to learn what
Karl Grossner: What is intended by this group. And just to raise the point that time matters an awful lot, and not only in historical cases.
Karl Grossner: But in modern cases as well as all sorts of trajectory data, all sorts of modern, relatively modern data about crime mortality, etc.
Karl Grossner: All of those features can have very important temporal attributes and standardizing a representation in the most common format currently in use GeoJSON seems to make sense to me.
Karl Grossner: That's all I've got. Okay.
Amelia Bellamy-Royds: Oh, thank you very much Karl. I'm going to jump in.
Amelia Bellamy-Royds: Just on the point sort of your question about MapML. MapML's vector model currently is almost directly compatible with GeoJSON is just converted into a markup form.
Amelia Bellamy-Royds: Peter can jump in with more specific questions, but it's designed to be as directly compatible as possible.
Karl Grossner: Well, I look forward to investigating that
Peter Rushforth: Yeah.
Karl Grossner: And then, and then any link that would direct me to a spec or a draft spec would be useful
Bryan Haberberger: Ditto for me.
Peter Rushforth: Okay, great. Well, I'm gonna give part two of the presentation that I didn't have time for today, tomorrow as part of my breakout
Peter Rushforth: Following your guys example I'm
Peter Rushforth: Using the time most judiciously to communicate as as efficiently as I can. So I'll do
Peter Rushforth: I'll give that presentation and then we can do it like a demo or whatever. Once I've done that presentation demos almost not necessary, but always nice to click on stuff and but thank you very much, time is a, time is a challenge and
Peter Rushforth: You know we are collecting Amelia has been leading the charge on collecting use cases for maps on the web.
Peter Rushforth: That, you know, we're going to reconcile the maps for HTML specifications with that use cases
Peter Rushforth: And in an iterative fashion. So, I mean, part of the challenges to what's in what's out and what should be handled by the browser "in theory", you know I know Brian and Simon or, or, you know, like, whoa, keep the
Peter Rushforth: Keep the request down to the bare minimum, but
Peter Rushforth: What, you know and we we live in that spirit as well. So, you know, what is the minimum viable product that we can ask that serves you know the most number of people.
Peter Rushforth: And I hate to call it the least common denominator, but that's effectively what it is right, and that's not a bad thing when you're thinking about math when you're learning, learning math when you're a kid, right when you
Peter Rushforth: When you bring things to the least lowest common denominator, you're able to integrate them then, right you're able to add them up. So hopefully the analogy works that way. No great presentation. I don't want to steal your time so go in.
Bryan Haberberger: I just, it's most interesting to me because it's all I have is the features. How do I
Bryan Haberberger: reconcile that with I just had the features I want to give to you a map and that's that's literally it. How do I just retain those features and make it so that it works within that markup language.
Peter Rushforth: Yeah. Well, there is a feature element that we're proposing that basically is based on GeoJSON, you know, I mean, the thing is that GeoJSON is strictly tied to WGS84. It doesn't have any notion of scale and there are no other
Peter Rushforth: There's no styling of that stuff. It's all up to the browser. So this is like JavaScript and CSS or CSS and JavaScript on a debate.
Peter Rushforth: Right. Yeah. So I mean, what we would like to do for feature is give it a home in HTML somehow right so that one con- geometry context is the map and the and the textual content is the
Peter Rushforth: Is a 2D browsing contest or like a regular browsing context, I guess. So somehow, work on, work that out but anyhow.
Peter Rushforth: I will talk more about that tomorrow.
Karl Grossner: Oh of course libraries like Leaflet take a data stream like some GeoJSON data and generate a ton of stuff elements in the DOM that are entirely proprietary
Karl Grossner: For each one
Karl Grossner: So ultimately, they live as elements in the DOM
Karl Grossner: All of these data objects
Peter Rushforth: But yeah, and the Linked Data idea like so you know Linked Data in the DOM is parsible, I suppose, like data crawlers in the sense. So giving features a home in the DOM could be part and parcel of making
Peter Rushforth: You know the geo web probable
Peter Rushforth: And more importantly indexable. So, yeah.
Bryan Haberberger: Yeah, and like it's the only difference between the GeoJSON and GeoJSON-LD is that context. So sort of at a really simple level, all I have to be able to do supply context.
Bryan Haberberger: You could do with a simple attribute
Karl Grossner: One thing, as I mentioned, real quick, is that GeoJSON-T
Karl Grossner: Is not LD compatible, such as it is this draft spec that's we're playing with the British Library and elsewhere. There's not LD compatible it
Karl Grossner: Predates really an effort to do that, but it has formed the basis for another format link for which was going a lot. And my last slide, which is Linked Places format.
Karl Grossner: Which is being used and world historical gadgets here which is LB compatible and is valid GeoJSON, it's valid JSON-LD 1.1 and
Karl Grossner: But is much more elaborate. It's designed specifically as a
Karl Grossner: Integration or contribution format for a couple of gazetteer platforms.
Karl Grossner: So GeoJSON-T very much should become GeoJSON-LDT
Bryan Haberberger: Yes. And just to give you a really easy idea of what that means, the context for everything else already exists, all it has to do is add
Bryan Haberberger: Some vocabulary and some constraints around 'when' to say, 'when' is a JSON object, not an array and I expected it to contain this or that and by 'when' I mean geographer.org/when
Bryan Haberberger: You know, and that's it. It would just be literally connecting up that new element that he's trying to introduce and of course some work with the GeoJSON standard people period, because at some point it would have to be sort of a, an approved extension kind of thing.
Karl Grossner: Yeah, I
Karl Grossner: See that is way out.
Bryan Haberberger: It is
Karl Grossner: I've been dealing with this for a long time, and proposing adding time to GeoJSON for a very long time, and I just
Karl Grossner: That group is not especially been responsive to the ideas or just throwing something out there and if I'm using it in some real applications and demonstrating and talking about it and
Karl Grossner: And inviting others to collaborate and making it an actual spec and Gethin is very much in that category. He saw it and that it suits what he has in mind that would serve
Karl Grossner: The Library and Museum communities and cultural heritage and so we're just moving forward and inviting people to help make it a true spec from what it is.
Bryan Haberberger: And so people like me. The chair of a IIIF community group, I take that as a call and to know now I should take this to the group when I when we have our next meeting to say hey guys, I know we're a year out from thinking about time. But look, there's already
Bryan Haberberger: A good JSON implementation for it. Is there anything we can use. Should we just use this and asked, Karl, if we can move it, like, what, what do we do
Karl Grossner: I'll take Peters point very seriously the minimum viable product or least common denominator. This is in my encounters with the world of standards development. This is always front and center.
Karl Grossner: And it's a frustration for people in my position because I'm encountering just all sorts of use cases. And I want to honor all of them.
Karl Grossner: But, but there is. I think there's a simple least common denominator for saying something about time in GeoJSON and one of the authors of GeoJSON has has said very explicitly yes there's such a thing as an event like feature.
Karl Grossner: But the the task. It just seems overwhelming and coming as I think from the world of geography academic, geography and geoscience is the task of merging or
Karl Grossner: Space and time in models and then computation has been an enormous challenge. And by and large is just simply ignored or in terms of standardization so
Karl Grossner: Yeah, it's not an easy thing at all to do or to think about that.
Karl Grossner: Maybe we can make some progress.
Doug Schepers: I have a question
Doug Schepers: I. Oh, sorry.
Gethin Rees: Go ahead. No, exactly. I was going to just say, does anyone else have questions and one on the mute themselves so perfect.
Doug Schepers: I have a couple of thoughts.
Doug Schepers: The first is that the minimum viable product. The 'viable' part is the important bit in there.
Doug Schepers: It's only viable if it allows for extensions. If it allows to be it to be grown into its natural set of use cases
Doug Schepers: and requirements even if not everything's supported at first there needs to be a really good use case and requirements discovery phase in which things are not excluded from being future enhancements of the thing.
Doug Schepers: So that's one thing that the MVP needs to be 'viable'. It can't just be a a bolted on solution.
Peter Rushforth: Yes, I think you need to have a story. You need to have a coherent story for for extension right so
Peter Rushforth: In my world that I think of that as progressive enhancement. So what is the what is the core
Peter Rushforth: behavior that you want to have, and how can you move forward from there. How can you put those times sliders that that make the animate the map and so on. And and and that's what I think, that's how I think of it anyway, is through progressive enhancement and
Doug Schepers: You actually had,
Doug Schepers: We didn't rehearse this folks, that's a natural segue into my next point, which is animation.
Doug Schepers: There are two ways that time is dealt with in the web right now.
Doug Schepers: Well, two main ways I'm thinking like in the HTML context. The first is timed media things like video and the second is animation, as in CSS animation SVG animation or JavaScript animation in general and
Doug Schepers: You know,
Doug Schepers: Karl if if you were to take the data from that Poland right and timestamp, the different states right, I mean by states. I mean, the different
Doug Schepers: Geometric bounds.
Doug Schepers: You could animate. You could use CSS, for example, to tween or SVG to tween between different states, different expansions and I think
Doug Schepers: I think that animation in that sense, really needs to be considered. What are the native animation capabilities of the web. And how is that going to feed into
Doug Schepers: The geometric expressions. So I'd love to see for example like Poland go from small to larger and larger and shriink again to nothing and then bounce back into existence. Over time, lots of other animations of like movements of language groups through through Europe, use of
Doug Schepers: You know, changes in borders in general, political movements, animations of
Doug Schepers: trade routes, etc.
Doug Schepers: animations of slave routes. I saw a really compelling one recently of, you know, where the slave started and where they ended up in you know way they started in Africa and where they ended up in the Americas and it was
Doug Schepers: and the pace at which it increased until it started slowing down and died off.
Doug Schepers: You know, that was emotionally, culturally relevant a
Doug Schepers: Piece of thing and that's, you can't do that if you don't consider time as a natural part of geometry. I mean, for, for that matter, the world spins. Right. Like what, like when, when is something open as well, like a
Doug Schepers: When is a business open
Doug Schepers: Okay, I know where the business is, when is the business right
Doug Schepers: When did it close down, this also ties into the time aspect that Brandon talked about earlier. He has, well he didn't mention it much, but he has this project of, you know, 80s.nyc which looks at historical
Doug Schepers: Things about the
Doug Schepers: New York City. Again, temporal, right, 'when' did any given event occur in a timeline at a particular location. I don't see how we can really think that we're representing geospatial information if we're not if it's not also temporal so Karl, thank you. That's
Karl Grossner: The money line. Thank you.
Doug Schepers: You're welcome at
Karl Grossner: All costs or
Doug Schepers: You can paypal me the the the agreed upon amount later.
Karl Grossner: Haha, that's great. All of the historical cases, you mentioned are quite routine cases that are being done right now routinely in academic research applications and so forth. But they're being done with
Karl Grossner: unique ways of expressing time within properties in GeoJSON and JavaScript. That's way they're being done so.
Karl Grossner: We're because we're interested in the Linked Data world and being able to share things and we have the sort of standard way of dealing with space.
Karl Grossner: There's a real impetus to include time in that standardization to facilitate integration via Linked Dta so so
Karl Grossner: I know that there are myriad modern examples that you mentioned some are stores opening and so forth. That's not my universe so I, you know, I'd be bringing these historical cases to the table, but
Karl Grossner: I know, and I've seen other discussions about time time modeling and so forth, W3C time modeling and all that, but there are very many modern cases and and there is a W3C time that has produced documents and standards and so forth.
Doug Schepers: Yeah.
Doug Schepers: I just wanna-
Karl Grossner: and delivering that to the web is a
Karl Grossner: Is a kind of a separate but very connected issue.
Doug Schepers: Yeah, I wanted to, I wanted to say I wanted to reiterate something I just glossed over which is that we should be looking at how
Doug Schepers: Mainstream things like CSS deal with time as well. Right. And make sure that there's a concordance between
Doug Schepers: How we represent it in GeoJSON and how it could actually possibly at be animated. Just a thought.
Doug Schepers: Where animation is relevant. Right. It's not always going to be relevant, but
Doug Schepers: But sometimes it will be
Gethin Rees: I think,
Gethin Rees: Also the edge case issue is one both presentations on time deal with well in that when you get a group of curators or academics together, you
Gethin Rees: I'm like this, there was this particular building and it moved here and then it moved there
Gethin Rees: And then it moved here and where do we actually put the building, you know, when it changed name and then change back to its original name, for example, and so Brian's
Gethin Rees: Presentation, you know, Web Annotations allows us to actually make assertions that can take advantage of those on what they will they can communicate the complexity of those edge cases.
Gethin Rees: And I knew that Karl in working through quite a few different iterations of temporal, spatial moderate modeling has also really consider those very well. And so I think that's something in in in understanding those edge cases that something this community can bring to a broader
Gethin Rees: Audience or a broader set of use cases.
Bryan Haberberger: More stories, please.
Gethin Rees: Are there any other, I don't know what the time limit actually is on this.
Amelia Bellamy-Royds: We'll cap it at the end of the hour.
Amelia Bellamy-Royds: I guess one question is sort of what what comes next. What are you hoping I mean, I think it sounds like you're going to have lots of collaborations between the GeoJSON-LD and the GeoJSON-T projects. What else from the web community or the rest of the geospatial community.
Bryan Haberberger: So I know with IIIF maps, that community group, for example.
Bryan Haberberger: As I showed you the GeoJSON all the context as it is right now is a no-go. So we are trying to just support the migration of that specifications that I can add that at version tag and perhaps maybe supply some more bounds to properties, having some things so
Bryan Haberberger: Open is actually sort of against some of the things like data once with permanence. We don't really want it to be anything we want it to be flexible on these terms. And so we need to
Bryan Haberberger: Do a little bit of work around that. So I'm working with community groups and I chatted in the Gitter sort of, the links to the stories that we've collected in IIIF.
Bryan Haberberger: And bringing in those use cases and bringing them to thinking on, you know, how are we doing this with resources. I mean, what I showed you was a simple geolocation
Bryan Haberberger: Example, but imagine in a map is an image of a map when there are no coordinates involved, a map is just an image.
Bryan Haberberger: What gives map it's mapping is and correct me if I'm getting my vocabulary wrong geo rectification. So I showed you simple geo locations that assumed a geo rectification, but what if my entity was just that image.
Bryan Haberberger: And I want to apply the geo rectification to it in my own data set as an annotation, you know, is that even possible.
Bryan Haberberger: So how this spreads. You know, it's not it. There's so many things you can do with geo
Bryan Haberberger: And so many things that are just image specific that aren't map specific. So I think a lot of the work we're trying to do for the future is what are those maps specific things that go beyond this being an image
Bryan Haberberger: That we need to account for. And of course, this takes stories and use cases and trial and error and and people like Karl come in and going "You guys didn't even consider the time dimension, what are you thinking like", it's all of that.
Doug Schepers: Well, actually, the annotation working group did consider the time dimension, annotations can be time stamped
Bryan Haberberger: Yes, they can. And especially with IIF AV, We have worked in those temporal assertions for things like a video and audio files, but not for images which again is important for
Bryan Haberberger: An image of a map, you have to realize at its base, that's that's a lot of times just what a what a person takes a map is if you just give me the image with no geo rectification, I can only treat it like an image.
Peter Rushforth: Well, I guess what to pitch my product a bit more like I'm not already doing that enough, but the
Peter Rushforth: Map element would be to geo rectified. So if you wanted to geo rectify and image, you would have a geo rectified target into which to
Peter Rushforth: To do that process. So I can imagine that would be a hefty WASM or JavaScript process. But I mean, I've seen I've seen know like, yeah, I think the New York library had
Peter Rushforth: A site that you could geo rectify images to
Peter Rushforth: Historical basemap
Bryan Haberberger: So yeah, lots of little demos out there. We've, we've looked at them.
Peter Rushforth: Yeah.
Peter Rushforth: So anyhow,
Gethin Rees: Okay. Well, I mean, if people don't have further questions.
Peter Rushforth: Um, web of layers to it. You know, I think layers are an important fundamental thing of of maps, sorry to stretch things out for people, but I just wanted to get some of the you know the primitive
Peter Rushforth: I want to, you know, basically, see what you guys think about
Peter Rushforth: You know, what is a primitive feature of maps and in my world, layers that are everywhere.
Peter Rushforth: I'm seeing Ivan Sanchez was saying everything's all there in his blog post. Everything's a layer. Forget the idea of layers.
Bryan Haberberger: Yeah.
Bryan Haberberger: You know,
Peter Rushforth: Yeah, sort of makes it a good target to actually implement
Bryan Haberberger: Yeah, I mean, in our, in our use cases, things like that, go completely outside of maps, but like a layer that is transcription and layer that is translation. How do we supply that for for for our objects.
Bryan Haberberger: We don't have a specific layer we use the combination of annotation collections and annotation pages and a structure called a range to sort of
Bryan Haberberger: Organize whole or pieces of
Bryan Haberberger: Of like entities and then supply the different
Bryan Haberberger: Layers, if you would, collections or pages of information. And that's sort of how IIIF deals with that primitive in their case.
Bryan Haberberger: I don't have a direct answer for you. I just have the one you know that's around my community.
Peter Rushforth: Can you provide a link for both on that topic?
Bryan Haberberger: Sure let me go grab it.
Peter Rushforth: Well, not now, but whenever
Peter Rushforth: That would be interesting.
Bryan Haberberger: Yeah, I can absolutely I can actually grab you a link on that topic.
Bryan Haberberger: We did talk about it.
Amelia Bellamy-Royds: I will say, I've been
Amelia Bellamy-Royds: Keeping notes in the chat. So kind of drowning the chat in the notes, but I'll copy them over into a Discourse and we can add all sorts of links and whatever there. And of course, we are still recording, so this will go up with the YouTube video of the main talks.
Peter Rushforth: Thanks Amelia for doing that.
Amelia Bellamy-Royds: So this definitely doesn't have to be the end of the conversation.
Gethin Rees: Thanks.
Gethin Rees: Something fantastic I'm sharing because it's been dropping in and out for me a bit.
Gethin Rees: Really appreciate that.
Karl Grossner: I think, you mentioned Amelia next steps and it occurs to me you were talking about extending GeoJSON, so you know natural thing to think about is
Karl Grossner: How to put these ideas about extensions before the GeoJSON
Karl Grossner: maintainers, or
Karl Grossner: Community developers and so forth and
Karl Grossner: There's no
Karl Grossner: There's no immediate uptake, as has been mentioned in the talk about MVP GeoJSON has a term that specified called the
Karl Grossner: Foreign member. Foreign members are allowed. They'll just simply be ignored by all software that doesn't specifically look for them.
Karl Grossner: And that's what, when, when in GeoJSON, a mouse to a foreign member. And at some level, the GeoJSON maintainer could care less what foreign members anybody ads and what they might want to do with them. So the idea, you know, my initial inclination was well time ought to be part of core
Karl Grossner: You know, following
Karl Grossner: What some I've been saying, you know, I mean, it's really elemental I think that a very long list of use cases can be put forward but
Karl Grossner: It's not clear how that's going to proceed. I mean, that JSON-LD a GeoJSON-LD is does not really non existent. I mean, it's not
Karl Grossner: It's not really truly respect at all. It has a has an alias file that just points to some stuff that
Karl Grossner: I don't think makes it really useful RDF,
Karl Grossner: So I don't know. That's a big open, that's my open question, for what next, and in the meantime, I'm just going to keep proceeding working with Gethin to and others who may
Karl Grossner: To create a format that sort of software modules, he's imagining, map plus timeline can work with and then put it out there and say, 'isn't this cool'
Karl Grossner: Is this cool enough to standardize are there enough use cases to support even thinking of it as a standard so
Bryan Haberberger: Now, and if he's working with communities like us, even in that prototype stage, we could probably produce an LD context for it, just to bring you into that game.
Bryan Haberberger: And then you're there.
Bryan Haberberger: And it's, it's in a place where we can start to test it and tell people to use it and give us feedback.
Karl Grossner: It's definitely getting some traction. So in the work that Gethin is doing nd then the IIIF community, the idea of adding time has
Karl Grossner: caught people's attention and there's attention to it. So that's great and
Karl Grossner: In the meantime, I'm writingsoftware.
Doug Schepers: Writing software is the best thing you can do. That way we can pave the cow paths, right. Find
Doug Schepers: actually what the
Doug Schepers: Hard parts are, fix the hard parts in code, theoretic and then standards can follow after
Karl Grossner: That's that's been that's been our game for number of years now
Karl Grossner: Where you can say some time and in action and some of the links that are on my last slide, including world historical gazetteer, which was intended to be
Karl Grossner: Intended to add time intrinsically to place names to places, their names their geometries, their types and their relationship to other places. So 'when' appears all over the place in the standard for that.
Karl Grossner: It is Geo-JSON compatible, well it does work.
Peter Rushforth: What do you do for scale? Like GeoJSON doesn't have notion of zoom built into it. So what do you do for for that.
Karl Grossner: Everything is in JavaScript. So, I mean, you know what, I, I work with Leaflet almost exclusively, I've done other things, D3 and
Karl Grossner: OpenLayers, way back when, but mostly for JavaScript or just make the spaghetti but all people who talk about standards hate,
Karl Grossner: But they love to draw attention to. I make spaghetti and you know it's, it works and it's you know it's a lot of the things I've built a pretty robust, you know, still running after years and so
Karl Grossner: There's a better way forward. And the whole idea of sharing which Linked Data and the LD universe proposes is really
Karl Grossner: My focus. And I think in
Karl Grossner: Gethin and Bryan and also the
Karl Grossner: That introduces
Karl Grossner: It almost compels standard models and ontologies behind those models
Peter Rushforth: Great.
Peter Rushforth: Very interesting.
Bryan Haberberger: I was gonna say the very next thing I would like to see happen is a webpage goes up that just says geospatial not equal to spatial temporal because so many people just assume that because I've done something geospatial for them.
Bryan Haberberger: It's like they can do it you know that timeline and and I say without time. You cannot have a timeline. Don't you understand geospatial it's not spatial temporal. It's so funny because these things are so connected that people just assume
Karl Grossner: Well, there's just a ton of geospatial data for which time is an assumption because you're making snapshots at a given time. So you have this temporal frame. And that's what you're looking at the stuff that tries to get dynamic
Karl Grossner: Is different.
Bryan Haberberger: Machines don't like abstraction that needs to be like, you know, officially said in the data and like you're saying it's not a lot of times
Karl Grossner: Right.
Karl Grossner: It's hard.
Peter Rushforth: Yeah, bet it's hard. I mean, it's so hard for two dimensions and you add the time dimension in there and you disappear.
Karl Grossner: I haven't even mentioned fuzzy time, and uncertainty and so on and so forth.
Karl Grossner: Yeah, all of which are great interest with people who do history.
Karl Grossner: And they're very difficult to formalize
Bryan Haberberger: I've heard a lot of, I saw a lot of talking in Gitter about the static pages and just could you imagine representing someone's location over a day using time you'd have to have a layer or feature for each second of the day like that would be I mean, wow.
Peter Rushforth: Yeah.
Karl Grossner: Thank you all for your comments,
Karl Grossner: Very useful.
Bryan Haberberger: Yes, thank you, everybody.
Peter Rushforth: Thank you for
Peter Rushforth: Joining us. It's been great to
Peter Rushforth: Have you guys join the join the conversation.
Doug Schepers: I want to point out so much
Doug Schepers: Sorry, I want to point out one thing, somebody commented into the
Doug Schepers: Like there. They didn't know what this word meant and caught in the context of MapML and Peter, correct me if I'm wrong, but I want to emphasize that this is not a MapML workshop
Doug Schepers: This is maps on the web. So it's all this stuff is welcome all this stuff in forms.
Doug Schepers: And it doesn't even have to be W3C or OGC. Right. It's this is ultimately this is about what are all the moving parts. And what do we need to do to to connect them and to get them all meshing
Doug Schepers: And there are lots of moving parts. So I want to make sure that people feel like their contributions are welcome in this workshop, because otherwise we're just going to have a partial solution that doesn't solve everything.
Peter Rushforth: Yeah well said Doug. I think the point of this workshop, which we should have had years ago,
Peter Rushforth: But which was only suggested to me by Mike Smith last year, so I blame Mike,
Peter Rushforth: Was
Peter Rushforth: Is to just to highlight exactly how valuable and important maps and location are to humanity and to try and put that into the context of the the information system that is the web into, you know, raise the profile of how we are dealing with maps, we're
Peter Rushforth: In my opinion, we're not we're not, we don't recognize it, everything, like you said, everything has a location every second of every day,
Peter Rushforth: And that is just as important as in some ways as human thought, right giving the web to having the web to allow the expression of that information in a, in an easy way like a way that the web, you know, has paved over for us is
Peter Rushforth: Is valuable I think, I think it's like an inestimably valuable, actually. So that's why the workshop is is here. It's not about, I mean, we've been working on MapML as a community group for
Peter Rushforth: A few years now since 2014 we started the community group at the when the spatial data on the web community, our interest group was created it at a workshop by, you know,
Peter Rushforth: I had my own say and we started the community group and, you know, over time, I've just become you know more convinced that spatial information is
Peter Rushforth: It's a primitive. It's a primitive in society and
Peter Rushforth: We'll see where it goes.
Badita Florin: Can I add something. Yeah, because, like for me like I'm also very glad that this workshop is happening because I'm working with maps like 10 years and
Badita Florin: Most of the times, like I needed to use like QGIS of other things like that. And when I started to going to Web Map, So if that is kind of that found
Badita Florin: But yeah I envision the future when we will not need to have like Leaflet and other things things like that and also to be like really simple, like when you learn HTML
Badita Florin: HTML five to be able to, Yeah, to be able to implement the map, very simply, and have
Badita Florin: Simple things that maybe we will be able to implement yet in the standard like maybe also because
Badita Florin: I'm working with like bigger dataset, like I need to show 50,000 points on the map. And usually when the DOM doesn't handle these so it will need to be see how we could do that at scale, and like clustering, like when you have 50,000 points. Definitely clustering, and that currently using
Badita Florin: Like Leaflet and the clustering, but I think it would be much more better to to be able to kind of get rid of all of these
Badita Florin: libraries that some will become unsupported, like we've seen Leaflet. But most of the people at Leaflet, they are now working
Badita Florin: At MapBox so they will probably not continue to evolve or Leaflet in the same way. So I think is really good to have something more of a standard than different libraries.
Bryan Haberberger: Yeah, that's really good way to put it.
Peter Rushforth: Yeah, absolutely. That's great. And I just come back to progressive enhancement, you know, the objective of
Peter Rushforth: Maps in HTML is not to get rid of libraries, but it's to is to make them faster, better, easier and and to, like, you know, the whole human
Peter Rushforth: World of thought and ingenuity can be applied to maps and, you know, we could take the lowest common denominator and build that into the engine that everybody uses, the browser,
Peter Rushforth: That would be that would be a big step forward in my opinion. And you know, I don't think there's any magic solution to 50,000 points in the browser, right, like like there, That's a lot of data and you have to have strategies.
Peter Rushforth: But anyhow,
Bryan Haberberger: Just sit there and let it lazy load for a week.
Peter Rushforth: Haha, yeah.
Peter Rushforth: Well, right, we're kind of out of time. Right.
Doug Schepers: Yeah.
Peter Rushforth: I'll let you shut us down Doug, or Amelia, take it.
Peter Rushforth: Thank you very much everyone for participating anyway.
Doug Schepers: Very inspiring.
Doug Schepers: Really enjoyed participating in this conversation. Thanks for organizing it.
Doug Schepers: And thanks, Gethin.
Doug Schepers: Thanks Bryan and Karl for really
Doug Schepers: seeding the conversation with some excellent material. And with that, I think we will convene for the day, Amelia. Do you have any final housekeeping.
Amelia Bellamy-Royds: No I think everybody left knows the deal. For now, so I hope to see most of you again tomorrow. And I'd like to thank you all for this session, since we didn't really know how it was going to work out. But this was a really great conversation.
Gethin Rees: Yeah. Thanks very much, everyone really appreciate it,
Gethin Rees: Really njoyed the whole week so far, you know, it's been great. I've really learned a lot.
Bryan Haberberger: Yeah, very refreshing to see how much work is going into this
Peter Rushforth: Awesome. Thanks. Okay, bye for now, then
Bryan Haberberger: All right, bye everybody.
Thanks everyone.
Badita Florin: Thanks. Bye. | https://www.w3.org/2020/maps/supporting-material-uploads/minutes/20200923-captions.html | CC-MAIN-2021-31 | refinedweb | 27,376 | 67.79 |
VueJS 2.0 Nodejs Tutorial is today’s main topic. NodeJS is a viral platform nowadays because of its features and Express is a web framework build on top of Node.js. This is the perfect example of How to use VueJS with NodeJS.
Summary
VueJS Nodejs Tutorial walks through creating a Node.js, MongoDB, Express, and front-end framework (Vue.js) application. Client side code is bundled with Webpack. It is also called VueJS NodeJS Express Tutorial or Vue Express Example Tutorial.
Purpose
One possible reason I am writing this is showcase how Node.js, Express Framework, MongoDB and modern client-side Javascript frameworks (Vue.js with Webpack) can all play nicely together. Express is still the dominant Node.js web framework.
The App and Stack
This application is capable of Creating, Reading, Updating and Deleting items from the MongoDB database and It’s relatively simple Single Page Application. So It’s a CRUD application with VueJS, NodeJS, MongoDB, and Express. We are using MongoDB database so it is Vuejs with MongoDB Tutorial Stack.
Vue.js 2.0
For learning Vue.js, I suggest to my this article Vuejs Tutorial With Example. It will guide you to learn fundamentals of Vue.js 2.0. If you want to know how a router works on Vue.js, then check out my this tutorial How To Use vue-router in VueJS.
Setup an Application Environment
Step 1: Make a directory of VueJS Nodejs Tutorial Project.
Create one project folder called by the following command.
mkdir VueJSNodePro
Go into that folder, create one file called package.json file and in that copy this code into it.
{ "name": "vuenodepro", "version": "1.0.0", "description": "", "scripts": { "start": "webpack-dev-server" }, "author": "", "license": "ISC", "devDependencies": { "axios": "^0.16.2", "babel-core": "^6.25.0", "babel-loader": "^7.1.1", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-es2015": "^6.24.1", "babel-preset-stage-3": "^6.24.1", "babel-runtime": "^6.25.0", "css-loader": "^0.28.4", "file-loader": "^0.11.2", "vue": "^2.4.2", "vue-router": "^2.7.0", "vue-axios": "^2.0.2", "vue-loader": "^13.0.2", "vue-template-compiler": "^2.4.2", "webpack": "^3.4.1", "webpack-dev-server": "^2.6.1" } }
Type the following command in your terminal.
npm install
It will download the all the required development dependencies in our project.
Next step would be to configure our webpack development server. So create one file called webpack.config.js in project’s root and put the following code in it.
// } }
Webpack will create one bundle.js file in a root. This file is the ES5 version of JavaScript, and it will be included in our index.html file. Create one file called index.html in a root folder.
<!-- index.html --> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>VueJS NodeJS and Express example<> <script src="bundle.js"></script> </body> </html>
Step 2: Create sub folders and main.js file.
Now, create one folder called src because all of our components will be stored in this folder. In that folder create one javascript file called main.js.
// main.js import Vue from 'vue'; import VueRouter from 'vue-router'; Vue.use(VueRouter); import VueAxios from 'vue-axios'; import axios from 'axios'; Vue.use(VueAxios, axios); const router = new VueRouter({ mode: 'history' }); new Vue(Vue.util.extend({ router })).$mount('#app');
I have imported vue, vue-router, and vue-axios library from the node_modules folder. The vue-router library is for routing our components where a vue-axios library is to send HTTP request to the server.
Next, create one vue component inside src folder called App.vue.
// App.vue <template> <div class="container"> <div> <transition name="fade"> <router-view></router-view> </transition> </div> </div> </template> <style> .fade-enter-active, .fade-leave-active { transition: opacity .5s } .fade-enter, .fade-leave-active { opacity: 0 } </style> <script> export default{ } </script>
In this component, I have defined router-view tag. It simply our application’s container part. All the different components will be rendered in this <router-view></router-view> element.
We need to include this App.vue file in our main.js and pass the argument while creating a vue instance.
// main.js import App from './App.vue'; new Vue(Vue.util.extend({ router }, App)).$mount('#app');
Step 3: Make components folder and create sub components.
Create one folder inside src folder and name it components. In components folder, create one file called CreateItem.vue.
// CreateItem.vue <template> <div> <h1>Create An Item</h1> <form v-on:submit.prevent=”addItem”> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Item Name:</label> <input type="text" class="form-control" v- </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Item Price:</label> <input type="text" class="form-control col-md-6" v- </div> </div> </div><br /> <div class="form-group"> <button class="btn btn-primary">Add Item</button> </div> </form> </div> </template> <script> export default { data(){ return{ item:{} } }, methods: { addItem(){ } } } </script>
Import this CreateItem.vue component inside the main.js file. We will need this component for routing purpose.
Switch to the main.js file and import this component by the following code.
import CreateItem from './components/CreateItem.vue';
Now, we need to define routes array and add this component to this list.
// main.js const routes = [ { name: 'CreateItem', path: '/', component: CreateItem } ];
Register this array in the time of the creation of router object.
// main.js const router = new VueRouter({ mode: 'history', routes: routes});
Now, start the server by the following command.
npm start
Switch to this URL:. You will see the Create Form like below.
Step 4: Configure NodeJS Express MongoDB backend.
Next step, would be to create Node.js and Express backend to store the data. Create one file in the project root called server.js
Now, we need to install the express framework and other dependencies via NPM, so let us do it first.
npm install --save express body-parser cors mongoose nodemon
Switch to newly created server.js file and enter the following code in it.
// server.js var express = require('express'), path = require('path'), bodyParser = require('body-parser'), cors = require('cors'), mongoose = require('mongoose'); const app = express(); var port = process.env.PORT || 4000; var server = app.listen(function(){ console.log('Listening on port ' + port); });
Next thing is we need to create the MongoDB database and connect it with our express application.
Note: You need to have installed MongoDB database on your server or local otherwise first you need to download it and start the MongoDB server.
Create one config folder inside project root. In that create one file called DB.js.
// DB.js module.exports = { DB: 'mongodb://localhost:27017/vueexpress' };
Import this file into our server.js file and use mongoose to set up a database connection with MongoDB. You need to copy the whole server.js file; I am about to show so that nothing will left and lead us to error.
// server.js const express = require('express'), path = require('path'), bodyParser = require('body-parser'), cors = require('cors'), mongoose = require('mongoose'), config = require('./config/DB'); mongoose.Promise = global.Promise; mongoose.connect(config.DB).then( () => {console.log('Database is connected') }, err => { console.log('Can not connect to the database'+ err)} ); const app = express(); app.use(express.static('public')); app.use(bodyParser.json()); app.use(cors()); const port = process.env.PORT || 4000; const server = app.listen(port, function(){ console.log('Listening on port ' + port); });
Step 5: Create Express routes for our application.
Now, we need to create two folders in a root called expressRoutes and models.
In models folder, create one model called Item.js.
var mongoose = require('mongoose'); var Schema = mongoose.Schema; // Define collection and schema for Items var Item = new Schema({ name: { type: String }, price: { type: Number } },{ collection: 'items' }); module.exports = mongoose.model('Item', Item);
In the expressRoutes folder, create one file called itemRoutes.js.
// itemRoutes.js var express = require('express'); var app = express(); var itemRoutes = express.Router(); // Require Item model in our routes module var Item = require('../models/Item'); // Defined store route itemRoutes.route('/add').post(function (req, res) { var item = new Item(req.body); item.save() .then(item => { res.status(200).json({'item': 'Item added successfully'}); }) .catch(err => { res.status(400).send("unable to save to database"); }); }); // Defined get data(index or listing) route itemRoutes.route('/').get(function (req, res) { Item.find(function (err, items){ if(err){ console.log(err); } else { res.json(items); } }); }); // Defined edit route itemRoutes.route('/edit/:id').get(function (req, res) { var id = req.params.id; Item.findById(id, function (err, item){ res.json(item); }); }); // Defined update route itemRoutes.route('/update/:id').post(function (req, res) { Item.findById(req.params.id, function(err, item) { if (!item) return next(new Error('Could not load Document')); else { item.name = req.body.name; item.price = req.body.price; item.save().then(item => { res.json('Update complete'); }) .catch(err => { res.status(400).send("unable to update the database"); }); } }); }); // Defined delete | remove | destroy route itemRoutes.route('/delete/:id').get(function (req, res) { Item.findByIdAndRemove({_id: req.params.id}, function(err, item){ if(err) res.json(err); else res.json('Successfully removed'); }); }); module.exports = itemRoutes;
Here, I have defined all the routes related to CRUD application.
This file will be included in our server.js file.
// server.js itemRoutes = require('./expressRoutes/itemRoutes'); app.use('/items', itemRoutes);
Step 6: Insert the value in the MongoDB.
So, your final server.js file will look like this.
// server.js const express = require('express'), path = require('path'), bodyParser = require('body-parser'), cors = require('cors'), mongoose = require('mongoose'), config = require('./config/DB'), itemRoutes = require('./expressRoutes/itemRoutes'); mongoose.Promise = global.Promise; mongoose.connect(config.DB).then( () => {console.log('Database is connected') }, err => { console.log('Can not connect to the database'+ err)} ); const app = express(); app.use(express.static('public')); app.use(bodyParser.json()); app.use(cors()); app.use('/items', itemRoutes); const port = process.env.PORT || 4000; const server = app.listen(port, function(){ console.log('Listening on port ' + port); });
From the front end side, we need to set up axios and fire up the HTTP Post call to the NodeJS server.
// CreateItem.vue addItem(){ let uri = ''; this.axios.post(uri, this.item).then((response) => { console.log(response) }) }
If your all the MongoDB database configuration is correct then, you will be able to store the values in the database.
Step 7: Display the items.
Now, we need to route to the listing of the item, when we got the response. Create one component inside components folder called DisplayItem.vue.
// DisplayItem.vue <template> <div> <h1>Items</h1> <div class="row"> <div class="col-md-8"></div> <div class="col-md-4"> ></td> </tr> </tbody> </table> </div> </template> <script> export default { data(){ return{ items: [] } }, created: function() { this.fetchItems(); }, methods: { fetchItems() { let uri = ''; this.axios.get(uri).then((response) => { this.items = response.data; }); } } } </script>
Now, we need to include this component to our main.js file, and also we need to register this component’s route in the routes array. I am writing the whole file, so just need to copy this file into your'; const routes = [ { name: 'CreateItem', path: '/create/item', component: CreateItem }, { name: 'DisplayItem', path: '/', component: DisplayItem } ]; const router = new VueRouter({ mode: 'history', routes: routes }); new Vue(Vue.util.extend({ router }, App)).$mount('#app');
You can notice here that, I have changed the routes name and root route would be the listing of the items page, so when you hit this URL:. It will display like this.
Step 8: Generate EditItem.vue component.
Now, we need to create one more component inside components folder called EditItem.vue.
// EditItem.vue <template> <div> <h1>Update Item</h1> <div class="row"> <div class="col-md-10"></div> <div class="col-md-2"><router-link :Return to Items</router-link></div> </div> <form v-on:submit. <div class="form-group"> <label>Item Name</label> <input type="text" class="form-control" v- </div> <div class="form-group"> <label name="product_price">Item Price</label> <input type="text" class="form-control" v- </div> <div class="form-group"> <button class="btn btn-primary">Update</button> </div> </form> </div> </template> <script> export default{ data(){ return{ item:{} } }, created: function(){ this.getItem(); }, methods: { getItem() { let uri = '' + this.$route.params.id; this.axios.get(uri).then((response) => { this.item = response.data; }); }, updateItem() { let uri = '' + this.$route.params.id; this.axios.post(uri, this.item).then((response) => { this.$router.push({name: 'DisplayItem'}); }); } } } </script>
Now, we need to import this component into a main.js'; import EditItem from './components/EditItem.vue'; const routes = [ { name: 'CreateItem', path: '/create/item', component: CreateItem }, { name: 'DisplayItem', path: '/', component: DisplayItem }, { name: 'EditItem', path: '/edit/:id', component: EditItem } ]; const router = new VueRouter({ mode: 'history', routes: routes }); new Vue(Vue.util.extend({ router }, App)).$mount('#app');
Also, we need to update DisplayItem.vue file.
// DisplayItem.vue <template> <div> <h1>Items</h1> <div class="row"> <div class="col-md-10"></div> <div class="col-md-2"> ><router-link :Edit</router-link></td> <td><button class="btn btn-danger" v-on:Delete</button></td> </tr> </tbody> </table> </div> </template> <script> export default { data(){ return{ items: [] } }, created: function() { this.fetchItems(); }, methods: { fetchItems() { let uri = ''; this.axios.get(uri).then((response) => { this.items = response.data; }); }, deleteItem(id) { let uri = ''+id; this.items.splice(id, 1); this.axios.get(uri); } } } </script>
Now, if you return to the browser and note that, if your webpack development server and your node server is not running, then please start your server at URL:.
If you have created more than one item then, you will see something like this. DisplayItem.vue
EditItem.vue will look like this.
Follow my blog with Bloglovin
This tutorial VueJS Nodejs Tutorial is now over.
Download Project On Github
Steps:
1) Clone the repository.
2) type the following command in your project root directory: npm install.
3) You need to install MongoDB database and also start the server of MongoDB.
4) Go to the project folder >> config >> DB.js file and change the URI according to your database connection and credentials. : Start the server: npm start.
5) webpack development server will start at
6) You also need to initiate the NodeJS server by typing following command: nodemon server.
If you still have any doubt then ask in a comment below, I am happy to help you out.
Thanks man!
I am using vuejs and mongodb, but with Laravel.
Will try this combination, looks promising!
Go ahead!! Keep experimenting.
Thanks bro, you helped me a lot.
Wish you write more tuts about nodejs and vuejs.
Thanks man!!
great tutorial!!!!!
After a long search finally got this page !!! The best and working solution so far. Good work Krunal !!
Hi. Krunal!
I think this tutorial is very educating and helpful.
But I have a problem when run site:
bundle.js:4365 GET net::ERR_CONNECTION_REFUSED
What can it be?
Thanks!
I guess your port is already consumed by other process, please change it to the other, or kill other processes.
Thank you for the response, Krunal.
I checked with netstat but didn’t find such process.
I will continue research, thank you very much.
Hey Greg, could you tell me how did u do to handle this error ?
Fixed the problem by fixing db file name.
could you please share how you resolved this error ?
Hi, Krunal,
Your tutorial is great, but you forgot one thing. You forgot to say that we need to run nodemon(node) server.js. Without that, we can’t run any server script and connect with database.
Sincerely,
Igor
Thank you for this great tutorial!
I have followed this step-by-step tutorial, and I found that should be included in CreateItem.vue file. If it is not included, the web would show ‘Cannot GET /create/item’ error.
However, I have no idea why this error happens since the form is not currently allocated to do a specific function. Any explaination?
I mean the form should be changed into form v-on:submit.prevent=”addItem”
Really Nice approuch.
How can we deploy it? Any suggestions to Heroku, maybe?
Krunal, I got a question. In final DisplayItem view
Edit
The link is always passing the first _id like param to the EditItem component so that i cant edit anyelse item. Nevertheless i clearly see the good _id into table rendering. I didn’t see any errors. Have u same trouble into your project ? (I’ve not cloned it)
Hello Krunal,
Thanks for nice tutorial.
After I complete the webpeck.config.js under ‘Step 1’ , the text shows ‘Webpack will create one bundle.js file in a root.’. I can’t see the bundle.js under my root directory. is there any other step to create bundle.js after saving the config.js file? This causes error on my first ‘npm start’,
bundle.js:sourcemap:10804 [Vue warn]: Property or method “item” is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See:.
found in
—> at src\components\CreateItem.vue
Also from my console on ‘npm start’, it displays
webpack output is served from /
Hash: e7eea2948a93c882ce61
Version: webpack 3.10.0
Time: 4589ms
Asset Size Chunks Chunk Names
bundle.js 752 kB 0 [emitted] [big] main
[12] multi (webpack)-dev-server/client? ./src/main.js 40
bytes {0} [built]
Hi there.
Nice tutorial, I have setup the code on my computer. I have fun all the installs, but cant figure out how to get the server routes to work in expressjs.
If I try to go here:
I get a 404, what am I missing?
did you solve the problem?
Hi,
Thanks for the tutorial. I set it up following all the steps but I have one issue.
If I try to go to one of the vue routes directly I am faced with a 404 error.
If I go to home then click about button which is a vue-router button it works, but then if i reload the page on that about page I get a 404 error.
Any help would be appreciated!
Great Tutorial.
I think you missed v-on:submit.prevent=”addItem” in CreateItem.vue (Template) &
this.$router.push({name: ‘DisplayItem’}) in addItem() method
Yes, thanks man for your support.
Can I have a question to you about consuming rest api with vue js? I need one thing get clearly.
Hey Krunal,
Thanks for the tutorial. I am facing a couple of problems.
1) Bundle.js is not forming.
2) When I am running the command npm start, error is showing up with the router line in main.js
Also, since I am starting with Vue for the first time, could you share few links from where I can start.
Cheers,
Anubhav
Everything i did was same. but in the browser it doesn’t display anything.
please help.
Thank you very much @Krunal for providing a nice tutorial.
Thanks, it works for my project
Willthis ever be psoted? Does it take years for a comment to show up here? Sorry if i am spamming but i have no clue if my comment made it or not..
Error: Network Error index.js line 216 > eval:16:15
Hm, is this comment function broken?
I try once more..
Sorry again if this gets doubled, I don’t get how this comment system is supposed to work, I cannot see my comment from yesterday ans also no info…
I downloaded your repository another time and tried to adjust stuff to be compatible with the latest (working) versions of the libraries. This led to the following scenario:
package.json:
{
“name”: “vuenodetutorial-master-fsc_neu”,
“version”: “1.0.0”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
“start”: “webpack-dev-server”
},
“author”: “”,
“license”: “”,
“devDependencies”: {
“@babel/core”: “^7.7.7”,
“axios”: “^0.19.1”,
“babel-core”: “^6.26.3”,
“babel-loader”: “^8.0.6”,
“babel-plugin-transform-runtime”: “^6.23.0”,
“babel-preset-env”: “^1.7.0”,
“babel-preset-es2015”: “^6.24.1”,
“babel-preset-stage-3”: “^6.24.1”,
“babel-runtime”: “^6.26.0”,
“core-js”: “^3.6.2”,
“css-loader”: “^3.4.1”,
“file-loader”: “^5.0.2”,
“nodemon”: “^2.0.2”,
“vue”: “^2.6.11”,
“vue-axios”: “^2.1.5”,
“vue-loader”: “^14.2.4”,
“vue-router”: “^3.1.3”,
“vue-template-compiler”: “^2.6.11”,
“webpack”: “^4.41.5”,
“webpack-cli”: “^3.3.10”,
“webpack-dev-server”: “^3.10.1”
},
“dependencies”: {
“body-parser”: “^1.19.0”,
“cors”: “^2.8.5”,
“express”: “^4.17.1”,
“mongoose”: “^5.8.5”
}
}
mongo
————————————————
➜ VueNodeTutorial-master-fsc_NEU brew services start mongodb-community
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-community)
npm run start
————————————————
> [email protected] start /zzz/zzz/zzz/VueNodeTutorial-master-fsc_neu
> webpack-dev-server /zzz/zzz/zzz/VueNodeTutorial-master-fsc_neu
ℹ 「wdm」: Hash: ebf5562222638d52a641
Version: webpack 4.41.5
Time: 1624ms
Built at: 08.01.2020 02:17:19
Asset Size Chunks Chunk Names
bundle.js 912 KiB main [emitted] main
Entrypoint main = bundle.js
[0] multi (webpack)-dev-server/client? ./src/main.js 40 bytes {main} [built]
[./node_modules/axios/index.js] 40 bytes {main} [built]
[./node_modules/strip-ansi/index.js] 161 bytes {main} [built]
[./node_modules/vue-axios/dist/vue-axios.min.js] 673 bytes {main} [built]
[./node_modules/vue-router/dist/vue-router.esm.js] 72 KiB {main} [built]
[./node_modules/vue/dist/vue.js] 334 KiB {main} [built]
[./node_modules/webpack-dev-server/client/index.js? (webpack)-dev-server/client? 4.29 KiB {main} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.51 KiB {main} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.53 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/createSocketUrl.js] (webpack)-dev-server/client/utils/createSocketUrl.js 2.91 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/log.js] (webpack)-dev-server/client/utils/log.js 964 bytes {main} [built]
[./node_modules/webpack-dev-server/client/utils/reloadApp.js] (webpack)-dev-server/client/utils/reloadApp.js 1.59 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/sendMessage.js] (webpack)-dev-server/client/utils/sendMessage.js 402 bytes {main} [built]
[./node_modules/webpack/hot sync ^\.\/log$] (webpack)/hot sync nonrecursive ^\.\/log$ 170 bytes {main} [built]
[./src/main.js] 711 bytes {main} [built]
+ 69 hidden modules
ℹ 「wdm」: Compiled successfully.
nodemon server
————————————————
[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node server.js`
Listening on port 4000
Database is connected ((server.js, line 11)
browser:
i can see the vue template:
Items
ID Item Name Item Price Actions
but nothing else.
browser console:
GET
[HTTP/1.1 304 Not Modified 1ms]
GET
[HTTP/2.0 200 OK 0ms]
GET
[HTTP/1.1 304 Not Modified 2ms]
=> => => XHRGET
=> => => [HTTP/1.1 404 Not Found 1ms]
GET
[HTTP/1.1 404 Not Found 0ms]
You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at vue.js:9063:47
=> => => Error: Request failed with status code 404 bundle.js line 228 > eval:16:15
=> => => Source-Map-Fehler: Error: NetworkError when attempting to fetch resource.
Ressourcen-Adresse: webpack:///./node_modules/sockjs-client/dist/sockjs.js?
Source-Map-Adresse: sockjs.js.map
XHRGET
[HTTP/1.1 200 OK 1ms]
GET
[HTTP/1.1 101 Switching Protocols 2ms]
In this setup, line 10 and 11 of server.js i changed to:
mongoose.connect(config.DB, { useNewUrlParser: true, useUnifiedTopology: true }).then(
() => {console.log(‘Database is connected ((server.js, line 11)’) },
And in webpack.config.js the port i set to 4000, to be consistent with server.js (was 3000 before).
Hard to see how this would not have happened before.
I guess some part of the puzzle might be missing.
But, then, how, how, how would anyone have been able to get this going?
And then not tell the others how?
Someone MUST be able to shed some light here, at least of those who claim to ‘have it going’ ?
I come for PHP and stuff, maybe it’s because of this the other tut,, worked fast.
But here, …
… no one?
If the author does not know, maybe someone else does?
Works now. Probably there are not as many mistakes in the code as I first thought. Late yesterday night I had build in an error by myself by setting XHR path and web path to the same port.
I think the main problem could be the changes the happened to MongoDB since this tutorial has been posted.
On a Mac, be sure to use ‘brew services start mongodb-community’ on the command line and start the server with
mongoose.connect(config.DB, { useNewUrlParser: true, useUnifiedTopology: true }).then(
… to have no deprecation warnings (there’s one left for mongoose with above package.json).
And double check if nodemon has been installed globally (sudo npm install -g nodemon).
Thanks for your efforts.
“Thanks for your efforts.”, that was to Krunal, maybe was not clear. | https://appdividend.com/2017/08/04/vuejs-nodejs-tutorial/ | CC-MAIN-2020-29 | refinedweb | 4,168 | 53.78 |
Don't mind the mess!
We're currently in the process of migrating the Panda3D Manual to a new service. This is a temporary layout in the meantime.
This page intends to lead through a minimal "hello world" program using Panda3D and Bullet physics.
World
In order to use Bullet physics we need to have a BulletWorld. The world is Panda3D's term for a "space" or "scene". The world holds physical objects like rigid bodies, soft bodies or character controllers. It controls global parameters, such a gravity, and it advances the simulation state.
from panda3d.bullet import BulletWorld world = BulletWorld() world.setGravity(Vec3(0, 0, -9.81))
The above code creates a new world, and it sets the worlds gravity to a downward vector with length 9.81. While Bullet is in theory independent from any particular units it is recommended to stick with SI units (kilogram, meter, second). In SI units 9.81 m/s² is the gravity on Earth's surface.
Next we need to advance the simulation state. This is best done by a task which gets called each frame. We find out about the elapsed time (dt), and pass this value to the
doPhysics method.
def update(task): dt = globalClock.getDt() world.doPhysics(dt) return task.cont taskMgr.add(update, 'update')
The
doPhysics method allows finer control on the way the simulation state is advanced. Internally Bullet splits a timestep into several substeps. We can pass a maximum number of substeps and the size of each substep, like show in the following code.
world.doPhysics(dt, 10, 1.0/180.0)
Here we have a maximum of 10 substeps, each with 1/180 seconds. Choosing smaller substeps will make the simulation more realistic, but performance will decrease too. Smaller substeps also reduce jitter.
Static bodies
So far we just have an empty world. We next need to add some objects. The most simple objects are static bodies. Static object don't change their position or orientation with time. Typical static objects are the ground or terrain, and houses or other non-moveable obstacles. Here we create a simple plane which will serve as a ground.
from panda3d.bullet import BulletPlaneShape from panda3d.bullet import BulletRigidBodyNode shape = BulletPlaneShape(Vec3(0, 0, 1), 1) node = BulletRigidBodyNode('Ground') node.addShape(shape) np = render.attachNewNode(node) np.setPos(0, 0, -2) world.attachRigidBody(node)
First we create a collision shape, in the case a
BulletPlaneShape. We pass the plane's constant and normal vector within the shape's constructor. There is a separate page about setting up the various collision shapes offered by Bullet, so we won't go into more detail here.
Next we create a rigid body and add the previously created shape.
BulletRigidBodyNode is derived from
PandaNode, and thus the rigid body can be placed within the Panda3D scene graph. you can also use methods like
setPos or
setH to place the rigid body node where you want it to be.
Finally we need to attach the newly created rigid body node to the world. Only rigid bodies attached to the world will be considered when advancing the simulation state.
Dynamic bodies
Dynamic bodies are similar to static bodies. Except that dynamic bodies can be moved around the world by applying force or torque. To setup a dynamic body is almost the same as for static bodies. We will have to set one additional property though, the body's mass. Setting a positive finite mass will create a dynamic body, while setting the mass to zero will create a static body. Zero mass is a convention for setting an infinite mass, which is the same as making the body unmovable (static).
from panda3d.bullet import BulletBoxShape shape = BulletBoxShape(Vec3(0.5, 0.5, 0.5)) node = BulletRigidBodyNode('Box') node.setMass(1.0) node.addShape(shape) np = render.attachNewNode(node) np.setPos(0, 0, 2) world.attachRigidBody(node)
Bullet will automatically update a rigid body node's position and orientation if is has changed after advancing the simulation state. So, if you have a
GeomNode - e. g. a textured box - and reparent this geom node below the rigid body node, then the geom node will move around together with the rigid body. You don't have to synchronize the visual world with the physics world.
The Program
Let's put everything learned on this page together into a single script, which is shown below. It assumes that you have an .egg model of a 1 by 1 by 1 box.
when running the script you will see a box falling down onto an invisible plane. The plane is invisible simply because we didn't parent a visual mode below the plane's rigid body node. Of course we could have done so.
The model cube.egg used in this hello word sample can be found in the following archive:
import direct.directbase.DirectStart from panda3d.core import Vec3 from panda3d.bullet import BulletWorld from panda3d.bullet import BulletPlaneShape from panda3d.bullet import BulletRigidBodyNode from panda3d.bullet import BulletBoxShape base.cam.setPos(0, -10, 0) base.cam.lookAt(0, 0, 0) # World world = BulletWorld() world.setGravity(Vec3(0, 0, -9.81)) # Plane shape = BulletPlaneShape(Vec3(0, 0, 1), 1) node = BulletRigidBodyNode('Ground') node.addShape(shape) np = render.attachNewNode(node) np.setPos(0, 0, -2) world.attachRigidBody(node) # Box shape = BulletBoxShape(Vec3(0.5, 0.5, 0.5)) node = BulletRigidBodyNode('Box') node.setMass(1.0) node.addShape(shape) np = render.attachNewNode(node) np.setPos(0, 0, 2) world.attachRigidBody(node) model = loader.loadModel('models/box.egg') model.flattenLight() model.reparentTo(np) # Update def update(task): dt = globalClock.getDt() world.doPhysics(dt) return task.cont taskMgr.add(update, 'update') run() | https://www.panda3d.org/manual/?title=Bullet_Hello_World | CC-MAIN-2019-35 | refinedweb | 950 | 53.27 |
how to make tab active [onsen with react js]
Hello,
I follow this tutorial
but i couldn’t make the tab home active! I didn’t see any line of example code make tab active too but in demo the home tab is active.
Could you please tell me how to make a tab active(for example Home tab) by default? What I am trying to do is after user login it will link to the tab page with home tab active
thank you
Hi! any help???
@iriekun As demonstrated in the help documents, this section sets the initial state:
getInitialState: function() { return { index: 0 } }
The tabs are basically a 0 based array. Change the number to indicate the tab.
@munsterlander i also tried it but it doesn’t work!!! I couldn’t understand why! It shoudn’t be that complicated!!! I also tried to use initialndex from this example
but still it didn’t work too!
here is my code
class Home extends React.Component { gotoComponent(component) { this.props.navigator.pushPage({comp: component}); } renderToolbar() { return ( <Toolbar> <div className='center'>Home</div> </Toolbar> ); } render() { return ( <Page renderToolbar={this.renderToolbar}> <List renderHeader={() => <ListHeader>Components</ListHeader>} dataSource={[{ name: 'Story Mission', component: StoryCarousel }, { name: 'Speed dials', component: StoryCarousel }]} renderRow={(row) => <ListItem tappable onClick={this.gotoComponent.bind(this, row.component)}> {row.name} </ListItem> } /> </Page> ); } } var Tabs = React.createClass({ getInitialState: function() { return { index: 0 } }, renderTabs: function() { return [ { content: <Home navigator={this.props.navigator}/>, tab: <Ons.Tab }, { content: <Home />, tab: <Ons.Tab } ]; }, render: function() { return ( <Ons.Page> <Ons.Tabbar renderTabs={this.renderTabs} /> </Ons.Page> ); } }); class App extends React.Component { renderPage(route, navigator) { const props = route.props || {}; props.navigator = navigator; return React.createElement(route.component, props); } render() { return ( <Ons.Navigator initialRoute={{component: Tabs, props: {key: 'main'}}} renderPage={this.renderPage} /> ); } } export default App;
@munsterlander no tab is active at all!
@iriekun You have a lot of extra code that I stripped out to confirm the tabbar works. Here is your basic template working:
@munsterlander but when I put it in the meteor project, it still doesn’t show the initial tab! I tried everything now! Could it have the conflict with meteor or what?
@iriekun Well, I would guess that if the code I provided works until it is rolled in with Meteor, then Meteor is the source of the issue. Now what that is, I don’t know.
On a side note and personal thought, I always wonder why so many projects roll so many frameworks into one that duplicate a ton of the efforts. I question the need for Meteor to begin with and the same goes for Angular, React, the whole lot. Unless it is some huge and super complex application with a building of developers, it always seems like overkill.
Ok, off my rant and back to your problem. Is anything being output into the console at all? | https://community.onsen.io/topic/1065/how-to-make-tab-active-onsen-with-react-js | CC-MAIN-2017-39 | refinedweb | 474 | 51.04 |
Graphs, Python and CSS.
First, I wrote a very lightweight CSS parser and rule matcher. Code examples always show off these things best; first you do something like
css_string = """wavegraph {color: #369; font-size: 12; }
grid.minor { color: #eee; } """
import css
stylesheet = css.CssStylesheet.from_css(css_string)
If you're feeling like using stylesheets a lot, you can make them external (e.g. a file "default_css.css") and use the import hook:
import css
css.install_hook()
import graphication.default_css as stylesheet
Then, querying properties is pretty simple:
>>> stylesheet.props("wavegraph")
{"color": "#369", "font-size": "12"}
>>> stylesheet.props("wavegraph").get("color")
"#369"
>>> stylesheet.props("wavegraph").get_int("font-size")
12
>>> stylesheet.props("wavegraph grid.minor line")
{"color": "#eee", "font-size": "12"}
This means all the styling crud previously used can be replaced with these simple css-selector-ish queries, and different graph styles can simply ship as different css files.
So, hopefully, graph styling will be a lot more accessible once I roll this fully into the graph system, as well as a lot nicer to deal with for most uses. In the meantime, if you want to look at this CSS parser code, have a look at the current subversion copy. | http://www.aeracode.org/2007/8/30/graphs-python-and-css/ | crawl-002 | refinedweb | 199 | 59.9 |
Contributing to Django
This document is for Django's SVN release, which can be significantly different from previous releases. Get old docs here: 0.96, 0.95.
We’re always grateful for patches to Django’s code. Indeed, bug reports with associated patches will get fixed far more quickly than those without patches.
“Claiming” tickets:
-
Once you’ve claimed a ticket, you have a responsibility to work on that ticket in a reasonably timely fashion. If you don’t have time to work on it, either unclaim it or don’t claim it in the first place!
Core Django developers go through the list of claimed tickets from time to time, checking whether any progress has been made. If there’s no sign of progress on a particular claimed ticket for a week or two after it’s been claimed, we will unclaim it for you so that it’s no longer monopolized and somebody else can claim it.
If you’ve claimed a ticket and it’s taking a long time (days or weeks) to code, keep everybody updated by posting comments on the ticket. That way, we’ll know not to unclaim it. More communication is better than less communication!
Which tickets should be claimed?.
-..
Non-trivial patches.
Ticket triage roles here:
- Core developers: people with commit access who make the decisions and write the bulk of the code.
- Ticket triagers: community members who keep track of tickets, making sure the tickets are always categorized correctly.
Second, note the five triage stages:
- A ticket starts as “Unreviewed”, meaning that a triager has yet to examine the ticket and move it along.
- “Design decision needed” means “this concept requires a design decision,” which should be discussed either in the ticket comments or on django-developers.
- to see if the patch is “good”.
- “Needs documentation”
- This flag is used for tickets with patches that need associated documentation. Complete documentation of features is a prerequisite before we can check a fix, or that the code doesn’t live up to our standards.
A ticket can be resolved in a number of ways:
- “fixed”
- Used by one of the core developers once a patch has been rolled into Django and the issue is fixed.
- “invalid”
- Used if the ticket is found to be incorrect or a user error.
- “wontfix”
- Used when a core developer decides that this request is not appropriate for consideration in Django. This is usually chosen after discussion in the django-developers mailing list, and you should feel free to join in when it’s something you care about.
- “duplicate”
- Used when another ticket covers the same issue. By closing duplicate tickets, we keep all the discussion in one place, which helps everyone.
- “worksforme”
- Used when the triage team is unable.
Submitting and maintaining translations
Various parts of Django, such as the admin site and validator error messages, are internationalized. This means they display different text depending on a user’s language setting..
- Create a diff of the .po file against the current Subversion trunk.
- Make sure that `` bin/compile-messages.py -l <lang>`` runs without producing any warnings.
- Attach the patch to a ticket in Django’s ticket system.
Coding style
Please don’t put your name in the code you contribute. Our policy is to keep contributors’ names in the AUTHORS file distributed with Django — not scattered throughout the codebase itself. Feel free to include a change to the AUTHORS file in your patch if you make more than a single trivial change.
Template style
In Django template code, put one (and only one) space between the curly brackets and the tag contents.
Do this:
{{ foo }}
Don’t do this:
{{foo}}
View style
In Django views, the first parameter in a view function should be called request.
Do this:
def my_view(request, foo): # ...
Don’t do this:
def my_view(req, foo): # ...
Model style Meta should
- class Meta
- class Admin
- def __unicode__()
- def __str__()
- def save()
- def get_absolute_url()
- Any custom methods
If choices is defined for a given model field, define the choices as a tuple of tuples, with an all-uppercase name, either near the top of the model module or just above the model class. Example:
GENDER_CHOICES = ( ('M', 'Male'), ('F', 'Female'), )
Documentation style
We place a high importance on consistency and readability of documentation. (After all, Django was created in a journalism environment!)
How to document new features philosophy is that “general improvements” are something that all current Django users should benefit from, including users of trunk and users of the latest release. Hence, the documentation section on djangoproject.com points people by default to the newest versions of the docs, because they have the latest and greatest content. (In fact, the Web site pulls directly from the Subversion repository, converting to HTML on the fly.)
But this decision to feature bleeding-edge documentation has one large caveat: any documentation of new features will be seen by Django users who don’t necessarily have access to those features yet, because they’re only using the latest release. Thus, our policy is:
All documentation of new features should be written in a way that clearly designates the features are only available in the Django development version. Assume documentation readers are using the latest release, not the development version.
Our traditional way of marking new features is by prefacing the features’ documentation with: “New in Django development version.” Changes aren’t required to include this exact text, but all documentation of new features should include the phrase “development version,” so we can find and remove those phrases for the next release.
Guidelines for ReST files
These guidelines regulate the format of our ReST documentation:
- In section titles, capitalize only initial words and proper nouns.
- Wrap the documentation at 80 characters wide, unless a code example is significantly less readable when split over two lines, or for another good reason.
Commonly used terms
-
- model — it’s not capitalized.
- template — it’s not capitalized.
- URLconf — use three capitalized letters, with no space before “conf.”
- view — it’s not capitalized.
Committing code
Please follow these guidelines when committing code to Django’s Subversion repository: lead developers don’t.”
For commits to a branch, prefix the commit message with the branch name. For example: “magic-removal: core Django developers follow your changes.
Django comes with a test suite of its own, in the tests directory of the Django tarball. It’s our policy to make sure all tests pass at all times.
The tests cover:
- Models and the database API (tests/modeltests/).
- The cache system (tests/regressiontests/cache.py).
- The django.utils.dateformat module (tests/regressiontests/dateformat/).
- Database typecasts (tests/regressiontests/db_typecasts/).
- The template system (tests/regressiontests/templates/ and tests/regressiontests/defaultfilters/).
- QueryDict objects (tests/regressiontests/httpwrappers/).
- Markup template tags (tests/regressiontests/markup/).
We appreciate any and all contributions to the test suite!
The Django tests all use the testing infrastructure that ships with Django for testing applications. See Testing Django applications for an explanation of how to write new tests.
Running the unit tests
To run the tests, cd to the tests/ directory and type:
./runtests.py --settings=path.to.django.settings
Yes, the unit tests need a settings module, but only for database connection info, with the DATABASE_ENGINE setting. You’ll also need a ROOT_URLCONF setting (its value is ignored; it just needs to be present).
Requesting features
In general, most development is confined to the trunk, and the trunk is kept stable. People should be able to run production sites against the trunk at any time.
Thus, large architectural changes — that is, changes too large to be encapsulated in a single patch, or changes that need multiple eyes on them — will have dedicated branches. See, for example, the i18n branch. If you have a change of this nature that you’d like to work on, ask on django-developers for a branch to be created for you. We’ll create a branch for pretty much any kind of experimenting you’d like to do.
We will only branch entire copies of the Django tree, even if work is only happening on part of that tree. This makes it painless to switch to a branch.
Developers working on a branch should periodically merge changes from the trunk into the branch. Please merge at least once a week. Every time you merge from the trunk, note the merge and revision numbers in the commit message.
To use a branch, you’ll need to do two things:
- Get the branch’s code through Subversion.
- Point your Python site-packages directory at the branch’s version of the django package rather than the version you already have installed.
Getting the code from Subversion (‘Trunk’.
Official releases.
A minor release may deprecate certain features in previous releases. If a feature in version A.B is deprecated, it will continue to work in version A.B+1. In version A.B+2, use of the feature will raise a PendingDeprecationWarning but will continue to work. Version A.B+3 will remove the feature entirely. Major point releases will always remove deprecated features immediately.
C is the micro version number which, is incremented for bug and security fixes. A new micro-release will always be 100% backwards-compatible with the previous micro-release.
In some cases, we’ll make release candidate releases. These are of the form A.BrcN, which means the Nth candidate release.
Deciding on features
Once a feature’s been requested and discussed, eventually we’ll have a decision about whether to include the feature or drop it.. Tough decisions will be discussed by all full committers and finally decided by the Benevolent Dictators for Life, Adrian and Jacob.
Commit access.
Questions/Feedback
If you notice errors with this documentation, please open a ticket and let us know!
Please only use the ticket tracker for criticisms and improvements on the docs. For tech support, ask in the IRC channel or post to the django-users list. | http://www.djangoproject.com/documentation/contributing/ | crawl-001 | refinedweb | 1,663 | 56.55 |
From: Yitzhak Sapir (ysapir_at_[hidden])
Date: 2002-02-05 05:08:29
As I said, I have a problem with call_traits. This problem is very
strange to me. I have gotten a simple piece of code to produce it, but
after getting this far, it seems very very odd. I'm using version 1.25
of the boost libraries.
#include "stdafx.h"
#include "boost/call_traits.hpp"
#include "boost/smart_ptr.hpp"
struct A
{
virtual const A& getA2() const = 0;
boost::shared_ptr<A> getA1() const;
};
int main(int argc, char* argv[])
{
A* a;
#if 1
a->getA1();
const A & b = (
boost::call_traits<const
A&>::param_type(a->getA1()->getA2())
);
#else
const A& b = (
a->getA1(),
boost::call_traits<const
A&>::param_type(a->getA1()->getA2())
);
#endif
return 0;
}
The following produces a series of errors starting with:
c:\testbind\boost\detail\ob_call_traits.hpp(47) : error C2529:
'<Unknown>' : reference to reference is illegal
c:\testbind\boost\detail\ob_call_traits.hpp(103) : see reference
to class template instantiation
'boost::detail::standard_call_traits<struct TC::TS const &>' being
compiled
C:\testbind\testct.cpp(21) : see reference to class template
instantiation 'boost::call_traits<struct TC::TS const &>' being compiled
What I find most strange and odd about it is this: If I change the #if 1
to #if 0, I get this error. If I leave the #if 1, it compiles fine (it
doesn't link, but that's not the point). In my code these various parts
represent boolean expressions joined by an &&, and there are three
classes involved, but I tried to get it as simple as possible. So I
could change the code to read: bool b1 = te->getTC(); bool b2 =
te->getTC()->getTS(); and then and them together. But if I try it in
one expression: bool b = te->getTC() && te->getTC()->getTS(); the
compiler fails on the above error.
I am pretty certain this is the error that originally caused my problem.
For some reason, I thought it had to do with a long& at the time. If I
change the long call_traits_chooser expression to be
<is_pointer<>::value, is_reference<>::value), both of the above #if
possibilities work. But I'm not sure this is the root of the problem
anymore.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk | https://lists.boost.org/Archives/boost/2002/02/24516.php | CC-MAIN-2019-47 | refinedweb | 386 | 57.47 |
In this tutorial, we'll review why Continuous Integration is indispensable to the development lifecycle of both solitary developers and teams and how we can immediately begin to reap its benefits.
Continuous Integration (CI) is a software development practice wherein developers regularly merge their code with a central repository after which automated builds and tests are run.
We'll be using git for version control and Circle CI as our CI server. It'll provide us with a reliable configurable environment for us to run our automated builds and tests.
Table of Contents
Principles of Continuous Integration
Before we get our hands dirty with a demonstration, let's briefly discuss the principles of Continuous Integration.
Maintain a single source code repository
Continuous Integration (CI) advocates the use of a version control system to track changes in code.
Everything needed for a fully functional application should be pushed to a single repository.
Build automation
It should be trivial to trigger a complete rendering of the project with a single command. This should include tasks like the creation and migration of databases and configuring project environment variables.
Make the build self testing
The CI tool used should trigger a run of the project tests after the build is complete. Of course, this necessitates that comprehensive tests be written for any work to be integrated.
Before the code that triggered the build is merged with the main branch, all tests must be seen to pass.
Make frequent commits to the main branch
Making atomic and frequent commits encourages integration and makes conflicts between work from different developers easier to manage and resolve.
After a section of work has been built and passes tests on the CI server, it should be merged to the main branch after review.
Every commit should trigger a build on the CI server
This assures that each commit made has not broken the build. It also becomes trivial to pinpoint a commit that caused errors in the build.
Broken builds should be fixed immediately
When it is discovered that a commit has caused a build on the CI server to fail, the commit should be analysed and the cause of the break resolved as soon as possible.
The CI build should be done in a replica of the production environment
Running the build in an environment with little or no deviation from the production environment assures that running the same application in the actual production environment will not be fraught with unwelcome surprises.
The output of CI builds should be visible
Build status should be made available to all relevant stakeholders. Circle CI can be configured to send email and web notifications after a build has completed.
Advantages of continuous integration
The benefits of implementing Continuous Integration in your development cycle are several. Let's note down a few here.
- Since build output is extremely visible, when a build fails, we can find and resolve bugs quickly.
- Continuous Integration helps to enforce testing in our applications, since we rely on these tests to assess the success of our builds.
- Because the build is run in a production like environment, CI reduces the time it takes to validate the quality of software to be deployed.
- Since atomic commits are encouraged, CI allows us to reduce integration problems with existing code, enabling us to deliver better software faster.
CI for solo developers and teams
Now that I've bended your ear with praises for Continuous Integration, let's sober up a little.
It's evident how the benefits we discussed above would be extremely valuable for teams. Now, let's focus on how CI can enrich development for solo developers and whether the benefits outweigh the costs.
All the advantages we mentioned above still apply to solo developers but if you're solo, you should think about the following before implementing CI.
- CI takes time: Depending on the complexity of your application's environment, it may require a lot of manpower to set up your CI environment in a way that mirrors your actual production environment. If your production environment changes, you'll need to reconfigure your CI environment too.
- Tests take time: Again, depending on the complexity of your application and the thoroughness of the tests running in the CI environment, your tests may take a while to run and confirm the health of the build. Since the build and tests should ideally run on every commit made, this could be an expensive operation. You may also need to spend valuable time optimising how your tests run. If you want to move fast and break things, this may be a little frustrating.
- CI is a way of life: Continous Integration begins and ends with the developer. It's a commitment not to be taken lightly. When you don't have a team that reminds you of the value of the process, it can be a lonely and tiring path to walk.
- CI can be a red herring: Developers implementing CI have to ensure that they are not lulled into a false sense of security by passing builds. This is even more important when you're working alone and without the benefit of other processes that could alert you to unseen problems. The build is only as good as the tests that run in it.
Account Setup
Now that we've got a handle on what Continuous Integration is, let's see what it entails. We'll need accounts with the following services, so go ahead and register.
- Github: We'll use Github to host our git repository.
- Circle CI: Registering on Circle CI with your Github account will make things easier in future. This has the advantage of adding CircleCI integration to your Github account.
- Coveralls: Samsies here. Sign up with Coveralls using your Github account.
Global Dependencies
Before we start, you'll need to install a few applications globally.
- git
- Python: I'll be using v3.5.2
- virtualenv: A recommended installation to isolate our application environment.
Project structure
The following will be the scaffolding for our project, so go ahead and create these directories.
+-- python-ci +-- src | +-- math.py +-- test | +-- math-test.py +-- requirements.txt
Next, copy and paste the following into the
requirements.txt file at the root of the project.
appdirs==1.4.0 astroid==1.4.9 click==6.7 coverage==4.3.4 coveralls==1.1 docopt==0.6.2 isort==4.2.5 lazy-object-proxy==1.2.2 mccabe==0.6.1 nose==1.3.7 packaging==16.8 pyparsing==2.1.10 requests==2.13.0 six==1.10.0 wrapt==1.10.8
Finally, create and activate the virtual environment for this project then run
pip install -r requirements.txt
This will install all the required dependencies for our project in your current virtual environment.
Let's create a simple class with a function that returns the sum of two numbers. Add this into your src/math.py file.
class Math(): def addition(value1, value2): if not isinstance(value1, int) and not isinstance(value2, int): return 'Invalid input' else: return value1 + value2
Next, let's write a test to make sure our function is working as expected.
import unittest from src.math import Math class MathTest(unittest.TestCase): def test_addition(self): # Make test fail self.assertEqual(Math.addition(3, 4), 8)
You'll notice that we've made an incorrect assertion in the test. Let's let it slide for now.
Now, run the following in your shell to make sure the test fails.
nosetests tests/math-test.py
Expect similar results
F ====================================================================== FAIL: test_addition (math-test.MathTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/emabishi/Desktop/Projects/Personal/python-ci/tests/math-test.py", line 8, in test_addition self.assertEqual(Math.addition(3, 4), 8) AssertionError: 7 != 8 ---------------------------------------------------------------------- Ran 1 test in 0.001s FAILED (failures=1)
Github
Let's create a repository on Github that will hold our application.
Once you've signed up, create one. I'll be calling mine
python-ci.
Next, it's time to initialise our local project directory as a git repository and add a reference to our github remote. At the root of your project, run the following commands:
git init && git remote add origin <enter-your-github-repository-url-here>
A second option would be to clone the Github respository to our local machine. We can do this with a single command.
git clone <enter-your-github-repository-url-here>
Let's create a new branch called
develop and check out to it with the command
git checkout -b develop
After this, we can add and commit our previous changes using
git add . && git commit -m "<enter-short-commit-message-here>"
Whew, we're done. I'd pat you on the back if I could. I promise you that the hardest part's over.
Circle CI
Circle CI is a service that helps us employ Continuous Integration by letting us build our application and run tests in a configurable environment.
It's also pretty handy because it can send us email and web notifications of the status of our current build. You can also integrate it with messaging services like Slack for real time notifications.
We just created an account with Circle CI, so let's take full advantage of it. Log in to your Circle CI account using Github authentication.
Once logged in, you'll be directed to your dashboard. Click on the fourth icon on the task bar on the left side of the screen. This is the projects tab and lists all your current Github repositories.
You'll see a page like the one below.
Click on the build project button next to the name of the repository you created before. Sit back, relax and watch what happens.
Circle CI runs our build but eventually errors out. Helpfully, it provides us with an error message.
To configure settings for the build on Circle CI, we'll need to create a configuration file in the form of a file with a .yml extension. Let's create a circle.yml file at the root of our project.
touch circle.yml
Fill it with the following:
machine: python: version: 3.5.2 dependencies: override: - pip install -r requirements.txt test: override: - nosetests tests/math-test.py
The machine section configures the virtual machine we're using. Here we're explicitly defining that the machine should run python version 3.5.2.
We use the dependencies section to install our application prerequisites and the test section to specify the command which will trigger our tests.
As you can see, it's exactly the command we used to run our tests locally.
As expected, with much pomp and circumstance, our tests have failed and failed loudly. We'll remedy this soon enough. Leave them in their imperfect state for now.
Coverage reporting
To ascertain the extent to which the tests we've written cover our code, we'll use Coverage.py. We've already installed it so there's little we have to do now.
At the root of our project, run
coverage run src/*.py && coverage report
Expect similar results
Name Stmts Miss Cover ---------------------------------------- tests/math-test.py 5 3 40%
You can tweak Coverage.py reporting in all sorts of interesting ways. If you're interested, have a look here. For our purposes, the default reporting will do for now.
Coveralls
The next service we're going to take advantage of is Coveralls. Coveralls displays our test coverage for all to see, thus making efforts at Continuous Integration loud and visible.
Once you sign in, you'll be directed to your dashboard.
Click on the second icon on the task bar on the left side of the screen. This is the add repo tab and lists all your Github repositories that are currently synced to Coveralls.
To refresh the list of repositories under your account, click on the Options menu on the right of the page linked to your Github account
Next, search of the name of the repository we recently created. In this case, I'm looking for
python-ci. Your repository name may be different.
Click on the switch to turn it to its ON position.
Click the details button next to the name of the repository. You'll see something like this:
Take note of the repo token.
To register our CI build with the Coveralls service, we have to perform some configuration. Let's do this by setting our Coveralls repository token as an environment variable on Circle CI.
Click on the gear button on the top right of the Circle CI build page. Follow along by clicking the Environment Variables tab on the left of the page. Finally, click the Add variable button and add the token like this.
Now, let's edit our circle.yml file to send coverage data to the Coveralls service after our tests run. Edit the circle.yml to look like this.
machine: python: version: 3.5.2 dependencies: override: - pip install -r requirements.txt test: override: - nosetests tests/math-test.py post: - coverage run src/*.py - coverage report - coveralls
Add and push the changes to your remote Github repository. The push will trigger another build on Circle CI.
If we go back to our Coveralls dashboard, we'll notice our dashboard now displays our test coverage percentage. We can even tell at a glance how our coverage has changed over time.
Sometimes it takes a while for the data to reflect, so give it a few minutes.
Github Status Checks
Going even further, in the spirit of Continuous Integration, we can prevent pushes or merges to the main branch of a repository until all required checks pass. In our case, these checks will be our tests.
We'll implement this using a helpful tool by Github called Status Checks.
Let's navigate to the settings tab of the repository we created on Github. Under the settings tab, select the Branches menu.
On the protected branches menu, choose to protect the master branch.
From there, make the following selections and save your changes. You'll be prompted to enter your password to authorise the changes.
To see the power of Github's Status Checks in action, let's make a Pull Request comparing the master branch of our repository with the develop branch.
As can be seen below, our tests failed on Circle CI. Therefore, because of the checks we put in place, merging to master is blocked.
Let's fix our tests, make a push to Github and watch our Pull Request for any changes.
Wohoo! Green all the way. We can now merge our work to the master branch with assurances that all our Continuous Integration checks have passed.
Conclusion
We've demonstrated that employing a Continuous Integration strategy in software development leads to major benefits in the quality of our work and the rapidity at which we resolve issues and conflicts within our application code.
Even more of interest is that when paired with Continuous Deployment strategies, CI becomes an even more powerful and capable tool. We've not gone into leveraging Continuous Deployment in our workflow, but I trust that you'll look into the possibilities that its use opens up.
However, there's a lot more we can do with CI which we've not gone into here. If you're interested, I'm leaving some links to a few resources which I believe will prove extremely helpful.
Resources
If you'd like to read more about Continous Integration, here are a few places you can start with.
A few other 3rd party CI tools are:
This list is by no means exhaustive.
I'd love some feedback on this guide. If you have a moment, drop me a comment in the box below. Also, if you have any questions, don't be shy, let me know. | https://scotch.io/tutorials/continuous-integration-with-python-and-circle-ci | CC-MAIN-2018-22 | refinedweb | 2,651 | 65.32 |
On Saturday morning I opened my web browser, built a playlist of a few songs and started to listen to them while I went about my morning computer tasks. Some of the songs in the playlist were on my laptop, while some were on the mac mini in the family room, and some were on a laptop of a friend that was on the other side of the Atlantic ocean. And if my friend in London had closed his laptop before I listened to ‘his’ song on my playlist it could have been replaced by a copy of the song that was on the computer of a friend in Seattle. I had a seamless music listening experience despite the fact that the music was scattered across a handful of computers on two continents. Such is the power of Playdar.
Playdar is a music content resolver. It is designed to solve one problem: given the name of track, find me a way to listen to it right now. You run Playdar on any computer that you own that has music and Playdar will make it easy to listen to all of that music as if it were on your local machine. The Playdar content resolver can also talk to other Playdar resolvers too, so if Playdar can’t find a track on my local network, it can ask my friend if it knows where the track is, extending my listening reach.
Playdar runs as a web service using standard web protocols for communicating with applications. When Playdar receives a request to resolve a track it runs through a list of prioritized content resolvers looking for the track. First it checks your local machine, then your local network. If it hasn’t found it there it could, if so configured, try your friends computers, or even a commercial song resolver (One could imagine for example, a music label offering up a portion of their catalog via a content resolver as a way to expose more listeners to their music). Playdar will do its best to find a copy of a song that you can listen to now. Playdar enables a number of new listening modes:
- Listen to my music anywhere – with Playdar, I don’t have to shoehorn my entire music collection onto every computer that I own just so I can listen to it no matter what computer I’m on. I can distribute my music collection over all my computers – and no matter what computer I’m on I have all my music available.
- Save money for music streamers – Music streaming services like Last.fm, Spotify and Pandora spend money for every song that is streamed. Often times, the listener will already own the song that is being streamed. Playdar-enabled music streaming services could save streaming costs by playing a local copy of a song if one is available.
- Share playlists and mixtapes – with Playdar a friend could give me a playlist (perhaps in a XSPF format) and I could listen to the playlist even if I don’t own all of the songs.
- Pool the music – At the Echo Nest, everyone has lots of music in their personal collections. When we are all in the same room it is fun to be able to sample music from each other. iTunes lets you do this but searching through 15 separate collections for music in iTunes is burdensome. With Playdar, all the music on all of the computers running Playdar on your local lan can be available for you to search and play without any of the iTunes awkwardness.
- Add Play buttons to songs on web pages – Since Playdar uses standard web protocols, it is possible to query and control Playdar from Javascript – meaning that Playdar functionality can be embedded in any web page. I could blog about a song and sprinkle in a little Javascript to add a ‘play’ button to the song that would use Playdar to find the best way to play the song. If I write a review about the new Beatles reissue and want the reader to be able to listen to the tracks I’m writing about, I can do that without having to violate Beatles copyrights. When the reader clicks the play button, Playdar will find the local copy that is already on the reader’s computer.
Playdar’s Marconi Moment
Playdar is the brainchild of RJ, the inventor of the audioscrobbler and one of the founders of Last.fm. RJ started coding Playdar in March of this year – but a few weeks ago he threw away the 10,000 lines of C++ code and started to rewrite it from scratch in Erlang. A few days later RJ tweeted: I should be taken aside and shot for using C++ for Playdar originally. It’s criminal how much more concise Erlang is for this. Less than 3 weeks after starting from a clean sheet of paper, the new Erlang-based Playdar had its first transatlantic track resolution and streaming. The moment occurred on Friday, October 16th. Here’s the transcript from the IRC channel (tobyp is Toby Padilla, of MusicMobs and Last.fm fame) when London-based RJ first streamed a track from Toby’s Seattle computer:
[15:40:46] <tobyp>
[15:41:06] <RJ2> woo, transatlantic streaming
[15:41:19] <tobyp> hot!
[15:41:35] <RJ2> playdar’s marconi moment
[15:41:42] <tobyp> hahah
An incredible amount of progress has been made in the last two weeks, a testament to RJ’s skills as much as Erlang’s expressiveness. Still, Playdar is not ready for the general public. It requires a bit of work to install and get running – (yep, the erlang runtime is required), but developer Max Howell has been working on making a user-friendly package to make it easy for anyone to install. Hopefully it won’t be too long before Playdar is ready for the masses.
Even though it is new, there’s already some compelling apps that use Playdar. One is Playlick:
Playlick is a web application, developed by James Wheare that lets you build playlists. It uses Playdar for all music resolution. Type in the name of an album and Playlick / Playdar will find the music for you and let you listen to it. It’s a great way to see/hear the power of Playdar.
Adding custom content resolvers
One of the strengths of Playdar is that it is very easy to add new resolvers. If you are a music service provider you can create a Playdar content resolver that will serve up your content. I wrote a content resolver that uses the Echo Nest to resolve tracks using our index of audio that we’ve found on the web. This resolver can be used as a backstop. If you can’t find a track on your computer or your friend’s computers the Echo Nest resolver might be able to find a version out there on some music blog. Of course, the quality and availability of such free-range music is highly variable, so this resolver is a last resort.
Adding a new resolver to Playdar was extremely easy. It took perhaps 30 minutes to write – the hardest part was figuring out git – (thanks to RJ for walking me through the forks, pushes and ssh key settings). You can see the code here: echonest-resolver.py. Less than 150 lines of code, half of which is boilerplate. 150 lines and 30 minutes to add a whole new collection of music to the Playdar universe. Hopefully soon we’ll see resolvers for music streaming services like Napster, Rhapsody and Spotify.
What’s Next for Playdar?
Playdar is new – and the plumbing and wiring are still be worked on – but already it is doing something pretty magical – letting me listen to any track I want to right now. I can see how Playdar could be extended into acting as my music agent. Over time, my Playdar servers will get to know quite a bit about my music tastes. They’ll know what music I like to listen to, and when I like to listen to it. Perhaps someday, instead of asking Playdar to resolve a specific track by name, I’ll just be able to ask Playdar to give me a playlist of new music that I might like. Playdar can then use an Echo Nest, Last.fm or an AMG playlister to build a playlist of interesting, relevant new music. Playdar won’t just be a music resolver, Playdar will be my music agent helping me explore for and discover new music.
#1 by David Singleton on October 18, 2009 - 11:31 am
It’s great to see Playdar getting wider recognition.
Adding new resolvers really is very simple and it’s the easiest part of the project for new developers to get involved in. There’s a base PHP resolver [1] I wrote which reduces the amount of boiler plate needed for a new resolver.
Hopefully people will contribute similar classes for other languages in the future.
[1]
#2 by Fine Tuning on October 18, 2009 - 11:33 am
Great overview.
Audiogalaxy came to my mind when reading the introduction.
#3 by Robert Dyson on October 18, 2009 - 5:16 pm
This is awesome. Thanks for the article!
#4 by Lucas Gonze on October 23, 2009 - 5:59 pm
Great overview, Paul.
Here’s an issue that cropped up with installing the echonest resolver:
File “/Users/lgonze/bin/playdar-core/contrib/echonest/echonest-resolver.py”, line 14, in
import simplejson as json
ImportError: No module named simplejson
Obviously the fix is to find and install the module, but I figured you’d want to know about the hurdle.
#5 by Paul on October 24, 2009 - 6:40 pm
Ah, thanks much – it is easy to forget which python modules are not standardized.
#6 by zazi on November 1, 2009 - 5:56 pm
All in all, Playdar seems really interesting. Nevertheless, there is still the old known problem that people often do not really know the name of track. So it’s up on EchoNest and other people involved in music content analysis to bridge that gap. Of course, it will also be very interesting how such a application will scale in the large. Do the 50 or 100 or people like to recieve streams from my PC? At least I don’t really know if it is really legal when I stream the music. It is, in my opinion, a kind of broadcast (and the old problem with the intellectual property management).
Cheers,
zazi | https://musicmachinery.com/2009/10/18/playing-with-playdar/ | CC-MAIN-2021-04 | refinedweb | 1,770 | 68.3 |
Inkscape Wiki - User contributions [en] 2020-09-18T23:17:10Z User contributions MediaWiki 1.33.1 TextRework 2012-05-25T12:30:56Z <p>Lajujula: </p> <hr /> <div>= Proposal for restructuring how Inkscape handles text.=<br /> <br /> This is a work in progress...<br /> <br /> == Motivation ==<br /> <br /> Inkscape currently handles all text layout using code written for the never-adopted "flowed-text" SVG1.2 spec. There are several problems with this code:<br /> <br /> * The code does not handle normal SVG text well.<br /> * It is extremely complex. It mixes up line-breaking with layout code.<br /> * Inkscape's "flowed-text" is not recognized by any other SVG renderer.<br /> <br /> <br /> == Strategy ==<br /> <br /> The major goal is to reorganize the code to treat all text as normal SVG text. Three special cases would be indicated by inkscape namespace tags giving a total of four types of text:<br /> <br /> ===Normal SVG text===<br /> Standard SVG text with all properties ("x", "y", "letter-spacing, etc.).<br /> <br /> The only special text manipulating provided by Inkscape would be that a carriage return would create<br /> a new <tspan> starting directly below the first "y" value of the <text> object and a distance of<br /> "line-spacing" below the <text> or <tspan> just before the carriage return (this should work for both right-to-left text and left-to-right text).<br /> <br /> One problem with the current Inkscape implementation is that text in a <text> object is<br /> automatically moved to a <tspan>. This can cause problems with animated SVG's.<br /> <br /> A block of text should be contained in one <text> element. Multiple lines should be handled in <tspan>s. This allows multi-line text selection (for example, you may want to change an attribute on a string of text that spans parts of two lines).<br /> <br /> ===Normal Inkscape text===<br /> <br /> Normal SVG text with the added property that lines are handled by Inkscape,<br /> allowing insertion of new lines in the middle This is equivalent to the current Inkscape<br /> manipulation of text.<br /> <br /> New attributes:<br /> <br /> * inkscape:text-property="manage_lines" : Indicates type<br /> * inkscape:text-role="line" : Marks start of each new line (replaces sodipodi:role="line").<br /> <br /> One routine would be responsible for manipulation of lines, outputting normal SVG which<br /> would then be rendered by the normal SVG text routines.<br /> <br /> ===Inkscape flowed text===<br /> <br /> Text where line-breaking would be handled by Inkscape to fit in a rectangle box,<br /> equivalent to the current Inkscape flowed:text. "letter-spacing" and "word-spacing"<br /> could be used to justify the text.<br /> <br /> Hyphenation, indentation, etc. could be added here. Note that SVG2 may add some CSS text properties that could be useful here.<br /> <br /> New attributes:<br /> <br /> * inkscape:text-property="flowed_text"<br /> * inkscape:text-align="justify"<br /> * inkscape:text-box=href(#xxx) or <inkscape:flowregion><br /> <br /> One routine would be responsible for line-breaking, outputting normal SVG which would then<br /> be rendered by the normal SVG text routines. Line spacing is controlled only by the "line-spacing"<br /> property.. This routine would be responsible for verifying new lines fit in the box.<br /> <br /> ===Inkscape flowed into shape text===<br /> <br /> A more generalized case of normal Inkscape flowed text.<br /> <br /> Switching between the four modes would be possible, preserving the rendering of the text as<br /> much as possible.<br /> <br /> Note: SVG2 will include text flow into arbitrary shapes using [ CSS Regions] and [ CSS Exlusions].<br /> <br /> == Implementation Steps ==<br /> <br /> # Write new routines to handle plain SVG text. Check that it works for all imported text.<br /> # Switch "normal" Inkscape text (with lines handled by Inkscape) to use the new code.<br /> # Rewrite line-breaking code to output standard SVG.<br /> <br /> == Alignment Issues ==<br /> <br /> Note that inkscape is not able to vertically align some text according to a given boundary (wether the text box or an explicitly selected shape)<br /> It would be usefull to get such alignment features. Apple Pages does it "the right way"</div> Lajujula | https://wiki.inkscape.org/wiki/api.php?action=feedcontributions&user=Lajujula&feedformat=atom | CC-MAIN-2020-40 | refinedweb | 692 | 54.73 |
Eclipse WindowBuilder. This tutorial describes the usage of WindowBuilder for creating user interfaces.
1. Using a the SWT Designer (WindowBuilder) for visual UI design
1.1. What is SWT Designer?
SWT Designer is a visual editor used to create graphical user interfaces. It is a two way parser, e.g., you can edit the source code or use a graphical editor to modify the user interface. SWT Designer synchronizes between both representations.
SWT Designer is part of the WindowBuilder project. WindowBuilder provides the foundation and SWT Designer adds the support for working with SWT based applications.
1.2. Using SWT Designer
SWT Designer provides a special editor. This editor can work with Eclipse 4 parts, SWT and JFace dialogs, JFace wizards, etc.
The following screenshot demonstrates how the editor looks like.
SWT Designer allows to drag-and-drop SWT components into an existing layout. You can layout settings and create event handlers for your widgets.
SWT Designer contributes additional SWT and JFace templates to the Eclipse IDE.
For example you can use it to create
Composites and add these to the Eclipse user interface.
To create a new
Composite select .
SWT Designer has support to establish data binding via the JFace Data Binding framework.
2. Install SWT Designer
To use the SWT Designer for designing SWT user interfaces use enter the following update site to use it.
3. Exercise: Getting started with SWT Designer
3.1. Building an user interface
Right-click on your
PlaygroundPart class and select .
package com.vogella.tasks.ui.parts; import javax.annotation.PostConstruct; import org.eclipse.swt.widgets.Composite; public class PlaygroundPart { // the WindowBuilder / SWTDesigner tooling // uses the @PostConstruct method to figure out // that the class is am Eclipse 4 part // one method must be annotated with @PostConstruct and // must receive a least a SWT Composiste @PostConstruct public void createControls(Composite parent) { System.out.println(this.getClass().getSimpleName() + " @PostConstruct method called."); } }
Switch to the Design tab in the WindowBuilder editor. This selection is highlighted in the following screenshot.
Use the SWT Designer to change the layout of the
Composite of the part to a
GridLayout.
Click in the Palette on Button and add a few buttons to your user interface.
Add a
Label and a
Text field.
3.2. Add a SelectionLister to your button
Assign an SelectionLister (event handler) to one of your buttons for the
widgetSelected.
You can to this via a right-click on the button.
3.3. Review the generated code
Switch to the Source tab and review the code generated by the SWT Designer.
4. Learn more and get support
This tutorial continues on Eclipse RCP online training or Eclipse IDE extensions with lots of video material, additional exercises and much more content.
5. Links and Literature
Nothing listed. | https://www.vogella.com/tutorials/EclipseWindowBuilder/article.html | CC-MAIN-2021-17 | refinedweb | 459 | 50.43 |
w_scan − a universal ATSC and DVB blind scanner
w_scan -fa -c <COUNTRY_ID> [ options ]
w_scan -fc -c <COUNTRY_ID> [ options ]
w_scan -ft -c <COUNTRY_ID> [ options ]
w_scan -fs -s <SATELLITE_ID> [ options ]
w_scan scans for DVB−C, DVB−S/S2, DVB−T,.
The following options are available.
−f TYPE
Frontend type,
"a" = ATSC,
"c" = DVB-C,
"s" = DVB-S/S2,
"t" = DVB-T (and ISDB-T) [default]
Depending on "TYPE", either of the arguments "-s" or "-c" is mandatory.
−c.
−s SATELLITE_ID
Mandatory argument for satellite scans, see option -f.
Specifies the satellite you wish to scan as uppercase identifier, e.g.
S19E2 = 19.2° east,
S13E0 = 13.0° east,
S0W8 = 0.8° west.
Use "-s?" for a list of all known identifiers.
−A N
specify ATSC scan type
1 = terrestrial [default],
2 = cable,
3 = both, cable and terrestrial.
−o N
VDR channels.conf format
2 = VDR−2.0 [default],
21 = VDR−2.1
−X
generate zap/czap/xine output instead of VDR channels.conf.
−x
generate initial tuning data output for (dvb−)scan instead of VDR channels.conf.
−k
generate channels.dvb for kaffeine instead of VDR channels.conf.
−L
generate VLC xspf playlist (experimental)
−M
mplayer output instead of vdr channels.conf
−G
generate output for Gstreamer dvbsrc plugin
−h
show help
−H
show expert help
−C CHARSET
specifies the output charset, i.e. "UTF-8", "ISO-8859-15"
use ’iconv --list’ to see full list of charsets.
−I FILE
import dvbscan initial_tuning_data
−v
verbose (repeat for more)
−q
quiet (repeat for less)
−R N
Radio channels
0 = don’t search radio channels
1 = search radio channels [default]
−T N
TV channels
0 = don’t search TV channels,
1 = search TV channels [default]
−O N
Other services
0 = don’t search other services,
1 = search other services [default]
Conditional access / encrypted channels
0 = only Free TV channels,
1 = include encrypted channels [default]
−a N
use device /dev/dvb/adapterN/ [default: auto detect]
(also allowed: -a /dev/dvb/adapterN/frontendM)
NOTE: This option is deprecated and should be usually omitted.
−F
Long filter timeout for reading data from hardware.
−t N
Tuning timeout, increasing may help if device tunes slowly or has bad reception.
1 = fastest [default],
2 = medium,
3 = slowest
−i N
spectral inversion setting for cable TV
0 = off,
1 = on,
2 = auto [default]
−Q
DVB-C modulation [default: choosen by country]
NOTE: for experienced users only!
0 = QAM64,
1 = QAM256,
2 = QAM128
−S RATE
set DVB−C
−e
extended DVB-C scan flags.
NOTE: for experienced users only!
Any combination of these flags:
1 = use extended symbolrate list,
2 = extended QAM scan
−l TYPE
choose LNB type by name (DVB-S/S2 only) [default: UNIVERSAL],
"-l?" for list of known LNBs.
−D Nc
use DiSEqC committed switch position N (N = 0 .. 3)
−D Nu
use DiSEqC uncommitted switch position N (N = 0 .. 15)
−p <file>
use DiSEqC rotor Position file
−r N
use Rotor position N (N = 1 .. 255)
−P
ATSC scan: do not use ATSC PSIP tables for scan (PAT and PMT only)
scan satellite 19.2°.
see README file from source code package.
Written by W.Koehler
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation.
vdr(1) | http://man.sourcentral.org/f23/1+w_scan | CC-MAIN-2017-51 | refinedweb | 552 | 64.81 |
@ Stratego
"They want American and Israeli foreign policy to stop targeting them with warfare."
Strange, I had the distinct impression that the current anti-American sentiment in the Arab world was fueled by the presence of American military bases in Saudi Arabia, this being (under some interpretations) forbidden by Islam.
And the fundamental underlying reason would seem to be simply the fact that political bogeymen are important, if not essential, for many politicians to remain in power.]]>
@Autolykos
I agree with you that it probably doesn't make sense to have a trial at all for non us citizens detained overseas. Instead, a military commander, with access to all the classified and the authority to question the detainee, should determine if a preponderance of the evidence indicates a person has ever been associated with a terrorist organization.]]>
@Autolykos
The Lockerbie bombing is one instance of a nation-state sponsored terrorist attack against the US after Pearl Harbor.]]>
@Anon: If you go down that road, you can save the hassle of putting them on trial at all. Any meaningful defense against "classified" evidence is impossible anyway, and such a trial would be a mockery of justice.
You can just as well conduct some Soviet-style show trials or simply shoot them in the back.
@Carpe: There are other types of terrorists than just "national agents" and "lone radicals", for example "groups funded by private persons/organizations" and "franchises of such groups". And for involvement of the Pakistani or Saudi Arabian (you mean them, and not South Africa, I presume) government in 9/11, I'd like to see the evidence. It's probably about as sketchy as the evidence for the involvement of the American or Israeli government.]]>
Terrorists should never be tried in civilian courts. Simply put, a lot of the damning evidence is classified and shouldn't be entrusted to a civilian jury. Additionally, because the evidence against terrorists is classified, terrorists should not be allowed to see the evidence against them. Further, the case of Lynne Stewart, demonstrates that civilian lawyers should not be allowed to communicate with terrorists. Terrorists should only have access to a US military, court appointed lawyer.]]>
America has a major image problem
Well yes and no. I agree there are points of disconnects between perception and reality (GTMO isn't helping), but these are being masterfully handled at the upper echelons. I'd go so far as saying that the USA is better at stitching these perception/reality gaps up than any other country. In its history it certainly has had a lot more practice than any other country...
Being the only superpower left is a real curse sometimes and at the very least a double-edged sword when it comes to foreign policy making. But for every person against the USA there are quite a lot of people for it. Before the American Empire there was the British, before that the French & Dutch, Spanish, Portuguese and they all succumbed.
Americans are still thriving because 1. They carried the spoils home post WWII and then they proceeded to reset world diplomacy 2. The English language has proved itself to be remarkable resilient AND adaptable pilfering words from over 350 languages and establishing itself as a global institution 3. The rise and dominance of TV, music and video. 4. The rise and dominance of IT&T. (Todays generation simply can't imagine a world without computers, internet (Google, Wikipedia,Facebook, Youtube and smartphones). USA is a squid and its tentacles are spread all over the world.
Though I am very much younger than you Clive me and my friends have for some time been working behind the scenes in addressing some of these image problems. The original idea that is the US of A is a powerful idea and I'm of a firm belief that the interplay between the old world, the new world and the east hasn't reached its height yet. That 'Murica, Europe et al have taken a small economic blow is perhaps necessary for the BRIC countries to rise and become more intergrated in the overall framework. It is a balancing act, a delicate one, but it is of a tranforming nature and happening on a world wide scale. One in which America has been playing the role of conductor. (Because what role is there left to play?) My point is: It is easy to hate but for the aforementiond items and its past achievements it should be admired - as long as its intentions remain noble. Even in the far corners of the world where the common man doesn't look past the US flag and then just decides to burn it, we know the intelligentsia, politicians, military- and business men know better.
Oh and I agree N. Korea poses a small threat. But it's nothing that can't be handled with grace, resolve, wit and intelligence. These alone can be found on this blog in abundance.
(And the US diplo cable dump! It may well have angered some short sighted American politicians, I however thought it a brilliant way of showing the world the level of professionalism and conduct displayed by its Diplomatic Corps.)
P.S. Fiona has wings! I gave her ball 11. I still owe her yellow no 1.
kind regards :o)]]>
Zero. Dark. Thirty.]]>
Could you please elaborate on the criteria that you require for posting on a subject, rules, or why comments are deleted.I think I know what prompted this question and that wasn't moderator action; it was an automated process behaving badly. That comment is back now.
Generally, we ask that commenters (1) contribute to the conversation, and (2) follow Wheaton's Law.
@ AtomBoy,
We are deeply concerned about people in very remote countries who dislike the US and may talk in private about that. :/
What about in very close countries such as Canada, or (supposadly) politicaly close countries such as the UK?
The simple fact is in most parts of the world Americans are thought of in one of two ways "they should get out more" (by those who have not met them) and "why cann't they go somewhere else not here" (by those that have met them). It applies equaly to civilians and military, as for US politicians, it's probably best not to ask...
There is a sort of joke in Thialand about it,
There is Thailand for the American tourists,
There is Thailand for the other tourists and Americans that want "The real Thailand".
And then there is Thailand for those who ask politely.
The first refers to the "Americanised" parts of Bangkok with the burger bars strip joints and other "off credit card spending" places. Basicaly the parts which cater for the less plesent of human activities. The second refers to the Western Hotels and their tourist trips to various temples and other places that pander to the tourist myths of Thailand, it's something that nearly all countries that have a significant tourist industry do. The third is kind of the place where many Thais live and work and is their equivalent of suburbia and some rural areas, where Thais themselves go.
A place I used to work for had factory facilities in Thailand and I got to know one or two Thai people quite well. In a resteraunt one evening we were chatting over dinner and one of them commented that the biggest problem with Americans was they wanted the whole world to be America so that they would feel comfortable wherever they went.
The thing is most of the rest of the world does not want to be America, to be honest most people outside of America look at it as being a trailer park on the wrong side of the tracks. In Europe the rise of various types of crime is usualy blaimed on American culture, especialy drugs, guns, gangs and illegal sex trade activities. But it's also blatent consumerism, the Banking crisis, etc etc. The list is long and various Governments have at various points in time over the past fifty years passed legislation against American culture and activities in one way or another.
One or two of my American friends have asked why America is viewed the way it is and to be honest it's not easy to answer without being trite. But one thing is true America has a major image problem and when it comes to a choice of how to deal with things most people view the way American choses as the wrong way...
With regards your comment,
Contrast that with Iran or North Korea who publicly swear America should be wiped off the map. And have the resources to do something about it
Well yes and no, although N.Korea is getting close to it.
America is almost single handedly responsible for what is going on in both Iran and N.Korea in that respect. The US sowed and is now reaping the harvest. Basicaly the US has been provoking both countries in one way or another for well over fifty years as part of the "super power game". After WWII the percieved world order changed Europe was all but destroyed and the so called British Empire finally fell appart (the fact that it had in effect fallen in all but name after WWI was not belived by many including the US). Of the three allied protagonists only the US and Russia had the basic resources to become Super Powers. Churchill was deeply suspicious of Stalin and his motives and in the end nearly lost his seat at the table over his idea to attack the Axis powers in the south east of Europe. Part of Churchills aim was to limit how far Russia under Stalin could advance westwards. For various reasons the US view was that the invasion should be from western Europe which was the view Stalin also prefered.
In the end Churchill got the invasion from the Med but when it got to Italy it stalled due to the actions of Mark Clark, and the result as Churchill expected was that the invasion from the west would bog down and slow up and Russia would drive forward towards the west coast of Europe.
As Churchill had suspected once Stalin had a military foot hold in any area he was not going to relinquish the gains, so in fairly short order the Cold war started. The difference now was captured German Technology, the designed but not built V3 was supposadly going to take the war to America from central Germany, possibly with a German Nuclear weapon. The Russians captured or stole much of the technology and it was not long befor the idea of continental America actually comming under threat from what we now call ICBMs dawned on the US en mass.
Like all over endowed parties the super powers wanted to show their muscles but the idea of direct nuclear confruntation was way to risky so instead the US and Russia started to fight proxy wars.
Also during this time Russia aided China on their first steps to super power status and Stalin encoraged China to join in the proxy war game.
In essensce Russia started the Korean war and then passed it over to China. The result was in the end stalmate and Korea was devided by an uneasy cease fire agrement (that was still in place untill very recently). It was an unfortunate portend of things to come with Vietnam.
Ever since the cease fire US troops have been stationed in South Korea and various war games and other quite deliberatly provking actions have been taken by the US against the north.
If you look back on this blog you will find that I've been more concerned about N.Korea than I have about Iran for several years.
Whilst Iran may be developing nuclear weapon capability it does not have a delivery system. Personaly I suspect Iran's nuclear development is actually as claimed for energy security (most in the middle east are more aware that the oil is nearly gone than your average American is). Further the lesson of Iraq's supposed WMD is unlikely to have been missed by them.
However the chase after nukes is a game the Americans have fostered with the way they treat other countries that have developed nukes. In effect the US anounced that a place on the top political table could be bought with nuclear capability by their deeds rather than their words.
N.Korea have started and stopped their nuclear developments almost entirely as a result of US political behaviour. The simple fact is that the US and N.Korea have come to agrements in the past the N.Koreans have acted as they said they would do but the US repeatedly failed to deliver on it's promises...
Unsurprisingly the N.Korea's have apparently decided that the US promises have no value and have thus moved forward to the point where they now appear to have nuclear capability but more importantly a viable delivery system...
If I were a person who was prone to making wagers I'd put a few pennies on the next serious political hot spot being the far east not the middle east.]]>
Bruce, "we" need to stop saying "we". "We" do not run the prison camps, "we" do not bomb people with drones.
The government of the Empire of the United States does that, and the sooner people realize that they are an evil, occupying army, the sooner the real "we", the victims of this empire, can stop feeding THEM.]]>
Zero. Dark. Thirty.]]>
Bruce, or whoever it may concern,
Could you please elaborate on the criteria that you require for posting on a subject, rules, or why comments are deleted.
I'd like to be respectful of your site and remain on topic, but it's not at all clear to me what your rules are.]]>
@Autolykos
Maybe I'm not understanding you, but if you are claiming (by asking) there was never an attack by nation based actors in the US. There us much evidence that Pakistan and SA were involved in 9/11 (and that's just a start.) Beyond that, what attacks of a statistically significant nature have come out of the ad-hoc self-radicalizers? The FBI has been behind almost ever single one...
Bruce makes again an awesome point about morality. The United States Republic, or what is left of it, is based on the rule of law. A rule of law that protects even our worst enemies with rights, due process, and unbiased justice.
The founding fathers recognized the need morally, and governmentally to treat even our worst enemies with fair due process of law. The moment you step away from that ideal, you start down the steep cliff of totalitarianism. The US stepped off that cliff a very, very long time ago.
The founding of this republic and the preservation, or return to liberty requires that the most horrible monsters must be treated with the same benefits and rights in order to preserve the rest.
Extrajudicial killings, kangaroo courts, and drone strikes of civilians create a monster, and that monster always turns back to attack the general population.
@atomboy,
North Korea is not a threat to the US. They are a target of US proxy war with China.
Iran is not a threat to the US, and they haven't invaded anybody since the time of the Persian empire. Sorry to tell you, they don't want to "wipe the US off the map". They want American and Israeli foreign policy to stop targeting them with warfare. Blockades are an act of war. Killing civilians engineers are an act of war, and a war crime. They want us to leave them alone.
Have you ever read the now declassified story of Mosadek? Freely elected president of Iran that we injected the CIA to destabilize and usurp the government, from which we installed a puppet president, the Shah at the behest of British Petroleum, that instituted secret police that snatched innocent people off the street and murdered them???? Nice guy. What would you think?
To all of you people, please stop buying the media line. It's propoganda to make you scared of a fictitious boogey man.
Think critically.
"We'll know our disinformation program is complete when everything the US public believes is false" - William J. Casey 1981 - Director of the Central Intelligence Agency
Ever heard of Operation Mockingbird:]]>
They have a very serious threat of nation based actors working on behalf of their nation.
Why, then was there never an attack by nation based actors on the US (well, since Pearl Harbor, at least)? And don't start with "but Bush said". Everyone outside the US (and most inside, too) know that was a complete fabrication.
@Clive
We are deeply concerned about people in very remote countries who dislike the US and may talk in private about that. :/
Contrast that with Iran or North Korea who publicly swear America should be wiped off the map. And have the resources to do something about it.]]>
@ Mosses,
Problem is that they're not innocent
No the problem is the US Govenment under the influance of those behind GWB "assumed them guilty" and forgot due process etc.
Now because of this if there was evidence that could have been presented in a civilian judicial court to indicate possible guilt, it is so contaminated that it would in all probability get thrown out.
Worse for the US Gov they have found that by far the majority were inocent by any acceptable measure, a few more were little more than rabble rousers. The US Gov aranged in many cases to have these innocent individuals kiddnaped (a Federal Offence) and are thus now liable under US and International law for that as a minimum, then there is "illegal detention" oh and various offences under International Treaty that makes various senior individuals then in the White House etc guilty of a fairly extensive listt of War Crimes.
The US via the DoJ amongst others are trying to work things such that those illegaly detained for many years cannot get a legal comeback against the US Gov for punative damages that would probably end up costing way way more than detaining them till they all die of (supposadly) natural causes.
The US people tend to forget that whilst "cow boys" might make colourfull figures, and have "quick draw" soloutions to problems. In reality outside of the "saturday morning flicks" many were thugs throwing their weight around by fear and intimidation. So Cowboys are not a lot of use for very much else, which is one of the reasons laws were brought in and they were driven off westwards virtualy into oblivion. Unfortunatly the mess Cowboys leave behind generaly takes generations to sort out, so it begs the question as to why the US keep them alive by voting them into public office...
I have to agree with the posters that point out gitmo is just one small part of a very, very large problem.
I have a hard time getting worked up about it when I am very well aware of how rotten the prison systems are.
Gitmo is a PR problem and it should be solved, regardless of the difficulties. It is a step of corruption that does stand clearly as such before the entire world.
Very few posters argued throw ins such as "they are all guilty". They are not all guilty and even if they were no one can prove that.
That kind of thing does matter. The US has a lot of power entrusted to it, and if it does not handle that power responsibly it will be removed from them. That statement is a nutshell explanation for why civilizations fall.
People who think there is no power higher then the US are willfully ignorant and do not deserve to be listened to.
Gitmo is also about illegal detaining of low level soldiers. Because of those who are "guilty", they are just low level soldiers. This is not the threat to the US. The threat is those who fund and have the resources to train such soldiers.
I agree with a number of the statements poster "Riley" made, except that 9/11 was just a piece of luck by a few low level soldiers who had no resistance.
This is not true. The 9/11 soldiers were highly trained individuals who had a full system operating behind them. The entire system was very professional, and what they pulled off was very professional.
They got here, they stayed underground and undercover. They had the training to do such things as act out of character by going to titty bars. They had a well worked out system of communication and money transfer. And they had a seamless military plan of action which operated without almost a hitch not because of luck but because of training.
The US has a very, very minor threat of isolated terrorists working on their own.
They have a very serious threat of nation based actors working on behalf of their nation.
]]>
Problem is that they're not innocent.]]>
"Even if Politics and drone killings would create less terrorists than they killed. This doesn't make it right! Just because the threat analysis works out, doesn't make it correct or morally accceptable. Otherwise USA would still have slavery as it may be economically viable. You come in this case to the right conclusion (ending Gitmo) but the reasoning why to do it seems unsound."
You misunderstand the reasoning in the essay, and my agreement with it. The essay is about the inherent immorality of it all. That bit I quoted was a response to "the last response of the blowhards and cowards."]]>
@ PrometheeFeu
But he could order that the doors to the prison be opened.
Guantanamo is a 117 square kilometer US base at Guantanamo Bay in the south of Cuba. The long-term lease of Guantánamo Bay by the US (for about 4,000 euro a year) was established by the 1902 Platt Amendment and has been strongly denounced since Castro rose to power as a violation of article 52 of the 1969 Vienna Convention on the Law of Treaties, which declares a treaty void if procured by the threat or use of force.
Now imagine Obama pushing the envelope and closing Gitmo. Where do the cleared inmates go ? Do they settle outside the naval base and by what means ? Or do they try to reach the Cuban border where no doubt they will be stopped and prohibited from entering the country. And what about those set for trial or impossible to take to trial ? Bring them to the US against the will of Congress and risk lots of trials turning to sh*t because in establishing Gitmo and by the treatment of inmates the US broke its own laws, causing a gigantic backlash for which nobody wants to take the fall ?
Not gonna happen anytime soon, and I wouldn't be surprised that many folks in the USG/DoJ are awaiting the outcome of the legal procedings against one Bradley Manning before even considering doing so. Anyone familiar with that case knows that the USG/DoJ have been going through great lengths to create a context in which Pfc. Manning can be successfully tried and convicted by depriving his defense of access to vital information, witnesses and other rights and resources under the now common "national security" argumentation.
@ Daniel, @ Wael
Islamic extremists don't attack the US because of Gitmo.
Which may soon change when the first hungerstrikers start dying. Do not underestimate the power of innocent martyrs. Even early Christians in Rome had figured that out.]]>
It's sad to see a once great nation becoming destroyed by its own policies. The seeds of destruction are always found within the organism.]]>
Thankfully the sane comments outnumber the paranoid ones.
Item One: the US, in creating this extra-legal prison, broke its legal system. And I might point out that this was one of the exact causes claimed in the Declaration of Independence for the establishment of a independent polity, the United States of America - that the British Crown had broken the British constitution and legal system in its actions, and therefore it was ripe for overthrow.
Item Two: if you're seriously paranoid, you generally need a prolonged course of medication and assistance, not weapons of mass destruction to carry out a grudge against nearly a fifth of the human race. Jeff and the other paranoid individual can therefore be discounted summarily.
Item Three: Doris Lessing in Canopus in Argos: Archives, got in right when in her final novel in the series, The Sentimental Agents in the Volyen Empire, she had a constitutional convention called in one of the worlds in the story, the object of which was to find out who the hell they were, so they could decide what to do about it. I think the US could well do some such thing, since with Gitmo and the "War on Terror" and the incessant propaganda intended to teach you to hate the Arabs, the Muslims, whatnot, you clearly don't know who the hell you are.
Without wishing to derail the thred on elephant in the room with Gitmo is that it can be seen as the tip of a more general problem with the US judicial system.
It is now fairly well known that within the US the arrest detention intimidation false confessions and false statments made by others against a defendent, rigged identification parades, with holding of evidence etc occurs to levels that cannot be accounted for as accidental or abberant behaviour of a few bad apples.
After conviction the prisonners are then entered into an ever growing commercial jail system where inmates are considered not as people who (might) need rehabilitation but as sources of profitable income.
Whilst this is not unique to the US (the UK has it's own claims to infamy in this area) it is still a blight on US political claims.
Now on the assumption POTUS does solve the Gitmo problem, in the process he may well be opening the door to the Ageian Stables on the US justice system.
As has been noted in many other places one of the biggest causes for the break down on Gitmo prisoners is the US Dept of Justice seaking to prevent the detainies obtaining justice against the US for what are crimes against them commited in part by the DoJ.
Thus the US Gov is seaking to prevent it's self from being found wanting in any part of it's judicial system because it knows that the chances are high that once the scab starts to lift the whole festering sore will disgorge thus necessitating a clean up which would adversly effect many vested interests.]]>
That is exactly the answer that needs to be opposed to Obama supporters who say he wants to close Guantanamo but is prevented from doing so by Congress. That is simply a lie. He cannot move the prisoners to the United States. But he could order that the doors to the prison be opened.]]>
""" our politics are creating more terrorists than they're killing """
They're working exactly as intended.
As long as the war is endless it doesn't matter much whether you're fighting Eastasia, Eurasia or 'terror'.
@ Daniel
Islamic extremists don't attack the US because of Gitmo...
This is just about the only correct statement you made.
I'm shocked by his ignorance ...And the rest of your sentences are ignorant enough to shock an electric eel.]]>
@john: yes, because we should base our opinions on fiction, not fact. Please read Dirk Praet's post.]]>
@jeff - very good post. Most of the commenters obviously have not seen the movie Obsession.]]>
Here Here! Excellent comment!
Thanks!
Islamic extremists don't attack the US because of Gitmo. They attack us because they hate the West. Take away Gitmo, they still want the Caliphate. Bruce is a smart guy. I'm shocked by his ignorance here.]]>
@Kevin Ballard .. The only reason these innocent people are under US jurisdiction is that the US sought them out and brought them into its jurisdiction.
The fact that there never was any evidence of these people committing offenses against the US is entirely the US' problem to resolve. (The US government may, for example, seek civil compensation for its costs if it can show in an international court that it was deliberately defrauded by the bounty hunters who, in some cases, originally detained the innocent people).
But the eyes of the world are on how the US will solve a problem it created. A problem involving a huddled mass yearning to breathe free.
Solve the problem well, and the US may even make a few friends out there.]]>
@ Jeff
The fact that they killed American soldiers and would otherwise slaughter everyone on this blog apparently isn’t good enough.
Please get your facts right. The grand total of current and former Guantanamo inmates is estimated at about 760. According to a 2002 CIA report: "a substantial number of the detainees appear to be either low-level militants . . . or simply innocents in the wrong place at the wrong time.”
When president Obama took office in January 2009, the prison held 245 terror suspects. By May 2012, that number had dropped to 169 after the administration negotiated repatriation deals with several countries. in April 2013, 166 inmates remained at Guantanamo.
About 7 people have been tried and convicted. 5 more terror suspects are to be tried by military tribunal. An interagency task force identified 36 detainees who are the subject of active investigations and could be tried in civil or military courts. 48 of the remaining detainees were classified as being too dangerous to release but cannot be taken to trial. They are being indefinitely detained.
About 85 detainees - i.e. half of what remains - have reportedly been cleared for release. They remain at the facility because of restrictions imposed by Congress and also concerns of possible mistreatment if they are sent back to their home countries. [Source: BBC News April 30th 2013 ; Center for Constitutional Rights]
The way I see it, Mr. Obama is facing an impossible conundrum to the point that it has become a case of "POTUS non potest" (Latin for "The president cannot")
1) Congressional opposition is making it impossible to transfer inmates to maximum security American prisons and try some of them in the US civilian system. Congress actually cut off funding for the transfer of detainees from Guantanamo to the mainland. One could argue that such actions constitute obstruction of justice.
2) Several dozens classified too dangerous to release cannot be tried because information obtained during waterboarding (or other forms of torture/coercion) is no longer permitted as evidence. The Obama administration has altered the rules of military commissions so that any coerced confession valid under the Bush administration now is no longer admissible.
3) Sending back the 50-60 cleared inmates fearing reprisals upon return in their home country may violate the principle of non-refoulement in international law. There are several documented cases of Libyan, Russian and Tunesian inmates who got an all but friendly home-coming reception. As there is no way the US is going to grant them asylum, they're simply trapped at Gitmo unless some other country wants them. I can imagine there is little enthusiasm in any country to welcome folks scarred for life and that has nothing to do with the problem anyway.
4) Pushing a Guantanamo closure agenda is guaranteed to meet steep resistance by Congressional republicans supported by many Americans as poorly informed as yourself, and which will weaken his position in negociations that are of much more importance to him than the fate of about 100 wrongfully detained foreigners. (eg. health care, budget, gun legislation)
As a result of this stalemate, about 100 inmates are currently on a hunger strike, and of which several are being force-fed. It's probably only a matter of time before one or more will succomb, giving rise to even more outrage and hatred against the US in muslim communities all over the world. And over this particular issue, you can hardly even blame them.]]>
It's fascinating that the Economist has gotten to this point insofar as the newspaper (the term it prefers over magazine) avidly encouraged the U.S. to invade Iraq.
As for "freeing terrorists", I simply can't buy into the notional terrorist threat.
For about 35 years, the U.S. has spent billions upon billions of dollars on a "war" against drugs. For at least 25 years the U.S. has spent a few billions "cracking down" on illegal immigrants. Today illegal drugs and undocumented workers are easy to find it literally every city in the U.S.
Are we then to believe that although the U.S. has failed to interdict drugs dealers and uneducated illegal immigrants, it has been successfully interdicting "professional" terrorists willing to die to carry out their missions? To borrow a phrase from a series of children's books, what's wrong with that picture?
The answer of course is that it's about money, and lots of it. When the Cold War ended, so too did the ability to use the pretense of containing Communism to justify open-ended defense spending and the meddling in the economies and politics of smaller nations too powerless to resist. Some new imaginary threat was needed and the Bush administration was all too eager to put that imaginary threat into place — "terrorism".
And voila, we once again have open-ended "defense" spending and a pretense for meddling in the economies and politics of nations too weak to resist. Worked out well, didn't it?
So-called 9/11 was spectacular, the but very method of delivery underscored the lack of a logistics capability. A handful of zealots got past what is now clearly understood to have been non-existent airport security, then used bits of sharp metal to hijack civilian airliners and crash them into a couple of symbolic structures. So much for an "army" of organized terrorists.
Sure there are lots of people in Guantanamo who despise U.S. foreign policy. Big deal — even many of our so-called allies despise U.S. foreign policy. The biggest problem with closing Guantanamo is that the world at large will learn what actually happened behind its walls. It will take a VERY long time, if ever, before the U.S. can ever again lecture other nations about the rule of law and human rights after that information comes out…]]>
Forgot something else I wanted to add.
Increasingly the shadow players as I call them. (the ones who have been in the game for multiple presidencies, usually advisers or strategic analysts) are saying that it never was about terrorism.
What it will boil down to is a tri-power world. The West, China, and Russia. I have in the past called it the neo cold war.]]>
Don't forget the original purpose of Guantanamo, as a staging ground for putting the "Unitary Executive" ideology into practice. That ideology holds that the War Power gives the Executive Branch unlimited authority to do whatever it deems necessary to protect the Homeland, without regard to any constitutional or legal constraints.
Cheney and Rumsfeld set up a detention facility outside of any legal jurisdiction, where the whims of the Unitary Executive would be the only law. Then they gave themselves the power to declare anyone they wanted an "enemy combatant." Persons so designated could be spirited away to Guantanamo, stripped of all rights including any ability to challenge the designation, and indefinitely detained without a trial or even formal charges.
Torture was an essential part of the process. Though justified on the grounds of obtaining "intelligence," the real purpose was to establish that the Unitary Executive had authority to nullify laws and international conventions whenever it decided it needed to. In other words, the main value of waterboarding and other "enhanced interrogation techniques" was to firmly place the Unitary Executive above the law. The Bush administration could, of course, justify everything on the grounds of "National Security."
So indeed, Guantanamo is an offense to anyone who believes that the United States is governed by the rule of law. But it's an intentional offense committed by leaders who asserted they could unilaterally suspend the rule of law at their sole discretion during Wartime. And the War on Terror they declared was, by definition, perpetual. I don't know if Cheney and company had plans to expand their law-free zone beyond Guantanamo and the other detention facilities. But they had successfully created a gulag that could serve as a model.
What it really comes down to is that physical security in the sense the most people think of it is not anywhere close to the minds of the people in the powergame. The security of the empire is what is being sought, and the middle east just happens to be the strategic location of importance as the effects of globalization grow. I am an Iraq combat vet who spent a lot of time trying to figure this out, and my conclusion is that the primary goal is presence in the area (Iraq, Afghanistan, Bahrain, Kazakstan, etc) so that we can effect our policy through subversion, overthrow, or war if need be in order to control access to natural resources.
This is also why we will continue to see an increase in violence in Africa... we can't have the Chinese feeling too safe.
In essence, the empire has gone into self-preservation mode. It has come to the conclusion that the only way to maintain itself is to hold other entities down. Security is just the line of bs sold to the idiots in DC and the populace to get them to go along.]]>
@Jeff
You endanger not only yourself with such arrogance and ignorance but are in direct opposition to the values that the framers of this country (put their homes, lives, and reputation on line) to repel oppression from the king of England.
I understand your loyalty to the cause you believe is an attack on our way of life...but answering it by betraying the values that are the basis for it is not the way to act. If you have something constructive to contribute, such as stating why the U.S. governments actions are inconsequential or irrelevant beyond our borders. Have you had the opportunity to travel the world and talk to others about how they perceive the United States? Or are you convince of the United State's supremacy in the world?
You are confident in your "authoritarian" position. You believe in the righteous of the cause--the neo-muslim facists are attacking us...let's do anything and everything we can...this is how authoritarianism works. It ignores others and only listens to its own voice. Anyone who disagrees with you is a communist...probably buys Chinese communist propaganda (or is that products). Good damn commie lovers!!!
Your way of thinking is tired (if it is even thinking) and should be answered appropriately. I doubt you realize you are part of the problem--not the solution. You are either we us, or against us. Binary thinking is fine for inanimate objects, consider yourself in good company.]]>
It's kind of like saying: "I just found a hundred dollar bill in the middle of the street. I asked everyone if it was theirs, but nobody wanted it." I'm not buying it. Who told you that nobody wanted them back??? Wouldn't happen to be the state department aye? hmm. Interesting.]]>
No one will take them? All, some , or none of the 166? I suspect the answer isn't none.
Especially if we do not restrict *which* locations (Gaza, Iran, etc).]]>
Jeff,
It is clear that you know nothing about what is really going on. It's troubling, because a majority of the American public is just as pitifully ignorant as you are.
As a person who took an oath several times to the constitution and carried a rifle for the United States. I will tell you that without a doubt that keeping people in Guantanamo makes lives of Americans become ever more dangerous. Chalmers Johnson a 27 year veteran of the CIA echoed that fact in his book "Blowback", as did another 20+ year veteran of CIA Ray McGovern, plus many others.
Secondly, these are not Nazis. Most of them were innocent citizens picked up on a bounty by rogue Northern Alliance members, or other "allies" of the US, because they had an old grudge against them. 90% in fact, have been cleared of any and all wrongdoing or charges. They are innocent.
Speaking of Nazis; had the majority of US politicians and leaders of the last 30 years been put to the same standard test for guilt as was used during the Nuremberg trials, 70% would have met a fate at the end of a rope for crimes against humanity, and treason.
Please educate yourself.]]>
This is left-wing drivel and typical of people who do not fear reprisal because you sleep comfortable knowing someone else will take the bullet instead of you. Treating terrorists as though they are card-carrying members of the ACLU instead of people bent on destroying our way of life is unbelievably careless. Would you be so cavalier with a captured Nazis? No. As for the military tribunals like the Nuremberg Trials, those where scheduled to take place at the beginning of 2009 until this current administration stopped them. Due process was denied. Start them up again and you will get the piece of paper you so desperately need to justify their imprisonment. The fact that they killed American soldiers and would otherwise slaughter everyone on this blog apparently isn’t good enough.]]>
Bruce, how do you plan on setting them free? I'm all for it, but from what I've read elsewhere, we pretty much can't, because nobody will take them. Their own countries don't want them back, and the US certainly doesn't want to let them immigrate.]]>
Strange logic Bruce:
1. Release them from Gitmo as they are largely harmless people now.
2. Gitmo creates radicals (unproven BTW - has you actually talked to someone who only became a terrorist because of Gitmo?)
So someone observing Gitmo will become a dangerous radical, but someone actually experiencing Gitmo is likely harmless?
If Gitmo is really a radicalizing influence, surely the people imprisoned in it would be the most dangerous radicals by now?
]]>
There is little here to disagree with, the statement that the people of the U.S. are sheep though is inaccurate.
From the moment Donald Rumsfeld and the neo-conservative cabal of the U.S. started down the road of no return (the future for democracy in the United States will require more than electing new representatives) having shocked and awed its own people, the citizenry reacted by cowering under their beds. Not only is the political class guilty of treason, but the citizens of the United States are guilty of dissertion.
From where I stand, somewhere in the far reaches of California, the tragedy that is our folly (namely the "War on Terror") has to be the largest breach in civil society since the dawn of time. Even Hitler, whom clearly stated by manifesto, was more
transparent about authoritirian rule then our current crypto-facist government. So much damage has been done to the psychie that unwrapping this socio-political turd will be decades if not centuries and there is no telling what the fallout from this will actually be...unlike a nuclear bomb, with a known yield, debris field, and residual radio-active fallout...a farcial war on an idea (terrorism) can never be won. We, all of us, are already losers. What could humanity accomplish in advance as opposed to retreat...
Wouldn't it be wonderful if all President Obama had to do was "take out his pen"?
If it was, he'd have done it, 4 years ago.]]>
I unfortunately am very cynical about this issue, and I scarcely expect any politician to end a very convenient "loophole" in the system. It's almost like expecting them to offer up a substantial pay cut when everybody else is suffering from a huge recession, or to end their special health care system, or even to end the nonsense of the TSA... Let's not forget also that the NDAA was signed by the same President Obama...]]>
They did send them to islands. Remember all the Chinese Uyghurs that had nowhere to go and were resettled?]]>
I'd send them on a little copter ride...one way over the caribean.he heh!]]> | https://www.schneier.com/blog/archives/2013/05/the_economist_o_4.xml | CC-MAIN-2016-50 | refinedweb | 7,535 | 61.26 |
small console program keeps crashing for some unknown reason
HI all
I have to write a console program for a developer internship interview before next monday and i'm hopelessly stuck... I have to write a program that finds all duplicate files in a directory and then writes a log file containing all the duplicates... When I run my program and enter the directory the program crashes and I can choose debug or close program. Any idea hwat could be causing this?
What i've done:
In main.cpp I read in a directory path from stdin and if the directory exists pass the directory on to the processDirectory function of my fileChecker class. In the fileChecker class I get the directory's entryList and then compare every file in the entryList to every other file and if two have the same size I generate a MD5 hash for both and add it to a QHash. I then have a getDuplicateList function in my fileChecker class which itterates over the QHash of possible duplicates and adds all duplicates of one file to a QString which is then added to a QStringList.
My Code:
main.cpp:
#include "filechecker.h"
#include <QDir>
#include <QTextStream>
#include <QString>
#include <QStringList>
QTextStream in(stdin);
QTextStream out(stdout);
int main() {
QDir dir;
FileChecker checker;
QString dirPath;
QStringList duplicateList;
out << "Please enter directory path NOTE: use / as directory separator regardless of operating system" << endl; dirPath = in.readLine(); dir.setPath(dirPath); if(dir.exists()) { checker.processDirectory(dir); duplicateList = checker.getDuplicateList(); } else if(!(dir.exists())) out << "Directory does not exist" << endl; foreach(QString str, duplicateList){ out << str << endl; } return 0;
}
fileChecker.h:
#ifndef FILECHECKER_H
#define FILECHECKER_H
#include <QString>
#include <QByteArray>
#include <QHash>
#include <QCryptographicHash>
#include <QStringList>
#include <QDir>
class FileChecker
{
public:
FileChecker();
void processDirectory(QDir dir);
QByteArray generateChecksum(QFile* file);
QStringList getDuplicateList();
private:
QByteArray generateChecksum(QString fileName);
QHash<QString, QByteArray> m_hash;
};
#endif // FILECHECKER_H
fileChecker.cpp:
#include "filechecker.h"
FileChecker::FileChecker() {
}
void FileChecker::processDirectory(QDir dir) {
dir.setFilter(QDir::Files); QStringList fileList = dir.entryList(); for (int i = 0; i < fileList.size(); i++) { bool possibleDuplicatesFound = false; QString testName = fileList.at((i)); QFile* testFile; testFile->setFileName(testName); foreach(QString s, fileList) { QFile* possibleDuplicate; possibleDuplicate->setFileName(s); if(testFile->size() == possibleDuplicate->size() && testFile->fileName() != possibleDuplicate->fileName()) { QByteArray md5HashPd = generateChecksum(possibleDuplicate); m_hash.insert(possibleDuplicate->fileName(), md5HashPd); possibleDuplicatesFound = true; fileList.replaceInStrings(possibleDuplicate->fileName(), ""); } QByteArray md5Hasht = generateChecksum(testFile); fileList.replaceInStrings(testFile->fileName(), ""); possibleDuplicatesFound = false; } }
}; }
}
QStringList FileChecker::getDuplicateList() {
QStringList tempList;
QString tempStr;
QString currentKey;
QByteArray currentValue;
QMutableHashIterator<QString, QByteArray> i(m_hash);
do {
while (i.hasNext()){
i.next();
currentKey = i.key();
currentValue = i.value();
tempStr.append("%1 ").arg(currentKey);
if (i.value() == currentValue) { tempStr.append("and %1").arg(i.key()); i.remove(); } tempList.append(tempStr); tempStr.clear(); } } while (m_hash.size() > 0); return tempList;
}
- mrjj Qt Champions 2016
Hi
Using debug+single step should show you exact line ?
One thing , i did wonder:
QStringList FileChecker::getDuplicateList() {
...
tempStr.append("%1 ").arg(currentKey);
i.remove(); <<<<< remove
if (i.value() == currentValue) { << and then look at value?
'
is that ok?
Hi Thanks yes I removed that unwanted remove(). Thanks for taking a look. I can't find debug + single step?
My output when I run is: 255
Starting C:\Qt\Qt5.3.0\Tools\QtCreator\bin\build-duplicateFinder-Desktop_Qt_5_3_0_MinGW_32bit-Debug\debug\duplicateFinder.exe...
1F8C) CheckProcessInRegistry: Got include list but no match was found.
1F8C) IsProcessAllowed(C:\Qt\Qt5.3.0\Tools\QtCreator\bin\build-duplicateFinder-Desktop_Qt_5_3_0_MinGW_32bit-Debug\debug\duplicateFinder.exe) (80004005)
1F8C) DllMain(ProcDetach) [OK]
1F8C) DSound_Unhook
1F8C) MCIWave_Unhook
1F8C) AudioClient_Unhook
1F8C) CAudioStreamMgr::Shutdown
C:\Qt\Qt5.3.0\Tools\QtCreator\bin\build-duplicateFinder-Desktop_Qt_5_3_0_MinGW_32bit-Debug\debug\duplicateFinder.exe exited with code -1073741819
Debugging starts
1BA0) CheckProcessInRegistry: Got include list but no match was found.
1BA0) IsProcessAllowed(C:\Qt\Qt5.3.0\Tools\QtCreator\bin\build-duplicateFinder-Desktop_Qt_5_3_0_MinGW_32bit-Debug\debug\duplicateFinder.exe) (80004005)
1BA0) DllMain(ProcDetach) [OK]
1BA0) DSound_Unhook
1BA0) MCIWave_Unhook
1BA0) AudioClient_Unhook
1BA0) CAudioStreamMgr::Shutdown
Debugging has finished 0
@Dn588 You never create an instance of QDir!
QDir* dir; ... dir->setPath(dirPath); // dir is not pointing to a valid QDir instance!
There is no need to use a pointer here, just put dir on the stack:
QDir dir; ... dir.setPath(dirPath);
Hi
The debug is right under the normal run. ( has little bug on it)
you then set a break point in a function say
getDuplicateList
When it then stops there, you can single step with F11.
That can be really useful to find exact line even of crash, next time -
as i think @jsulm nailed this one :)
@jsulm Thanks for taking a look. I fixed that but it's still crashing. i'll try start setting breakpoints now
QFile* testFile; testFile->setFileName(testName);
Again: why do you use pointers where no pointers are needed?
If you want to use pointers then you have to create an instance and delete it when not needed any more:
QFile* testFile = new QFile(); testFile->setFileName(testName); ... delete testFile;
@jsulm Thanks I see now that it crashes on line 189 of Qatomic_x86.cpp. What does this mean? I also see that the processDirectory and getChecksum functions has no issue however this crash happens before getDuplicateList runs?
the reason I use pointers is that I get an error message when trying to pass a QFile as argument to generateChecksum
here's a link to my code if it helps to see it in QTCreator:
@Dn588 What error do you get if you pass QFile to generateChecksum?
It should be like this:
QByteArray FileChecker::generateChecksum(QFile& file) // Change QFile* to QFile& { ... }
This are C++ basics.
And again if you want to use pointer then you have to create an instance using new and later delete it. But in your case there is really no need for pointers - just fix your interface to pass QFile as reference. And even if you want to pass a pointer you can do so:
QFile file; ... generateChecksum(&file);
I'm quite sure the problem is not in QAtomic. You should take a look at the call stack who is calling QAtomic?
At which line in your code does it crash?
@jsulm I put a breakpoint at the end of generateChecksum and the program gets there with no issues so i'm guessing the processDirectory and generateChecksum functions are ok? So the crash happens after generateChecksum but i'm not exactly sure where. Where can I view the calling stack?
I get the following error when debugging
"The inferior stopped because it received a signal from the operating system
signal name: SIGSEGV
signal meaning: segmentation fault
"
Yes sorry I should have passed by reference from the start. Seems like 6 month's break from C++ made me forget quite a lot...
Thanks again for all your help/patience
Fix like this to not to crash:; } // This line was missing, so you did not return a valid QByteArray instance if the if condition was false! return QByteArray(); }
@jsulm Thanks that worked!. However now it seems like the file i'm passing to generateChecksum has no fileName? I get 12 errors in the terminal saying " QFSFileEngine::open no file name specified". the directory I am entering has 4 .dat files which consists of 2 groups of 2 duplicate files. Any idea what is happening here? Also where can I view the calling stack in future if I have a crash like before?
@Dn588 The problem is: you pass only the file name without the directory. So your application tries to open that file in current directory. You can see it easily if you debug.
Thanks @jsulm Will do:) is therre a way to view the contents of a variable while debugging? I google'd that error and it seems like it happens when the QFile is initialized with a name so I used QFile->setFileName(fileList.at(i)) but still no luck... Sorry for all the excessive questions... i'm writing two exams tomorrow and on mon and have this program to finish before mon to get an internship interview so stressing a bit...
contents of a variable while debugging?
See picture. its on right side. showing Name / Value / type
and "this" variable.
- jsulm Moderators
@Dn588 Please take a closer look at the picture @mrjj provided - in the upper right corner you will find what you're looking for.
Setting only the file name is not enough if the file is not in current directory. You need to set whole path: the directory you use with QDir + file name.
@jsulm Sorry I see that's possible in the call stack. Sorry I have an eye problem and as a result only have 4% vision so missed it the first time... | https://forum.qt.io/topic/67787/small-console-program-keeps-crashing-for-some-unknown-reason | CC-MAIN-2018-09 | refinedweb | 1,434 | 57.57 |
I have a file A that has multiple paragraphs. I need to identify where I matched words from another file B. I need to tell the paragraph, line number, and word number of every word, including those matching a word in file B. I've finally gotten so far, having given up on vectors, and arrays, and string splitting. I learned (I think) stringstream. Currently, I read in the line, then split it on the "." into sentences, then read those sentences back in again, splitting on the " ". I have the line numbers counting, and the words counting and matching, but I just can't seem to get the paragraph numbers (I've realized that the p++ is actually counting the lines, and the l++ is counting words as well). Could someone please help me? edit Each paragraph is separated by "\n" and each sentence is separated by a "." I'll still have to figure out a way to ignore all other punctuation so that words match 100%, and are not thrown off by a comma, semi-colon, or other punctuation. I'm guessing that will be a regex in there somewhere.
input from file with the text would look like:
My dog has fleas in his weak knees. This is a line. The paragraph is ending.'\n'
Fleas is a word to be matched. here is another line. The paragraph is ending.'\n'
w1, p1, s1, word, My
w2, p1, s1, word, dog
w3, p1, s1, word, has
w4, p1, s1, namedEntity, fleas
#include <iostream>
#include <string>
#include <fstream> // FILE I/O
#include <sstream> // used for splitting strings based upon a delimiting character
using namespace std;
int main() {
ofstream fout;
ifstream fin;
ifstream fmatch;
string line;
string word;
string para;
string strmatch;
int p = 0, l = 0, w = 0;
stringstream pbuffer, lbuffer;
fin.open("text.txt");
while (getline(fin, para)) { //get the paragraphs
pbuffer.clear();
pbuffer.str("."); //split on periods
pbuffer << para;
p++; //increase paragraph number
while (pbuffer >> line) { //feed back into a new buffer
lbuffer.clear();
lbuffer.str(" "); //splitting on spaces
lbuffer << line;
l++; //line counter
while (lbuffer >> word) { //feed back in
cout << "l " << l << " W: " << w << " " << word;
fmatch.open("match.txt");
while (fmatch >> strmatch) { //did I find a match?
if (strmatch.compare(word) == 0) {
cout << " Matched!\n";
}
else {
cout << "\n";
}
}
fmatch.close();
w++; //increase word count
}
}
}
fin.close();
cin.sync();
cin.get();
}
Since you say that you can write each word on read, we won't bother with a collection. We'll just use
istringstream and
istream_iterator and counter the indices.
Assuming that
fin is good, I'm going to simply write to
cout you can make the appropriate adjustments to write to your file.
1st you'll need to read in your "fmatch.txt" into a
vector<string> like so:
const vector<string> strmatch{ istream_iterator<string>(fmatch), istream_iterator<string> }
Then you'll just wanna use that in a nested loop:
string paragraph; string sentence; for(auto p = 1; getline(fin, paragraph, '\n'); ++p) { istringstream sentences{ paragraph }; for(auto s = 1; getline(sentences, sentence, '.'); ++s) { istringstream words{ sentence }; for_each(istream_iterator<string>(words), istream_iterator<string>(), [&, i = 1](const auto& word) mutable { cout << 'w' << i++ << ", p" << p << ", s" << s << (find(cbegin(strmatch), cend(strmatch), word) == cend(strmatch) ? ", word, " : ", namedEntity, ") << word << endl; }); } }
EDIT:
By way of explaination, I'm using a
for_each to call a lambda on each word in the sentence.
Let's break apart the lambda and explain what each section does:
[&This exposes, by reference, any variable in the scope in which the lambda was declared to the lambda for use: Because I'm using
strmatch,
p, and
sin the lamda those will be captured by reference
, i = 1]C++14 allowed us to declare a variable in the lambda capture of type
autoso
iis an
intwhich will be reinitialized each time the scope in which the lambda is declared is rentered, here that's the nested
for-loop
(const auto& word)This is the parameter list passed into the lambda: Here
for_eachwill just be passing in
strings
mutableBecause I'm modifying
i, which is a owned by the lambda, I need it to be non-
constso I declare the lambda
mutable
In the lambda's body I'll just use
find with standard insertion operators to write the values. | https://codedump.io/share/PsnUXWTVfu6S/1/locating-matched-words-in-a-string | CC-MAIN-2017-04 | refinedweb | 712 | 69.01 |
#include <wx/xrc/xmlres.h>
wxSizerXmlHandler is a class for resource handlers capable of creating a wxSizer object from an XML node.
wxXmlResourceHandler is an abstract base class for resource handlers capable of creating a control from an XML node.
See XML Based Resource System (XRC) for details.
Default constructor.
Destructor.
Add a style flag (e.g.
wxMB_DOCKABLE) to the list of flags understood by this handler.
Add styles common to all wxWindow-derived classes.
Returns true if it understands this node and can create a resource from it, false otherwise.
Implemented in wxSizerXmlHandler.
Creates children.
Helper function.
Creates a resource from a node.
Creates an object (menu, dialog, control, ...) from an XML node.
Should check for validity. parent is a higher-level object (usually window, dialog or panel) that is often necessary to create the resource.
If instance is non-NULL it should not create a new instance via 'new' but should rather use this one, and call its Create method.
Called from CreateResource after variables were filled.
Implemented in wxSizerXmlHandler.
Creates an animation (see wxAnimation) from the filename specified in param.
Gets a bitmap.
Gets a bitmap from an XmlNode.
Gets a bool flag (1, t, yes, on, true are true, everything else is false).
After CreateResource has been called this will return the class name of the XML resource node being processed.
Gets colour in HTML syntax (#RRGGBB).
Returns the current file system.
Gets a dimension (may be in dialog units).
Gets a direction.
If the given param is not present or has empty value, dirDefault is returned by default. Otherwise the value of the parameter is parsed and a warning is generated if it's not one of
wxLEFT,
wxTOP,
wxRIGHT or
wxBOTTOM.
Gets a file path from the given node.
This function expands environment variables in the path if wxXRC_USE_ENVVARS is used.
Gets a float value from the parameter.
Gets a font.
Returns an icon.
Gets an icon from an XmlNode.
Returns an icon bundle.
Returns the XRCID.
Creates an image list from the param markup data.
After CreateResource has been called this will return the instance that the XML resource content should be created upon, if it has already been created.
If NULL then the handler should create the object itself.
Gets the integer value from the parameter.
Returns the resource name.
After CreateResource has been called this will return the XML node being processed.
Gets the first child of the given node or NULL.
This method is safe to call with NULL argument, it just returns NULL in this case.
Gets node content from wxXML_ENTITY_NODE.
Gets the next sibling node related to the given node, possibly NULL.
This method is safe to call with NULL argument, it just returns NULL in this case.
Gets the parent of the node given.
This method is safe to call with NULL argument, it just returns NULL in this case.
Finds the node or returns NULL.
Finds the parameter value or returns the empty string.
Returns the node parameter value.
After CreateResource has been called this will return the current item's parent, if any.
Gets the position (may be in dialog units).
After CreateResource has been called this will return the current wxXmlResource object.
Gets the size (may be in dialog units).
Gets style flags from text in form "flag | flag2| flag3 |..." Only understands flags added with AddStyle().
Gets text from param and does some conversions:
$by
and
$$by
$(needed for
_Fileto
Filetranslation because of XML syntax)
Check to see if a parameter exists.
Checks if the given node is an object node.
Object nodes are those named "object" or "object_ref".
Convenience function.
Returns true if the node has a property class equal to classname, e.g. object class="wxDialog".
Reports error in XRC resources to the user.
See wxXmlResource::ReportError() for more information.
Like ReportError(wxXmlNode*, const wxString&), but uses the node of currently processed object (m_node) as the context.
Like ReportError(wxXmlNode*, const wxString&), but uses the node of parameter param of the currently processed object as the context.
This is convenience function for reporting errors in particular parameters.
Sets the parent resource.
Sets common window options. | https://docs.wxwidgets.org/trunk/classwx_xml_resource_handler.html | CC-MAIN-2019-47 | refinedweb | 693 | 69.79 |