text
stringlengths 20
1.01M
| url
stringlengths 14
1.25k
| dump
stringlengths 9
15
⌀ | lang
stringclasses 4
values | source
stringclasses 4
values |
|---|---|---|---|---|
SQL.
When you include the
FOR XML clause in your query, you must specify one of the four supported modes-
RAW,
AUTO,
EXPLICIT, or
PATH. The options available to each mode vary according to that mode; however, many of the options are shared among the modes. In this article, I explain how to use each of these modes to retrieve data as XML and provide examples that demonstrate how they use the various options.
The RAW Mode
The
RAW mode generates a single XML element for each row in the result set returned by the query.
To use the
FOR XML clause in
RAW mode, you simply append the clause and
RAW keyword to your
SELECT statement, as shown in the following example:
Notice that the
SELECT statement itself is a very basic query. (The statement pulls data from the AdventureWorks sample database.) Without the
FOR XML clause, the statement would return the following results:
With the addition of the
FOR XML clause, the statement returns the data as the following XML:
As you can see, each
<row> element maps to a row that is returned by the
SELECT statement, and each column, by default, is treated as an attribute of that element.
Note: You can include a
FOR XML clause only in
SELECT statements, if those statements define the outer, or top-level, query. However, you can also include the clause in INSERT, UPDATE, and DELETE statements that are part of a subquery.
In the preceding example, each element in the XML is named
<row> by default. However, you can override the default behavior by providing a name for the element, as the following example shows:
Now the element associated with each row returned by the query will be named
<Employee>, rather than the default
<row>:
In addition to being able to provide a name for the row element, you can also specify that a root element be created to wrap all other elements. To create a root element, add the ROOT keyword to your
FOR XML clause:
Notice that you must include a comma when adding an option such as ROOT in order to separate the elements. As the following results show, a <root> element is now included in the XML:
As with the row element, you can also provide a specific name for the root element:
In this case, I’ve named the root element
<Employees>, as shown in the following results:
Up to this point, the examples I’ve shown you have added column values as attributes to each row element. This is the default behavior of the
RAW mode. However, you can instead specify that the column values be added as child elements to the row element by including the
ELEMENTS option in the
FOR XML clause:
Once again, I’ve added a comma to separate the options. As you can see in the following results, each
<Employee> element now includes a set of child elements that correspond to the columns returned by the query:
Now the
<Employee> elements no longer include any attributes and all data is rendered through individual child elements.
If you refer back to the XML returned by the previous example, you’ll notice that the data for employee 4 (Rob Walters) does not include a middle name. This is because that MiddleName value is null in the source data, and by default, no elements are created for a column whose value is null. However, you can override this behavior by adding the
XSINIL keyword to the
ELEMENTS option:
Now the results will include an element for the MiddleName column and will include the
xsi:nil attribute with a value of true when a value is null, as shown in the following XML:
Notice that the xmlns:xsi attribute has also been added to the root node and provides the name of the default schema instance.
Another important option that is supported by the
RAW node is XMLSCHEMA, which specifies that an inline W3C XML Schema (XSD) be included in the XML data. You add the XMLSCHEMA option in the same way you add other options:
As you can see in the following results, the schema is fully defined and is incorporated in the XML results:
When you specify that a schema be created, you can also specify the name of the target namespace. For example, the following
FOR XML clause includes the XMLSCHEMA option, followed by the name of the target namespace (urn:schema_example.com):
The statement will return the same results as the previous example, except that the XML will now include the new name of the target namespace.
The
SELECT statements shown in the preceding examples have retrieved data from non-XML columns (in this case, integer and string columns). However, your queries might also retrieve data from XML columns. In such cases, the
FOR XML clause will incorporate the data retrieved from an XML column into the XML result set.
For example, the following
SELECT statement uses the XML query() method to retrieve education-related data from the Resume column in the JobCandidate table:
The query() method itself retrieves the following data from the Resume column:
This data is incorporated into the rest of the result set when you use the
FOR XML clause, as shown in the following results:
As you can see, the
<ns:Education> element and its child elements have been added to the XML data. The namespace defined on the source data in the XML column is also included.
The AUTO Mode
The
AUTO mode in a
FOR XML clause is slightly different from the
RAW mode in the way that it generates the XML result set. The
AUTO mode generates the XML by using heuristics based on how the
SELECT statement is defined. The best way to understand how this works is to look at an example. The following
SELECT statement, as in the previous examples, retrieves employee data from the AdventureWorks database:
Notice that I’ve provided meaningful alias names to the tables (Employee and Contact info). These names are used in defining the XML element names, so you’ll want to construct your
SELECT statements accordingly. Now take a look at the results returned by this query:
As you can see, the
<Employee> element has been named automatically based on the table alias name. Notice too that the
<ContactInfo> element is a child element of
<Employee>. The structure of the elements is based on the order in which the columns are defined in the
SELECT list and the tables that are specified in the
FROM clause. In this case, because
EmployeeID is the first column in the
SELECT list and the Employee table is included in the
FROM clause, the first element is
<Employee>. And because the remaining columns, which are associated with the ContactInfo table, appear next in the
SELECT list, they are added as a child element. If an additional table and its columns were included in the
SELECT list, after the other columns, they would appear as a child element of
<ContactInfo>.
In addition, the columns and their values are added as attributes to the table-related elements. This structure is similar to what you saw in the
RAW mode examples. And in the same way, you can override the default behavior by using the
ELEMENTS option:
As you can see in the following XML result set, the column values are now included as child elements, rather than attributes:
Notice that the
<ContactInfo> element also contains child elements, one for each column.
If you want to include an element for columns with null values, you can use the
XSINIL option, as you saw when using the
RAW mode:
Now the results will include all elements. That means, if a value is null, the
xsi:nil attribute is included:
As you’ve seen in these examples, the XML is based on how the columns are listed in the
SELECT list. However, as I mentioned earlier, the XML is also based on the tables listed in the
FROM clause. In the preceding examples, the
SELECT list contained only columns that are referenced in the
FROM clause. If a column is not directly associated with a table in the
FROM clause (as in a computed or aggregate column), the column is nested at the deepest level wherever it appears.
For example, the following
SELECT statement includes the FullName computed column, which concatenates the first and last names:
Because the FullName column appears in the
SELECT list after the EmployeeID column, the FullName column is added as a child element of
<Employee>, as shown in the following XML:
As I’ve mentioned, the placement of columns in the
SELECT list impacts the resulting XML. This is also the case with computed columns. For example, in the following
SELECT statement, I’ve added the FullName column after the EmailAddress column:
Now the FullName column will be added as a child element to the
<ContactInfo> element, as the following XML demonstrates.
As these results show, you must be aware of the order you place columns when you define your
SELECT list.
Now let’s take a look at another aspect of the
AUTO mode. One of the limitations of this mode (as well as the
RAW mode) is that the column data is added as either attributes or child elements, depending on whether you specify the
ELEMENTS option. However, there might be times when you want to return some of the data as attributes and some as child elements. One method you can use with the
AUTO mode is to return some of the data in a subquery. For example, the following
SELECT statement includes a subquery that returns the employee’s first and last names:
Notice that the subquery includes a
FOR XML clause that uses
AUTO mode and includes the
ELEMENTS option. The
FOR XML clause also includes the
TYPE option, which specifies that the data returned by the subquery be returned as the XML type. You must include the
TYPE option to preserve the data as XML in the outer
SELECT statement.
The outer
SELECT statement also includes a FOR XML clause, but the
ELEMENTS option is not included. As a result, only the first and last names will be returned as child elements, but the employee ID and login ID will be returned as attributes, as shown in the following XML:
As you can see, subqueries let you maintain some control over the output. However, the
AUTO mode (and the
RAW mode, for that matter) provides little control over the XML returned by your query. For greater control, you’ll want to use the
EXPLICIT mode or the
PATH mode.
The EXPLICIT Mode
The
EXPLICIT mode provides very specific control over your XML, but this mode is much more complex to use than the
RAW or
AUTO modes. To use this mode, you must build your
SELECT statements in such as way as to define the XML hierarchy and structure. In addition, you must create a
SELECT statement for each level of that hierarchy and use UNION ALL clauses to join those statements.
There are a number of rules that describe how to define your
SELECT statements when using the
EXPLICIT mode, and it is beyond the scope of this article to review all those rules, so be sure to refer to the topic “Using EXPLICIT Mode” in SQL Server Books Online for the details about how to construct your
SELECT statements. In the meantime, let’s take a look at a few examples that help demonstrate some of the basic elements of the
EXPLICIT mode.
When constructing your
SELECT statement, you must include two columns in your
SELECT list that describe the XML hierarchy. The first column, Tag, is assigned a numerical value for each level of the hierarchy. For instance, the first
SELECT statement should include a Tag column with a value of 1. This is the top level of the hierarchy. The second
SELECT statement should include a Tag column with a value of 2, and so on.
The second column that you should include in your
SELECT statement is Parent. Again, this is a numerical value that identifies the parent of the hierarchy based on the Tag values you’ve assigned. In the first
SELECT statement, the Parent value should be null to indicate that this is a top level hierarchy.
Your first
SELECT statement should also include a reference to all the columns that will make up the XML structure. The columns must also include aliases that define that structure. Let’s look at an example to help understand how this all works. The following
SELECT statements return results similar to what you’ve seen in previous examples; however, the
SELECT statements themselves are more detailed:
In the first
SELECT statement, I begin by defining the Tag column and assigning a value of 1 to that column. Next I define the Parent column and assign a null value. I then define the EmployeeID column and assign an alias to that column. Notice that I use a very specific structure to define the alias name:
As the syntax shows, the first three components are required, and the last is optional:
<ElementName>
:The name of the element that the value should be assigned to.
<TagNumber>
:The tag number associated with the hierarchy that the value should be assigned to, as defined in the Tag column.
<AttributeName>:The name of the attribute associated with the column value, unless an optional directive is specified. For example, if the ELEMENT directive is specified, <AttributeName> is the name of the child element.
<OptionalDirective>
:Additional information for how to construct the XML.
For example, based on the alias name assigned to the EmployeeID column, you can see that the EmployeeID attribute will be associated with the
<Employee> element on the first level of the hierarchy.
Because the next three columns in the
SELECT list are associated with the second level of the XML hierarchy, which is defined in the second
SELECT statement, null values are assigned to the alias names for the column. This will provide the XML structure necessary to join the two
SELECT statements.
The second
SELECT statement is much simpler, but it still includes the Tag and Parent columns in the
SELECT list. The remaining columns in the
SELECT list are defined as you would normally define columns in your query.
The result set for the two
SELECT statements is then ordered by the EmployeeID and FirstName columns. This is necessary so that null values appear first in the result set to ensure that the XML is properly formatted. The
FOR XML clause is then appended to the end of the
SELECT statement in order to generate the following XML:
The EmployeeID column has now been added as an attribute to the
<Employee> element. However, you can change the EmployeeID column to a child element simply by adding the ELEMENT directive, as I did with the other columns:
Now the EmployeeID value will be displayed as a child element of
<Employee>,the first level element:
You can also ensure that columns with null values will still display the element by changing the
ELEMENTS directive to
ELEMENTSXSINIL, as shown in the following
SELECT statement:
Now the results will include the
xsi:nil attribute where values are null in the MiddleName column, as shown in the following XML:
As you can see from these examples, the
EXPLICIT mode can cause your
SELECT statements to become quite complex, especially if you want to add more levels to the hierarchy or want to create more intricate
SELECT statements. Fortunately, most of what you can do with the
EXPLICIT mode, you can do with the
PATH mode, and do it in a much simpler way..
We’ll begin with the
PATH mode’s default behavior. The following example includes a
FOR XML clause that specifies only the
PATH option:
Because no specific attributes or hierarchies have been defined, the query will return the following XML:
As you can see, each column is added as a child element to the
<row> element. You do not have to specify the
ELEMENTS directive because individual elements are returned by default, based on the column names.
You can also rename the row element and define a root element, as you’ve seen in earlier examples:
As the following results show, the XML now includes the
<Employees> root element and the individual
<Employee> row elements:
Suppose, now, that you want to include the EmployeeID value as an attribute of
<Employee>.You can easily do this by adding an alias to the EmployeeID column in the
SELECT clause and preceding the alias name with @, as shown in the following example:
Now the
<Employee>elements contain the EmpID attribute, along with the employee ID:
You can see how easy it is to return both attributes and child elements by using the
PATH mode. And if you want to include elements with null values, you simply include the
ELEMENTS
XSINIL option in your
FOR XML clause:
Now your results include the
xsi:nil attribute for those fields that contain null values:
As you can see, the
xsi:nil attribute in the
<MiddleName> element has been set to true.
Note: Because the
PATH mode automatically returns values as individual child elements, the
ELEMENTS directive has no effect when used by itself in a
FOR XML clause. It is only when the
XSINIL option is also specified that the
ELEMENTS directive adds value to the clause.
In addition to defining attributes within your column aliases in the
SELECT list, you can also define hierarchies. You define hierarchies by using the forward slash and specifying the element names. For example, the following
SELECT defines the
<EmployeeName> element and its three child elements:
<FirstName>, <MiddleName>, and
The statement returns the following XML result set:
Notice that each
<Employee>element now includes an
<EmployeeName> element, and each of those elements includes the individual parts of the name.
Suppose that you now want to add an email address to your result set. You can simply add the column to the
SELECT list after the other columns, as shown in the following example:
Because the column name is EmailAddress and no alias has been defined on that column, your XML results will now include the
<Employee>,right after
<EmployeeName>:
You must be careful on how you order your columns in the
SELECT list. For example, in the following
SELECT statement, I added the EmailAddress column after MiddleName, but before LastName:
Because I do not list the parts of the employee names consecutively, they are separated in the XML results:
As the XML shows, there are now two instances of the
<EmployeeName> child element in each
<Employee> element. The way to address this issue is to make certain you list the columns in your
SELECT list in the order you want the XML rendered.
In an earlier example, I demonstrated how to include an XML column in your query. You can also include an XML column when using the
PATH mode. The XML data returned by the column is incorporated into the XML that is returned by the query. For instance, the following
SELECT statement adds education data to the result set:
The
<Education> element and child elements are now included the XML result set:
As these preceding examples demonstrate, the
PATH mode provides a relatively easy way to define elements and attributes in your XML result set. However, the
PATH mode, like the other
FOR XML modes, supports additional options. For that reason, be sure to check out SQL Server Books Online for more information about each mode and about the
FOR XML clause in general. Despite how basic the clause itself might seem, it provides numerous options for returning exactly the type of XML data you need.
Load comments
|
https://www.red-gate.com/simple-talk/sql/learn-sql-server/using-the-for-xml-clause-to-return-query-results-as-xml/?article=720
|
CC-MAIN-2020-29
|
en
|
refinedweb
|
My software development/consultancy company, Stochastic Technologies, has developed and owns various products. One of these products, Dead Man’s Switch, is a service that emails you every few days to check up on you, and sends some e-mails you have pre-configured to your contacts if you don’t respond within your selected timeframe.
We recently rewrote the entire thing (it wasn’t too big, so the rewrite was quick), to make it more extensible, maintainable, current, &c. The previous version was rock-solid for years, but, somewhere along the line, it came to my attention that the new version had a weird bug that sometimes wouldn’t send the notification emails on the day they were supposed to.
The previous version only accepted emailing intervals that were on the area of two weeks to a month, but the new version has a “Test email” feature, that notifies you one day after you last show up, and sends all your emails the following day if you don’t check in after that email. A few users mentioned problems with that email never arriving, and my tests confirmed this on production, but for a long time I couldn’t pinpoint the bug.
Since the service is of such importance, it is critical that false positives never occur. However, if a user doesn’t get the notification email and forgets to check in, that’s a pretty serious bug. Due to the requirement that everything be as error-free as possible, the codebase is extensively tested, with the function that decides whether a user should be contacted having undergone multiple reviews and having many tens of test cases (which is a lot for a simple, twenty-line function).
The bug in question was never happening in tests, or on staging, or anywhere but production, and it also didn’t happen on production when I tried to debug it. It was a true Heisenbug, and baffled me to no end. I added debug statements everywhere, tested the entire thing multiple times, printed the inputs and outputs of the function, and nothing. The inputs were correct, the outputs were correct in staging, everything was right, except production was wrong. To reiterate: Running a simple, side-effect free function with the same inputs on production and staging seemingly gave different results.
The relevant function is below, see if you can spot the bug.
last_login is the user’s last login date,
last_contact is the date we last contacted them (so the function is idempotent),
intervals is their contact preferences (in days) and
contact_date is today’s date, mainly used in tests to simulate other dates:
def should_contact(last_login, last_contact, intervals, contact_date=date.today()): """ Decide whether we should contact a user or not. """ # If we last contacted the user on contact_date, we should also not contact. if last_contact == contact_date: return False # The number of days since the user's last login. days_since_login = (contact_date - last_login).days # The number of days we contacted the user after their last login. days_since_contact = (last_contact - last_login).days # If we have contacted before or on the last login, we don't need to contact again. if days_since_login <= 0: return False ... more code ... return <whether we should contact the user>
See it? I saw it too, I knew about this Python quirk, but I never realized, until it dawned on me: Python evaluates default arguments at definition time. Python evaluates default arguments at definition time. Which means that
date.today() is evaluated once, until the process is restarted. No wonder DMS didn’t send some emails: it thought it was a day earlier than it actually was, until the process got restarted and re-evaluated the code. This meant that this bug would never be exhibited in tests, or in staging (which didn’t live for days, as it’s only started when needed for testing), or while production was being debugged (because uploading new code restarted the process and got the correct date).
A quick change to:
def should_contact(last_login, last_contact, intervals, contact_date=None): """ Decide whether we should contact a user or not. """ if contact_date is None: contact_date = date.today() ...
fixed everything.
I’m not sure what the moral to this story is, except that even things you know can still come back to bite you, if you aren’t careful/don’t realize they can. The lesson I’ve learnt was that I shouldn’t avoid just putting mutable datastructures (lists, dictionaries, etc) as default arguments, but really anything that’s not specifically immutable (numbers, strings, True/False/None, that’s pretty much it). I’ll definitely be more aware of what goes on in default argument land now, but at least the bug is gone and the service is reliable once more.
|
https://www.stavros.io/posts/bug-life-and-death/
|
CC-MAIN-2020-29
|
en
|
refinedweb
|
Hide Forgot
Hi...
I found some problems with installer, for example anaconda can't detect
properly the video card SiS 620, i've search it in kudzu pcitable, and i
didn't found it.. so i have added it.... the pci entry i used is...
0x1039 0x6306 "Card:SiS 620" "Silicon Integrated Systems [SiS]|620"
It worked fine, with the card, now we can perform a graphic installation
with this video card, and the entries to Xconfigurator work fine...
the file modified is...
/RedHat/instimage/usr/share/kudzu/pcitable
just add the line, and go...
About the es_MX, i found this problem, when I went to do something like...
[root@geo12 /root]# rm lolis
rm: ?borrar `lolis'? (s/n) s
[root@geo12 /root]# ls -l lolis
-rw-r--r-- 1 root root 5 Dec 11 07:37 lolis
[root@geo12 /root]#
so, the file was not erased, then i changed the definition in
/etc/sysconfig/i18n to...
LANG="es_ES"
LC_ALL="es_ES"
LINGUAS="es_ES"
Ok, this when the system is already installed, but we can fix this in the
installer program...
the archive to modify is this...
RedHat/instimage/usr/lib/python1.5/site-packages/todo.py
in the class Language...
class Language (SimpleConfigFile):
def __init__ (self):
self.info = {}
self.langs = {
"Czech" : "cs_CZ" ,
"English" : "en_US" ,
"German" : "de_DE" ,
"Hungarian" : "hu_HU" ,
"Icelandic" : "is_IS" ,
"Indonesian" : "id_ID" ,
"Italian" : "it_IT" ,
"Norwegian" : "no_NO" ,
"Polish" : "pl_PL" ,
"Romanian" : "ro_RO" ,
"Slovak" : "sk_SK" ,
"Slovenian" : "sl_SI" ,
"Spanish" : "es_ES" ,
"Russian" : "ru_RU.KOI8-R" ,
"Ukrainian" : "uk_UA" ,
}
The originale line said...
"Spanish" : "es_MX" ,
and i changed it to...
"Spanish" : "es_ES" ,
Now, the installation perform well in spanish (Oh, sorry my bad english,
spanish is my native language :) and all ths system is already correctly
located, (Kde, Gnome. mc, etc...).
I hope we can share this to all...
By.
Juan Diego
Fixed in the latest installer available in RawHide.
|
https://partner-bugzilla.redhat.com/show_bug.cgi?id=7754
|
CC-MAIN-2020-29
|
en
|
refinedweb
|
Hi all,
I am creating a skill that echoes back what the user has said. I want to display the recognized utterance on a screen. How do I do this? Do I need to use socket communication? I ask because the skill runs as a service. I could write the output to a text file and have a reader program read it but that kind of thing is tricky to do. I have looked at the recording skill and know that I have to use something called a scheduled skill. However, there is no documentation on this kind of skill. I have some code below. The scheduling is failing because the line
self.schedule()
is getting a null value. I am also uncertain about how to stop the skill. Do I have to do something with threading and static methods? I am seeing the record skill where this has been done but I do not know how to apply that knowledge to my code.
By the way, the use case for this skill is to create an application for deaf people which would output conversation to a screen.
import time
from adapt.intent import IntentBuilder
from mycroft.skills.scheduled_skills import ScheduledSkill
from mycroft.util import record, play_wav
from mycroft.util.log import getLogger
author = ‘Pranav Lal’
LOGGER = getLogger(name)
class EchoUtteranceSkill(ScheduledSkill):
def init(self):
super(EchoUtteranceSkill, self).init(“EchoUtteranceSkill”)
def initialize(self):
intent = IntentBuilder(“EchoUtteranceSkillIntent”).require(
“EchoUtteranceSkillKeyword”).build()
self.register_intent(intent, self.handle_echo_utterance)
intent = IntentBuilder(“EchoUtteranceSkillIntent”).require(
“EchoUtteranceSkillStopKeyword”).build()
self.register_intent(intent, self.handle_echo_stop_utterance)
self.speak_dialog(“echo.on”)
def handle_echo_utterance(self,message): LOGGER.info("echo back on") utterance = message.data.get('utterance') self.speak(utterance) time.sleep(1) self.schedule() def handle_echo_stop_utterance(self): self.cancel() self.speak_dialog("echo.off")
def create_skill():
return EchoUtteranceSkill()
|
https://community.mycroft.ai/t/displaying-utterances-creating-an-echo-back-skill/2831
|
CC-MAIN-2020-29
|
en
|
refinedweb
|
The CIO Framework - OOP344 20131
OOP344 | Weekly Schedule | Student List | Teams | Project | Student Resources
Under construction!
Contents
- 1 Objective
- 2 Tips
- 3 CUI General Header file (cuigh.h)
- 3.1 File Names
- 3.2 Hierarchy
- 3.3 Issues, Releases and Due Dates
- 3.4 CFrame
- 3.5 CField
- 3.6 CLabel
- 3.7 CDialog
- 3.8 CLineEdit
- 3.9 CButton
- 3.10 CValEdit
- 3.11 CCheckMark
- 3.12 CMenuItem
- 3.13 CText
- 3.14 CCheckList
- 3.15 CMenu and MNode (optional) team and.
Tips.
CUI General Header file (cuigh.h)
The general header file holds the common setting and definition between all the Core Classes. Review this header file at each stage of the project for changes.
#ifndef ___CUIGH_H__ #define ___CUIGH_H__ namespace cio{ gitub: 2.9.1_AddTextClass
0.2 Milestone
- Add Console Class to the repo and test it with cio_test.cpp and Test1Frame.cpp.
- Create Mock-up classes
- CLabel Mock-up Class (issue 2.2)
- CDialog Mock-up Class (issue 2.3)
- CLineEdit Mock-up Class (issue 2.4)
- CButton Mock-up Class (issue 2.5)
Details
Due Date, 13th, 23:59 all called Zero,);)
CDialog Blog Posts
Methods.
CLineEdit Student Resources
CLineEdit Help/Questions Blogs
-
CLineEdit Blog Posts"
|
https://wiki.cdot.senecacollege.ca/w/index.php?title=The_CIO_Framework_-_OOP344_20131&%3Boldid=95245&mobileaction=toggle_view_desktop
|
CC-MAIN-2020-05
|
en
|
refinedweb
|
[
]
ASF GitHub Bot commented on AIRFLOW-6004:
-----------------------------------------
potiuk commented on pull request #6596: [AIRFLOW-6004] Untangle Executors class to avoid cyclic
imports
URL:
There are cyclic imports detected seemingly randomly by pylint checks when some
of the PRs are run in CI:
************* Module airflow.utils.log.json_formatter
airflow/utils/log/json_formatter.py:1:0: R0401: Cyclic import
(airflow.executors -> airflow.executors.kubernetes_executor ->
airflow.kubernetes.pod_generator) (cyclic-import)
airflow/utils/log/json_formatter.py:1:0: R0401: Cyclic import (airflow ->
airflow.executors -> airflow.executors.kubernetes_executor ->
airflow.kubernetes.pod_launcher) (cyclic-import)
airflow/utils/log/json_formatter.py:1:0: R0401: Cyclic import
(airflow.executors -> airflow.executors.kubernetes_executor ->
airflow.kubernetes.worker_configuration -> airflow.kubernetes.pod_generator)
(cyclic-import)
The problem is that airflow's _init_ contains a few convenience imports
(AirflowException, Executors etc.) but it also imports a number of packages
(for example kubernetes_executor) that in turn import the airflow package
objects - for example airflow.Executor. This leads to cyclic imports if you
import first the executors before airflow. Similar problem happens with
executor._init_.py containing class "Executors" imported by all executors but
at the same time some of the executors (for example KubernetesExecutor) import
the very same Executor class.
This might happen in pylint checks in pre-commit because they split a number of
files they process between the multiple threads you have at your machine and
sometimes it might happen that the files are imported in different order.
As a solution, the executors "list" should be moved to a separate module.
Also the name of constants was changed to not to be confused with class
names and Executors class was renamed to AvailableExecutors.
Make sure you have checked _all_ steps below.
### Jira
- [x] My PR addresses the following [Airflow Jira]()
issues and references them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
-
### Description
- [x] Here are some details about my PR, including screenshots of any UI changes:
### Tests
- [x] My PR adds the following unit tests __OR__ does not need testing for this extremely
good reason:
### Commits
- [x]
- [x]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
> Untangle "Executors" class from potentially cyclic import
> ---------------------------------------------------------
>
> Key: AIRFLOW-6004
> URL:
> Project: Apache Airflow
> Issue Type: Sub-task
> Components: ci
> Affects Versions: 2.0.0
> Reporter: Jarek Potiuk
> Priority: Major
>
> See the description in
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
|
http://mail-archives.apache.org/mod_mbox/airflow-commits/201911.mbox/%3CJIRA.13268940.1574015423000.165288.1574016060087@Atlassian.JIRA%3E
|
CC-MAIN-2020-05
|
en
|
refinedweb
|
Range rage
December 3, 2012 at 9:36 PM by Dr. Drang
I understand why Python’s
range function works the way it does, and I usually use it correctly, but I still tend to mess up the three-parameter version. Even worse, I mess up its NumPy cousin,
arange, which I find more useful than
range itself, almost every time I use it. Today I decided to take action.
The root of the problem is list indices. Python inherited C’s zero-based indexing scheme. The first five items of an array named
a are
a[0], a[1], a[2], a[3], a[4]
not
a[1], a[2], a[3], a[4], a[5]
as they would be in a language built for scientists and engineers, like, say Fortran.1
C does this because it’s close to the metal,2 and the index really represents an offset from the address of the start of the list. Thus the memory address of
a[0] is the same as the address of
a itself,
a[1] is one away from the address of
a, and so on.
I don’t know why Guido decided Python, which is decidedly not close to the metal, should use the same indexing scheme as C, but I suspect it has something to do with C being the mother tongue of most computer science types of his generation.
The list of numbers generated by
range fits in with this zero-based mindset. The single-parameter version,
range(5), returns
[0, 1, 2, 3, 4]
which are the indices of a five-element list. The default starting value of
range is zero.
The two-parameter version allows you to set the starting value, so
range(1, 5) returns
[1, 2, 3, 4]
which maintains the same end value. This is a little tricky, because the second parameter represents neither the end value nor the number of elements, but there is a consistency of sorts with the one-parameter version.
The three-parameter version allows you to set the step value, so
range(0, 10, 2)
returns
[0, 2, 4, 6, 8]
As with the one- and two-parameter versions, the second parameter, which the documentation calls the “stop” value, never appears in the list. To get 10 in the list, we have to use
range(0, 11, 2) or
range(0, 12, 2).
As I said, I usually get this wrong, but since I seldom use
range, my cognitive deficiency doesn’t hurt me too often. I do, on the other hand, use the NumPy version,
arange, quite often. When I want to plot a function over a uniformly spaced set of x values,
arange is just the ticket.
Or it would be, if I didn’t keep mistaking the stop value for where the generated array actually stops. I can’t tell you how often I’ve written
arange(0, 1, .1) and been disappointed when it creates
array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9])
and doesn’t include the 1.
If you’re familiar with NumPy, you might think
linspace would be my salvation. But while
linspace does stop on the stop value, I still have an off-by-one issue with its third parameter, which I keep thinking should be the number of intervals, not the number of generated values. So I do
linspace(0, 1, 10) and am disappointed when the result is
array([ 0. , 0.11111111, 0.22222222, 0.33333333, 0.44444444, 0.55555556, 0.66666667, 0.77777778, 0.88888889, 1. ])
instead of
array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. ])
which requires
linspace(0, 1, 11).
Today I decided to combat this problem by writing an array-generating function that works the way my brain does. It’s called
fromtoby, and it always takes three parameters:
- The value the array starts from.
- The value the array goes to.
- The amount successive values increase by.
Here’s
fromtoby.py:
1: #!/usr/bin/python 2: 3: from __future__ import division 4: from numpy import arange 5: 6: def fromtoby(f, t, b): 7: return arange(f, t + b/2, b) 8: 9: if __name__ == "__main__": 10: print fromtoby(0, 1, .1)
By saving it in my
$PYTHONPATH, I can
from fromtoby import fromtoby
and say things like
x = fromtoby(0, 1, .01)
to get
x equal to, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.6 , 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.7 , 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.8 , 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.9 , 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1. ])
which is, finally, exactly what I want on the first try.
|
https://leancrew.com/all-this/2012/12/range-rage/
|
CC-MAIN-2020-05
|
en
|
refinedweb
|
Steganography is the practice of hiding a file, message, image or video within another file, message, image or video. The word steganography is derived from the Greek words steganos (meaning hidden or covered) and graphe (meaning writing).
It is often used among hackers to hide secret messages or data within media files such as images, videos or audio files. Even though there are many legitimate uses for Steganography such as watermarking, malware programmers have also been found to use it to obscure the transmission of malicious code.
In this tutorial, we gonna write a Python code to hide text messages using a technique called Least Significant Bit.
Least Significant Bit (LSB) is a technique in which last bit of each pixel is modified and replaced with the data bit. This method only works on Lossless-compression images, which means that the files are stored in a compressed format, but that this compression does not result in the data being lost or modified, PNG, TIFF, and BMP as an example, are lossless-compression image file formats.
As you may already know, an image consists of several pixels, each pixel contains three values (which are Red, Green, Blue), these values range from 0 to 255, in other words, they are 8-bit values. For example, a value of 225 is 11100001 in binary and so on.
Let's take an example of how this technique works, say I want to hide the message "hi" into a 4x4 image, here are the example image pixel values:
[(225, 12, 99), (155, 2, 50), (99, 51, 15), (15, 55, 22), (155, 61, 87), (63, 30, 17), (1, 55, 19), (99, 81, 66), (219, 77, 91), (69, 39, 50), (18, 200, 33), (25, 54, 190)]
By looking at the ASCII Table, we can convert this message into decimal values and then into binary:
0110100 0110101
Now, we iterate over the pixel values one by one, after converting them to binary, we replace each least significant bit with that message bits sequentially (e.g 225 is 11100001, we replace the last bit, the bit in the right (1) with the first data bit (0) and so on).
This will only modify the pixel values by +1 or -1 which is not noticable at all, you can use 2-Least Significant Bits too which will modify the pixels by a range of -3 to +3.
Here is the resulting pixel values (you can check them on your own):
[(224, 13, 99),(154, 3, 50),(98, 50, 15),(15, 54, 23), (154, 61, 87),(63, 30, 17),(1, 55, 19),(99, 81, 66), (219, 77, 91),(69, 39, 50),(18, 200, 33),(25, 54, 190)]
Related: How to Use Hash Algorithms in Python using hashlib.
Now that we understand the technique we gonna use, let's dive in to the Python implementation, we gonna use OpenCV to manipulate the image, you can use any other imaging library you want (such as PIL):
pip3 install opencv-python numpy
Open up a new Python file and follow along:
import cv2 import numpy as np
Let's start off by implementing a function to convert any type of data into binary, we will use this to convert the secret data and pixel values to binary in the encoding and decoding phase:
def to_bin(data): """Convert `data` to binary format as string""" if isinstance(data, str): return ''.join([ format(ord(i), "08b") for i in data ]) elif isinstance(data, bytes) or isinstance(data, np.ndarray): return [ format(i, "08b") for i in data ] elif isinstance(data, int) or isinstance(data, np.uint8): return format(data, "08b") else: raise TypeError("Type not supported.")
The below function will be responsible for encoding secret_data into the image:
def encode(image_name, secret_data): # read the image image = cv2.imread(image_name) # maximum bytes to encode n_bytes = image.shape[0] * image.shape[1] * 3 // 8 print("[*] Maximum bytes to encode:", n_bytes) if len(secret_data) > n_bytes: raise ValueError("[!] Insufficient bytes, need bigger image or less data.") print("[*] Encoding data...") # add stopping criteria secret_data += "=====" data_index = 0 # convert data to binary binary_secret_data = to_bin(secret_data) # size of data to hide data_len = len(binary_secret_data) for row in image: for pixel in row: # convert RGB values to binary format r, g, b = to_bin(pixel) # modify the least significant bit only if there is still data to store if data_index < data_len: # least significant red pixel bit pixel[0] = int(r[:-1] + binary_secret_data[data_index], 2) data_index += 1 if data_index < data_len: # least significant green pixel bit pixel[1] = int(g[:-1] + binary_secret_data[data_index], 2) data_index += 1 if data_index < data_len: # least significant blue pixel bit pixel[2] = int(b[:-1] + binary_secret_data[data_index], 2) data_index += 1 # if data is encoded, just break out of the loop if data_index >= data_len: break return image
Here is what we did:
Now here is the decoder function:
def decode(image_name): print("[+] Decoding...") # read the image image = cv2.imread(image_name) binary_data = "" for row in image: for pixel in row: r, g, b = to_bin(pixel) binary_data += r[-1] binary_data += g[-1] binary_data += b[-1] # split by 8-bits all_bytes = [ binary_data[i: i+8] for i in range(0, len(binary_data), 8) ] # convert from bits to characters decoded_data = "" for byte in all_bytes: decoded_data += chr(int(byte, 2)) if decoded_data[-5:] == "=====": break return decoded_data[:-5]
We read the image and then get all the last bits of every pixel of the image. After that, we keep decoding until we see that stopping criteria.
Let's use these functions:
if __name__ == "__main__": input_image = "image.PNG" output_image = "encoded_image.PNG" secret_data = "This is a top secret message." # encode the data into the image encoded_image = encode(image_name=input_image, secret_data=secret_data) # save the output image (encoded image) cv2.imwrite(output_image, encoded_image) # decode the secret data from the image decoded_data = decode(output_image) print("[+] Decoded data:", decoded_data)
I have an example PNG image here "image.PNG", use whatever image you really want, just make sure it is a Lossless-compression image format as discussed earlier.
After the execution of the script, it will write another file "encoded_image.PNG" which has exactly the same image looking, but with secret data encoded in it, here is the output:
[*] Maximum bytes to encode: 125028 [*] Encoding data... [+] Decoding... [+] Decoded data: This is a top secret message.
Awesome ! You just learned how you can implement Steganoghraphy in Python on your own !
As you may notice, the resulting image will look exactly the same as the original image, this is because we're only modifying the pixel values by 1. So whenever a person sees this image, he/she won't be able to detect whether there is a hidden data within it.
Finally, here are some ideas and challenges you can do:
THIS MAY INTERESTS YOU: How to Create a Reverse Shell in Python.
Happy Coding ♥View Full Code
|
https://www.thepythoncode.com/article/hide-secret-data-in-images-using-steganography-python
|
CC-MAIN-2020-05
|
en
|
refinedweb
|
any update? currently the AUR package of MXNet is not usable :(
Search Criteria
Package Details: mxnet-mkl 1.5.1-2
Dependencies (24)
- double-conversion (double-conversion-git)
- hdf5 (hdf5-java, hdf5-openmpi-java, hdf5-openmpi)
- intel-dnnl
- intel-mkl (intel-mkl-slim, intel-mkl-bin)
- intel-tbb (intel-tbb-gcc6)
- python-numpy (python-numpy-mkl-bin, python-numpy-openblas, python-numpy-mkl)
- python-requests
- cairo (cairo-dfb, cairo-minimal, cairo-ubuntu, cairo-infinality, cairo-git, cairo-infinality-remix, cairo-glesv2-aarch64, cairo-glesv2-armv7l) (make)
- cblas (openblas-lapack-git, cblas-tmg, flexiblas, blas-git, opencblas, openblas-lapack-static, atlas-lapack, openblas-lapack, openblas-lapack-openmp) (make)
- cmake (cmake-git) (make)
- cuda (cuda65) (make)
- cudnn (make)
- cython (cython-kivy, cython-git) (make)
- git (git-git) (make)
- glew (glew-libepoxy, glew-git, glew-egl-glx) (make)
-) (make)
- gtkglext (make)
- intel-compiler-base (make)
- intel-dnnl (make)
- intel-mkl (intel-mkl-slim, intel-mkl-bin) (make)
- lapack (openblas-lapack-git, lapack-tmg, flexiblas, lapack-git, openblas-lapack-static, atlas-lapack, openblas-lapack, openblas-lapack-openmp) (make)
- nccl (nccl-git) (make)
- python-graphviz (make)
- vtk (vtk-visit, vtk-git, vtk-raytracing-git) (make)
Required by (5)
- python-gluoncv (requires mxnet)
- python-gluonnlp (requires mxnet)
- python-mxboard (requires mxnet)
- python-onnx (requires mxnet) (optional)
- python-tensorly (requires mxnet) (optional)
Sources (17)
- 13559.patch
- git+
- git+
- git+
- git+
- git+
- git+
- git+
- git+
- git+
- git+
- git+
- git+
- git+
- git+
- git+
- mxnet
olko commented on 2020-01-15 20:20
petronny commented on 2019-12-25 08:52
@olko I'll take a look next month.
olko commented on 2019-12-25 08:39
@petronny Your mxnet package fails because of unmet dependencies to intel and mkl packages (so I used the upstream archive).
I got MXNet compiled with OpenCV + CUDA + MKL.
The problem was that Arch Linux provides the newest GCC version (9.2.0 at this time) and newer versions are more eager to generate warnings.
MXNet uses
-Werror that causes compilation abortion. As a quick fix I removed
-Werror from the cmake config for MKLDNN.
But I'll provide a pull request upstream that eliminates the warnings.
My Steps:
download and extract the official MXNet 1.5.1 archive (apache-mxnet-src-1.5.1-incubating.tar.gz)
cd apache-mxnet-src-1.5.1-incubating
store cmake config () as cmake_options.yml in apache-mxnet-src-1.5.1-incubating (I believe that USE_MKLML_MKL and USE_MKLDNN are automatically switched on if USE_MKL_IF_AVAILABLE is enabled)
apply OpenCV patch (OpenCV-flags in namespace cv)
apply MKLDNN patch (remove -Werror causing abort)
call
./dev_menu.py build
Please, provide a new AUR package that uses my configuration from above (e.g. CUDA + MKL enabled for MXNet).
ty, Oliver
petronny commented on 2019-12-24 05:28
@olko Because it doesn't build when I wrote the PKGBUILD.
If it's building now or you figure out how to make it build, I'm happy to merge your changes.
olko commented on 2019-12-23 20:50
Why is mxnet configured without support for OpenCV?
olko commented on 2019-12-23 20:49
Why is no mxnet-cuda-mkl provided?
zottelef commented on 2019-07-17 08:30
@pet.
petronny commented on 2019-07-11 05:50
@zottelef Adding these 3 lines before
R CMD INSTALL R-package:
echo "PKG_CXXFLAGS+=$(CFLAGS)" >> R-package/src/Makevars sed '1i#define CV_IMWRITE_PNG_COMPRESSION cv::IMWRITE_PNG_COMPRESSION' -i R-package/src/im2rec.cc sed '1i#define CV_IMWRITE_JPEG_QUALITY cv::IMWRITE_JPEG_QUALITY' -i R-package/src/im2rec.cc
under
rpkg: in
Makefile should work.
I can't find a file like
mxnet_0.5.tar.gz to install, but I think mxnet has been installed. I can pass the tests with
make rpkgtest.
zottelef commented on 2019-07-08 07:12
There is still and error with the R CMD INSTALL R-package:
im2rec.cc:39:10: fatal error: opencv2/opencv.hpp: No such file or directory 39 | #include <opencv2/opencv.hpp> | ^~~~~~~~~~~~~~~~~~~~ compilation terminated. Prepending opencv4 to the /home/fabio/.cache/pikaur/build/mxnet/src/mxnet/R-package/src/im2rec.cc
gives this error:
In file included from im2rec.cc:39: /usr/include/opencv4/opencv2/opencv.hpp:48:10: fatal error: opencv2/opencv_modules.hpp: No such file or directory 48 | #include "opencv2/opencv_modules.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
but I cannot find the file that calls opencv2/opencv_modules.hpp and prepend opencv4. opencv_modules.hpp and opencv.hpp are in /usr/include/opencv4/opencv2/ (on my computer)
petronny commented on 2019-07-05 11:13
@zottelef I've looked into the R support.
At last, the document asks you to run
make rpkg
which is
rpkg: mkdir -p R-package/inst/libs cp src/io/image_recordio.h R-package/src cp -rf lib/libmxnet.so R-package/inst/libs mkdir -p R-package/inst/include cp -rf include/* R-package/inst/include cp -rf 3rdparty/dmlc-core/include/* R-package/inst/include/ cp -rf 3rdparty/tvm/nnvm/include/* R-package/inst/include Rscript -e "if(!require(devtools)){install.packages('devtools', repo = '')}" Rscript -e "library(devtools); library(methods); options(repos=c(CRAN='')); install_deps(pkg='R-package', dependencies = TRUE)" cp R-package/dummy.NAMESPACE R-package/NAMESPACE echo "import(Rcpp)" >> R-package/NAMESPACE R CMD INSTALL R-package Rscript -e "if (!require('roxygen2')||packageVersion('roxygen2') < '5.0.1'){\ devtools::install_version('roxygen2',version='5.0.1',\ repos='',quiet=TRUE)}" Rscript -e "require(mxnet); mxnet:::mxnet.export('R-package'); warnings()" rm R-package/NAMESPACE Rscript -e "require(roxygen2); roxygen2::roxygenise('R-package'); warnings()" R CMD INSTALL R-package
So if you have
lib/libmxnet.so I think there is no need to compile libmxnet.so youself. Could you try skip the build and use the
libmxnet.so in the prebuilt binaires?
Packaging
r-mxnet is a sort of nightmare to me since almost all
r-* things are in AUR and I have to add them into my repository before packaging
r-mxnet. But some of them are orphaned and maybe not well-maintained so I don't really want to add them into my repository.
So could you try a local installation without building
libmxnet.so.
|
https://aur.tuna.tsinghua.edu.cn/packages/mxnet-mkl/
|
CC-MAIN-2020-05
|
en
|
refinedweb
|
William Steele1,739 Points
Instantiation
How do I declare the frog class and give it a name at the same time, tried doing it the way it showed in video but said it was wrong and have been messing around but not finding anything
namespace Treehouse.CodeChallenges { class Program { static void Main() { new Frog == Frog 'mike' } } }
namespace Treehouse.CodeChallenges { class Frog{} }
2 Answers
Antonio De Rose20,859 Points
namespace Treehouse.CodeChallenges { class Program { static void Main() { new Frog == Frog 'mike' //when you want to instantiate a class //class instancevariable = new kewyword class(), this will lead to the below //questions asks you to use the mike word for the instance variable //Frog mike = new Frog(); } } }
Ed H-P2,557 Points
William,
I had the same issue as you, and found the answer by removing a sneaky space I had between my class Frog and the (); , after I defined the new variable.
e.g. this was wrong: Frog mike = new Frog ();
but I removed the final space and Treehouse let me have it. My initial method was still valid, but not 100% grammatically/typographically correct.
:)
|
https://teamtreehouse.com/community/instantiation-2
|
CC-MAIN-2020-05
|
en
|
refinedweb
|
RationalWiki:Noticeboard
Helios 02:18, 22 May 2007 (CDT):
- RationalWiki's first userbox is here.
- 2nd one here. olliegrind 06:51, 22 May 2007 (CDT)
OK, I have over a hundred of the templates (without names!) stashed in my sandbox - does anyone know an efficient way to upload them? Editing each one, one at a time is tedious! humanbe in 12:51, 22 May 2007 (CDT)
- I dont no but I think Linus would be the best person to ask, he's our tech guy =) --Helios-talk to me 13:12, 22 May 2007 (CDT)
- Well, the overall best way is to click the "move" button at the top of each page, and use the wizard to move it all, create redirects automatically, and generally be cool. --Linus M. 18:04, 22 May 2007 (CDT)
- Wow, that won't work with that. Ah well, we'd better simply C&P them. --Linus M. 18:13, 22 May 2007 (CDT)
- Yeah, been doing it. It looks imposing at first, but then I realized 80% of those UXBs will never be used here, or, if someone wants them, they can make them themselves. But anyway what is the point of putting the "noticeboard" on the front page? The link was enough, wasn't it? It just looks... wrong. humanbe in 18:36, 22 May 2007 (CDT)
I'm uploading my Alaska article. Helios-talk to me 13:39, 22 May 2007 (CDT)
Clean up job for a sysop[edit]
Who wants the unenviable job of moving all the articles about CP to the CP namespace, and all the essays to the essay namespace, and deleting the redirects? Tmtoulouse 19:50, 22 May 2007 (CDT)
-
- I'll do a few, just for the power trip, but then off to work.-AmesG 19:58, 22 May 2007 (CDT)
- Trent, some of the "Essays" just got moved out of the essay space, non? Is there a list of these things somewhere? How did we get enough articles on CP and essays for there to be a "lot" of work already? Point me and I'll do what I can to help. And... at a higher meta-level of sysopness, can you improve the "namespace" article, give it a big highlight for people, make it easy to figure out exactly how to get an article title right? Tanks! And airplanes! humanbe in 20:00, 22 May 2007 (CDT)
- They got moved because there was no such thing as those name spaces yet, I had to move them out so when I created the namespace nothing bad happened to them. Now that I created the namespaces I have to put them back in. Basically atleast. Tmtoulouse 20:07, 22 May 2007 (CDT)
Non-funny vandalism[edit]
User:1234 went on a small spree of non-funny vandalism. This consisted of a series of page moves, apparently intended to hide Main Page, its content-containing template, and its talk page. There were also 8 pages created named Owned through Owned8; 7 of them just contained the word 'Owned'; the 8th was a redirect to Main+Page, which contained photographs of doggies. The doggies page was also used to replace RationalWiki:Site support.
Per my understanding of the emerging community consensus, I did the following:
- blocked User:1234 for 24 hours
- Undid the page moves
- Saved a copy of the doggies page at RationalWiki:Site support/Vandalism/1234
- Deleted the Owned* pages
- Deleted the various nonsense-named redirects left behind by the page moves
If any sysop disagrees with any of those actions, I won't be upset if they're undone. And if any non-sysop disagrees, lemme know and we can talk about it. And if the community thinks I overstepped the consensus or my bounds, speak up about that too. Not that anyone could stop ya. --jtltalk 02:31, 30 May 2007 (CDT)
- He was a busy little chappie, wasn't he? looks like you dun good to me.--Bob_M (talk) 03:19, 30 May 2007 (CDT)
- In his(?) defense, the dog is adorable. But when faced with this sort of "cyber terrorism", it's clear what we must do now. We must disable the Move and Upload functions for non-sysop! And then we must disable registrations! And we must block all new accounts if our gut says there's something fishy going on. And all of this will make our site "grow rapidly"! After all, this worked so extremely well for CP! ;) --Sid 12:15, 30 May 2007 (CDT)
- 95% of right thinking people know conservatives use vandalism as a tactic to make their point. They are also deceitful. ɱ@δ ɱ!ɳHello?/I did this! 15:23, 30 May 2007 (CDT)
Maybe funny vandalism[edit]
New user JtI (that last letter is a capital EYE) moved by User page and User talk page. I'm less sure that's not funny, so feel I'm on less solid grounds blocking, so I've only blocked for 2 hours. Other than that, same as above --jtltalk 02:42, 30 May 2007 (CDT)
- OMGz, batten down the hatches! Lock down the site! Ban all suspicious users! Write articles about evil, deceitful vandals messing up our furniture! hehe humanbe in 12:11, 30 May 2007 (CDT)
Listen, Buddy, we know who you are and IT STOPS HERE! We have filed a case, ID# IJ429K421K/215-ad-421/20932-01 and have given your IP to the FBI (who for some reason sounded like a 12 year old girl, but no matter). You will be PUNISHED! --PalMD-yada yada 12:31, 30 May 2007 (CDT)
- Maybe we should build a virtual pillory? Flippin;-)
Anyone willing to ASCII art it? --ויִכִּ נתֶּרֶפּרֶתֵּר שְׁלֹום!
Update...it turns out that the report I filed was with the cable company. My cable is back on. The real case number is 758dsa258fjtr598advd/23--PalMD-yada yada 12:41, 30 May 2007 (CDT)
We read it while
this ticked.--PalMD-yada yada 13:35, 30 May 2007 (CDT)
-
- Maybe we should use this as a study on how conservative vandals work, because it obviously is a conservative vandal. Conservative, particularly conservative vandals must have a strong desire for attention. Conservatives are almost always more aggressive than liberals here, as conservatives insist on the last word, insist on continuing debate long after it has become tiresome, and repeat complaints after they have been rejected. You know that sort of stuff. Sterile 13:40, 30 May 2007 (CDT)
|
https://rationalwiki.org/wiki/RationalWiki:Noticeboard
|
CC-MAIN-2020-05
|
en
|
refinedweb
|
This project shows how to simply Fade-In and Fade-Out a LED by using delay function to control pulse width what is sometimes called Software PWM (Pulse Width Modulation). In our circuit a LED is connected to PB0 and it is made to Fade the LED In and Out alternately. The code is on Github, click here. DELAY_MAX (512) #define DELAY_MIN (1) #if DELAY_MAX < 1 || DELAY_MIN < 1 # warning "Value of DELAY_MAX and DELAY_MAIN should be from range <1, 2^16>" #endif #if !(DELAY_MAX > DELAY_MIN) # warning "Value of DELAY_MAX should be greater then DELAY_MIN" #endif int main(void) { uint16_t delay = DELAY_MIN; uint8_t dir = 0; /* setup */ DDRB = 0b00000001; // set LED pin as OUTPUT PORTB = 0b00000001; // set LED pin to HIGH /* loop */ while (1) { PORTB &= ~(_BV(LED_PIN)); // LED off _delay_loop_2(delay); PORTB |= _BV(LED_PIN); // LED on _delay_loop_2(DELAY_MAX - delay); if (dir) { // fade-in if (++delay >= (DELAY_MAX - 1)) dir = 0; } else { // fade-out if (--delay <= DELAY_MIN) dir = 1; } } }
|
https://blog.podkalicki.com/attiny13-led-fading-with-delay-function/
|
CC-MAIN-2020-05
|
en
|
refinedweb
|
Rename the mtd documentation files to ReST, add anindex for them and adjust in order to produce a nice htmloutput via the Sphinx build system.At its new index.rst, let's add a :orphan: while this is not linked tothe main index.rst file, in order to avoid build warnings.Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>--- Documentation/nvdimm/{btt.txt => btt.rst} | 140 ++--- Documentation/nvdimm/index.rst | 12 + .../nvdimm/{nvdimm.txt => nvdimm.rst} | 518 ++++++++++-------- .../nvdimm/{security.txt => security.rst} | 4 +- drivers/nvdimm/Kconfig | 2 +- 5 files changed, 387 insertions(+), 289 deletions(-) rename Documentation/nvdimm/{btt.txt => btt.rst} (71%) create mode 100644 Documentation/nvdimm/index.rst rename Documentation/nvdimm/{nvdimm.txt => nvdimm.rst} (60%) rename Documentation/nvdimm/{security.txt => security.rst} (99%)diff --git a/Documentation/nvdimm/btt.txt b/Documentation/nvdimm/btt.rstsimilarity index 71%rename from Documentation/nvdimm/btt.txtrename to Documentation/nvdimm/btt.rstindex e293fb664924..2d8269f834bd 100644--- a/Documentation/nvdimm/btt.txt+++ b/Documentation/nvdimm/btt.rst@@ -1,9 +1,10 @@+============================= BTT - Block Translation Table ============================= 1. Introduction----------------+=============== Persistent memory based storage is able to perform IO at byte (or more accurately, cache line) granularity. However, we often want to expose such@@ -25,7 +26,7 @@ provides atomic sector updates. 2. Static Layout-----------------+================ The underlying storage on which a BTT can be laid out is not limited in any way. The BTT, however, splits the available space into chunks of up to 512 GiB,@@ -33,43 +34,43 @@ called "Arenas". Each arena follows the same layout for its metadata, and all references in an arena are internal to it (with the exception of one field that points to the-next arena). The following depicts the "On-disk" metadata layout:+next arena). The following depicts the "On-disk" metadata layout:: - Backing Store +-------> Arena-+---------------+ | +------------------+-| | | | Arena info block |-| Arena 0 +---+ | 4K |-| 512G | +------------------+-| | | |-+---------------+ | |-| | | |-| Arena 1 | | Data Blocks |-| 512G | | |-| | | |-+---------------+ | |-| . | | |-| . | | |-| . | | |-| | | |-| | | |-+---------------+ +------------------+- | |- | BTT Map |- | |- | |- +------------------+- | |- | BTT Flog |- | |- +------------------+- | Info block copy |- | 4K |- +------------------++ Backing Store +-------> Arena+ +---------------+ | +------------------++ | | | | Arena info block |+ | Arena 0 +---+ | 4K |+ | 512G | +------------------++ | | | |+ +---------------+ | |+ | | | |+ | Arena 1 | | Data Blocks |+ | 512G | | |+ | | | |+ +---------------+ | |+ | . | | |+ | . | | |+ | . | | |+ | | | |+ | | | |+ +---------------+ +------------------++ | |+ | BTT Map |+ | |+ | |+ +------------------++ | |+ | BTT Flog |+ | |+ +------------------++ | Info block copy |+ | 4K |+ +------------------+ 3. Theory of Operation-----------------------+====================== a. The BTT Map@@ -79,31 +80,37 @@+======== =============================================================+31 - 30 Error and Zero flags - Used in the following way: + == == ====================================================+ 31 30 Description+ == == ====================================================+ 0 0 Initial state. Reads return zeroes; Premap = Postmap+ 0 1 Zero state: Reads return zeroes+ 1 0 Error state: Reads fail; Writes clear 'E' bit+ 1 1 Normal Block – has valid postmap+ == == ==================================================== -29 - 0 : Mappings to internal 'postmap' blocks+Postmap ABA The block number in the "Data Blocks" area obtained after indirection from the map-nfree : The number of free blocks that are maintained at any given time.+nfree The number of free blocks that are maintained at any given time. This is the number of concurrent writes that can happen to the arena.+============ ================================================================ For example, after adding a BTT, we surface a disk of 1024G. We get a read for@@ -121,19 +128,21 @@+======== =====================================================================+lba The premap ABA that is being written to+old_map The old postmap ABA - after 'this' write completes, this will be a free block.-new_map : The new postmap ABA. The map will up updated to reflect this@@ -147,8 +156,10 @@ c. The concept of lanes While 'nfree' describes the number of concurrent IOs an arena can process concurrently, 'nlanes' is the number of IOs the BTT device as a whole can-process.- nlanes = min(nfree, num_cp@@ -180,10 +191,10 @@ e. In-memory data structure: map locks -------------------------------------- Consider a case where two writer threads are writing to the same LBA. There can-be a race in the following sequence of steps:+be a race in the following sequence of steps:: -free[lane] = map[premap_aba]-map[premap_aba] = postmap_aba+ free[lane] = map[premap_aba]+ map[premap_aba] = postmap_aba Both threads can update their respective free[lane] with the same old, freed postmap_aba. This has made the layout inconsistent by losing a free entry, and@@ -202,6 +213,7 @@ On startup, we analyze the BTT flog to create our list of free blocks. We walk through all the entries, and for each lane, of the set of two possible 'sections',.@@ -228,7 +240,7 @@ Write: 1. Convert external LBA to Arena number + pre-map ABA 2. Get a lane (and take lane_lock) 3. Use lane to index into in-memory free list and obtain a new block, next flog- index, next sequence number+ index, next sequence number 4. Scan the RTT to check if free block is present, and spin/wait if it is. 5. Write data to this free block 6. Read map to get the existing post-map ABA entry for this pre-map ABA@@ -245,6 +257,7 @@ Write:).@@ -263,11 +276,10 @@:+For example, the ndctl command line to setup a btt with a 4k sector size is:: ndctl create-namespace -f -e namespace0.0 -m sector -l 4k See ndctl create-namespace --help for more options. [1]: --git a/Documentation/nvdimm/index.rst b/Documentation/nvdimm/index.rstnew file mode 100644index 000000000000..1a3402d3775e--- /dev/null+++ b/Documentation/nvdimm/index.rst@@ -0,0 +1,12 @@+:orphan:++===================================+Non-Volatile Memory Device (NVDIMM)+===================================++.. toctree::+ :maxdepth: 1++ nvdimm+ btt+ securitydiff --git a/Documentation/nvdimm/nvdimm.txt b/Documentation/nvdimm/nvdimm.rstsimilarity index 60%rename from Documentation/nvdimm/nvdimm.txtrename to Documentation/nvdimm/nvdimm.rstindex 1669f626b037..08f855cbb4e6 100644--- a/Documentation/nvdimm/nvdimm.txt+++ b/Documentation/nvdimm/nvdimm.rst@@ -1,8 +1,14 @@- LIBNVDIMM: Non-Volatile Devices- libnvdimm - kernel / libndctl - userspace helper library- linux-nvdimm@lists.01.org- v13+===============================+LIBNVDIMM: Non-Volatile Devices+=============================== +libnvdimm - kernel / libndctl - userspace helper library++linux-nvdimm@lists.01.org++Version 13++.. contents: Glossary Overview@@ -40,49 +46,57 @@ Glossary-------------------+======== The LIBNVDIMM subsystem provides support for three types of NVDIMMs, namely, PMEM, BLK, and NVDIMM devices that can simultaneously support both PMEM@@ -96,19 +110,30 @@ accessible via BLK. When that occurs a LABEL is needed to reserve DPA for exclusive access via one mode a time. Supporting Documents-ACPI 6: Namespace: Interface Example: Writer's Guide: 6:+ Namespace:+ Interface Example:+ Writer's Guide:+ Git Trees-LIBNVDIMM::: LIBNVDIMM PMEM and BLK-------------------+====================== Prior to the arrival of the NFIT, non-volatile memory was described to a system in various ad-hoc ways. Usually only the bare minimum was@@ -122,38 +147,39 @@ For each NVDIMM access method (PMEM, BLK), LIBNVDIMM provides a block device driver: 1..?---------+======== While PMEM provides direct byte-addressable CPU-load/store access to NVDIMM storage, it does not provide the best system RAS (recovery,@@ -162,12 +188,15 @@+-----------+ BLK-apertures solve these RAS problems, but their presence is also the major contributing factor to the complexity of the ND subsystem. They complicate the implementation because PMEM and BLK alias in DPA space.@@ -185,13 +214,14 @@ carved into an arbitrary number of BLK devices with discontiguous extents. BLK-REGIONs, PMEM-REGIONs, Atomic Sectors, and DAX---------------------------------------------------+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^@@ -200,52 +230,52 @@ LIBNVDIMM/NDCTL: Block Translation Table "btt" Example NVDIMM Platform------------------------+======================= For the remainder of this document the following diagram will be-referenced for any example sysfs layouts.). 1.. 2.". CONFIG_NFIT_TEST is enabled and@@ -254,7 +284,7 @@ by a region device with a dynamically assigned id (REGION0 - REGION5). LIBNVDIMM Kernel Device Model and LIBNDCTL Userspace API-----------------------------------------------------+======================================================== What follows is a description of the LIBNVDIMM sysfs layout and a corresponding object hierarchy diagram as viewed through the LIBNDCTL@@ -263,12 +293,18 @@ NVDIMM Platform which is also the LIBNVDIMM bus used in the LIBNDCTL unit test. LIBNDCTL: Context+-----------------+ Every API call in the LIBNDCTL library requires a context that holds the logging parameters and other library instance state. The library is based on the libabc template:- LIBNDCTL: instantiate a new library context example+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^++:: struct ndctl_ctx *ctx; @@ -278,7 +314,7 @@ LIBNDCTL: instantiate a new library context example return NULL; LIBNVDIMM/LIBNDCTL: Bus--------------------+----------------------- A bus has a 1:1 relationship with an NFIT. The current expectation for ACPI based systems is that there is only ever one platform-global NFIT.@@ -288,9 +324,10 @@ we use this capability to test multiple NFIT configurations in the unit test. LIBNVDIMM: control class device in /sys/class+--------------------------------------------- This character device accepts DSM messages to be passed to DIMM-identified by its NFIT handle.+identified by its NFIT handle:: /sys/class/nd/ndctl0 |-- dev@@ -300,10 +337,15 @@ identified by its NFIT handle. LIBNVDIMM: bus+--------------++:: struct nvdimm_bus *nvdimm_bus_register(struct device *parent, struct nvdimm_bus_descriptor *nfit_desc); +::+ /sys/devices/platform/nfit_test.0/ndbus0 |-- commands |-- nd@@ -324,7 +366,9 @@ LIBNVDIMM: bus `-- wait_probe LIBNDCTL: bus enumeration example-Find the bus handle that describes the bus from Example NVDIMM Platform+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^++Find the bus handle that describes the bus from Example NVDIMM Platform:: static struct ndctl_bus *get_bus_by_provider(struct ndctl_ctx *ctx, const char *provider)@@ -342,7 +386,7 @@ Find the bus handle that describes the bus from Example NVDIMM Platform LIBNVDIMM/LIBNDCTL: DIMM (NMEM)----------------------------+------------------------------- The DIMM device provides a character device for sending commands to hardware, and it is a container for LABELs. If the DIMM is defined by@@ -355,11 +399,16 @@ Range Mapping Structure", and there is no requirement that they actually be physical DIMMs, so we use a more generic name. LIBNVDIMM: DIMM (NMEM)+^^^^^^^^^^^^^^^^^^^^^^++:: struct nvdimm *nvdimm_create(struct nvdimm_bus *nvdimm_bus, void *provider_data, const struct attribute_group **groups, unsigned long flags, unsigned long *dsm_mask); +::+ /sys/devices/platform/nfit_test.0/ndbus0 |-- nmem0 | |-- available_slots@@ -384,15 +433,20 @@ LIBNVDIMM: DIMM (NMEM) LIBNDCTL: DIMM enumeration example+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^)@@ -413,7 +467,7 @@ Bit 31:28 Reserved dimm = get_dimm_by_handle(bus, DIMM_HANDLE(0, 0, 0, 0, 0)); LIBNVDIMM/LIBNDCTL: Region-----------------------+-------------------------- A generic REGION device is registered for each PMEM range or BLK-aperture set. Per the example there are 6 regions: 2 PMEM and 4 BLK-aperture@@ -435,13 +489,15 @@ emits, "devtype" duplicates the DEVTYPE variable stored by udev at the at the 'add' event, and finally, the optional "spa_index" is provided in the case where the region is defined by a SPA. -LIBNVDIMM: region@@ -468,10 +524,11 @@ LIBNVDIMM: region [..] LIBNDCTL: region enumeration example+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Sample region retrieval routines based on NFIT-unique data like "spa_index" (interleave set id) for PMEM and "nfit_handle" (dimm id) for-BLK.+BLK:: static struct ndctl_region *get_pmem_region_by_spa_index(struct ndctl_bus *bus, unsigned int spa_index)@@ -518,33 +575,33 @@ REGION name generic and expects userspace to always consider the region-attributes for four reasons: 1.. 2.. 3.. 4. There are more robust mechanisms for determining the major type of a- region than a device name. See the next section, How Do I Determine the- Major Type of a Region?+ region than a device name. See the next section, How Do I Determine the+ Major Type of a Region? How Do I Determine the Major Type of a Region? ----------------------------------------------@@ -553,7 +610,8 @@ Outside of the blanket recommendation of "use libndctl", or simply looking at the kernel header (/usr/include/linux/ndctl.h) to decode the "nstype" integer attribute, here are some other options. - 1. module alias lookup:+1. module alias lookup+^^^^^^^^^^^^^^^^^^^^^^ The whole point of region/namespace device type differentiation is to decide which block-device driver will attach to a given LIBNVDIMM namespace.@@ -569,28 +627,31 @@ looking at the kernel header (/usr/include/linux/ndctl.h) to decode the the resulting namespaces. The output from module resolution is more accurate than a region-name or region-devtype. - 2. udev:+2. udev+^^^^^^^ -+ The kernel "devtype" is registered in the udev database:: - #:+3. type specific attributes+^^^^^^^^^^^^^^^^^^^^^^^^^^^ As it currently stands a BLK-aperture region will never have a "nfit/spa_index" attribute, but neither will a non-NFIT PMEM region. A@@ -600,7 +661,7 @@ looking at the kernel header (/usr/include/linux/ndctl.h) to decode the LIBNVDIMM/LIBNDCTL: Namespace--------------------------+----------------------------- A REGION, after resolving DPA aliasing and LABEL specified boundaries, surfaces one or more "namespace" devices. The arrival of a "namespace"@@ -608,12 +669,14 @@ device currently triggers either the nd_blk or nd_pmem driver to load and register a disk/block device. LIBNVDIMM: namespace+^^^^^^^^^^^^^^^^^^^^+ Here is a sample layout from the three major types of NAMESPACE where namespace0.0 represents DIMM-info-backed PMEM (note that it has a 'uuid' attribute), namespace2.0 represents a BLK namespace (note it has a 'sector_size' attribute) that, and namespace6.0 represents an anonymous PMEM namespace (note that has no 'uuid' attribute due to not support a-LABEL).+LABEL):: /sys/devices/platform/nfit_test.0/ndbus0/region0/namespace0.0 |-- alt_name@@ -656,76 +719,84 @@ LABEL). `-- uevent LIBNDCTL: namespace enumeration example+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Namespaces are indexed relative to their parent region, example below. These indexes are mostly static from boot to boot, but subsystem makes no guarantees in this regard. For a static namespace identifier use its 'uuid';+ static struct ndctl_namespace+ *get_namespace_by_id(struct ndctl_region *region, unsigned int id)+ {+ struct ndctl_namespace *ndns; - return NULL;-}+ ndctl_namespace_foreach(region, ndns)+ if (ndctl_namespace_get_id(ndns) == id)+ return ndns;++ return NULL;+ } LIBNDCTL: namespace creation example+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^+ 'uuid' must be set before 'size'. This enables the kernel to track DPA allocations-internally with a static identifier.+internally with a static identifier:: -static int configure_namespace(struct ndctl_region *region,- struct ndctl_namespace *ndns,- struct namespace_parameters *parameters)-{- char devname[50];+ static int configure_namespace(struct ndctl_region *region,+ struct ndctl_namespace *ndns,+ struct namespace_parameters *parameters)+ {+ char devname[50]; - snprintf(devname, sizeof(devname), "namespace%d.%d",- ndctl_region_get_id(region), paramaters->id);+"?+^^^^^^^^^^^^^^^^^^^^^^^^^ 1. Why not "volume" for instance? "volume" ran the risk of confusing- ND (libnvdimm subsystem) to a volume manager like device-mapper.+ ND (libnvdimm subsystem) to a volume manager like device-mapper. 2. The term originated to describe the sub-devices that can be created- within a NVME controller (see the nvme specification:-), and NFIT namespaces are- meant to parallel the capabilities and configurability of- NVME-namespaces.+ within a NVME controller (see the nvme specification:+), and NFIT namespaces are+ meant to parallel the capabilities and configurability of+ NVME-namespaces. LIBNVDIMM/LIBNDCTL: Block Translation Table "btt"----------------------------------------------+------------------------------------------------- A BTT (design document:) is a stacked block device driver that fronts either the whole block device or a partition of a block device emitted by either a PMEM or BLK NAMESPACE. LIBNVDIMM: btt layout+^^^^^^^^^^^^^^^^^^^^^+.+nd_blk driver depending on the region type:: /sys/devices/platform/nfit_test.1/ndbus0/region0/btt0/ |-- namespace@@ -739,10 +810,12 @@ nd_blk driver depending on the region type. `-- uuid LIBNDCTL: btt creation example+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^+.+finding and idle BTT and assigning it to consume a PMEM or BLK namespace:: static struct ndctl_btt *get_idle_btt(struct ndctl_region *region) {@@ -787,29 +860,28 @@ Summary LIBNDCTL Diagram ------------------------ |+ +---------+ +--------------+ +---------------+------+diff --git a/Documentation/nvdimm/security.txt b/Documentation/nvdimm/security.rstsimilarity index 99%rename from Documentation/nvdimm/security.txtrename to Documentation/nvdimm/security.rstindex 4c36c05ca98e..ad9dea099b34 100644--- a/Documentation/nvdimm/security.txt+++ b/Documentation/nvdimm/security.rst@@ -1,4 +1,5 @@-NVDIMM SECURITY+===============+NVDIMM Security =============== 1. Introduction@@ -138,4 +139,5 @@ This command is only available when the master security is enabled, indicated by the extended security status. [1]: [2]: --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfigindex 54500798f23a..e89c1c332407 100644--- a/drivers/nvdimm/Kconfig+++ b/drivers/nvdimm/Kconfig@@ -33,7 +33,7 @@ config BLK_DEV_PMEM Documentation/admin-guide/kernel-parameters.rst). This driver converts these persistent memory ranges into block devices that are capable of DAX (direct-access) file system mappings. See- Documentation/nvdimm/nvdimm.txt for more details.+ Documentation/nvdimm/nvdimm.rst for more details. Say Y if you want to use an NVDIMM -- 2.21.0
|
https://lkml.org/lkml/2019/6/12/1106
|
CC-MAIN-2020-05
|
en
|
refinedweb
|
import "go.chromium.org/luci/logdog/appengine/coordinator/config"
config.go projects.go settings.go
var ( // ErrInvalidConfig is returned when the configuration exists, but is invalid. ErrInvalidConfig = errors.New("invalid configuration") )
ActiveProjects returns a full list of all config service projects with LogDog project configurations.
The list will be alphabetically sorted.
ActiveUserProjects returns a full list of all config service projects with LogDog project configurations that the current user can see.
The list will be alphabetically sorted.
ProjectConfig loads the project config protobuf from the config service.
This function will return:
- nil, if the project exists and the configuration successfully loaded - config.ErrNoConfig if the project configuration was not present. - ErrInvalidConfig if the project configuration was present, but could not be loaded. - Some other error if an error occurred that does not fit one of the previous categories.
ProjectConfigPath returns the path of the project-specific configuration. This path should be used with a project config set.
A given project's configuration is named after the current App ID.
ProjectNames returns a sorted list of the names of all of the projects that the supplied authority can view.
ServiceConfigPath returns the config set and path for this application's service configuration.
type Config struct { svcconfig.Config // Settings are per-instance settings. Settings Settings // ConfigServiceURL is the config service's URL. ConfigServiceURL url.URL `json:"-"` // ConfigSet is the name of the service config set that is being used. ConfigSet config.Set `json:"-"` // ServiceConfigPath is the path within ConfigSet of the service // configuration. ServiceConfigPath string `json:"-"` }
Config is the LogDog Coordinator service configuration.
Load loads the service configuration. This includes:
- The config service settings. - The service configuration, loaded from the config service. - Additional Settings data from datastore via settings.
The service config is minimally validated prior to being returned.
type Settings struct { // BigTableServiceAccountJSON, if not empty, is the service account JSON file // data that will be used for BigTable access. // // TODO(dnj): Remove this option once Cloud BigTable has cross-project ACLs. BigTableServiceAccountJSON []byte `json:"bigTableServiceAccountJson"` }
Settings is the LogDog Coordinator auxiliary (runtime) settings. These are stored within a given datastore instance, rather than in luci-config, due to their sensitivity.
Load populates the settings instance from the stored settings.
If no settings are stored, an empty Settings instance will be loaded and this will return nil.
An error will be returned if an operation that is expected to succeed fails.
Store stores the new global configuration.
Validate validates the correctness of this configuration, returning an error if it's invalid.
Note that only the contents saved to settings are validated. The read-only configuration is not.
Package config imports 11 packages (graph) and is imported by 8 packages. Updated 2020-01-18. Refresh now. Tools for package owners.
|
https://godoc.org/go.chromium.org/luci/logdog/appengine/coordinator/config
|
CC-MAIN-2020-05
|
en
|
refinedweb
|
On the GotDotNet.com message boards, GeFIN asks how to create a unique ID using XML.
There are several ways to accomplish this. For instance, you could use the classes in the System.Xml namespace to load the document, select the nodes from the document, sort them, then get the value of the last node in the node list. You might simply generate a Guid for each node and use that new value. You could retrieve a value from a database, using something like Oracle’s sequences, or you could use SQL Server’s XML capabilities to shred the document and handle the autoincrement the IDs internally.
Let’s look at some ways that we can leverage XSLT to accomplish this task.
The first (and likely simplest) means of generating IDs is to use XSLT’s generate-id() function to append arbitrary unique IDs to each node. We use the XSLT identity transformation:
Given the instance document:
The output result is:
In the above example, we generated unique IDs for each node. Further runs of this transformation might provide different IDs for each node, which might not be acceptable. In GeFIN’s case, he actually desired the ability to use some type of an autoincrement. Using an autoincrement naturally assumes knowledge of the last maximum value used. While XSLT does not provide a means to find a maximum value, this problem has already been addressed in several ways. EXSLT provides a max function to get a max value from a nodeset. Dimitre Novatchev’s FXSL also provides a simple means of retrieving a maximum value. Let’s look at developing our own solution using a recursive named template that implements a recursive quick sort algorithm.
The result is:
The max value is:8
The next value is:9
This is the nice, traditional recursive max() implementation.
There could be a problem that some XSLT processors could go out of stack quickly for big number of nodes.
For an alternative implementation of max(), which avoids this problem and has linear time complexity and is quite fast, see:
=====
Cheers,
Dimitre Novatchev. — the home of FXSL
|
https://blogs.msdn.microsoft.com/kaevans/2003/03/28/using-autoincrement-for-an-xml-document/
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
Hi all, Consider code: long int foo (double a) { return __builtin_round (a); }Compiling for aarch64-none-elf (bare-metal aarch64 with newlib as C-library) with -O2 gives the 003t.original dump:
;; Function foo (null) ;; enabled by -tree-original { return (long int) __builtin_round (a); }whereas compiling for aarch64-none-linux-gnu (linux target with glibc) gets translated into:
;; Function foo (null) ;; enabled by -tree-original { return __builtin_lround (a); }These end up taking different codepaths through the compiler () because __builtin_lround has to take -fmath-errno into account and does not end up getting inlined (generating a call to the library lround).
__builtin_round, however, is defined everywhere and ends up getting expanded to a__builtin_round, however, is defined everywhere and ends up getting expanded to a
rounddf optab + (set r:DI (fix:DI (r:DF)))which then later gets combined into the expansion we've got for the lrounddfdi2 optab
Is that correct/expected behaviour?I tried grepping around the gcc sources but I'm not familiar with code that would do the frontend transformation mentioned above.
Thanks, Kyrill
|
http://gcc.gnu.org/ml/gcc/2014-07/msg00048.html
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Please sign up to be able to read, comment and contribute to our website.
For many people, Brexit is mainly a political decision, However the debate over it happens mainly in the economic realm, and yet few people understand what actually is at stake here.
Contrary to what you might believe, the Brexit discussion is not about the UK versus the EU, or to be precise not as much as you’d have thought. Much as the EU has become a political union, in truth the stakes here are mainly economical. The politics are just a tool to serve certain economical interests.
In the Brexit debacle, it is important to understand the main actors who are not, as you might have thought, the Brits versus the Eurocrats.
The main conflict is actually a capitalist structural issue, namely a fight between the manufacturing/trade sector and the financial/banking sector.
The discussion is about whether Britain should be a manufacturing economy or a service one. It is a long standing economic debate, ad much as I am not an economist I will still endeavour to explain what’s happening behind your backs.
The trade/manufacturing sector has been the engine of western progress for centuries. I’s about real work with tangible results that creates real progress, real money, real jobs. Because it is a real sector, however, it has drawbacks, namely that it requires tools, facilities and people in order to achieve success and create profit.
Which means that it’s expensive, and since it is based in real world, it is also uncertain.
In the Brexit debacle, the manufacturing/trade sector is the engine behind the Leave campaign.
This is because it is actually better for Britain from an manufacturing/trade POV to be outside of the EU. Why, you ask?
Because the EU is a stifling mechanism whose purpose is to create a prisoner market for the non global competitive economies of the original members. The purpose of the endless regulations and rules and tariffs is to ensure only certain countries and companies can make a profit, at the cost to the European taxpayer’s pocket and well being.
British trade and manufacturing have been shackled by European regulations for 40 years, because the needs of the German and French economies are more important to the EU than those of any other country, and significantly above the needs and interests of the European citizens.
This actually means that progress and wealth have been siphoned out of the European taxpayer’s pockets and the non original 6 members’ economies to prop the otherwise shabby German industry and French agriculture.
Example: Solar power cells are an easy to use mean for the average citizen to reduce their electricity bill while maintaining their standard of living. So why, will you ask, doesn’t everybody have solar panels on their house?
That’s very simple- because the power cells are expensive. Too expensive to actually be accessible to the average Joe.
But why are they expensive, you ask? Because the EU imposed onerous tariffs on Chinese made power cells, so as to not be able to compete with the German made power cells.
So you can’t buy affordable power cells because the EU decided that the interests of the ailing German industry are more important than your prosperity. The average Joe won’t get solar panels on their house. He will pay extra every month for his electricity consumption which feeds both the utilities companies and keeps in business the German producers.
Who loses here? Absolutely everybody- the European taxpayer, the environment and the global trade. We are talking money stolen out of your pockets to keep the German industry going, which allows Germany to claim the preeminent role in the EU’s decision making chambers and as such continue to pass economic measures that every day siphon money from your pockets to pay the wages of Guy Verhofstadt, Schauble and Juncker, and ensure no country will be able to progress enough to overtake and overturn the German grip on Europe.
In the automotive sector, we see clearly how the EU
manipulates the market to serve the German auto industry. This is being achieved by the following
means:
1.
EU regulations and standards who are written for
the purpose of protecting the French and German auto industries.
These standards are written in such a way that it is almost impossible
for a non German/French automotive company to compete with German/French cars.
Any automotive producer who wants to compete on the European market will
have to obey the stringent EU regulations and standards- so they will either
have to make huge investments in the necessary infrastructure- which will bring
the prices up and thus make them uncompetitive.
2.
Import tariffs that make it very inconvenient to
import non EU made vehicles, thus giving the EU the advantage on the market. The best selling cars in the EU are all EU
made- because it is impossible to get inside the EU market from outside.
Most big automotive companies circumvented this by establishing
manufacturing facilities in the EU, but the result is that there is a certain
price level that is being maintain by everybody.
Which means you the consumer will pay what you’re told although there are
cheaper cars out there that would make your life easier, but you don’t get
access to them because you have to feed the German/French car industries.
3.
Prohibitive eco regulation to prevent the import
of cheap/ old cars.
This is especially nasty to the poorest consumers on the market-
especially the working class. The EU regulations ensure that unless you buy an
EU made car you will be taxed to high heaven for the privilege. This has little
to do with environment concerns but a lot to do with protectionism- again at
the cost of the European taxpayer.
The list could go on, but hopefully this will explain the
stranglehold the EU has on its member economies. While the newer smaller
members make a certain bit of profit from this – of course, after they sold
their national industries to German/French corporations, a trading and
manufacturing economy like Britain will suffer from these shackles.
Furthermore, we have seen that the EU has actually been
taking active steps to steal British jobs and ship them abroad. While the
practice of buying companies just to close them down to reduce the risk to
German/French fields is well known- see the Ebb Vale case in which the local
coal plant was bought by a French company in the aughts only to be immediately
closed down and leave a whole region without its main jobs source. Ebb Vale continues to remain in the 10
poorest regions of Western Europe.
The EU effectively murdered the British coal extraction
industry condemning whole regions to poverty. It did the same to the Dutch coalmining
industry and is in the process of killing the mining industry of Romania as
well, albeit the large coal deposits in the Carpathians could easily support
Europe, still largely depending on coal, for the next few centuries.
Forty years after the coal mines in the south of Limburg were closed, Heerlen and its adjacent areas are still suffering economically. The EU who is very good at closing companies down, only cares about creating new jobs in Germany, France and Eastern Europe, and it wouldn't really care about Eastern Europe if work there wasn't so much cheaper.
While the EU is very keen on reducing the coal extraction in
the EU for “environmental” reasons, these reasons don’t seem to apply to the
German mining field in the Ruhr and the German owned coal mining sector of
Poland.
It’s almost as if you’re only allow to exploit your country’s
resources if Germany gets to profit from it, and fuck you if you don’t like it.
The need for coal continues to exist. It is arguably worse
for the environment to import coal from outside the EU, but as it happens the
main importers are German companies… and nobody cares about the coal mining
regions that are still suffering from the massacre inflicted upon them by
German interests.
Here’s a very important phrase you need to remember in all
this discussion- per Wikipedia
When
disregarding subsidies and externalities, coal has the lowest average cost in EU. Coal has the highest external cost.[5]
So the actual costs of importing coal are being passed
upon YOU the consumer. The jobs loss are burdening communities all across
Europe. Who profits?
Germany of course, who has no problem using coal and
extracting it, as long as other countries obey the rules Germany is too good to
Think about that.
The technology to capture the pollutants resulting from
coal burning exists, but has been stalled and repeatedly defunded by the EU for
decades. As an effect of the EU stepping in and taking over the funding on any non
corporate R&D, they get to decide what gets researched and what doesn’t.
The aggressive policy of closing down the coal mines
across Europe has led to loss of jobs and poverty for millions of people. Funny
how the Dutch, British and Romanian miners can be left to starve, but not the
German miners.
Europe continues to use coal as its main source of
energy. Importing coal from outside increases the costs exponentially, creates
bigger long term environment problems and costs millions of Europeans their
jobs.
If you enjoy our work, please share it on your medium of choice.
While we are a free site and make no money from traffic, more visitors mean a larger the number of people who get to see an alternative view.
Thank you
|
http://politicalpragmatism.com/viewpost.php?id=562
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
Odoo Help
Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
on_change event won't go into loop
I'm currently making a module for a pharmaceutical company.
When one of the representitives gives out samples to the doctors they have to register it in openerp. Every doctor only gets 8 samples of any product a year. so when they add a sample to openerp they need to supply a product, quantity and parent_id, date is automatic today.
i can get the information from the current form and add it to the raise osv.except_osv event. but it only outputs the data of the form no sum of all the quantity's. so it seems that the function doesn't go into the loop.
here is my code
samples.py
def on_change_quantity(self, cr, uid, ids, quantity, parent ,product , context=None): if parent: currentYear = datetime.now().year totaal=quantity for item in self.browse(cr, uid, ids): if parent==item.parent_id: if currentYear==item.year: if product==item.product_id: totaal=sum([rec.quantity for rec in self.browse(cr, uid, ids)]) raise osv.except_osv(('fout'), (totaal) )
samples.xml
<field name="quantity" on_change="on_change_quantity(quantity,parent_id,product_id)"/>
If you try to count the amount of the same product for one doctor in one year, change
totaal=sum([rec.quantity for rec in self.browse(cr, uid, ids)])
to
totaal += 1
Or instead of the nested ifs use the search method:
def on_change_quantity(self, cr, uid, ids, quantity, parent ,product , context=None): if parent: currentYear = datetime.now().year totaal=quantity rec_ids = self.search(cr, uid, [('id','!=',ids[0]), ('parent_id','=',parent), ('year','=',currentYear), ('product_id','=',product)]); total += sum([rec.quantity for rec in self.browse(cr, uid, rec_ids, context=context)])
Hope that helps somehow.
About This Community
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|
https://www.odoo.com/forum/help-1/question/on-change-event-won-t-go-into-loop-47708
|
CC-MAIN-2017-51
|
en
|
refinedweb
|
signet 1.0.11
Signet provides support for building and delivering tamper resistant python to your users and customers.
FULL HTML Documentation:
Signet provides support for building and delivering tamper resistant python to your users and customers.
Signet creates a custom python loader which you deliver with your script. On each invocation, the loader will verify no tampering has ocurred before it runs the python script.
Users have the confidence of knowing their scripts are safe and yet retain full access to the python source for code review and enhancement. And you know your users are running the right version of code.
Signet is fully integrated with distutils to make the process of building and installing new python projects as simple and painless as possible.
How does it work?
Signet relies on the strength of cryptographic hash to reliably detect file modifications. Signet builds hashes of your script and all it’s dependencies. These hashes are incorporated into a custom python loader which will handle re-verifying the hashes before it will run your script.
If your script or any of it’s dependencies are tampered with, the loader will emit an error and exit. If everything matches, the loader will run your script.
Example usage
For example, if you had a simple script hello.py:
import os print('hello from %s' % os.name)
And you deployed it with this simple setup.py:
from distutils.core import setup, Extension from signet.command.build_signet import build_signet setup(name = 'hello', cmdclass = {'build_signet': build_signet, }, ext_modules = [Extension('hello', sources=['hello.py'])], )
Build your loader:
python setup.py build_signet
On Windows you’ll have hello.exe and on Linux you’ll have hello.
The signet system also provides facilities for code signing:
from distutils.core import setup, Extension from signet.command.build_signet import build_signet, sign_code setup(name = 'hello', cmdclass = {'build_signet': build_signet, 'sign_code': sign_code, }, ext_modules = [Extension('hello', sources=['hello.py'])], )
Build your loader:
python setup.py build_signet python setup.py sign_code --savedpassword --pfx-file {path-to-pfx}
Installing Signet
Signet is hosted on github at
Installation using git:
git clone cd signet python setup.py install
Signet can also be installed with pip:
pip install signet
Features
- Multiplatform: works under
- Windows (32/64-bit)
- Linux
- FreeBSD
- Integrated with Distutils
- Protection from tampering (SHA1 hashed content)
- On Windows
- Provides code signing executables
- PE executable verification
- Automatic resource file generation
- Customizable program icon
- Customizable python loader (full c++ included)
- Unique process name
- show hello rather than python hello.py
- Downloads (All Versions):
- 18 downloads in the last day
- 183 downloads in the last week
- 606 downloads in the last month
- Author: Jim Carroll
- Download URL:
- License: Signet is licensed under the 3-clause BSD License
- Categories
- Development Status :: 5 - Production/Stable
- Environment :: Console
- Intended Audience :: Developers
- License :: OSI Approved :: BSD License
- Natural Language :: English
- Operating System :: OS Independent
- Topic :: Security
- Topic :: Software Development :: Build Tools
- Topic :: System :: Software Distribution
- Package Index Owner: jamercee
- DOAP record: signet-1.0.11.xml
|
https://pypi.python.org/pypi/signet/1.0.11
|
CC-MAIN-2015-40
|
en
|
refinedweb
|
See:
Description
Provides low-level introspective services.
This internal package is not intended for public usage and there is no guarantee that its public classes or methods will remain as is in subsequent versions.
The IntrospectorBase, ClassMap, MethodKey, MethodMap form the base of the introspection service. They allow to describe classes and their methods, keeping them in a cache (@see IntrospectorBase) to speed up property getters/setters and method discovery used during expression evaluation.
The cache materialized in Introspector creates one entry per class containing a map of all accessible public methods keyed by name and signature.
|
http://commons.apache.org/proper/commons-jexl/apidocs/org/apache/commons/jexl2/internal/introspection/package-summary.html
|
CC-MAIN-2015-40
|
en
|
refinedweb
|
I'm making my first foray into a sound engine and I'm using SlimDX in order to allow me access to DirectX in C#. I dug around and found a couple of tutorials which got me started and when playing a file from a file, everything is fine. However I also want to look at playing a file from a memory stream (loaded with the contents of a file, stored in a byte array) as I don't want to have to access the hard drive for playing sounds in quick succession.
In doing so I appear to have stumbled across an issue with sound corruption. I'm able to reproduce it 100% of the time on both my home machine and my work machine (both Windows 7) but it only happens with certain files and in a certain order. In this particular case, see the attached file, sounds.zip which contains two files, klaxon2.wav (sounds like the red alert sound from star trek) and warn2.wav (the word warning repeated three times).
The easiest way to describe the issue is to demonstrate the code I'm using to load and play, and the test procedure. I've boiled down the code from my main project to a fairly simple test class:
public class SoundPlayer { private XAudio2 m_device = new XAudio2(); private SourceVoice m_sourceVoice = null; public SoundPlayer() { MasteringVoice masteringVoice = new MasteringVoice(m_device); } public void Load(string fileName) { WaveStream waveStream = new WaveStream(fileName); Load2(string fileName) { byte[] fileData = File.ReadAllBytes(fileName); MemoryStream ms = new MemoryStream(fileData); WaveStream waveStream = new WaveStream(ms); Play() { Thread t = new Thread(PlayMethod); t.Start(); } private void PlayMethod() { m_sourceVoice.Start(); while (m_sourceVoice.State.BuffersQueued > 0) { Thread.Sleep(10); } m_sourceVoice.Dispose(); m_device.Dispose(); } }
So the idea is load the sound clip into a class and call play. It will play itself in a thread and finish. Please keep in mind that this is a very bare bones example from what's in my main project. Things like proper thread management and object clean-up were not a priority, just reproducing the issue in order to post it here for help (though I'm certainly open to pointers and advice... first timer with sounds after all).
Anyway, stick this class in a project somewhere and, using the attached sounds, use the following code to run it:
SoundPlayer p1 = new SoundPlayer(); SoundPlayer p2 = new SoundPlayer(); SoundPlayer p3 = new SoundPlayer(); p1.Load2(@"..\..\klaxon2.wav"); p2.Load2(@"..\..\klaxon2.wav"); p3.Load2(@"..\..\warn2.wav"); p1.Play();(NOTE: Replace the path with whatever directory you unzipped the files in.)
What seems to happen is that when p1 is played, it plays a slowed down version of warn2 until warn2 is finished, then plays the rest of klaxon2 until klaxon2 is finished. If I were to use the Load method instead of Load2, it would work fine. If I were to not load two copies of klaxon2, it would work fine. If I were to load two copies of klaxon2 but no warn2, it would work fine. In my tests I've found a few other examples of the problem but for the most part, it's an issue that's hard to reproduce. When you do find a way to reproduce it you can always reproduce it. If that makes any sense... bleh.
As you can see, the way in which I'm loading the stream isn't terribly complex, so I'm not sure what I could be doing wrong. The file data is copied out of the file and put into a new memory stream every time so there shouldn't be any corruption. Can anybody see anything wrong with what I'm doing? Note that I'm certainly not set on this method of playback either... if there was an alternative, I'm interested. I'm also curious as to whether or not it's possible there is an issue with SlimDX, and how one might go about reporting the issue if this is the case.
Again, any help is appreciated as this one has me banging my head on the keyboard.
Thank you!!
|
http://www.gamedev.net/topic/618436-corruption-when-playing-sound-via-memory-stream-xaudio2/
|
CC-MAIN-2015-40
|
en
|
refinedweb
|
I was advocating the use of a "polymorphic" design, where two structures that have the same initial member were aliased:
namespace Commands { enum Type { Foo }; } struct Command { Commands::Type id; }; struct Foo { Commands::Type id; int value; }; //e.g. Foo foo = { Commands::Foo, 1337 }; Command* cmd = (Command*)&foo; switch( cmd->id ) { case Commands::Foo: Foo* fooCmd = (Foo*)cmd; printf( "id = %d, value = %d\n", (int)fooCmd->id, fooCmd->value ); break; }At the time, I thought this violated the strict-aliasing rule, but that the code would produce the intended behaviour anyway. The worst thing that I thought would happen, is that the compiler would generate code that redundantly reads "fooCmd->id", even though it already read "cmd->id" just above.
However, the C++03 wording of the rule is:
If a program attempts to access the stored value of an object through an lvalue of other than one of the following types the behavior is undefined:Does the bold statement mean that I'm not actually breaking the strict aliasing rule here, because the aliased value (i.e. id) is actually the correct type in both structures?
• the dynamic type of the object,
• a cv-qualified version of the dynamic type of the object,
• a type that is the signed or unsigned type corresponding to the dynamic type of the object,
• a type that is the signed or unsigned type corresponding to a cv-qualified version of the dynamic type of the object,
• an aggregate or union type that includes one of the aforementioned types among its members (including, recursively, a member of a subaggregate or contained union),
• a type that is a (possibly cv-qualified) base class type of the dynamic type of the object,
• a char or unsigned char type.
Edited by Hodgman, 01 January 2013 - 08:04 AM.
|
http://www.gamedev.net/topic/636630-strict-aliasing-rule/
|
CC-MAIN-2015-40
|
en
|
refinedweb
|
Daniel Cazzulino (kzu)
2001-06-02
Setting aside theoretical issues for the moment:
Will we have to replicate Microsoft's typed dataset functionality before we have the chance to implement any of these additional features?
Daniel Cazzulino (kzu)
2001-06-03
It wouldn't be a replica, as typed datasets don't allow creation of tables, inheritance between tables for extensibility, nor enum values metaphora for field values (like the Sex case, or some DeliverState field for example). And you have to load them from a DatasetCommand anyway, and that means sending a SQL statement, or executing a stored procedure, not very OO indeed.
From an application point of view, you will still be interacting with a typed dataset, I guess... maybe the bridge should accept these datasets to update the underlying tables, but the idea is to isolate the DB design.
I think the main idea is metadata extensibility (or extensible attributes to fields, put another way) and inheritance at the DB level. If the RDBMS already had these things, there would be no need to think of it.
Think of what happens when you have a simple app, which has a simple Client table, which is accesed from a simple Client class, and you start a new project and need some additional data in the client table. Sure u can reuse the class and inherit it and whatever, but when this class loads itself, if will do so from a table, and u'll have to change this part. And you'll have to duplicate the structure of the Client table to add the fields without disturbing existing apps, or maybe add another table with the additional fields, and make the load method do a join. Or modify all stored procedures.
It sounds to me like we have all the OO power in our hands now, but the DB is becoming the new bottleneck.
The layer will be for sure an assembly, but one that should be built dynamically by the graphic designer, all with its classes, enums, and whatever, hiding the underlying DB tables, SP's and whatever.
It would make my programmer life easier, for sure...
How about these issues?
+ object identity?
Relational databases have no such concept. OO mandates it. You can fudge it by introducing object id keys into tables, but that ruins the purity of the relational model somewhat.
+ cache coherency?
Two applications accessing the same database won't have the same objects. One application could be caching old data in its objects, while the other application may have updated the RDBMS.
+ querying?
It's all well if you could navigate the databases via implicit joins, but there is still the need to make queries, especially across one-to-many relationships, where indexing isn't what we always want. I am really after something that is OO, but with the full expressiveness of SQL.
Daniel Cazzulino (kzu)
2001-06-05
+ object identity?
The adding of ID keys to DB is inevitable, but that doesn't ruin anything, as u'll be interacting with the Bridge objects and the Bridge GUI, not the tables and IDs.
+ cache coherency?
This is the exact problem you will also have when using datasets, loading the results and modifying them... the platform may provide conflict resolution or anything else, but this is independent from the concept. Maybe the resolution method could be another functionality of the Bridge GUI and objects. The platform's objects would't contain data themselves, they would be just that, an OO bridge to the RDBMS, let's say static classes and methods maybe
+ querying?
What do u mean by "indexing"?. This is the scenario I view:
Bridge.Client.FirstName.Filter(FilterType.Equals, "John");
Bridge.Client.PurchaseOrders.DateOrdered.Filter(FilterType.GreaterThan, "01/01/2001");
Bridge.Client.FillDataSet(MyDataSet);
You would have selected the desired records, have the dataset loaded all with the relation between Client->Purchases set in his in-memory data, and all without a clue of which tables you were touching, nor SQL strings and the like. And the Bridge could have executed this through a stored procedure optimized for the type of DB selected.
The best functionality scenario of the Bridge would be:
1- you have a method in which u update the status of a purchase order to "C" which means in your DB "Canceled"
2- At some time, by design, you no longer admit "Canceled" values.
3- The app will continue to compile, but u would have to search all through it to find that status changed.
4- With the Bridge u would have deleted the "Canceled" status from the possible values of the object Purchase.
5- So the line where u changed the order' state now would be Bridge.PurchaseOrder.Status = PurchaseStatus.Canceled
6- After updating the Bridge and the undelying tables, your line of code won't compile again unless u change it, and u would have avoided to have a logic bug somewhere. Just recompiling would tell u if everything is still OK.
Daniel
> Bridge.Client.FirstName.Filter(FilterType.Equals, "John");
Which means?:
SELECT * FROM Client where Client.FirstName = 'John';
So that the return type is?:
Client_Set c = Bridge.Client.FirstName.Filter(FilterType.Equals, "John");
Or should that be?:
Client c = Bridge.Client.FirstName.Filter(FilterType.Equals, "John");
where we are treating the Client class as both the single record and a record set.
The second looks more appealing.
Daniel Cazzulino (kzu)
2001-06-06
Well, I was thinking more in something like this:
Bridge.Client.FirstName.Filter(FilterType.Equals, "John");
Bridge.Client.FillDataSet(MyDataSet);
And this dataset could be a strong typed one generated by the same Bridge, what do u think?
Or it could return a collection of Client objects...
But I see the Bridge classes as interfaces and functions, not data themselves, which could me managed with datasets, I don't know. Maybe there should be Admin classes, to filter, etc., and Data classes with the actual data and collections.
Jason Phelps
2001-06-05
use an XML snap shot to hold onto the metadata for any object, this abstraction is enough to keep the DB and the application services seperate in their schema. The mapping is trivial and can be setup when new object types are created.
Daniel Cazzulino (kzu)
2001-06-05
Jason, plase read my other postings on the subject, 'cause it seems like u missed the point on the idea...
The functionality the Bridge should provide is just impossible with an XML snapshot of whatever.
If u follow this path, you're going with Dataset's XSDs, and that doesn't provide u anything else than a structure. You'll be querying tables, making joins, selects, etc. And y cant inherit anything with an XML snaphot.
Or maybe I didn't undestand your alternative
Daniel
Jason Phelps
2001-06-06
Daniel,
Sorry, I didn't provide enough detail. What I am thinking about is using metadata also stored in a database to describe object structures. When you animate an object from a document stored in a DB you can use something like reflection (.NET has a namespace for this) to peek into it's structure. You can use this same metadata in modeling and derving new object types and their methods & props, using code generate (also in .NET) to handle producing database repositories, object code, and specifications documents. Some of this approach can be seen in CRM solutions like Pivotal, and in the OODB space with the Objectivity database. When you bring it all together in a framework with modeling you end up using logical functions of object orientation to drive physical needs. .NET appears to be built around this and already has tools built in to make the effort more productive.
Jason
Daniel Cazzulino (kzu)
2001-06-08
Jason, I have the following questions regarding your idea:
1- What exactly do you mean by "animate an object"?
2- Using Reflection is right to get late binding, but it is surelly a pain at design time, specially if all your objects will be contructed and filled with properties and methods at runtime (I think that was the idea)
3- I've been watching Code generate namespace in .NET, but it has 0 documentation, but looks great!
My reflection: in the last paragraph, your idea is just identical to mine, but you started from the other extreme of the functionality. I see it the other way: you design the objects graphically in the modeling tool, u save this structure and relations as XML (for porting to other RDBMS), generate the tables, use code generation to create the classes, methods, properies, enums, etc., and compile it.
Therefore, at design time, you have full Intellisense and no reflection!
I think at last there's no difference between the two approaches, it's just a detail of implementation.
Daniel.
Jason Phelps
2001-06-08
animate is a word I have and seen used to signify the creation of an object type and the population of default state from a data store. Rehydration is another term used by some industry folks. Since objects can have all kinds of properties and behaviors you can write systems that have object types where instances can be personified, thus the action words
I think you are absolutely right, we are both talking about the same type of solution, and I think where you are going with the addition of rich modeling and code generation in the framework is going to be a huge win for all of us
Jason
Daniel Cazzulino (kzu)
2001-06-09
I'm working on a prototype document specification I'll make public ASAP for discussion. I can't wait to start serious coding, but we should agree on an arquitecture first.
Daniel
Jason Phelps
2001-06-11
I have templates for a wide range of spec docs and a content guide available for review if the group is interested.
Jason
Daniel Cazzulino (kzu)
2001-06-11
We sould use the Yahoo group for easy exchange of files.
If u can, send them to
and I'll peek them from there.
Daniel
Jason Phelps
2001-06-15
I put the source code zip and a general doc up in the Yahoo group file store
How about writing our own DBMS that includes OO and attributed programming features?
Maybe a RDBMS standard implementation we could rip off some database implementation text book, and then add support for inheritance and methods?
It would be much less of a hack than to build complex SQL strings behind the scenes with each access/update.
The reason I say this, is because I think we will exceed the limitations of an RDBMS pretty quickly (eg. performance of complex joins, complexities of naming conventions, lack of support for triggers, etc).
Another annoying thing about RDBMS, is I have to set up DSNs, and such. Often, I just want to write an application with a database in a file/directory. Such a project would start off as a sort of embedded database, and possibly later become a database server if there is demand.
Daniel Cazzulino (kzu)
2001-06-06
Well, that surely is a huge task...
I'm not still convinved of full OO DB is fast enough (some time ago I read about Jazmine, I think)... but it could be...
I don't know if it's a task we can jump on right know... maybe the first bridge could be usefull to detect potential needs, functionality, and at a later time, when we all master the .NET runtime, we can go for the OODB.
Jason Phelps
2001-06-06
John,
What you is 100% true, I've already tried it and the idea does suffer from many of the things you speak of. And then there is database independance to make everyone who wants to use the software happy. The solution seems to be a hybrid database that can work with data in a shared mechanism to provide the style of access necessary to solve a specific problem. Not sure what is out there though, searching has turned up some ideas.
Jason Phelps
2001-06-07
What are a few simple challenges we all face building software and frameworks? If we all weigh in on that using simple descriptions we can choose some ideas to specify in detail, and keep others open for further brainstorming. As developers what are our user requirements?
Daniel Cazzulino (kzu)
2001-06-07
My guess:
1- Data access layer components (with multithreading, concurrency conflict resolution)
2- Security
2- Centralized exception handling and logging
Jason Phelps
2001-06-08
I have been thinking on a port of a database abstraction layer I released as free software in 1999. There is a VB version, and an updated Java version has been underway for a few months. A .NET version would be interesting. I can post the source code when we get into coding.
Daniel Cazzulino (kzu)
2001-06-08
I say we go coding right now if it's ok with you. I would like to begin working ASAP.
Daniel
Jason Phelps
2001-06-09
Daniel,
I'm not familiar with CVS and want to get the source of the data components I have into the public forum. Any ideas on what we do? Can we give a shout out to another project someone knows of for someone to post a quick start to CVS for us?
Jason
|
http://sourceforge.net/p/dotnetopensrc/discussion/87322/thread/c06db8df
|
CC-MAIN-2015-40
|
en
|
refinedweb
|
Visual Studio shortcuts
A shortcut I was searching for along time CTRL + "M" + "M"
This one will collapse the region your cursor is at whether its a method, namespace or whatever for collapsing code blocks, regions and methods. The first will collapse only the block/method or region your cursor is at while the second will collapse the entire region you are at.
Here's a reference for more Visual Studio Shortcuts
Enjoy :)
|
http://weblogs.asp.net/bilalshouman/visual-studio-shortcuts
|
CC-MAIN-2015-40
|
en
|
refinedweb
|
Difference between revisions of "Programming in D for Ruby Programmers"
Latest revision as of 23:34, 4 August 2016
This page is under community development.
In the meantime, you may find the following links of interest as a Ruby programmer:
- Ruby Programmer shares his excitement about D
- forum discussion of post
- Jacob Carlborg writes on embedding Ruby in a D application
- David Oftedal writes on Project Euler problem 61: from Ruby to D
- forum posts on Ruby
- Call D Functions Using Ruby FFI
Adding methods to existing classes / UFCS
In Ruby, it's possible to add methods to existing classes, even builtin ones:
class String def underline puts self puts "=" * self.length end end "Hello, world!".underline # prints: # Hello, world! # =============
Because it uses a static compilation model, it's not possible to do exactly the same in D. However, D allows calling a free function as if it were a method, which mostly has the same effect from a caller's point of view, and has the additional advantage of not polluting the type's namespace:
void underline(string s) { import std.stdio : writeln; import std.range : repeat; writeln(s); writeln('='.repeat(s.length)); } void main() { "Hello, world!".underline(); }
|
https://wiki.dlang.org/?title=Programming_in_D_for_Ruby_Programmers&diff=prev&oldid=7906
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
How to sync data in a ros bag
I'm trying to integrate a LiDAR unit with an INS (IMU+GPS) and as it seems there's no way to sync them together unless we're willing to let go of IMU data (only GPS data is output in NMEA format if they are connected). So we connected them separately to a laptop and recorded some sample data and here's the issue: They are not in sync and when I try to do LiDAR mapping in any application ( here's one as an example) I get misaligned point clouds and jerky movement!
I was wondering if there's a way read the bag file, synchronize the data and save it in a new bag?
I have looked into
TimeSynchronizer here but I'm not sure how to apply it, or if it's what I need for this purpose at all.
Here's also a hacky script I came up with in Python, but it doesn't produce the desired result I guess the timings are too close or it's not the proper method at all:
def sync__to_current_timestamp(bag, output_path): topic_list = ["/os_cloud_node/points", "/os_cloud_node/imu", "/imu/data", "/gnss"] with rosbag.Bag(output_path + 'data_synced.bag', 'w') as outbag: bar = ChargingBar('Syncing', max=bag.get_message_count()) for topic, msg, t in bag.read_messages(): bar.next() if topic == "/tf" and msg.transforms: outbag.write(topic, msg, rospy.Time.now()) elif topic in topic_list: msg.header.stamp = rospy.Time.now() outbag.write(topic, msg, rospy.Time.now()) bar.finish() print("\n Done!")
Would appreciate any pointers.
Have you seen the
rosbagcookbook? It gives a good example of how to use the TimeSynchronizer to sync bag data.
@tryan Thank you for the url, I had a look although it's in C++ and that alone is a challenge for me (I was looking for a Python solution) but couldn't find the "saving" logic in that code?
I may have misinterpreted your question, so please clarify if I missed the point. If you have data that were recorded concurrently (is that your situation?), you could play the bag file, and run a custom synchronizer node.
ApproximateTimeSynchronizerwill collect the messages in a buffer and trigger a group callback when it has collected an set that are near in time. You've probably already looked at this, but here's a Python example. You could save the data to a new bag with a new timestamp in the callback function.
How exactly are the topics "not in sync"? Are they offset by a small delay, different frequencies, or something else?
|
https://answers.ros.org/question/371961/how-to-sync-data-in-a-ros-bag/
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
Flutter Sizer
Flutter Sizer helps implement a responsive layout by providing helper widgets and extensions
Content
Installation
Add
flutter_sizer to pubspec.yaml
dependencies: flutter_sizer: ^1.0.4
Parameters
Adaptive.h()- Returns a calculated height based on the device
Adaptive.w()- Returns a calculated width based on the device
Adaptive.sp()- Returns a calculated sp based on the device (deprecated)
Adaptive.dp()- Returns a calculated dp based on the device
.h- Returns a calculated height based on the device
.w- Returns a calculated width based on the device
.sp- Returns a calculated sp based on the device (deprecated)
.dp- Returns a calculated dp based on the device
Device.boxConstraints- Returns the Device's BoxConstraints
Device.orientation- Returns the Screen Orientation (portrait or landscape)
Device.screenType- Returns the Screen Type (mobile or tablet)
Device.devicePixelRatio- Returns the devicePixel Ratio or (1.0)
Usage
Import the Package
import 'package:flutter_sizer/flutter_sizer.dart';
Wrap MaterialApp with FlutterSizer widget
FlutterSizer( builder: (context, orientation, screenType) { return MaterialApp(); } )
Widget Size
Container( width: Adaptive.w(20), // This will take 20% of the screen's width height: 30.5.h // This will take 30.5% of the screen's height )
Font size
Text( 'Flutter Sizer', style: TextStyle(fontSize: 15.dp), )
Orientation
If you want to support both portrait and landscape orientations
Device.orientation == Orientation.portrait ? Container( // Widget for Portrait width: 100.w, height: 20.5.h, ) : Container( // Widget for Landscape width: 100.w, height: 12.5.h, )
DeviceType
If you want the same layout to look different in tablet and mobile, use the
Device.screenType method:
Device.screenType == ScreenType.tablet ? Container( // Widget for Tablet width: 100.w, height: 20.5.h, ) : Container( // Widget for Mobile width: 100.w, height: 12.5.h, )
Take Note
You need to import
flutter_sizer package in order to access
number.h,
number.w, and
number.dp
Auto import in VSCode and Android Studio doesn't work for dart extension methods. Typing
10.h would not bring up auto import suggestion for this package
One workaround is to type
Device so that the auto import suggestion would show up:
import 'package:flutter_sizer/flutter_sizer.dart';
Community Support
If you have any suggestions or issues, feel free to open an issue
If you would like to contribute, feel free to create a PR
|
https://pub.dev/documentation/flutter_sizer/latest/
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
When creating a microservice, there are several major programming languages to choose from with robust frameworks. NestJs has many tools for us to create a robust, organized, and testable application. A highlight is a power of dependency injection that the framework brings, where we can inject a module into another one, facilitating code reuse. But it’s worth noting that when this dependency injection makes modules dependent on each other, we hurt some Clean Architecture concepts.
The project that we will create next came from an idea of experimenting with the development of an API that is able to keep its input interface, responses, and business rules highly independent of databases and frameworks.
We’ll start creating our microservice thinking about a problem that it can solve so it’s easier to define the functionality that we’ll work on. The communication protocol that we will implement is TCP, which will be responsible for operations and we will use PacketSender for testing purposes, an open-source application that allows us to send network packets that support TCP.
Implementing a microservice via HTTP would be no different than implementing an API using Node.JS just because a microservice has a well-defined architecture and scope, so we will choose to use an asynchronous pattern with TCP packets which we will communicate with our microservice, and hence the choice of Nest.JS as it has many built-in features making it easier for us to create a microservices architecture.
We’re going to divide the development into four stages so this tutorial doesn’t get too extensive, they are:
In this step we will create a new application in NestJS using your CLI using the command below:
npx @nestjs/cli new products-microservice
Note: if you do not have npx installed, go to the link
Now that your app has been created, make sure you are at the root of the project and install a library @nestjs/microservices.
@nestjs/microservices
cd products-microservice && yarn add @nestjs/microservices
We need to modify the main.ts leaving as the code snippet below:
main.ts
import { INestMicroservice } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { Transport } from '@nestjs/microservices';
import { AppModule } from './app.module';
// Create the microservice options object
const microserviceOptions = {
transport: Transport.TCP,
options: {
host: process.env.HOST, //
port: process.env.PORT,
},
};
(async () => {
const app: INestMicroservice = await NestFactory.createMicroservice(
AppModule,
microserviceOptions,
);
await app.listen();
console.info('Microservice is listening...', process.env.PORT || 8080);
})();
NestJS supports several built-in transport layer implementations. The code above will create a microservice that communicates through the TCP transport layer to port 8080.
We have the option of using a message pattern or an event pattern to communicate with the microservice.
The message pattern acts as a request-response method, it is recommended for exchanging messages between services and the event pattern for when you just want to post events without waiting for a response.
We will just implement the functionality that will create a product based on the given input and we will get the created product. So let’s register a named message pattern create_product in the file app.controller.ts.
create_product
app.controller.ts
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@MessagePattern('create_product')
async createProduct(@Payload() payload: CreateProductDto) {
const product = await this.appService.createProduct(payload);
return product;
}
}
Next, we will abstract the logic of creating a new product, it can be implemented in different ways based on the needs and the database used, and we will focus only on requirements related to microservices.
import { IsString, IsEmail, IsNotEmpty } from 'class-validator';
export class CreateProductDto {
@IsNotEmpty()
@IsEmail()
name: string;
@IsNotEmpty()
@IsNumber()
price: number;
}
The payload we use to create a new product will look like this:
And finally, the most important thing is our service, which will be responsible for saving this data in the bank.
...
import Product from '../entity/product.entity';
import { CreateProductDto } from '../dto/create-product.dto';
...
@Injectable()
export default class AppService {
constructor(
@InjectRepository(Product) private readonly productRepository: Repository<Product>,
){}
async createProduct(body: Partial<Product>): Promise<UserDto> {
try {
const product = new Product();
product.name = body.name;
product.price = body.price;
const productCreated = await this.productRepository.save(product);
return productCreated;
} catch (e) {
throw new InternalServerErrorException('Error');
}
}
...
}
With all our code created we can perform the test in our application using PackatSender.
Now that we have our microservice configured and structured we need to perform the test to check if everything is working, for that we will use PacketSender to send a TCP packet to our application. Set the Address and Port to 127.0.0.1:8080 and select TCP from the drop-down menu on the right. To encode our message, use the ASCII field and fill it in with the following value:
122#{"pattern":"create_product",
"data":{"name":"G Suite","price":120},
"id":"ce51ebd3-32b1-4ae6-b7ef-e018126c4cc4"}
pattern
data
name
price
The value 122 represents the length of our message starting from the first key to the last (both included).
122
The NestJS provides the possibility to build lightweight, well-structured and amazing microservices. Out-of-the-box tools and features make development, extension, and maintenance nice and efficient.
|
https://tkssharma.com/nestjs-microservices-of-all-types/
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
7.69. V4L2 select()¶
7.69.1. Name¶
v4l2-select - Synchronous I/O multiplexing
7.69.2. Synopsis¶
#include <sys/time.h> #include <sys/types.h> #include <unistd.h>
7.69.3. Arguments¶
7.69.4. Description¶
function succeeds, setting the bit of the file descriptor in
readfds
or
writefds, but subsequent VIDIOC_DQBUF
calls will fail. 1
function.
For more details see the
select() manual page.
7.69.
|
https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/func-select.html
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
Recipes¶
The
recipe class documentation is below.
A recipe describes neuron models in a cell-oriented manner and supplies methods to provide cell information. Details on why Arbor uses recipes and general best practices can be found in Recipes.
Recipe¶
- class arbor.recipe¶
Describe a model by describing the cells and network, without any information about how the model is to be represented or executed.
All recipes derive from this abstract base class.
Recipes provide a cell-centric interface for describing a model. This means that model properties, such as connections, are queried using the global identifier
gidof a cell. In the description below, the term
gidis used as shorthand for the cell with global identifier.
Required Constructor
The constructor must be implemented and call the base class constructor, as at the moment there is no way to instruct Python to do that automatically.
Note
Arbor’s Python binding is that: a thin wrappper around the Arbor library which is written in C++. Calling the base class constructor ensures correct initialization of memory in the underlying C++ class.
A minimal constructor therefore looks like this:
def __init__(self): arbor.recipe.__init__(self)
Required Member Functions
The following member functions (besides a constructor) must be implemented by every recipe:
- cell_kind(gid)¶
The cell kind of the cell with global identifier
gid(return type:
arbor.cell_kind).
- cell_description(gid)¶
A high level description of the cell with global identifier
- connections_on(gid)¶
Returns a list of all the incoming connections to
gid. Each connection should have a valid synapse label
connection.deston the post-synaptic target
gid, and a valid source label
connection.source.labelon the pre-synaptic source
connection.source.gid. See
connection.
By default returns an empty list.
- gap_junctions_on(gid)¶.
- event_generators(gid)¶
A list of all the
event_generators that are attached to
gid.
By default returns an empty list.
- probes(gid)¶
Returns a list specifying the probesets describing probes on the cell
gid. Each element in the list is an opaque object of type
probeproduced by cell kind-specific probeset functions. Each probeset in the list has a corresponding probeset id of type
cell_member: an id
(gid, i)refers to the probes described by the ith entry in the list returned by
get_probes(gid).
By default returns an empty list.
- global_properties(kind)¶
The global properties of a model.
This method needs to be implemented for
arbor.cell_kind.cable, where the properties include ion concentrations and reversal potentials; initial membrane voltage; temperature; axial resistivity; membrane capacitance; cv_policy; and a pointer to the mechanism catalogue. Also see Built-in Catalogues.
By default returns an empty object.
Cells¶
Synapses¶
See Interconnectivity.
Event generator and schedules¶
- class arbor.event_generator¶
- event_generator(target, weight, schedule)¶
Construct an event generator for a
targetsynapse with
weightof the events to deliver based on a schedule (i.e.,
arbor.regular_schedule,
arbor.explicit_schedule,
arbor.poisson_schedule).
- target¶
The target synapse of type
arbor.cell_local_label.
- class arbor.regular_schedule¶
Describes a regular schedule with multiples of
dtwithin the interval [
tstart,
tstop).
- regular_schedule(tstart, dt, tstop)¶
Construct a regular schedule as list of times from
tstartto
tstopin
dttime steps.
By default returns a schedule with
tstart=
tstop=
Noneand
dt= 0 ms.
- class arbor.explicit_schedule¶
Describes an explicit schedule at a predetermined (sorted) sequence of
times.
- explicit_schedule(times)¶
Construct an explicit schedule.
By default returns a schedule with an empty list of times.
- class arbor.poisson_schedule¶
Describes a schedule according to a Poisson process.
- poisson_schedule(tstart, freq, seed)¶
Construct a Poisson schedule.
By default returns a schedule with events starting from
tstart= 0 ms, with an expected frequency
freq= 10 kHz and
seed= 0.
- events(t0, t1)¶
Returns a view of monotonically increasing time values in the half-open interval [t0, t1).
An example of an event generator reads as follows:
import arbor # define a Poisson schedule with start time 1 ms, expected frequency of 5 Hz, # and the target cell's gid as seed def event_generators(gid): target = arbor.cell_local_label("syn", arbor.selection_policy.round_robin) # label of the synapse on target cell gid seed = gid tstart = 1 freq = 0.005 sched = arbor.poisson_schedule(tstart, freq, seed) # construct an event generator with this schedule on target cell and weight 0.1 w = 0.1 return [arbor.event_generator(target, w, sched)]
Example¶
Below is an example of a recipe construction of a ring network of multi-compartmental cells. Because the interface for specifying cable morphology cells is under construction, the temporary helpers in cell_parameters and make_cable_cell for building cells are used.
import sys import arbor class ring_recipe (arbor.recipe): def __init__(self, n=4): # The base C++ class constructor must be called first, to ensure that # all memory in the C++ class is initialized correctly. arbor.recipe.__init__(self) self.ncells = n self.params = arbor.cell_parameters() # The num_cells method that returns the total number of cells in the model # must be implemented. def num_cells(self): return self.ncells # The cell_description method returns a cell. def cell_description(self, gid): # Cell should have a synapse labeled "syn" # and a detector labeled "detector" return make_cable_cell(gid, self.params) # The kind method returns the type of cell with gid. # Note: this must agree with the type returned by cell_description. def cell_kind(self, gid): return arbor.cell_kind.cable # Make a ring network def connections_on(self, gid): src = (gid-1)%self.ncells w = 0.01 d = 10 return [arbor.connection((src,"detector"), "syn", w, d)] # Attach a generator to the first cell in the ring. def event_generators(self, gid): if gid==0: sched = arbor.explicit_schedule([1]) return [arbor.event_generator("syn", 0.1, sched)] return [] def get_probes(self, id): # Probe just the membrane voltage at a location on the soma. return [arbor.cable_probe_membrane_voltage('(location 0 0)')]
|
https://docs.arbor-sim.org/en/latest/python/recipe.html
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
What other programs do the same thing as gprof?
Solution 1
gprof (read the paper) exists for historical reasons. If you think it will help you find performance problems, it was never advertised as such. Here's what the paper says:
The prole can be used to compare and assess the costs of various implementations.
It does not say it can be used to identify the various implementations to be assessed, although it does imply that it could, under special circumstances:
especially if small portions of the program are found to dominate its execution time.
What about problems that are not so localized? Do those not matter? Don't place expectations on gprof that were never claimed for it. It is only a measurement tool, and only of CPU-bound operations.
Try this instead.
Here's an example of a 44x speedup.
Here's a 730x speedup.
Here's an 8-minute video demonstration.
Here's an explanation of the statistics.
Here's an answer to critiques.
There's a simple observation about programs. In a given execution, every instruction is responsible for some fraction of the overall time (especially
call instructions), in the sense that if it were not there, the time would not be spent. During that time, the instruction is on the stack **. When that is understood, you can see that -
gprof embodies certain myths about performance, such as:
that program counter sampling is useful.
It is only useful if you have an unnecessary hotspot bottleneck such as a bubble sort of a big array of scalar values. As soon as you, for example, change it into a sort using string-compare, it is still a bottleneck, but program counter sampling will not see it because now the hotspot is in string-compare. On the other hand if it were to sample the extended program counter (the call stack), the point at which the string-compare is called, the sort loop, is clearly displayed. In fact, gprof was an attempt to remedy the limitations of pc-only sampling.
that timing functions is more important than capturing time-consuming lines of code.
The reason for that myth is that gprof was not able to capture stack samples, so instead it times functions, counts their invocations, and tries to capture the call graph. However, once a costly function is identified, you still need to look inside it for the lines that are responsible for the time. If there were stack samples you would not need to look, those lines would be on the samples. (A typical function might have 100 - 1000 instructions. A function call is 1 instruction, so something that locates costly calls is 2-3 orders of magnitude more precise.)
that the call graph is important.
What you need to know about a program is not where it spends its time, but why. When it is spending time in a function, every line of code on the stack gives one link in the chain of reasoning of why it is there. If you can only see part of the stack, you can only see part of the reason why, so you can't tell for sure if that time is actually necessary. What does the call graph tell you? Each arc tells you that some function A was in the process of calling some function B for some fraction of the time. Even if A has only one such line of code calling B, that line only gives a small part of the reason why. If you are lucky enough, maybe that line has a poor reason. Usually, you need to see multiple simultaneous lines to find a poor reason if it is there. If A calls B in more than one place, then it tells you even less.
that recursion is a tricky confusing issue.
That is only because gprof and other profilers perceive a need to generate a call-graph and then attribute times to the nodes. If one has samples of the stack, the time-cost of each line of code that appears on samples is a very simple number - the fraction of samples it is on. If there is recursion, then a given line can appear more than once on a sample. No matter. Suppose samples are taken every N ms, and the line appears on F% of them (singly or not). If that line can be made to take no time (such as by deleting it or branching around it), then those samples would disappear, and the time would be reduced by F%.
that accuracy of time measurement (and therefore a large number of samples) is important.
Think about it for a second. If a line of code is on 3 samples out of five, then if you could shoot it out like a light bulb, that is roughly 60% less time that would be used. Now, you know that if you had taken a different 5 samples, you might have only seen it 2 times, or as many as 4. So that 60% measurement is more like a general range from 40% to 80%. If it were only 40%, would you say the problem is not worth fixing? So what's the point of time accuracy, when what you really want is to find the problems? 500 or 5000 samples would have measured the problem with greater precision, but would not have found it any more accurately.
that counting of statement or function invocations is useful.
Suppose you know a function has been called 1000 times. Can you tell from that what fraction of time it costs? You also need to know how long it takes to run, on average, multiply it by the count, and divide by the total time. The average invocation time could vary from nanoseconds to seconds, so the count alone doesn't tell much. If there are stack samples, the cost of a routine or of any statement is just the fraction of samples it is on. That fraction of time is what could in principle be saved overall if the routine or statement could be made to take no time, so that is what has the most direct relationship to performance.
that samples need not be taken when blocked
The reasons for this myth are twofold: 1) that PC sampling is meaningless when the program is waiting, and 2) the preoccupation with accuracy of timing. However, for (1) the program may very well be waiting for something that it asked for, such as file I/O, which you need to know, and which stack samples reveal. (Obviously you want to exclude samples while waiting for user input.) For (2) if the program is waiting simply because of competition with other processes, that presumably happens in a fairly random way while it's running. So while the program may be taking longer, that will not have a large effect on the statistic that matters, the percentage of time that statements are on the stack.
that "self time" matters
Self time only makes sense if you are measuring at the function level, not line level, and you think you need help in discerning if the function time goes into purely local computation versus in called routines. If summarizing at the line level, a line represents self time if it is at the end of the stack, otherwise it represents inclusive time. Either way, what it costs is the percentage of stack samples it is on, so that locates it for you in either case.
that samples have to be taken at high frequency
This comes from the idea that a performance problem may be fast-acting, and that samples have to be frequent in order to hit it. But, if the problem is costing, 20%, say, out of a total running time of 10 sec (or whatever), then each sample in that total time will have a 20% chance of hitting it, no matter if the problem occurs in a single piece like this
.....XXXXXXXX...........................
.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^(20 samples, 4 hits)
or in many small pieces like this
X...X...X.X..X.........X.....X....X.....
.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^(20 samples, 3 hits)
Either way, the number of hits will average about 1 in 5, no matter how many samples are taken, or how few. (Average = 20 * 0.2 = 4. Standard deviation = +/- sqrt(20 * 0.2 * 0.8) = 1.8.)
that you are trying to find the bottleneck
as if there were only one. Consider the following execution timeline:
vxvWvzvWvxvWvYvWvxvWv.vWvxvWvYvW
It consists of real useful work, represented by
.. There are performance problems
vWxYztaking 1/2, 1/4, 1/8, 1/16, 1/32 of the time, respectively. Sampling finds
veasily. It is removed, leaving
xWzWxWYWxW.WxWYW
Now the program takes half as long to run, and now
Wtakes half the time, and is found easily. It is removed, leaving
xzxYx.xY
This process continues, each time removing the biggest, by percentage, performance problem, until nothing to remove can be found. Now the only thing executed is
., which executes in 1/32 of the time used by the original program. This is the magnification effect, by which removing any problem makes the remainder larger, by percent, because the denominator is reduced.
Another crucial point is that every single problem must be found - missing none of the 5. Any problem not found and fixed severely reduces the final speedup ratio. Just finding some, but not all, is not "good enough".
ADDED: I would just like to point out one reason why gprof is popular - it is being taught, presumably because it's free, easy to teach, and it's been around a long time. A quick Google search locates some academic institutions that teach it (or appear to):
berkeley bu clemson colorado duke earlham fsu indiana mit msu ncsa.illinois ncsu nyu ou princeton psu stanford ucsd umd umich utah utexas utk wustl
** With the exception of other ways of requesting work to be done, that don't leave a trace telling why, such as by message posting.
Solution 2
Valgrind has an instruction-count profiler with a very nice visualizer called KCacheGrind. As Mike Dunlavey recommends, Valgrind counts the fraction of instructions for which a procedure is live on the stack, although I'm sorry to say it appears to become confused in the presence of mutual recursion. But the visualizer is very nice and light years ahead of
gprof.
Solution 3
Since I did't see here anything about
perf which is a relatively new tool for profiling the kernel and user applications on Linux I decided to add this information.
First of all - this is a tutorial about Linux profiling with
perf
You can use
perf if your Linux Kernel is greater than 2.6.32 or
oprofile if it is older. Both programs don't require from you to instrument your program (like
gprof requires). However in order to get call graph correctly in
perf you need to build you program with
-fno-omit-frame-pointer. For example:
g++ -fno-omit-frame-pointer -O2 main.cpp.
You can see "live" analysis of your application with
perf top:
sudo perf top -p `pidof a.out` -K
Or you can record performance data of a running application and analyze them after that:
1) To record performance data:
perf record -p `pidof a.out`
or to record for 10 secs:
perf record -p `pidof a.out` sleep 10
or to record with call graph ()
perf record -g -p `pidof a.out`
2) To analyze the recorded data
perf report --stdio perf report --stdio --sort=dso -g none perf report --stdio -g none perf report --stdio -g
Or you can record performace data of a application and analyze them after that just by launching the application in this way and waiting for it to exit:
perf record ./a.out
This is an example of profiling a test program
The test program is in file main.cpp (I will put main.cpp at the bottom of the message):
I compile it in this way:
g++ -m64 -fno-omit-frame-pointer -g main.cpp -L. -ltcmalloc_minimal -o my_test
I use
libmalloc_minimial.so since it is compiled with
-fno-omit-frame-pointer while libc malloc seems to be compiled without this option.
Then I run my test program
. and so on ... 15.17% my_test libtcmalloc_minimal.so.0.1.0 [.] operator new(unsigned long) | --- operator new(unsigned long) | |--11.44%-- f1(long) | | | |--5.75%-- process_request(long) | | main | | __libc_start_main | | | --5.69%-- f2(long) | process_request(long) | main | __libc_start_main | --3.01%-- process_request(long) main __libc_start_main 13.16% my_test libtcmalloc_minimal.so.0.1.0 [.] operator delete(void*) | --- operator delete(void*) | |--9.13%-- f1(long) | | | |--4.63%-- f2(long) | | process_request(long) | | main | | __libc_start_main | | | --4.51%-- process_request(long) | main | __libc_start_main | |--3.05%-- process_request(long) | main | __libc_start_main | --0.80%-- f2(long) process_request(long) main __libc_start_main 9.44% my_test my_test [.] process_request(long) | --- process_request(long) | --9.39%-- main __libc_start_main 1.01% my_test my_test [.] operator delete(void*)@plt | --- operator delete(void*)@plt 0.97% my_test my_test [.] operator new(unsigned long)@plt | --- operator new(unsigned long)@plt 0.20% my_test my_test [.] main 0.19% my_test [kernel.kallsyms] [k] apic_timer_interrupt 0.16% my_test [kernel.kallsyms] [k] _spin_lock and so on ...
So at this point you know where your program spends time.
And this is main.cpp for the test:
#include <stdio.h> #include <stdlib.h> #include <time.h> time_t f1(time_t time_value) { for (int j =0; j < 10; ++j) { ++time_value; if (j%5 == 0) { double *p = new double; delete p; } } return time_value; } time_t f2(time_t time_value) { for (int j =0; j < 40; ++j) { ++time_value; } time_value=f1(time_value); return time_value; } time_t process_request(time_t time_value) { for (int j =0; j < 10; ++j) { int *p = new int; delete p; for (int m =0; m < 10; ++m) { ++time_value; } } for (int i =0; i < 10; ++i) { time_value=f1(time_value); time_value=f2(time_value); } return time_value; } int main(int argc, char* argv2[]) { int number_loops = argc > 1 ? atoi(argv2[1]) : 1; time_t time_value = time(0); printf("number loops %d\n", number_loops); printf("time_value: %d\n", time_value ); for (int i =0; i < number_loops; ++i) { time_value = process_request(time_value); } printf("time_value: %ld\n", time_value ); return 0; }
Solution 4
Try OProfile. It is a much better tool for profiling your code. I would also suggest Intel VTune.
The two tools above can narrow down time spent in a particular line of code, annotate your code, show assembly and how much particular instruction takes. Beside time metric, you can also query specific counters, i.e. cache hits, etc.
Unlike gprof, you can profile any process/binary running on your system using either of the two.
Solution 5
Google performance tools include a simple to use profiler. CPU as well as heap profiler is available.
Solution 7 if you want a high performance tracer
|
https://solutionschecker.com/questions/alternatives-to-gprof-closed/
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
type parameter inference and conversions
In this example:
Basically it is the question regarding the impact of conversions on the inference process. What is the relationship between type parameter inference and method argument conversions? The spec does not say anything, or does it?
public class X { private static <T> T f(T t) { return t; } public static void main(String[] args) { f(5); } }Would the call to f be illegal? Or would it be legal and invoke
<Integer>fand perform a boxing conversion on the method argument?
Basically it is the question regarding the impact of conversions on the inference process. What is the relationship between type parameter inference and method argument conversions? The spec does not say anything, or does it?
- The call to f would be illegal. Autoboxing is not supported.
If the JSR 201 proposal will be accepted then Java will have support for autoboxing.
Which raises the question: what is the relationship between autoboxing and type parameter inference? will autoboxing be treated as other conversions such as the widening reference conversions? what is the relationship between method argument conversion and type parameter inference?
public class Super {} public class Sub extend Super {} public class X { private static <T> T f(T t) { return t; } private static void g(Integer i) {} private static Super h(Super s) { return s; } public static void main(String[] args) { f(5); // 1 g(5); // 2 Super r1 = f(new Sub()); // 3 Super r2 = h(new Sub()); // 4 } }Call // 4 is legal. Is call // 3 legal? Which method does it call: <Sub>f or <Super>f ? In other word, does the call involve a widen reference conversion on the method argument?
Call // 2 is legal (provided that autobxing makes it into the language). Is call // 1 legal? Does it call <Integer>f and performs an autoboxing conversion on the method argument? Or does type parameter inference infer 'int', in which case the call would be illegal?
- Very good question. Fantastic example.
Oh, I can't wait for the next drafts of these proposals!
This discussion has been closed.
|
https://community.oracle.com/tech/developers/discussion/1186908/type-parameter-inference-and-conversions
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
The CSS and web font files to easily self-host the “Alex Brush” font. Please visit the main Fontsource monorepo to view more details on this package.
Fontsource assumes you are using a bundler, such as Webpack, to load in CSS. Solutions like CRA, Gatsby and Next.js are prebuilt examples that are compatible.
yarn add @fontsource/alex-brush // npm install @fontsource/alex-brush
Then within your app entry file or site component, import it in. For example in Gatsby, you could choose to import it into a layout template (
layout.js), page component (
index.js), or
gatsby-browser.js.
import "@fontsource/alex-brush" // Defaults to weight 400.
Fontsource allows you to select weights and even individual styles, allowing you to cut down on payload sizes to the last byte! Utilizing the CSS unicode-range selector, all language subsets are accounted for.
import "@fontsource/alex-brush/500.css" // Weight 500. import "@fontsource/alex-brush/900-italic.css" // Italic variant.
Alternatively, the same solutions could be imported via SCSS!
@import "~@fontsource/alex-brush/index.css"; // Weight 400. @import "~@fontsource/alex-brush/300-italic.css";
These examples may not reflect actual compatibility. Please refer below.
Supported variables:
[400]
[normal]
Finally, you can reference the font name in a CSS stylesheet, CSS Module, or CSS-in-JS.
body { font-family: "Alex Brush"; }
In the rare case you need to individually select a language subset and not utilize the CSS unicode-range selector, you may specify the import as follows. This is especially not recommended for languages, such as Japanese, with a large amount of characters.
import "@fontsource/alex-brush/latin-ext.css" // All weights with normal style included. import "@fontsource/alex-brush/cyrillic-ext-500.css" // Weight 500 with normal style. import "@fontsource/alex-brush/greek-900-normal.css" // Italic variant.
[latin,latin-ext].
Google Fonts License Attributions
Font version (provided by source):
v12.
Feel free to star and contribute new ideas to this repository that aim to improve the performance of font loading, as well as expanding the existing library we already have. Any suggestions or ideas can be voiced via an issue.
|
https://openbase.com/js/fontsource-alex-brush
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
This chipped training dataset is over N'Djamena 3,044 tiles and 124,208 individual buildings. The satellite imagery resolution is 45 cm and was sourced from Maxar ODP (10300100AA405C00). Dataset keywords: Urban, Peri-urban, Rural
DevGlobal, (2022). ramp Building Footprint Training Dataset - N'Djamena, Chad, Version 1.0, [Date Accessed]. Radiant MLHub.
from radiant_mlhub import Dataset ds = Dataset.fetch('ramp_ndjamena_chad') for c in ds.collections: print(c.id)
Python Client quick-start guide
RADIANT EARTH
|
https://mlhub.earth/data/ramp_ndjamena_chad
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
In this modern data science scenario, there are many kinds of data required to analyze, and various analysis algorithms help us view the data better or understand the data. Still, when it comes to analysis, a series evolving with time, the spectrogram is the most common tool we frequently use to analyze this kind of data. Audio files, sound waves, and magnetic waves are the most common examples of this kind of data; all of them provide signal information in the form of data. Therefore, measuring the frequency and amplitude of the signals can be considered the main motive of the spectrogram.
For visualising signals into an image, we use a spectrogram that plots the time in the x-axis and frequency in the y-axis and, for more detailed information, amplitude in the z-axis. Also, it can be on different colors where the density of colors can be considered the signal’s strength. Finally, it gives you an overview of the signal where it explains how the strength of the signal is distributed in different frequencies.
THE BELAMY
Sign up for your weekly dose of what's up in emerging technology.
So the amplitude and the frequency of the signal are the two main components of any spectrogram. Next in the article, we will have a general definition of both of them so that we won’t get confused about the terms we will use later in the article.
Frequency
Mathematically, frequency is the number of waves passing through a fixed point in a single time unit or the number of cycles performed by a body in a single time when it is in a periodic motion.
Amplitude
Amplitude can be defined as the greatest distance travelled by a moving body in a periodic motion in a single time unit or the highest distance of the wave on dips down or rising from its flat surface.
The image below can give us the visualization of these components.
Let’s move on the spectrogram side.
The mathematics behind the spectrogram is based on the Gabor transform. We use the Gabor transform to compute the spectrogram. Gabor transform is the special case of the short-time Fourier transform used to extract the sinusoidal frequency and phase content of a signal in its particular section. In Fourier transform, we take some signals in space or time and write them into their frequency components. More formally, from any signal, after performing a Fourier transform, we can pull out the signal’s frequency components that help to make the signal. In the images below, we can see the graphs of signal and frequency after the Fourier transform of the signal.
Hereafter the Fourier transform, we can see the frequency components but for example, let’s consider the signal in the image as an audio signal of any song. Then we can know by the time domain graph what the words or tune is playing. By the frequency domain graph, we will be able to know what is the frequency of the tune. If we don’t know about the frequency at a particular time, Gabor transform comes into the picture to resolve this.
Gabor Transform
Gabor transform allows us to figure the spectrogram of any signal by using the time-frequency plot to easily track details in a signal like the frequency with the time factor. In Gabor transform, we multiply the Gaussian function to our signal function. The function can be regarded as the window function, and the resultant of the process is then transformed with the Fourier transform to derive the time-frequency analysis.
The window function is the signal near the time we want to analyze the signal and provide it with a heavier weight. Mathematically we can represent the Gabor transform as:
In the image, we can see that the Gabor transform is built on the Fourier transform. As discussed before, we can see that to get the Gabor transform, we are multiplying the Fourier transform of the function with the window function of the frequency. The window function will slide with time, so basically, the window function is a function of the time range, or at a time, we can say that time to complete one frequency of the signal.
In the image below, we can imagine that we have taken a gaussian window that slides across the signal. When it is positioned in a particular time domain, it will provide the weight to the signal of that particular time. Thus, it will generate the key present in our time-frequency graph of the signal in the form of small dashes. The distance from the x-axis is showing the magnitude of frequency where the distance from the y axis is showing the time.
Next, we will see how we can make the spectrogram using python and also, we will be looking at the insights from the graph of any signal. There are various ways to make any spectrogram in python, and various libraries provide the direct modules to make spectrograms of any signal. So, let’s see how we can do that.
Implementation of Spectrogram in Python
Importing the required libraries :
Input:
import numpy as np from scipy import signal from scipy.fft import fftshift from matplotlib import mlab mport matplotlib.pyplot as plt mport matplotlib.pyplot as plt
Making a signal using scipy in python:
Input:
fs = 10e3 N = 1e5 NFFT = 1024 amp = 2 * np.sqrt(2) noise_power = 0.01 * fs / 2 time = np.arange(N) / float(fs) mod = 500*np.cos(2*np.pi*0.25*time) carrier = amp * np.sin(2*np.pi*3e3*time + mod) noise = rng.normal(scale=np.sqrt(noise_power), size=time.shape) noise *= np.exp(-time/5) x = carrier + noise
Here I have created a signal which is a 2 Vrms sine wave with modulated frequencies around 3000 Hz, and also the amplitude of the signal is slowly decreasing from 20000 Hz to 100000 Hz.
Next, we can make a plot of the signal so that we can have its overview.
Input:
plt.figure(figsize=(10,12)) plt.plot(x) plt.show()
Output:
Here we can see the waves of the images, which tells how the signal’s amplitude is changing.
Let’s make a spectrogram of the signal using scipy.signal.spectrogram.
Input:
f, t, Sxx = signal.spectrogram(x, fs) plt.figure(figsize=(8,10)) plt.pcolormesh(t, f, Sxx, shading='gouraud') plt.ylabel('Frequency [Hz]') plt.xlabel('Time [sec]') plt.show()
Output:
Here we can see in the spectrogram how our wave is moving on its space, but in scipy’s spectrogram, we do not accurately measure amplitude.
As discussed earlier in this topic, it will be much better to analyze the signal in a spectrogram when we can have all components (frequency, amplitude) with time in one image. So I basically prefer to use matplotlib to make a spectrogram of any kind of signal.
Using matplotlib to make the spectrogram.
Input:
fig, (ax1, ax2) = plt.subplots(nrows=2) ax1.plot(time, x) Pxx, freqs, bins, im = ax2.specgram(x, NFFT=NFFT,Fs=fs, noverlap=900) plt.show()
Output:
.
In this graph, we can see that as the amplitude decreases, the color of the spectrogram is varying or getting darker than before. So if we are working with any fluctuating audio file and by this graph, we can understand how the frequency(curve line of yellow color) is changing with time and what is the amplitude component of the particular time.
We can modify that graph more in the next input. I am providing it with a color label to see the exact value of magnitude at a particular time.
Input:
def specgram2d(y, srate=44100, ax=None, title=None): if not ax: ax = plt.axes() ax.set_title(title, loc='center', wrap=True) spec, freqs, t, im = ax.specgram(y, Fs=fs, scale='dB', vmax=0) ax.set_xlabel('time (s)') ax.set_ylabel('frequencies (Hz)') cbar = plt.colorbar(im, ax=ax) cbar.set_label('Amplitude (dB)') cbar.minorticks_on() return spec, freqs, t, im fig1, ax1 = plt.subplots() specgram2d(x, srate=fs, ax=ax1) plt.show()
Output:
Here we can see more on the graph. Now we can easily measure the amplitude component of the signal with time using the color label. We can also visualize the signal in 3D to understand how the signal is going in the 3-dimensional space.
Input:
def specgram3d(y, srate=44100, ax=None, title=None): if not ax: ax = plt.axes(projection='3d') ax.set_title(title, loc='center', wrap=True) spec, freqs, t = mlab.specgram(y, Fs=srate) X, Y, Z = t[None, :], freqs[:, None], 20.0 * np.log10(spec) ax.plot_surface(X, Y, Z, cmap='viridis') ax.set_ylabel('frequencies (Hz)') ax.set_ylabel('frequencies (Hz)') ax.set_zlabel('amplitude (dB)') ax.set_zlim(-140, 0) return X, Y, Z fig2, ax2 = plt.subplots(subplot_kw={'projection': '3d'}) specgram3d(x, srate=fs, ax=ax2) plt.show()
Output:
Here we can see all three dimensions in one picture. Here it is a little messed up, but it can be helpful when working with real data.
There are more ways to make the spectrogram of the signal. We can also use TensorFlow to make a spectrogram. I have written an article to explain the whole TensorFlow to preprocess the audio data with a spectrogram. Please refer to the article here- link. There are various uses of the spectrogram, like classification of the music, sound detection, where we compare the spectrogram of saved audio files to the target audio file. The ocean also sometimes uses the spectrogram for object detection by sending the SONAR waves and collecting the variation in waves in the form of spectrograms.
Here in the article, we have seen what a spectrogram is, the mathematics behind the spectrogram, and how can we visualize spectrograms using python libraries. We have also gone through some examples that are done by the use of spectrograms.
References
.
|
https://analyticsindiamag.com/hands-on-tutorial-on-visualizing-spectrograms-in-python/
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
sl_se_command_context_t Struct Reference
SE mailbox command context.
#include <sl_se_manager_types.h>
SE mailbox command context.
This structure defines the common SE mailbox command context used for all SE Manager API functions that execute SE mailbox commands. The members of this context structure should be considered internal to the SE Manager and should not be read or written directly by the user application. For members that are relevant for the user, the user can access them via corresponding set and get API functions, e.g. sl_se_set_yield().
Field Documentation
◆ command
SE mailbox command struct.
◆ yield
If true, yield the CPU core while waiting for the SE mailbox command to complete.
If false, busy-wait, by polling the SE mailbox response register.
|
https://docs.silabs.com/gecko-platform/latest/service/api/structsl-se-command-context-t
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
How to setup Cypress for end to end testing an SPA that is locked behind an Auth0 login. Auth0 has a blogpost explaining this setup here. However, if you're building a single page application you are most likely depending on @auth0/auth0-spa-js for managing your login state. This means we need to get the token into our auth0 client. This post will demonstrates how we can achieve that using localstorage.
Setup Auth0 and Cypress
First of all we need to configure Auth0 so that we can retrieve a token with an API request. To do this follow the steps in the paragraph Auth0 Setup & Configuration from the Auth0 blogpost about Cypress.
Add a file
cypress.env.json to your cypress project root folder and fill it out with your auth0 application and user data.
{ "auth_audience": "", "auth_url": "", "auth_client_id": "", "auth_client_secret": "", "auth_username": "", "auth_password": "" }
Don't forget to add it to your
.gitignore!
Then add a command to
/cypress/support/commands.js:); });
Enable Auth0's localstorage for caching
Now somewhere in your SPA you will have:
import createAuth0Client from '@auth0/auth0-spa-js' ... this.auth0Client = await createAuth0Client(authOptions)
This is where you should enable localstorage. The parameter
authOptions is an object that can contain
cacheLocation, which we just need to set to
'localstorage'. Note that saving tokens in localstorage is a security concern. Therefore we will only use localstorage for non-production environments. For production we will use
cacheLocation: 'memory', which is also the default if you don't provide it.
const cacheLocation = process.env.NODE_ENV === 'production' ? 'memory' : 'localstorage' const optionsWithCache = { ...authOptions, cacheLocation, } this.auth0Client = await createAuth0Client(optionsWithCache)
This also means Cypress login will only work in non-production environments, so I hope you don't need to run Cypress on your production environment.
The login test
describe("login", () => { it("should successfully log into our app", () => { cy.login() .then((resp) => { return resp.body; }) .then((body) => { const { access_token, expires_in, id_token, token_type } = body; cy.visit("/", { onBeforeLoad(win) { const keyPrefix = "@@auth0spajs@@"; const defaultScope = "openid profile email"; const clientId = Cypress.env("auth_client_id"); const audience = "default"; const key = `${keyPrefix}::${clientId}::${audience}::${defaultScope}`; const decodedToken = { user: JSON.parse( Buffer.from(body.id_token.split(".")[1], "base64").toString( "ascii" ) ), }; const storageValue = JSON.stringify({ body: { client_id: clientId, access_token, id_token, scope: defaultScope, expires_in, token_type, decodedToken, audience, }, expiresAt: Math.floor(Date.now() / 1000) + body.expires_in, }); win.localStorage.setItem(key, storageValue); }, }); }); }); });
A few things to note from this snippet:
cy.visit("/")assumes you've set
baseUrlin
cypress.json. For example in my case testing locally:
{ "baseUrl": "" }
- The
keyand
storageValueneed to be of a specific format in order for the Auth0 client to pick it up. The snippet contains the default values for
keyPrefix,
defaultScopeand
audience. Don't worry about their peculiar values. Unless you're tinkering with
scopeor
audiencewhen creating your Auth0 client you don't need to change those.
Happy testing!
Top comments (1)
Thanks for this man! I was having some trouble figuring this out on my own and your solution worked 😄
|
https://practicaldev-herokuapp-com.global.ssl.fastly.net/peerhenry/setup-cypress-and-auth0-for-spa-s-4f5p
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
Python password manger
Project description
Pysafe is a terminal-based password manager with a very easy to use CLI.
Features:
- Generate a unique encryption key to be used as a master password.
- Generate new passwords for new login entries.
- Encrypt all saved password using the generated encryption key.
- Show all your saved login credentials with a click of button.
- A ready to export CSV file for an easy backup experience.
- Master reset to delete saved encryption key and all saved login entries.
How to install:
On mac:
Open terminal and type:
python3 pip install pysafe
On windows:
Open Powershell and type
python3 pip install pysafe
How to use:
On mac:
Open terminal and type
Python3
Import pysafe
On Windows:
Open CMD and type
python3
import pysafe
General usage:
- Generate a new encryption key: You only need to do this once. Save your encryption key somewhere safe as this will be used as your master password.
Note: Encrypted credentials are linked to the generated encryption key . Avoid generating a new key with existing login credentials as this would result in losing the ability to decrypt your saved login credentials.
Use previous encryption key: Here you can use previously generated encryption key. The encryption key is 44 character.
Save a new login: After saving your encryption key, you can enter as many login entries as you so desire with the ability to generate new passwords along the way, or just enter a password of your choosing. Then the program will save it for you in CSV file. The passwords in that CSV file will be encrypted, and can only be seen using the generated encryption key that we mentioned earlier.
Show saved logins: The program will print out the saved logins using the saved encryption key and saved CSV file, so you can see them in plain text that you can use.
Generate a new password: This will give your the ability to generate a new password without having an encryption key or entering any additional information such as a website tile or website link. You only need to enter the length of the password and the program will do the rest.
Show locations of saved files: This will show you the absolute path of the generated files by the program
Delete all data: This will be used in case you wish to have a fresh start without any encryption key nor login credentials file file.
Note: This will permanently delete your encryption key and saved login credentials. So only do that, if you know what you are doing.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|
https://pypi.org/project/pysafe/
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
React Native is one of the most famous open-source hybrid frameworks to build apps for Android, iOS, and web platforms using JavaScript with a single codebase.
The name “React Native” is composed of two words: React and Native. “React” states the use of the React app development environment, and “Native” represents the use of native Android/iOS/Web UI widgets to develop apps for better performance. React Native interacts with the Native platform at runtime via JavaScript to construct the native view for React Native UI components. React Native also offers ready-to-use inbuilt APIs for UI development such as
<ScrollView>,
<FlatList>,
<ImageView>, etc. to develop apps.
This guide covers the basics of React Native development on Android using the standard
npx react-native CLI.
React Native is built upon the React framework, but it uses different APIs and technologies to make React apps compatible with the Native mobile platform:
DOMor
windowobject.
native moduleto create a wrapper to use platform-specific APIs or third party modules.
As mentioned earlier, the standard React Native
create-react-native-app CLI requires the Native development tools (Android Studio or XCode) and other npm packages, such as Camera and Map, to build specific features. Expo CLI overcomes the limitations of standard React Native CLI with the following features:
Expo is an enhanced version of the standard React Native CLI for quick design, development, and publishing, but despite many pros Expo has some limitations:
Expo is an easy way to get started quickly with React Native development in browsers. Expo also supports unimodules to use Expo SDK in React Native apps.
React Native follows the similar development structure and tools of React, so this guide assumes that you have the basics knowledge of following technologies and tools.
The
npx react-native init requires external tools, so follow the below steps to download and install the required tools, as per operating system:
1/bin/bash -c "$(curl -fsSL)"
Note: Homebrew installation requires the
xcode-select command-line tool to work so it's recommended to install Xcode as well or it will ask to confirm the installation of
xcode-select tool.
nodeand
watchman
1brew install node watchman
break caskto install GUI software installation setups
1brew cask install adoptopenjdk/openjdk/adoptopenjdk8
1# can use any editor instead of open 2open ~/.bash_profile
1# after other pre-configured environment variables 2export ANDROID_HOME=$HOME/Library/Android/sdk 3export PATH=$PATH:$ANDROID_HOME/emulator 4export PATH=$PATH:$ANDROID_HOME/tools 5export PATH=$PATH:$ANDROID_HOME/tools/bin 6export PATH=$PATH:$ANDROID_HOME/platform-tools
MacOS Cataline has a default shell as
zsh so to fix the warning below, edit/create
~/.zprofile (under
/users/username/) file for Cataline.
1chsh -s /bin/zsh 2# create the .zprofile under users/your_user_name and copy content from bash_profile, save it 3source ~/.zprofile
printenvprints all environment variables.
xcode-select --versionallows you to view the version of xcode-select CLI.
1choco install -y nodejs.install python2 openjdk8
UserNamewith your username:
1setx ANDROID_HOME "C:\Users\UserName\AppData\Local\Android\SDK"
and add
platform-tools to
PATH variable. Make sure to replace
UserName with your user name:
1setx /M PATH "%PATH%;C:\Users\UserName\AppData\Local\Android\SDK\platform-tools"
The steps to run the project is the same on all operating systems:
1npx react-native init RNClickCounter
1cd RNClickCounter 2npx react-native run-android --verbose
The above command process may ask to install
CocoaPods, which is a dependency manager for iOS projects and required to run iOS apps.
In the above command,
--verbose is optional but useful to view any potential issues, like below.
InvokerHelper Error: Gradle version
6.1.1can cause this issue, so make sure to update
distributionUrlattribute in
RNClickCounter\android\gradle\wrapper\gradle-wrapper.propertiesfile:
1# To fix the "Could not initialize class org.codehaus.groovy.runtime.InvokerHelper" error, use latest gradle 2distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
and update classpath in
RNClickCounter\android\build.gradle:
1classpath("com.android.tools.build:gradle:4.0.0")
Note: React Native may not use the exact
buildToolsVersion version declared in the
RNClickCounter/android/build.gradle file, so in case of error the specific version needs to be installed from the Android SDK.
The project structure of a React Native project is similar to React. The underlying Android and iOS project is pre-configured to use React components to build platform-specific apps.
Let's go through the key elements of a React Native project:
Index.jsis an entry point for a React app to register the app and to load required modules for the JS executions environment.
App.jsis the first/main screen of the app.
androidfolder contains all the Native Android development, and build files, which is almost similar to the Native Android project structure.
iosfolder contains all the Native iOS development and build files, which is almost similar to the Native iOS project structure.
package.jsoncontains the details about the app (name, version), dependencies, and executable script details.
app.jsoncontains the app name details.
React Native uses some common mobile components like
Button,
View,
Text, etc., along with React Native-specific components like
SafeAreaView and
StyleSheet. Let's go though some basic components to build the click counter app:
SafeAreaViewadds the required padding for camera-notches/sensor-housing and reflects the area that is not covered by any of the top views like toolbar, navigation, etc.
Textdisplays text on the screen. It is similar to
UILabel,
TextView, or
<p>tag.
Viewis a basic UI container element with flexbox layout support. The Native equivalents of view are
UIView,
View, or
divtag.
Buttonrepresents the Native platform-specific button with platform-specific style.
StyleSheetis used to define the style attributes for elements that will be mapped to Native-style values.
useStateis a React hook that is used to maintain a state (stored values) in a functional component. This is used in the
App.jsfunctional component to keep the track of the counter variable’s state. The counter variable should be modified by the callback method
setCount, and returned by
useState.
export default Appis used to allow other components to import the
Appcomponent. There can be only one default export in a file.
flex: 1is used to define the CSS3 flexbox style responsive layout vertically.
React$Noderepresents a type of React node (from flow type check) whose value can be a ReactChild, ReactFragment, ReactPortal, boolean, null, number, or string.
Follow the below steps to implement click counter in the
App.js component:
react-hookto store the updated value of
count. The
setCountmethod will be used to update the value of
count:
1 const [count, setCount] = useState(0);
count:
1 const counterPlus = () => { 2 setCount(count + 1 <= Number.MAX_SAFE_INTEGER ? count + 1 : count) 3 } 4 5 const counterMinus = () => { 6 setCount(count - 1 >= Number.MIN_SAFE_INTEGER ? count - 1 : count) 7 }
Buttonand
Text:
1const styles = StyleSheet.create({ 2 container: { 3 flex: 1, 4 justifyContent: 'center', 5 alignItems: 'center', 6 backgroundColor: '#e6e6fa', 7 }, 8 textConter: { 9 fontSize: 28, 10 color: '#000', 11 }, 12 buttonStyle: { 13 width: "80%", 14 margin: 10, 15 } 16});
1import React, { useState } from "react"; 2import { SafeAreaView, StyleSheet, Text, StatusBar, Button, View} from 'react-native'; 3 4const App: () => React$Node = () => { 5 6 const [count, setCount] = useState(0); 7 8 const counterPlus = () => { 9 setCount(count + 1 <= Number.MAX_SAFE_INTEGER ? count + 1 : count) 10 } 11 12 const counterMinus = () => { 13 setCount(count - 1 >= Number.MIN_SAFE_INTEGER ? count - 1 : count) 14 } 15 16 return ( 17 <> 18 <StatusBar barStyle="dark-content" /> 19 <SafeAreaView style={styles.container}> 20 <Text style={styles.textConter} >{count}</Text> 21 <View style={styles.buttonStyle}> 22 <Button 23 onPress={counterPlus} 24 25 </View> 26 <View style={styles.buttonStyle}> 27 <Button 28 onPress={counterMinus} 29 30 </View> 31 </SafeAreaView> 32 </> 33 ); 34}; 35 36const styles = StyleSheet.create({ 37 container: { 38 flex: 1, 39 justifyContent: 'center', 40 alignItems: 'center', 41 backgroundColor: '#e6e6fa', 42 }, 43 textConter: { 44 fontSize: 28, 45 color: '#000', 46 }, 47 buttonStyle: { 48 width: "80%", 49 margin: 10, 50 } 51}); 52 53export default App;
React Native is a great way to build hybrid apps. You can either use
Expo or
npx react-native CLI to get started with React Native development.
The optimized codebase is available at RnClickCounter repository. Hopefully, this guide explained the necessary details to get started with React Native on Android. Happy Coding!
|
https://www.pluralsight.com/guides/getting-started-with-reactnative-on-android
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
How to Write Pr2 PropsDescription: This is a step-by-step guide to writing one of the basic Android Apps that runs on the Pr2. This tutorial will demonstrate how to make the Pr2 Props App. You should read the previous tutorial linked above but if it didn't all make sense then that's okay. This tutorial does assume that the Android development environment described at the beginning of that article has been set up.
Tutorial Level: BEGINNER
WARNING: This documentation refers to an outdated version of rosjava and is probably incorrect. Use at your own risk.
Contents
Android Client
Creating the Package
If you roscd to the existing android_pr2_props package you'll see a lot of different files. some of those files will get generated for us. We can follow some of the same instructions from the previous tutorial. Go to your ROS_DIR (where you installed your ROS android toolchain). Create a directory called android_pr2_props2 and navigate to it.
mkdir android_pr2_props2 cd android_pr2_props2
We can use the android_create tool to make some of the autogenerated files. The parameters are fairly complex. For a full description see the previous tutorial. Here is an example of what we'll put for our Props App.
rosrun appmanandroid android_create --create Pr2Props2 ros.android.pr2props2 Pr2Props2 icon "Pr2 Props2" pr2_props2 pr2_props2_app/pr2_props2
After running the script, you should see a bunch of new files.
To create our icon file, we can just borrow the ROS icon for now. Or you can use your own.
cp `rospack find android_gingerbread`/res/drawable-hdpi/icon.png res/drawable/icon.png
Then add the application to your tool chain install:
rosinstall ROS_DIR . source ROS_DIR/setup.bash
If this produces any errors, just read the error message and it should indicate how to fix it. Remember to tailor the solution to your version of ROS.
Next build the application.
rosmake --threads=1
Filling in the Activity Class
Now we can actually start to make the application do something. Props is only a single Android activity. We can find the source for the activity if we roscd to the package and go to src/ros/android/pr2props/Pr2Props2.java.
roscd android_pr2_props2 cd src/ros/android/pr2props vi Pr2Props2.java
Once you've opened up the activity file in the editor of your choice, you can see that it's mostly empty. Let's start to fill that in.
If we take a look at the onCreate() method, we'll notice that most initialization has been done for us. We can add a line to set the robot's height to 0.0 when it starts up. We'll make it a global variable and declare it at the beginning of our activity.
1 public class Pr2Props extends RosAppActivity { 2 3 private double spineHeight; 4 5 /** Called when the activity is first created. */ 6 @Override 7 public void onCreate(Bundle savedInstanceState) { 8 setDefaultAppName("pr2_props_app/pr2_props"); 9 setDashboardResource(R.id.top_bar); 10 setMainWindowResource(R.layout.main); 11 spineHeight = 0.0; 12 super.onCreate(savedInstanceState); 13 }
Next we can look at onNodeCreate(), which has everything in it that happens when your node is created. Here you want to create your publisher to publish messages to the spine of the robot and move the torso up/down. If you are familiar with the Props App you probably know that there's more to it than just moving the torso of the robot. The other parts are controlled by services, so they'll get taken care of later. This also creates an interesting behavior where if for some reason the .launch file doesn't get launched on the robot, the torso can still move up and down because it's just relying on messages published to a topic.
Your onNodeCreate() might look something like this now:
1 @Override 2 protected void onNodeCreate(Node node) { 3 super.onNodeCreate(node); 4 spinePub = node.newPublisher("torso_controller/command", "trajectory_msgs/JointTrajectory"); 5 spineThread = new Thread(new Runnable() { 6 @Override 7 public void run() { 8 JointTrajectory spineMessage = new JointTrajectory(); 9 spineMessage.points = new ArrayList<JointTrajectoryPoint>(); 10 spineMessage.joint_names = new ArrayList<String>(); 11 spineMessage.joint_names.add("torso_lift_joint"); 12 JointTrajectoryPoint p = new JointTrajectoryPoint(); 13 p.positions = new double[] { 0.0 }; 14 p.velocities = new double[] { 0.1 }; 15 p.time_from_start = new Duration(0.25); 16 spineMessage.points.add(p); 17 try { 18 while (true) { 19 spineMessage.points.get(0).positions[0] = spineHeight; 20 spinePub.publish(spineMessage); 21 Thread.sleep(200L); 22 } 23 } catch (InterruptedException e) { 24 } 25 } 26 }); 27 spineThread.start(); 28 }
Basically this just creates a publisher to publish messages of the type trajectory_msgs/JointTrajectory to the torso_controller/command topic. As you can see, the actual construction and publishing of the messages is done in a separate thread.
Make sure to declare any undeclared global variables. Your global variables list should look like this:
onNodeDestroy() is what happens when the node gets shutdown. You want to shutdown your spineThread and your publisher, spinePub:
1 @Override 2 protected void onNodeDestroy(Node node) { 3 super.onNodeDestroy(node); 4 final Thread thread = spineThread; 5 if (thread != null) { 6 spineThread.interrupt(); 7 } 8 spineThread = null; 9 final Publisher pub = spinePub; 10 if (pub != null) { 11 pub.shutdown(); 12 } 13 spinePub = null; 14 }
At the bottom you'll see code for handling the options menu. This can be left as is, or you can change it as necessary.
Now it's time to deal with the services. How will we make the robot give high fives? What we do is make a method called runService which does all the work of actually running the services. It takes a string for the service name and then creates a service client to send messages to the service node on the robot-side. In this case it actually just sends empty messages and gets empty responses. Our runService() method might look something like this:
1 private void runService(String service) { 2 Log.i("Pr2Props2", "Run: " + service); 3 try { 4 ServiceClient<Empty.Request, Empty.Response> appServiceClient = 5 getNode().newServiceClient(service, "std_srvs/Empty"); 6 Empty.Request appRequest = new Empty.Request(); 7 appServiceClient.call(appRequest, new ServiceResponseListener<Empty.Response>() { 8 @Override public void onSuccess(Empty.Response message) { 9 } 10 11 @Override public void onFailure(RemoteException e) { 12 //TODO: SHOULD ERROR 13 Log.e("Pr2Props2", e.toString()); 14 } 15 }); 16 } catch (Exception e) { 17 //TODO: should error 18 Log.e("Pr2Props2", e.toString()); 19 } 20 }
So that was how the client is going to make the requests, but where do the requests get made? In the Props App, the user hits a button to trigger each of the actions high five left, props right, raising the torso, etc. We'll briefly see what the buttons look like in the layout xml later but right now we can just make a bunch of callbacks to use runService() when buttons are clicked. For example:
1 public void highFiveLeft(View view) { 2 runService("/pr2_props/high_five_left"); 3 } 4 public void highFiveRight(View view) { 5 runService("/pr2_props/high_five_right"); 6 } 7 public void highFiveDouble(View view) { 8 runService("/pr2_props/high_five_double"); 9 } 10 public void lowFiveLeft(View view) { 11 runService("/pr2_props/low_five_left"); 12 } 13 public void lowFiveRight(View view) { 14 runService("/pr2_props/low_five_right"); 15 } 16 public void poundLeft(View view) { 17 runService("/pr2_props/pound_left"); 18 } 19 public void poundRight(View view) { 20 runService("/pr2_props/low_five_right"); 21 } 22 public void poundDouble(View view) { 23 runService("/pr2_props/pound_double"); 24 } 25 public void hug(View view) { 26 runService("/pr2_props/hug"); 27 } 28 public void raiseSpine(View view) { 29 spineHeight = 0.31; 30 } 31 public void lowerSpine(View view) { 32 spineHeight = 0.0; 33 }
The last two methods there aren't actually service calls. Those are just setting the spine height. The spine publisher thread will pick up on that and publish the corresponding messages.
Finally you should make sure you're importing all the right things. If you try to build it, you'll probably find out what's missing. Just in case though, these are the import statements from the original Props App and we can just steal those:
1 import org.ros.exception.RemoteException; 2 import ros.android.activity.AppManager; 3 import ros.android.activity.RosAppActivity; 4 import android.os.Bundle; 5 import org.ros.node.Node; 6 import android.view.Window; 7 import android.view.WindowManager; 8 import android.util.Log; 9 import org.ros.node.service.ServiceClient; 10 import org.ros.node.topic.Publisher; 11 import org.ros.service.app_manager.StartApp; 12 import org.ros.node.service.ServiceResponseListener; 13 import android.widget.Toast; 14 import android.view.Menu; 15 import android.view.View; 16 import android.view.MenuInflater; 17 import android.view.MenuItem; 18 import android.widget.LinearLayout; 19 import org.ros.service.std_srvs.Empty; 20 import org.ros.message.trajectory_msgs.JointTrajectory; 21 import org.ros.message.trajectory_msgs.JointTrajectoryPoint; 22 import java.util.ArrayList; 23 import org.ros.message.Duration;
Congratulations! That's pretty much all the java code you'll have to write for this app! If you want, you can skip down to the part where we write the corresponding robot-side code and give it a quick read before finishing up the Android side. It might make more sense if done that way.
Layout XML
If you navigate to the root of your package and then to res/layout, there will be the layout xml in main.xml. If you're familiar with Android layouts then this should be easy and you can definitely skip this part of the tutorial.
There are a lot of different ways to accomplish the same thing with layouts, so the exact implementation can be somewhat arbitrary. Let's consider what we want to accomplish. We want to have a button for each action that we defined in our activity. It's a lot of buttons. We should probably group the similar buttons together under headings (all the high fives together, all the props together, changing torso height, etc). We should make the view scroll in case the app will be run on a device where not all the content fits on the screen at once.
To do that we can use a LinearLayout as the main layout. Then, we should have another LinearLayout inside that one, which will be the top_bar and have the dashboard components that you might have seen in the ROS Android apps. This shows basic status information about the robot (battery, run-stop status). The top_bar layout does not contain any other layouts. Our main layout should contain a ScrollView. The ScrollView's child can be another LinearLayout containing the buttons grouped under TextViews for headings. You can implement this yourself. The only trick with the buttons is that you have to make sure to define the names of the OnClick methods for your buttons in the xml since we didn't declare them in the activity. If you have any trouble you can take a look at the actual Props implementation at:
roscd android_pr2_props vi res/layout/main.xml
If you write a couple of button descriptions and decide that it's too much typing for the moment you can actually just copy the main.xml from the original Props App. We don't need to change it.
cp `rospack find android_pr2_props`/res/layout/main.xml res/layout
Update Manifest
We need to make some minor changes to our manifest.xml as well. It can be found in the root of our package. Right now we depend only on the appmanandroid library. With the latest version of rosjava we should also explicitly depend on std_msgs and trajectory_msgs. Just add these two lines after the other package dependency:
And that's it. Since we changed the manifest.xml we have to rosmake it again. If you make changes that do not change the manifest.xml you can use ant instead.
rosmake --threads=1
If you want to iteratively make changes to the app but you're not changing the manifest.xml then the best way to do it is to use ant. The following commands will build your project and clean it.
ant ant clean
If you've made changes then it's important to clean the project before installing the app on a device because depending on which files have changed, ant might not recreate the class files appropriately. To install it on your device you can use:
ant debug install
If this fails then it may be because your computer does not recognize your Android device. That is outside the scope of this tutorial but you are encouraged to Google vigorously.
Robot-side Application
Writing the Python Script
The robot-side of the application must have a stack. In this case we're not going to release a whole new stack for our application. Since we're just testing we'll log (ssh) into the robot as the user 'applications' and put our stack under the ROS install directory. If this is a PR2 then it may be a directory called 'ros' in the applications user home directory:
cd ros mkdir pr2_props2_app
The main part of the app here is a python script. Inside pr2_props2_app we can make a directory called 'scripts' and inside make a file called prop_runner with the editor of your choice.
cd pr2_props2_app mkdir scripts cd scripts vi prop_runner
The start of our python script will look like this:
We're importing and using roslib only for bootstrapping reasons. It is appropriate to use rospy for most of your ROS Python needs. We then import rospy and os. We import os because we're actually going to use os.system to rosrun scripts to do the positioning for us. All we're going to do is queue a bunch of requests to run scripts and then send them to the system to run. We import everything from std_srvs.srv to allow us to respond to service requests. Also, if you don't usually write anything in Python, remember Python is whitespace delimited!
Let's start by making our QueueItem class. This is just an object to hold on to the command we're going to have the system execute and let us know when it's done. Let's also create an item and put it into a queue.
Next as a way for things to get added to our queue, we'll make run_command:
run_command will add create QueueItems out of the commands you want to run and add them to the queue. Now we have to actually figure out the commands that we want run.
If you navigate to /opt/ros/electric/stacks/pr2_props_stack/pr2_props/src you'll see a couple of .cpp files that basically just run a few different actions. That's what we want to run when the user presses a button in the app. We can use the rosrun command for that.
Let's make methods for each of the buttons in the app that can be pushed (except for the buttons to raise and lower the torso, those buttons have no robot-side code because they publish messages straight to topics that the spine subscribes to). Each method should queue a command to rosrun the appropriate script out of the ones we saw earlier:
1 def high_five_double(msg): 2 run_command("rosrun pr2_props high_five double") 3 return EmptyResponse() 4 5 def high_five_left(msg): 6 run_command("rosrun pr2_props high_five left") 7 return EmptyResponse() 8 9 def high_five_right(msg): 10 run_command("rosrun pr2_props high_five right") 11 return EmptyResponse() 12 13 def low_five_left(msg): 14 run_command("rosrun pr2_props low_five left") 15 return EmptyResponse() 16 17 def low_five_right(msg): 18 run_command("rosrun pr2_props low_five right") 19 return EmptyResponse() 20 21 def pound_double(msg): 22 run_command("rosrun pr2_props pound double") 23 return EmptyResponse() 24 25 def pound_left(msg): 26 run_command("rosrun pr2_props pound left") 27 return EmptyResponse() 28 29 def pound_right(msg): 30 run_command("rosrun pr2_props pound right") 31 return EmptyResponse() 32 33 def hug(msg): 34 run_command("rosrun pr2_props hug") 35 return EmptyResponse()
You'll notice that they take in a msg. These methods are the handlers that rospy.Service() will make callbacks to in the main function. rospy.Service() recieves messages from the service client we created on the Android side.
Now it's time to use this stuff in the main function. We should create a node, which we can call 'pr2_props2_app' and then make the callbacks to our handlers that we just wrote.
1 if __name__ == "__main__": 2 rospy.init_node("pr2_props2_app") 3 s1 = rospy.Service('pr2_props/high_five_double', Empty, high_five_double) 4 s2 = rospy.Service('pr2_props/high_five_left', Empty, high_five_left) 5 s3 = rospy.Service('pr2_props/high_five_right', Empty, high_five_right) 6 s4 = rospy.Service('pr2_props/low_five_right', Empty, low_five_right) 7 s5 = rospy.Service('pr2_props/low_five_left', Empty, low_five_left) 8 s6 = rospy.Service('pr2_props/pound_double', Empty, pound_double) 9 s7 = rospy.Service('pr2_props/pound_left', Empty, pound_left) 10 s8 = rospy.Service('pr2_props/pound_right', Empty, pound_right) 11 s9 = rospy.Service('pr2_props/hug', Empty, hug)
You'll notice that the on the Android side we sent empty messages and here we're returning empty responses. This is because it's not necessary to get any extra content from the message. The fact that it was sent/executed is sufficient. The last thing we need is to actually read from the queue we created and have the system run those 'rosrun pr2_props ...' commands. We can make a loop to go through the queue while the node is not shutdown, execute the goals, and remove them from the queue.
This will create the behavior that when you press buttons more quickly than the actions can execute, your requests get queued. So if you were to press 'hug' ten times then the robot would sit there for about 3 minutes and give all ten hugs in sequence.
That's really it for the python code even though we cheated and used those .cpp scripts. For the next few sections we'll be basically following the steps from this tutorial: ApplicationsPlatform/CreatingAnApp
Launch File
Next we need to write a launch file for the application. We will place it in a directory called 'launch' and call it 'pr2_props_app.launch'.
roscd pr2_props2_app mkdir launch vi pr2_props_app.launch
The launch file will help launch the correct nodes when the application is started. The ROS Application Chooser (which you will want to download from the Android Market if you are going to be running any ROS Android applications on an Android device) will use these launch files when you start apps from insider the App Chooser. If you do not start your ROS app from inside the app chooser then you will have roslaunch the launch file yourself from your computer. For information on the format of the launch files see roslaunch/XML. Your launch file should look something like this:
1 <launch> 2 <include file="$(find pr2_props)/launch/pr2_props.launch" /> 3 <node pkg="pr2_props2_app" type="prop_runner" name="pr2_props2_app" /> 4 <node pkg="pr2_position_scripts" type="head_up.py" name="head_up" /> 5 </launch>
What we're doing is including another .launch file. It's actually in pr2_props_stack. You can roscd to pr2_props_stack and you'll see the package that we're searching for, pr2_props. Inside is the launch file we want to include. Then we also create a node for what's running in our Python script and also for the position scripts that make the robot face forward when we start up the app.
Interface File
The interface file is a file that is essentially blank for now. In the future it will be more important. It should look like this and be named 'pr2_props_app.interface' and it should also be in the root of the package:
published_topics: {} subscribed_topics: {}
Icon
For now we're actually just going to steal the icon from the original Props app. You should definitely get your own eventually when you make real apps, but that's up to you. Go to the root to the package and type:
cp `rospack find pr2_props_app`/pr2props.jpg pr2props2.jpg
App File
The .app file is what the app manager uses to find out about your application. Ours will look like this:
display: Props2 description: Run PR2 Props platform: pr2 launch: pr2_props2_app/pr2_props2_app.launch interface: pr2_props2_app/pr2_props2_app.interface icon: pr2_props2_app/pr2props2.jpg clients: - type: android manager: api-level: 9 intent-action: ros.android.pr2props2.Pr2Props2 app: gravityMode: 0 camera_topic: /wide_stereo/left/image_color/compressed_throttle
Most of that is pretty straightforward. One thing to be aware of is that the path names are all ROS path names so they just have the package_name/file_name no matter how many directories down in the package the file is.
Installing App
We have to add your package/unary stack to the .rosinstall file. Make sure you're in the ROS install directory. Then add the following line to the .rosinstall file:
- other: {local-name: pr2_props2_app}
After you save and close:
rosinstall .
Now add:
echo "Sourcing /u/applications/ros/setup.bash" . /u/applications/ros/setup.bash
to the .bashrc in the home directory of the applications user.
Now we have to make a .installed file. Go to the local_apps directory (should be located under the home directory). We will name the file pr2_props2_app.installed and it will contain the following:
apps: - app: pr2_props2_app/pr2_props2_app display: Pr2 Props2 App
It's actually pointing to the .app file. This is hard to tell since we named everything 'pr2_props2_app'. But we don't include the .app extension because it gets automatically added.
Loose Ends: Makefile, stack.xml, manifest.xml, etc
There are a few more things to take care of before we can actually run the app. Because we just created this stack now, it's missing some important things that it should have.
We need a Makefile and CMakeLists.txt. If you want some background information on making those files you can look here rospy_tutorials/Tutorials/Makefile. We could have used roscreate-pkg to create our package at the start and that would have generated a template of these files for us. However since they're each only a few lines long we can make them ourselves this time.
First let's roscd to our package. Our Makefile only has to be one line:
include $(shell rospack find mk)/cmake_stack.mk
And our CMakeLists.txt looks like this inside:
cmake_minimum_required(VERSION 2.4.6) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) rosbuild_make_distribution(0.1.0)
Alternatively you can also just copy the same files from the original Props:
cp `rospack find pr2_props_app`/Makefile Makefile cp `rospack find pr2_props_app`/CMakeLists.txt CMakeLists.txt
We also need to make a manifest.xml. It's pretty standard in terms of dependencies and should look like this:
1 <package> 2 <description brief="PR2 Props2 App"> 3 Application files for running PR2 props 4 </description> 5 <author>You</author> 6 <license>BSD</license> 7 <url></url> 8 <review status="na" notes="" /> 9 <depend package="roslib" /> 10 <depend package="rospy" /> 11 <depend package="pr2_props" /> 12 <depend package="pr2_position_scripts" /> 13 <depend package="std_srvs" /> 14 <platform os="ubuntu" version="9.04"/> 15 <platform os="ubuntu" version="9.10"/> 16 <platform os="ubuntu" version="10.04"/> 17 </package>
We also need a stack description in the form of the stack.xml:
<stack> <description brief="pr2_props2_app">pr2_props_app</description> <author>Maintained by Applications Manager</author> <license>BSD</license> <review status="unreviewed" notes=""/> <url></url> <depend stack="pr2_apps" /> <!-- pr2_position_scripts --> <depend stack="pr2_props_stack" /> <!-- pr2_props --> <depend stack="ros" /> <!-- roslib --> <depend stack="ros_comm" /> <!-- std_srvs, rospy --> </stack>
Now we're done. Almost. We need to put a ROS_NOBUILD file in the root of the package/unary stack so that rosmake skips it. This file does not have any real content. We can just copy it from the original Props stack.
cp `rospack find pr2_props_app`/ROS_NOBUILD ROS_NOBUILD
Done! Deactivate and restart your robot (from the ROS Application Chooser you can push the "Deactivate" button). Once you reconnect, you should see your application listed in the Application Chooser.
If you see no applications listed, this means that your application's formatting is invalid, and it has caused errors. If you do not see your application listed at all, this means that you have skipped a step or failed to restart the app manager.
If there is an error, deactivate your robot, and find the latest log in the ~/.ros directory of the applications user. The *app_manager* files should tell you a bit about what happened.
If you see your application, click it to start it. You should see the application highlight and see your ROS nodes running, just as if you launched the roslaunch file manually.
You should run your applications through the Application Chooser because it will roslaunch the appropriate nodes for you. If you do not go through the App Chooser and instead just try to run the application by itself, you will have the manually roslaunch the .launch file for your application, probably from your computer.
|
https://wiki.ros.org/ApplicationsPlatform/Clients/Android/Tutorials/HowToWritePr2Props
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
Overview
Contents
Overview¶
Harmonica provides functions and classes for processing, modelling and interpolating gravity and magnetic data.
Its main goals are:
Provide efficient, well designed, and fully tested code that would compress the building blocks for more complex workflows.
Cover the entire data life-cycle: from raw data to 3D Earth model.
Focus on best-practices to discourage misuse of methods.
Easily extendable code to enable research on the developments of new methods.
Harmonica will not provide:
Multi-physics partial differential equation solvers. Use SimPEG or PyGIMLi instead.
Generic processing methods like grid transformations (use Verde or Xarray instead) or multidimensional FFT calculations (use xrft instead).
Reference ellipsoid representations and computations like normal gravity. Use Boule instead.
Data visualization functions. Use matplotlib for generic plots, Xarray for plotting grids, PyGMT for maps, and PyVista for 3D visualizations.
GUI applications.
Conventions¶
Before we get started, here are a few conventions we keep across Harmonica:
Every physical quantity will be assumed to be given in a unit belonging to the International System of Units (SI). The only exceptions are:
gravity accelerations are expected in miligal (mGal) (\(1~\text{mGal} = 10^{-5}~\text{m}/\text{s}^2\)).
gravity tensor components are assumed to be in Eotvos (\(1~\text{Eotvos} = 10^{-9}~\text{s}^{-2}\)).
magnetic fields are given in nano Tesla (nT).
Harmonica uses the same conventions as
verde, meaning:
Functions expect coordinates in the order: West-East, South-North and (in occasions) Bottom-Top. Exceptions to this rule are the
dimsand
shapearguments.
We avoid using names like “x”, “y” and “z” to avoid ambiguity. We use “easting”, “northing” and “upward” or “longitude”, “latitude” and “height” instead.
Some functions or classes expect its arguments to be defined in a specific coordinate system. They can either be in:
Cartesian coordinates: usually given as easting, northing and upward coordinates (in meters), where the vertical axis points upwards.
Geodetic or ellipsoidal coordinates: given as longitude, latitude (both in decimal degrees) and geodetic height (in meters).
Spherical geocentric coordinates: given as longitude, spherical latitude (both in decimal degrees) and radius (in meters).
See also
Checkout the Coordinate systems section for more details on these coordinates systems.
The Library¶
Most classes and functions are available through the
harmonica top level
package. Througout the documentation, we’ll use
hm as an alias for
harmonica.
import harmonica as hm
See also
Checkout the API Reference for a comprehensive list of the available function and classes in Harmonica.
|
https://www.fatiando.org/harmonica/latest/overview.html
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
1578942712
You will learn: presentation, WSO2’s Senior Technical Lead, Ishara Karunarathna, will discuss how to augment service mesh functionality with API management capabilities, so you can create an end-to-end solution for your entire business functionality — from microservices, to APIs, to end-user applications.
#microservices #api #web-development #kubernetes
1593220572
Before going to deploy the service into istio let’s first understand what is service mesh.
The service mesh is a dedicated infrastructure layer for handling service to service communication.
Basically, it’s a way to control how different micro services deployed on Kubernetes will manage secure communication and traffic between them with lots of cross-cutting concerns like logging, security, etc.
Istio service mesh comes with lot’s of feature like –
we will not talk about the feature here, Let’s jump over to how we can deploy here so we categories the deployment process in 3 phases.
For downloading the latest version we can refer to the release page. Just download the tar.gz file and unzip it. In the directory, we will find istioctl client which we can use
Now set the istioctl client to your machine path and for installation we need to choose the configuration profile. There are a set of configuration profiles, we are going to use a demo profile which enables the components according to default settings.
use the following command for installing the demo configuration profile.
istioctl install --set profile=demo
As we know, istio automatically injects Envoy sidecar proxies using mutating webhook admission controllers when we deploy services in a particular namespace. To enable this feature we need to enable the istio-injection in a particular namespace where we will deploy the application.
kubectl label namespace default istio-injection=enabled
Now let’s deploy the sample application by applying the following yaml file.
apiVersion: v1 kind: Service metadata: name: sample namespace: default labels: app: sample spec: selector: app: sample ports: - name: http port: 8081 --- apiVersion: apps/v1 kind: Deployment metadata: name: sample namespace: default spec: replicas: 1 selector: matchLabels: app: sample version: 'v1' template: metadata: labels: app: sample version: 'v1' spec: initContainers: - name: init-ds image: busybox:latest command: - '/bin/sh' - '-c' - | while true do if [ $? -eq 0 ]; then echo "DB is UP" break fi echo "DB is not yet reachable;sleep for 10s before retry" sleep 10 done containers: - name: sample-app image: lokesh/bundle123:latest imagePullPolicy: Always env: - name: SPRING_PROFILES_ACTIVE value: prod - name: SPRING_SLEUTH_PROPAGATION_KEYS value: 'x-request-id,x-ot-span-context' - name: JAVA_OPTS value: ' -Xmx256m -Xms256m' resources: requests: memory: '256Mi' cpu: '50m' limits: memory: '512Mi' cpu: '1' ports: - name: http containerPort: 8081 --- apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: sample spec: hosts: - "*" gateways: - sample-gateway http: - match: - uri: exact: /getStudents - uri: exact: /accounts/create - uri: exact: /istio/auth - uri: prefix: /getTeacher route: - destination: host: sample port: number: 8081
#devops #microservices #scala #tech blogs #deploy microservice #istio #service mesh
|
https://morioh.com/p/96e22f5f6095
|
CC-MAIN-2022-40
|
en
|
refinedweb
|
Nenv
Using ENV in Ruby is like using raw SQL statements - it feels wrong, because it is.
If you agree, this gem is for you.
The benefits over using ENV directly:
- much friendlier stubbing in tests
- you no longer have to care whether false is "0" or "false" or whatever
- NO MORE ALL CAPS EVERYWHERE!
- keys become methods
- namespaces which can be passed around as objects
- you can subclass!
- you can marshal/unmarshal your own types automatically!
- strict mode saves you from doing validation yourself
- and there's more to come...
Other benefits (and compared to other solutions):
- should still work with Ruby 1.8 (in case anyone is still stuck with it)
- it's designed to be as lightweight and as fast as possible compared to ENV
- designed to be both hackable and convenient
Installation
Add this line to your application's Gemfile:
gem 'nenv', '~> 0.1'
And then execute:
$ bundle
Or install it yourself as:
$ gem install nenv
Examples !!!
Automatic booleans
You no longer have to care whether the value is "0" or "false" or "no" or "FALSE" or ... whatever
# Without Nenv t.verbose = (ENV['CI'] == 'true') ok = ENV['RUBYGEMS_GEMDEPS'] == "1" || ENV.key?('BUNDLE_GEMFILE') ENV['DEBUG'] = "true"
now becomes:
t.verbose = Nenv.ci? gemdeps = Nenv.rubygems_gemdeps? || Nenv.bundle_gemfile? Nenv.debug = true
"Namespaces"
# Without Nenv puts ENV['GIT_BROWSER'] puts ENV['GIT_PAGER'] puts ENV['GIT_EDITOR']
now becomes:
git = Nenv :git puts git.browser puts git.pager puts git.editor
Or in block form
Nenv :git do |git| puts git.browser puts git.pager puts git.editor end
Custom type handling
# Code without Nenv paths = [ENV['GEM_HOME`]] + ENV['GEM_PATH'].split(':') enable_logging if Integer(ENV['WEB_CONCURRENCY']) > 1 mydata = YAML.load(ENV['MY_DATA']) ENV['VERBOSE'] = debug ? "1" : nil
can become:
# setup gem = Nenv :gem gem.instance.create_method(:path) { |p| p.split(':') } web = Nenv :web web.instance.create_method(:concurrency) { |c| Integer(c) } my = Nenv :my my.instance.create_method(:data) { |d| YAML.load(d) } Nenv.instance.create_method(:verbose=) { |v| v ? 1 : nil } # and then you can simply do: paths = [gem.home] + gem.path enable_logging if web.concurrency > 1 mydata = my.data Nenv.verbose = debug
Automatic conversion to string
ENV['RUBYGEMS_GEMDEPS'] = 1 # TypeError: no implicit conversion of Fixnum (...)
Nenv automatically uses
to_s:
Nenv.rubygems_gemdeps = 1 # no problem here
Custom assignment
data = YAML.load(ENV['MY_DATA']) data[:foo] = :bar ENV['MY_DATA'] = YAML.dump(data)
can now become:
my = Nenv :my my.instance.create_method(:data) { |d| YAML.load(d) } my.instance.create_method(:data=) { |d| YAML.dump(d) } data = my.data data[:foo] = :bar my.data = data
Strict mode
# Without Nenv fail 'home not allowed' if ENV['HOME'] = Dir.pwd # BUG! Assignment instead of comparing! puts ENV['HOME'] # Now contains clobbered value
Now, clobbering can be prevented:
env = Nenv::Environment.new env.create_method(:home) fail 'home not allowed' if env.home = Dir.pwd # Fails with NoMethodError puts env.home # works
Mashup mode
You can first define all the load/dump logic globally in one place
Nenv.instance.create_method(:web_concurrency) { |d| Integer(d) } Nenv.instance.create_method(:web_concurrency=) Nenv.instance.create_method(:path) { |p| Pathname(p.split(File::PATH_SEPARATOR)) } Nenv.instance.create_method(:path=) { |array| array.map(&:to_s).join(File::PATH_SEPARATOR) } # And now, anywhere in your app: Nenv.web_concurrency += 3 Nenv.path += Pathname.pwd + "foo"
Your own class (recommended version for simpler unit tests)
MyEnv = Nenv::Builder.build do create_method(:foo?) end MyEnv.new('my').foo? # same as ENV['MY_FOO'][/^(?:false|no|n|0)/i,1].nil?
Your own class (dynamic version - not recommended because harder to test)
class MyEnv < Nenv::Environment def initialize super("my") create_method(:foo?) end end MyEnv.new.foo? # same as ENV['MY_FOO'][/^(?:false|no|n|0)/i,1].nil?
NOTES
Still, avoid using environment variables if you can.
At least, avoid actually setting them - especially in multithreaded apps.
As for Nenv, while you can access the same variable with or without namespaces, filters are tied to instances, e.g.:
Nenv.instance.create_method(:foo_bar) { |d| Integer(d) } Nenv('foo').instance.create_method(:bar) { |d| Float(d) } env = Nenv::Environment.new(:foo).tap { |e| e.create_method(:bar) }
all work on the same variable, but each uses a different filter for reading the value.
Documentation / SemVer / API
Any behavior not mentioned here (in this README) is subject to change. This includes module names, class names, file names, method names, etc.
If you are relying on behavior not documented here, please open a ticket.
What's wrong with ENV?
Well sure, having ENV act like a Hash is much better than calling "getenv".
Unfortunately, the advantages of using ENV make no sense:
- it's faster but ... environment variables are rarely used thousands of times in tight loops
- it's already an object ... but there's not much you can do with it (try ENV.class)
- it's globally available ... but you can't isolate it in tests (you need to reset it every time)
- you can use it to set variables ... but it's named like a const
- it allows you to use keys regardless of case ... but by convention lowercase shouldn't be used except for local variables (which are only really used by shell scripts)
- it's supposed to look ugly to discourage use ... but often your app/gem is forced to use 3rd party environment variables anyway
- it's a simple Hash-like class ... but either you encapsulate it in your own classes - or all the value mapping/validation happens everywhere you want the data (yuck!)
But the BIGGEST disadvantage is in specs, e.g.:
allow(ENV).to receive(:[]).with('MY_VARIABLE').and_return("foo") allow(ENV).to receive(:[]=).with('MY_VARIABLE', "foo bar") # (and if you get the above wrong, you may be debugging for a long, long time...)
which could instead be completely isolated as (and without side effects):
allow(env).to receive(:variable).and_return("foo") expect(env).to receive(:variable=).with("foo bar") # (with verifying doubles it's hard to get it wrong and get stuck)
Here's a full example:
# In your implementation MyEnv = Nenv::Builder.build do create_method(:variable) create_method(:variable=) end class Foo def foo MyEnv.new(:my).variable += "bar" end end # Stubbing the class in your specs RSpec.describe Foo do let(:env) { instance_double(MyEnv) } before { allow(MyEnv).to receive(:new).with(:my).and_return(env) } describe "#foo" do before { allow(env).to receive(:variable).and_return("foo") } it "appends a value" do expect(env).to receive(:variable=).with("foo bar") subject.foo end end end
Contributing
- Fork it ([my-github-username]/nenv/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request
|
https://www.rubydoc.info/gems/nenv/0.3.0
|
CC-MAIN-2020-50
|
en
|
refinedweb
|
Host library for controlling a WiConnect enabled Wi-Fi module.
Dependents: wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more
« Back to documentation index
The root WiConnect library class. More...
#include <WiconnectInterface.h>
Inherits wiconnect::NetworkInterface, wiconnect::SocketInterface, wiconnect::FileInterface, and wiconnect::GhmInterface.
Detailed Description
The root WiConnect library class.
This class inheriets all WiConnect functionality.
This class is implemented as a 'singleton'. This means it only needs to be instantiated once. Subsequent class may either use the class instance or the static function: Wiconnect::getInstance()
Definition at line 78 of file WiconnectInterface.h.
Constructor & Destructor Documentation
WiConnect class constructor.
- Note:
- This should only be called once within a program as the WiConnect library is implemented as a singleton.
- If this constructor is used, then all commands must be supplied with an external response buffer. This means most the API functions will not work as they use the internal buffer. It's recommended to use the other constructor that supplies an internal buffer. See Dynamic / Static Allocation
- Parameters:
-
Definition at line 109 of file Wiconnect.cpp.
WiConnect class constructor.
- Note:
- This should only be called once within a program as the WiConnect library is implemented as a singleton.
- This is the recommended construstor as it supplies the WiConnect library with an internal buffer. Most API calls require the internal buffer.
- Parameters:
-
Definition at line 98 of file Wiconnect.cpp.
Generated on Mon Dec 17 2018 18:50:02 by
|
https://os.mbed.com/teams/ACKme/code/WiConnect/docs/tip/classwiconnect_1_1Wiconnect.html
|
CC-MAIN-2020-50
|
en
|
refinedweb
|
Asked by:
Why is predicate misinterpreting parameters' values when called in recursive function
Question
I'm trying to create a extended treeview control inheriting from the existing winform TreeView control. Created a
Load()function in the class TreeViewEx. In this function the dataSource is looped in a foreach. This foreach then calls the
Where()extension method on the looping dataSource passing to it a methode (which takes as parameter the current element) returning a predicate. This predicate misintepretes the parameter value passed to it. It seems to be using previous parameter values.
Initially i thought this behavior was due to the fact that i am iterating through an
Enumerablenot a list, so i change the different enumerables to List but nothing changed. Also tried to instatiate the returned predicate but nothing.
Load function :
public Func<T, Func<T, bool>> GetChildrenPredicate { get; set; } . . . public virtual void Load(List<T> dataSource = null) { try { if (CreateNode == null) { OnError?.Invoke(this, new ArgumentNullException("CreateNode")); return; } if (GetParentKey == null) { OnError?.Invoke(this, new ArgumentNullException("GetParentKey")); return; } if (GetChildrenPredicate == null) { OnError?.Invoke(this, new ArgumentNullException("GetChildrenPredicate")); return; } var finalDataSource = dataSource ?? DataSource; TreeNode node = null; BeginUpdate(); foreach (var item in finalDataSource) { node = CreateNode(item); node.Tag = item; if (this.Nodes.Find(node.Name, true).Count() == 0) { var n = this.Nodes.Find(this.GetParentKey(item), true).FirstOrDefault() as TreeNode; if (n == null) { this.Nodes.Add(node); } else { n.Nodes.Add(node); } List<T> children = finalDataSource .ToList() .Where(this.GetChildrenPredicate(item)) .ToList(); //this.GetChildrenPredicate is //the property func generating the //predicate set by a different class if (children.Count() > 0) { // Recursively call this function for all childRows Load(children); } } } EndUpdate(); } catch (Exception ex) { OnError?.Invoke(this, ex); } }
GetChildrenPredicate :
private Func<ORM.DataModels.Menu, bool> GetChildrenPredicate(ORM.DataModels.Menu arg) { return (ORM.DataModels.Menu m) => (m.Lepere == arg.Codmen) || (m.Lepere == null && arg.Codmen == "_" + m.Niveau); }
All replies
- Ok. I found the solution. Actually i did not realized that `finalDataSource` was overriden on each call of `Load()`. I was only focused on the weird behaviour of the predicate. just had to used the global DataSource property defined in the class.
List<T> children = this.DataSource.Where(this.GetChildrenPredicate(item)); //<= changed local variable finalDataSource to the defined property this.DataSource
- Proposed as answer by Wendy ZangMicrosoft contingent staff, Moderator Tuesday, April 9, 2019 4:20 AM
Hi Etienne Yamsi,
Thanks for your sharing.
Please mark the solution as answer. This will make answer searching easier in the forum and be beneficial to community members as well..
|
https://social.msdn.microsoft.com/Forums/en-US/981ebad8-fe2d-43b6-8a05-c2b988373fa1/why-is-predicate-misinterpreting-parameters-values-when-called-in-recursive-function?forum=netfxbcl
|
CC-MAIN-2020-50
|
en
|
refinedweb
|
Jim Miller
Joined
Activity
In case someone stumbles across this and needs an answer. Modify message_list_controller:
app/javascript/controllers/message_list_controller.js
_cableReceived(data) { this.messagesTarget.innerHTML += data.message; }
Hi,
I'm having some issues with Stimulus and I was hoping that someone could review this code and see if they see anything that I missed.
The Rails part is working and saving to the db. I'm sure that I have a typo somewhere...
Here is what I have:
app/channels/message_channel.rb
class MessageChannel < ApplicationCable::Channel def subscribed stream_from 'message_channel' end def unsubscribed stop_all_streams end end
app/javascript/controllers/message_list_controller.js
import { Controller } from "stimulus"; import consumer from "../channels/consumer"; export default class extends Controller { static targets = ["input", "messages"]; connect() { this.channel = consumer.subscriptions.create("MessageChannel", { connected: this._cableConnected.bind(this), disconnected: this._cableDisconnected.bind(this), received: this._cableReceived.bind(this), }); } clearInput() { this.inputTarget.value = ""; } _cableConnected() {} _cableDisconnected() {} _cableReceived() { this.messagesTarget.innerHTML += data.message; } }
app/controllers/messages_controller.rb
class MessagesController < ApplicationController before_action :set_message, only: [:show, :edit, :update, :destroy] def index @messages = Message.all end def create @message = Message.new(params.require(:message).permit(:content)) @message.save! ActionCable.server.broadcast('message_channel', message: (render @message)) head :ok end private def set_message @message = Message.find(params[:id]) end def message_params params.require(:message).permit(:content) end end
app/views/messages/index.html.erb
<p id="notice"><%= notice %></p> <h1>Messages</h1> <div data- <div data- <%= render @messages %> </div> <%= form_with(model: Message.new, data: { action: 'ajax:success->message-list#clearInput' }) do |form| %> <%= form.text_area :content, data: { target: 'message-list.input' }, rows: 1, autofocus: true %> <%= form.submit class: "btn btn-default" %> <% end %> </div>
Thanks!
Updated my controller but still no go:
def create message = @hangout.messages.new(message_params) message.user = current_user respond_to do |format| if message.save format.html { redirect_to @hangout, notice: 'Success' } format.js else format.html { render action: 'new' } end end
BTW, I am working on this Lesson:
Group Chat with ActionCable: Part 3
I am using Rails 6. I have a form that I need to pass
remote: true so I get POST to process as JS:
LOG: MessagesController#create as JS
Here is what I have tried:
<%= form_for [@hangout, Message.new] do |f| %>
The result is a good save to the DB but processes as HTML:
LOG: MessagesController#create as HTML
So I tried:
<%= form_for [@hangout, Message.new], remote: true do |f| %>
I learned that this would give an InvalidAuthenticityToken error:
LOG: ActionController::InvalidAuthenticityToken - ActionController::InvalidAuthenticityToken:
Tried this:
<%= form_for [@hangout, Message.new], authenticity_token: true do |f| %>
It passes as HTML, not JS
I read that for Rails 6, the best way to do this was with form_with because it passes
remote:true:
<%= form_with(model: [@hangout, Message.new]) do |f| %>
Unfortunately, this never reaches the controller so I get no response. I know that my model and controller are set up properly since the first try with form_for works, so it has to be with the way I am writing my form_with, right?
Does anyone have any advice?
Thanks!
#model class Message < ApplicationRecord belongs_to :hangout belongs_to :user end #controller class MessagesController < ApplicationController before_action :authenticate_user! before_action :set_hangout def create message = @hangout.messages.new(message_params) message.user = current_user message.save redirect_to @hangout end private def set_hangout @hangout = Hangout.find(params[:hangout_id]) end def message_params params.require(:message).permit(:body) end end #routes require 'sidekiq/web' Rails.application.routes.draw do resources :hangouts do resource :hangout_users resources :messages end resources :notes authenticate :user, lambda { |u| u.admin? } do mount Sidekiq::Web => '/sidekiq' end devise_for :users, controllers: { registrations: 'users/registrations' } get 'mine', to: 'notes#mine' root to: 'application#root' mount Shrine.presign_endpoint(:cache) => '/images/upload' end
Posted in Help with Debugging
Hi all,
I am trying to help out an open source project that I use. I found an issue and the developer has asked me to help debug the javascript but I'm a javascript hack and not sure how to do it.
Background:
- The project is coc-tailwindcss
- The plugin works in one project but not the other. Here's the issue:
- The developer says the LSP init fail, debug the error at line:
- The developer asked me "Use console.log to print info to output channel or follow"
I have at least 2 questions:
- The developer wants the console.log() on 7134. Exactly where in the code should I put it and what variable should I use?
- I'm assuming that the output would be in :CocCommand workspace.showOutput but I'm not sure. Am I right? Is there another spot to output?
I appreciate any help!!
Jim
Posted in How to Set Up a Stripe Scheduled Subscription with an option for Deposit but with only X months to Pay the Balance?
";)
Posted in How to Set Up a Stripe Scheduled Subscription with an option for Deposit but with only X months to Pay the Balance?
Its only "Very cool" if it works! LOL
So you are basically saying that I control everything in Rails and just use Stripe as the final payment method, right?
So like this:
- The deposit would be one payment thru Stripe, say $200 out of $400 (I'm assuming that I can use the same JavaScript as I have been with your tutorial?)
- Thru Rails I would set that as "deposit". Maybe using Enums? enum status: [:paid_in_full, :deposit]
- Set up Cron to send an email to all depositors every month as a reminder
- The rest of the payment would be a seperate payment thru Stripe
- If full payment is made, update status: :paid_in_full
- If status: :paid_in_full, then show advertisement on WordPress site
I plan on pulling json generated from the users controller to populate the WordPress site. I'm sure I will post questions when I get to that stage!
Thanks for the help, Chris!
Hi Kasper,
The first thing that I notice is that you don't have any actions defined in your controller. Rails is trying to process UserprofilesController#update but the action empty. So that would be a start, define your actions and see what happens.
A couple of things that you should try after you resolve the first one:
- Your UsersController should inherit from Devise. See Devise github page:
- Make sure that you sanitize any additonal attribute from the Devise standard:
My personal opinion is to not overly complicate your Rails code to make the UI better for the user. You can order attributes into groups on the front-end to make it easier for the user to focus, you could make tabs to seperate the groups. What I would do is use something like the Wicked gem. It helps you create a wizard type of experience for your user. Breaks the profile creation into bit-sized pieces. Richard Schneeman is the maintainer. Check out his screen cast, I think that its what you are looking for:
I hope that my comments are helpful! Good luck!
Posted in How to Set Up a Stripe Scheduled Subscription with an option for Deposit but with only X months to Pay the Balance?
Its for a Tattoo Convention. These are artists putting a deposit down for a booth or multiple booths. The deposit is "no refund". Which is the industry accepted practice.
The system I am creating will:
- have the artist register with the normal contact info plus other info like tattoing style, Instagram and/or Facebook urls and their picture which will be in their profile/account info in Devise.
- Then they can pay full price for a booth(s) or they can put a deposit down.
- The deposit holds a booth for them until the determined due date. If the date passes, they loose the spot for the booth and deposit.
- Once the artist pays in full, their info and picture will be posted on the site, not before. This is for advertisement on the Convention site so its incentive for them to pay in full so they get there advertisement on the site. So I need to record when they complete payment so then I will have the advertisment posted dynamically to the Convention site, which is a Wordpress site.
I also found that you can set the Stripe API to send the invoice to the customer by email, which is cool:
Kasper, can you tell us why you want to split the user profile into 3 different pages?
Kasper, does your log files give you any indication as to what is going on?
Posted in How to Set Up a Stripe Scheduled Subscription with an option for Deposit but with only X months to Pay the Balance?
I am creating a Stripe product that gives the buyer an option to put a deposit down then they are given x amount of months to pay. Or they can pay in full. I'm sure that I would use scheduled subscriptions to do that. How would I set up that Subscription so that the customer only has x months to pay and requires the balance paid at the end?
Thanks!
Jim
Hi all,
I am getting an error "uncaught syntaxerror unexpected token ' var'" . I'm using this JQuery plugin:
The error is showing up on "var updateTime.
Here is the page that I am adding it to:
Can anyone see what I am doing wrong?
Thanks ahead of time!
Jim
<script> var cl = cloudinary.Cloudinary.new({ cloud_name: 'downtown' }); cl.responsive(); //Script for CountDownTimer $("#DateCountdown").TimeCircles(); $("#CountDownTimer").TimeCircles({ time: { Days: { show: false }, Hours: { show: false } }}); $("#PageOpenTimer").TimeCircles(); ------------ var updateTime = function(){ var date = $("#date").val(); var time = $("#time").val(); var datetime = date + ' ' + time + ':00'; $("#DateCountdown").data('date', datetime).TimeCircles().start(); } $("#date").change(updateTime).keyup(updateTime); $("#time").change(updateTime).keyup(updateTime); // Start and stop are methods applied on the public TimeCircles instance $(".startTimer").click(function() { $("#CountDownTimer").TimeCircles().start(); }); $(".stopTimer").click(function() { $("#CountDownTimer").TimeCircles().stop(); }); // Fade in and fade out are examples of how chaining can be done with TimeCircles $(".fadeIn").click(function() { $("#PageOpenTimer").fadeIn(); }); $(".fadeOut").click(function() { $("#PageOpenTimer").fadeOut(); }); </script>
Posted in How do I resolve this syntax error
That's it! Thanks!
Posted in How do I resolve this syntax error
Hi guys,
I have this error and I don't understand what the error is. I'm using Rails 6
syntax error, unexpected tLABEL
stripe_id: customer.id,
~~~~~~~~~
/vagrant/Rails/stripe-test/app/controllers/subscriptions_controller.rb:34: syntax error, unexpected tLABEL, expecting '='
My code is:
options = (
stripe_id: customer.id,
stripe_subscription_id: subscription.id
)
current_user.update(options)
Thanks,
Jim
that sounds good! live and learn. luckily this is only a tutorial.
thanks Chris
lol. that sucks. I'm in Fla and my computer is in PA. I guess it defeats the purpose, but can it be reset locally so I can finish my tutorial? ":)
Hi all,
I cloned my project to my laptop but when I try to access credentials.yml.enc with rails credentials:edit, I get this error:
Couldn't decrypt config/credentials.yml.enc. Perhaps you passed the wrong key?
Can anyone give me the steps to properly reset my credentials.yml in a cloned repo?
Thanks,
Jim
Posted in Subscriptions with Stripe Discussion
Thanks Chris!
|
https://gorails.com/users/118
|
CC-MAIN-2020-50
|
en
|
refinedweb
|
Create scope handling objects
Registered by Gustavo Narea on 2009-06-23
It should be possible for users to employ a simple syntax to define the variables and functions available in different namespaces, as well as all their names in the different languages. On the other hand, the parser should retrieve such objects in a efficient/fast way. As a consequence, scope handing utilities should be created.
Blueprint information
- Status:
- Complete
- Approver:
- Gustavo Narea
- Priority:
- Essential
- Drafter:
- Gustavo Narea
- Direction:
- Approved
- Assignee:
- Gustavo Narea
- Definition:
- Approved
- Implementation:
Implemented
- Started by
- Gustavo Narea on 2009-06-23
- Completed by
- Gustavo Narea on 2009-06-27
Related branches
Related bugs
Sprints
Whiteboard
Implementation finished in r85.
Dependency tree
* Blueprints in grey have been implemented.
|
https://blueprints.launchpad.net/booleano/+spec/scope-handling
|
CC-MAIN-2020-50
|
en
|
refinedweb
|
Subject: Re: [boost] namespace boost?
From: Kim Barrett (kab.conundrums_at_[hidden])
Date: 2011-01-15 17:12:37
On Jan 15, 2011, at 4:46 PM, Dave Abrahams wrote:
>>> +1, although I think the name should be boost::ratio rather than
>> boost::ratios
>
> If it has a type called "ratio" in it, "ratios" might be a better
> choice for the namespace. That, at least, is how tuple did it. I
> can't find a good rationale for that choice now, but once upon a time
> it used to be our recommended practice.
"For those who are really interested in namespaces"
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/2011/01/175022.php
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
A simple piece of advice: If you are throwing an exception (or logging an error) about a value being incorrect in some way, include the value itself. It will make it so much easier for the poor sap who has to figure out why the exception is happening.
I found myself in this situation, this code throwing an exception:
if not isinstance(key, str):
raise Client.MemcachedStringEncodingError, ("Keys must be str()'s, not"
"unicode. Convert your unicode strings using "
"mystring.encode(charset)!")
There are a few things wrong with this message, the first being that the multi-line string concatenation is missing a space, so the message actually has the word “notunicode” in it. Why are we so sure the wrong value is Unicode in the first place? And of course, it should include the actual value:
if not isinstance(key, str):
raise Client.MemcachedStringEncodingError, (
"Keys must be str()'s: %r" % key
)
If you want to be paranoid, you can limit the amount of repr text that will appear in the message:
if not isinstance(key, str):
raise Client.MemcachedStringEncodingError, (
"Keys must be str()'s: %.60r" % key
)
If you are really paranoid, you’re worried that getting the repr of your unknown object could itself throw an exception:
def safe_repr(o):
try:
return repr(o)
except:
return "??norepr?"
...
if not isinstance(key, str):
raise Client.MemcachedStringEncodingError, (
"Keys must be str()'s: %.60s" % safe_repr(key)
)
or even:
def safe_repr(o):
try:
return repr(o)
except Exception, e:
return "??norepr (%s)?" % e
Good error handling is always a pain, but it’s worth it when things start hitting the fan and you have to figure out what’s going on.
You won't need safe_repr quite as often if you remember to never use `%r` with a single interpolated value, because this can happen:Always use "foo %s" % repr(v) instead.
Another trick I like to use quite often is to add values to exceptions other people raise that don't have enough info yet:
Who says that e.__str__() in the last example can't raise exceptions? :)
I always try to mention (and remember myself) that you should pretty much never use a blanket "except": you might catch SystemExit or KeyboardInterrupt with that (if someone hits Ctrl-C while you are executing that in a tight loop).
@ot and @Christopher: both good points! Like I said, this stuff is hard!
Add a comment:
|
https://nedbatchelder.com/blog/201007/better_error_messages.html
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
node_interop 1.0.3.
1.0.3 #
- Removed generic annotations from Process methods per #56 (not supported by Dart yet).
- Added
util.inspectbinding.
1.0.2 #
- Clarified documentation of
dartifyregarding conversion of JS object keys (#52).
1.0.1 #
- Fixed declaration of
fs.writeSyncand
fs.readSyncto return
intinstead of
void.
1.0.0 #
No functional changes in this version, it is published to replace obsolete
0.0.7 version on the
Pub's package homepage to improve discoverability.
Ongoing work will continue in
1.0.0-dev.* branch until it's considered stable and feature complete.
Make sure to checkout recent dev version for latest updates.
Non-breaking changes may be published to the stable track periodically.
1.0.0-dev.13.0 #
- Added
HttpsAgentOptionswith basic TLS/SSL parameters.
- Breaking: createHttpsAgent() now expects instance of
HttpsAgentOptionsinstead of
HttpAgentOptions.
1.0.0-dev.12.0 #
- Fixed Console method bindings to not force
Stringarguments and allow any type.
- Breaking: Updated
JsErrorconstructor definition to match Node.js documentation.
1.0.0-dev.11.0 #
- Upgraded to build_node_compilers 0.2.0
1.0.0-dev.10.0 #
- Internal changes.
1.0.0-dev.9.0 #
- Fixed analysis warnings.
1.0.0-dev.8.0 #
- Upgraded to latest build_node_compilers.
1.0.0-dev.7.0 #
- Fixed: Changed
ServerResponse.getHeaderreturn type from
Stringto
dynamic.
1.0.0-dev.6.0 #
- Added: binding for JS
undefinedvalue in
node_interop/js.dart.
1.0.0-dev.5.0 #
- Fixed: strong mode issue in
dartifyutility function when converting plain JS objects to Dart
Map. Returned map is now of type
Map<String, dynamic>instead of
Map.
1.0.0-dev.4.0 #
- Fixed: strong mode issue in
promiseToFutureutility function.
- Fixed: signature of
fs.realpathSync.
1.0.0-dev.3.0 #
- Added or completed bindings for following Node.js modules:
dns,
events,
fs,
http,
https,
module,
net,
os,
path,
process,
querystring,
stream,
timers,
tls.
- Added more examples and tests.
1.0.0-dev.2.0 #
- Completed
dnsmodule function definitions (still missing data structures).
1.0.0-dev.1.0+1 #
- Minor internal changes.
1.0.0-dev.1.0 #
Breaking changes: #
- node_interop depends on Dart 2 SDK which allows us to leverage new build_runner system and move away from Pub transformers.
- Removed Pub transformer, which means you shouldn't need it in your
pubspec.yamlanymore. Build system is now based on
buildpackage. See docs for more details.
- node_interop no longer exports Dart-specific abstractions like an HTTP client or FileSystem. These abstractions have been moved to separate packages:
node_ioand
node_http. This way node_interop now only exposes JS bindings for Node and some utility functions.
- library structure is changed to map closer to built-in Node modules. There is a separate file for each module which exposes that module's bindings, e.g.
fs.dart,
http.dart.
nodeobject has been removed. Can use
requireand
exportsfunctions directly. There is also new convenience function
setExport.
jsPromiseToFuturerenamed to
promiseToFuture.
futureToJsPromiserenamed to
futureToPromise.
jsObjectKeysrenamed to
objectKeys.
dartifynow allows converting JS
functionobjects.
- `JsPromise
0.1.0-beta.9 #
- Added library-level
getfunction to
http.dart.
0.1.0-beta.8+1 #
- Updated changelog.
0.1.0-beta.8 #
- Introduced new
io.dartlibrary designed to follow
dart:iocontract.
- Breaking: renamed
HttpRequestexposed by
http.dartto
NodeHttpRequest. This is a server-side request object which will eventually be hidden from this library. It is recommended to import new
io.dartwhich exposes both
HttpRequestand
NodeHttpRequestobjects.
0.1.0-beta.7 #
- Fix HttpHeaders.forEach crash when called on HttpRequest.headers [#6]
0.1.0-beta.6 #
- Breaking:
- renamed
ReadableStream.nativeStreamto
ReadableStream.nativeInstance
- renamed
WritableStream.nativeStreamto
WritableStream.nativeInstance
- New:
- Added
jsonStringifyand
jsonParsewhich bind to native
JSON.stringifyand
JSON.parserespectively.
0.1.0-beta.5 #
- Fixed:
HttpResponse.close()failed when trying to finalize headers.
0.1.0-beta.4 #
- Made
Promise<T>a generic type. Also added definition of
Thenable.
onRejectedin
Promise.thenis now optional.
- Added explicit type to
nodevariable.
0.1.0-beta.3 #
- More updates to bindings.
- Added new
async.dartlibrary with basic implementations of
ReadableStream<T>,
WritableStream<T>and
NodeIOSink.
- Added implementations of server side
HttpRequestand
HttpResponseto
http.dart, as well some other objects like
HttpHeaders.
- Added
dartifyError(JsError error)to the main library which converts from JS
Errorinstances in to Dart's equivalent.
- Implemented more methods in
File:
openRead,
openWrite,
readAsBytes.
- Deprecated
createJSFilein
test.dartlibrary. Use
createFileinstead.
0.1.0-beta.2 #
jsObjectToMapdeprecated. There is new helper function
dartify. See documentation for more details.
- New
jsifyhelper function.
- Clarified type of HTTP server
requestListener.
- New
createJSFiletest util in
test.dart.
0.1.0-beta.1 #
- Breaking changes:
NodePlatformis no longer exported from
node_interop.dartlibrary.
- Library-level
exportsgetter was removed. Now
exportsis a direct reference to native JS object. Replace any calls to
exports.setProperty(name, value)with new API:
node.export(name, value).
- "http" module:
Agent,
Server,
AgentOptionsrenamed to
HttpAgent,
HttpServer,
HttpAgentOptionsrespectively.
- "http" module:
createAgentrenamed to
createHttpAgent.
node_interop/bindings.dartwas removed. All bindings are available through main
node_interop/node_interop.dartimport.
- New:
- Many updates to documentation.
- Main package's library now exposes all (implemented) Node API bindings.
- New
nodelibrary object with centralized access to the Node platform and runtime information, as well as module globals like
requireand
exports.
- Exposed parts of "https", "tls", "dns" and "net" module bindings.
- Added HTTPS support to
NodeClientfrom
node_interop/http.dart.
- Updated examples.
- Gitter channel is now up:.
0.0.7 #
- Added
node_interop/test.dartlibrary with
installNodeModules()helper function. See dartdoc for more details.
0.0.6 #
jsObjectToMap: added null-check.
- Added basic HTTP client implementation for Node, based on an interface from 'http' package. Use with
import package:node_interop/http.dart.
0.0.5 #
- Streamlined bindings layer and exposed as it's own library. Use
import package:node_interop/bindings.dartto get access.
- Added bindings for 'http' module (work in progress).
0.0.4 #
- Upgraded to
testpackage with support for running tests in Node
- Implemented
NodeFileSystem.file()and
File.writeAsStringSync().
0.0.3 #
- Added bindings for
Console.
0.0.2 #
- Switched to use official
node_preamblepackage
0.0.1 #
- Initial version
// Copyright (c) 2018, Anatoly Pulyaevskiy. All rights reserved. Use of this source code // is governed by a BSD-style license that can be found in the LICENSE file. import 'dart:convert'; import 'package:node_interop/fs.dart'; import 'package:node_interop/node.dart'; /// Simple example of reading contents of current working directory and /// printing out as nicely indented JSON. void main() { final contents = List<String>.from(fs.readdirSync(process.cwd())); final json = new JsonEncoder.withIndent(' '); print(json.convert(contents)); }
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: node_interop: :node_interop/node_interop.dart';
We analyzed this package on Mar 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.1
- pana: 0.13.6
Health suggestions
Fix
lib/util.dart. (-1.49 points)
Analysis of
lib/util.dart reported 3 hints:
line 56 col 16: Unnecessary new keyword.
line 94 col 19: Unnecessary new keyword.
line 108 col 10: Unnecessary new keyword.
Fix
lib/http.dart. (-1 points)
Analysis of
lib/http.dart reported 2 hints:
line 198 col 12: Avoid return types on setters.
line 200 col 12: Avoid return types on setters.
|
https://pub.flutter-io.cn/packages/node_interop
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
codemirror.dart
What is it?
A Dart wrapper around the CodeMirror text editor. From codemirror.net:
CodeMirror is a versatile text editor implemented in JavaScript for the browser. It is specialized for editing code, and comes with a number of language modes and addons that implement more advanced editing functionality.
An example
Map options = { 'mode': 'javascript', 'theme': 'monokai' }; CodeMirror editor = CodeMirror.fromElement( querySelector('#textContainer'), options: options); editor.getDoc().setValue('foo.bar(1, 2, 3);');
See also our example/ directory.
How do I use it?
In your main html file, link to the style sheet:
<link href="packages/codemirror/codemirror.css" rel="stylesheet">
reference the CodeMirror JavaScript code:
<script src="packages/codemirror/codemirror.js"></script>
and, in your Dart code, import the library:
import 'package:codemirror/codemirror.dart';">
Polymer transformer
The Polymer transfomer will inline our theme css references incorrectly.
Currently, to use the
codemirror package with Polymer, you'll need to add the
following lines to your
pubspec.yaml file.
- polymer: entry_points: web/foo_bar.html inline_stylesheets: packages/codemirror/codemirror.css: false
Disclaimer
This is not an official Google product.
Libraries
- codemirror
-
- codemirror.hints
- A wrapper around the
hint/show-hint.jsaddon.
- codemirror.panel
- A wrapper around the
addon/display/panel.jsaddon.
|
https://pub.dev/documentation/codemirror/latest/
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
Java, J2EE & SOA Certification Training
- 37k Enrolled Learners
- Weekend
- Live Class
An array is a fundamental and crucial data structure Java programming language. It is highly used by programmers due to its efficient and productive nature. A Java String Array is an object that holds a fixed number of String values. In this tutorial, let us dig a bit deeper and understand the concept of String array in Java.
This article will touch up on following pointers,
You must be aware of Java Arrays, it is an object that contains elements of a similar data type. Also, they are stored in a continuous memory location. Strings, on the other hand, is a sequence of character. It is considered as immutable object i.e, the value cannot be changed. java String array works in the same manner. String Array is used to store a fixed number of Strings.
Now, let’s have a look at the implementation of Java string array.
For implementation ensure you get Java Installed. A string array is declared by the following methods:
String[] stringArray1 //declaring without size String[] stringArray2 = new String[2]; //declaring with size
The string array can also be declared as String strArray[], but the previously mentioned methods are favoured and recommended. Note that the value of strArray1 is null, while the value of strArray2 is [null, null].
Now let us move ahead and checkout how to initialize a string array,";
All three arrays specified above have the same values.
Since there are only 3 elements in stringArray3, and the index starts from 0, the last index is 3. We could also use the formula (array length – 1) to ascertain the value of the index. On accessing an index greater than 2, an exception will be raised.
Example:
String[] stringArray3 = new String[3]; stringArray3[3] = "U";
This will throw a java.lang.ArrayIndexOutOfBoundsException.
Initialization of a string array can be done along with the declaration by using the new operator in the syntax:
<strong>String</strong>[] stringArray3 = new <strong>String</strong>[]{“R”,”S”,”T”};
Let us continue with the next topic of this article,
The property length of a string array can be used to determine the number of elements in the Array.
<strong>String</strong>[] stringArray3 = {“R”,”S”,”T”};
System.out.println( stringArray3.length);
Output:
3
Next in this string array in Java article we would how to iterate in a string array
Iterating In A String Array
Iteration over a string array is done by using java for loop, or java for each loop.
String[] strArray3 = {“R”,”S”,”T”}; //iterating all elements in the array for (int i = 0; i < strArray3.length; i++) { System.out.print(strArray3[i]); }
The code starts from index 0, and continues up to length – 1, which is the last element of the array.
Output:
R
S
T
We can also make use of the enhanced for loop provided by Java 5:
//iteration by using the enhanced for loop provided by Java 5 or later for (String str : strArray3) { System.out.print(str); }
Let us move further with this article on String Array In Java,
In case the user wants to search for a specific value in the string array, for loop is used.
public class SearchStringArrayExample { public static void main(String[] args) { String[] strArray3 = { "R", "S", "T" }; boolean found = false; int index = 0; String s = "S"; for (int i = 0; i < strArray.length; i++) { if(s.equals(strArray[i])) { index = i; found = true; break; } } if(found) System.out.println(s +" found at the index "+index); else System.out.println(s +" not found in the array"); } }
Output:
B found at index 1
The keyword break is used to stop the loop as soon as the element is found.
To sort the elements in the string array, we can implement our own sorting algorithm, or we can invoke the Arrays class sorting method.
String[] vowels = {"o","e","i","u","a"}; System.out.println("Initial array "+Arrays.toString(vowels)); Arrays.sort(vowels); System.out.println("Array after the sort "+Arrays.toString(vowels));
Output:
Initial array: [o ,e , i, u, a]
Array after the sort: [a, e, i, o, u]
It must be noted that String implements the Comparable interface, therefore it works for natural sorting.
It is required to convert a String Array to a String sometimes, due to display purposes. We can use the Arrays.toString() method for the conversion.
String[] strArray3 = { "R", "S", "T" }; String theString = Arrays.toString( strArray3 ); System.out.println( theString );
Output:
[R,S,T]
The elements are not only separated by a comma, but also enclosed in square brackets.
The user also has the option of implementing a custom behaviour. In the following example, we will be using a custom delimiter:
String[] strArray3 = { "R", "S", "T" }; String delimiter = "-"; StringBuilder sb = new StringBuilder(); for ( String element : strArray3 ) { if (sb.length() > 0) { sb.append( delimiter ); } sb.append( element ); } String theString = sb.toString(); System.out.println( theString );
Output:
R-S-T
The above code uses the delimiter dash without the square brackets.
Let us continue with the next topic of this String Array in Java article,
The major disadvantage of a string array is that it is of a fixed size. For an array which can grow in size, we implement the List.
String[] strArray3 = { "R", "S", "T" }; List<String> stringList = Arrays.asList( strArray3 );
It must be noted that we cannot add items to the List returned by Arrays.asList method. It raises a java.lang.UnsupportedOperationException as shown in the code below:
String[] strArray3= { "R", "S", "T" }; List<String> stringList = Arrays.asList(strArray3); stringList.add( "U" );
The error raised can be avoided by converting the String Array to an ArrayList.
String[] strArray3 = { "R", "S", "T" }; List<String> fixedList = Arrays.asList(strArray3); List<String> stringList = new ArrayList<String>( fixedList ); stringList.add( "U" );
This code constructs a new ArrayList based on the value returned by Arrays.asList. It will not raise an exception.
While a List can contain elements that are duplicate, a Set cannot. To create a collection of elements that are unique in nature, Set proves to be an appropriate data structure.
String[] strArray3 = { "R", "S", "T", "T" }; List<String> stringList = Arrays.asList(strArray3); Set<String> stringSet = new HashSet<String>( stringList ); System.out.println( "The size of the list is: " + stringList.size() ); System.out.println( "The size of the set is: " + stringSet.size() );
Output:
The size of the list is: 4
The size of the set is: 3
As mentioned, the set contains only the unique elements.
It is plausible to convert a List back to the String Array.
List<String> stringList = new ArrayList<String>(); stringList.add( "R" ); stringList.add( "S" ); stringList.add( "T" ); String[] stringArr = stringList.toArray( new String[] {} ); //passing the toArray method for ( String element : stringArr ) { System.out.println( element ); }
The toArray specifies the type of the array returned.
The Java StringArray contains innumerous methods but is used widely and assuredly for an efficient programming experience.
Thus we have come to an end of this article on ‘String Array in Java’. blog and we will get back to you as soon as possible.
|
https://www.edureka.co/blog/string-array-in-java/
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
Alexa.Presentation.APL (v1.0)
The
Alexa.Presentation.APL namespace contains APIs that provide a receipt of Alexa Presentation Language (APL) responses, consisting of documents and commands, to an Alexa Built-in device.
To learn how to integrate the APL Core Library, see the APL Core Library repo and documentation.
To learn more about visual responses for the Alexa Voice Service (AVS) and related APIs, see Alexa Presentation Language (APL) Overview.
- Capability Assertion
RenderedDocumentStatecontext entry
- UserEvent event
- RenderDocument directive
- ExecuteCommands directive
Capability Assertion
A device may implement Alexa.Presentation.APL 1.0 on its own behalf, but not on behalf of any connected endpoints.
For new AVS integrations, assert support through Alexa.Discovery. However, AVS provides support for existing integrations through the Capabilities API.
Sample declaration
{ "interface": "Alexa.Presentation.APL", "type": "AlexaInterface", "version": "1.0", "configurations": { "runtime": { "maxVersion": "1.2" } } }
RenderedDocumentState context entry
Alexa expects a client to report
RenderedDocumentState to communicate the current onscreen APL elements with each event that requires context.
For more details, see Context and the APL Core Library repo and documentation.
Sample message
The following sample code shows the structure for a
RenderedDocumentState context entry:
{ "context": [ { "header": { "namespace": "Alexa.Presentation.APL", "name": "RenderedDocumentState", "payloadVersion" : "1" }, "payload": { "token": "token", "version" : "Alexa.Presentation.APL-1.0.x.x", "componentsVisibleOnScreen": [{ "id": "list4050", "position": "100x200+30+50:1", "visibility": 1, "tags": { "focused": true, "list": { "itemCount": "2" } } }] } } ] }
Context properties
UserEvent event
Send an
UserEvent event from the device directly to AVS when a
SendEvent command is executed, such when a user presses a button.
The Alexa Skill that owns the APL document receives the event.Always send the
UserEvent event along with a complete
Context object. See Context for more details.
Sample UserEvent event message
The following sample code shows the structure for a
UserEvent event message:
{ "header": { "namespace": "Alexa.Presentation.APL", "name": "UserEvent", "messageId": "56fd9e9b-132c-4ebf-949e-e84e7a517c00" }, "payload": { "presentationToken": "OPAQUE_TOKEN", "arguments": [ "rideTypeSelected", 2, "shared" ], "source": { "type": "Touchable", "handler": "onPress", "id": null, "value": null }, "components": { "component1": "value1", "component2": 3 } } }
UserEvent event payload parameters
The following table lists the payload parameters for the
UserEvent event. The SendEvent command provides the source of the properties for
UserEvent.
RenderDocument directive
The
RenderDocument directive renders a visually rich document by delivering a template document and datasources to a device.
RenderDocument directive message format
The following sample code shows the structure for a
RenderDocument directive:
{ "header": { "namespace": "Alexa.Presentation.APL", "name": "RenderDocument", "messageId": STRING, "dialogRequestId": STRING }, "payload": { "presentationToken": STRING, "document": {{OBJECT}}, "datasources": {{OBJECT}}, "windowId": {{STRING}} “supportedViewports”: [ Array of supported viewports ] } }
RenderDocument payload parameters
The following table lists the payload parameters for the
RenderDocument directive:
ExecuteCommands directive
The
Alexa.Presentation.APL.ExecuteCommands directive runs an array of APL commands on APL documents that have been already rendered and share the same
presentationToken.
ExecuteCommands directive message format
The following sample code shows the structure for a
ExecuteCommands directive:
{ "header": { "namespace": "Alexa.Presentation.APL", "name": "ExecuteCommands", "messageId": string, "dialogRequestId": string }, "payload": { "presentationToken": string, "commands" : array of commands, ... ] } }
ExecuteCommands payload parameters
Although the commands themselves might vary, the following table lists the common properties that all commands share and that an
ExecuteCommands array might include:
|
https://developer.amazon.com/fr-FR/docs/alexa/alexa-voice-service/presentation-apl.html
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
Social Network For Security Executives: Help Make Right Cyber Security Decisions
In the previous blog entry, we described how to exploit an XSS vulnerability in SAP Afaria. Today’s post is dedicated to another security issue affecting Afaria.
( Read More: Checklist On Skillset Required For An Incident Management Person )
Added by Alexander Polyakov on February 15, 2016 at 1:30am — No Comments
Added by Alexander Polyakov on February 15, 2016 at 1:30am — No Comments
Added by Alexander Polyakov on November 25, 2015 at 8:32pm — No Comments
Added by Alexander Polyakov on October 1, 2015 at 8:30pm — No Comments
Now that we have covered PeopleSoft Architecture, it is time to continue with PeopleSoft security and describe some attack vectors against PeopleSoft system discovered by ERPScan researchers. The first one is an attack on back-end systems.
First, we should clarify some essential terms:
Added by Alexander Polyakov on October 1, 2015 at 8:00pm — No Comments
Today security risk, depending on the sensitivity of the data. In SAP products, 628 XSS vulnerabilities were discovered that is almost 22%…Continue
Added by Alexander Polyakov on August 25, 2015 at 5:48pm — No Comments
For AS Java, the encoding is available as tc_sec_csi.jar. There is a static class and an interface which provides the encodings for HTML/XML, JavaScript, CSS and URL. Also it is available to use methods of public class StringUtils (com.sap.security.core.server.csi.util.StringUtils):
Added by Alexander Polyakov on August 25, 2015 at 5:47pm — No Comments
We continue our series of posts giving a review of one of the most frequent vulnerability which affects a lot of SAP modules: cross-site scripting, or XSS. Today's post describes how to protect SAP NetWeaver ABAP from XSS.
For all generic Web applications where you accept input parameters, you must use encoding methods provided by the ICF handler. The implementation of the encoding is…Continue
Added by Alexander Polyakov on August 25, 2015 at 5:46pm — No Comments
Oracle PeopleSoft applications are quite complex and consist of many components, so does their security. While there is almost no research on PS security, successful attacks against such systems happen from time to time. That’s why we decided to start a series of articles about some aspects of PS security.
These applications are designed to address the most complex business requirements. They…Continue
Added by Alexander Polyakov on August 24, 2015 at 6:44pm — No Comments
Hello, dear readers! Today I would like to talk about Oracle Security.
On August 11, Mary Ann – Oracle's CSO - published an incredibly shocking post about security researchers which was promptly deleted (either by herself or somebody else). The post was discussed by multiple resources such as…Continue
Added by Alexander Polyakov on August 24, 2015 at 6:38pm — No Comments
No…Continue
Added by Alexander Polyakov on August 4, 2015 at 4:31pm — No Comments
Last…Continue
Added by Alexander Polyakov on July 14, 2015 at 4:58pm — No Comments
Recently, HP published their yearly Cyber Risk Report 2015. Having many typical things spotlighted in this report such as growing number of ATM and IOT Security events, we have found some parts that are relevant to business application security, which we are honored to share with our readers, customers and partners.
According to their report, HP Zero Day Initiative were busy coordinating the disclosure and remediation of over…Continue
Added by Alexander Polyakov on June 25, 2015 at 7:41pm — No Comments
Intro…Continue
Added by Alexander Polyakov on June 25, 2015 at 6:30pm — No Comments…Continue
Added by Alexander Polyakov on June 24, 2015 at 4:00pm — No Comments…Continue
Added by Alexander Polyakov on June 17, 2015 at 3:45pm — No Comments
April 17, 2015 – As a part of monthly updates Microsoft released security update MS15-034 which closes vulnerability in driver HTTP.sys which…Continue
Added by Alexander Polyakov on June 17, 2015 at 12:49pm — No Comments
Mobile devices are actively integrated into business processes. Companies have more and more business applications and mobile devices. Employees increasingly bring their own equipment to the workplace (BYOD policy – Bring Your Own Device) and gain access to critical corporate information.
SAP Mobile Platform (or SMP, formerly called Sybase Unwired Platform, or SUP) is a MEAP (Mobile Enterprise Application Platform) solution. SMP is used for monitoring…Continue
Added by Alexander Polyakov on June 17, 2015 at 12:48pm — No Comments
Each…Continue
Added by Alexander Polyakov on April 2, 2015 at 8:00pm — No Comments
Today we are going on with our series of articles where we describe the 33 steps to security. The subject is of great significance not only to a small group of SAP infosec specialists, but to all those people who work with ERP systems as recent years have witnessed an increased awareness of business data protection problems. Not to go into details, let us get right to the topic.
The SAP NetWeaver platform includes not only the Dispatcher service…Continue
Added by Alexander Polyakov on March 26, 2015 at 3:00pm — No Comments
© 2020 Created by CISO Platform.
Badges | Report an Issue | Privacy Policy | Terms of Service
|
https://www.cisoplatform.com/profiles/blog/list?user=39n7uilr0dgci
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
I?
Ciao,
Gordon
I?
As much has been suggested a few times, we've even left this ticket open to keep us open to the possibility:
But it's a fundamental change, would take a lot of effort, and might end up with fewer features (although better fidelity).
A lot of the smarts of IntelliJ come from being able to type programs in spite of syntax errors, and I'm not sure how far scalac has progressed in this regard.
Scala might expose some of the compiler internals, for example tp1 <:< tp2, in a future version of the standard libary as part of a reflection package. This would open up interesting possibilities for reuse.
Thanks for the reply, Jason. I realize that it's not something you can just snap your fingers and have done. I just wanted to point you at the news so that you were at least aware of it and could take it into consideration.
Although, I must say that I would prefer fidelity over features. Syntax error checking is pointless if it's wrong and very annoying to deal with in the editor when it tells me my code is wrong when it isn't.
Ciao,
Gordon
I have to agree on fidelity. Scala is a fairly new language to me -- and if I use intellij I get great autocomplete -- and completely uselss syntax highlighting.
object hmm {
def main(args: Array[String]) {
val f = new File(args(0)) /// intellij says the 0 is red...
val a = new Array[String](100)
a(100) = "fred" // again intelllij highlights the 100 in red
(1 to 100) aspar foreach (println) // and in this case intellij FAILS to mark aspar red . desipte it not being defined on the sequence
}
}
If I go over to Eclipse... it works perfectly. Of course... intellij is more polished and the auto-complete features (even in scala) work better.. but... when I'm learning a new language.. those red wavvy lines are so so critical...
-Eric
With current version of plugin there are no problems with this code:
.
-tt
."
oo... it would be great if this worked for me. This is exciting that it works for you guys. Lets start with the basics..
1) did I plug it in? yes.. I did... just being silly
2) Type-aware highlighting? <--- woa! whats that? where is it? I'm clicking around and can't find it -- I checked the facet configuration for scala within project structure... and scala compiler within settings
3) I'm using plugin verison.....0.4.589
Perhaps I just need to grab the latest bits manually? I had assumed that updating from the plugin manager would give me the latest and greatest...
The latest version is 0.4.755. Versions after 0.4.735 will only work with IDEA 10.5 EAP, but you should be able to download the latest compatible version from the plugin manager. If not, get it from here:
*blush* okay that is embarassing.. It looks much better now...:)
I can now code in my favoriate IDE again! :)
-Eric
-- In Jetbrains I trust
Good :)
I also went ahead and moved to 10.5 to get that nifty type stuff... so far so good. Thanks again!
I think I'll add support of Scala 2.9 presentation compiler. Anyway I think it's good idea to try.
Best regards,
Alexander Podkhalyuzin.
... another approach would be to use both... the intellij method for refactorings..etc.. and the scala compiler method for syntax/type errors...
That does not seem like a very good idea to me, at least not as a starting principle.
If you're going to start using the presentation compiler for this, use it for everything that it can deliver. Use your own code to augment it only where it doesn't delivere the information you need (and file an enhancement requests on the presentation compiler for that information as well).
In situations like this I rather strongly believe that you're better of with 1 source of truth than with 2 sources of truth that could end up in conflict.
Anyhow, at this point it sounds more like Alexander is going testing to see if the presentation compiler can work at all for this plugin, so there's no need for definitive decisions until the test results are in.
I hope Alexander will post the results of his experiment to the forum.
I implemented some support of presentation compiler. It works ok now, except two bugs (which I found in presentation compiler). It now works in very simple way, like in Eclipse (I mean highlighting).
Now I need more work to add features like Add Import, Unused Imports etc. (after that I'll update plugin with this optional feature).
Then I'll think about everything from presentation compiler. But I'm not sure what way will be chosen.
Best regards,
Alexander Podkhalyuzin.
This is very interesting news -- there are some aspects of Scala that really stretch the currenct approach. For example, find-usages for apply/update/unapply/implicit views isn't possible without typing the whole program; our approach to expected types breaks down when there are apply/update methods involved; method type argument inference is problematic; higher-kinded types, etc, etc.
I think that a hybrid approach will be needed, stitching the two views of the program together will be the fun part :)
Thanks for looking into this approach. The effort is much appreciated!
Hi Jason,
How does the presentation compiler solve these issues?
(not sure if there's a short answer to this question)
-tt
Thank you very much for looking into this, Alex. Your efforts are greatly appreciated. :)
Are there any news on the presentation compiler investigation front?
I can't to stabilize presentation compiler, It fails often (I'm sure I can fix it from IDE side by often rerunning compiler, but I'm really not sure this is right). So I think we can wait until presentation compiler (2.9.1?) will be faster and until it will highlight more error types than now (and I hope more stable than now and obviously if plugin still be in such state with many "good code is red"). Sorry that I haven't met expectation.
Anyway I think I'll do a branch with current changes of presentation compiler using; so you will be able to try.
Best regards,
Alexander Podkhalyuzin.
There's no reason for being sorry. After all you've looked into it and made a decision about how to efficiently distribute your resources. If the presentation compiler isn't stable enough there's no point in spending too much work on it.
Maybe one should think about whether it will be used in the future. And based on this decision delay complicated features that can be easily handled by it, thus reducing the duplicate work as much as possible.
And thanks for making your efforts public. I've thought about looking into the plugin source several times. Maybe I'll use this occasion for it.
Thanks for trying, Alex. If you think you have useful information about the failures, maybe you could file bugs or give that information back to the scala guys? Maybe they can fix it for 2.9.1.
Hi Alex,
Sorry to hear that IntelliJ failed to incorporate the presentation compiler. Eclipse is currently stable and doesn't require presentation compiler restart. So something might be different/not following PC invariants from IntelliJ side.
I know that Eclipse uses presentation compiler and it's almost stable (I got an error once, after which compiler was broken completely, but I can't reproduce it again:( ). I think the same thing for NetBeans and Emacs.
I was near to commit my changes to trunk, when I got FreashRunReq outside of compiler thread exception again (after this exception compiler can't restart automatically). I mean that presenation compiler still has task queue problems, which cause this exception.
I don't know really how to fix it from IDEA side except to handle stdout about FreshRunReq and to restart presentation compiler (maybe can help some mystical sleep or to change API calls order).
Presentation Compiler is really good idea, but now I think that it's better to wait more complete Presentation Compiler work.
Best regards,
Alexander Podkhalyuzin.
Well, if you think the compiler has problems, why don't you write the test that demonstrates the problem? Otherwise I don't think there's going to be any activity on the presentation compiler front in future releases.
BTW: Just to check, I enabled the type-aware highligting in the recent nightly build of the Scala plugin and in half of my files I see code in red (ofc, the code compiles).
It seems the plugin has still some problems with generic types. So, at least for me, current highlighting is still not quite useful, and I'm really eager to see if the presentation compiler can fix this.
|
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206640235-Latest-Scala-IDE-for-Eclipse-uses-new-compiler-interface?page=1
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
Add anchor points?
- monomonnik last edited by gferreira
Is there an easy way to add anchor points to a path, like the Add Anchor Points command in Illustrator?
(I looked here and in the documentation, but I can’t find it.)
you can use the
FlattenPenfrom fontPens.
from fontPens.flattenPen import FlattenPen # create an empty path dest = BezierPath() # create flatten pen that will draw into the dest bezierPath pen = FlattenPen(dest, approximateSegmentLength=30, segmentLines=True) # draw into the flatten pen pen.moveTo((100, 100)) pen.curveTo((100, 150), (150, 200), (200, 200)) pen.endPath() # create an other path path = BezierPath() # draw an oval path.oval(200, 200, 200, 200) # draw the path with oval in the flatten pen path.drawToPen(pen) # set stroke and fill stroke(0) fill(None) # draw the dest drawPath(dest)
to learn more about pens and how to use them see
- monomonnik last edited by
@frederik You opened a door to a whole new world for me. This is much simpler than I thought. And at the same time, I think it’s going to take me some time to get my head around all this pen-stuff. Thanks!
|
https://forum.drawbot.com/topic/241/add-anchor-points
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
In Java we can use
Collections.shuffle method to randomly reorder items in a list. Groovy 3.0.0 adds the
shuffle and
shuffled methods to a
List or array directly. The implementation delegates to
Collections.shuffle. The
shuffle method will reorder the original list, so there is a side effect using this method. Or we can use the
shuffled method that will return a copy of the original list where the items are randomly ordered.
In the next example we use both methods to randomly order lists:
def signs = (2..10) + ['J', 'Q', 'K', 'A'] def symbols = ['♣', '♦', '♥', '♠'] // Create list as [♣2, ♦2, ♥2, ♠2, ..., ♣A, ♦A, ♥A, ♠A] def cards = [symbols, signs].combinations().collect { it.join() } // Store original cards list. def deck = cards.asImmutable() // We should have 52 cards. assert cards.size() == 52 // Let's shuffle the cards. // Notice this will change the cards list. cards.shuffle() assert cards.every { card -> deck.contains(card) } println cards.take(5) // Possible output: [♣6, ♠A, ♥Q, ♦Q, ♠5] // We can use our own Random object for shuffling. cards.shuffle(new Random(42)) assert cards.every { card -> deck.contains(card) } println cards.take(5) // Possible output: [♦5, ♦2, ♦3, ♣7, ♦J] // Store first 5 cards. def hand = cards.take(5) // Using shuffled we get a new list // with items in random order. // The original list is not changed. def shuffledCards = cards.shuffled() assert shuffledCards.size() == cards.size() assert shuffledCards.every { card -> cards.contains(card) } // Original list has not changed. assert hand == cards.take(5) println shuffledCards.take(5) // Possible output: [♣4, ♠2, ♠6, ♥Q, ♦4] // We can pass our own Random object. def randomizer = new Random(42) def randomCards = cards.shuffled(randomizer) assert randomCards.size() == cards.size() assert randomCards.every { card -> cards.contains(card) } println randomCards.take(5) // Possible output: [♥5, ♠6, ♠8, ♣3, ♠4]
Written with Groovy 3.0.0.
|
https://mrhaki.blogspot.com/2020/02/groovy-goodness-shuffle-list-or-array.html
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
Key for vtkInformation vectors. More...
#include <vtkInformationInformationVectorKey.h>
Key for vtkInformation vectors.
vtkInformationInformationVectorKey is used to represent keys in vtkInformation for vectors of other vtkInformation objects.
Definition at line 33 of file vtkInformationInformationVectorKey.h.
Definition at line 36 of file vtkInformationInformationVector.
Methods invoked by print to print information about the object including superclasses.
Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkObjectBase..
Duplicate (new instance created) the entry associated with this key from one information object to another (new instances of any contained vtkInformation and vtkInformationVector objects are created).
Reimplemented from vtkInformationKey.
Report a reference this key has in the given information object.
Reimplemented from vtkInformationKey.
|
https://vtk.org/doc/nightly/html/classvtkInformationInformationVectorKey.html
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
Implementing Object Detection and Instance Segmentation for Data Scientists
Object Detection is a helpful tool to have in your coding repository.
It forms the backbone of many fantastic industrial applications. Some of them being self-driving cars, medical imaging and face detection.
In my last post on Object detection, I talked about how Object detection models evolved.
But what good is theory, if we can’t implement it?
This post is about implementing and getting an object detector on our custom dataset of weapons.
The problem we will specifically solve today is that of Instance Segmentation using Mask-RCNN.
Instance Segmentation
Can we create masks for each object in the image? Specifically something like:
The most common way to solve this problem is by using Mask-RCNN. The architecture of Mask-RCNN looks like below:
Essentially, it comprises of:
A backbone network like resnet50/resnet101
A Region Proposal network
ROI-Align layers
Two output layers — one to predict masks and one to predict class and bounding box.
There is a lot more to it. If you want to learn more about the theory, read my last post– Demystifying Object Detection and Instance Segmentation for Data Scientists
This post is mostly going to be about the code.
1. Creating your Custom Dataset for Instance Segmentation
The use case we will be working on is a weapon detector. A weapon detector is something that can be used in conjunction with street cameras as well as CCTV’s to fight crime. So it is pretty nifty.
So, I started with downloading 40 images each of guns and swords from the open image dataset and annotated them using the VIA tool. Now setting up the annotation project in VIA is petty important, so I will try to explain it step by step.
1. Set up VIA
VIA is an annotation tool, using which you can annotate images both bounding boxes as well as masks. I found it as one of the best tools to do annotation as it is online and runs in the browser itself.
To use it, open
You will see a page like:
The next thing we want to do is to add the different class names in the region_attributes. Here I have added ‘gun’ and ‘sword’ as per our use case as these are the two distinct targets I want to annotate.
2. Annotate the Images
I have kept all the files in the folder data. Next step is to add the files we want to annotate. We can add files in the data folder using the “Add Files” button in the VIA tool. And start annotating along with labels as shown below after selecting the polyline tool.
3. Download the annotation file
Click on save project on the top menu of the VIA tool.
Save file as via_region_data.json by changing the project name field. This will save the annotations in COCO format.
4. Set up the data directory structure
We will need to set up the data directories first so that we can do object detection. In the code below, I am creating a directory structure that is required for the model that we are going to use.
from random import random import os from glob import glob import json # Path to your images image_paths = glob("data/*") #Path to your annotations from VIA tool annotation_file = 'via_region_data.json' #clean up the annotations a little annotations = json.load(open(annotation_file)) cleaned_annotations = {} for k,v in annotations['_via_img_metadata'].items(): cleaned_annotations[v['filename']] = v # create train and validation directories ! mkdir procdata ! mkdir procdata/val ! mkdir procdata/train train_annotations = {} valid_annotations = {} # 20% of images in validation folder for img in image_paths: # Image goes to Validation folder if random()<0.2: os.system("cp "+ img + " procdata/val/") img = img.split("/")[-1] valid_annotations[img] = cleaned_annotations[img] else: os.system("cp "+ img + " procdata/train/") img = img.split("/")[-1] train_annotations[img] = cleaned_annotations[img] # put different annotations in different folders with open('procdata/val/via_region_data.json', 'w') as fp: json.dump(valid_annotations, fp) with open('procdata/train/via_region_data.json', 'w') as fp: json.dump(train_annotations, fp)
After running the above code, we will get the data in the below folder structure:
- procdata - train - img1.jpg - img2.jpg - via_region_data.json - val - img3.jpg - img4.jpg - via_region_data.json
2. Setup the Coding Environment
We will use the code from the matterport/Mask_RCNN GitHub repository. You can start by cloning the repository and installing the required libraries.
git clone cd Mask_RCNN pip install -r requirements.txt
Once we are done with installing the dependencies and cloning the repo, we can start with implementing our project.
We make a copy of the samples/balloon directory in Mask_RCNN folder and create a samples/guns_and_swords directory where we will continue our work:
cp -r samples/balloon samples/guns_and_swords
Setting up the Code
We start by renaming and changing balloon.py in the
samples/guns_and_swords directory to
gns.py. The
balloon.py file right now trains for one target. I have extended it to use multiple targets. In this file, we change:
balloonconfigto
gnsConfig
BalloonDatasetto
gnsDataset: We changed some code here to get the target names from our annotation data and also give multiple targets.
And some changes in the train function
Showing only the changed
gnsConfig here to get you an idea. You can take a look at the whole gns.py code here.
class gnsConfig(Config): """Configuration for training on the toy dataset. Derives from the base Config class and overrides some values. """ # Give the configuration a recognizable name NAME = "gns" # We use a GPU with 16GB memory, which can fit three image. # Adjust down if you use a smaller GPU. IMAGES_PER_GPU = 3 # Number of classes (including background) NUM_CLASSES = 1 + 2 # Background + sword + gun # Number of training steps per epoch
3. Visualizing Images and Masks
Once we are done with changing the
gns.py file,we can visualize our masks and images. You can do simply by following this Visualize Dataset.ipynb notebook.
4. Train the MaskRCNN Model with Transfer Learning
To train the maskRCNN model, on the Guns and Swords dataset, we need to run one of the following commands on the command line based on if we want to initialise our model with COCO weights or imagenet weights:
# Train a new model starting from pre-trained COCO weights python3 gns.py train — dataset=/path/to/dataset — weights=coco # Resume training a model that you had trained earlier python3 gns.py train — dataset=/path/to/dataset — weights=last # Train a new model starting from ImageNet weights python3 gns.py train — dataset=/path/to/dataset — weights=imagenet
The command with weights=last will resume training from the last epoch. The weights are going to be saved in the logs directory in the Mask_RCNN folder.
This is how the loss looks after our final epoch.
Visualize the losses using Tensorboard
You can take advantage of tensorboard to visualise how your network is performing. Just run:
tensorboard --logdir ~/objectDetection/Mask_RCNN/logs/gns20191010T1234
You can get the tensorboard at
Here is how our mask loss looks like:
We can see that the validation loss is performing pretty abruptly. This is expected as we only have kept 20 images in the validation set.
5. Prediction on New Images
Predicting a new image is also pretty easy. Just follow the prediction.ipynb notebook for a minimal example using our trained model. Below is the main part of the code.
# Function taken from utils.dataset def load_image(image_path): """Load the specified image and return a [H,W,3] Numpy array. """ # Load image image = skimage.io.imread(image_path) # If grayscale. Convert to RGB for consistency. if image.ndim != 3: image = skimage.color.gray2rgb(image) # If has an alpha channel, remove it for consistency if image.shape[-1] == 4: image = image[..., :3] return image # path to image to be predicted image = load_image("../../../data/2c8ce42709516c79.jpg") # Run object detection results = model.detect([image], verbose=1) # Display results ax = get_ax(1) r = results[0] a = visualize.display_instances(image, r['rois'], r['masks'], r['class_ids'], dataset.class_names, r['scores'], ax=ax, title="Predictions")
This is how the result looks for some images in the validation set:
Improvements
The results don’t look very promising and leave a lot to be desired, but that is to be expected because of very less training data(60 images). One can try to do the below things to improve the model performance for this weapon detector.
We just trained on 60 images due to time constraints. While we used transfer learning the data is still too less — Annotate more data.
Train for more epochs and longer time. See how validation loss and training loss looks like.
Change hyperparameters in the mrcnn/config file in the Mask_RCNN directory. For information on what these hyperparameters mean, take a look at my previous post. The main ones you can look at:
# if you want to provide different weights to different losses LOSS_WEIGHTS ={'rpn_class_loss': 1.0, 'rpn_bbox_loss': 1.0, 'mrcnn_class_loss': 1.0, 'mrcnn_bbox_loss': 1.0, 'mrcnn_mask_loss': 1.0} # Length of square anchor side in pixels RPN_ANCHOR_SCALES = (32, 64, 128, 256, 512) # Ratios of anchors at each cell (width/height) # A value of 1 represents a square anchor, and 0.5 is a wide anchor RPN_ANCHOR_RATIOS = [0.5, 1, 2]
Conclusion
In this post, I talked about how to implement Instance segmentation using Mask-RCNN for a custom dataset.
I tried to make the coding part as simple as possible and hope you find the code useful. In the next part of this post, I will deploy this model using a web app. So stay tuned.
You can download the annotated weapons data as well as the code at Github..
|
https://mlwhiz.com/blog/2019/12/06/weapons/
|
CC-MAIN-2020-16
|
en
|
refinedweb
|
Traceback (most recent call last):
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py", line 89, in main
run_details = run(port, options, args, stderr)
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py", line 449, in run
run_details = manager.run(args)
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py", line 240, in run
needs_http=needs_http, needs_web_platform_test_server=needs_web_platform_test_server, needs_websockets=needs_websockets)
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py", line 84, in __init__
self.start_servers()
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py", line 201, in start_servers
self._port.start_web_platform_test_server()
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/Tools/Scripts/webkitpy/port/base.py", line 1015, in start_web_platform_test_server
self._web_platform_test_server.start()
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base.py", line 98, in start
self._pid = self._spawn_process()
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py", line 164, in _spawn_process
raise http_server_base.ServerError(error_log)
ServerError: WPT Server process exited prematurely with status code 1
More log info from the bot:
CRITICAL:web-platform-test-launcher:Import of wpt serve module failed.
Please check that the file serve.py is present in the web-platform-tests folder.
Please also check that __init__.py files in the web-platform-tests/tools folder and subfolders are also present.
Traceback (most recent call last):
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/Tools/Scripts/webkitpy/layout_tests/servers/web_platform_test_launcher.py", line 15, in <module>
import tools.serve.serve as WebPlatformTestServer
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/LayoutTests/imported/w3c/web-platform-tests/tools/serve/__init__.py", line 1, in <module>
import serve
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/LayoutTests/imported/w3c/web-platform-tests/tools/serve/serve.py", line 23, in <module>
from manifest.sourcefile import read_script_metadata, js_meta_re
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/LayoutTests/imported/w3c/web-platform-tests/tools/manifest/__init__.py", line 2, in <module>
from . import manifest
File "/Volumes/Data/slave/ios-simulator-11-release-tests-wk2/build/LayoutTests/imported/w3c/web-platform-tests/tools/manifest/manifest.py", line 5, in <module>
from six import iteritems, itervalues, viewkeys
ImportError: cannot import name viewkeys
I SSH'd into a few bots that *don't* exhibit this issue and it looks like they still have six as an untracked file, so that explains why they still work.
$ svn status
? LayoutTests/imported/w3c/web-platform-tests/tools/six
? layout-test-results.zip
We are hitting the failure on a few of our macOS and iOS bots. Two of them seemed to hit this issue after they were rebooted, so my guess is that the checkouts were cleaned up and the untracked version of six was removed.
From the import error, it is clear that six library is missing.
On my machine, six is probably available as wpt server runs fine.
On these bots, six is probably unavailable.
The solution might be to either update these bots or add back six.
The latter might be simpler.
Created attachment 323032 [details]
Patch
(In reply to youenn fablet from comment #4)
> Created attachment 323032 [details]
> Patch
I applied this patch on one of the broken bots and it was able to start the WPT server and begin running LayoutTests.
Comment on attachment 323032 [details]
Patch
Attachment 323032 [details] did not pass mac-debug-ews (mac):
Output:
New failing tests:
workers/wasm-long-compile.html
Created attachment 323041 [details]
Archive of layout-test-results from ews112 for mac-elcapitan
The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Comment on attachment 323032 [details]
Patch
Error is unrelated.
Comment on attachment 323032 [details]
Patch
Let's wait Monday to land this actually.
Any update?
Comment on attachment 323032 [details]
Patch
Clearing flags on attachment: 323032
Committed r223064: <>
All reviewed patches have been landed. Closing bug.
<rdar://problem/34893589>
Aha, I guess I had six installed in my system (and in all other bots). Sorry about this.
|
https://bugs.webkit.org/show_bug.cgi?id=178017
|
CC-MAIN-2020-24
|
en
|
refinedweb
|
Spring boot is used to help developer to develop spring application quickly and easily. It can help you in following aspects.
- Create spring project file structure and related source files with wizard.
- Get and add correct dependencies jars into your spring project automatically from spring repository.
- You do not need to care about the dependency jar file’s name, version and compatibility. All this is done by spring boot automatically. You just need to tell spring boot which module you need such as web, security and JPA etc.
- You also do not need to configure spring beans by yourself, all the configuration will be done by spring boot automatically also.
- You can create the spring boot project with spring tool suite ( STS ) or Spring Initializr.
This article will show you example about how to create spring boot project with spring tool suite and spring initializr.
1. Create Spring Boot Project With STS.
- Download spring tool suite from link.
- Open Spring Tool Suite, click File —> New —> Spring Starter Project menu item.
- Input related information in the spring starter project popup dialog as below. Please note if you do not want to use default location to store the project files, you need to browse to your custom folder.
- Click Next button in above dialog to go to Spring Starter Project Dependencies dialog. In this dialog, you can select which module you want to use in this project. As hello world example, we just select Web and Thymeleaf module, then spring boot will download required jars for Web and Thymeleaf module into this project later.
- Click Finish to complete the wizard, now you can see the hello world project has been created in STS left panel. Expand the Maven Dependencies folder, you can see there are a lot of jar files have been added into the project. All this jars are downloaded from spring central repository.
- From above spring boot added jars you can see that tomcat embed jar is also there, this means you can start this application with an embed tomcat as web server.
2. Spring Boot Hello World Project Source Files.
There are two java files and one html file in this example.
- HelloWorldApplication.java : This file is created by the wizard automatically. You can run this class to start the embed tomcat server.
- HelloWorldController.java : This file is created by user manually. It is a spring mvc controller file which will receive client request and dispatch related web page to client.
- helloWorldPage.html : Because we use Thymeleaf module, we create this file to display the hello world to client. This file is located in src/main/resources/templates folder.
2.1 HelloWorldApplication.java
package com.dev2qa; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class HelloWorldApplication { public static void main(String[] args) { SpringApplication.run(HelloWorldApplication.class, args); } }
2.2 HelloWorldController.java
package com.dev2qa; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller @RequestMapping("/") public class HelloWorldController { @RequestMapping(value="/helloWorld", method=RequestMethod.GET) public String helloWorld() { // The html file name is helloWorldPage.html. return "helloWorldPage"; } }
2.3 helloWorldPage.html
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> </head> <body> <br/><br/> <center>Hello World!</center> </body> </html>
3. Execute Spring Boot Hello World Example In STS.
- Right click the HelloWorldApplication.java file in Spring Tool Suite left panel.
- Click Run As —> Spring Boot App menu item in the popup menu list.
- Then you can see embed tomcat server started log information output in log console.
- Open a web browser and input. It will display the hello world web page.
4. Execute Spring Boot Hello World Example In Command Line.
To execute the hello world example in command line we need to first Package Spring Boot Hello World Project Into Jar file and then Run It In Command Line.
- Right click the pom.xml file in the project file list panel.
- Click Run As —> Maven build menu item.
- Input package in the Goals input text box.
- Click Run button. When build process complete, right click target folder in left project file list panel and click Refresh menu item in popup menu list. You can find the generated HelloWorld-0.0.1-SNAPSHOT.jar file.
- CD to above jar file saved directory, and run
java -jar HelloWorld-0.0.1-SNAPSHOT.jarin a terminal window. Then the embed tomcat server will be started.
5. Create Spring Boot Project With Spring Initializr.
This is a web version tool which can help you to create spring boot project structure.
- Open a web browser and go to.
- Click switch to full version link to open full element selection page.
- Input related information such as group, artifact and select required dependencies module.
- Click Generate Project button. Then a zip file will be downloaded.
- Unzip the file and you can see the spring boot file structure inside it.
|
https://www.dev2qa.com/spring-boot-hello-world-example-in-sts/
|
CC-MAIN-2020-24
|
en
|
refinedweb
|
Hide Forgot
Hello,
I am running RH6.0 + updates on an x86 machine. This box is
networked and uses NIS to sync accounts across our network.
The problem arises when code like the following is run on a
RH6 machine with the default NIS installation:
#include <stdio.h>
#include <netdb.h>
int main() {
while (1) {
struct hostent* pHostEnt = NULL ;
pHostEnt = gethostbyname("");
}
return 0 ;
}
Note that using gethostbyname_r has the same problem (I did
a search on deja.com, and Theodore Tso mentioned that using
the standard gethostbyname is prone to memory leaks.)
Running this program and watching it in top will show that
the process will continually eat memory until it severely
bogs down the machine. The problem is glibc-related, but it
is actaully triggered with RH's default NIS setup. The
"hosts:" entry in /etc/nsswitch.conf has 'nisplus' listed
before 'dns' - I'm guessing the leak starts here, as
switching the order (ie, having 'dns' listed before
'nisplus' on a network setup that queries a valid DNS
server) will fix the problem.
--Ant
Hello, I just found this URL on deja.com which sheds more light.
Perhaps it's time for a new glibc RPM release?
One last note - my friend runs the latest Mandrake which includes this
version of glibc; he's a huge Mandrake advocate. We can't have RH be
behind Mandrake in bugfixes now, can we? ;)
Memory leaks in NIS code are fixed in the Raw Hide glibc.
|
https://bugzilla.redhat.com/show_bug.cgi?id=4657
|
CC-MAIN-2020-24
|
en
|
refinedweb
|
Bayesian Belief Networks
Bayesian Belief Networks also commonly known as Bayesian networks, Bayes networks, Decision Networks or Probabilistic Directed Acyclic Graphical Models are a useful tool to visualize the probabilistic model for a domain, review all of the relationships between the random variables, and reason about causal probabilities for scenarios given available evidence.
This article covers the following topics:
- Prerequisite probability concepts for Bayesian Belief Networks:
- Random Variables
- Intersection
- Joint Distribution
- Conditional Distribution
- Conditional Independence
- Bayesian Belief Networks and their Components:
- Directed Acyclic Graph
- Conditional Probability Table
- Bayesian Belief Networks in Python
1. Prerequisite probability concepts for Bayesian Belief Networks:
As Bayesian Belief Networks are a part of Bayesian Statistics, it is very essential to review probability concepts to fully understand Bayesian Belief Networks. Some essential probability concepts are mentioned below:
Random Variables:
- A Random Variable is a set of possible values from a random experiment.
- A Random Variable's set of values is the Sample Space.
For Example:
- Tossing a coin: we could get Heads or Tails. Let Heads=0 and Tails=1 and Random Variable X represents this event.
- X = {0, 1}
- The probability of an event happening is denoted by P(x).
- The Probability Mass Function(PMF) is f(x) which is the P(X=x).
- Therefore f(0) = f(1) = 1/2
- Probability of event X not happening is denoted by P(~X) and is equal to 1 - P(X).
Intersection
The probability that Events A and B both occur is the probability of the intersection of X and Y. The probability of the intersection of Events X and Y is denoted by P(X ∩ Y).
Joint Distribution:
A joint probability distribution shows a probability distribution for two (or more) random variables.
For Example:
- Let's have 2 coin tosses represented by random variables X and Y.
- The joint probability distribution f(x, y) of X and Y defines probabilities for each pair of outcomes. X = {0, 1} and Y = {0, 1}
- All possible outcomes are: (X=0,Y=0), (X=0,Y=1), (X=1,Y=0), (X=1,Y=1).Each of these outcomes has a probability of 1/4.
- f(0, 0) = f(0, 1) = f(1, 0) = f(1, 1) = 1/4.
- This concept can be extended to more than 2 variables as well.
Conditional Distribution:
Sometimes, we know an event has happened already and we want to model what will happen next.
The conditional probability of two events X and Y as follows:
P(Y|X) = P(X ∩ Y)/P(X)
For Example:
- Yahoo’s share price is low and Microsoft will buy it.
- It is cloudy and it might rain.
Conditional Independence
The concept of Conditional Independence is Backbone of Bayesian Networks. Two events are said to be conditionally independent if the occurrence of one event doesn't affect the occurrence of the other event.
For example let one event be the tossing of a coin and the second event be whether it is raining outside or not.
The above mentioned events are conditionally independent as if it rains or not doesn't affect the probability of getting heads or tails.
To read more about Bayesian Statistics and the Bayesian Model, I would highly recommend that you read:
- Basic Data Science concepts everyone needs to know by OpenGenus Foundation
- Bayesian model by Prashant Anand
2. Bayesian Belief Networks and their Components:
- Bayesian Belief Networks are simple, graphical notation for conditional independence assertions.
- Bayesian network models capture both conditionally dependent and conditionally independent relationships between random variables.
- They also compactly specify the joint distributions.
- They provide a graphical model of causal relationship on which learning can be performed.
Let us consider the below mentioned example to explain Directed Acyclic Graphs and Conditional Probability Tables:
Let us consider a problem where:
- There is an Alarm in a house, which can be set of by 2 events: Burglary and Earthquake with certain conditional probabilities.
- The owner of the house has gone for work to office.
- The 2 neighbors are Mary and John, who call the owner if they hear an alarm go off with certain conditional probabilities.
Directed Acyclic Graph:
- Each node in a Directed Acyclic Graph (DAG) represents a random variable. These variables may be discrete or continuous valued. These variables may correspond to the actual attribute given in the data. Bayesian Belief Network. In simple English, a variable A cannot depend on its own value – directly, or indirectly. If this was allowed, it would lead to a sort of infinite recursion which we are not prepared to deal with.
Disconnected Nodes are Conditionally Independent:
Based on the directed connections in a Bayesian Belief Network, if there is no way to go from a variable X to Y (or vice versa), then X and Y are conditionally independent. In the example.
Conditional Probability Table:
- In statistics, the conditional probability table (CPT) is defined for a set of discrete and mutually dependent random variables to display conditional probabilities of a single variable with respect to the others (i.e., the probability of each possible value of one variable if we know the values taken on by the other variables).
-The CPTs for the aforementioned example are:
- The CPTs are given already and don't need to be calculated.
Calculation of the occurrence of an Event:
Occurrence of an event can be calculated using the CPTs, DAG and concepts of probability.
As we Disconnected Nodes are Conditionally Independent. Let us now try to calculate the probability that the Alarm rings (A) given that:
- John Calls (J)
- Mary Calls (M)
- Earthquake doesn't happen (~E)
- Burglary doesn't happen (~B)
P(A) = P(J|A)*P(M|A)*P(A|~E, ~B)*P(~B)*P(~E) = 0.90*0.70*0.001*0.999*0.998 = 0.00062
3. Bayesian Belief Networks in Python:
Bayesian Belief Networks in Python can be defined using pgmpy and pyMC3 libraries.
Below mentioned are the steps to creating a BBN and doing inference on the network using pgmpy library by Ankur Ankan and Abinash Panda. The same example used for explaining the theoretical concepts is considered for the practical example as well.
Installing pgmpy:
#For installing through anaconda use: $ conda install -c ankurankan pgmpy #For installing through pip: $ pip install -r requirements.txt # only if you want to run unittests $ pip install pgmpy
Importing pgmpy:
from pgmpy.models import BayesianModel from pgmpy.inference import VariableElimination
Defining network structure
alarm_model = BayesianModel([('Burglary', 'Alarm'), ('Earthquake', 'Alarm'), ('Alarm', 'JohnCalls'), ('Alarm', 'MaryCalls')]) #Defining the parameters using CPT from pgmpy.factors.discrete import TabularCPD cpd_burglary = TabularCPD(variable='Burglary', variable_card=2, values=[[.999], [0.001]]) cpd_earthquake = TabularCPD(variable='Earthquake', variable_card=2, values=[[0.998], [0.002]]) cpd_alarm = TabularCPD(variable='Alarm', variable_card=2, values=[[0.999, 0.71, 0.06, 0.05], [0.001, 0.29, 0.94, 0.95]], evidence=['Burglary', 'Earthquake'], evidence_card=[2, 2]) cpd_johncalls = TabularCPD(variable='JohnCalls', variable_card=2, values=[[0.95, 0.1], [0.05, 0.9]], evidence=['Alarm'], evidence_card=[2]) cpd_marycalls = TabularCPD(variable='MaryCalls', variable_card=2, values=[[0.1, 0.7], [0.9, 0.3]], evidence=['Alarm'], evidence_card=[2]) # Associating the parameters with the model structure alarm_model.add_cpds(cpd_burglary, cpd_earthquake, cpd_alarm, cpd_johncalls, cpd_marycalls)
Checking if the cpds are valid for the model:
alarm_model.check_model()
Output:
True
Viewing nodes of the model:
alarm_model.nodes()
Output:
NodeView(('Burglary', 'Alarm', 'Earthquake', 'JohnCalls', 'MaryCalls'))
Viewing edges of the model:
alarm_model.edges()
Output:
OutEdgeView([('Burglary', 'Alarm'), ('Alarm', 'JohnCalls'), ('Alarm', 'MaryCalls'), ('Earthquake', 'Alarm')])
Checking independency of a node::
alarm_model.local_independencies('Burglary')
Output:
(Burglary | Earthquake)
The entire code can be found on my Github.
Hope you found this article interesting and understood the prerequisite probability concepts, what Bayesian Belief Networks are, and how to represent them in Python.
Further Readings:
- Basic Data Science concepts everyone needs to know by OpenGenus Foundation
- Bayesian model by Prashant Anand
- Gaussian Naive Bayes by Prateek Majumder
- Text classification using Naive Bayes classifier by Harshiv Patel
- Applying Naive Bayes classifier on TF-IDF Vectorized Matrix by Nidhi Mantri
|
https://iq.opengenus.org/bayesian-belief-networks/
|
CC-MAIN-2020-24
|
en
|
refinedweb
|
Description
A custom UIDatePicker object that allows design customization of various user interface attributes such as font, color, etc. This pod
aims to replicate the default UIDatePicker functionality while adding additional customization in the user interface.
This is project is inspired by and uses codes from PIDatePicker.
In addition it has the option to set picker type to one of .year, .yearMonth, .date, .dateTime.
It is also possible to change calendar identifier.
Example
To run the example project, clone the repo, and run
pod install from the Example directory first.
Installation
HEDatePicker is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod "HEDatePicker"
Because this project was written in Swift, your project must have a minimum target of iOS 8.0 or greater. Cocoapods
does not support Swift pods for previous iOS versions. If you need to use this on a previous version of iOS,
import the code files directly into your project or by using git submodules.
Customization
There are several options available for customizing your date picker:
The following public methods are available for calling in your module:
Delegate
A class can implement
PIDatePickerDelegate and the following method to respond to changes in user selection.
func pickerView(pickerView: PIDatePicker, didSelectRow row: Int, inComponent component: Int)
Contributing
To report a bug or enhancement request, feel free to file an issue under the respective heading.
If you wish to contribute to the project, fork this repo and submit a pull request.
License
HEDatePicker is available under the MIT license. See the LICENSE file for more info.
Latest podspec
{ "name": "HEDatePicker", "version": "1.0.4", "summary": "A short description of HEDatePicker.", "description": "TODO: Add long description of the pod here.", "homepage": "", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "Hassan Eskandari": "[email protected]" }, "source": { "git": "", "tag": "1.0.4" }, "platforms": { "ios": "8.0" }, "source_files": "HEDatePicker/Classes/**/*", "pushed_with_swift_version": "3.0" }
Sun, 20 Aug 2017 01:40:16 +0000
|
https://tryexcept.com/articles/cocoapod/hedatepicker
|
CC-MAIN-2020-24
|
en
|
refinedweb
|
.
#include "opencv2/imgproc.hpp" #include "opencv2/highgui.hpp" #include <stdlib.h> #include <stdio.h> using namespace cv; /** @function main */ int main( int argc, char** argv ) { Mat src, src_gray, dst; int kernel_size = 3; int scale = 1; int delta = 0; int ddepth = CV_16S; char* window_name = "Laplace Demo"; int c; /// Load an image src = imread( argv[1] ); if( !src.data ) { return -1; } /// Remove noise by blurring with a Gaussian filter GaussianBlur( src, src, Size(3,3), 0, 0, BORDER_DEFAULT ); /// Convert the image to grayscale cvtColor( src, src_gray, CV_RGB2GRAY ); /// Create window namedWindow( window_name, CV_WINDOW_AUTOSIZE ); /// Apply Laplace function Mat abs_dst; Laplacian( src_gray, dst, ddepth, kernel_size, scale, delta, BORDER_DEFAULT ); convertScaleAbs( dst, abs_dst ); /// Show what you got imshow( window_name, abs_dst ); waitKey(0); return 0; }
Create some needed variables:
Mat src, src_gray, dst; int kernel_size = 3; int scale = 1; int delta = 0; int ddepth = CV_16S; char* window_name = "Laplace Demo";
Loads the source image:
src = imread( argv[1] ); if( !src.data ) { return -1; }
Apply a Gaussian blur to reduce noise:
GaussianBlur( src, src, Size(3,3), 0, 0, BORDER_DEFAULT );
Convert the image to grayscale using cvtColor
cvtColor( src, src_gray, CV_RGB2GRAY );
Apply the Laplacian operator to the grayscale image:
Laplacian( src_gray, dst, ddepth, kernel_size, scale, delta, BORDER_DEFAULT );
where the arguments are:
Convert the output from the Laplacian operator to a CV_8U image:
convertScaleAbs( dst, abs_dst );
Display the result in a window:
imshow( window_name, abs_dst );.
|
https://docs.opencv.org/3.0-alpha/doc/tutorials/imgproc/imgtrans/laplace_operator/laplace_operator.html
|
CC-MAIN-2020-24
|
en
|
refinedweb
|
Hide Forgot
Description of problem:
Starting up Vuze
Version-Release number of selected component:
java-1.8.0-openjdk-headless-1.8.0.92-3.b14.fc24
Additional info:
reporter: libreport-2.7.1
backtrace_rating: 4
cmdline: /usr/lib/jvm/jre/bin/java -cp /usr/lib64/eclipse/swt.jar:/usr/share/java/json_simple.jar:/usr/share/java/bcprov.jar:/usr/share/java/apache-commons-cli.jar:/usr/share/java/apache-commons-lang.jar:/usr/share/java/log4j-1.jar:/usr/share/azureus/Azureus2.jar:./*.jar -Djava.library.path=/home/dwald/.azureus/app -Dazureus.install.path=/home/dwald/.azureus/app -Dazureus.script=/usr/bin/azureus -Dazureus.script.version=5 -Dorg.eclipse.swt.browser.UseWebKitGTK=true -Dazureus.skipSWTcheck=1 org.gudy.azureus2.platform.unix.ScriptBeforeStartup
crash_function: outputStream::print_cr
executable: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.92-3.b14.fc24.x86_64/jre/bin/java
global_pid: 2187)
#6 outputStream::print_cr at /usr/src/debug/java-1.8.0-openjdk-1.8.0.92-3.b14.fc24.x86_64/openjdk/hotspot/src/share/vm/utilities/ostream.cpp:140
#7 VMError::report at /usr/src/debug/java-1.8.0-openjdk-1.8.0.92-3.b14.fc24.x86_64/openjdk/hotspot/src/share/vm/utilities/vmError.cpp:346
#10 signalHandler at /usr/src/debug/java-1.8.0-openjdk-1.8.0.92-3.b14.fc24.x86_64/openjdk/hotspot/src/os/linux/vm/os_linux.cpp:4233
#12 std::_Function_base::_Function_base at /usr/include/c++/6.1.1/functional:1694
#13 std::function<void ()>::function(std::function<void ()>&&) at /usr/include/c++/6.1.1/functional:1897
#14 WTF::Deque<std::function<void ()>, 0ul>::append<std::function<void ()> >(std::function<void ()>&&) at /usr/src/debug/webkitgtk-2.12.3/Source/WTF/wtf/Deque.h:441
#15 WTF::Deque<std::function<void ()>, 0ul>::append(std::function<void ()>&&) at /usr/src/debug/webkitgtk-2.12.3/Source/WTF/wtf/Deque.h:85
#16 WTF::RunLoop::dispatch(std::function<void ()>) at /usr/src/debug/webkitgtk-2.12.3/Source/WTF/wtf/RunLoop.cpp:130
#17 WebKit::ProcessLauncher::launchProcess()
#18 std::function<void ()>::operator()() const at /usr/include/c++/6.1.1/functional:2136
Created attachment 1178053 [details]
File: backtrace
Created attachment 1178054 [details]
File: cgroup
Created attachment 1178055 [details]
File: core_backtrace
Created attachment 1178056 [details]
File: dso_list
Created attachment 1178057 [details]
File: environ
Created attachment 1178058 [details]
File: limits
Created attachment 1178059 [details]
File: maps
Created attachment 1178060 [details]
File: mountinfo
Created attachment 1178061 [details]
File: namespaces
Created attachment 1178062 [details]
File: open_fds
Created attachment 1178063 [details]
File: proc_pid_status
Created attachment 1178064 [details]
File: var_log_messages
-Djava.library.path=/home/dwald/.azureus/app -Dazureus.install.path=/home/dwald/.azureus/app
--^ This suggests it's using some third-party app (vuze?), which in turn uses webkit triggering a code path that crashes the JVM. Is this reproducible with packages from Fedora only?
I can tell you it happens every time Vuze starts up, and only began after I upgraded to Fedora 24. Also, Vuze seems to run normally.
Re-assigning to azureus component as this seems more appropriate for an analysis. It seems your installation didn't come from the F24 repositories (package azureus), though. Can you confirm?
Uhm, since it got re-assigned, could you please try the version of Vuze (which gor historical reasons still is called azureus)?
sudo dnf install azureus
/usr/bin/azureus
I just briefly tried it myself here and couldn't reproduce the.
|
https://partner-bugzilla.redhat.com/show_bug.cgi?id=1354179
|
CC-MAIN-2020-24
|
en
|
refinedweb
|
10.2. Perform Hit Testing with Shapes
Problem
You need to detect whether a user clicks inside a shape.
Solution
Test the point where the user clicked with methods such as Rectangle.Contains and Region.IsVisible (in the System.Drawing namespace) or GraphicsPath.IsVisible (in the System.Drawing.Drawing2D namespace), depending on the type of shape.
How It Works
Often, if you use GDI+ to draw shapes on a form, you need to be able to determine when a user clicks in a given shape. You can determine this using a Rectangle and a Point. A Rectangle is defined by its height, width, and upper-left coordinates, which are reflected by the Height, Width, X, and Y properties. A Point, which is an X and Y coordinate, represents a specific location on the screen. ...
Get Visual Basic 2008 Recipes: A Problem-Solution Approach now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.
|
https://www.oreilly.com/library/view/visual-basic-2008/9781590599709/9781590599709_perform_hit_testing_with_shapes.html
|
CC-MAIN-2020-24
|
en
|
refinedweb
|
I am trying to use AdaBoostClassifier with a base learner other than a decision tree. I have tried SVM and KNeighborsClassifier but I get errors. Can someone point out the classifiers that can be used with AdaBoostClassifier?
There is a way to find out all the base learners supported by AdaBoostClassifier. A compatible base learner's fit method needs to support sample_weight, which can be obtained by running following code:
import inspectfrom sklearn.utils.testing import all_estimatorsfor name, clf in all_estimators(type_filter='classifier'): if 'sample_weight' in inspect.getargspec(clf().fit)[0]: print name
import inspect
from sklearn.utils.testing import all_estimators
for name, clf in all_estimators(type_filter='classifier'):
if 'sample_weight' in inspect.getargspec(clf().fit)[0]:
print name
Output:
AdaBoostClassifier, BernoulliNB, DecisionTreeClassifier, ExtraTreeClassifier, ExtraTreesClassifier, MultinomialNB, NuSVC, Perceptron, RandomForestClassifier, RidgeClassifierCV, SGDClassifier, SVC.
If the classifier doesn't uses predict_proba, you will have to simply set AdaBoostClassifier parameter algorithm = 'SAMME'.
To learn more about Adaboost, go through Machine Learning Course. Also, visit Machine Learning Tutorial to master the course.
Hope this answer helps you!
|
https://intellipaat.com/community/15686/adaboostclassifier-with-different-base-learners
|
CC-MAIN-2020-24
|
en
|
refinedweb
|
Developer Product Briefs
Check out the latest VS.NET add-ins, including a component that lets you bidirectionally transform data between XML formats and relational database structures.
Proposion Report Adapter 1.0
Proposion Report Adapter is a set of extensions for integrating Lotus Notes/Domino into Microsoft SQL Server 2000 Reporting Services. Proposion Report Adapter helps you use the Report Designer client to create professional reports that draw data, including images and attachments, directly from Notes and Domino databases. Users can visit the Report Server at run time using their Web browser and access cached or up-to-the minute versions of the report and view them interactively or download them in a variety of formats, including HTML, PDF, Excel, TIFF, CSV, and XML. Proposion Report Adapter also allows any Reporting Services report, whether or not it's based on Notes data, to be run automatically on the server and delivered to subscribers via native Notes Mail or deposited in a Notes database. Starts at $795.
Proposion
Web:
Phone: 978-388-7342
Updates:
Allora 4.1
Allora is a middleware tool that lets you bidirectionally transform data between XML formats and relational database structures. Version 4.1 includes a multiple SELECT feature. This option allows you to work with multiple sub-maps that are then joined in real time with XSL, a W3C language for transforming XML documents. Rather than use database-specific SQL dumps or flat files that cannot contain table relationships or constraints, you can persist the complete database structure and data into XML for easy access or transport, and you can re-create it on any other database platform at a minimum cost. Other enhancements include support for namespace definitions, complex database expressions, NetBeans 4.1, and stored procedures in Oracle packages. Contact vendor for pricing.
HiT Software
Web:
Phone: 408-345-4001
AspLib 3.01
AspLib is a component library that features an integrated, all-in-one pack of 18 different components to facilitate your ASP.NET development cycle. These components allow you to give your Web applications a Windows-style interface. The AspLib component library offers Binary Image, Button, Calendar, Checkbox, ColorPicker, ComboBox, DualSelectBox, and ToolBar, among many other components. It also features a Web-based WYSIWYG editor for editing HTML pages online. You can use it to create tables, links, and pictures; manage CSS styles; change text color, size, pattern, and font; and add snippets and insert images. Its design with Word-style toolbar buttons lets you start editing HTML pages without any training. $299.
Astron Digital
Web:
ComponentOne Doc-To-Help 2005
ComponentOne Doc-To-Help 2005 allows you to use any HTML editor for your source content, convert RoboHelp and other HTML Help projects, and generate NetHelp, a browser-independent, HTML-based help system. You can use styles from a customizable stylesheet to define help systems within your favorite HTML editor or Word. Version 2005 also features D2HML (Doc-To-Help Markup Language) and FrontPage integration. NetHelp lets you publish your documentation on the Web so that your audience can view it regardless of their platform. Doc-To-Help Enterprise 2005 $999.95; Doc-To-Help for Word 2005 $749.95.
ComponentOne
Web:
Phone: 800-858-2739; 412-681-4343
ComponentOne Studio Enterprise 2005 Vol. 2
ComponentOne Studio Enterprise 2005 Vol. 2 adds a new component, Barcode for .NET, as well as more than 60 updates to .NET WinForms and ASP.NET WebForms components already included in the Studio Enterprise subscription. Barcode for .NET allows you to create barcodes dynamically as image objects and display them in your .NET applications. You can add barcodes to reports, grid cells, Web pages, standard .NET PrintDocument objects, and more. You can print, save, and manipulate barcodes to fit any application, and you can add control symbols and checksums automatically. New features were also added to Chart for .NET, WebChart for ASP.NET, Menus and Toolbars for .NET, Reports for .NET, and more. $999.95; upgrade $749.95.
ComponentOne
Web:
Phone: 800-858-2739; 412-681-4343
Ektron CMS400.NET 5.0
Ektron CMS400.NET delivers an infrastructure to create, manage, publish, and reuse Web content, Microsoft Office documents, and other assets, while Webmasters and site administrators retain site control. It provides Web content management functionality, including WYSIWYG editing, workflow/approval, versioning/history/audit trails, metadata support, task management, and more. Advanced features include integrated document management, an online forms engine, a calendar module, XML indexing for advanced search, content translation/localization, RSS support, and a new Explorer-like interface. An open API lets you customize the Ektron system. Version 5.0 supports Macromedia ColdFusion, Microsoft ASP, JSP, and PHP, and ASP.NET sites. Contact vendor for pricing.
Ektron
Web:
Phone: 866-435-8766; 603-594-0249
Enterprise Blocks 2.5
Enterprise Blocks is a set of .NET Web controls that help you perform data analysis on SQL Server databases. Version 2.5 includes new and upgraded ASP.NET Web controls, as well as member properties filtering and drill-through to detail data. The Enterprise Blocks catalog and workbook Web controls are available as SharePoint Web parts. The Enterprise Blocks add-in for Microsoft Reporting Services provides drag-and-drop OLAP inside Reporting Services against Analysis Services databases. The add-in for DotNetNuke allows these end-user documents or objects to be saved into and retrieved from the Windows file system as XML documents. It exposes the Windows file system allowing end-user navigation to content from inside DotNetNuke. $495.
Enterprise Blocks
Web:
Franson GpsTools 2.20
Franson GpsTools allows you to develop GPS, mapping, and basic GIS applications in Visual Studio. Version 2.20 includes vector map support, which lets you draw polygons and polylines, as well as display, save, and manage ESRI Shapefiles. It also lets you access GPS position, speed, and satellite information, without any knowledge of low-level GPS protocols. It supports almost all geographic coordinate systems on earth with a new custom grid and custom datum feature. You can define raster maps and draw icons, lines, ellipses, rectangles, and other objects on them. You can connect these maps to the GPS data, where you can rotate and zoom them. You can also draw objects on multiple layers. Starts at $49.
Franson Technology
Web:
Phone: +46-8-612-50-70
InstallShield 11
InstallShield 11 keeps you up to date with support for the latest technologies and industry standards to avoid installation failures. It lets you author installations across all platforms, operating systems, and devices. You can create Windows Installer, InstallScript, and cross-platform installations and extend them to configure database servers, Web services, and mobile devices. Version 11 supports Microsoft's recent MSI 3.1 release, IIS 6.0, DIFx 1.1, and third-party objects, including DirectX, Crystal Reports, and WMI. It also includes more than 20 InstallScript enhancements, including the ability for installations to install and register 64-bit files. Starts at $1,399.
Macrovision
Web:
Phone: 800-374-4353; 847-466-4000
Proposion N2N 2.0
Proposion N2N is a native .NET data connector for integrating IBM Lotus Notes and Domino into Microsoft's .NET Framework and Visual Studio .NET development tools. It provides an implementation of Microsoft's ADO.NET managed data provider specification, the standard interface for accessing any data source from .NET applications. Proposion N2N lets you create, update, and delete documents in your Domino database. The connector can invoke Domino agents, allowing .NET applications to leverage investment in LotusScript and JavaScript libraries. Proposion N2N also includes the N2N Query Analyzer, programming examples and sample code, and integration into the Visual Studio .NET development environment. Starts at $795.
Proposion
Web:
Phone: 978-388-7342
SftTabs/ATL 5.0
SftTabs/ATL 5.0 offers 66 customizable tab-control styles designed specifically for use with Visual Basic 6 applications. Version 5.0 introduces six new tab styles; gradient-fill backgrounds; built-in MDI-style Close, Minimize, and Restore buttons including tooltips; new button styles; simplified deployment using registration-free activation on Windows XP; and online help, printable documentation, and design-time enhancements. The tab control supports many different styles and tab locations. Tabs can use different colors, display images, use special fonts, and display multiline text with various alignment options. Scrollable tabs offer several button styles, which can use custom images. The product supports development of wizard-style dialogs and similar multipage dialogs. $350.
Softel vdm
Web:
Phone: 941-505-8600
VBdocman .NET 2.0
VBdocman .NET 2.0 is a Visual Basic .NET add-in that allows you to generate technical documentation from VB.NET source files automatically. It parses source code and creates tables of contents, indexes, topics, cross-references, and context-sensitive help automatically. You can add additional descriptions manually, or let VBdocman .NET extract them from source code comments. You can add C#, XML, or JavaDoc comments in your source code. Version 2.0 features a WYSIWYG comment editor that helps you write your XML comments. It allows you to insert tables, lists, pictures, links, and other formatting directly into your source code. $229.
Helixoft
Web:
About the Author
Written/compiled by the editors of Visual Studio Magazine.
Printable Format
> More TechLibrary
I agree to this site's Privacy Policy.
> More Webcasts
|
https://visualstudiomagazine.com/articles/2005/09/01/transform-data-between-xml-and-databases.aspx
|
CC-MAIN-2018-13
|
en
|
refinedweb
|
Directory Overview¶
This is an overview of the directories relevant to Evennia coding.
The Game directory¶
The game directory is created with
evennia --init <name>. In the
Evennia documentation we always assume it’s called
mygame. Apart
from the
server/ subfolder within, you could reorganize this folder
if you preferred a different code structure for your game.
mygame/
commands/- Overload default Commands or add your own Commands/Command sets here.
server/ - The structure of this folder should not change since Evennia expects it.
`conf/```_ - All server configuration files sits here. The most important file is ``server.conf.
logs/- Portal log files are stored here (Server is logging to the terminal by default)
typeclasses/- this folder contains empty templates for overloading default game entities of Evennia. Evennia will automatically use the changes in those templates for the game entities it creates.
web/- This holds the Web features of your game.
world/- this is a “miscellaneous” folder holding everything related to the world you are building, such as build scripts and rules modules that don’t fit with one of the other folders.
Evennia library layout:¶
If you cloned the GIT repo following the instructions, you will have a
folder named
evennia. The top level of it contains Python package
specific stuff such as a readme file,
setup.py etc. It also has two
subfolders
bin/ and
evennia/ (again).
The
bin/ directory holds OS-specific binaries that will be used when
installing Evennia with
pip as per the Getting started
instructions. The library itself is in the
evennia subfolder. From
your code you will access this subfolder simply by
import evennia.
- evennia
- ```__init__.py```_ - The “flat API” of Evennia resides here.
- ```commands/```_ - The command parser and handler.
default/- The default commands and cmdsets.
- ```comms/```_ - Systems for communicating in-game.
contrib/- Optional plugins too game-specific for core Evennia.
game_template/- Copied to become the “game directory” when using
evennia --init.
- ```help/```_ - Handles the storage and creation of help entries.
locale/- Language files (i18n).
- ```locks/```_ - Lock system for restricting access to in-game entities.
- ```objects/```_ - In-game entities (all types of items and Characters).
- ```accounts/```_ - Out-of-game Session-controlled entities (accounts, bots etc)
- ```scripts/```_ - Out-of-game entities equivalence to Objects, also with timer support.
- ```server/```_ - Core server code and Session handling.
portal/- Portal proxy and connection protocols.
`settings_default.py```_ - Root settings of Evennia. Copy settings from here to ``mygame/server/settings.pyfile.
- ```typeclasses/```_ - Abstract classes for the typeclass storage and database system.
- ```utils/```_ - Various miscellaneous useful coding resources.
- ```web/```_ - Web resources and webserver. Partly copied into game directory on initialization.
All directories contain files ending in
.py. These are Python
modules and are the basic units of Python code. The roots of
directories also have (usually empty) files named
__init__.py. These
are required by Python so as to be able to find and import modules in
other directories. When you have run Evennia at least once you will find
that there will also be
.pyc files appearing, these are pre-compiled
binary versions of the
.py files to speed up execution.
The root of the
evennia folder has an
__init__.py file
containing the “flat API”. This holds shortcuts to various subfolders
in the evennia library. It is provided to make it easier to find things;
it allows you to just import
evennia and access things from that
rather than having to import from their actual locations inside the
source tree.
|
http://evennia.readthedocs.io/en/latest/Directory-Overview.html
|
CC-MAIN-2018-13
|
en
|
refinedweb
|
"Complexity" seems to be a lot like "energy": you can transfer it from the end user to one/some of the other players, but the total amount seems to remain pretty much constant for a given task. -- Ran!. ]##.
Two identifiers are considered equal if the following algorithm returns true:
proc sameIdentifier(a, b: string): bool = a[0] == b[0] and a.replace("_", "").toLower == b.replace("_", "").toLower
That means only the first letters are compared in a case sensitive manner. Other letters are compared case insensitively and underscores treated as the two tokens * and : (to support
var v*: T).
The following strings denote other tokens:
` ( ) { } [ ] , ; [. .] {. .} (. .)
The slice operator .. takes precedence over other tokens that contain a dot: {..} are the three tokens {, .., } and not the two tokens {., .}.
This section lists Nim's standard syntax. How the parser handles the indentation is already described in the Lexical Analysis section.
Nim allows user-definable operators. Binary operators have 11 different levels of precedence..') section(variable) | bindStmt | mixinStmt) / simpleStmt stmt = (IND{>} complexOrSimpleStmt^+(IND{=} / ';') DED) / simpleStmt ^+ ';'
All expressions have a type which is known at compile time. Nim is statically typed. One can declare new types, which is in essence defining an identifier that can be used to denote this custom type.
These are the major type classes:
Ordinal types have the following characteristics:
inc,
ord,
decon ordinal types to be defined.
Integers, bool, characters and enumeration types (and subranges of these types) belong to ordinal types. For reasons of simplicity of implementation the types
uint and
uint64 are not ordinal types.
These integer types are pre-defined:
int
int8,
int16,
int32,
int64. Literals of these types have the suffix 'iXX.
uint
'uis of this type.]
The following floating point types are pre-defined:
float
float32.
The
cstring type meaning compatible string is the native representation of a string for the compilation backend. For the C backend
A variable of a structured type can hold multiple values at the same time. Structured types can be nested to unlimited levels. Arrays, sequences, tuples, objects and sets belong to the structured
[]., `$`]) {...} echo @[1, 2, 3] # prints "@[1, 2, 3]" and not "123". Also, when the fields of a particular branch are specified during object construction, the correct value for the discriminator must be supplied at compile-time.. In general, a ptr T is implicitly convertible to the pointer type.:
stringand
seqtoo.
private,
globaland
localwill prove very useful for the upcoming OpenCL target.
lentand
uniquepointers.:
fastcall, but only for C compilers that support
fastcall.
closuretake up two machine words: One for the proc pointer and another one for the pointer to implicitly passed environment.
__stdcallkeyword.
__cdeclkeyword.
__safecallkeyword. The word safe refers to the fact that all hardware registers shall be pushed to the hardware stack.
__inlineprocedures. This is only a hint for the compiler: it may completely ignore it and it may inline procedures that are not marked as
inline.
__fastcallmeans.
__syscallin C. It is used for interrupts.
fastcallto improve speed.
Most calling conventions exist only for the Windows 32-bit platform.) =.
A type
a is implicitly convertible to type
b iff the following algorithm returns true:
# XXX range types? proc isImplicitlyConvertible(a, b: PType): bool = if isSubtype(a, b) or isCovariant(a, b): return true.
An expression
b can be assigned to an expression
a iff
a is an l-value and
isImplicitlyConvertible(b.typ, a.typ) holds.
In a call
p(args) the routine
p that matches best is selected. If multiple routines match equally well, the ambiguity is reported at compiletime.
Every arg in args needs to match. There are multiple different categories how an argument can match. Let
f be the formal parameter's type and
a the type of the argument.
aand
fare of the same type.
ais an integer literal of value
vand
fis a signed or unsigned integer type and
vis in
f's range. Or:
ais a floating point literal of value
vand
fis a floating point type and
vis in
f's range.
fis a generic type and
amatches, for instance
ais
intand
fis a generic (constrained) parameter type (like in
[T]or
[T: int|char].
ais a
range[T]and
Tmatches
fexactly. Or:
ais a subtype of
f.
ais convertible to
fand
fand
ais some integer or floating point type.
a
If the experimental mode is active and no other match is found, the first argument
a is dereferenced automatically if it's a pointer type and overloading resolution is tried with
a[] instead. and
typedesc are not lazy.. However it does a control flow analysis to prove the variable has been initialized and does not rely on syntactic properties:
type MyObject = object {.requiresInit.} proc p() = # the following is valid: var x: MyObject if someCondition(): x = a() else: x = a() use x.
In a
var or
let statement tuple unpacking can be performed. The special identifier
_ can be used to ignore some parts of the tuple:
proc returnsTuple(): (int, int, int) = (4, 2, 3) let (x, _, z) = returnsTuple():
p(X)are compile-time computable if
pis a proc without side-effects (see the noSideEffect pragma for details) and if
Xis a (possibly empty) list of compile-time computable arguments.
Constants cannot be of type
ptr,
ref,
var or
object, nor can they contain such a type.:
expr) has to be a constant expression (of type
bool).
The
when statement enables conditional compilation techniques. As a special syntactic extension, the
when construct is also available within
object definitions.:
nimvm. More complex expressions are not allowed.
elifbranches.
elsebranch.
when nimvmstatement. E.g. it must not define symbols that are used in the following code..
Example:
break
The
break statement is used to leave a block immediately. If
symbol is given, it is the name of the enclosing block that is to leave. If it is absent, the innermost block is left.
Example:
echo "Please tell me your password:" var pw = readLine(stdin) while pw != "12345": echo "Wrong password! Next try:" pw = readLine(stdin)
The
while statement is executed until the
expr evaluates to false. Endless loops are no error.
while statements open an implicit block, so that they can be left with a
break`) """
Warning: The
using statement is.
An if expression is almost like an if statement, but it is an expression. Example:
var y = if x > 8: 9 else: 10
An if expression always results in a value, so the
else part is required.
Elif parts are also allowed.
Just like an if expression, but corresponding to the when statement.:
{key: val}.newOrderedTable.
constsection and the compiler can easily put it into the executable's data section just like it can for arrays and the generated data section requires a minimal amount of memory..
Example:
cast[int](x)
Type casts are a crude mechanism to interpret the bit pattern of an expression as if it would be of another type. Type casts are only needed for low-level programming and are inherently unsafe.
What most programming languages call methods or functions are called procedures in Nim.' # (x=0, y=1, s="abc", c='\t', b=false).
Since closures capture local variables by reference it is often not wanted behavior inside loop bodies. See closureScope for details on how to change this behavior..
As a special more convenient notation, proc expressions involved in procedure calls can use the
do keyword:
sort(cities) do (x,y: string) -> int: cmp(x.len, y.len) # Less parenthesis using the method plus command syntax: cities = cities.map do (x:string) -> string: "City of " & x # In macros, the do notation is often used for quasi-quoting macroResults.add quote do: if not `ex`: echo `info`, ": Check failed: ", `expString`
do is written after the parentheses enclosing the regular proc params. The proc expression represented by the do block is appended to them. In calls using the command syntax, the do block will bind to the immediately preceeding expression, transforming it in a call.
do with parentheses is an anonymous
proc; however a
do without parentheses is just a block of code. The
do notation can be used to pass multiple blocks to a macro:
macro performWithUndo(task, undo: untyped) = ... performWithUndo do: # multiple-line block of code # to perform the task do: # code to undo it
The following builtin procs cannot be overloaded for reasons of implementation simplicity (they require specialized semantic checking):
declared, defined, definedInScope, compiles, sizeOf,.
The
[] subscript operator for arrays/openarrays/sequences can be overloaded.
Procedures always use static dispatch. Multi-methods use dynamic dispatch. For dynamic dispatch to work on an object it should be a reference type as well.in a closure iterator can not occur in a
trystatement.
returnis allowed in a closure iterator (but rarely useful) and ends iteration..
The exception tree is defined in the system module::
Tis assumed to raise
system.Exception(the base type of the exception hierarchy) and thus any exception unless
Thas an explicit
raiseslist. However if the call is of the form
f(...)where
fis a parameter of the currently analysed routine it is ignored. The call is optimistically assumed to have no effect. Rule 2 compensates for this case.
p's raises list.
qwhich has an unknown body (due to a forward declaration or an
importcpragma) is assumed to raise
system.Exceptionunless
qhas an explicit
raiseslist.
mis assumed to raise
system.Exceptionunless
mhas an explicit
raiseslist.
raiseslist.
raiseslist, the
raiseand
trystatements of
pare.
Note: Read/write tracking is not yet implemented!
The inference for read/write tracking is analogous to the inference for exception tracking.)
The
is operator checks for type equivalence at compile time. It is therefore very useful for type specialization within generic code:
type Table[Key, Value] = object keys: seq[Key] values: seq[Value] when not (Key is string): # nil value for strings used for optimization deletedKeys: seq[bool]. We call such type classes bind once types.. Such type classes are called bind many types..
Note: Concepts are still in development.
Concepts, also known as "user-defined type classes", are used to specify an arbitrary set of requirements that the matched type must satisfy.
Concepts are written in the following form:
type Comparable = concept x, y (x < y) is bool Stack[T] = concept s, var v s.pop() is T v.push(T) s.len is Ordinal for value in s: value is T
The concept is a match if:
The identifiers following the
concept keyword represent instances of the currently matched type. You can apply any of the standard type modifiers such as
var,
ref,
ptr and
static to denote a more specific type of instance. You can also apply the type modifier to create a named instance of the type itself:
type MyConcept = concept x, var v, ref r, ptr p, static s, type T ...
Within the concept body, types can appear in positions where ordinary values and parameters are expected. This provides a more convenient way to check for the presence of callable symbols with specific signatures:
type OutputStream = concept var s s.write(string)
In order to check for symbols accepting
typedesc params, you must prefix the type with an explicit
type modifier. The named instance of the type, following the
concept keyword is also considered an explicit
typedesc value that will be matched only as a type.
type # Let's imagine a user-defined casting framework with operators # such as `val.to(string)` and `val.to(JSonValue)`. We can test # for these with the following concept: MyCastables = concept x x.to(type string) x.to(type JSonValue) # Let's define a couple of concepts, known from Algebra: AdditiveMonoid* = concept x, y, type T x + y is T T.zero is T # require a proc such as `int.zero` or 'Position.zero' AdditiveGroup* = concept x, y, type T x is AdditiveMonoid -x is T x - y is T
Please note that the
is operator allows one to easily verify the precise type signatures of the required operations, but since type inference and default parameters are still applied in the concept body, it's also possible to describe usage protocols that do not reveal implementation details.
Much like generics, concepts are instantiated exactly once for each tested type and any static code included within the body is executed only once.
By default, the compiler will report the matching errors in concepts only when no other overload can be selected and a normal compilation error is produced. When you need to understand why the compiler is not matching a particular concept and, as a result, a wrong overload is selected, you can apply the
explain pragma to either the concept body or a particular call-site.
type MyConcept {.explain.} = concept ... overloadedProc(x, y, z) {.explain.}
This will provide Hints in the compiler output either every time the concept is not matched or only on the particular call-site.
The concept types can be parametric just like the regular generic types:
### matrixalgo.nim import typetraits type AnyMatrix*[R, C: static[int]; T] = concept m, var mvar, type M M.ValueType is T M.Rows == R M.Cols == C m[int, int] is T mvar[int, int] = T type TransposedType = stripGenericParams(M)[C, R, T] AnySquareMatrix*[N: static[int], T] = AnyMatrix[N, N, T] AnyTransform3D* = AnyMatrix[4, 4, float] proc transposed*(m: AnyMatrix): m.TransposedType = for r in 0 .. <m.R: for c in 0 .. <m.C: result[r, c] = m[c, r] proc determinant*(m: AnySquareMatrix): int = ... proc setPerspectiveProjection*(m: AnyTransform3D) = ... -------------- ### matrix.nim type Matrix*[M, N: static[int]; T] = object data: array[M*N, T] proc `[]`*(M: Matrix; m, n: int): M.T = M.data[m * M.N + n] proc `[]=`*(M: var Matrix; m, n: int; v: M.T) = M.data[m * M.N + n] = v # Adapt the Matrix type to the concept's requirements template Rows*(M: type Matrix): expr = M.M template Cols*(M: type Matrix): expr = M.N template ValueType*(M: type Matrix): typedesc = M.T ------------- ### usage.nim import matrix, matrixalgo var m: Matrix[3, 3, int] projectionMatrix: Matrix[4, 4, float] echo m.transposed.determinant setPerspectiveProjection projectionMatrix
When the concept type is matched against a concrete type, the unbound type parameters are inferred from the body of the concept in a way that closely resembles the way generic parameters of callable symbols are inferred on call sites.
Unbound types can appear both as params to calls such as s.push(T) and on the right-hand side of the
is operator in cases such as x.pop is T and x.data is seq[T].
Unbound static params will be inferred from expressions involving the == operator and also when types dependent on them are being matched:
type MatrixReducer[M, N: static[int]; T] = concept x x.reduce(SquareMatrix[N, T]) is array[M, int]
The Nim compiler includes a simple linear equation solver, allowing it to infer static params in some situations where integer arithmetic is involved.
Just like in regular type classes, Nim discriminates between
bind once and
bind many types when matching the concept. You can add the
distinct modifier to any of the otherwise inferable types to get a type that will be matched without permanently inferring it. This may be useful when you need to match several procs accepting the same wide class of types:
type Enumerable[T] = concept e for v in e: v is T type MyConcept = concept o # this could be inferred to a type such as Enumerable[int] o.foo is distinct Enumerable # this could be inferred to a different type such as Enumerable[float] o.bar is distinct Enumerable # it's also possible to give an alias name to a `bind many` type class type Enum = distinct Enumerable o.baz is Enum
On the other hand, using
bind once types allows you to test for equivalent types used in multiple signatures, without actually requiring any concrete types, thus allowing you to encode implementation-defined types:
type MyConcept = concept x type T1 = auto x.foo(T1) x.bar(T1) # both procs must accept the same type type T2 = seq[SomeNumber] x.alpha(T2) x.omega(T2) # both procs must accept the same type # and it must be a numeric sequence
As seen in the previous examples, you can refer to generic concepts such as Enumerable[T] just by their short name. Much like the regular generic types, the concept will be automatically instantiated with the bind once auto type in the place of each missing generic param.
Please note that generic concepts such as Enumerable[T] can be matched against concrete types such as string. Nim doesn't require the concept type to have the same number of parameters as the type being matched. If you wish to express a requirement towards the generic parameters of the matched type, you can use a type mapping operator such as genericHead or stripGenericParams within the body of the concept to obtain the uninstantiated version of the type, which you can then try to instantiate in any required way. For example, here is how one might define the classic Functor concept from Haskell and then demonstrate that Nim's Option[T] type is an instance of it:
import future, typetraits type Functor[A] = concept f type MatchedGenericType = genericHead(f.type) # `f` will be a value of a type such as `Option[T]` # `MatchedGenericType` will become the `Option` type f.val is A # The Functor should provide a way to obtain # a value stored inside it type T = auto map(f, A -> T) is MatchedGenericType[T] # And it should provide a way to map one instance of # the Functor to a instance of a different type, given # a suitable `map` operation for the enclosed values import options echo Option[int] is Functor # prints true
All top level constants or types appearing within the concept body are accessible through the dot operator in procs where the concept was successfully matched to a concrete type:
type DateTime = concept t1, t2, type T const Min = T.MinDate T.Now is T t1 < t2 is bool type TimeSpan = type(t1 - t2) TimeSpan * int is TimeSpan TimeSpan + TimeSpan is TimeSpan t1 + TimeSpan is T proc eventsJitter(events: Enumerable[DateTime]): float = var # this variable will have the inferred TimeSpan type for # the concrete Date-like value the proc was called with: averageInterval: DateTime.TimeSpan deviation: float ...
When the matched type within a concept is directly tested against a different concept, we say that the outer concept is a refinement of the inner concept and thus it is more-specific. When both concepts are matched in a call during overload resolution, Nim will assign a higher precedence to the most specific one. As an alternative way of defining concept refinements, you can use the object inheritance syntax involving the
of keyword:
type Graph = concept g, type G of EqualyComparable, Copyable type VertexType = G.VertexType EdgeType = G.EdgeType VertexType is Copyable EdgeType is Copyable var v: VertexType e: EdgeType IncidendeGraph = concept of Graph # symbols such as variables and types from the refined # concept are automatically in scope: g.source(e) is VertexType g.target(e) is VertexType g.outgoingEdges(v) is Enumerable[EdgeType] BidirectionalGraph = concept g, type G # The following will also turn the concept into a refinement when it # comes to overload resolution, but it doesn't provide the convenient # symbol inheritance g is IncidendeGraph g.incomingEdges(G.VertexType) is Enumerable[G.EdgeType] proc f(g: IncidendeGraph) proc f(g: BidirectionalGraph) # this one will be preferred if we pass a type # matching the BidirectionalGraph concept.
The
bind statement is the counterpart to the
mixin statement. It can be used to explicitly declare identifiers that should be bound early (i.e. the identifiers should be looked up in the scope of the template/generic definition):
# Module A var lastId = 0 template genId*: untyped = bind lastId inc(lastId) lastId
# Module B import A echo genId()
But a
bind is rarely useful because symbol binding from the definition scope is the default.: untyped): untyped = #
untyped,
typed or
typedesc (stands for type description). These are "meta types", they can only be used in certain contexts. Real types can be used too; this implies that
typed expressions are expected..
You can pass a block of statements as a last parameter to a template via a special
: syntax:
template withFile(f, fn, mode, actions: untyped): untyped =.].
A template is a hygienic macro and so opens a new scope. Most symbols are bound from the definition scope of the template:
# Module A var lastId = 0 template genId*: untyped = inc(lastId) lastId
# Module B import A echo genId() # Works as 'lastId' has been bound in 'genId's defining scope
As in generics symbol binding can be influenced via
mixin or
bind statements.
In templates identifiers can be constructed with the backticks notation:
template typedef(name: untyped, typ: typedesc) = type `T name`* {.inject.} = typ `P name`* {.inject.} = ref `T name` typedef(myint, int) var x: PMyInt
In the example
name is instantiated with
myint, so `T name` becomes
Tmyint.'
Per default templates are hygienic: Local identifiers declared in a template cannot be accessed in the instantiation context:
template newException*(exceptn: typedesc, message: string): untyped =: untyped, actions: untyped): untyped =: untyped) =.
A macro is a special kind of low level template. Macros can be used to implement domain specific:
macrostmtsyntax (statement macros)
The following example implements a powerful
debug command that accepts a variable number of arguments:
# to work with Nim syntax trees, we need an API that is defined in the # ``macros`` module: import macros macro debug(n: varargs[untyped]): untyped = # )) are defined just as expression macros. However, they are invoked by an expression following a colon.
The following example outlines a macro that generates a lexical analyzer from regular expressions:
import macros macro case_token(n: untyped): untyped = #:
Whole routines (procs, iterators etc.) can also be passed to a template or a macro via the pragma notation:
template m(s: untyped) = discard proc p() {.m.} = discard
This is a simple syntactic transformation into:
template m(s: untyped) = discard m: proc p() = discard.
Note: Dot operators are still experimental and so need to be enabled via
{.experimental.}.:
This operator will be matched against both field accesses and method calls.
This operator will be matched exclusively against method calls. It has higher precedence than the . operator and this allows one to handle expressions like x.y and x.y() differently if one is interfacing with a scripting language for example.
This operator will be matched against assignments to missing fields.
a.b = c # becomes `.=`(a, "b", c)
There are 3 operations that are bound to a type::
exprin
var x = expr.
exprin
let x = expr.
exprin
return expr.
exprin
result = exprwhere
result
The operators
*,
**,
|,
~ have a special meaning in patterns if they are written in infix notation.
|operator
The
| operator if used as infix operator creates an ordered choice:
template t{0|1}(): untyped = 3 let a = 1 # outputs 3: echo a
The matching is performed after the compiler performed some optimizations like constant folding, so the following does not work:
template t{0|1}(): untyped =.
{}operator
A pattern expression can be bound to a pattern parameter via the
expr{param} notation:
template t{(0|1|2){x}}(x: untyped): untyped = x+1 let a = 1 # outputs 2: echo a
~operator
The
~ operator is the not operator in patterns:
template t{x = (~x){y} and (~x){z}}(x, y, z: bool) = x = y if x: x = z var a = false b = true c = false a = b and c echo): untyped = &): untyped =[untyped], f: File, w: untyped) = w(f, x, y)
The following example shows how some simple partial evaluation can be implemented with term rewriting:
proc p(x, y: int; cond: bool): int = result = if cond: x + y else: x - y template optP1{p(x, y, true)}(x, y: untyped): untyped = x + y template optP2{p(x, y, false)}(x, y: untyped): untyped = x - y.
The
include statement does something fundamentally different than importing a module: it merely includes the contents of a file. The
include statement is useful to split up a large module into several files:
include fileA, fileB, fileC:
import "gfx/3d/somemodule"
Identifiers are valid from the point of their declaration until the end of the block in which the declaration occurred. The range where the identifier is known is the scope of the identifier. The exact scope of an identifier depends on the way it was declared..
The field identifiers inside a tuple or object definition are valid in the following places:
The Nim compiler emits different kinds of messages: hint, warning, and error messages. An error message is emitted if the compiler encounters any static error.
The
destructor pragma is used to mark a proc to act as a type destructor. Its usage is deprecated, see type bound operations instead.
See type bound operations instead.
The
procvar pragma is used to mark a proc that it can be passed to a procedural variable.
The
noreturn pragma is used to mark a proc that never returns.
The
final pragma can be used for an object type to specify that it cannot be inherited from.!".}
The
warning pragma is used to make the compiler output a warning message with the given content. Compilation continues after the warning.
The
hint pragma is used to make the compiler output a hint message with the given content. Compilation continues after the hint.
The
line pragma can be used to affect line information of the annotated statement as seen in stack backtraces:
template myassert*(cond: untyped,.
See Ordinary vs immediate templates.
The listed pragmas here can be used to override the code generation options for a proc/method/converter.
The implementation currently provides the following possible options (various others may be added later).
Example:
{.checks: off, optimization: speed.} # compile without runtime checks and optimize for speed
The push/pop pragmas are very similar to the option directive, but are used to override the settings temporarily. Example:
{.push checks: off.} # compile this section without runtime checks as it is # speed critical # ... some code ... {.pop.} # restore old settings."
This section describes additional pragmas that the current Nim implementation supports but which should not be seen as part of the language specification.
The
bitsize pragma is for object field members. It declares the field as a bitfield in C/C++.
type mybitfield = object flag {.bitsize:1.}: cuint
generates:
struct mybitfield { unsigned int flag:1; };
The
volatile pragma is for variables only. It declares the variable as
volatile, whatever that means in C/C++ (its semantics are not well defined in C/C++).
Note: This pragma will not exist for the LLVM backend..
The
incompleteStruct pragma tells the compiler to not use the underlying C
struct in a
sizeof expression:
type DIR* {.importc: "DIR", header: "<dirent.h>", final, pure, incompleteStruct.} = object.
The
link pragma can be used to link an additional file with the project:
{.link: "myfile.o".} #..
The sloppy interfacing example uses
.emit to produce
using namespace declarations. It is usually much better to instead refer to the imported name via the
namespace::identifier notation:
type IrrlichtDeviceObj {.final, header: irr, importcpp: "irr::IrrlichtDevice".} = object
When
importcpp is applied to an enum type the numerical enum values are annotated with the C++ enum type, like in this example:
((TheCppEnum)(3)). (This turned out to be the simplest way to implement it.)
Note that the
importcpp variant for procs uses a somewhat cryptic pattern language for maximum flexibility:
#symbol is replaced by the first or next argument.
#.indicates that the call should use C++'s dot or arrow notation.
: "#[#]".}
'followed by an integer
ioperation..()
The
injectStmt pragma can be used to inject a statement before every other statement in the current module. It is only supposed to be used for debugging:
{.injectStmt: gcInvariants().} # ... complex code here that produces crashes ....
Nim's FFI (foreign function interface) is extensive and only the parts that scale to other future backends (like the LLVM/JavaScript backends) are documented
$$.
The
bycopy pragma can be applied to an object or tuple type and instructs the compiler to pass the type by value to procs:
type Vector {.bycopy, pure.} = object x, y, z: float
The
byref pragma can be applied to an object or tuple type and instructs the compiler to pass the type by reference (hidden pointer) to procs.,.eThread..
To override the compiler's gcsafety analysis a
{.gcsafe.} pragma block can be used:
var someGlobal: string = "some string here" perThread {.threadvar.}: string proc setPerThread() = {.gcsafe.}: deepCopy(perThread, someGlobal)
Future directions:.)
The interaction between threads and exceptions is simple: A handled exception in one thread cannot affect any other thread. However, an unhandled exception in one thread terminates the whole process!
Nim has two flavors of parallelism:
parallelstatement.
spawnstatement.:
f(a, ...).
fmust be
gcsafe.
fmust not have the calling convention
closure.
f's parameters may not be of type
var. This means one has to use raw
ptr's for data passing reminding the programmer to be careful.
refparameters are deeply copied which is a subtle semantic change and can cause performance problems but ensures memory safety. This deep copy is performed via
system.deepCopyand so can be overridden.
fand the caller a global
TChannelneedswithin a
parallelsection has special semantics.
a[i]and
a[i..j]and
destwhere
destis part of the pattern
dest = spawn f(...)has to be provably disjoint. This is called the disjoint check.
locthat is used in a spawned proc (
spawn f(loc)) has to be immutable for the duration of the
parallelsection. This is called the immutability check. Currently it is not specified what exactly "complex location" means. We need to make this an optimization!
parallelsection.
Apart from
spawn and
parallel Nim also provides all the common low level concurrency mechanisms like locks, atomic intristics or condition variables.
Nim significantly improves on the safety of these features via additional pragmas:: untyped) =): untyped = {.locks: [dummyLock].}: memoryReadBarrier() x echo atomicRead(atomicCounter)
The
locks pragma takes a list of lock expressions
locks: [a, b, ...] in order to support multi lock statements. Why these are essential is explained in the lock levels section.: untyped) =).
The
locks pragma can also take the special value
"unknown". This is useful in the context of dynamic method dispatching. In the following example, the compiler can infer a lock level of 0 for the
base case. However, one of the overloaded methods calls a procvar which is potentially locking. Thus, the lock level of calling
g.testMethod cannot be inferred statically, leading to compiler warnings. By using
{.locks: "unknown".}, the base method can be marked explicitly as having unknown lock level as well:
type SomeBase* = ref object of RootObj type SomeDerived* = ref object of SomeBase memberProc*: proc () method testMethod(g: SomeBase) {.base, locks: "unknown".} = discard method testMethod(g: SomeDerived) = if g.memberProc != nil: g.memberProc().
© 2006–2017 Andreas Rumpf
Licensed under the MIT License.
|
http://docs.w3cub.com/nim/manual/
|
CC-MAIN-2018-13
|
en
|
refinedweb
|
++.
// C++ program to find corner points of // a rectangle using given length and middle // points. #include <bits/stdc++.h> using namespace std; // Structure to represent a co-ordinate point struct Point { float x, y; Point() { x = y = 0; } Point(float a, float b) { x = a, y = b; } }; // This function receives two points and length // of the side of rectangle and prints the 4 // corner points of the rectangle void printCorners(Point p, Point q, float l) { Point a, b, c, d; // horizontal rectangle if (p.x == q.x) { a.x = p.x - (l/2.0); a.y = p.y; d.x = p.x + (l/2.0); d.y = p.y; b.x = q.x - (l/2.0); b.y = q.y; c.x = q.x + (l/2.0); c.y = q.y; } // vertical rectangle else if (p.y == q.y) { a.y = p.y - (l/2.0); a.x = p.x; d.y = p.y + (l/2.0); d.x = p.x; b.y = q.y - (l/2.0); b.x = q.x; c.y = q.y + (l/2.0); c.x = q.x; } // slanted rectangle else { // calculate slope of the side float m = (p.x-q.x)/float(q.y-p.y); // calculate displacements along axes float dx = (l /sqrt(1+(m*m))) *0.5 ; float dy = m*dx; a.x = p.x - dx; a.y = p.y - dy; d.x = p.x + dx; d.y = p.y + dy; b.x = q.x - dx; b.y = q.y - dy; c.x = q.x + dx; c.y = q.y + dy; } cout << a.x << ", " << a.y << " n" << b.x << ", " << b.y << "n"; << c.x << ", " << c.y << " n" << d.x << ", " << d.y << "nn"; } // Driver code int main() { Point p1(1, 0), q1(1, 2); printCorners(p1, q1, 2); Point p(1, 1), q(-1, -1); printCorners(p, q, 2*sqrt(2)); return 0; }
Output:
0, 0 0, 2 2, 2 2, 0 0, 2 -2, 0 0, -2 2, 0
Reference:
StackOverflow
This article is contributed by Ashutosh Kumar given four points form a square
- Find points at a given distance on a line of given slope
- Count Integral points inside a Triangle
- How to check if two given line segments intersect?
- How to check if a given point lies inside or outside a polygon?
-.
|
https://www.geeksforgeeks.org/find-corners-of-rectangle-using-mid-points/
|
CC-MAIN-2018-13
|
en
|
refinedweb
|
Are you sure?
This action might not be possible to undo. Are you sure you want to continue?
CIETY 770 Eastern Parkway Brooklyn, New York 11213
Copyright O 1998 by J. Immanuel Schochet Published by Kehot Publication Society 770 Eastern Parkway / Brooklyn, New York 11213 . . (718) 774-4000 / FAX (718) 774-2718 e-mail: kehot@chabad.org Orders Department: 291 Kingston Avenue / Brooklyn, New York 11213 (718) 778-0226 / FAX (71 8) 778-4148 All rights resewed, including the right to reproduce this bookor portions thereof, in any form, without prior permission, in writin& from the publisher. Library of Congress Cataloging-in-Publication Data Tsava'at ha-%vash. English. The testament of Rabbi Israel Baal Shem Tov and rules of upright conduct : consisting of instructions . . . heard from the holy mouth of. . . Israel Baal Shem Tov . . . : and to those were added rules of upright conduct from the man of God . . . Dov Ber of the community of Mezhirech. Includes bibliographical references and index. ISBN 0-8266-0399-8 (hard : alk.paper) 1. Ba'al Shem Tov, ca 1700-1760-Will. 2. Wills, Ethical. 3. Hasidism. I. Ba'al Shem Tov, ca.1700-1760. 11. DovBaer, of Mezhirech, d. 1772. 111. Title. BJ1286.W6T7213 1998 296.3'C.c21 98-12351 CIP Printed in the United Sfatex !$America
TESTAMENT OF RABBI ISRAEL BAAL SHEM TOV AND RULES OF UPRIGHT CONDUCT CONSISTING OF INSTRUCTIONS, RULES OF PROPER CONDUCT, GREAT AND WONDROUS COUNSELS FOR THE SERVICE OF THE CREATORRE, LATING TO TORAH, PRAYER AND OTHER TRAITS, HEARD FROM THE HOLY MOUTH OF THE MAN OF GOD, THE HOLY LIGHT, OUR MASTER RABBI ISRAEL BAAL SHEM TOV, HIS MEMORY B FOR A BLESSING, FOR THE LIFE OF THE WORLD TO COME; AND TO THESE WERE ADDED RUIES OF UPRIGHT CONDUCT FROM THE MAN OF GOD, THE HOLY LIGHT, OUR MASTER RABBI DOVBER OF THE COMMUNOIF~ M EZHIRECH [Text of the original title-page]
Foreword ....................................................................... ...........i.x Introduction I The Literary Origin of Tzava'at Harivash ........................ xi I1 Basic Concepts in Tzava'at Harivash . . Deveikut ................................................................... .....m. il ... Prayer ......................................................................... m.. ill Torah-Study ............................................................... xx Mitzvot ........................................................................ ...x. xi . . Joy ............................................................................ ...m.. i Religious Ethics in Daily Life .....................................x xiv Sublimation of Alien Thoughts and Yeridah Tzorech Aliyah ...................................................m i I11 Target of Opposition to Chassidism ....................... xxxvii Tzava'at Harivash .............................................................. .......... 1 Glossary ....................................................................... ..........1. 47 Bibliography ................................................................... .......1. 55 Index of Quotations ............................................................ ..1. 61 Index of Subjects. ............................................................. ......1 67 Appendix ....................................................................... ........1. 81
A fifth edition. appearing in various studies or anthologies of the Baal Shem Tov's teachings. I acceded to many requests and translated Tzava'at Harivash into English. This. I published a new edition of Tzava'at Harivash with source-references. Menachem M. 60 and 61. cross-references. 5 and 6. A number of teachings in this work had been translated before. R. 82 and 83. 17 to 19. These include. with corrections and further additions. and other supplements. 7 and 8. Israel Baal Shem Tov (18 Elul 5458-6 Sivan 5520). 1." the text's general usage of third person was changed (in most cases) to second person. 26 and 27. at the behest of the Lubavitcher Rebbe. This English rendition follows my original Hebrew edition in the division of the text into separate se~tionsA. brief commentaries. . 13 and 14. In view of the present observance of the 300th anniversary of the birth of R.' each with further additions. for which the translator must assume full responsibility. and has already gone through four printings. Also. Careful review of the material convinced me that these combinations are more appropriate than my original division. is presently in prin t and will appear shortly. and 126 and 127. Schneerson YI~V. Even so. The only divergence is in joining sections 2 and 3. however. is the first translation of the complete text. It is most gratifying that this has become the standard edition. in line with the nature of the contents as instructions for "proper conduct and practices.In 1975. I added to each segment brief comments and explanations. 2.78 and 79.~n y translation is of itself an interpretation.
the renowned R. . 11 Nissan. This will surely hasten the promise made to the Baa1 Shem Tov of bringing about the Messianic redemption when "the earth shall be full with the knowledge of God as the waters cover the sea" (Isaiah ll:9) "and they shall teach no more every man his neighbor and every man his brother saying. .. Immanuel Schochet Toronto. Ont. 5758 3. Abraham Gershon of Kitov. Indeed. from scholar to simpleton. In view of the numerous references to Maaid Devarav Leya'akov the appendix offers a comparative table of the principal editions currently in use. the mystical tradition of Judaism. and the impact of its publication. 'Know God. the Baal Shem Tov records in a famous letter addressed to his brother in-law. the inner dimension of the Torah. that it was revealed to him that the Messianic redemption will follow when his teachings "will become renowned and will be revealed throughout the world. Chassidism made it possible that everyone. externally)' . be able to taste from the Tree of Life of pnimiyut haTorah. for then the kelipot (aspects of evil) will perish and it will be a time of propitiousness and deliverance.FOREWORD where it was felt to be necessary or helpful. from the least of them unto the greatest of them" (Jeremiah 3 1 :33). J. citations of earlier sources that elucidate the contents or indicate authoritative roots for the ideas stated. the central themes that appear in it." Thus it is our prayerful hope that this work be not only a worthy noting of the present anniversary.' for they shall all know Me.' An extensive introduction discusses the literary origin of Tzava'af Han'vmh. but also be conducive in brinpng the inspiration of the Baal Shem Tov and Chassidism to an ever-widening audience. . and 'your wellsprings will be dispersed chutzah (abroad.
which incorporates R. YalakovYossef of Polnoy's Toldot Ya'akov Yossef (1780). all of its contents can be found in anthologies of the Mamd's teachings. and a few additional sections in Maggid Devarav Leya'akov. and 141-143. It was preceded only by R. Menachem Mendel of Vitebsk (first published in 1911). third edition 1792). the Maggid of Mezhirech. . also known as Likkutei Amarim (1781. and sect. 113 is a duplication of sect. In fact. 62. seventy-four appear in Likkutim Yekarim. forty-three appear in the Likkutei Amrim attributed to R. and three (and with some 1. 125. Actually there are only 141 sections: sect. It is identical in form and style to Maggid Devarav Leya'akov and Likkutim Yekarim. Dov Ber of Mezhirech's Maggid Devarav Leya'akov. Note also that sect. 2. 123. thirty-three in Or Torah (first published in 1804). 42. second edition with supplements 1784. and sect. and R. Sections 102. Dov Ber. Tzava'at Harivash is an anthology of teachings and instructions attributed to the Baal Shem Tov and his successor. and Likkutim Yekarim. 51. 35 is a variation o n 42. Ben Porat Yo& (1781) and Tzafnat Pane'ach (1782).INTRODUCTION I THEL ITERAROYR IGINOF TZAVA'ANTA RNAsH Tzava'at Harivash is one of the earliest Chassidic texts to be published. 57 is a duplication of sect. To a great extent it is identical to these also in content: the major part of our text appeared already in Likkutim Yekarim. Its first edition appeared in 1792 or 1793 (no date is mentioned). R. 97 is essentially a brief version of sect. though some of these were published later: all but six' of its 1432 sections appear in Or Ha'emet (first published in 1899). Meshulam Feivish of Zborez' Yosher Diwei Emet (1792).
variations another five) in Maggid Devarav Leya'akov. 75. our Master Rabbi Dov Ber of the community of Mezhirech. 31. 1. for the life of the world-to-come.5 3. Some appear also in Kitvei Kodesh (1884) and in Shemu'ah Tovah (1938). 106. 101. his memory is for a blessing. 96. because it would create the assumption that everything up to there is from the Baal Shem Tov. This appears rather untenable. 10. 101-b. nineteen sayings appear with the name of the Baal Shem Tov. rules of proper conduct." In the text itself. 47. 109. 5. 120 and 124. our Master Rabbi Israel Baal Shem Tov. 69 and 73. to the exclusion of the rest. Sect.. 100. Rabbi Isaiah. heard from the holy mouth of the Man of God. 76. Sect.. Some have suggested that the heading preceding this section may be meant for all the sections from there on. The original title-page reads as follows: "Book ofthe Testament $Rabbi Israel Baal Shem and Hanhagot Yesharot (rules of upright conduct)--that was found in the valise of . To these were added Hnnhgot Yesharot from the Man of God. 91-93. the Holy Light. when in fact both parts are of the same nature . 4. These duplications beg consideration to determine the origin of Tzava'at Harivash. 41. 17-19. Head of the Rabbinic Court and Head of the Academy of the holy community of Yanow-which consists of tzava'ot (instructions). Sect. great and wondrous counsels for the service of the Creator relating to Torah and prayer and other traits. 64-65.3 In other early sources we find attributions to the Baal Shem Tov for another five teaching^. the Holy Light.^ Explicit attribution to the Maggid appears in our text only once . see my notes on these sections in the Hebrew edition.
' Magqid Devarav Lqa'akov was edited by R. M. R. Levi Yitzchak of Berdichev."'o Kitvei Kodesh was printed from manuscripts owned by R. another disciple of the Maggid. p. R. app ear in Torat Hamaggid Mtmezhirech.. 10. compiled . the title-page of which reads: "Likkutei Amrim of the saintly rabbi. 27 sections of Tzava'af Harivash appear there as well. It is also not known who compiled Likkutim Yekarim6 and Or Torah. Israel of Kozienice.. the rabbi of the holy community of the capital Nikolsburg. the famous Holy Light. from manuscripts written by other^.. 9. Its contents are identical to a manuscript that was in the possession of R. Haberman's bibliographical list in Sefer Habesht. but the number and type of its variations and additions necessitate a separate study of its origin. as was also Shemu'ah Tovah? Likkutei Amarim (Vitebsk) was printed from a manuscript found among the possessions of R. and 2 pages of its contents. 46ff. it is indeed most likely that Likkutim Yekarim was published from his manuscripts. Darkei Yesharim-Hanhagot Yesharot. Meshulam Feivish of Zborez because he mentions manuscripts of the Maggid in his possession and his own Yosher Divrei Emet was incorporated in Likkutim Yekarim.. Jerusalem IW. by his disciple . See the publisher's foreword. Photostats of this manuscript's title-page. Menachem Mendel of Vitebsk and erroneously attributed to him by the publishers. the Maggid of the holy community of Mezhirech. 8.) is not included in our list. Yeshayah of Donavitz. See the publishers' forewords to these works. Shemuel Shmelka of Nikolsburg. attributed to R. see A. Shelomoh of Lutzk. As stated below.. See below the quotation from the introduction to Maggid Devarav Leyn'akov. 7. Menachem Mendel of Premishlan [Przemysl] (first published around 1800. Indeed. .It is not known who compiled Tzava'at Harivash. Some suspect that it is R. [7-91. and verified by. Its title-page mentions merely that this work was published from manuscripts in the possession of. Dov Ber . a disciple and relative of the Maggd. our Master R. pp. but not necessarily by him. 1' 6.. 11. Shmelka.^ Or Ha'emet was printed from a manuscript of R.
This raises some questions about its literary origin. 14. (Only half of sect. Shelomoh of Lutzk. Some appear partially. in another. and edited by Sect. 15-16. A closer study of the sources. or more elaborately. note 12. there are significant omissions in some of its versions. Sect. Most duplications are generally identical. he came into possession of "a number of manuscripts written by various people. (Only part of sect. as noted above. Magqid Devarav Leya'akov.INTRODUCTION All these works contain teachings that appear in the others. or in brief versions. R. Magid Devarav Leya'akov. The first in the series of publications of the Maggid's teachings is. provides the answer." and ten that I found only in Or Ha'ernet. 76. Ze'ev Wolf of Greater Horodna in Lithuania..) 102 and 123. confusion and omissions that would require total re-writing which. Tzava'at Harivash is the only one of these anthologies that does not contain anything original. has a brief passage with similarity to sect.) 15. and completely. 101-b was printed in Tza~ta'aHt arivash. but otherwise there are but minor variations. anything that 1s not found in the others. Fortunately. 143 was printed in Tzava'at Harivash. i. 97. sect. Sect. Sect. in one text. 123 and most likely is taken from the same discourse. Generally they were full of errors. and especially copied from the handwriting of R. Its editor. 51 (duplicated in sect. he complains. would have been very difficult for him. 99-101a-b and 115. It is noteworthy that it contains two sections that I found only in Likkutim Yekarim.I4 Moreover. however. . including one15 that leaves its rendition incomplete. great 141 and 143. 58. 143. arbitrary anthologes without any order or system and (at least some) copied from one another. however.lz two that I found only in Or Torah. 113). as noted above. relates in his detailed introduction that a number of manuscripts of the Mawd's teachings circulated in his time.e.
41 (p. The differences between them (additional materials. and all his references can be found in Likkutim Yekarim. delightful discourses that I still remember. Yeshayah of Donovitz (Or Torah). Shelomoh published these manuscripts unaltered as the book Maaid Devarav Leya'akov. R.l7 It is safe to assume that the publisher of Likkutim Yekarim used his manuscript(s) to publish that work. ch." R. Shemu'el Shmelka of Nikolsburg (Likkutei Amarim-MS). ch . R. Written in 5777. R. 17 (p. 142b). Shelomoh of Lutzk The identical contents clearly indicate that all of these must have had a singular source. 19 (p. 15 (pp. R. 117b and 118a). 42 (p. Shemu'ah Tovah). ch. R. Meshulam Feivish of Zborez (Likkutim Yekarim). 56 (p. Thus we find a series of manuscripts containing identical writings in the hands of R. Levi Yitzchak of Berdichev (Or Ha'emet. 110a) and ch. Shelomoh of Lutzk (Maggid Devarav Leya'akov). 118b)..him. . R. 1 (p. Menachem Mendel of Vitebsk (Likkutei Amarim)." He mentions these manuscripts several times. Meshulam Feivish of Zborez writes in the introduction to Yosher Diwei Emeti6 (which was incorporated in Likkutim Yekarim) that he merited to attend to the Maggid and later on (after the Maggid's passing) obtained "sacred writings of his holy words. but it was impossible for me to rewrite them and to arrange them in orderly fashion. Israel of Kozinice (Kitvei Kodesh). See there ch. R. aside of the anonymous manuscripts mentioned by R. textual variations and so forth) can be accounted for by some having more or less complete manu16. as noted by the author there. 134a). 14 (p . as appears also from the fact that his Yosher Divrei Emet was incorporated therein. omissions. I found [in them] . and R. 117a) 17. Yeshayah of Yanov (Tzava'at Harivash).. Ze'ev Wolf of Horodna and R. ch. 120a). ch. 134a) and ch.
his "Safrut Hahanhagof Hachasridit. and of related interest. Schneur Zalman of Liadi. published in 1772 (thus during the life-time of the Maggid). and the many hands of copyists until the respective manuscript came into the hands of the rabbis. These omissions are of two kinds: a)there is much more material in the other works that fits the theme of Tzava'at Harivash and would surely have been included if available to the editor." Kiryat S+r. He verifies the absolute authenticity of our book's contents." Zion 464. was left incomplete. 19. The manuscripts used by the anonymous editor were not the best. pp. 38). clearly indicates that the author had a manuscript containing section sect. Its editor selected passages that would form a manual for religious ethics. The wording in the criticism against the Chassidic emphasis on joy and condemnation of melancholy that appeared in Zemir Aritzim Vechorbot Tzurim (ed.scripts. They were obviously defective. and he did not decree anything before his passing. 52. pp.' and [the compil18. Jerusalem 1981. as mentioned above. in the life-time of the Maggid. 187-210. and circulated widely to the point of reaching also the hands of the adversaries of Chassidism. a principal disciple of the Maggid. Jerusal em 1977. See also Z. [Its contents] are but collections of his pure sayings that were gathered 'gleanings upon gleanings. R. 198-305. This analysis of the origin of Tzava'at Harivash19 is supported by the testimony of an authoritative contemporary. These manuscripts were already written and copied. vol.18 Tzdva'at Harivash differs from all these other works in one important respect: it is not simply a copy of one or more of these manuscripts. but an edited selection of teachings with one theme. 46 in Tzava'at Harivash. but also comments that "it is not at all [the Baal Shem Tov's] last will. as indicated in the title-page. Wilensky. . Gries. as appears from significant omissions in our text which otherwise make no sense at all. p. and b)section 143. "Arichat Tzava'at Harivash.
23." a Talmudic expression (Ta'anit 6b). of blessed memory. 21. Deveikut The central theme in Tzava'at Harivash.81. Tanya. See sect.. 3. 25. 22. sect. See below. . but also to man's mundane engagements in the daily life. It is an all-comprehensive principle. is the ultimate of Chassidism's religious values: deveikut. for the Baal Shem Tov. note 27. and later copyists omitted some parts (and perhaps added others from different manuscripts) until some late copy or copies came into the hands of our editor from which he made his selection that comprises our text. would deliver his Torahdiscourses in Yiddish.ers] were unable to phrase it exactly. 29-30. 101 and 136. It implies constant communion with God. "zO "Gleanings upon gleanings. that relates not only to prayerz1 and Torah-study=.30. and not in the sacred tongue (Hebrew).84. not surprisingly. attachment or cleaving unto God. 138a-b and 141a. . pp. means that our editor's manuscript had passed through various stages: copies were made from the original manuscript(s) of an anthology of the Baal Shem Tov and the Maggid's teachings. Igeret Hakoderh.23 Its pursuit enables man to achieve the level of equanimity by means of which he transcends worldly thoughts and con20. See sect. a vivid and overwhelming consciousness of the Omnipresent as the sole true reality.
then. can and must engage in this form of communion with God. without distinction. S. In addition to the cited references see also sect. It is also universal. and cf. Sect. 12.31. Sha'ar Hatefilah. 80." i. 4 (p.) and sect. though Torah-study is in principle superior to worship. and the primary bimr (refinement and correction of the world that leads to the Messianic redemption). 41. 155aff. 82. relating to the common folks no less than to the saint and scholar.~za~v a'at Harivarh is then replete with emphasis on the significance of prayer and guidance for proper prayer and worship: 24. Kuntres Acharon. The predominance of this theme is readily understood in view of the Chassidic emphasis on prayer. 7. ch. the period of ikvot Meshichah ("on the heels of Mashiach. that it is a recurring theme throughout our text. Isaac Luria.25 Prayer The most frequently mentioned concept in Tzava'at Harivash is prayer. Eitz Chayim 39:l-2 and 47 :6. is expressly through prayer. For prayer is the most direct and most common occasion for deveikut. 27. 162a). 111 and 135. Moreover. It is the subject of over 40 sections. Every individual. Peri Eitz Chayim. 63. 10. and see below. Religious Ethics in Daily Life.. ruled: in the present era. See sect. 8 (p. .38-39. sect.V. the supreme authority of Jewlsh mysticism.26 Thus we are told that the Baal Shem Tov merited his unique attainment of spiritual perfection and his revelations of supernal matters by virtue of his prayers with great kavanah (devotion).e. 25. and not by virtue of his extensive study of the Talmud and the ~o d i f i e r sT.cernsZ4 Little wonder. See Tanya. the period just prior to the Messianic redemption) the primary service of God. R. 26.
Sect. one is to attain the level of deveikut. Sect. 84.58-59.75 and 108. and through.34 Proper kavanah is possible only with personal exertion. 4. 60-61 and 72. 120. bodily movements (swaying).Prayer is union with the Shechinah. 37.30 Thus one must pray with all one's strength31 to the extent that the words themselves become alight?2 and it should be with joy33 and hithhavut (fervor. Sect. 37. 61 and 143.42 One is not to be discouraged when it seems difficult to concentrate 28. 41.58-59.68 and 104-105. 62.28 In. 40.35 Initially this may necessitate to pray out loud. though. 19 and 61. 38. Sect. Sect. 118. Sect. to stimulate leavanah26 The ideal prayer.38 This will also avoid beingperturbed by alien thoughts in prayer. 75. 34. is inaudible and immobile." The attainment of the proper state requires gradual stages of ascent. 33-35. Sect. 107-108. Sect.97 and 123. but to serve God and fulfill His Will. 32. 30. 35. Sect. and reading from the prayer-book. Sect. Sect.57-59. . Sect. 32.35. 42. 105. to spur man to greater effort on concentration and devotion. Sect.41 Special effort must be made at the very beginning and that at least part of the prayer is in proper fashion. 39.61. 68.67-70. 123 and 136. ecstasy). 33.39 Unavoidable disturbances from without are Providential.68 and 104-105. 62 and 97. 40. 31.29 a deveikut that will then extend beyond the prayers into the daily activities. 32-33.37.58.3' The focus in prayer is not to be on personal gains. prayer. 36. 73.40.42. Sect. 33. 29. the prayer that is altogether from within. Sect.
54 and 119. entreat God for His assistance and you will Torah-Study The emphasis on deveikut and prayer is not to belittle the significance and central role of Torah-study. 113 and 119. It furbishes the and is the essential antidote to the temptations of the yetzer hara (inclination to evi1). 58. 51 and 113." the Torah is God's "garment. Sect. Sect.48 Thus it must be done with joy." 47 Torah-study. See also the notes on sect." Nonetheless. ." which also offers the benefit of reducing alien thoughts. Sect. Sect.^^ and (c)the time spent on Torah-study is certainly not inferior to the states when conscious deveikut is precluded. Sect. 33-34. relates man directly with God. 45. Sect. Sect. 111. 29. 49. 30. 117. 48. 44. Sect. 46.properly: strengthen yourself and make every effort to overcome the barriers. as when 43. 29. 50. Sect. 51. awe and love. 38.(~b)~b y virtue of proper Torah-study one will be duly attached to god lines^. 29-30.46 "God and the Torah are entirely one. therefore. one must study because (a)failure to do so leads to cessation of de~eikut. 30. 51. 53. this means that one cannot simultaneously concentrate on the ultimate goal of deveikut.60-61 and 72. 47. Sect. Sect. Sect.T~o' be sure.45 It must be pursued with all one's strength and energy.50 When studying one must concentrate on the subjectmatter. 52. 51 and 113. to understand it pr~perly. Torah-study is all-important. 54.
Sect. Sect. 121.84.43-44.5~ In this context one is not to limit the curriculum to theoretical studies of the Talmud and its commentaries.94-95. 56. 59. Sect. "for the sake of Heaven.46-47. but also include works of religious ethics that further fear of Heaven@-and to study these every day61-as well as the codes of law in order to know the proper observance of the law. 63." i. Sect. whether these be material or ~piritual.sleeping or the mind "falls. 60. Sect. 62. in the four cubits of Halachah. when studying Torah one must be aware that it is God's Torah. 54. failure to study Torah is a principal cause of all spiritual harms and defects. prayer and the other mitzvot must always be observed with the appropriate devotions.62 One must be very careful with the fulfillment of the mitzvot (religious obligations). Sect. 29. 55 and 126. 58. 1."58 Thus every so often one ought to interrupt the study to remind himself thereof and to attach himself unto G0d. Torah-study.. 11. Sect. Sect.73. 2-3. the lack of ideal intent can never be an excuse for not carrying out any of these obligation^. They must be devoid of any ulterior motives. 29. 64.116 and 127.^ There is an objec-. to serve God and to carry out His Will. 117.122-123. .101. 61. 119. 55.~3 Even so."55 Indeed.56 Even so. as it were. lishmuh (for their own sake as Divine precepts). 57. Sect. Sect.e. thus "before Whom you are learningn57 and that God Himself is "concentrated.20. 117.
Sect. 66." The underlying principle of obedience to do God's Will assures observance of all mitzvot. Ibid. 69. is a dominant theme in Tzava'at Harivash: Sadness is a repugnant character-trait.17 and 122 68. 'The need of penitence. 46. Ibid. Sect.68 and that the mitzvot be done with alacrity and Chassidism is known for its emphasis on joy and a happy frame of mind. This. 126.t~ i~s very important that not a single day pass by without performing at least one mitzvah. 72. Sect.65 thus do as many mitzvot as you can and eventually you will perform them in proper fashion. too. without distinction whether they are major or minor. Sect. 55. Sect.73 Man must be disturbed and upset by wrong-doing and defects. 1 and 17. . 1.tive validity and value in the very act of a mitzvah. for all are equally Divine precepts that must be observed caref~l lyI. 20 and 116. and its categorical rejection of sadness and melancholy. however. 71. 70. Sect. Sect. 44 and 46. must be in context 65.7O a barrier to the service of It is a typical objective of the yetzer hra who pretends to seek man's religious self-improvement by harping on one's real or imagned shortcomings and failures in order to generate a sense of worthlessness and hopelessness?z Thus one must be extremely cautious to recognize this ruse of the yetzer hra and not fall into his trap. 67. 73.
78 One must be happy at all time^. generally spealung.~2 Even so. 56.80 with prayel-8' and Torah-~tudy. 74 with care that it be without ulterior motives. 15. 110 and 128. This implies a joyful pursuit of the service of prayer and the observance of the miavot. 82. 75. 44 and 46. 76. Sea. . Sect. 56 and 78-79. Sect. 83. Sect. 43 and 77. 84. 107-108.of correcting these deficiencies and enhancing attachment to God and observance of Torah and mitzvot.'^ especially when serving God. 45 and 107.83 Love and fear of God must go hand in hand. 81. the constant joy must be tempered by an accompanying awe and fear of God. 77. Sect. Self-improvement and self-correction may even necessitate fasting and selfmortification. or when beseeching God in momentary occasions of dire distress). Sect. Sect.76 True teshuvah (return to God) and authentic worship focus on God and not oneself. Sect. 51 and 119.44-46 and 137. 80." Thus weeping is bad. fasting and self-affliction should be avoided because they cause feelings of sadness and depression. unless it is an expression of joy (or in the context of terhuvah at the appropriate times. Sect. 79. lest the one turn into carelessness and the other into depression. 78. 44-45. 110." 74.75 notwithstanding the fact that. Sect. Sect.
Sect. Sect. in context of the Divine service.INTRODUCTION Religious Ethics in Daily Life Senrice of God is not limited to rituals like Torah. i. 100. Your proper use of these items. It is only a means toward an end.. for illness of the body weakens the One must eat. 91. Sect. 80. becomes a direct cause of spiritual gain and achie~ement?~ One must be careful. redeems and elevates these sparks.% The materiality of the body is an obstructing barrier to the soul87 and its mundane desires must be disregarded and despised. Indeed.@ Thus "know and acknowledge God in all your ways. Sect. not to be drawn after the mundane. 86. however. 3. 88. 106. to be strengthened for the Divine servi~e. Thus do not eat or drink excessively. 88 At the same time.~ Moreover. the soul cannot function on earth without the body. 89. Thus one must safeguard physical health.127 and 141. God is to be served in all possible ways. The fact that physical objects come your way is a Providential indication that their sparks relate to your soul. 90. thus actualizing the intended purpose of the items?' Thus matter itself is sublimated to holiness. though. Sect. all physical entities contain holy sparks which are the very vitality sustaining them. matter and physical reality. . 6 and 9." even in your mundane engagements. in all involvements with the physical reality of man. Sect. drink and sleep to maintain health. mitzvot and prayer. Sect. and not an end in itself.e. but only to the ex85. Sect. 31. 87. 5 and 22. chomer. 92. 94.109.
10E~q uanimity and spiritual growth require selfnegation. on the spiritual reality.% Likewise. knowledge and foretho~ght.84 and 127. 5. 84. 5 and 121. and for pride or other evil character-traits to arise. 101.93 Indulgence leads to spiritual downfall. 121 and 131. Sect.99 In this scheme there is no room for sanctimonious selfsatisfa~ tion. all personal transactions must be conducted with da'at. They are like momentary departures from your true home with the mind set on returning as soon as possible?' The ideal attitude is one of equanimity: total indifference to personal delight or pleasure. Sect. Sect. 2. Sect. Sect. gener93. 1o1 Sincere humility. Sect. implicit belief in Divine providence. 97. self-deprecation. 99. 52. Sect. Sect. and total submission to God. 102. 53. Sect. 96. Sect. . 103. 95. 100. the root of all evil.98 This is achieved by constant attachment to God. and to other peoples' praise or blame. 101. and see also sea. Sect. 10. 12 and 77. 98. 98. but only as temporary digressions.% Man's thought must always be focused on God. 114. 2 and 10.lo3 Self-esteem and arrogance is a most serious offense.~E5v en the intent viewing of the mundane desensitizes and brings crudity upon oneself.IM When preoccupied with the service of God there is simply no time to think of self. Involvements with the mundane may be neccessary. is the very sign of the true servant of God. 49. 6.tent of maintaining your health. 94.
Sect." but that rendition is too restrictive.lm In Tzava'at Harivash. 106. Their intrusion is especially disturbing when it occurs during prayer or other religious practices.'" This applies especially to the self-satisfaction from spiritual activities and assumed achievements. 105. corresponding to the Divine attributes known by their Kabbalistic term as the Sefirot: 1) love of something. marked by attraction. thus we used the literal meaning throughout. and separates man from God. The concept of machshavah zara is a frequent theme in Tzava'at Harivash. marked by repulsion. as well as in other early Chassidic works. whether it be sinful per se or not. For others. we find another approach: Man's feelings or emotive traits consist of seven categories.124 and 131. diversion of attention that would result in the immediate dismissal of the inappropriate thoughts. and also manifesting itself in terms of hndness. however. The literal meaning of this term is "alien thought.122. 62. does require further elaboration: Sublimation of Alien Thoughts and Yeridah Tzorech Aliyah A." One more subject. and also manifesting 104. . 74. notes 127-128. 2) fear of something. lustful or sinful thought. Sect.lo5 These are some of the central themes in this work. the reader is directed to the index.ates alien thoughts. See below. however. It includes any thought or feeling that is inappropriate to the occasion. especially for the extensive treatments of "thought" and "speech." It is often translated as "evil. 92 and 97. If this should happen. Man is often beset by such thoughts or feelings. the general advice is hessech huda'at.
dependent on the others. the source of all beauty on high. 3 )recognition of an inherent quality of status. has a good side and a bad side. manifesting itself in praise or admiration. 4) the trait to endure. prevail or conquer. Ibid. and a pale reflection of. and there is the fall to "bad love" (illicit love.)lo7 These seven traits are analogous to the Sefirot because the). of the Divine attributes. Sublimation would then mean to trace the bad thought to its good source and transform it into a good thought. rather than active. Its category. such as beauty or some achievement. and so forth. 5) the trait of acknowledgment. would one pursue the mere reflection when he can have the allinclusive source? The inappropriate love of. however. (The seventh difyers from the others in that it is more passive. and attraction to107. on the other hand. are altogether holy and good. and there is the fall to "bad admiration" as in pride and self-esteem. worldly counter-parts. 108. The human traits. or hatred). and 7) the trait of governance in the sense of applying the other traits.lm The concept of the "sublimation of alien thoughts or feelings" is based on this contrariety. in Divinity. For ultimately all things are rooted in the Divine. are a reflection. Sect. and rooted therein. are like man himselE they can be holy and good or manifest themselves as the very opposite. . mundane beauty is rooted in. Thus there is a "good love" and a "good fear. then. The Sefirot. however. 6) the trait of bonding. of establishing a relationship. There is the "good admiration" of the holy and sublime. or of a restraining splendor. or love of sins) and to "bad fear" (inappropriate fear. The alien thought is bad. as it were. Why." relating to that which ought to be loved or feared.itself in terms of severity or strictness. For example. 89.
too. Sect.90 and 124.in an ascent to a level transcending one's original status. by rejecting them. and in the process elevate man himself as well: there was a momentary descent to the depth of the alien thoug-h t. Sect. a'e&hmn.It0 This concept has nothing to do with the Sabbatean heresy of engaging in forbidden activities to "elevate" the forbidden and impure. The rejection of evil releases the sparks. the evil and forbidden. thus is to be traced to the ultimate source of love and attraction in holiness and transformed into a love and pursuit of the holy.87.p . both attributed to the Baal Shem Tov: Ben Porat Yorsef. Those sparks. [A proper understanding of the Chassidic concept of sublimating "alien thoughts and feeling" requires consideration of two crucial explanations. thus deprives evil of its source of vitality. Va'ayechi. Sect. Sect. infuses them with greater vitality. On the contrary: any prohibited contact with.e. and that is how evil is subdued and removed. The same applies to all other categories of thought and feeling.90. something mundane. or use of. p.22. something that is transient and illusory."' All the best intentions in using them in ways that violate Torahlaw will not consecrate or elevate them. can be released and redeemed only by relating to those objects as prescribed by the Torah. 85b). contain holy sparks that enable them to exist. It requires Divine assis109. . 64. 9. and Me'or E i ~ y i mV. i.jw That is how the alien thoughts are elevated and sublimated to become holy. 120 and 127. There is a real danger that engaging in sublimation may be counter-productive and lead astray..101-b. but they do so with the warning that it is hazardous. 85a (and see there also p. forbidden objects. 112. culminating. thus empowers and enhances the forces of evil and imp~rity. however. 14.INTRODUCTION ward. 62b-c. 110. 87.'~~ Chassidic works present the principle of sublimating alien thoughts.] 111. To be sure. or engagement in illicit activities.
"subduingn with total divestment of self or any personal attachment. These initial steps are earmarked by a profound sense of dread. and the wise will be silent!" R. All others must put their efforts into praying more intensely.e. 29c). Toldor Ya'akov Yorrpf. Addenda. sect. After explaining the principle of sublimating evil and alien thoughts in context of Divine Providence. 160. and see the re also par. 118. 115. 629a). 13. 163 and 302.tance as a safeguard. the "sweetening" of the forbidden thoughts (i. and havdalah. suggesting that this is an esoteric teaching that is not meant for the average person lest it be abused. see there. Ben Poraf Yossef. that the person is overcome by a gripping fear of God. The Baal Shem Tov states that the sublimation of alien or extraneous thoughts requires huchna'ah. Cf: Shabbat 153b. 228. sect. one praying with hitlahavut. huvdalah and hamtakah. Sect. 15 and 16 (p. 87. a separation from any linkwith the realm of evil. Eikev: I (p. who recorded these teachings of his master. Toldot Ya'akov Yossef.. he notes: "Sometimes. In oneU6 he adds the verse "It is the glory of God to conceal the matter" (Proverbs 25:2). 729b-d). 28. 277.l15 In at least two other instances we find that the Baal Shem Tov adds cautionary qualifications to this principle.. All this is cited in k2fer Shem Tov.114 These qualifications are reiterated more emphatically in other texts. end of Lech Lech (p. is to engage in sublimation. how113. Sect. 140. Note also Maggid Devarav Leya'akov. Eikev: I11 (p. 632a).e. Toldot Ya'akov Yosef. Harntakah. 116. t17. 731b). i.117 In the other118 he adds the conclusion: "To dwell on this at length involves danger. their complete separation from the kelipot. Yaakov Yossef of Polnoy.1'3 Only the enthused person. can follow only after an initial huchna'ah. sect. their sublimation to holiness). 25 (p. the Baal Shem Tov. par. . and Or Torah. 114. is more explicit.
then see to bring it near and sublimate it. Magid Devarav Leya'akov. You may ask. for 'if one comes to slay you. love."li9 R. but in truth he is removed. 50c. relates only to a tzadik who is to elevate them to their spiritual source.' (Song 2:7. If the means to correct and elevate the alien thought will arise in your mind immediately as it comes to you. 98. One must never introduce them on his own: "If one will say. cited in Ke&r Shem Tov. they entered the mind beyond the person's control. 'how will I know which thought must be repelled. sect. too. sect. and Or Torah. or b)they are rooted in the cosmic "breaking of the vessels. sect.ever. relates the principle of sublimation to the premise of Divine Providence. cited (partially) in Keter Shem Tov. 213." 119. sect. the Mamd of Mezhirech and successor of the Baal Shem Tov. Ben Porat Yon4 Toldol. 207. p. however. . He thinks that he is close. which now offer an opportunity to be corrected. the means to correct it will not arise immediately in the mind. 120. It is then permissible to repel that thought. 'I shall intentionally meditate to bring about [an alien thought ofj love so that [I may] elevate it. [this] thought must be repelled. sect. he is distanced from God. also in Likkutim Yekarim. If.' of him it is said 'That you awaken not. In one lengthy discussion1z0h e traces the occurrence of alien thoughts to one of two sources: a)they may be a reflection of the person's evil deeds in the past." independent of the individual. however. of blessed memory said of this that 'he who wilfully excites himself shall be under the ban' (Nidah 13b). and which is to be brought near and elevated?' [The answer is:] Man must consider [the following]. In either case. 115 (which has significant variants). 39. however. until it please. that is. it may be assumed that [the alien thought] came about to disturb man in his prayer and to confuse his thought. 3:5) Our sages. forestall [by slaying him]' (Sanhedrin 72a). The latter. Dov Ber. nor stir up.
lit. as in the case of an alien thought in the midst of prayer. 231. and Maimonides. continuously ascending from level to level with deveikut and hitlahuvut to the point of their thoughts being attached to a level that transcends all worldly matters. however. sect. par. 277. analogous to Elijah on Mount Carmel: he brought offerings there in spite of the prohibition of sacrificing on bamot (altars outside the Holy Temple in Jerusalem). . Cf Maaid Devarav Leya'akou.This distinction appears again in the Maggid's interpretation of "Ikvotecha (Your footsteps. see Rashi there)." i. Hikhot Yessodei Hatorah 9:3.122 The Maggid identifies those to whom the principle applies. as opposed to all others. It is crucial. They merit Divine assistance In purifying even their physical and material aspects. They are pious people immersed in Torah-study. sect. 122. Sometimes.. You 121. This. they are without intent. Or Torah. 'That is the meaning of "ikvotecha were not known. 175. and attached to. This means that in the case of sublimation there was a time when that thing had to be elevated. 228. sect. and Or Torah. however. Alien thoughts occur to them in their prayers or studies (when they are immersed in. Yeuamot 90b. See Sije.e. though. these can ascend. l21 because he had to elevate the whole generation that worshipped idolatry. 'the mark of your heels') were not known" (Psalms 77:20): eikev (heel) refers to the lowest levels. The term sha'ah is an expression of "let them not pay attention to false words" (Exodus 5:9. Of these people he says: 'You are not like the other people whose alien thoughts come to them from their own thought that is not purified from physical matters. that one do not think the alien thought intentionally. Shoflim. is an aspect of hora'at sha'ah (a temporary decision or dispensation). holiness) in order that they may be sublimated to that holiness.
then it is most certain that he knows 123. Surely you understand this on your own. sect. when you are beset by an alien thought you can elevate it to h0liness. cited (partially) in Ket er Shem Tov. and 94dJ)."'2~ The Maggid's disciples spell out these warnings in most explicit terms. 28 (p. ch. and Lo Ta'aseh 41. 124. Vqigash.. Menachem Mendel of Vitebsk. Meshulam Feivish of Zborez writes: "This should be your rule. .who walk in my statutes. R. to whom [an alien thought] occurs of his own making. 207.3:4-5. 13b-c. ed. R. as is well known. Dov Ber. 6-8. Tzvi Elimelech of Dinov cites this passage repea tedly in his Derech Pikudecha (Hakdamah VII. base self-glorification. For if one is attached to materialism and desires.. and there are but few who can compare themselves to him and act as he did.e.3:5. Pen' Ha'aretr. sect. They see there that he writes in a number of places. for those things were meant only for tzadikim to whom alien thoughts do not occur of their own making but those of others. and willingly derives pleasure from them. and likewise with evil fear. 118.. par. This derivation can be applied only by one who is stripped of materialism. he is not to take notice of them but immediately avert his mind from them. Tanya. have become disclosed to various people. Likkutim Yekarim. Or 'Torah. But he. Lo Ta'aseh 35. in [the study ofj Torah or in devout prayer. of blessed memory. from the aspect of evil in his heart . Lemberg 1921. R.. 123. sect. how can he elevate it when he himself is bound [there]. See also R. but the writings of that holy man. i.. Schneur Zalman of Liadi writes: "If there occur to [man] lustful imaginings or other alien thoughts at the time of worship. 86c. sense of triumph etc. down below! "124 R. 35a). pp. He should not be a fool and engage in the elevation of the traits of the alien thought. even minutely. that from the evil love that occurs in man he can attach himself to the love of the Creator.
nothing of the love of the Creator."'~~ 125.. and will thereby be bestirred to a greater love of the Creator and fear of Him. 126. He must push off and lull [that thought].. nor of the fear and glorification of [God] etc. 128. of blessed memory. then evil thoughts will never occur to him. never to blemish by speech or act . note 120). imaginings will occur to him on account of his own evil: they are altogether evil and will not be corrected.. But he who is not guarded in his spirit and soul. . and ch.. he is counseled to extract the precious from the vile .d. David Shelomoh Eibeshitzlz6q uotes at length this principle as taught by the Baal Shem Tov and reconciles it with the seemingly contradictory ruling of Maimonides127 and the Shulchan Aruch'28 which ordains immediate dismissal of evil thoughts and directing the mind to words of Torah: "Both are true. as stated by the Baal Shem Tov. Man must examine himself. Heaven forbid.. ch. he will fall into a deep pit if he will not watch himself very much.. . Heaven forbid for him to dwell on these thoughts even for a moment... on Genesis 21:l-2 (ed. i. Wolf of Tsherni-Ostrow (a leading disciple of the Maggid) and R. n.. 18. If he guards himself very carefully not to blemish the aspects within his control. sect. The thought that will yet come to him [in spite of himself] occurs for the sake of correction. and author of Levushei Serad (a prominent commentary on Shulchn Aruch) and the classic Ami Nachal. Only he who is divested of materialism and none the less it happens occasionally that an evil love or an evil fear awakens in his heart . See there also the sequel (based on the sources cited above. 240.. with his words and deeds. i. 39c). Hilchot Issurei Bi'ah 21:19.. Yosher Divrei Emet. Meshulam Feivish of Zborez. Warsaw. 17 (p. 118b). 127. 129."125 R. Arvei Nachal.. cited (partially) in Keter Shem Tov. thus it is not to be repelled.e. Vayeira. as stated by Maimonides and the Shulchan Ar~ch.e. p. Disciple of R. Even Ha'ezer 23:3.
Ma& Devarav Leya'akov.. however. So. sect. He should not be afraid [that this means] that he is removed from [God]. Zohar I:237b 132. however. Maggid Devarav Leya'akov. sect. deveikut in general and his status in particular. 'For a tzadik falls seven times and rises up again' (Proverbs 24:16): his very fall is but for the 'rising. which is called a descent. the tzadik falls only for the sake of ascending. 10 and 235.' (ibid.' as it is written. thus lowering themselves from their level in order that they may ascend. into the depths [of the sea]. .' the waves of the sea: 'those who go down to the sea' (Psalms 107:23). for God is present even in those deeds. 248.). and inconsistent wlth. be130.' i. that [as he re-ascends] he will raise additional sparks along with himself. He appears to engage in idle talk and inconsequential actions like the average person: "The tzadik will sometimes fall from his level. this principle is cited in the more delicate context of the tzadik's "fall" to levels.." This concept relates to the principle of sublimating alien thoughts: "'Many waters cannot extinguish the love. 131. but this descent is for the sake of an ascent. situations or behavior that seems removed from. sect.B. The selfsame distinction applies also to the concept of "Yeridah Tzorech Aliyah--descent for the sake of an ascent. 336. is not a real 'fall."13? "The tzadik. Or Torah. This. who is in a continuous state of deveikut. This is the meaning of 'he crouched and lay down like a lion' (Numbers 24:9)."l30 More often. they have seen the deeds of God.' (Song 8:7) Alien thoughts are referred to as 'many waters. and cf: there als o sect. too. to raise sparks along with himself. 'they do [their] work in many waters. 177.e. sometimes experiences a cessation of the deveikut. . as it is said'"' that a lion goes down (crouches) only to seize prey [that he smells from afar].
) that this relates to various levels and aspects. 113. but is afraid that he will be unable to ascend from the pit. 64 and 96. so that matter is transformed into form. and when he went to the land of the Philistines. See sect. Toldol Ya'akov Yost$ Vayeira:I (p. as Nachmanides comments (ad loc. prior to de . sect. The descent is for the sake of an ascent."l36 133. from now on I can enter [the pit]. cited (in amended wording) in Keter Shem Tov. 427. lest he remain there. What did he do? He tied a rope above the p~ts.' So. 59a-b). as the Baal Shem Tov said that there are many who remained [below]. 90 and 396. and Or Torah. 134. "135 There is a clear emphasis in practically all references to this principle that it applies only to the tzadik. 'As I made this bond. This is the meaning of 'That man do [the mitzvot] and live by them' (Leviticus 18:5).a ying. thus found it necessary to voice caution and qualifications: "The ultimate intent in man being created with matter and form is to refine the matter. he [first] attached himself to the faith. illust rating the point with a parable that appears in Zohar 1:112b: "When Abraham descended to Egypt. with Abraham: when he wanted to go down to Egypt. The Baal Shem Tov and the Maggid were fully conscious of these. 488. however. too. One aspect is that after ascending on high one descends again in order to elevate the lower levels. sect. Every descent. the spiritually accomplished person who is firmly fastened to Above to assure that he will ascend again after the "fall. Heaven forbid. sect. 136.cause this may possibly happen to him in order to attain a level that is yet higher and excelling. Note carefully Likkutim Yekarim. the being distanced is for the sake of coming This concept appears in our text as It should be quite obvious that it is filled with serious implications. Or Torah. 135. [This is comparable] to a person who wants to descend into a deep pit. sect. requires caution to re-ascend.
137. One is not to be.. and if he were to do so he will fall and not rise. blessed be His Name. I [God HimselfJ.Moreover. cited above (re note 133). of Shemot." or "sometimes falls. Mechilfa on Exodus 12:12 and 12:29. it is not an intentional fall or descent. I. and not a seraph. and Degel Machaneh Ephrayim. and not an angel. "138: Egypt was a place of impurity to the scending there.e. but just happens by Divine Providence. like those licentious ones who say that man must make himself descend to the lowest level and then ascend from there. A number of people left the faith on account of such!"' "It follows that man must be continuously attached unto [God].e. Heaven forbid. In other words..)i. cited in the Haggadah for Pesach. But it is beyond human ability." indicates passivity..' (ibid. the consistent expression of "when he falls.. . i. "These matters are too lengthy to be explained. with reference to "'I shall go through Egypt' (Exodus 12:12)-i. Thus it is explained in the Zohar (I:117a). The very same qualifications relating to the sublimation of alien thoughts apply equally to the general principle of yeridah tzorech aliyah.' exclusively for the sake of God without any ulterior motives). and then he descended there. This must not happen [among the people of] Israel. 'and I will smite . yeridah tzorech aliyah.e. 138. Cf: the Baal Shem Togs warning. he must quickly restore himself to the higher level. If he should fall from his level.." Cf: also the similar passage in Zohar I:81b. he first tied the bond of the faith to be strengthened by it. Heaven forbid. The Maggid spells this out in sharp and unequivocal terms: "In all matters one is to serve God continuously [in a mode of] avodat gevohah ('for the sake of Above. cited and explained in our context in Tddot Ya'akov Yo& NassolXVII. as in the case of alien thoughts that are to be elevated. beg.
and nothing can interpose before Him. 202. i. Their criticisms against Chassidic teachings refer specifically to Tzava'at Harivash and they had public burnings of the book140 Two reasons may account for singling out this work: 1) Tzava'at Harivash is a very small book It may even be called a pamphlet. p. 'and you shall not be below' (ibid. because most of its teachings appeared already in those earlier books. and the brevity of its individual teachings. I. pp. Thus one cannot ascribe to it special significance. on the lower level. but was printed later than the works of the Mawd and R.e. The light of the Holy One.252.. [9]). 140. Nonetheless. The first editions consisted of 48 small pages (including the title-page). Likkutei Amarim-MS. the smallness of the book as a whole. 182. i. penetrates everything. to serve God on the level of 'above' (the high level). on the level of 'below7i. Ya'akov Yossef of Polnoy. Moreover. however. as stated Tzava'at Harivash is one of the early publications of Chassidism.. however.). This. Likkutei Amarim-Vitebsk.e. vol. Heaven forbid.e. allowing for wide distribution. approximately 3 by 5 inches. "Thus You shall be only above' (Deuteronomy 28:23). blessed is He. Jerusalem 1970. 25bE.. is not in the power of man. . p. Chidim UMitnugdim (a study of the controversy between them in the years 1772-1815). Wilensky. make it a very read139.267 and 289.point that that if an angel had gone there he would have [become and] remained defiled. 201. it became a primary target in the attacks by the opponents to Chassidism. of R. See M. Thus it must have been quite inexpensive. Shmelka of Nikolsburg L14 (facsimile of this passage appears in Torat Hamaggid Mimezhirech.
38. See also Shever Poshim. Petersburg (see below. 143. p. 306. 2) Tzava'at Harivash is a specialized anthology of Chassidic teachings. note 161) and published in Kerem Chabad El.'" More specifically. 44-46 furthers illicit frivolity. See the bibliographical list appended to my Hebrew edition of Tzava'at Harivash. sect. p. that it gained great popularity: there were at least seven editions between 1792 and 1797!141 This must surely have concerned the Mitnagdim (adversaries to Chassidism) and aroused their ire. 145. then. 142. and 4 ZernirAritzim Vechorbot Tzurim. Thus it became the logical choice to be a prime target for those who opposed Chassidism. Sefer Viku'ach. Chassidim Umitnagdim. Kfar Chabad 1992 (henceforward abbreviated as KC). Our text can then be seen as an easily identifiable manifesto of Chassidism.able text for friend and foe alike. the founders and leaders of the Chassidic movement and Chassidic philosophy. p. and from the documents recently discovered in the archives of the prosecutor-general in S. pp. p. Israel Baal Shem is . "instructions and rules of proper conduct. Little wonder. 300 and 307f: 144. Zemir Aritzim. Depositions of Avigdor Chaimovitch (henceforward: Avigdor). 135. Ibid. 212. It addresses the masses no less than the scholars. 45 (as well as 141.. It is a manual for the religious life and observance of the chassid. 212: "In the books of R.~~~ (b) The segment of sect. p. The adversaries' accusations against the teachings in Tzava'at Harivash are as follows:142 (a) Sect. 41 is a denigration of Torah and Torah-st~dy. 2498 Note also Zrmir Aritzim. It consists of pericopes that present explicit guidance. Wilensky. p. unlike the earlier texts that were much bulkier and much more intricate. 44 errs in dismissing depression and in calling thoughts leading to depression sect." taught by the Baal Shem Tov and the Maggid. The synopsis following is culled from the writings of the adversaries that were published in M.
Ibid. 108: to say that in prayer one becomes unified with God is unfounded "worthless illusion^. 38. p. aside of the fact that erotic metaphors are common to all Kabbalistic writings. 87: i. 312. 154. p. 298 and 312. in stating that one is to love and fear God alone.15' (g) Sect. iii. 273. Sefer Viku'ach. To say that one need not fear anything but God is absurd and contradicts Scripture. 96).'49 (e) Sect. Avigdor. 74 is a denigration of Torah-study and the normative religious lifestyle. 214. p. 82. 147. pp.sect. 1601: 150. in relating the Divine glory to creatures. suggests anti-nomianism. p. p. pp. 153. some of the very same terms that the adversaries objected to are used by the Gaon of V11na in his commentaries on the Zohar! See KC. To say that everything happening to man is by Divine Providence is to justify all wrongdoing and to exempt all wrong-doers from punishment. It is noteworthy that. 127 errs i. if that had been the sole content of his books. 83.'54 (j) Sect."'^^ (h) Sect. and in KC. 310f: 151. Shewr Poshim.146a nd sect. 107) errs in dismissing weeping in prayer. to identify speech written that it is forbidden to bring depression upon oneself. p.. To say that a Divine life-force is vested in all beings. Sefer Viku'ach. ZemirArittim Vechorbot Tzurim. Zemir Arifzim. 120 is blasphemous for stating that the Shechinah is vested in all human beings. p. ZemirAritzim. and in KC." 146.. Cf. and in KC. 306 and 309. 68 is crude imagery leading to licentiousness. 46 suggests anti-nomiani~m. p.153 (i) Sect. pp. 10Y and 108. Sefw Viku'ach. dealing with yeridah tzorech aliyah. Ibid. In truth. in stating that there is a Divine emanation in all beings. and iv. 249f. 149. [they] would already deserve to be cast unto fire to be condemned to burning. ii. 83. p. p. 248f. 152. Sefer Viku'ach. iii. p. . 64 (as well as sect.(~c)~ S~e ct. pp. is blasphemy. 248 and 274. and in KC.'" (d) Sect. including animals. and 273. 148. ii. 306. pp. Avigdor.19 (f) Sect. 83. 109 furthers licentiousness and anti-nomianism by suggesting the indulgence of all desires. p.
pp. This statement thus proves that "they are of the cult of Shabbatai Tzvi. 246J and 274.with the vital force of God inherent in man is a blasphemous attribution of man's lies and evil speech to God." iii. 83. p. 14%. p. p." KC." because it assumes that the Messiah has come already.I57 though without a specific reference. Avigdor. ii. 137: i. 82. Schneur Zalman for his response.. and in KC. there is an implicit attack on the concept of sublimation of alien thoughts. Eight of the references cited above appear in the slanderous accusations before the Czarist regime by Avigdor Chaimovitch of Pinsk against R. Mundshein. "Kinat HaMitnagdim Leminhagei Ashkenaz. 157. To say that one must always be "merry and joyous" is wrong. Thus "one cannot establish this lund of trust in God. Ibid. and the second one was to be given by them to R.U. There are notable differences between the two: Avigdor is much more careful with the 155. 143 explains a notable difference between that text and the Ashkenazy one.I55 (k) Sect. 244f and 246. p. because rejoicing is restricted to the celebration of the festivals in the Holy Temple. 158. p. See also Y. S. and in KC. 308.158 The over-all criticism by the Mitnagdim of the Chassidic adoption of the Lurianic-Sefardi liturgyt59 also touches upon Tzaoa'at Harivash. Avigdor submitted two depositions: the first was addressed to the authorities. Shewr Poshim. for sect. To believe that "the kindness of God dwells upon man and embraces him" contradicts Scripture which relates that Jacob was afraid in spite of the Divine promise to be with him everywhere (Genesis 28:15). See above. 151ff . pp. Sefer Viku'ach. To say that "man sees God and God sees man" is a blasphemous ascription of corporeality to Not surprisingly. 156. 159. Schneur Zalman of Liadi. Sublimation of Alien Thouglits. and is not allowed even in prayer.
implicitly answers also most of the criticisms against sect. sect.I6O R.criticisms in the second deposition. analyzing the relevant principles in great detail. Even so.'~~ 160. This is a common feature in many of the early writings of the Mitnagdim. p. vol. 87 in the court-~ase. Schneur Zalman exposes these distortions. p. 161. p. and brought about his acquittal and liberation from imprisonment. R. there is a consistent thread of misquotation and distortion running through both. p. vol. Mundshein. Schneur Zalman's submissions appear now also in Igrot Kodesh-Admur Hazaken. 25 (pp. 39-62 and 140. vol. except for the first two charges. 120 was again submitted to R. Tanya. 273J). Schneur Zalman's responses only the last two were known and published (ibid. They include also Avigdor's original Hebrew deposition (the second one). 158J Sefer Viku'ach is a notable exception to this. Schneur Zalma n's letter to the Chassidim in Vilna. Of R. and a Russian translation of all. and offers clear and convincing explanations which vindicated Tzava'at Harivash and the Chassidic philosophy. Igeret Hakodesh.. Recent research discovered the files of this case in the archives of the prosecutor-general in Petersburg. 11. omitting many of his alleged refutations. He must have realized that they were blatantly absurd. Igmt KodeshAdmur Hazaken. Schneur Zalman. pp. Schneur Zalman and signed by him. 138a-142a). All but the first two were known and published (Wilensky. All this has now been published in Kerem Chabad IV:I. in Hebrew translation where necessary. I. 200). written in 1797. 88 (also in Wilensky.161 The criticism of sect.. thus easily dismissed. see Y. These include these last two answers in the original Hebrew handwriting of R. as well as the Russian translation of all his answers. I. . including photostats of the originals. Avigdor's second deposition has 19 accusations against Chassidism and R." ibid. vol. His elaborate response. Schneur Zalman in a private (and apparently friendly and respectful) communication from Mitnagdim. 162. Cf: also R. p. "SilufDivrei Chassidur. 87 and 127. 277). I . It overlaps in many respects with his lengthy response on sect.
TZAVA'AT HARIVASH THE T E S T ~ N T OF RABBI ISRAEL BAAL SHEM Tov .
whether it be a "minor" or "major" mitzvah."2 It is essential not to forget the matters [of Torah and Mitzvot] . Do not allow a single day to pass without performing a mitzvah. On the importance of studying musrar. lb)." He did not leave a "last will* in writing or in words. 2. The wording is reminiscent of the Biblical phrase "[But take heed and watch yourself greatly lest] you forget the matters [that your eyes saw. see also below. a light or illumina tion of its own that is effected by the performance of a mitzvah. and perhaps alludes to it.e.. no. blessed be He." i. 3. It does not appear at all in Kekr Shem Tov (p. reading: "It is essential not to forget to study musrar every day. R. 117." Our rendition. and so forth. To perform many mifzvot on one day cannot make up for the lost opportunity . Bachya Ibn Pakuda's Chovot Hakvovot. sect. peace be upon him Be complete in the worship [of God]. Eliahu de Vidas' Reishit Chochmah. The sentence is not very clear. 4. . 2. This is not the Baal Shem Tov's testament in the sense of "last will. Israel Baal Shem. whether much or little. and no less so the pervasive musrar found in the Zohar.5 This is 1. with the bracketed words. The emphasis is on daily acts. follows the interpretation in Be'urim Befzaua'at Hariuash. R.' It is essential to study mussa14 every day. Avodah tamah is a Talmudic expression (Yoma 24a) denoting a form of service that is complete in itself without any further action required for its completion. Strive continuously to cleave to good traits and upright practices.. This would refer to texts like R.1 Testament1 ofR. Tzava'ah here means "instruction . Works of moral guidance and inspiration. Every single day is an important entity on its own. [that it be] a "complete service. Thus it requires something concrete to show for itself. 198) it is combined with the next sentence. In Likkutim Yekarim (no.. 5. instructions and guidelines taught by the Baal Shem Tov for the ideal religious conduct. lsaiah Horowitz's Shemi Lurhot Habent. .]" (Deuteronomy 4:9-lo).
CJ below. 6." (Likkutim Yekarim. Sanhedrin 106b). 2. that man's heart should seek the Merciful . ch.indicated in "Be zahir (careful." See also below. SJm'ar Yichrd Hama'aseh. Bachya ibn Pakuda (Chovot Halevovot. Whatever may happen. For [with this perspective] the yetzer hara is entirely removed from you. and if it is proper in His eyes. 2-3 "Shiviti-I have set God before me at all times. equal.. too.. sect. and so. sect. Our proof-text . the belief that every detail is controlled by Divine Providence. 91. Cy Zohar 1:129a and 224a on thc significance of each indjvidual day. it. for "The Merciful seeks the heart" (Zohar II:162b. The notion of equanimity i s a fundamental principle in the pursuit of authentic religiosity and piety.6 of another day. see there. it is all the same to you. R. say that "it comes from [God]. whether people praise or shame you." (Daniel 12:3). sect. no. 84. 6. This applies likewise to any food: it is all the same to you whether you eat delicacies or other things."2 Your motives 1. with anything else. "The Merciful seeks the heart. . 93 and 127. . 122. 10. blessed be He. Shiviti is related to the root-word shaveh. Equanimity follows logically from a profound sense of hashgachah peratit. 17[a]. 106) To the seeker of God there is no difference between "majorn and "minor" mitzvot: both are commands of God and effect refinement and illumination of the soul." (Psalms 16: 8) Shiviti is an expression of hishtavut (equanimity):' no matter what happens. 5) calls it the "ultimate of the most precious levels among the rungs of the pious. This implies that the soul will shine and glow from a "minor" mitzvah even as it does from a "major" one. Note: this paragraph has an explanatory sequel below. For [the word] zahir is an expression of "They that are wlse yaz'hiru (shall shine). scrupulous) with a 'minor' mitzvah as with a 'major' one" (Auot 2:l). .
Do not be disturbed by this. 4.. and your thoughts shall be established. sometimes in one manner and sometimes in another. sect.94 and 123. . 22. The realization of hhgachahperatit.e. note 2. Nonetheless. and as for yourself nothing makes any difference. for the realization of the ultimate perfection of the spiritual reality underlying physical reality: "God has made everything for His own purpose. in order that you serve Him in that alternate way. i. An important rule: "Commit your deeds to God." (Proverbs 16:4) Cf: below. This means the following: Sometimes one may walk and talk to others and is then unable to study [Torah]. This [sense of equanimity] is a very high level. thus reads: "Shiviti--everything is equal to me [because I realize that] God is before me at all times. because everything is "required [for Above].e. blessed be He. you must realize that whatever happens is from [God]. See below.4 So also when on the road."' God wishes to be served in all possible ways..are altogether for the sake of Heaven. serve God with all your might. i. For God wishes to be served in all possible ways. 2.' 1. Yichdim (unifications) is the Kabbalistic concept of effecting harmony in the totality of creation by "connecting" (unifjring) things to their spiritual roots.75." See below. see above. 3. thus unable to pray and study as usual. sect. lit. "for the need of Above. That is why it happened that you had to go on a journey or talk to people." (Proverbs 16:3) That is. sect. 11 and 73. sect. Tzorechgewha. Also." This is the mystical term indicat ing that everything in creation is to be for the Divine intent. 4. you must serve [God] in other ways. you must attach yourself to God and effect yichudim (unifications).
Our sages. thus said that "sight leads to remembering and to desire. Think that you belong to the Supernal World and all the people dwelling in this world should not be important to you. of blessed memory. In turn. to gaze at the tzitzit (ritual fringes on certain garments.See to it that you request from God always to visit upon you that which God knows to be for your benefit. sect. 'lh view something good or holy has positive effects.. Hikht De'of 3:2 and ch. therefore." (Commentary of Rashi on Numbers 1539) See also below. 69). lead to wrongful actions in their pursuit: "The eyes see and the heart covets. the slght of it made it desirable.2 For it is quite possible that what IS good in your own eyes is really bad for you. 84 5-6 Attach your thought to Above. sect. 4. For example. and the body commits the sin. Cf: below.' Do not eat or drink excess~ vely. 1. positively or negatively. 2. 8 and 24.. and $ sect. as opposed to the mundane. 3. Thus commlt unto God everything. but only to the extent of maintaining your health? Never look intently at mundane matters. . nor pay any attention to them. sect. will be attached to spirituality (see below. as opposed to that which appears to be so to the human mind. as it is written "you will see it and remember all the commandments of God and do themn (ibid."' and ~t is written of the Tree of Knowledge that it is "desirable to the sight and good for eat~ng"(G enesis 2:9). a11 your concerns and needs. i. verse 39). so that you may be separated from the physical. See Maimonides. the focus of your thought should always be on the supernal spirituality . to gaze at the physical and mundane will arouse desires related to it and. and below. I. Thus you yourself. Intent viewing of the mundane brings crudity upon oneself. sect. 50 and 90. too. sect.e. 121.e. Man is affected by what he sees. 2. ordained in Numbers 15:38#) will lead to observance of mifzvot. 2. Cf: above.
that the body is evil per 5e. (Shechinah is always referred to in feminine gender. 5-6. sect. Thus it is not equivalent to the serpent but only to the "slun of the serpent.. The phrase is from Tikunei Zohar 21:48b. As man attaches himself to God through mitzvot and communion. its external aspect. because he is broken-hearted." i. . The physical body seeks physical pleasure that defiles and leads astray. it takes precedence to all prayers of the world.e. when praying. Say constantly in your mind: "When will I merit that the light of the Shechinah abide with me?"3 1.. allowing man's freedom of choice to do good or evil (see ibid. It is the outer garment to the soul. and will be recei ved favorably before the Holy King. and it is written. "Which is the most excellent of all [prayers]? It is the prayer of the poor. his prayer ascends. a person should make himself poor. As such it is an a dmixture of good and evil. 'God is near to the broken-hearted' (Psalms 34:19). for their love or hatred means nothing... Be indifferent to others loving you or hating you. allowing the soul to function in this world with the performance of mitzvot. When a person. the Divine "spark" and lifeforce (vitality) in all creatures.. do not pay any attention to the desires of your filthy body which is a "leprous thing from the shn of the snake.-The term Shechinuh signifies the Divine immanen ce and presence throughout the world. will always make his will as that of a pauper. 67:98a) The Zohar (III:195a) states that one's will is to be like that of a pauper. Thus. Likewise. note 1.For the whole of this world is but like a granule in relation to the Supernal World."4 4." 2. the light of the Shechinah becomes ever more manifest to him. even as the original serpent enticed Adam and Eve... Your thought should always be secluded with the Shechinab: thinking only of your continuous love for Her that She may be attached to you.) 3. This does not mean. See above. however.' Thus consider yourself like a pauper and always speak with soft and beseeching words like a pauper.
even In thought. remove them from your mind. (CJ Shenei Luchot Haberii. sect. ed. to utilize it for matters of holiness. note 8). p. sect. 43. . as explained below.. "rejoicing in the suffering" (Shabbat 88b)..e. may He be blessed. Bet David (cur. 5-6."~ 1. and thus you will subdue them? Do not be depressed at all from not having mundane desires.) 3.When beset by mundane desires.e. See Berachot 5a: "Man should always incite the yetzer tou (good impulse in man) against the yetzer hra (evil impulse in man) [i. "Siira achara-the other side." as oppo sed to the "side of holiness.. Rashi]. ke1ipot)-husk@). shell(s)" (analogous to the crude husk that encompasses the edible fruit) is the mystical term for the realm or forces of evil and impurity. as it is said in the Zohar (1:lOOb): "'A pure heart' (Psalms 24:4) is the one that will not let his will and heart be drawn after the sitra a~hara. See above. Scorn the desire to the point of it becoming hated and despised by you. 4. i. On the contrary.e. to wage battle against the yetrer hara. When you are not drawn after your desire. 79). and 4 sect. and scorn it." To do so." It accords with the Baal Shem Tov's interpretation of "Who is strong? He who conquers (subdues) his [evil] impulse" (Auot 4:l): the yefzer hra is not to be destroyed but conquered. rejoice exceedingly for meriting to subdue your passion for the sake of the Creator's glory. to harnes s its energy for good. In turn. as it is written 'Tremble (incite) and sin not (or: and you will not sin)' (Psalms 4:5). also ibid." i." Sinful thoughts and acts vitalize and strengthen the sitra uchra (see below. Our sages said of this. helps subdue the personal yetzer hra and the power of evil (that is concentrated in worldly pleasures) in general . overcoming and subduing such thoughts and temptations subdues and weakens the kelip~t (see below. 36b. 16b. Note the term "subdues. "Kelipah (pl. you subdue the kelipot3 very much.' Incite the yetzer tov against the yetzer hara and your desire. 87 and 90. p. sect. the "side of evil and impurity. 2.
94). All these arepeniyo t (sing. self-negation (see below. sect. peniyah). and "Let all your deeds be for the sake of Heaven" (Avot 2:12). This excludes the expectation of any son of reward (material or spiritual). 2. let alone a sense of self-satisfaction.55. sect.77 and 92). True service of God implies total disregard of self. In mystical writings deveikut signifies intimate communion with God. 52-53).Equanimity is an important principle. cleaving. will not leave any spare time to think of those [other] matters3 1. have in mind to give gratification to your Creator. 47). being constantly busy with attaching yourself on high to [God]. Whatever you do. sect. 2-3). Orach Chayim:231. . ulterior motives of ego-centricity that must be shunned (see below. the concept of "service for the sake of Above" (see sect. This [perspective] is brought about by constant deveikut (attachment) unto the Creator. see below. Le. 15. as explained in Shlchan Aruch. It is a dominant theme in Chassidic teachings in general. 52. 2. See above.' This means that it should be all the same to you whether you are regarded as devoid of knowledge or learned in the whole Torah. unto God. sect.' Even the expectation of personal delight from your service [of God] is [an ulterior motive] for one's own con~erns.42.2 Preoccupation with this deveikut. This is the principle of "Acknowledge Him in all your ways" (Proverbs 36. and do not think--even a littleof your own needs. sect. blessed be He. 3. the pursuit of spiritual attainments (4 below. See below. 2.~ 1.. sect. blessed is He. to the point of bitul ha yesh. Deveikut-attachment. and in our text in particular.
as it is written "I am a worm and no man. each in its own way. sect. 11. 48. therefore. What makes you superior to a worm? The worm serves the Creator with all its mind and strength!2 Man. the worm and all other small creatures are considered as equals in the world. blessed be He. God gave a mind to the other just as He gave a m~ndto you. and certainly [no better] than [other] people. is no reason for self-satisfaction or arrogance: he can do so only by virtue of the special abilities given to him by God. [Recite them] with . [Heaven forbid. As each creature serves God according to its own abilities. You are like any other creature. Cf: below. See above. 3. When tempted to commit a sin. sect. All created things praise and worship God. 2. Bear in mind that you." (Psalms 22:7) If God had not given you intelligence you would not be able to worship Him but like a worm. That man can and will do more than others. note 2. See there especially the preamble (cited in Yalkut Shimoni on Psalms 150) how King David was rebuked by a frog who demonstrated that its service of God excels that of King David.] recite the [Biblical] verses pertaining to that sin. Thus you are no better than a worm. all are proportio nally equal. For all were created and have but the abillty given to them by the blessed Creat~r.Do not think that by worshipping with deveikutl you are greater than another. is a worm and maggot.~ Always keep this matter in mind. -1. created for the sake of His worship. too. as described in the Midrmh Perek Shirah.
netzach. As they were morally corrupt. there was no need to expel them. and [the temptation] will leave you. (If the sin has already been committed it will correct this in conjunction with teshuvah. 2. recite with all might. beginning of sect.h~us it will depart from you. they were to be expelled from there (Deuteronomy 7:1J and 20:16f). in general. Thus just as there are the attributes (Sefirot) of holiness. and so forth. will negate the temptation. love of. therefore. and attraction to. sect.. Our text refers to "six nations. is merely like a "filter" for . (CJ below. to be afraid of that which one should not fear. sect. and this will remove the temptation.) Seven nations inhabited the Land of Israel before the Jewish people came there after the exodus. Reciting the specific verses that relate to the subject of the sinful temptation. is the antidote to the yetzer hara. In terms of man. we find that mostly only six are named. for example. and 4 Maggid Devarav Leya'akov. According to tradition. and self-negation or avoidance of that which is forbidden). In our context. in the manner prescribed here. note 3). so there are the attribu tes of impurity (Zohar III:4lb and 70a). the Girgash ite fled the land before the Israelites entered and. with fear and love [of God]. Heaven forbid. 87. 87. e. sovereignty) of the realm of impurity. pursuit of the good. yessod and makchut) of sitra achara (as opposed to the midot of the realm of holiness). or negation of another human as expressed in anger and hatred. omitting the Girgashite. see Maggid Devarav Leya'akov. see below. must be conquered and expelled. In our context. 1. t$ret. 110 and 147. Thus reciting their names "with fear and love of God" leads to an awareness that sinful desires derive from evil. sect. is of no concern: makhut. temptation of any sinful trait or emotion in man is rooted in them. Torah. sect. All aspects in the realm of holiness and purity have corresponding counterpar ts in the realm of evil and impurity (see below.' When tempted by an evil trait. therefore. 223). the mundane or the forbidden. Their corresponding "evil" traits would be. there are the "good" traits ofchessed andgeuurah (manifested in love andfeor of God. the Girgashite. with fear and love [of God]. 139. [the names of] the six nations-the Canaanite e t ~T. the impulse and tempta tion to sin (see below. gevurah. the last of the seven attributes.g. 138).their intonations and punctuation." In the Torah. too. In Kabbalistic terminology they correspond to the seven midot (emotive attributes of the ten Sefirnt--rhesed. sect. hod. signifying the attribute of maldurt (kingship.
For example. First and foremost be careful that every motion in the Divine service be without ulterior motives. channel aH your love to God alone and concentrate all your efforts in that direction.87. Heaven forbid. 4. attach yourself strongly to his words to become united with the preacher..Connect that trait unto the Holy One. See above. i. . 22.e. sect.90. Sinful thoughts or desires are overcome in one of two ways: (i) Driving them away by diversion of thought.4 the compound of the first six. Heaven forbid. especially note 2. overpower your yetzer [bra] and transform that trait into a chariot for God." the seve nth is dispelled of itself. Ulterior motives may be the first ste p of spiritual decline. 11. if tempted by sinful love. Others may be led yet further astray by it. 120 and 127).3 When you hear someone preach with fear and love [of God]. disregarding them altogether and filling your mind with positive thoughts. When [tempted] by anger. His words will then become thoughts in your mind and [the sinfLl thought] will leave you. thus must not even attempt it. sect. This is a frequent theme in carly Chassidic teachings of which this paragraph is a typical example (and see also below. who can find it out?" (Ecclesiastes 7:24) There 1s then no alternative but to 1. and filling your mind with. (ii) Elevation or sublimation of the evil thought or desire to goodness. 3. thus as the earlier six are "corrected. 101. which is an expression of sinful "fear" and derives from the attribute of gevurah. blessed be He. from the earliest onwards. positive thoughts of holiness will of itself dispel the negative thoughts.' This requires profound wisdom "exceedingly deep. This last paragraph is another way to rid yourself of sinful thoughts: concen trating on. Chassidic texts. caution emphatic~llyt hat the second method is a hazardous technique that should be employed only by those who have reached spiritual perfection.
especially when required to do so." Note there also. . encourage emphatically frequent immersions in context of the Divine service..110 and end of 137)." 3. Immersion in a mikwh (ritual pool or equivalent) is mandated by the Torah for removal of impurity. even for a moment. prayer and sacred matters. The Baal Shem Tov said (Kefer Shem Tou. and to concentrate in the mikveh on the appropriate kavanot (devotions) for mikveh. A statement nearly identical to the present one appears as a sequel in the parallel-version of sect.retain constant awareness of this principle. Kabbalistic and Chassidic texts offer a number of special kauanot for the immersions. ought to have at least the proper intent towards that end (e. In Halachah. They did and do so even in the most difticult conditions. Continuous use of the mikveh is much better than fasting.2 For the "three-fold cord that is not broken quickly" (Ecclesiastes 4:12): remove yourself from depression and let your heart rejoice in G0d. as on Yom Kppur) before the morning-prayers.107. for the sake of purity or feshuuah). 178 (which appears also in the Maggid's Or Torah. 17-1 9 below) in Likkutim Yekarim. This is another fundamental principle of Chassidism.Yitro. that the Baal Shem Tov "merited a11 his illumination and levels by virtue of his frequent immersions. It is common practice among Chassidim to immerse daily (except when precluded to do so by law. Yoreh De'ah 198:48 and 201:5). 44-46. 164) that proper immersion is effective even without any kauamh (4 Chulin 31a. therefore. sect. It serves also for those who are pure to attain higher levels of spiritual purity required by Torah-law. this applies only to the basic purification for chulin (ordinary. 205-d). sect. aside of the additional immersions before the onset of every Shabbat or festival . you must also be scrupulous with [ritual] immersion.56. unconsecrated matters).j 2. and Shulchan Aruch. Addenda. note 19. but not for something that is consecrated. however. often repeated at length in this text (see below. 198: "One is to immerse as much as possible. therefore.. for it is a matter that is flawed by distraction. . sect. such as in rivers or lakes in the winter. See at length Sefer Baal Shem Tou. Secondly. Do not divert your mind from it.g. sect. Mystics. Immersion for greater purification for matters of Torah. sect. and to meditate in the mikveh on the appropriate meditations. 1 above (and sect.
should be said before sunrise. i.2 The difference between before sunrise and after sunrise is as great as the distance from east to west. sect. these ("who stand. Thus it became a special tlme for Israel. to mourn and lament ~ t esx lle and to pray for the redemp t~ on (Rosh on Berachot. for prior [to sunrise] one can still negate [all judgment^]. That part of the day is an especially auspicious time. rejoicing like a war1.It is necessary to make it known that one should regularly [rise] at midnight. most of the prayer.' At the very least be scrupulous to recite the [morningjprayer before sunrise.). never allowed a midnight to pass asleep.. worthy to bless Him (see Memchot 110a. This applies especialty to midnight which is an especially auspicious time of Divine grace and favor (Yevamot 72a). 26-28 and 83). ibid. King David. This is the ideal time for the morning-prayer (Berachot 29b). Shu[chan Aruch. the mldnlght vigl with a specla1 order of prayers followed by the study of Torah In general. ad lor. as stated in Mechilta and Zohar. et passim).. and "vatikintho se who are strong (in piety. in the nights") are the true servants of God. "[The sun is] like a groom coming forth from his bridal chamber. Thus "Bless God. both in summer and winter. . therefore." (Berachot 3b) With the destruction of the Bet Harnikdash (the Holy Temple in Jerusalem). That is.e.. midnight became the time that God Himself mourns that catastrophe and the subsequent exile of Israel (Berachot. Orach Chayrm. and Zohar 1:136a). as he said (Psalms 119:62) "At midnight I arise to give thanks. 3. sect 1) Thls 1s known as trkun chatzot. 9b). Tamid 32b. and selected passags from Talmud and Zohar m panlcular The mystics are very emphatic on the practice of study and prayer at night.^ This is indicated in [the verse]. and it is a recurring theme in our text as well (see below. up to the reading of the Shema. too. all you servanls 4 God who stand in the Hofrse of God in the n&htsn (Psalms 134:l). 2. those who love the performance of the commandments) would complete (the reading of the Shema) with sunrise" (ibid. The night is a propitious time for Torah-study (see Chgigah 12b.
blessed is He.. an intercesso r. This means that the soul will shine and glow from a "minor" mitzvah even as it does from a "majorn one. an intercessor. the Holy One. he is saved.. stands before the Holy One. 1. was very particular with this. . . . When anyone performs good deeds. see there notes 56. Acharei:47a) See also Avot 4:ll: "He who does even a single mitzvah gains himself an advocate. for it is of great import. as our sages said.rior. and says: 'I am from so-and-so who did me. one among a thousand .I This is a very significant matter. "Even if 999 [accusers] argue for his guilt. Do not allow a single day to pass without performing a mitzvah. whether it be a "minor" or "major" mitzvah. for then you know that you achieved something that day: you created an angel. Likewise. do not read chamota (its heat) but chimato (his wrath).'" (Shabbat 32a) . i. He is gracious to him. for "The Merciful requires the heart" (Zohar 11: 162b. blessed is He." (Job 33:23)3 1.. each mitzvah he did ascends on high.? and "if there be for him an angel." (Zohar Chadash. the commandments. 'If there be with him an angel. a. provides him with an angel for every word of Torah that he listens to. blessed is He. Sanhedrin 106b) . scrupulous) with a 'minor' mitzvah [as with a 'major' one]" (Avot 2:l): the word zahir is an idiom of "They that are wise yaz'hiru (shall shine). "Be zahir (careful.. then provides that person with an angel that will help him." 3. Thus do not regard this matter lightly. Up to here is a repetition of the third paragraph in sect. may his memory be for blessing. 2. and one [advocate] argues in his favor. This means that once the sun has already risen over the earth there is no more hiding from the judgments which come from the angels ofwrath. to the point that when he did not have a quorum he would pray on his own." (Daniel 12:3).e. as it is said. and he who commits a single sin acquires an accuser.' The Holy One. The Baal Shem. and nothing is hidden from charnuto (its heat)" (Psalms 196-7).
" (Shabbat 118b)' 4. 6. It is the remedy [to attain] "he will know no evil. when you undertake the instruction stated. blessed is He: every single day. This is alluded in the fact that the lette rs of the word Shabbat are the same as of "tushev-you turn back. 118. no. one needs perform kindness with God.This is indicated [in the verse] "rhmer mitzvalz (he who guards the mitzvah will know no evil" (Ecclesiastes 8:5). This is the implication of the word shomer. protects man from sin. you must stand on guard from morning to evening for the opportunity to perform a mitzvah that may come your way. To be mindful of mitzvot.. Addenda. b. signifies teshuvah on its highest level. precluding nocturnal emissions which are referred to as ''e~il. In the days of Enosh. 7. and Reishit Claorhmah. with all its details and nuances. "The kindness of God is kol hayom ("all day long". "to call in the name of God became profaned" (Genesis 4:26). you return. Guard the Shabbat properly." i. Sha'ar Ha'ahavah. his generation introduced idolatry (see Maimonides. 5. Hikhof Avodah Zara.e."~ [This general principle] is indicated [in the verse]. ch. the grandson of Adam and Eve."See also Keter Shem Tov. as in "his father shamr (guarded. therefore. To mind God's will by observing His commandments is regarded as "performing kindness with God" (see Zohar 1II:281a. This is indicated in [the verse] "Tashev enosh-You turn man back until he is crushed" (Psalms 90:3): tashev is the same letters as Shabbat: and enosh alludes to "[he is forgiven] even if he served idolatry like the generation of Enosh. or: "every day") (Psalms 523). effects atonement. The Kabbalah teaches that all realms ascend to their spiritual source on the S h h t : they return (teshuvah) to their source to be absorbed in higher sancti ty (Eitz Chayim 40:5 and 8. That is. 8). and 50:6). in both the letter and the spirit of the law. and to heed their performance. awaited and looked forward to) the matter" (Genesis 37:ll). and its proper observance. ch. Shabbat. that is. 1) Proper observance of . that is.
whether they relate to the body or the You may find it impossible to pray without alien thought. blessed be He.. Heaven forbid. 'Whosoever reads the Shema . This is indicated [in the saying].. This applies especially to the first two verses ("Hear."). those that cause harm keep away from him." and "Blessed is the Name. to do so without any alien thought. and other parallel sources. because you have been renewed and became a different person that is capable to beget. The Shema must be read with kavanah (concentration on the meaning of the text) and awe. With proper recital of the Shema. 0 Israel . demonstrates teshuvah. begetting . corresponding to the 248 limbs of the body. . Israel Baal Shem Tov. recited twice daily. which effects forgiveness even for the grave sin of idolatry. Arharei. 17-19 appe ar (with slight variations) as one segment under the heading of "Tzava'ah (Testament) of R. 198. sect. Tanchuma..8 To do so is something inestimably great. (Shukhan Anrch. Zohr Chadash. sect.I0 the Shabbat. each word effects protection and healing for the limb to which it corresponds." (Berachot 5a) "Those that cause harm" refers to all harms in the world. 8. Orarh Chayim. 60 and 63) 9. 10.. Kedorhim: 6. the duty of the Shema has not been fulfilled and it must be read again. however. At the very least be careful with the reading of the Shema. Zohar 1:lOla. analogous to the attribute of the Holy One. nonetheless. In Likkutim Yekarim. 48a. The Shema has 248 words (including the three concluding words repeated aloud by the cantor). train yourself to commence [reading the Shema] without alien thoughts. a return to God. for if these were said without kavanah. Rise from your sleep with alacrity. sect.c." 20 Embrace the trait of zerizut (alacrity) very much. .
Thus it is one of the advanced levels on the ladder of spiritual perfection (rf: Avodah Zara 20b and its parallel passages). The techelet signifies the Heavenly Throne of Judgment. analogous to the Almighty "begetting" (bringing about) all the worlds (rf: Tikunei Zohar 69:104a and 105b).. indolence.3 1. and you shall not stray after your heart and after your eyes .. 21 When donning the talit1 one is to see the "blue thread. the &itzit in general) is a reminder of God and will prevent man from sinning (Menachot 43b. A four-cornered garment with tzitzit (special fringes) attached to each corne r (Numbers 15:37$.) The significance of the techelet is that its color reflects the color of the sea . thus "you . The significance of the hiit is "accepting upon yourself the yoke of the Heavenly Kingdom in the act of spreading the talit over your head" (Zohar III:120b). Consciousness of this ability should cause one to rise and act with alacrity. which is similar to that of the sky which. Deuteronomy 22:12). in the realm of impurity.' Whatever you do should be done with alacrity. commonly called "prayershawl. note 1). thus nowadays we are unable to observe that detail of the precept of &itzit. in the present observance.worlds. he is able to cause new effects in all realms by means of his worship of God with Torah and mitzvot. on the other hand. The mystics note that laziness. 5-6. and prevents man from worshipping God (rf: below. sect. When man rises from sleeping he is like a new being. With the renewed energy. in turn. 116). 'This is regarded as "begetting" new things. Thus "you shall see it and remember all the commandments of God and do them. 3. is analogous to that of the Divine Throne of Glory. as it is written "They are new every morning" (Lamentations 3:23)." (Numbers 1539) To see the "blue thread" (or. a thread colo red blue (or turquoise) with a dye extracted from an aquatic creature called chilazon. indicates a desire of the soul and heart to act for the love of God." 2. sect. is rooted in ev11. 2. It is evidence of disinterest. and 6 above. (The identity of this creature is no longer known."Z This means that awe come upon him. Zeriztct (alacrity). The fringes on all four corners are to contain apetil techelel.. for you can serve God with everything2 1.
. as it is written." (Psalms 4:5)2 1. sect. 11:139a and 152a-b. blessed be He. blessed be He. 13-14. 2-3 (especially note 3) and 11. note 1." with the good remaining for the Divine service. sect. Everything in this world has a spiritual root Above. agitated and trembling from the fear of the Creator. 9. remember the love of God. 2-3. and above. . 4. "Be agitated and do not sin. See above. with regard to raising and sublimating all thoughts. Hilchot fi'ot 3:3.) 3.shall see it and remember all the commandments of God" because of the awe or fear it instills (ibid. Thus one must trace everything to its Divine root and apply it in that context to the service of God.2 Even when going to the privy have in mind "I am separating the bad from the good. 2. 2. See above. note 1. and see also ibid. remember the Holy One. sect. sect. Cf: above. blessed be He. .' Thus you will not come to sin. when going to sleep think that your mental faculties go to the Holy One. See Maimonides. [reflect in your hearts on your beds]. Whatever you see. 178b). as this is elaborated in various sources. 20. note 4. and will be strengthened for the Divine serv1. Before falling asleep lie in dread and fear. III:175a). sect. one should be agitated (tremble) in fear of God (Zohar III:113b). and with [an aspect ofj fear remember the fear of God. It is a time of serious soul-searching and stock-taking (ibid.' Thus [when seeing an aspect of] love. When retiring for the night. Thls is the concept of yichdim (unifications). (Cf: above.' Likewise.
2 1. See above.rop. sect.Your thought should be [directed] to Above. however. 136. sect. in service to God. The following is an important principle: Remain all day with the thought with which you rose from your bed. sect 4.er. 212. (The Baal Shem Tov explains this in context of the mystical interpretation of the honor due an elder brother. too. cited below. Obviously this relates to a thought that is pure in itself or has been sublim ated to holiness. The frequently cited concept that man's thought is to concentrate on the spiritual reality on h~gh is based on the principle that thought is man's very being. and below. 69). incurs a ban Above. . Heaven forbid. Likewise. Cleave unto Him and trust in Him to attain your desire. sect. If thc thought is pure and holy. This requires. citing Likkutim Yekarim. will be pure and holy.' 1. and no other thought. one must be careful to "sancti@ and purify one's first utterance" every day as one awakens. 90. 2. for it sets the tone for the whole day.) Always be careful to rise at midnight. all subsequent speech and actions. beginn~ngo f sect.) See Keter Shem Tov. thus you are where your thought is (see below.' 1. 16. . Thus it is extremely important that the first thought in the morning. .be p. This is based on Zohar III:23b (and see there also I:207a) . Cf:a bove. sect. 137." (instead of "Remain all day . .") This would accord with the following teaching of the Baal Shem Tov: Speech and action are rooted in man's thought.' He who does not rise. without having being prevented beyond his control. sect. the Supernal World. that one's first thought be attached to holines s. This sentence can be read also: "One remains all day .
27b. 30 below). Sleeping in day-time (except on Shabbat) is generally disapproved of. It offers a succinct declaration of the unique nature of Chassidism and the difference between it and its opponents. pause briefly every hour' to attach yourself unto [God]. especia lly by the mystics. He places Torah-study into context: the ultimate goal of the religious life is deoeikut-attachment to. 29 When you study. as often charged by his adversaries.* Even so. and communion with. 3. and also an hour preparing for each prayer "in order to focus their heart to their Father in Heaven." 2. p. The Baal Shem Tov clearly does not downgrade or belittle Torah-study. the principal purpose of Torah studied) is feshuvah (return to. however. Sleep a few hours during the day so that you will sufice with but little sleep at night. The Halachic proof-text for this principle is in the Talmudic passage relating that "the pious of old" spent an hour on each of the daily three prayers. explained in the next one (and elucidated by the much more elaborate parallel-passage in Likkufei Arnarim-Vitebsk. may He be blessed. as well as by sect. It is a typical Hebrew expression for "every so often. Thus study many [different] lessons [and that will banish your sleepiness].. This paragraph. one may "borrown from day-time to "repay it" in the night. Thus they spent nine hours daily on deueikut without worrying about the over-riding obligation of Torah-study.3 When rising at midnight and overcome by sleepiness." and an additional hour after each prayer to extend the communion with God beyond the prayer itself (Beracbot 30b and 32b). For "the goal ofwisdom (i. you must study? 1. Do not concentrate on a single lesson lest it become onerous for you. Study a number of [diverse] subjects.e.Convert the nights into days. "Every hour" is not necessarily to be taken literally. God. If it is necessary to enable one to study Torah at night. and communion . is no doubt one of the crucial statements in Tzaua'at Harivarh. drive it away by pacing back and forth in the house and chanting hymns with raised voice.
As for the "pious of oldn (see above. Isaac Luria that deveikut is sevenfold more etrective for the soul than study. It is practically impossible to do so when simultaneously concentrating on deveikut (4 below. for the reason explained in the next paragraphs. It requires concentratio n on the content of the subject-matter to the point of full understanding and acquiring yedi'at Hatorah (knowledge of Torah). they did not need to spend more time on reviewing etc.") Man thus faces a dilemma: should he pursue meaningful study with its unavoidable interruption of deveikut. Sefer Chareidim. note I). Schneur Zalman of Liadi. writes on the authority of R. 30: 'When studying Torah you must concentrate on the subject-matter. Mitzvat Hateshuvah.In the midst of study it is impossible to cleave unto God.4 Nonetheless one must study because the Torah furbishes the soul and is "a Tree of Life to those who hold fast to it. 4. as it is written. By not studying Torah. 3. Torah-study is not a superficial utterance of words. or focus on deveikut at the expense of study and yedi'at Hatorah? The Baal Shem Tov's answer is an unequivocal "you must study!" 5. 3. and already knew the whole Torah. This follows from the Talmud's statement that by virtue of their saintliness "their Torah was presented. Notwithstanding the primary goal of deveikut." Unl~ke others. Their piety and deveikut did not exempt them from the precept of Torah-study. and an unlearned person cannot be a chassid (a pious person who acts beyond the minimal letter of the law). sect. The precept ofauthentic deveiktrt with "fear and love of God is superior to the precept of Torah-study and takes precedence to it. they spent so much time on prayer and deveikut because they had already studied." (Avot 25) The lack of Torah-knowledge precludes the possibility of authentic deveikut. ~t does not over-ride the oblig ation to study Torah. "A boor cannot be fearful of sin. therefore. as stated in Sefer Chareidim and in Shenei Luctaot Haberi~. God) and good deeds" [Rashi: that it be with teshuvah and good deeds] (Beracbot 17b). however.5 with. your deveikut will cease. the sequel to this scntence. "The beginning of wisdom is fear of God" (Psalms 111:10). to assure that they will not forget what they had learned. but from the normative obligation of continuous Torah-study in accord with . Shulchan Aruch. blessed be He. and R. end of ch. (See the lengthier vers ion in Likkrrtei Amarim-Vitebsk. one loses out on both the basic precept of Torah-knowledge and dewikut. Hilchot Talmud Torah 4:4-5.) Note." (Proverbs 3:18) If you do not study.
and by virtue thereof you will be properly attached b Godlinesr. at least one fulfills the precept of talmud Torah (studying Torah).. when in a state of constricted consciousness. as stated above. you . 30: "When studying Torah you must concentrate on the subject-matter. 121. that the failure to study Torah is one of the four primary causes of spiritual corruption). It is a fact of reality that in any case there are times when the active pursuit of deueikul is precluded. In view of the above. sect. the precept of acquiring yedi'at Hatorah (Torah-knowledge)." (Cf: below. When studying Torah. note 7. "you must study!" Moreover. Cf: below. Le.8 the Halachic principle (Berachol lla. 7.7 Nonetheless."6 The time of Torah-study is then certainly not inferior to those conditions. The pursuit of deveikut cannot be an excuse not to study Torah. when the mind is not preoccupied with thoughts of Torah. sect. It is absurd to argue that Torah-study is inferior to those states of being.) Nonetheless. blessed is He. which is the very foundation of the religious life of following God's will and without which there is no authentic dewikut. par. 6) Note the sentence in sect. and the mind will be filled with meaningless (devarim befeilim-idle matters) or even sinful thoughts (6 below. 117. such as when "the mind falls" (i. H i k t Talmud Torah. 121. you must consider at all times attachment to the blessed Creator. and sect. which is part of the service of God and communion with God.Ponder the fact that you cannot cleave [unto God] when sleeping or when your mind "falls. Thus. every so often one must remind oneself that its pursuit is a command of God. 8. When conversing think of nothing but attachment to the Creator.e. when unable to concentrate and focus the mind) or when asleep. however." Thus they continued their studies in the time left to them beyond the nine hours devoted to prayer and deveikut. When studying Torah. ibid. (See at length. one is not in a state of deveikut. 54. unable to concentrate and focus. " 6... sect. Sukah 25a) that "when preoccupied with one mitzvah one is exempt from another mitzvah. it is clear that Torah-study is absolutely essential in the full sense of "Talmud Torah is equivalent to all the commandments.
note 4).~ 1. In this context note his interpretatio n of the Midrash that states that God concealed the original light of the first day of creation: the light was hidden in the Torah (see Zohar Chadash. You must always be occupied with Torah. sect. Something may come your way and you do not know whether to pursue it or not. you will be able to determine your course of action from the subject-matter that you learned. If you studied Torah that day. 85a-b. and by virtue thereof you will be properly attached to Godliness.must concentrate on the subject studied. par. however. R.'Just assure that you are continuously attached to God.]' (Psalms 5523). He will inspire your thoughts with [the idea] of what you need to do. 81. however. then things are most likely as it oc . Any disruption of dewikuf at that time may reduce it to idle talk and lead astray. (Degel Machnneh Ephrayim. 11-12) is preceded by the following words: "As you subdue all your thoughts to the Creator. because it is itself the prere quisite for proper deveikut. and by means of it one is able to see things that are not normally perceived. for it 1s "a Tree of Life to those who hold fast to it" (Proverbs 3:18). It is related of the Baal Shem Tov that he would look into sacred texts and then answer those who sought his counsel. however. blessed be He. He will then always provide you with the opportunity to know [how to act] from the Torah [st~died]. You do not lose out on this account. The optional activity of conversing. as it is said.1 I. and a thought comes to you about whatever it may be. 147-9). Ruth. 29. sect. on Genesis 1:4) 2. The version of this section in Likkutim Yekarim (sect. Torah-study requires concentration on the subject-matter (see above. Israel Baal Shem Tov said that when you are attached [in a state of deveikut] to the Creator. When but conversing and relying on the deveikut. 'Cast your burden upon God [and He will sustain you. allows for it to be in context of dewikur. be very careful not to lapse occasionally from the deveikut. below. Cf. blessed be He. Sejer Habahir.
72. ~ 1. 27-28. one relates to God haphazardly. See below. too. a prophet ic spirit). advance in gradual stages.If. then God. and 143. however.) Though unable to pray with deveikut at the outset of prayer. will deal with you in a random way.~ curred in your thought.. sect.) The punishment for relating to Gtd haphazardly is that you will be deprived of this opportunity. When permissible foods. 60. sect. garments or objects come your way. and see there also verses 21. that it is meant for you to elevate them. See below. He will not provide you with the garments and food which contain the sparks related to the source of your soul that are meant for you to corre~t. On the gradual ascent in prayer. This is achieved by using all things for their intended purpose in context of man's service of God. When praying. 38. 109." 3. 116 and 142). recite the words with great kavanah (devotion). God relates to man "measure for measure" (4 below. it is an indication that they contain "holy sparks" related to your soul.2 Commence with composure and in the midst of prayer attach yourself with great deveikut.135. too. 112. Strengthen yourself bit by bit until [God] will help you to pray with intense d e v e i k ~ t . will deal with you haphazardly" (Leviticus 2622-24. Thus you will even be able to recite the words of the prayer expeditiously. 4. 3.3 Moreover. This is a bit of ru'ach hakodesh (holy spirit. (See below . I. See below. Cf: also sect. i. see below. sect. sect. 36. All things in this world contain "holy sparks" that must be elevated to their Divine source. 2. 4.' Do not exhaust all your strength at the beginning of prayer. sect. 58. Thus "if you behave haphazardly with Me. and 40-41). 85 and 86. .e. sect.
otherwise it will be [defective]." 2. and end of 75. 51. whether it be Hymns or [words of Torah-]study. however. when you say the word with great bonding. only her l~psm oved and her voice was not heard. all kavanot are involved in the whole word of themselves and by themselves. See below. 1.You must learn and train yourself to pray with a low voice. you are but meditating on those you know. should be said with all your strength. 75: "Every letter contains 'worlds.' Whatever you say. Note below. becoming truly unified in Divinity . 58. Know that every word is a kornah shelemah. 60. Thus it is customary in many places (and especially among certain schools of Chassidism) to pray loudly. sect. 118: 'Wen meditating in prayer on all the kavanot (mystical devotions) known to you. All worlds will then be unified as one and ascend.. for the average person Nonetheless.. To pray out loud stimulates kavanah. "you must learn and tram yourself to pray with a low voice. On an elevated level of communion with God. as it is sald. and even necessary. On the other hand. and to cry out silently. when praying with profound focus and devotion in the gripping consciousness of being literally in the very presence of God." (Psalms 35:10)? An outcry rooted in deveikut is silent. the words flow from the very depth of the heart and soul and are practically silent: "Hannah was spealung from the heart." (I Samuel 1:12) To pray aloud initially is acceptable. For every letter is a complete world." Below..' Thus you must invest it with all your strength.." . "All my bones shall say .. souls and Divinity. sect. even the Hymns [of Praise]. 1. sect. with great intensity (except for the Amidah which should not be audible even to those standing next to you). like missing a limb.' These ascend and become bound up and united with one another. 34-35. with Divinity. a complete structure. The letters then unite and become bound together to form a word. and to cry out silently.
Every word of Torah or prayer, therefore, is charged with spiritual forces and signifies the ultimate principle of unity. 35 It is a great kindness of God that man remains alive after praying. In a natural course of events, death would have to result from exhausting all strength [in prayer] because of exerting oneself so much by concentrating on all the great kavanot (mystical devotions).' 1. See below, sect. 42. 36 Sometimes you can pray very quickly, because the love of God burns very strongly in your heart and the words flow from your mouth by themselves.' 1. See above, sect. 32. Cf: Kekr Shem Tov, sect. 217, that in the state of inten se deveikut, the holy spark of the She chi~hin herent in man's soul will sometimes extend itself to the point that words spoken flow from It. It seems that the person is not speaking by himself but that the words flow from his mouth by themselves. 37 When attaching yourself on high in the silent prayer,' you will merit to be raised yet higher during that prayer.2 Our sages thus said, "He who comes to be purified will be helped." (Shabbat 104a) 1. The Amidah, which is to be said in an inaudible voice. 2. Cf: above, sect. 32.
28 TZAVA'AHTA RTVASH By means of that prayer you will then merit to be attached on high with your thought.3 Thus you will attain to the yet greater level of being attached on high even when not engaged in prayer. 3. To be attached with your thought IS to be attached with your very bang, with your soul (4 below, sect. 104). On that level the deveikut remains even when not engaged in prayer. 38 Do not recite many Psalms before prayer so that you will not weaken your body. By exerting your strength before prayer with other things you will not be able to recite with deveikut the main thing, i.e., the mandatory [prayers] of the day-the "Hymns of Praise," the Shema and the Amidah.' Thus say first the main thing with deveikut. Then, if God gives you additional strength, recite2 Psalms and the Song of Songs with deveikut. 1. Some recite Psalms as a preparation for prayer. It helps to focus the mind to the service of prayer: it clears the mind from alien thoughts, and it is conduci ve to deveikut. To spend too much time or effort on the preliminary Psalms, however, can be counter-productive, as the energy expended may be at the expense of that required for the mandatory prayers. Cf: Kefer Shem Too, sect. 120. 2. At the conclusion of the prayers. 39 On Yom Kippur, before ne'ilah (the concluding prayer), recite the machzor (liturgy of the day) with katnut ("smallness;" limited consciousness) so that you will then be able to pray [ne'ilah] with deveikut.' 1. This paragraph is relating the advice of the preceding section to the service of Yom Kippur.
When you are on a low level, it is preferable to pray out of a siddur (prayer book). By virtue of seeing the letters you will pray with greater kavanah (devotion).' When attached to the Supernal World, however, it is better to close your eyes, so that the sight [of your eyes] will not distract you from being attached to the Supernal World.2 1. The mystics emphasize that the letters of the Hebrew alphabet are not convent ional symbols for sounds but signify--and are charged with-Divine emanations, lights and creative forces. (Cf:be low, sect. 75.) The very sight of these holy letters, therefore, stimulates kavanah. R. Isaac Luria always prayed out of a siddur (except for the Amidah which he said with closed eyes). 2. In the state of deveikut one does not need the inspiration of seeing the lett ers and, as stated above, sect. 36, the words will flow of themselves. In fact, in that state, anything else (such as reading the words) will distract. The soul told the Rabbi [the Baal Shem Tov]' that he did not merit his revelations of supernal matters because he learned so much Talmud and the codifiers, but because his prayers were always with great kavanah (devotion).Z By virtue thereof he merited to attain a high level. 1. One of the levels of prophetic spirit is the self-revelation of a person's ow n soul as it connects with its supernal source. (This form of m'ach hakodeshholy spirit-is described in R Chaim Vital, Sha'ani Kedushah III:5 and 7.) 2. The Baal Shem Tov was not only a great mystic but also a profound scholar in Talmudic and Halachic studies, as attested by his disciples (many of whom were themselves among the universally acknow!edged Torahscholars and authorities of the time; see the essay by Rabbi S. Y. Zevin in Sefer Habesht, Jerusalem 1960, p. 24ff; and the Introduction to B. Mintz's edition of Shivrhei Habesht, Tel Aviv 1961, p. l9f) His lectures were not limited to mystical subjects. They included regular lessons in Talmud, the Codes and their commentators, and were delivered with great acuity and
brilliance. He merited his unique revelations, however, by virtue of his extraordinary kavanah in prayer. Before praying have in mind that you are prepared to dle from the kavanah (intense concentration) while praying. Some concentrate so intensely that it may be natural for them to die after reciting bust] two or three words before God, blessed be He.' Bearing this in mind, say to yourself: "Why would I have any ulterior motive or pride from my prayer when I am prepared to die after two or three w~rds?"~ Indeed, it IS a great kindness of God to gve [man] the strength to complete the prayer and remain alive. 1. The concentration on every word ought to be to the point that thc word is "illuminated and shines" (see below, sect. 75). Bwikut to God is by means of attaching one's thought and inwardness to the spiritual core of the letters of Torah and prayer-the spiritual core of the light of the En Soph that is in the letters, an "attachment of spirit to spirit." (fibr Shem Tov, sect. 44 and 94) Thus when sayinga word, you prolong it extensively and do not want to let go of it (below, sect. 70). There is then an intense communion to the point of "my soul yearns, it expires, for the courtyards of Godn (Psalms 84:3). Thus it may be natural to die (kelot hnefesh---expiration of the soul from its pining for God) after reciting but two or three words from the prayer. 2. Prayer with great deueikut may lead to a sense of self-satisfaction or other ulterior thoughts. The Baal Shem Tov thus cautions to beware, that the prayer be followed by a profound sense of humility. (See Darkei Tzedek, 1:no. 5.) Cf: above, sect. 12. When fasting,' have in mind the f~llowing:~ 1. In line with normative Halachah (Maimonides, Hilchoi De'ot 3:l; Shukhn Aruch, Orah Chayim, sect. 571), Chassidism is opposed to self
4. 76-79. strength. sect." (Cited in Keter Shem Tow. with love and fear. . the subservience of man's natural inclinations to God. and see there also sect. This section thus offers the appropriate meditations when fasting.'Woe to me! I have angered the Supreme IGng on account of my desires and my putrid pride.) Nonetheless. soul. It is much better to use the energy one would expend on fasting for the study of Torah and prayer. Thus I will effect Above that "the slave be subservient to his Master and the maid-servant to her Mi~tress.. my body and fire. the pervasive presence of God as the sole true reality. See below. It emphasizes that man concentrate on positive forms of self-improvement: "It is preferable to serve God in joy without self-mortifications. return to God). t.e. 2. Fasting is not itself teshuvah (repentance. and Addenda: sect. sect. That is why I wish to afflict myself to subdue my desires and pride. but facilitates t he frame of mind required for teshuvah (see below. 'Woe to me! What am I and what is my life? I wish to offer my fat and blood. 3. 16. 178: "The Baal Shem Tov merited all his illuminations and levels by virtue of his constant immersions. fasting is not rejected outright: at times it may be needed for spiritual correction in the context of teshuvah. Frequent [immersions in a] mikveh (ritual pool) is superior to fasting. mortifications such as fasting and other forms of self-afliction. 249.302. in order that I effect His unity: and also to offer myself as an offering before Him.. note 16) 5. God (see below.e. and cf : also sect. for fasting weakens the body from the service of God. Cf: TikuneiZohar 2a. The proper fast is not simply a passive state of "not eating and drinking. because the latter cause feeling of depression" (below. sect. notes 4 and 16)." I t needs be a conscious act with a profound sense of overcoming physical needs and desires in the service of."a~nd fulfill the precept of teshuah. 56. Note also Likkutim Yekarim. and submission to.. as opposed to t he dualism of the erroneous assumption of a dichotomy between the spiritual and the material. to pray with all one's strength and concentration which leads one to spiritual ascent. 1. sect. my spirit. 219. 56).^ I wish to diet myself so that I may serve God truthfully and whole-heartedly.
In the metaphortcal terminology of the Kabbalah thts is regarded as a separation between the Shechinah (D~vineIm manence) and Her "spousen. Sin defiles not only the sinner's body and soul but also. strength and w~ll( seezohar Chadmh. mere dust.6 [I want to offer these] to the Creator of all worlds.' in absolute unity: In a mode of kindness and 6. as it were. and His Shechinah. blessed is He"). May I effect Above that all the kelipot be removed from the Shechinah so that She may be purified and uniG with Her 'Spouse.' evil forces) because of my affliction. spirit and soul. by whose word all worlds came Into being and before whom everything is as nothing-all the more so I. fasting involves overcom~ng the natural des~res for food and drtnk. a maggot and worm. Moreover.' and also to ease that sorrow. I ought to rejoice that He gave us the means to subdue the yetzer hara that is upon us.heart and will before Him. "covers " the Shechtnah wtth the crude husk of evil. Ruth-80a) 7 To sin is to cause sorrow to God. 8. The Shechinah IS thus ''exled" in evil. on both the level of the Divine Immanence and Presence (Shechrnah) and the level of the Divine Transcendence ("The Holy One. preventtng the manifestation of the Dtvine Presence. Fasting diminishes the blood and fat of the body. Thus it is regarded like offering these as a sacrifice on the Divine altar of atonement (Berachot 17a) Moreover. blessed be He. blessed is He (Divine Transcendence). Woe to me! Of what significance is my affliction compared to that sorrow which I caused for so many years! I can but appeal to His great mercies to observe my selfaffliction to ease the sorrow of His Shechinah. "I ought to rejoice so much that I merited to bring [Him] some gratification with my body. and that He remove from us the kelipt ('husks. but more so of soul. Thus it impl~esa sacrtfice of not only the phystcal blood and fat. Acts of virtue (Torah and mitzvot). "I wish to afflict myself because I caused sorrow to the Holy One. I cannot but appeal to His great mercies to augment my strength to offer many sacrifices before Him. the Holy One. and specifi .
yet His providence is upon them to endow them with [supernal] effluence and their vitality. 10. In His kindness He has helped me many times. however. for He put it in my heart to afflict myself. heart and liver.e.9 "I trust in Him. blessed is He. ch. sect. for He created all worlds by His word to come into being from nothingness. he offers "nourishment"-the blood and fat that are diminished in him. and other such enticements.compassion. and it transfers it to the heart which then transfers it to the brain.. "frees* the Shechinah from that exile and reunites Her with Her "spouse. Thus surely He can provide me with strength. In the human. Everything came into being. too. is in reverse: the aspect of "brain" (the Spfirah of Chochmah) transfer s to the aspect of "heartn (the Sejirot ofZe'eirAnpin." whence it ascends to the supernal "heart" and then to the supernal "brain. My self-affliction will thus effect union from Above to below.10 All is as naught before Him. 1)." Thus I appeal but to His great luridness. Chessed to Yessod). and this day." The "arousal from below" by man thus initiates a reciprocal "arousal from Above" in the normative order of Divine emanation and effluence. He will help me. Zohar I11:153a notes that the Holy One. from the mind to the heart and from the heart to the liver. the liver is the first to absorb nourishment. 11. When man fasts. The order of Divine effluence. saving me from the yetzer h r a so that it will not prevent me from my self-affliction by arguing that I am weak and that my mind is withering. 78-79. See below. and in His kindness set His providence upon myself as well. and that He pour His emuence upon me as ~e11. i. and his will-to the supernal "liver. and continues existing. . by means of the ten utterances ofthe six days of creation (as recorded in Genesis. and cally the correction of sin (teshuvah)." 9. and the "heart" to the "liver" (the Spfirah of Mafchut) from which it is diffuse d to the lower levels. manifests Himself and His effluence by way of three principal channels which are metaphorically analogous to man's vital organs of the brain.
. [the fast] is not even an affliction on my part. Moreover. 'The greater the person. This interpretation of Psalms 37:3 (to rely on God to help you fulfill the mitzvot) is identical to that of Nachmanides (Ha'emunah Vehabiwhon. one is allowed to trust [in God for the ability] to do Mitzvot. for everything emanates from Him. "I am not afraid of any weakness on account of the hst. 'I am going the way of all the earth' and I will not deviate. He will surely sustain me. "Furthermore. sect. but more so to "sanctify yourself by that which is permitted to you. the greater is his yetzer hra' (Sukah 52a). S. note 1. I can trust in [God]: 'Trust in God and do good' (Psalms 37:3).' (Isaiah 40:31) Indeed. I4 and 'They that hope in God shall renew strength. To be holy means not only to separate from all that is forbidden. Our sages said. On my own I would be altogether unable to afflict myself. See below." and I trust in His kindness that He will augment my strength so that I may serve Him in truth.I2 "Thus I submit myself unto Him who created all worlds by means of His word. ch. as it is said. Bitarhon). 138. 'God supports him upon the bed of illness' (Psalms 41:4). I wish to fulfill 'you shall be holy.e.' (Leviticus 20:7). Bachaya (IC?d Hakemarh. man has but by Divine grace.save me from anything that would prevent me [from my good intentions]. 'the Shechinah sustains the sick. i.' (Shzbbat 12b) Thus. 14.U. for many people become ill [without fasting]. in His luridness. 1) and R." self-restraint in permissible things (see Nachmanides on Leviticus 19:2). But as I do not devlate. it is a good omen for one to die while engaged 12. "Moreover.. and that He will help me so that people will not know of my deeds. 13. even to endure all mortifications and disgraces for the sake of His unity. blessed be He. Even the strength and energy needed for the fast.
with teshuvah. that they turned from their evil way' (Jonah 3:10). but if you trust in the Creator's 15. without actual speech.I6 Do not feel proud. Sometimes the mouth feels dry and has a bitter taste." 16. Cf: below. Change your place every so often. . 77. 'God saw their deeds. Nathan 252: "It is a good omen for one to die whilst engaged with a mifzvah. Study Torah in your mind. for he who takes pride in his fasting "will be delivered to dogs. as we find that it is not said of the people of Ninveh that God saw their sackcloth and fasting. CJ Avot deR.15 Without [this teshuvah] I may possibly have to be reincarnated because of sin and for having failed to worship properly with love and fear. the whole world is forgiven. [In the days of fasting follow this procedure:] At the outset sleep in the first three nights-though not too much-in order to strengthen your mental faculties. the essence of which is to turn from one's evil ways and return to God (see Maimonides. walk around a bit and then lie down briefly. sect. for surely you effected something very great. but. in order to ease your pain. Hilchot Ta'anit 5:l). C' Ta'anit 16a: "Neither sackcloth nor fastings are effective. [it is said] 'Do not worry about the troubles of tomorrow' (Yevamot 63b)." (Yoma 86b) Thus rejoice in the pain of the fast for offering up yourself [to sanctify God's Name]. 17." (Tikunei Zohur 18: 33b)" Even "if but a single individual repents. but only tesh uvah and good deeds." Fasts serve the purpose to stir the heart to kshuvah." *** The essence of teshuvah is to turn back from one's evil ways. to ease your pain. and the yetzer [hara] makes it seem to you that your head aches and that it is unbearable for you. Also.
You must understand this trickery.' my Creator will be more gratified if I do not pay attention to the stringency that you pointed out [to me] to make me depressed in His worship. because of your depression. and have in mind that the Shechinah sustains you even as She sustains others that are ill.I8 Have in mind that your fast 1s to bring gratification unto the Creator. and below.2 Though I ignore the stringency you mentioned. scct 47 . See below. and then God will help you. and there is no pain at a11. His intent is that you should feel depressed as a result thereof. for your intent is but to keep me from His service. blessed be He. blessed is He. and say to the yetzer hara: "I will not pay attention to the stringency you referred to. 18. because I do not pay attention to it only so that I will not be kept 1 See below.lndness your vigor will be strengthened. the Creator will not hold it against me. Even if there really was a degree of sin. sect 46. sect. "In fact. 11. and that you accept the pain upon yourself in order to ease the pain of the Shechinah. Worshlp with joy. and thus be kept from serving the Creator. I will serve Him with joy! For it is a basic rule that I do not think the Divine service to be for my own sake but to bring gratification to God. may He be blessed. note 2 2 See above. You speak falsely. 78-79 Sometimes the yetzer h r a deceives you by telling you that you committed a grave sin when there was really no sin at all or [at worst you violated] a mere stringency. sect.
you must put aside all other thoughts. Think of God and not yourself! "Turn away from evil and do good.. Thus it must be avoided altogether. To read it that way. and the quote cited below. (see Sha'arei Kedushah I: 2 and 5. For how can I negate His service. but it is really counterproductive. note 2). Thus "turn away from (real or imagined) evil. sect. The Baal Shem Tov does not belittle sin or the remorse it requires. It was often cited by the opponents to Chassidism as "proof' of anti-nomianism. Chaim Vital (the principal disciple of R. one must pursue it with alacrity and joy. "Behold. Shabbat Teshuvah) In fact. atrvut (depression.e. 33b. "and do good. p. and the authoritative scribe of his teaching). 46) he cautions against the psychological effects of obsessive remorse that leads to depression. blessed be He: avoid depression as much as possible. Isaac Luria. 111: 4. sect. melancholy) is a nasty. Cj below. sect. There is a specific time for everything. As already stated by R. is a total distortio n. for these are but the device of the yetzer hara to prevent you from your present obligation.. such as thoughts of self-reproach for past misdeeds or personal worthlessness. Remorse for sin is necessary." (Psalms 34:15) R Dov Ber of Mezhirech." i. (Or Hame'ir. disciple and successor of the Baal Shem Tov. God rides on a light av (cloud)": God dwells with that person who regards any sin he committed to be av (thick.3 3. But this mikvah of ieshuvah must be separated from the observance of the other mitzvot. carry out your obli gations in proper manner with joy and eagerness. coarse) even if it is essentially a light transgression. It is part of leshvah. interpreted: When it comes to Torah-study and service of God. however.from His service. setting aside all other matters. blessed be He. When the obligation or opportunity of mikvol comes about. 398) Here (and below. even for a moment!" This is a major principle in the service of the Creator. (Keter Skm Tw." i. sect. To be depressed by one's spiritual deficiencies or downfall may seem laudable. This whole section (and the similar one below. He interprets Isaiah 19:1. 107. 11: 4. and in particular the concern about one's spiritual status. Sha'ar Ru'ach Hakodesh. forget now these thoughts. 46) requires elaboration. harmful and objectionable character-trait that is a hindrance to the service of God. 45 and 107.e. this principle is an established premise of much earlier author+ ties: "A person must never think to himself 'I am a sinner and committed .
thus of what avail is it for me to perform mitzuot?' On the contrary: if he has committed many sins. 15 and 44. I'erek Hamitzvot. sect 107. as it is written "Serve God with joy. note 2). It follows an earlier ruling by R. Chibur Hateshrrvuh 1:ch. he must be joyful at the time of Divine service. The Baal Shem Tov's teaching here. Mitzvat Hateshuvah. Hilchot Lulav 8:15. The good kind 1s brought about by the yet+er fov and ascends on high. See above. should he eat more garlic so that his breath should go on smelling?" (Shabbat 31a) In other words. 46. 394j. he should countermand that with the performance of mitmot. as it is written. if you have committed bundles (chabiiot) upon bundles of transgressions. and below. is very good .. sect. Israel ibn Al-Nakawa. Menoral Hama'or. Thus it is stated in Vayikra Rabba [21:5]: 'For with tachbulot (wise advice) you shall wage your war' (Proverbs 24:6). your God.' Weeping that results from happiness. Menachem Me'iri. 2 Zohar Chadash (Ruth:80a) notes that there 1s a good lund of tears and n bad Iund of tears. we do not say to a wicked person. and see also R.' (Deuteronomy 28:47) This applies to every service of God. however. "Be still more wicked and abstain from mitzvot. p." (Sefer Chreidim. countermand them by bundles upon bundles of mitzvot. sect. ch. come before Him with joyous song" (Psalms 100:2). T h ~~sn cludesw hen a person In d~stresss heds tears In prayer. 107. Hilchot Trfdah 156). "If onc has eaten garlic so that his breath smells. thus offers guidance that preserves and strengthens Halachic observance. 'Because you did not serve God. and below. More so ~t rncludes tears of remorse In context of teshuvah. i. and as ruled categorically by Maimonidcs in his Code. 12) This accords with the Talmudic proverb. Eleazar Azkari: "Though a person may be depressed on account of his sins.e. 4) Weeping is very bad because man must serve [God] with joy. Abundant joy in the performance of all mittvot is itself mandated by Halachah. sect.many transgressions." (R. wh~chln dlcate the sincerity of ult~matete shuvah (see . placln g h ~ tsru st In God and seelang HIS mercy and compassion to remove the angush (see below. and how much more so then to the service of prayer which is called 'the service of the heart' (Ta'anit 2a). with joy and gladness of the heart." This principle is applied on the practical level ofJewish law (see Maimonides.z 1.
As for the chumrot that are stated explicitly in Shuhhan Amch. this applies only to extra stringencies that man undertakes on his own. including all its details. Chaim Ibn Atar notes that weeping (beyond the "good" types referred to above) may be the symptom of resignation. i.e. sect. or the ecstatic state of deveikut. For the Torah in its totality. it is better not to be overly stringent . Tears of anger and frustration. R. Thus bevond the moment of distress.] do not be overly punctilious in all you do. Another kind of positive (and commendable) weeping is the one mentioned here.). note 2. [As you set out to serve God. "Even so. Thus it is said in a general way: 'Even what a conscien . However. This section offers a general principle on its own. 12). Akiva's eyes when hearing the mystical meanings of the Song of Songs (Zohar I:98b). 107. or the appropriate times for prayers of penitence. signifying a lack of faith in God (Or Hachayim. but gains clarification when read in context of the sequence of sections 44-46. unlike the earlier ones whose mind was very powerful. one's service of God must be with joy. the one that results from overwhelming joy. thus we are unable to follow properly all chumrot (stringencies of the law). are not received by God (Zohar Chadash. ad [or. one must observe these wen if it appears in his mind that to do so will negate the deveikut. or in prayers for evil to come upon another. [That includes] even the precautionary laws [that are Rabbinic]. one must be very careful in this matter and weigh actual practice on the scales of the mind: if the stringency will cause a negation of dewikut between himself and the Creator. as when tears flowed from R.Zohar Chadmh. ch.). precautionary measures and subtleties. Note carefully the qualifying admonition of the Maggid of Mezhirech: "Our minds are not as powerful as those of the earlier [generations]. Moreover. [Preoccu pation with these would cause] a cessation of dewikut because of our weak mind.. was given to us solely to become attached to His great Name by means of the deeds we do. Sha'ar Ho'ahuvah. See below. He is surely wrong [in that assumption]. For true faith and trust in God must of itself lead to joy and gladness (Reishit Chorhmah.' [To do so] is but a contrivance of the yetzer 1. ad loc. Numbers 11:18). Other kinds of weeping are at least suspect. from the [time of the] Faithful Shepherd (Moses) up to [and including] the Shulchan Amch.
' In that case do not pay attention to the yetzer hara who seeks to prevent you from performing that mitzvah. Thus strengthen yourself to rejoice in the Creator. they voided Your Torah. because of a variety of obstacles. are entrrely one' (see below. Pe'ah 2. because you fully repented and resolved never to repeat your folly. even for a matter of transgression. "searches the hearts and minds" (Psalms 7:10).. 44. for that would be very base. and the notes there 3 See the rnterpretatlon of thls verse In Berachot 63a. He knows that you wish to do the best but were unable to do so. see Megrlnh 19b and Vqtkra Rabba 22 I). is an immense obstacle to the service of the Creator. but then rejoice in the Creator. Depression. do not be overly depressed lest this stop your worship. p. and h ~Ssh emonah Perakim. I e. Note there also the refe rence to "In all your ways acknowledge Him" (Proverbs 3:6). ch. blessed be He. do not feel depressed. blessed be He. [Heaven forbid]. sect. and see on this Maimon~des' Mlshnah-Commentary on Berachot 9.5.[hara] to make you apprehensive that you may not have fulfilled your obligation. blessed be He. 29a-b) 2. blessed be He. Respond to the yettious student w~llin novate In the future [was sa~da lready to Moses at SInal]' (Yerushalmi. Bear in mind that the Creator. One must be careful." (Psalms 3 19:126) This ~mpliesth at the performance of a mitzvah may sometimes entail an intimation of sin. see there. Heaven forbld.4. in turn. assoclatlng any personal delight. and 'the Torah and the Holy One. Do feel saddened by the sin [and feel ashamed before the Creator.2 It is written. Even if you are certain that you did not fulfill some obligation. blessed be He. though. On these first three paragraphs see also above. sect 54. and beg him to remove your evil]. blessed 1s He. in order to make you feel depressed. end of ch 5 . Even if you did commrt a sin. "There is a tlme to act for God. as stated by the saint. 1-4). the author of Chovot Halevo vot (Sha'ar Ytchud Hama'aseh. from the manuscript of R. note 1). that rt is done exclus~velylt shmah (for its own sake) without. Menachem Mendel of Vltebsk." (Lckkuter Amarim.
" Each. The emphasis of our text is a condemnation of ulterior motives: a selfserving pursuit of "the level of R. and b) you will lose what you had already! (fiter Shem Tov.? 1. Elsewhere the Baal Shem Tov adds a warning: in trying to attain that level you are over-reaching your own level and capacity.' When serving God. sect. CJ Moreh Nevuchim L34. "Many did like R. naively emulating others to attain something that is beyond you. For a) you will not obtain what you seek. sect. and the parallel-passages in Told01 Yaakov Yosscef. Shimon bar Yochai. but they were not successful.. is counterproductive. To do so. however. Le. That is why they did not succeed. You cannot simply follow your impulse with all the best of intentions in context of what is stated here. citing Ben Porat Yorcef. you must carefully determine in your mind whether or not to perform that r n i t z ~ a h ! ~ All that I have written5 are important principles "more desirable than much fine gold. . blessed be He.) 2. The wording ("I have written") indicates that this last paragraph is an addit ion by the editor of the manuscript. 5. for the author did not record his teachings. Forewor d. and not the attainment of [high] levels. Shimon bar Yochain will not succeed.zer [ h r a ] : "My sole intent with that mitzvah is but to bring gratification to the Creator. 11. 4. 4. item is an important principle. Shimon bar Yochai." With the help of God the yetzer h r a will then depart from you. Mikeitzl and Metzora:l. The decision to proceed in such circumstances requires careful consideration. See above. Nonetheless. blessed be He." (Berachot 35b) This means that they wanted to subject themselves to many self-mortifications in order to attain the level of R. this is a very serious matter. have in mind nothing but to bring gratification to the Creator.
even if they contain sacred texts (see R. even when spealung to them. Sefer Chassidim. Do not gaze at the face of people whose thoughts are not continuously attached to the Creator.5.' 1.' 13 1 "The practlce of the rrghteous 1s to suffer Insult and not to msult. 'I am greater than my fellow. for that gaze will blemish your soul. s. sect. whether it be with regard to prayer or other matters. Another important principle: When people ridicule you about your worship. This is an extension of the Talmudrc admonition not to gaze at the face of a wicked person (Megilah 28a) In the same context one should not use books written by wicked people. based on Shabbat 88b. See R. sect. to hear themselves rev~led wrthout answerrng."' (OtTot deR. do not be arrogant. 12.) 2 Haughtrness leads to forgett~ngy our Creator. Maggid Devarav Leya'akov. See above." (Marmondes. "One is not to say [in his heart]. blessed be He. Hikhot De'ot 2 3. 3. 52). Cham V~talS. Thus it is said .v. blessed be He.2 Our sages said that "man's silence leads him to humility.' Do not reply even in a positive way. ha'arer Kedushah 11.48 When you see that your worship excels that of another. 249. Akiva. so that you will not be drawn into quarrels or into haughtiness which causes one to forget the Creator. see Sohh 5a). R. your God" (Deuteronomy 814. Judah Hachassid. Dov Ber of Mezhirech. sect. as rt 1s written 'Your heart becomes haughty and you will forget God. . Dalet)' 1. do not respond.
? 2. one's whole being should be involved. I. preoccupations with the yetzer hara .. sect. See above. blessed be He. sect. idle or distracting thoughts. Intensive and joyful Torah-study helps to overcome these. and note 3 there). that for Torah-study to be effective and retained one must clearly utter the words with the mouth. All rnitzvot must be performed with joy (see above. 24). .^ 1. 10. 5 1 Torah-study must be with intensity' and great joy. but if not it will not be secure. Cf: Eruvin 54a. 119." 2. for "if it is 'ordered' in your 248 limbs it will be secure. This whole section follows upon the principle that one is affected by what one sees. 51.e. ch." (Avot deR. See above. especially when gazingwith intent." (Maimonides. foolish preoccupations.' 1. note 3..2 This will diminish alien thought^. as it is said.e. unchaste preoccupations. with all your strength and energy. . and note 1 there. to love pride or other character-traits that are evil. "Alien thoughtsn relates to any kind of sinful. those whose thoughts are attached to the Creator. "He who takes to heart the words of Torah will have negated for himself many mental preoccupations. This applies even more so to Torah-study. sect. i. 20) "Our sages thus declared that man should direct his mind and thoughts to the words of Torah and enlarge his understanding with wisdom. there is no opportunity to be arrogant. sect. ch. 44. 3.. and sect. as explained below. for unchaste thoughts prevail only in a heart devoid of wisdom. 52 When one serves God every moment. based on Kidushin 30b and Midrash Mb&i. Moreover. Hikht Issurei Bi'ah 22:21. Nathan. you ought to gaze at them and thus accrue holiness to your soul. preoccupations with idle things. 5-6. .As for fit people however.
as the Gemara (Sotah 21b) interprets the verse Wisdom shall be found from 'nothing. "The Holy One. 2. blessed is He and He and His Name are one" (tbid. Words of Torah remain only with him who makes himself as one who is nothing. make every effort to do so.'" (Job 28: 12)' This means that you are to regard yourself as if you are not in this world: thus "what is there to gain from people esteeming YOU?"^ 1. thus you must give serious consideration [to this matter] at all times. blessed IS He." as it were. I. 5-6 and 10. The Baal Shem Tov continuously emphasizes the need for observing mitzvot with kavanah (proper intent). is He. 54 When studying Torah bear in mind In whose presence you learn. sect.e. 3.' 1. are entirely one. sect. with love and fear of God. . blessed. blessed IS He" (II. Do not allow the yetzer hara to dissuade you by saying that to do so may lead you to pride. sect. 62.. material reality and pursuits mean nothing to you: you are indifferent to them and you concentrate solely on the spiritual. See below. as it is written. that God is "concentrated.' 1. "the Torah 1s l~terailyt he Name of the Holy One. See below. blessed be He. 90b) 2. 29-30.Regard yourself as nothing. sect 119. In the Torah." as the Zohar states. "The Torah and the Holy One. and the Torah 1s but the Holy One.'" 2. CJ above. See above. 'Wisdom shall be found from nothing. with deueikut.6Oa). and the notes there When desirous to perform a mitzvah. 1s called Torah.' It may happen that in your study you may be removed from the Creator. You make sure to do it anyway .
sect.' Nonetheless.. 126. and the Holy One. sect. strengthen yourself to the best of your ability. 74 and 117. sect. .2 No doubt but that ultimately you will act literally lishmah (for [the mitzvah's] own sake) without any sense of pride. will help you to act without ulterior motives. Cf: also below. Note carefully the more detailed restatement of this section. The yener hra is intent to prevent man from his religious obligations and spiritual involv ements by proposing misleading arguments of hypocrisy.Nonetheless. we have a clear refutation of the accusations of antinomianism by the opponents of the Baal Shem Tov and Chassidism. "You must strengthen yourself to the best of your abilityn to observe the mitzvot in ideal fashion. even when thinking that eventually it will be done properly. push it away with vigor and enthusiasm. below. Underlying this teaching is the principle that one must beware of the wiles of the yefzer hra. sect. and the Baal Shem Tov's teaching in filer Shem Tov. Thus one is to ignore these arguments and to do as many m i m t and good deeds as one can. In other words. do not refrain from performing the mitzvah but battle the negative thoughts that would prevent you from it. unworthiness. blessed is He. 3. and the notes there). and so forth (see below. be very careful: if a sense of pride arises in you in the midst of fulfilling [the mitzvah]. It is an established principle that he who seeks sincerely to be purified wil l be helped by God to achieve his goal (Shabbat 104a). It does not simply try to seduce man to do outright evil. for "out of shelo lishmah (doing it "not for its own saken) comes lishmah (doing "for its own saken).(Pesachim 50b) Do as many Mitzvot as you can. All that has been said above is not an excuse to simply go through the motion s of the mifzvot mechanically. though. Here. Oftentimes it will appear as a "pious sa~nt"d emanding optimum spiritualit y and belittling religious behavior that is not up to that par. Thus he states that one is to do them even if the ideal consciousness is as yet lacking (just as we saw earlier. sect. 91. 393. he recognizes an objective validity to the very act of a mitzvah. that he demanded Torah-study even when presently deficient of the sense of deveikut). again. 29-30. 2.3 You must. 4. even if they may not yet be on the ideal level of lishmah (for its own sake). as by rote.
4. say to yourself: "Why would I have any ulterior motive or pride from my prayer when I am prepared to die after two or three words?" Indeed. 4.? [In this context bear in mind that] there are many things about which some need be very scrupulous and accept upon themselves various stringencies.' 1. 4). because of the state of their soul. sect.56 If you feel a desire to fast. ch. Hilrhot De'ot. . Normative Halachah forbids arbitrary self-affliction. Bearing this in mind. See above. sect. Before praying have in mind that you are prepared to die from the kavanah (concentration) during the prayer.~ 1.' Indeed.~o netheless. 42. 55. This section is a duplication of above. Shukhan Aruch Harat). and Choshen Mishpat. 3. note 1. Hilchot Nizkei Haguf: par. Orach Chayim 1551. 571. it is a great kindness of God to g~ve me the strength to complete the prayer and remain alive. because the latter cause feelings of depressi~nN. and his Shemonah Perakim. 43. and the notes there. sect. while others need not be that s~rupulous. see there. See Maimonides. See above. and note 3 below. Orach Chayim. Some people concentrate so intensely that it may be natural for them to die after reciting bust] two or three words before God. 2. be careful not to negate that desire. sect. without self-mortifications. It is allowed (within certain limits) in context of teshuuah or other forms of spiritual selfcorrectio n (see commentators on Shulckan Artrch. blessed be He. you know that it is preferable to serve God in joy. 2. it may be assumed that you know of yourself that you need to fast because you did not yet correct your soul properly. ch.
Do so even if this may happen several times with that same level. a vessel. sect. dqnot be discouraged by your "fall. Cf: above. the kelipot ("husks. do not be discouraged by the obstacle. See below. The word per se is like the body. blessed be He. 33. 32. Again. and then contemplate on its meaning and significance. 4." forces of evil) will not let him. Another way is . blessed be His Name.. Kaudnah can be induced by physical activity of the body. One way is to pray (initially) with raised voice (see above. note 1). "The righteous lives by his faith. with perfect faith. with all your strength. In the gradual ascent.e. At first say the "body" of the word. 72 and 86. See the parable below. the proper thought and concentration when reciting the word. 5. Cf: Gter Shem Tov." (Genesis 3:24) When a person wishes to attach his thoughts to the supernal worlds. that "the whole earth is full of His glory" (Isaiah 6:3)2--and this is when you are in the Supernal World. first recite each word. to the Creator. 84 and 137. sect. Nonetheless. 2. in spite of the obstacle." (Habakuk 2:4)3 Even if you may have fallen from your level in that prayer. infuses it with its soul. sect. I. recite the words with lesser kavanah (concentration) to the best of your ability. Man's kavanah. 17 and 284. in order that the power of the soul shine forth in Thus it is said in the Zohar (III:166b and 168a) that a 1. Thus it is written. sect. Keep trying as hard as you can and eventually you will succeed. and then invest it with its At first you must bestir yourself with your body." but gradually work your way up again. sect.58 There is "a flaming sword that revolves to guard the path to the Tree of Life.' Strengthen yourself in believing. you must force yourself with all your strength many times in one and the same prayer and attach yourself to the Creator. 3. and then strengthen yourself to return to your level. Thus you will enter the supernal worlds.
The Talmud (Berochot 32b) states that prayer requlres vigor or exertion. So. 33.e ct.~ .C hrdirshei Aggadot. sect. you must guard yourself against any movements. blessed be He. the kelipor and alien thoughts which come to prevent him from having his mind on his prayer. therefore. See above." (Kear Shem TOUs. so that your deveikut (attachment) will not cease. sect. I e . sect. observers will surely not laugh at hinl and his motions. and see below.wooden beam that will not burn should be splintered and it will become aflame. 2 "At the begnnlng (of the Amrdah. R Davld . too. 33. In the state of deueikut. ad loc. one should not mock him when he tries to save himself from the 'evil waters'-i. to the Creator.. 68). 60-61 It is impossible to pray with kaoatzah (devotion) without exertion. even with the body.' 1. sect. sect.. and gesticulates in the water to extricate himself from the waters that sweep him away. 215) 6. open my 11ps and my mouth shall declare Your prase' (Psalms 51. that one must always strengthen hunself. Conscious movements. Afterward you will be able to worship with the mind alone. 58.' You must entreat God for help and assi~tance. "when a person is drowning in a river.1. swaying to and fro during prayer (Shukhn Ari~hO.17) " (Berachot 4b) The reason 1s to entreat God for help and assistance to be able to pray properly (see R Samuel Edel~s. without any movements of the body. Nonetheless. 59 and 104-105. 226).e. Kerer Shern Tov. rach Chayirn 48:l. wrth all hn energy. the essential prayer) one has to say 'God. and below. Sometimes. sect. notes 5-6.6 p~ ~~ bodily movements. and below. when you are attached to the Supernal World. See above. Ideally one should reach a stage of deueikut in which the prayers arc recited in an undertone and immobile in the consciousness of standing before God (see above. would be disruptive and counter-productrve to deveikut. sect. physlcal reality 1s transcended. 104-105.
240 and 279. 5. Ha'emunah Vehabitachon.]. all worldly desireslet alone evil character-traits-are despised in one's heart and eyes. 146. note 3). 400. you feel weak and the deveikut is lost. who is for me? [And if I am for myself. what can you do? Pray to the best of your ability with lesser kavanah until the end ofAleinu [i. 199.) As sated earlier.-The Baal Shem Tov defines this: no longer to sense the feelings of the body and this world. and God will indeed help him (above.e ct. cited in Keler Shem Tov.e. 55. the concluding p~ayer]. Cf: Zohar I:243b: "[R. Your thoughts are but on the supernal worlds. sect. unaware of your existence in this world. Cf: also Maggid Devarav Lep'akov.~ Abudraham. or he is in distress and unable to recount the praises of his Master?' [R. Shulchan Amch. sect. and note 14 there). and $ Nachmanides. Shemonei Esrei. Orach Chayim 98:l. sect. I will certainly have no fear of alien thoughts. Abudraham. For when I am divested of this world. and see there also sect. in the end. on the spiritual reality underlying everything. and are totally meaningless in view of one's longing for the Creator.'" 62 "If I am not for myself. sect. Yosse] answered him: 'He may not be able to concentrate his heart and mind. 'When I reach the level that I am altogether unaware whether I am in this world or not.' That is to say.239 and 284.Consider that it is to your benefit when God helps you to have complete kavanah for half or most of your prayer.. 3. alien thoughts 1. (fikr Shem KJVs. what am I?. and you vest your mind and soul into these thoughts. s. ch. Chizkiyah asked:] What of a person whose heart is troubled and he wishes to pray." (Avot 1:14) When praying one must be like divested from physical reality. If. but why should the order of his Master's praises be diminished? He is to recount the praises of his Master in spite of his inability to concentrate.) . 43. and then pray. one may place his trust in God to enable him to do mitzvot (above.v..
sect. when I regard myself as something substantial and real In this world. sect. See.2 At times. and of what value is my service before God? For then alien thoughts will disturb me and I am as nothing in thls world. When you want to seclude yourself [with God]. .' a companion should be with you. as he reduced himself to naught. though.e."= This is the meaning of "who is for me?. each one secluding himself on his own with the Creator... 2. "that no other person be there. you can practice solitude even in a house full of pe~ple. as also the thoughts of another." i.4 2. The principal purpose of man's creation in this world is service [of God]. for even the chirping of birds can interfere. he is unassaila ble by alien thoughts or negative forces. This is the meaning of "what am I?.~ 1. sect. 3. Keler Shem Tov. that hitbodedut (meditation in seclusion) is an effectiv e way to attain deveikut. that the pursuit of deveikut beyond the periods of prayer is better in total seclusion. sect." 3.3 but I am unable to perform His service because alien thoughts disturb me. Two people should be in the room. See below. beiow. 82.will not approach me. 216.. In the state of self-negation (4 above. Kidushill 82a 4. In the state ofdeveikut one is oblivious to all surroundings. See also the shorter version of this section.e. Moreover. what alien thought will come to me? But "If I am for myself. It is dangerous to do so alone. then 1 am really as of no value at all." i." i. when attached [to God]. 53) he is indifferent to worldl y concerns and desires.e. blessed be He. 97. of what significance am I.
is for the sake of an "ascent. and Egypt signifies the kelipot ("husks. At other times this fall may be caused by the environment.. and promising him every manner of blessing. He caused a famine in the land which forced Abraham to descend to Egypt. however. So. The "descent". because God knows that you need this. note 1. thus motiva te him to make a greater effort to regain his loss and attain yet higher levels." forces of evil)4 1. These two reading converge in the Baal Shem Tov's interpretation of this verse with a parable of a father teaching his child to walk: every time the child takes two or three steps toward the father. Others (Targum. Thus "He will guide us to death." Still others (see Ibn Ezra) read the one word almut to be derived from helem. reduction in rank is tantamount to death (Tanchuma. Zohar III:135b: "The term death applies to anyone who was lowered from the earlier level he had"). Lerh: 5. i. "He will guide us a1 muth (lit. This will surely cause him to be disturbed. God tested Abraham: right after telling him to move to the Holy Land. quoted by Rashi).e. in order that he bestir himself to greater ascents.." i. Rimzei Rosh Hashanah. "And Abram descended to Egypt" (Genesis 12:lO) and "Abram ascended from Egypt" (Genesis 13:1)? Abram signifies the soul (Zohar I:122b). He does not realize that he has not yet reached his full potential. . Degradation. a concealment of God.e. 237. concealment. to reach a higher level." (Psalms 48:15)2 It is also written.Sometimes one may fall from his level on his own. to death). Vayech i: 2. whether or not he would question the original command and promises (Tamhma.) read al-mu& as one word which means "youth. 2. 3.. (Kpdushat Levi on Exodus 3: 11. too. to redu ction in rank. 67. By attaining spiritual levels one may feel content with that achievement." i. the father distances himself in order to make the child walk further. in order that we make an effort to ascend higher. more extensively in Turei Zahau.' Thus it is written. God is the "hiding God" (Isaiah 45:15) in order that one come yet closer to Him.e.) There is then a "falln for man. Thus he will "fall" to a lower level. and briefly in Keler Shem Tov. See below. sect. Rashi etc. childhood.. sect. This ordeal was a test of Abraham's faith.
31. Tiklrnim:llBc) You must perform your deeds in a concealed manner.' Otherwise. 132).2 Your [good] intention of lishmah (for its own sake) may thus 1. his soul and all his possessions.A test (nisuyon) is meant to ekvate the person: "&mot-in order to test you" (Exodus 20:17). This section cautions.When the soul is saved from that 'evil officer' .' that is. I f : Zohr I:140a. and is indifferent to being recognized or esteemed by others for his good deeds (see below.). The best intentions. " (Zohr Chadash. "What is the meaning of 'Abram ascended from Egypt'?. 99 etc. the lung of the oppressors that distress the souls. Cf: Keter Shem Tov. ." returning enriched both spiritually and materially. 95.. quoted by Rashi. therefore. sect.g. sect. and already discussed earlier at length by Maimonides (Shemonah Perakim. 2. 4. what is written of the masters of the soul? 'Abram ascended from Egypt'! He is raised beyond them. the demons . though. and below.. thus "Abram ascended from Egypt. wili prove counter-productive. scrupulous commitment to Halachah. 9. if you act openly like [the rest ofl the world. by acting in the unrefined manner of the masses before attaining a high level. 27 and 151. The concealed form of worship is a sign of sincerity... the 'king of Egypt. ch.. sect. you may be drawn to become like [the rest of] the world. the destructive angels. 122)..e. It shows that man thinks but of God alone. The Baal Shem Tov thus cautions that you must first prove yourselfwith normative religious behavior. This is a continuously repea ted principle in Sefer Hachinitch (e. i. that before being able to choose this path you must first assure that you have reached a high level of thorough training and commitment to act properly. 16. 4). 40. i t .. and only inwardly seek to be pious. A person is influenced by his deeds and actions. may condition a person to become like them. before trying to become a "secret" or "hidden" saint. with great strength-he. sect. Bachodesh: ch. so that people will not note your piety. To pretend to be a simpleton. But before you reach a high level you must act openly. to elevate and magnify you (Mechilta. Abraham did not waver in his faith. .
The state of fear or awe is attained by contemplating God's majesty. "'Fear of God is the beginning of wisdom . or reverence. for surely without entering that gate one will never gain access to the Supreme King.) There is. as in the presently stated condition. sect.' for it is the gate to enter before God. with ulterior motives). His great and wondrous works and creations. and below." (Pesachim 50h." When you wish to pray. and then you will be able to enter the supernal worlds.e. of God. Hilchot Yessodei Habrah 2:l-2 and 4:12) This contemplation is a prerequisite to prayer when one must be aware "before whom you standn (Berachot 28b). that it is done] shelo Eishmah (not for its own sake)? 3.. ." Contemplate His greatness and exaltedness. also the danger. (Maimonides. "to think of the exaltedness of God and the lowliness of mann (Shulchan Aruch. and 6 Shbbat 31b) 3. first bring yourself to a state of awe. It goes through stages of ebb and flow. that "out of doing it lishmah one may come to act shelo Ikhmah. Fear. though. "One should always occupy oneself with Torah and mitzvot though it is yet shelo lirhmah (not for its own sake. 2.' (Psalms 111:10). "ratzo veshov-running (ad . without any ulterior motives)." (Zohar 1:7b.2 Say in your heart: "To whom do I wish to attach myself? To the One who created all worlds by His word. . sect. for out of shelo lishmah one will [eventually] come [to doing it] lishmah (for its own sake.result in [the very opposite thereof." limited or restricted consciousness):' he does not enter 1. see above. Orach Chayim 98:l). 'This is the gate to God' (Psalms 118:20).' 1. 55. i. gives them existence and sustains them. and realizing one's own insignificance. 126. Man's consciousness cannot always concentrate on the ideal level of sublime deveikut. . Sometimes a person worships in a state of katnut ("smallness. .
sect. ~ tess sence or soul is kauanah. as it were. See also below. they are in principle unavoid able: it is impossible to remain in a constant state of ideal dewikut. too. are merely the body of prayer. sect. 121). 111. as explained here. Prayer is zivug (coupling) with the Shechinah. 137. Thus we see that if there remains a single spark among coals it can be blown up to become a great flame. sect. 69. so. Nonetheless. here are "C~lls"( descents) from the state ofgadlut ("greatness. The words of prayer must be articuldted (Berachot 31a." (Likkutin~Y ekarim." expanded consciousness) to katntrt that may come about by one's own doing or as part of the natural phases through which the soul passes. 217) The aforementioned consciousness of Divine omnipresence is itself a degree of dewikut. and that he is close to [God]. sect. sect. however . this does not mean that deveikut itself has to cease altogether: there is an ebb and flow from one stage to another. is directed to [the fact that] "the whole earth is full of His glory" (Isaiah 6:3). In fact. or (b) as a "descent for the purpose o f subsequent ascent" (see above. the mental ~nvolvement and concentration (see above. 3. sect. "Even when you 'fall' from your level. The words. By virtue of that kamut you can come togadlut. however. albeit on the level ofkafnul. These are not necessarily failures: they may happen (a)in order that the soul "regenerate" itself.' Just as there IS motion at the beginning of coupling. remain attached to the Creator albeit with a small thought..-See below. At the same time. however. His thought. 64). Even in the state of katnut one can easily remain conscious of the omniprcsen ce of God. sect. one must 1. 2. he does so with great deveik~t. though worshipping on a level of katnut. Zohar III. because that deveikut would then turn into something common and natural and would not be appreciated-for "continuous delight ceases to be delight" (see below.294b).* In that state he is like a child whose mind is but slight and not yet developed. further on. 171. Ketrr Shrn Tov. thus also one's own closeness to God at all times.~ vancing to absorption in spirituality) and returning (recoiling to mundane reality)" (Ezekiel 1~14)T. and Keler Shrn Tov.the supernal worlds at all. 58) Prayer is . sect.
3. sect. however. you can attain great bestirment. note 42. 2. sect. Keter Shem Tov.e. sect. therefore. 67. Thus you can ascend from katnut togadlut.'" (Maimonides. the Shechinah. Thereafter one can stand still. 2. For you think to yourself: "Why do I move myself? Presumably it is because the Shechinah surely stands before me. and Zohar II1:247b). Prayer thus expresses the soul's longing for Divinity ("My soul thirsts for You. that is where he is himself. You may be in a state of katnut ("smallness. you will then think of the Supernal World. 58-59. and absorption in. 1. See above.. without motion.2 As a result of your swaying. rf. Man himself. sect. is where his thoughts are.move (sway) at the beginning of prayer. 104-105. therefore. as Solomon expressed it allegorically (Song 2:s) 'I am sick with love. rapture). (This oft-cited concept of the Baal Shem Tov appears also in a modified version: "Wherever the person's will and thought are." restricted consciousness) with great attachment to the Shechinah." fiter Shem Tov. you would not have thought of it at all. prayer is "zivug with the Shechinah" (see Zohar II:200b and 216b." the depth of man's heart and soul seeking union with. its ultimate root and source. 16 and 362).) . Man is identical with his thought (Tikunei Zohar 21:63a.' If. Hikhot Teshuvah 10:3) In the metaphorical terminology of the Kabbalah. and below." Psalms 63:3).. sect. attached to the Shechinah with great deveikut.2 For a person is where his thought Thus if you had not been in that upper world. you will instantaneously be in the upper worlds." This will effect in you a state of great hitlahavut (enthusiasm. "deep calling unto deep. See above. "being bonded to the love of God. Addenda. continuously enraptured by it like the love-sick whose mind is never free from hi passion. i. 38. my flesh longs for You.
sect. leads to unity with their inherent Divinity: a state of deveikut. sect. See Keter Shem Tov.' 1. the evil mind and alien thoughts opposed to holine ss. The Baal Shem Tov interprets dimilich as an idiom of the root-word damam (to keep silent). my beloved (it is better to stop praying until that impediment is removed). 7). This is the meaning of "[My love. 71 If you have an alien thought when praying. The lights of the letters are 'chambers' of God into which He draws His emanations. 64. dimitich (I compare you)] to a horse in the chariot of Pharaoh." forces of evil) is riding on [your] utterances. 5:20b and 47:84b): they are the "vehicle" subservient to. . . the rider (the soul. Pharaoh signifies kelipah. ibid.e.. place your whole thought into the power of the words you articulate until you perceive how the [Divine] lights in the words become enkindled from one another. Note Maggid Devarav Leya'akov. therefore. attachment and cleaving unto God that one does not want to let go of. for thought rides upon the [words ofj speech. 46-47 ($ Kerer Shem Tov. taking him to places he is unable to reach on his own (see Maggid Devarav Leya'akov. rides upon them.Deveikut means that when saying a word you prolong that word extensively. then "my love. and guided by." (Song 1:9) Words are referred to as horses. i t . alien thoughts ride it). 284): "When praying. Heaven forbid. draw it out. By virtue of deveikut you do not want to let go of that word and. then dimiri chI silence you. 44 and 192. sect. man's thoughts and mind). Cf: above. sect. note 4. dimitich": it is better to be ~ilent. The words and letters of the Torah and prayers are compared to "horses" (Tikunei Zohar 8a.. kelipah ("husk. therefore. 2. Addenda." The concentration on the words.~ 1. The proof-text thus reads: if the "horse" (the words of prayer) is in the chariot of Pharaoh (i. the allen thought. thus generating various lights. 3.' When Pharaoh. sect.
sect.5 4. See above. 1. when [you feel that you are] unable to pray. as is well known. s. Strengthen yourself all the more1 and the awe [of God] will come upon you ever more. [they enter] the heart of Above. uttered with k a v a ~ ahn d fervo r. Sha'ar 13. Thus fortif. ofwhich the Zohar states that "he who exhales. Those who are wise recognize him by hls mannerisms. . his innermost vitality. (p. Those who are less wise recognize the king by noting the place with extraordinary guarding: surely that is the place of the lung. Breath comes from exhaling.. Sob)."4 i. from his inwardness. lev tov. Sometimes. You must know that there is additional guarding all around the King. do not believe that you are definitely unable to pray that day. see there. 5. The King is there. Words that ascend are those which are fonned by the "exhalation" rooted in the very core of man's heart. 58 and 60-61. 2.On the other hand.3 Thus it is when you are unable to pray with kavanah. great strength and additional kavanah. Awe of God is a prerequisite for proper prayer (above.v..e. You will then be able to pray with exceeding kavanah. sect." i. i.. so that you will be able to come close and pray before God. 86. exhales from within himself.e. sect. "words that come from the heart enter the heart. Sha'ar Ha'otiot. cited in Shenei Luchot Haberit.2 This is comparable to a king who sets out to wage war and disguises himself. 66).e. Tam). but you are unable to approach Him because of the special protection surrounding Him. A popular proverb stated in Sefer Hayashar (attributed to R. by means of the breath. l yourself with awe. 3. This parable is cited again below.
and the numerous parallel passages). do so for the sake of the "heaviness in the Head. Emphasis on personal desires.c. Rosh Harhanah 16b. that appears frequently in Talmud and Midrash (Sanhedrin 46a. i. therefore. The Shechinah is referred to as "Head" (seeZohar III:187a). thus draws attention to his sins and failures (see Berachol 32b. essentially based on Isaiah 63:9 and Psalnls 91:15. Nonetheless. 5. reflect. By implication. applies to the Whole as well. Koved rosh... may be counterproductive: it causes a celestial "auditn of the supplicant's record. Sgie on Numbers 10:35. 4. an analogous condition Above." For whatever you lack. sufrering is sensed by the soul (the "limb" of the Shechi . [as ~t For man is a "part of God from on high. Midrash Tehilim 20:l. Tiktrnei Zohar 3b). He who does not pray dally for sustenance 1s of little falth (Zohar II:62a-b) . To beseech God for our constant needs IS an expression of our bel~efin God and Divine Providence."4 Any deficiency in a part. "heaviness of the head.2 If you wish to pray.e. this concept must be placed in the wider context of ultimate reality where events and conditions on earth reflect spiritual "events and conditions.) 3.e. an acknowledgment of Divine sovereignty and our continuous dependence on God for everything we have and require. This is the anthropomorphic concept of Divine pathos.' 1. in it s literal meaning of "heaviness of the head.. Deficiencies and suffering on earth. soul-less) body does not feel pain or sense any needs. I. and the Whole senses the deficiency of the part. Job 31:2. it is not the ideal prayer. expecting that God will grant these desires as compensation due for praying. Mechilla on Exodus 1241 and 17:15. therefore. in the Shechinah. then.73 "One should not rise to pray but with koved rosh (lit." would thus refer to the afflicitive heaviness of the Shechinah." humility). as it were. let alone pre sumptuous "calculation on prayer" (iyun @/ah). Every soul is a spark or "limb" of the Shechinah (Zohr III:17a and 231b). 2." (Beracht 30b) This means: do not pray for that which you lack1 for then your prayer will not be acceptable.. The lifeless (i. The Shechinah is the very root and source of all souls (Zohr I:25a." This section explains this wider context and its implications. and the commentaries ad lor. the sufferings the Shechinah shares with man. that same deficiency is in the Skechinah.
the Sltechinah). therefore. If the pain or deficiency IS sensed by the part. Nonetheless. he has ceased to be wise. and see also Maggid Deuarau Leya'akou. Likkutim) Even so. the other (Tikunei Zohar 6:Za) refers to those who pray for their personal or material needs as "arrogant dogs. note 1) states that one must pray daily for personal needs. Selah' (Psalms 3:9).. God examin es the heart and knows the truth. sect. by the indi vidual extension of the Shechinah." (Likkutim Yekarim.6 This is the meaning of "but mitoch koved rosh (because of the 'heaviness in the Head'). 53. pray for all and any needs. should be for the deficiency in the Whole." nah). barking hau hau-give us food"! The Baal Shem Tov explains: One may. if for no other reason but the acknowledgment and consciousness of Divine sovereignty and every thing's total and continuous dependence on God." (Psalms 36:4-5) ." by the Shechinah per se. indeed must.) In this context the Baal Shem Tov resolves two contradictory passages: one (cited above. for "as his prayer is answered and 'Salvation is [wrought] unto God (i. Better to be honest and pray for yourself than the falsehood of pretending concern for the Shechinah! (Keter Shem Tov. sect. Prayer on behalf of the Shechinah (the 'Wholen) of itself covers the problems or needs of man (the part of the 'Whole"). not the body. to do good. 6. the Baal Shem Tov cautions: "The worker of deceit shall not dwell in My house. never pretend to pray for the sake of the Shechinah. (Degel Machaneh Ephrayim. sect. 123.e.Your prayer." (Psalms 101:7) Thus when overcome by the anguish of personal needs and unable to rise above this. he who tells lies has no place before My eyes. it is sensed also by the 'Whole. 395) "The words of his mouth are evil and deceit. one is not to lose perspective: do not get carried away by transien t details instead of concentrating on the whole.' this brings about also the conclusion of that verse that Your blessing is upon Your people.
there is no remedy. and how to worship Him. blessed be He."' The second one is blinded by the yetzer hara and imagines himself to be altogether righteous. He is unaware of the essential form of worship that is required for proper [Torah]-study and prayer. thus how can he return with teshuvah? Thus when the yetzer hara seduces man to cornnut a sin. For the second one.' 1. however. 78 and 114. 2. and to perform a commandment lishmah (for its own sake). to entice man. Their sense of self-righteousness thus preclude s them from teshuvah. however. He is righteous in his own eyes. as well as the perfect faith that is required for constant attachment unto Him. He may study Torah continuously. sect. who might not succumb to blatant sin. Torah-scholars. "he knows his Master yet purposely sets out to rebel against him. beggng God to show him "the way where light dwells" (Job 38:19). 117. A Midrashic expression for one who brazenly acts wickedly (Sijia. 55. pray and afflict himself. blessed be He. blessed be He. and also appears as such to people. The yetzer hara disguises himself as yetzer tow. The first is altogether wicked. he will make it appear to hlm as though he has performed a mitzvah so that he will never repent. sect. his effort is all for naught. and the notes there. See bclow. Cf: above. as an advocate for good. His greatness. sect. cited by Rashi on Genesis 10:9). Bechukotay. Simple people he leads to blatant sins. because he lacks attachment [deveikut] to the Creator.There are two types of [wicked] people. The difference between these [two] is as follows: The altogether wicked one can be cured from his affliction: when he is bestirred by the sense of teshuvah and returns to God with all his heart. Keter Shem Tow. In truth. . he leads to sanctimoniousness by urging them to study Torah and perform mitzwot in an inappropriate way. His eyes are bedaubed from seeing the Creator. He approaches each one on his own level.
and a review of.. note 2. his spiritual record and status (Berachot 32b and Rosh Hashanah 16b). . sect. for a similar interpretation of our proof-text. "recalls his sins* by drawing celestial attention to. . said: "Make a light for the teivah (ark) [and finish it to (the width of) an amah (cubit) on high .e. Israel Baal Shem [Tov].6 That is. Every letter harbors Or Ein Sof (a light of the Infinite)." 2. as stated above. Teivah also means "word. the words of the yetzer hara. to do good. sect.) 75 R.. Every word is a "complete structure" (above.' All this is the enticement of the yetzer hara. 118). sect. 4. Thus "he4 has ceased to be wise. He does not realize that this only recalls his sins. souls and Divinity. which is its individual aspect of Shechinah (Divine Indwelling). sect. he prays to God to heal his illness by virtue of the Torah and Mitzvot he had performed. 34). "he devises evil on his bed" (Psalms 36:5)."2 These ascend and become bound up and united with one another. 5.This is alluded in the verse "The words of his mouth3 are evil and deceit": the yetzer hara deceives a person by malung it seem to him that his transgression is a mitzvah. 3. 124. for another emphasis on the pitfalls of self-righteousness. l. sect." i. 6. The verse following immediately upon our proof-text. 1. See als o below." (Genesis 616) This means that the teivah (word)' should shine. The victim of the yetzer hara. [This will be understood by the following:] Every letter contains "worlds.5 More serious yet. [the yetzer hara] deceives him further as follows: when he falls [ill and is] bedridden. 73. 117. every letter a "compl ete world" (below. he has left off from ever repenting. . (Cfa:b ove. Quite clearly this will not be to his benefit. Man's expectation that God grant his wishes as compensation due for his merits.I. See below. peace be upon him.e. 7.
" the second one to the aspect of "Souls. by the Baa1 Shem Tov's grandson and disciple R. compounding the Worlds of Beri'ah. (b)the second level of Divine concealment which is referred to as the World of Atzilrrt. it is cited also.e." is. 1. the intermediary facultjcs). 175. The letters then unite and become bound together to form a word [teivah]. sect. p. to make it possible for the or to be contained in the keli. sect." R." the Divine lights). note 1. however. Sha'ar XDL See filer Shem Tov. R. [This is the Baal Shem Tov's terminology for what R.). Yefzirah andhiyah. in Degel Machaneh Ephrayim.^ All worlds will then be unified as one and ascend. must include his soul in each of these aspect^. as the (relatively) finite keli is to contain the infinite or. and this effects immeasurably great joy and delight. there is need for an int ermediary to bring them together.] .with Divinity. Mosheh Zaccuto that these are (a)the first "world" (level) of Divine concealment which is referred to as Adam Kadrnon.." See Degel Machaneh Ephrayim.1 3. relates the three levels in the ark to the individual Worlds of Beri'ah. 5. in current editions. second and third [stories]" (ibid. The bottom floor refers to the aspect of "Worlds. blessed is He. needs a keli (vessel) to contain it. Chaim Vita l. 276. Isaac Luria refers to as "oror (lights)-rritzofrim (sparks)-keilim (vessels). Mosheh Chaim Ephraim of Sydilkov." i. [Shenei Luchot Haberit. See there the commentary of R. and Elokut ("Divinity. sect. Man. and (c)the third level of ever-increasing concealment. souls and Divin[for "The Holy One. 42. 6.. Parshat No'ach (p. neshatnol ("souls. No'ach.] has three worlds [in which He is concealed]'"Zohr III:159a 7). Yelzirah and Arsiyah. This whole paragraph appears also (nearly verbatim) in the Baal Shem Tov's famous letter to his brother-in-law. This intermediary is referred to as neshamah (soul). p. 9dJ). Thus each letter compounds olamot ("worlds. Addenda." and the third (upper) one to the "Divine Lights. with elaboration. therefore. No'ach. Moreover. The or (light). see Keter Shem Tov. becoming truly unified in Divinity.4 This is the meaning of "[make it with] bottom. Abraham Gershon of Kitov. the "vessels"). 4. Eitz Chayim. lb. referring to "worlds. See above.
8. a case of "he that murmurs separates the Master [of the universe] . because it is the Shechinah [Herselfj. the aspect of Divine transcendence) and the Shechinah (the aspect of Divine immanence).With every word you must hear what you say. 43. sect." The Kabbalistic term ima (mother) is synonymous with Shechimh.. It causes a separation between the "Master of the Universe" (the Holy One. level or category. 1. that it emerges with brightnesss and to bring gratification to your Maker. [See above. Human speech is a manifestation of the soul. Zohur III:3la." who speaks.9 Without faith. that you make a light for the word. as the Shechinah is referred to as "true faithfulnessn (Isaiah 25:l. Benishif:lOd). This requires great faith. Heaven forbid. The Kabbalah. which Targum Onkebs and Targum Yehonathan translate: "ru'ach memalala-a speaking spirit* (see Rashi and Nachmanides on this verse).e.. 9. note 4). it is. you make it shine brightly (as stat ed above. by uttering it in proper manner. two levels of the Divine manifestation that is called Shechinah: (a)imah ila'ah. which corresponds to the Sefirah ofMalchut. General reference to Shechinah. 73. and 6 Zohar Chadash.e. you must be conscious with true faith of the presence of. blessed is He. i. therefore.' provided that [the word] has a "light. see Zohar I:22a and III:16b). which in the sphere of the Sefimt corresponds to Binah."" 7. raise the prayer) to imah. When that soul was infused into the body of the original human.: a living being)" (Genesis 2:7). thus rooted in the Shechinah. the supernal "mother" (supernal Shechinah).] 11. 10. "man became a nefesh chayah (lit. sect. the Shechinah. notes 7-8.. "Finish it (i. The term "world(s)" in Kabbalistic and Chassidic thought does not refer to geographic areas but to a spiritual realm. Man's soul is a spark or "limb" of the Shechinah (see above.e." (Proverbs 1 6:28)1° [The concluding phrase] "finish it to an amah (cubit) on high" means "to imah (the 'mother'). however. in the first paragraph). and relations hip with.. The Shechinah. is referred to as the "World of Speech" (see Zohar 1II:228b and 23k. the "World of Speech.e. speaks of imah on two levels. the lower "mother" (lower Shechinah)." i. . and (b)imah tata'ah. 1. Tikunei Zohar 2b and 5a.e. on the concepts of the unity and separation between the aspects of Divine transcendence and Divine immanence..
open my lips . (R. thus the "lower Shechinah". The brightness there is very great. Joseph Gikatilla." relates to imah tata'ah. ["Prayer is speech. Thus. in any case." As the prayer is infused with true devotion (kavanah) a ascends on high to the "supernal recess" (the Sefirah Bimh.] The same prayer concludes with the verse "May the words of my mouth and the meditations of my heart be to ratzon (find favor) before You. open my lips and nry mouth will declare Your praise" (Psalms 51:17). That is.e. Ratzon signifies the highest S$rah (Gter)."'Z and especially in terms of 'World of Speech. "Meritorious is the mouth that by prayer provides a resting-place for the Shechinah. 'We raise the World of Speech to the World of Thought. The principal prayer (the Amidah) starts with the verse "A-D-N-P (My Lord). . analogous to the sun which we are unable to gaze at because of ILS intense brightness." (Maaid Devarav Leya'akov. indeed are unable to) see it ascend to the higher realm" which. whence they ascend further on their own.. The term A-D-N-Y signifies the lowest Sefirah (Malrhut). .." Tikunei Zohar 2b. sect. just as one is not able to look at the sun." 12.. one does not see it ascend to the higher realm. cited in Keter Shem Too. 160. the Sefir ah of Malchur. God. Tikunim." (Psalms 19:15). Sha'arei Oruh. The speech of prayer. 101d) This is the ultimate conclusion of prayer. it is the Shechinah. The mystery of speech is 'A-D-N-Y. When praying we raise the words of the prayer from Malchut (the World of Speech) to B i d (the World of Thought). sect. as it is said 'you makc the mother lie down (rest) between the lips' (Psalms 68:14. is beyond our grasp. 400. This is the meaning of "finish it on high. to make the 'supernal mother' rest between them.. end of Sha'ar 11) Thus "you do not (need not. it is A-D-N-Y. IS on the level of the "lower Shechinah." (Zohar Chadash. the "supernal mother" or "supernal Shechinah") "whence issue all blessings and all freedom to sustain everything" (Zohar 1:229a). the World of Speech. interpreting the word im (if) to read eim (mother-ee Tik~rneZi ohar 18:34a). and see also Zohar III:228b. "finish it to the imah.) . . on high.. therefore.Alternatively one can interpret as follows: Once the word has left your mouth there is no need to mind it any more. i.
the moment you separate yourself from your deveikut (attachment. Shulchan Aruch. i. or worship of God)..e.. body and mind. and this is tantamount to idolatry. 33-34 and 60-61.One can achieve this by "Come into the teivah. the way of God." .e. Israel Baal Shem [Tov] : "For My thoughts are not your thoughts.." (Deuteronomy 11: 16)2 Nonetheless... 228. you are worshipping idolatry.e.e.1 2.. 1. it is as if you serve 'other gods." (Isaiah 55%) This means: the moment you separate yourself from God. neither are your ways My ways.e. [A teaching] of R. even in all your personal and physical pursuits and engagements (Maimonides.I3 13. (Me'or Einayim. I. by concentrating on the words of prayer with your whole being. the moment "you turn astrayn-"you serve other gods. CJ: above. [R.. then) your ways are not My ways (i. to forget the obligation of "Acknowledge Him in all your ways" (Proverbs 3:6)-i. I.' God is the sole true reality . with all of your body and strength. This is the meaning of "you turn astray and you serve [other gods] .' There is no middle ground. sect. you with all your familyn (Genesis 7:1).e. To ignore this principle.e. they are not hound to God. Shemot)] The Baal Shem Tov thus reads our proof-text: 'When your thoughts are not My thoughts (i. it is accounted to 1. Hilchot De'ot 3:3. sect." (Cf: Maggid Devarav Leya'akov. bond) with God. everything is continuously dependent on God for its very existence. Orach Chayim: 231)-is like denying this principle and setting up an authority or power independent of God. Menachem Nachum of Czernobyl notes that the Baal Shem Tov would frequently cite this interpretation of Deuteronomy 11:16. the Talmud states (Makot 23b) that "he who refrains from committing a transgression.
sect 43."' 3.' Rather think to yourself: "Of what esteem are my deeds compared to the service of the angels whose service of God is constant? I am but a 'putrld drop'2 and my end is unto dust!" 1 See above. Indeed. again. and at the end of the last day your harbored an ultenor mottve ." the s~deop posed to holmess) 2 Auot3. Then. note 2 "for then 'your ways are not My ways'"). btrl My ways": when you overcome the temptation to commit a transgression. even the slightest. and that the fasting will greatly purify you. on the proper medttat~ons when fast~ng Ultertor mottves. sect 188. sect. thus "not [following] your ways. Do not say in your heart that you are doing something great by afflicting yourself that much.e.him as if had performed a mitzvah. let alone a sense of self-sattsfactton In thlnlung to have attamed sp~rttualh etghts and perfection. "If you fasted from one Shabbat to the next.. The last sentence may be a summary of the general principle stated in the first paragraph (as rendered above. you have lost all the good stored for you from your fast and your effort was for naught. it may relate specifically to the second paragraph by interpreting it "and not your ways.1 78-79 In the middle of the week' the yetzer hara will sometimes over-power you. are the very antt-thests of D~vinew orshtp (see above. from one Shabbat to the next . do not harbor ulterior thoughts. 196) The parallel-passage of thts section tn Ltkkutrm Yekanm. sect 11-12). 77 When you fast." 'This is the meaning of ''your ways are not My ways." it is accounted to you as if you had performed a mitzvah (i. even if it be from one Shabbat until the next. it is "My ways. by making it seem to you that your fasting is 1.")." (Magtd Deuarau Leya'akov. When fasting a whole week. thus adds here "Thls fast goes to the srtra achara" (the "other side.
sect. See above. 43. but as you over-power him. This does not imply that you should have in mind the attainment of a higher level. 9. the side of evil) is subdued for the sake of His service. If you are wise and over-power the yetzer [hara].very difficult for you. 3. 47). See above. Beseech the mercies of the Creator. 77. Rather. and which prompted you to undertake the fast. sect. blessed is He. Thus it is said in the Zohar (II:128b and 184a). at the conclusion of the fast. sect. text relating to note 11. for that would be counter-productive (as stated above.4 The yetzer hara is sometimes allowed to cause you great pain. blessed be He. This . that you no longer sense the great pain you felt at the time. the yetrer hara does not want you to acquire the purifi cation for which you felt a need in context of teshuvah (return and attachment to God). and 4 sect. the sitra achara is very much subdued.? Understand that the yetzer [hara] is envious of you. 43. Sometimes you need to gaze in different directions in order to attach your thought to the Creator. and saying that you are unable to bear it. you will effect something great on high. This happens to test you whether you will persist and over-power the yetzer hara. sect." The yetzer [hara] greatly desires to prevent you from fasting. "The glory of the Holy One. you will note] afterwards. [If you do so. is increased when that sitra achara (other side. lest you attain a [higher] leveL3 That is why he instigates so much against you. See above. 4. 5. to strengthen your eyes so that they will not be affected adversely by your fasting5 2. blessed be He.
blessed be He. the principle of "Acknowledge Him in all your ways" (Proverbs 3%. 11.' 1. the mystical meanings of the Torah. and in that state of attachment pray for some need of your household. The principle that hithdedut is conducive to dewikut is stated already in Reishit Chochmah. CJ above. An important principle: Attach yourself to the Creator.' ~1. ch . sect. and 76. however. sect.' by writing "secrets of the Torah. This will acclimate you to the reverse: you will be able to invoke deveikrct during times of mundane involvements. Thus you must work your way into it. 3 and 10. C' above.is necessitated by the materiality of the body which is an obstructing barrier to the soul. 140. One merits deveikut by hitbodedut (seclusion) from people. ibid. note 1.. This would then apply especially to razei Torah. Do so in order to train yourself to have your thought attached to the Creator. see above. Sha'ar Ha'ahavah. sect. The advice given here is to train yourself into that frame of mind by gradually introducing mundane involvements during the "safe* times of deveikut. 4 and 10). note 2. The materiality of the body can be overcome by diffusing it. sect. below. to become accustomed to a state of deveikut at that time. which are called nishmata de'orayta (the soul of the . even when you are involved in actions or speech relating to material matters. is a precarious and hazardous task. The ideal service of God is not by separating yourself from the world and physical reality. On the contrary: the latter must be sublimated to holiness. 63. Profound deliberation in Torah leads to dewiktrt (Reishit Chochmah. the last paragraph of sect 58. 2."? and by performing the yi1. ch. or do or say something though there is no need for that act or speech. CJ below. 94). This. blessed be He. Gazing in dlffer ent directions will break the body's concentration on any of its physical pursuits.
The mystics are very emphatic on the special virtue in joining the night to the day (in the morning) with Torah and prayer (see R." (Maimonides. Shenei Luchot Haberit (cited by M a p Avraham. The concealed aspect (soul) of the Torah connects with the concealed aspect (soul) of man. 5. your service must be singularly [devoted] to Him. . Sha'ar Hakauamt." This is an important principle. Man must always have but a singular thought in the service of the Creator.' Thus it is written. that is. Isaac Luria offer the meditat ions to effect yichudim. 4. . too. sect.. Moreh Nevuchim III:12) . blessed be He. Orach Chayim 1:l) states that this applies also to joining the day to the night (in the evening). note 4. but they sought manifold contrivances. be scrupulous in rising at midnighe and to join the day and the night [with Torah and ~rayer]. ch. and ibid. 7:29). of blessed memory? When performing yichudirn. Cf: Maimonides. "God made it that they will fear Him" (Ecclesiastes 3:24) and "[God has made man upright.e.~ Torah. See above. ch. Zohar 111:152a. Sijia (Shemini) states: "Remove the yetzer hara from your heart . As [God] is singular in the world. Torah-study at night is especially conducive to deveikut (Reishit Chochmah. the thought of devoting himself to the service of God. your manifold thoughts cause you to be confused.. 16 and 26-27. Hikhot Shemitah Veyovel13: 13. meditate on God's greatness to the best of your ability. Isaac Luria. Derushei Halailah. sect. Reishit Chochmah. 4. ch. 10). and binds it to the "concealed aspect of the Holy One.' and these contrivances bring the evils upon him. so. blessed is Hen (see Zohar IlI:73a). 17). I. ibid. Chaim Vital. 3. See above. 2.] but they sought out manifold contrivances" (ibid.2 1. Sha'ar Hakedushah. Also. 3. 79b and 1I:SSb). The teachings of R.chudim (acts of unification) known from R. "'God has made man upright.
Everything that comes about through the thoughts of man with various devices. Keler Shem Tor. you know that a is best for you when things did not happen as you ~ i s h e d . i.2d." (Maggid Devuruu Leya'ukov. blessed be He. Midrash Hane'elam.Have in mind that everything in the world is filled with the Creator. Without the Divirie cffusion and vitality. and out of which all the others follow (Zohar I:15a-b. sect . is the meaning of 'the whole earth is filled with His glory' (Isaiah 6:3).) 4. Bereisltit is a comprehensive utterance which compounds all the others. it can be said that "the Creator is in every motion. respectively. In that sense. and it is impossible to make any motion or (utter) any speech without the ability conferred by thc Creator. The Talmud comments: The phrase "He said" appears only nine times in the account of the creation? The term Bereirhit (In the Beginning. of His Self-contraction: and everything came into being by means of a single utterance.e. the very first word of the Torah) is also an utterance (thus to be added to the other nine). the World of the Angels or the World of the Throne. sect. 5. See above. indeed. For all are within the vacated space of His constricted light. then. whether it be the World of the Spheres. sect. Zohar Chadash. (Rosh Hashanah 32a) Moreover. Yetzirah and Beri'ah. This. See also below. 38.' Why.3 Thus ~t should make no difference to you whether your aim was achieved as you wished or not. sect. then. even the most trivial thing happening in the world. 16b. 200).. blessed be He. 30a and 31b. blessed be He. 6. sect. should you be drawn after anything desirable in those worlds when all is but a single utterance of [God]? It is better to attach yourself beyond the 3. 2 and 4. As everything comes from the Creator. 54. The concept of tzirntzt~rn. ~ Bear in mind that everything. sect.-The world was created with ten utterances (Awt 5:l). The Worlds ofhsiyah. it is all by His providence.s all is as naught before Him.. 137. man is unable to make any motion (Likkutim Yekarim. Keter Shem Tov.) . 7. 273. of the Divine "Self-contraction" that conce aled the infinite light to make it possible for finite being to exist without becoming nullified by the intensity of the infinite light of God.
always think of the Supernal World. to the Creator. with a complete love that is greater than that for anything else in the world. blessed be He. i. to [God]. cited in Or Hachamah on Zohar I1:lOa." for all the worlds are destined to de~truction. above. for every good thing in this world is rooted in Him. . Cf: below." Your thought should always be attached to the Supernal World. 11. Think [to yourself]: "I always wish to bring gratification unto [God]. sect." (Leviticus 21:12)11 When you have to speak at length about mundane matters. for there is your primary abode with the Creator. Sanhedrin 97a.~ Thus always bear in mind to attach yourself to the Creator. to that which is primary. Be as one who leaves his house for the outside with the intent to return right away. blessed be He.~ This is what the Zohr (II:134b) means by stating: "happy are the righteous who know to fm their will upon the Supernal IGng. The mystics generally agree that this is not meant in the lite ral sense. "he shall not leave the Sanctuary..e. Le. 9. Bet David. See above. sect. even when you speak of mundane matters. 24. than becoming attached to something that is s~bordinate.90 and 101-b. and Shenei Luchot Haberit. Cf. 12. "he shall not leave his holy status" (Sanhedrin 19a). too. Teshuwt Harashba I:9. and to serve Him constantly. 87. think to yourself that you are descending from the Supernal World to below.l0 This is alluded in the meaning of the verse. thinlung throughout his departure "when can I return horne?"l2 So. and not upon this world and its vain desires. blessed be He. 8.) 10.worlds.. sect. See also the extensive discussions in Moreh Nevuchim II:28-29. 76. (R. but refers to the destruction of all negative aspects and the universe being renewed on a sublime level of purity. Chaim Vital.
like a person on a journey with h ~ sm ind and desire set to return home with the greatest haste. He will grant you your wish. sect. they. as stated above.blessed be He. . The prayers of the Shabbat are especially beloved on high. 69. When your thought is focused on the Supernal World. you never leave it. but not on weekdays. You may not be able to speak before [the IGng]. but on the Shabbat it shall be opened. "The righteous . sect. see Zohar I:75b). for He is exceedingly merciful to you. (See Zohar II:135$ and III:243a). Kad Hakemach. sect. ." (R. prayer needs much more effort. 2. Even as a stranger yearns to return to his birthplace. 86. Bachya. Thus repel all the guards until you come before the King. nor be worthy to come into His presence. . therefore. 3. consider this world insignificant." (I Kngs 2:2) i.e. .I4 13. sect. long to return to their root and origin.U. that without the IQng it is bad for you. The "other side" (impurity) is set aside. This refers to the parable cited above. 72. and their dwelling h ere is but temporary . too. S. with [proper] faith. A person like that 1s not a faithful servant2 You must realize.. shall be shut during the six working days. ger) Do not say. . . Nonetheless. and there is a manifestation of radiant Godliness. to think that you will pray with kavanah on Shabbat after neglectin g this duty all week long. for. Sltabbat is an especially auspicious holy day." (Ezekiel 46:l. On weekdays. 131. "The gate of the inner court . "I will pray on Shabbat with kavanah (concentration). David thus said to his son Solomon: "I am going the way of all the earth. 14."l For you are not to be like servants of the lung who apply themselves to their work in the presence of the hng but will not do it conscientiously in his absence. .I3 and immediately restore your thought to the original attachment. and below. 1. as explained below. Moreover. will simply not work. you are where your thought is.
72 and 86). This paragraph is based on Zohar II:245b. but otherwise I will not force myself to pray. for the King is here but He is hidden from you. Those who are familiar with the king recognize him by his mannerisms. because you are judged in every chamber whether you are worthy to enter. Those who are not familiar with the king note that people guard a certain place more [than others]. sect. see there. as you lacked kauanah or did not pray with hifhhavut (see the Baal Shem Tov's teaching in Magid Deuarau Leya'akov. 72. When you pray with hitlahavut. and Keter Shem Tou. 207). if you are unable to pray. So. 64. too. such 1. 58. An alien thought may be cast into your mind by Divine Providence. This is. 287). consider the nature of the [alien] t h o~g h ti:f ~it relates to evil love. Bear in mind that in prayer you proceed from chamber to chamber. When an alien thought comes [to your mind] you are expelled. sect. a hazardous task which requires a degree of sp~ritualp erfection (see above. 89. which of itself means expulsion from the chamber. See also below. This section basically repeats the theme of sect. fervor): start to pray intensely. sect. and the notes there) in order that you sublimate that thought (see firer Shem Tov.' 1. sect. 84. sect. thus it may be assumed that the king must be there. Thus strengthen yourself so much more. The alien thought may be cast into your mind in context of "a descent for the sake of an ascent" (see above. Thus it should bestir you to strengthen yourself. . though.86 Do not say: "I will pray when I am able to do so with hitlahavut (ardor. 2.' Thus if you are not praying with hitlahavut (ardor. fervor)." On the contrary! It is comparable to a lung who changes his garments when waging battle. it means that the King is guarded from being manifest to you. 3. sect. to pray intensely (6 above.
4. C$ Berekhit Rabba 3. ' it was morning' refers to the deeds of the righteous. Just as these attributes are to be found in the realm of Divinity and holiness. 5. the mid01 are reflect ed In corresponding soul-faculties. and likewise with nitzu'ach (endurance.. i. Gevuruh. 90. "[good] glorification" of glorifying God and "bad [glorification]" of self-glorification. The "seven days of creation" sign~fy the lower seven Sefirot.as sensuous lust. and so forth) 6. Thus you can undertake this task only when you pray with hitlahavut. The numbering of the days of creatlon (Genes~s1 ) is introduced w~t hth e phrase "It was evening and rt was morning.7 The [seven types of thought] are then "love of God" and "love of sin. In two parallel categories: the seven emotive attributes of man's Divine soul relate strictly to holiness (Chessed-love of God. 120 and 127) explains the sublimation of all possible categories of alien thoughts. 13-14. sect. sect. i t . thanksgiving." 7. See above.r~ev is an expression of ta'aruvot (mixture).. the midot (attributes) of Chersed. note 2). they are to bc found In the realm of impurity and evil (see abovc. In man. T$ret.E"a~c h [of these] has an erev (evening) and a boker (m~rning)E. Ceuuruh-fear of material objects. Everything in creation contains sparks of the Sefrrot. too. so. either of th c Sefirof of holiness or of the Sefirot of impurity. sect. . 13. 101 . hodayah (acknowledgment. and boker is an expression of bikur (visit). Netzach. Hod.8: "'It was evening' refers to the deeds of the wlcked. yessodot (founda~ons) sect. They correspond to the "seven days of creat i~n. note 3). thus to the realm of that which is not holy or even evil (Chessed-love of material objects or sin. Gevurah-fear or awe of God." There are only seven types of thought.e. i. 22.e. victory). praise). Y e d and Malchut. bring it to ~ t s[u ltimate] source which IS the love of God. and so forth). The sequel of this section (as also below." "fear of God" and "bad fear" such as hatred. and the seven emotive attributes of man's animal soul which relate to his physical reality and pursuit s. having an alien thought. or its consequence s like anger." . visiting God.
Ishmael thus signifies chessed of kelipah and Esau gevurah of kelipah (see Zohar III:124a and 246b). sect.e. i." i." 8. There is also Isaac.e. Heaven forbid. and sins in general. gives vitality to Ishmael and the nine [aspects] that go with him. and submission to evil or impurity on the bad side. The author does not mention here the attribute of rnalchut (kingship. Isaac--Gevurah. par. and likewise with all the others. note 2). sect. Aaron... 39. There are altogether ten St$rot: the upper three (filer." therefore. The Holy One. and the seven midof. The attribute of yesod signifies bonding. or. 90). it was wavering to and fro. then said that Abraham-i. murder. Joseph and David) the other four respectively (Zohar III:301b-302a). . on the immanent level. the attribute of love"-will come forth into the world. Chsed thus compounds Chochtnah of Chessed. Binah and Da'af). ch.^ With every bad thought one gives vitality. 12. to the "seven nations. sect. Da'at of Chesred. Chersed of Chexsed. blessed is He.e. Chochmah and Binah. Binah of Chessed. and Berachah. 11. are not just failures on the pan of man..e. joining together . Tikunei Zoha r 15:30b). A thought of "bad fear. Evil thoughts. i. Ishmael and Esau are the dross of Abraham and Isaac respectively (Sije. 139.i. (Tikunei Zohar 47:84a and 69:116b) 10." and [correspondingly] Esau [the attribute of] "bad fear. Pesrkia Rabaty. See above. Ha'azinu. 13-14. Each of these subdivides into ten levels of inter-relationships with the other Sefirot. and so forth. note 5. 9.. See below. Jacob-Tijret). [the attribute of] "bad love. Chochmah. The Patriarchs signify the first three attributes of holiness (AbrahamChesed."'z A thought of "bad love. and later saints (Moses. 212. the attribute of "[good] fear. sovereignt y). They have a cosmic effect of strengthening (infusing vitality into) the seven attributes of the realm of kelipah (see also below. par.e. It would relate to accepting the sovereignty of God on the good side. But there will also be the issue of Ishmael."1° Midrash Hane'elam (Zohar I:86b) thus states: m e n God created] the world.. 343. The "seven nation s" of the early inhabitants of the Holy Land signify these seven attributes of the realm of impurity (see above. the sense of bonding8 Each of these [seven] is compounded of ten aspect^].
. 47). 15. a woman. selfnegation). 14. 90. when you see or eat something that gves you pleasure. Negative Jlessed.Is Your whole being. Thus take heed not to crudify that delight. . i. thus bringing the thought to the attribute of ayin (naught).: over) God" (Isaiah 58:14). Thus if you happen to think of a "bad love. you forsake the incidental and insignificant and pursue the primary and essential.e. which is a term for the highest refirah of Keter. for example. and it is . 18. In other words. therefore.. as. See above. and "then you will find pleasure a1 (lit. sect. beyond [the level of the Divine] Name [Havayah. the level of ayin (naught. but in Kabbalistic terminology taken literally: 'from ayin-naught'. of which it is written '[I raise my eyes over the mountains] me'ayin (from whence.'I6 how much more should I love God!"17 Likewise. sect. the place from whence those above and below derive. think that it is but a part of the World of Love. should be directed to that 13. 16. See Zohar I1:83a: "It docs not say 'im (with) Havayah. Vitality from the realm of thought that originates in holiness. In the supernal realm of ayin all breaches can be corrected."13 say to yourself: 'What have I done? I have taken a part of the World of Thoughti4 and brought it to a place of filth!" This will effect that you be subdued and come to the [level] of dust. The realization of wrong-doing leads to subduing and negating the ego ("I am as dust and ashesn-Genesis 18:27).therefore. as it were. and below. i t . Also. the Tetragrammaton].' but 'a1 (over) Havay ah'. sect. for thought is made up of letters which in their origin are sparks of the Shechinah (see Maggid Devarav Leya'akov. 84. sect.'s Then you will come to the World of Love by reminding yourself: "If I love this object. when you hear words of jest which cause you to be mirthful. the ultimate sphere of the World of Delight) will come my help' (Psalms 121:1). Avot 3:l 17. 98 and 232). gives vitality to Esau and the nine [aspects] that go with him. and all sparks ascend to holiness (see Maggid Detwrav Lq~a'akov. who is but a 'putrid drop. and they desire that place. think that it is but a part of the World of Delight. Heaven forbid.
Negativegevurah. Zohar 11 1 b. Ta'anit 20b. yet be in the World of Delight.21 When people praise you. for every [form ofl splendor is emitted from there and from it emanate all those crowns (i. The longing and delight of the righteous is to contemplate that splendor.. will bring delight unto God in all worlds.e. Yoreh De'ah 116:s)." The Tetragrammaton signifies Ze'eir Anpin. blessed be He. how much more should I fear [God] The same applies to glorification. 19. is vested in that being [enabling it to exist]. The pleasure that you caused yourself. in Kabbalistic terminology generally signifying the realm of Keter) and they brought him near before Him' (Daniel 7:13). thus think of God. The attribute of T$ret. shame-before God. when you see something of which you are afraid. 21. or you sense pride in the midst of prayer. written 'and reached unto Atik Yomaya (the Ancient of Days.. One is to consider that the present-uninfendedconfronta tion of danger is by Divine Providence (6 below. the compound of the midot from Chessed to Yessod. for it is Halachically forb idden to expose oneself to danger and to rely on miracles (Pesachim 64b. This does not mean that one is to ignore danger.lg say to yourself: ''Why should I be afraid of this? It is but a human like myself-let alone if it is but an animal or beast! As the awesome God. 120). bring yourself to a sense of awe-i. sect." therefore. Likewise. 20.pleasure in context of it being part of the World of Delight. or people exalt you for your concentrated study. he should utilize that opportunity to consider the ultimate source of fear and generate within himself the fear of God. Hikhot Rotze'ach Ushirat Hanefesh 11:4$. Thus you may sit and eat here. Maimonides. . therefore. is to ascend beyond the midof to their very source. To ascend "above Havayah. even while using the Divinely endowed gift of intelligence to observe the Divine precept to save himself. The Baal Shem Tov deals with sublimation: when something mundane arouses fear in man. Sefirof).e. Shukhan Amch. Thus one must avoid danger and make every effort to escape it.
The attribute of Hod. 33. The attribute of Netznch 23. the Shechtmh. 75. w~l l generate a sense of fear 'When thlnlung before prayer about what you w~lsla y. 75. 24. because the 'World of Speech" is the 'World of Fear. "'Fear of God' IS the Shechrnah. the Sefrah of Malchul (ibd . you will be overcome by fear. thereforc. (Darker Tzedek I:20) See also Maggid Devarav Jkya'akov. sect 313 ) . When cons~derrng that the World of Speech."2 Thus. but rt 1s rooted In Brmh. 77a. The Baal Shem Tov taught The Shechrnah 1s 111 exlle because all words of speech derrve from Her and ought to be for the servlce of the Creator but. The attribute of Yessod. sect 75. See above. the holy Malchuf" (Tzkuner Z d ~3r3. The Shechrmh 1s the World of Speech (above. and mtnd~ngth rs when spealung. Zohar Ill 269b). and before whom you are spealung." In Malchut (wh~cht. 1s called the "lower Gevurah". sect. fervor). you w11 be afrard of the words themselves .e. 1. also hid 7b).h erefore.23 and also with "bonding."z4 i. How can you not be overcome by fear and shame when you know that you bestrr the Shechtnah" (Maggid Devarav Leya'akov. note 11) The attr~buteo ffear relates to Gevurah (above. Realrz~ngth e ~dent~ty of Shechinah and speech. when spealung with a sense of love and awe [of God]. Addenda. I e. sect. note 10.In context of nitzu'ach. by our many slns.' Normally you ought to be overcome by fear when spealung. sect 87). You should show compassion for the Shechinah when spealung in a way that removes the words from God. to be bound up with God alone. 22. these words are used for materra1 matters." Do the same with the aspect of hodayah.. sect 78. note 7). fear and shame w1l1 surely come upon you. Idle talk and falsehoods.z2 overcome that trait or have your understanding lead you to a sense of "Divine victory. and when continuing that way you will reach a level of immense hitlahavut (ardor.. crted m Keter Shem Tov. the "supernal Shechrnah" (see sect. indeed. note 11) Thus it 1s reflected In the "lower Shechrmh. . 2. speaks through you.
legitimate) person but the inner reality is evil. 87. 1 (and see also Nedarim 20b) that some are regarded like mamzerim though legally they are not. [as the mother so is her daughter]. the alien thought reflects its origin in the illegitimate union of holiness and evil. too. man's thought. sound and speech correspond to male and female. 3.. 148: "The Holy One. sect. too. the offspring reflects its origin.] the words spoken are letters of holiness.89 When beset by an alien thought. which is the very soul of his speech. sect.e. It would seem preferable to emend this sentence as in the version of Maggid Devarav Leya'akov." which implies premature death). says: "Why did you come into the teivah (word) when I am not in it?!"5 1. [In our context. In our context. A mamzer is the offspring of a union between a man and woman whose marriage would be a capital offense or incur the Heavenly penalty of karet ("excision. one begotten with the alien thought of someone external. sect. For with holy speech coined to] thoughts of something else you beget a mamzer."3 Thought has a male and a female aspect. I$ Massechet Kallah ch. The status of the mamzer reflects th e transgression of his parents. 2. 4. See Zohar III:228a-b. See above. such as incest and adultery. One of these is mamzer temurah. So. I. Cf: Likkutim Yekarim.e. that as your thought is wandering among other matters. 5. So. blessed is He.' Return to the palace with great embarrassment and exceeding humility. was not in the word. as explained in the next paragraph. i. ." That is. says: 'Why is it that I came and there is no man' (Isaiah 50:2) in the word.. the Holy One. feel extremely ashamed because you have been expelled from the Kng's palace. 131. blessed is He.4 The utterance of words of holiness while harboring an alien thought is like a mamzer whose external fonn is as that of a kosher (fit. Bear in mind also. To harbor an alien thought is a [grave] sin tantamount to begetting a mamzer: as it is said (Ketuvot 103a) "ewe follows ewe. but the thought [behind them] is evil.
it draws vitality from the major branch. Chaim Vital. How much more so. itro. 'Do not turn to the idols and do not makc for yourselves molten gods.]" (Psalms 17: 14) Avoid gazing at material things that are attractive. avoid gazing at the beauty of women to indulge your desire. the younger brother draws v~tality from the older one. . Sha'ar Hamitzvo~Y. of blessed memory.5 Thus it follows that when first infusing strength 1. thus explained [the ruling] that "Honor your father. The quote cited above. Heaven forbid. [they leave their yeter (abundance.~. impregnating it. your child will be rooted in the power [of the keli~ot]R. sect." (Zohar III:84a." (Exodus 20:12) includes [the obligation to honor] your elder brother (Ketuvot 103a): The older brother is llke the major branch of a tree. i. Vayeira. 4. As another branch grows from that major branch. Bachya on Leviticus 1Y:2).2 Thus you will add strength to kelipah ("husk. "Whoever gazes at thc beauty of a woman by day will have [lustful] thoughts at night. if you do so before giving birth to a child. Cf: Nedarim 20a. 2." the forces or realm of evil).e. Aoadah Zara 20a-b. See above.' that is why it is written. . and if he brings that thought upon himself he will violate the prohibition of 'do not make for yourself molten gods' (Leviticus 19:4). R. to nocturnal sin.'You fill their belly with tzefuncha (that which is hidden with you) . coritinues that the children one begets under the influence of those thoughts "are called 'molten gods. For that type of loolung is self-worship. 87 (and note 10 there). Moreover. Isaac Luria. 4 R. which is like worshipping idolatry. too. that which you tzofeh (observe) for your sake. So.' [Moreover."' 5. note 1. .. such as the beauty of a woman. By loohng for self-indulgence you add power to [kelipah]. remainder) to their babes. note 1.' This is the meaning of tzefunchu. and above. 3. Likkulei Torah.] that thought leads.
something additional. sect. sect. This principle is stated already above. Why. 120 a nd 127. See also below. ." Thus when seeing things. therefore. which is a Divine portion from Above [for the vitality of all physical things is a Divine portion from Above]. 8. bear in mind that the taste and sweetness of the food derives from the vitalizing force and sweetness of Above. The principal strength is [given] into [the forces of evil]. 87. beyond your control. Think to yourselE "Whence came beauty and form to this vessel? Its material substance is clearly worthless.into kelipah and then begetting a child. See Nidah 31a: a person's beauty comes from God. too. and that is its vitality. For inorganic matter. The vital force of everything is a spark of the Shechinah.' It gives her the quality of beauty and redness. are the spiritual and vital reality of the vessel. conduct yourself as follows: If you suddenly happen to see a beautiful woman: think to yourself: 'Whence is her beauty? If she were dead she would no longer look this way."g It is likewise when observing other physical objects. Zohar 1:llb 9. such as a vessel. is in the Divine force. sect. See next note. should I be drawn after a mere part! I am better off in attaching myself to 'the root and core of all worlds's where all forms of beauty are to be found. That is. however. 7. The root of beauty. 109. and the child is like yitron.1° Likewise when eating. an d below. thus where does her [beauty] come from? Per force it must be said to come from the Divine force diffused within her. then. This is the meaning of "they left their yitron to their babes. Its beauty and form. that child will be like the smaller branch. has a vital force as evident from the fact that it has 6. 10.
l4 Thus it is written of all prophets that "I speak to him in a dream" (Numbers 12:6). 13. This is effective for negating [improper] thought. you are loolung at them with your mind." Berachot 57b. Chaim Vital. See Tanya. and it is not done for self-indulgence but related to the En Sof. but when your thought dwells on the spiritual reality vested in the physical. dust. "Dream is a sixtieth part of prophecy.i3 For [the term] chalom (dream) is an expression of "periods of chalirn" (Rosh Hashamh 28a).existence and durability. that is why he does not see the vital force inherent in physical matters. See Or Hachamah on Zohar 183a. Eik Chayirn 393. you will merit to see in your dreams the vital force of that physical object. 14. that the Divine vitality from Above is to be found everywhere. Your sight (empirical perception) during the day is but of the physical. This may bring one to levels of prophecy. In daytime man's vital force is weak because he is bound up with his [physical] body.e. Cf: Maimonides. however. "Even inorganic matter-i. thus it is strong and allows one to perceive the vital force itself. sound. When viewing things this way. blessed is He. Sha'ar Hayichud. animals and humans.12 Thus by following the above procedure all day long.li It follows. Zohar I:183a. See Zohar 1:147a. (R. At night. the vital force extends beyond the body. It is an established principle that what you think during the day affects the thoughts you have when sleeping and dreaming. ch.) 12. 1-2. stones and so forth--of necessity possess es a spiritual life-force." as do also all vegetation. then in your dream you will see the bare spirituality divested from its [external] garment.. See Berachot 55b. then. except for Moses. . 11. Hilchot Yersodei Hatorah 7:1. which means strong. and Moreh Nevrrchim 11:36.
' and He is vested in that matter.e. See Hilchot Yeuodei Hatorah 7:2 and 6. lla and 289b (and in several places in Tikunei Zohar). The wise one's mind is focused on the rosh-the "head" or true reality." "Image" alludes to the fonn. i... peace be upon him. [I will be sated with Your image when awake] . in the "head" of the object. the Divine Immanence." (Psalms. the spirituality and vital force--of everything. 73. in context of the Zohar's concept of "Reisha decho2 reishin-the Head of all heads. Why [did he merit this]? Because "I will be sated with Your image when awake. Moreh Nevuchim I:3 17. as opposed to the external appe arance.) 18. that rosh refers to the Shechinah. and of "You are exalted as rosh (head) over all" (I Chronicles 29:11)." This is the meaning of "The wise one's eyes are in his (alternatively: its) rosh (head)" (Ecclesiastes 2:14). the Divine emanations that constitute the essence. its form and vital force-are 'from You.e. its spirituality and vital force. It sig nifies the supreme Sefirah of Keter. verse 16) Echezeh is an expression of "chizayon laylah" (a vision at night. sect. that is.I6 Thus."18 15. note 3.15 [King] David thus said: "Echezeh (I will see) Your face in righteousness. from whence derive all other "heads" (i. ibid. Zohar III:lOb. who was able to perceive the vital force of physical matter even when awake.our teacher. beginning) of Your word is truth" (Psalms 119: 160)." This is also the meaning of "The rosh (head. (See above. 16. [thus implying a vision ofJ 'Your face" itself at night. "when noting something physical. . Job 33:15). the spirituality and vital force. I will not look just at its matter but will also consider that its image-i..e. of everything).
arrogance." (For a definition of this amount see Maimonides' commentary on Amt 4:4. and in Ch assidism in particular (see below.' as our sages said (Sotah 5a) that a Torahscholar ought to have "one eighth of an eight's [of However. is a cardinal sin in religious ethics in general.Sometimes you must exhibit pride towards others for the glory of the Creator.57. sect. and for a mystical definition sec R. like everyone else. sect. thus leads to service of God and the performance of mitzvot. he must also remember what he represents and conduct himself accordingly (see Maimonides.42-43. even the slightest thought of it. one must remove oneself to the furthest extreme . This symbolic amount is chosen because it represents the content of the smallest instrument for measuring in Halachah (Tossajt.55. For himself he must be humble. Hilchot De'ot 1:45 and 2:3) a minimal sense of pride. 9. saying to yourself: "In truth I am very base. 68 and 393). A Torah-scholar represents the honor of Torah. Every thought is a 1. Rosh Hashanah 13a. sect. Generally one should choose a middle path (the "golden mean"). ch.~~ 1. LC. At the same time.) 3. rule 6). In that context he must exhibit (externally+ Maimonides. 12. even as negative humility is repellent to these (see Kefer Shem Tov. 2. s. It is pride in God and Torah. sect. and my proud demeanor is but for the glory of the Creator. Kav Hayashar. and 4: Hilchot Talmud Torah 610 and 12). Cj above." (I1 Chronicles 166) That pride is not detrimental to the ideal of humility .. 65. Pride. there is a "good pride. chsar) . but aids and increases it (Chovot Halevovot.' Any ulterior motive derives from pride.. thus why would I want honor?"' -~ . 124 and 131. Hilchot De'ot. is a very grave matter. ch. and below. Sha'ar Hakeniyah. 6. "one eight of an eight's. 102). blessed be He. Nonetheless. 122. For myself I do not need any pride. 114. As for pride and anger. for 'I am a worm and not a man' (Psalms 22:7).-. 5. ch. however. 'I'zvi Hirsh Kaidanovcr." of which it is said "his heart was elevated (proud) 111 thc ways of' God. be very careful to consider at the time your own baseness. 48. 92 Pride. v. however. and see there also ch.
"Every letter is a complete world" (below. Yoma 56t$). it is not a mater of self-esteem.complete s t r~cturep. declares of anyone with arrogance. 34). 75). sect.~i t h pride. and "every word is a complete structure" (above. 49). On the other hand. sea. therefore. (Kekr Shem Tou. however. sect. first attach yourself mentally to the Creator. 3. blessed is He. Tzafnt Pane'ach. i. note 1).e. The soul of the other." (Proverbs 16:5)9 away from them.' as it is said. it is said. then." defiles. the Baal Shem Tov teaches that "Pride purifies the defiled. therefore. sect. 91. is . Of the proud and arrogant. containing "worlds. 118)." as it is written "Every one who is proud in heart is an abomination to God.." (Solah 5a) The Baal Shem Tov taught that this passage proves that pride is worse than blatant sin: Of all forms of sin and impurity it is said 'Who dwells with them amid their impurity" (Leviticus 16:16. souls and Divinity" (above. 93 When spealung to people. incl uding the spiritual realms. 'I and he cannot both dwell in the world. and I$ above. "I and he cannot both dwell in the world. 76d).] one causes a serious blemish Above and "repels the feet of the Shechinah. Yitro. note 14). but exclusively for the glory of God. These two traits are tantanlount to idolatry (Hikhl De'ot 2:3." (Cited by R. 393) 2. the seemingly pure who fulfills his obligations is defiled by his pride. the Shechinah remains among them despite their spiritual contamination. Ya'akov Yossef of Polnoy. by the self-satisfaction and self-esteem in his service of God. 87. for thought is composed of letters and words (see above. sect. blessed be He. The positive pride discussed in the preceding section does not contradict this principle: it is not personalized. sect. p. that is. it affects the totality of reality. As a complete or self-contained structure. and defiles the pure": A false sense of humility. 'I can not bear him who is with haughty eyes and proud heart' (Psalms 101:5). too. "The Holy One. It is overcome (you are purified) by the pride of "his heart was proud in the ways of God" (see above. thinking to yourself "I am not fit to approach God. In that sense. because it prevents you from pursuing your obligation s. sect. This applies to thought as well.
as last . the Skc/tirtah) and effects the emanation of additional vitality (ibid." (Proverbs 3x5) This is an important principle: Da'eihu is an expression of "joining together. too . Cj Keter Shem Tov.e. whether he will praise or reproach me. without ulterior motives (such as self-glorification). Da'eih can be divided into two parts: da (know. Your words are attached to Above. 2. and hei-vav (the last two letters of the word). establis hes a relationship with the listener. for the life of the world to come. sect.). even in your physical involve1."' i. The letter hei. for what difference does his praise or reproach make to me [i. with prior attachment of your thought (the soul of speech) to on high. 103). may the memory of the righteous be for blessing. Moreover. sect. the Divine vitality of these words is infused in the listeners.e. sect.] 1. 75. thus "I am not speaking to my fellow.e. bestirs the "supernal speech" (i. sect. only when spoken for the sake of Heaven. 113 and 253. The root-word of da'eih is yada (to know). sect. in our context: join together ). Tikunei Zohar 69:99a). Speech is rooted in the Shechinah.[then] bound up with the Creator. See below.: knowHim). "In all your ways da'eihu (acknowledge-lit. By addressing your words to others. and become a channel for Divine emanation. 103. For every person lives but by virtue of the [Divine] emanation infused into all creatures. 99. joining the hei to the vav? in all your dealings.. cod speech" ascends on high.. which signifies attachment and union (as in Genesis 41. blessed be He. wherc this principle is applied in particular to the context of rebuking others: the speaker's prior attachment to on high. therefore.' Bear in mind that your words are but spoken before the Creator.. and their souls. Thinking of yourself while speaking will disrupt the bond and the flow ofvitality. note 7). 2."2 All this is from the Baal Shem Tov. become bound to the Creator. to bring gratification unto Him. to the common root of all souls. As sparks of the Shechinah. the 'World of Speech" (see above. the words of speech reflect the vitality of man (see below. See below.
There. 2. The physical or mundane engagement itself will thus be sublimated to holiness and spiritualiw. notes 7-8). 122-123. represented by the term the "Holy One. and His Shechinah" (see above. your study of Torah. sect. on the prin ciple of avodah tzorechgemhah (service for the sake of Above). blessed is He.' letter of the Tetragrammaton. without any ulterior motives that involve the ego.ments. however. The beginning of our proof-text ("In all your ways") signifies all your deali ngs. all your physical or mundane engagements (Hikhol De'ot 3:3. even if it be for spiritual attainments. 43. blessed is He. 231). See also above. the Shechinah (the ultimate life-force that enables man to act). or the compound of the six Sefirot Chewd to Yessod (in Kabbalistic terminology referred to as Ze'eir Anpin-'Minor Visage'). This section essentially repeats the theme of the preceding one. sect.? 1.' Not even the slightest intent should be for your own sake. and below. for advice how to go about in attaining this goal. 73 and 84. Orach Chayim. Thus: "In all your waysn join the act (signified by the hei) to the vav. signifies the Sefirah of T$ret. 95 [Another important principle:] Your service must be but for the sake of Above. Here the emphasis is on preserving the purity of the Divine service: your prayer. sect. your mitzvot. as second-last lette r of the Tetragrammaton. Shukhan Aruch. This is then clearly a great (all-comprehensive) principle. sect. without any other intent. 3. 81. The vau. signifies the Sefirah of Makhr.'" (Berachof 63a) Note above." Da'eihrr thus means to effect the "unity of the Holy One. 11. must all be for the sake of God. the focus is on the sublimation of the physical. but [altogether] for the sake of Heaven. as already stated in the Talmud: "What short text is there upon which all the essential principles of the Torah depend? 'In all your ways acknowledge Him. 3. .
he will elevate all his idle words [or deedsl. that whlch was orignally defic~enct an subsequently bc rect~fieda nd elevated by proper Intent . thus they become Intermmgled. externally he 1s not engaged In the service of God 3 HIS temporary descent to katrzrrt 4." In other words. sect. however... embers]. . gachelet is defined to relate to omemot. Israel Baal Shem: "Beware of their gachelet (glowing coal) lest you be burnt . why then qua116 it [in the conclusion as] 'tfiery coals"? If again." (Avot 2:10) This is difficult to understand: if the unqualified termgachelet implies burning [coals. descends and hovers In the lowest firmament. remalnlng there until that person wall do teshuuah If he returns properly to his Master and offers another prayer properly. and sometimes may even go idle. all their words are like fierygachlot (coals). i. dimmed (dying coals). thus said: A perfect tzadik (sa~nt)m ay sometunes fall from his level and worship God in a mode of katnut (constricted consciousness):' he does not pray with great kavanah (intention). After all. as that good prayer ascends-the overseeing [angel] makes the Improper prayer arise to meet up with the good prayer. you are but a simple person who is totally unaware of the mystery 1 See above.4 You. . and sometimes going idle. who observed him. . why would you need to be careful "lest you be burnt" asgachelet simply refers to omemot? [The Baal Shem Tov]. may very well think to himself that he can act likewise. ascend together and enter before the Holy fing. of blessed memory. Cf Zohar II:245b: "The improper prayer a expelled. 67 and 69 on thc concept of kafttut 2 1 e.e.96 Citing R. how much more so he hlmself! The teacher [of our Mishnah] thus cautions: "Do not compare yourself to the Torah-scholar and tzadik! For when the tzadik will awaken from his 'sleep'' and again prays and studies as he used to. ~f the saintly and pious can do so.2 Another person seeing the tzadik in that state of not praying or studying with great kavanah.
fiery coals. however.5 -5. 97 "If I am not for myself. Ofthand the implication is as follows: "If I am here. then. too. but remain on their level (see Keter Shem Tov. but i f I am not here. all is here" (Sukah 53a). can be interpreted in like manner. His burning sparks can restore the great flame (see above... "But when I am for myself. everyone is here.e. 2. 356. This is the meaning of "If I am not for myself'--i. who is here?" Thus: "If I"-<go and self-awareness-"am . 67.2 1. you must be divested of physical realiiy. This cannot be said. 113). sect. what am I?]" (Avot 1:14) When you pray. "I concealed (treasured) Your word in my heart so that I will not sin against Youn (Psalms 119: 11). 65. 77 and 366) He retains the ember. of one who is not a tzadik: if he engages in idle talk or deeds. and Likkutim Yekarim. (filer Shem Tov. even in his state of katnut.' The saying "When I am here. see there. he may not only be unable to sublimate these. The fzadik is always attached to Godliness.e. as stated above.. even when that fire is dimmed and not apparent. for even their idle talk is like fiery coals. I am not afraid of alien thoughts. compare yourself to him!" This is the meaning of "beware of their glowing coals": Even when [tzadikim] have fallen from their level and are like "dimmed coals" for uttering idle words or involved with idle deeds. note 3) that will sublimate everything of his temporary fall. what am I?. To him applies. sect." i. Up to here is a brief version of sect.e." i. when I am thus divested-then "who is for me?. who is for me? [But when I am for myself. sect. beware! Do not apply a lesson from them [for yourself]. and cf: also Maggid Devarav Leya'akov. How dare you.of Divine worship. in my state of self-awareness there are many alien thoughts. sect. 62. sect.
however. the ahen thoughts-"IS here. sect. whlch rs followed by the text of our sect. soul) of his animal. sect. sect 237. everyone"-I c . ~l r enth oughts wrll not approach me Note.e . Wlth attachment (deveikut) to Godliness. 94. see above. 4 Thrs seems to be an extended rnterpretatton of ylphros as a notankon (an acrostlc abbreviat~on) forpames-rosh (leader-head) The more elaborate verslon of this teachrng In Maggrd Devarav Leya'akov. blessed be He. 97 as a sequel 98 "Every prudent man acts w~th da'at (knowledge." as the root-words of both are essentially the same." but "if 1 dm not heren-1. The reading there is: "he is parush from the world and continuously studres Torah. saint) yode'a (knows) the tzefesh (desire.here. 99) 2 The principle of "Acknowledge Hrm In all your ways. lit. but he stud~es and prays without deveiktrt to the Creator. the state of selfneg atron. sect 94. renders the more lrkely (and srmpler) intcrpretat~on of readrng ytphros as "beconl~ng parush-abstemious (from worldly involvements). sect 431. [but the fool yiphros (spreads out) [his] folly.' even his [personal] transaction^. He who acts without devetklrt. forethought). though." (Proverbs 12:lO) This means ." (Proverbs 13:16) This means that the wise man does everything with da'at." See above. ~f I am drvested of ego and physrcal awareness.^ The fool: however.. [Thus for him] 'rt IS folly "' 99 "The tzadik (righteous. 1. then "who is here"--1 c. 3. the lnterpretatron rn Or Torah. note 1 (and below. dorng so only for self-esteem and to be called rabbi. even when succeeding in becoming a communal leader or head: it is but folly.
p."3 1. By a slight change of vocalization. 91. sect.. Dov Ber of Mezhirech. This is again a variation on the theme of sect."3 1. 29. Israel Baal Shem: "Yisas'char chamor garem-Issachar is a large-boned donkey. the Preacher ofthe Holy Community of Mezhirecht [a] In the act of coition you must regard yourself as naught. note 109). earning)' that garam (is c a ~ s e d )by~ chomer (physical matter). 94. A variation on the theme stated above. It. sect. 94. 3.2 This is the meaning of "Rabba drove away the flies" (Nidah 17a). 1.that he joins even that nefeshl to the service of the Creator." (Genesis 49:14) This verse indicates that "yesh-sachar (there is reward. and rf. R. (See R. 98 and 99.) 3. Shevilei Emunah. This interpretation appears already in Nidah 31a and Zohr I:157b (with an explanation in Bereishit Rabba 99:lO. Addenda. his involvements with the physical and mundane. sect. ch." Zohar 1:158a. i. Gevurot Hashem. The name Yisax'char can be divided into the two words "Yesh sachar-there is a reward (or earning).) 2.. VI. the nefesh of his animal soul. cited in Shenei Luchot Haberit. Judah Loewe. 77b. Sukah. disciple and successor of the Baal Shem Tov. he did not consider himself even as a fly. 94 and 98. note 1. 2. Citing R. garem is read garam. it.? For the word yode'a is an expression of 'tjoining together. Sublimation of physical matter and reality causes great gain and reward. This is a a frequent reading in mystical writings (see R. Cf: Keter Shem Tov. great spiritua l effects. Meir ibn Aldabi. Chamor is read as chomer.. Torah Shelemah on Exodus 4:20.e. . 101 In the name ofthe Rabbi. See above.
and one is not to love anything but God and His commandments. It excludes an objectified love of the wife that is contingent on self-serving consideration. Hilchot Ishut 15:19). 40a. Zohar Chadash. as he is not to love anything but God and His commandments..j Regard it like someone traveling 2.4 Do not muse on 11er. 94-95 and 98-100) applles here no less than wt h any other phys~cale ngagements (see Ma~mon~deHs. 7b. When a craftsman hits the rock with a hammer. Orach Chytm:231. As he and she are but tools. for this cannot be except by the cohabitation of male and female. All of (man's) limbs are but tools: he needs to eat but cannot do so without his toois. to hit the rock. for if it had been the latter. (the hammer) would be independent of the craftsman. Shdar Hakedrrshah. sect. however. Cohabitation is necessary to preserve the species (lit. Thus-] love your wife just like your tefillin (phylacteries) which you care for only for the sake of observing the command of God. the bracketed passage.tl chot De'ot 3 2 and 5 4-5. Bereislzit Ila-b. Maimonides. The preamble. "'Sanctify yourselves and be holy' (Leviticus 11:44). ch.: the generation). He is not to eat to indulge his desire. Menachem Mendel ofvitebsk). p. Thus things happen according to the infusion of the primordial mind into the tools. this happens because of his desire. 16).[b] [3 Regard yourself as no more than a tool. this teaches that a per son must sanctify himself during cohabitation. such as self-gratification (6 Avot 5:16)." (Zohar Chadash. is. 4. 3. "t he sages ordained that a man is to honor his wife more than his own self and love her as himself' (Yevamot 62b. and Likkrrtei Amarim (manuscript of R. Reishit Chochmah. p. Shulchan Aruch. After all.25) Thc mystical writings are very emphatic on the sanctification of this act (see especially Zohar I:112a and III:80a and 81b. one should not cohabit to indulge desire. This does not mean to excludc the basic or ideal sense of love. and not because of the hammer's desire. The sensual aspect of . and Even Ha'erer. does not appear in Trava'at Harivas h but in the version of Or Ha'emet. Bereishit Ila) The pr~nc~polef self-negatlon ("regard yourself as naught") and acting for the sake of Hedven (see abovc.
i. putrid and repugnant. The beauty sown by the [physical] father derives from the Supernal Father.. Man's principal affairs to serve God and fulfill his function on earth.'Z the 'World of Love.to a market. The Sefirah of Chochmah (Zohar III:290af). This paragraph deals with the sublimation of thought. 6. See Yevamot 62bJ 9. he would not be obsessed about the horse which is merely his "tool" for transportation 7. in detail. the "Supernal Fathern (Zohar II:175b and III:118b). Do not keep thinlung of her in context of self-gratification. When you see a beautiful womanm think to yourself that the white substance is from the seed of the father and the red substance is from the seed of the mother. The personal benefits from the spouse are but incidental to the spiritual benefits effected by marriage. spurn her [being a sexual object]." 14. 13. which placed next to food would render that food loathsome. 14 and 22.e.. and he cannot do so without a horse.) 5. 1 1 . 8. for the service of God."l3 while the seed of the mother derives from the Supernal Mother. 10. therefore. as well as sect. . above.e. (Note that Zohar 1II:Sla-b draws an analogy between k1.14 the 'World of Fear. sect. The Sefirah of B i ~ (hZo har I I I : 2w) . Love is identified with the Sefirah of Chesred (Tikunei Zohar 6a and lob). the husband and wife are but "tools" to achieve that end.flin and the union of husband and wife. 87 and 90. come to love the horse?6 Is there anything more foolish than that? Likewise."15 This is the beauty [of the cohabitation is only a necessary means towards a higher end. Nidah 31a 12. just as kjllin are the "tools" to fulfill the command of God. Would he. I.ll turbid blood. This subject has alrea dy been dealt with. Thus Chochmh is the ultimate "World of Love. in this world a man needs a urlfe for the service of the Creator7 in order to merit the World-toCome. In that context.8 Could anything be more foolish than to forsake his affairs9 to muse on her? Rather. b ut Chessed is rooted in Chochmh.
The consciousness of the Divine. 20." who has 365 sinews alluding to the 365 prohibitions [in the T~r a h ] . 18. Thus he is attached with everything to katnut (constricted conscio~sness)I. note 21. 16. To be in the grips of physical pleasure means attachment to the physical. sect. Thus Bimh is the ultimate "World of Fear.t~ i~s far better to attach himself to the Holy One.21 Man most likely derives pleasure from his eating and other things. no nian would build a house. For it accounts for the formation of man." (Bereishit Rabba 9:7. blessed is He. is (at least) weakened and restricte d. which. By analyzing the pleasures. as stated above. in turn. therefore. all sins will be repugnant in your eyes. 17. and sublimating them to thcir spiritual sources. See below." Cf: above. but Gev~trah is rooted in Bimh.) 22. 21. 88. blessed is He. 23. brings about the formation of man. [for] all forms of pleasure derive from that [seminal] drop. Fear is identified with the Sefirah of Gevurah (Tikunei Zohar lob).woman]. "Were it not for the evil desire.''' R. the "Supernal Mother" (Zohar II:175b and III:118b). Zohar I:170b 19.] negates [the violation ofj the 365 prohibitions. Israel Baal Shem. By rendering that sinI6 repugnant in your eyes. and see Zohar 1:61a. Thus it is better to attach yourself to the love and fear of the Creator. thus said: There is a great desire for this sin20 because it accounts for the formation of man. peace be upon him. ['S~p urning lust. therefore. See note 16. The control and sublimation of the ultimate root of all violations enablcs man to avoid these. . take a wife a nd beget children.23 15. The pursuit of pleasure leads to cohabitation. The sin of indulging sensual self-gratification.
whether it be perceived as good or bad. however. each signi@ing one of the Divine attributes. [you are to] "Acknowledge Him in all your waysn (Proverbs 3:6).s thus I must continuously increase [my] merit^. consider that it is surely to atone your sin? On the other hand. he is using up the merits he has accumulated. I.2 Thus if. Tanchuma. signifies the Divine attribute of mercy. something bad happens to you. [signi@ ing] the attribute of mercy. Zohar 1II:65a) 2. compassion. God is referred to by a variety of names. acknowledge the presence and workings of God in everything that happens to you. Lech:lO. Elokim signifies the attribute of Divine judgment. the tzadik should worry about good things happening to him. . because "the righteous are rewarded in the world to come." . Heaven forbid. He assumes that when good things come his way. See Shabbal 32a. and Rashi on Genesis 32: 11. because they may be at the expense of his merits4 This is the meaning of "Havayah shall be for me Elokim": Havayah."Havayah (GOD) shall be for me Elokim (God). 4. Cf: the interpretation of our proof-text in Zohar I:151a: "Even the mercy 1 shall regard to myself as judgment. See Berachot 5a. may in fact be [for me] the attribute of judgment indicated by [the Name] E1okim. 5. Cf: Berachot 54a: "Man must bless God for bad things just as he blesses Him for good thing. The Almighty does not withhold the merited rewards of any creature (Baba Kamma 38b).e. the wicked are rewarded in this world" (Ta'anit lla). whether it is something good or bad." 3. is to worry that the good things happening to him imply compensation in this world for his merits. so that I will serve [God] continuously.^ 1. This would be a negative sign of Divine judgment. The Tetragrammaton (conventionally rendered Havayah to avoid pronouncing this ineffable name). The tzadik. 6.. . The tzadik does not take it for granted that he deserves the Divine benevolen ce." (Genesis 28:21)l That is. (Sgw on Deuteronomy 3:24.
75. Likkuai Torah." Kpter Shem Tov. 2.' 'Thus when a person utters "good speech. sect. 88 and 93.Speech is the vitality of the human. If. Sometimes one is to serve God just with the soul. Cf: also above. it derives from his soul .e. Gev.i. Likewise. 58. on Deuteronomy 8:l-3) See also above. when they speak bad [words]. 'When a person speaks. it produces a sound that ascends on high and bestirs the holinesses (i. however. the Sefirol) of the Supernal Ktng and they crown his head. When [people] speak good [words] and attach thought to that speech.2. That is why why we are enjo ined not to engage in idle talk because it causes one to lose part of his soul." (R.' 1.n thought. keeping the body static so that it will not become ill from using it extensively. This is indicated by the vernacular expression "er hot oysgeredthe has spoken [it] out.. sect. the vital force has departed from him and will not ascend. he has exhausted thc vitality." This. 105. That breath is part of his vitality . and sect. x. a person speaks something that is bad. Heaven forbid. Le."' 1. in turn. notes 56. . When man emits a holy word from his mouth." that speech ascends on high and stirs the Supernal "Speech. 3. sect. 59. for good or for bad (Zohar II:47b). and the notes there. Chaim Vital. they join the World of Speech to the World of Thought and effect good. Thus it is likely that his total vitality may cease from him altogether. . they effect evil. a word of Torah. . 1II:lOSa). . note 7. effects that further vitality emanates to him from on high. See above. and below. 273 (and see my notes therc). and therc is joy above and below (ibid. . blessed be He. sect. breath comes out of his mouth.. The word coming from the mouth of man ascends and bestirs an arousal from Above. and that vitality comes from [God].
and great hitiahvut (fervor. "for it is impossible to understand the subjects ofwisdom and to meditate upon them when he is ill or one of his limbs is aching" (Maimonides. 1. too. Hikht De'ot 3:3 and 4. 3. See above. It proceeds faster. sect. that the welfare of the soul can only be achieved after obtaining the welfare of the body. Addenda.Sometimes one can recite the prayers with love and fear. than prayer that is externally visible in the 1imbsPKelipah ("husk". Israel Baal Shem: When the body ails. Physical infirmity (including the weakness incurred by fasting) undermines the powers of the mental faculties. 58-59. . with immense and great love [of God]. sect. Citing R. 65 and 68. Thus you must guard the health ofyour body very carefully? Up to here [is this quote]. sect. 3.' and one is unable to pray properly2 even when clear of sins. See Keter Shem Tov. because it is altogether inward.68 and 104 2. 226. with greater deveikut to God.1. force of evil) cannot attach itself to this [ideal] prayer.2 This is the best lund of worship. is weakened.65. I. CJ the admonition of the Maggid of Mezhirech: "A small hole in the body causes a big hole in the soul. 191) 2. and 4 Moreh Nevuchim 3:27. See above.' p e n strongly attached to God] one can serve Him with the soul [alone]. burning enthusiasm)." (Ma& Devarav Leya'akov. without moving at all. Hikht De'of 3:3 and 4:l). the soul. so that to another it may appear that he is saying the words without any deveikut (attachment to God). sect.
R. for ['before Him'] all is joy (Chagigah 5a) . 16. That prayer will then enter before the Holy King.'' (Peri Eitz Chayim. however. sect. end of ch. 2). Thus those appointed over the gates break down all detours and locks and take in those tears.v. blessed be He. in turn. or the prayers of the midnight-vigil (see above. s.. however. To be sure. ch. than prayer in sadness and with ~eeping." (Zohar II:165a) Likewise. Tears are caused by sorrow and sadness. sect.~ A parable for this would be the case of-a pauper petitioning and beseeching a king with great weeping: he will receive but 1 "One is not to pray In a state of sadness but with joy" (Berachot 31a). 44-45 "'Rejovc before Him' (Psalms 68:4). [One is to pray] but like a servant attending to his master with great joy. however. for otherwise the soul does not have the capacity to receive the supernal illumination that is drawn into him by means of his prayer. and the service of God in general. weeping is appropriate in prayers related to teshuvah--e. "The root of prayer is the heart's rejoicing In God" (Sefer Charridtm. sect. for 'before Him' there is no sadness at all. 12). Sha'ar Olam Ha'aniyah. but with great joy. Sadness is appropriate only with the recital of confession and when remen~beringo ne's sins. Isaac Luria thus rules: "It is prohibited to pray before God in a state of sadness. one ir not to consider any sadness-not even concern about sin. note 1). With all other praycrs. confession of sin and asking for forgiveness (see above.Prayer with great joy1 is certamly much more acceptable before [God].h us unable to rejolcc in h ~ hse art. This is a very important matter. it is good that one be humble when praying. All other prayers. 40) The act of prayer implies faith and trust in God which.g.2). note 2). .< one has committed. Sha'ar Hakorbamt. sect 18). ~t was taught (Baba Metzi'a 59a) that all gates have been closed. imply (and of themselves must lead to) joy and gladness of the heart (see Reishit Chorhmah. Bet Haknesset. 1 (in ed. Thus it 1s wrltten 'Serve God with joy' (Psalms 100. This matter is beyond estimation [of its value]. for one IS not to show sadness [In His scrv~ce] What about one who IS troubled and In d~stresst. Naggid IJmetzaveh. must be with joy. 2. See above. p. Koretz. 45. and because of h a d~stresss ee ks compassion from the Supcrnal l n g ? Is he to refrain from prayer altogether to avo~de nterlng w~ t ha ny sadness? Surely. ch. Sha'ar Ho'ahavah. and it is proper to be careful with it. but the gates of tears have not been closed.
have in mind that God is vested in the letters. with [God]. thus it is only proper that I do so joyfully. 2.' This means: We do not know what a person thinks unless he speaks. the supernal one.e.. With a minister. then. that speech is a garment for thought. therefore. . with all your ~trengthb. 75. If it is in a state of sadness. It follows. closeness and attachment to God. I. and the upper world gives to it in accordance to its condition: if it is with radiating countenance. and the Holy One. therefore. you are united. they will be radiant to it in kind from on high. As your strength is in the letter[~].' 3." (Zohar II:184a. 4.) When praying.~ec ause that will effect unity with [God]: blessed be He.. it is given judgment in kind.little. who joyfully recounts the king's praises before him and in that context also submits his request.58 and 75. blessed be He. sect. dwells in the letter[s].88 and 103. 3. 75.' for the joy of man draws forth another joy. and see there also end of 218a. to yourself: "I am preparing a garment for such a great King.* Say. 107. sect. "The world below is always in a state of receiving. . The thought is vested in speech."3 Utter the words. See above. sect. Thus it is written 'Serve God with joy. blessed be He. however. 34. 5." (Yoma 39a) Why so? .6 1. sect. 6. Cf: above. the king will give him a very large gift as befits the minister's stature. "The Torah is concerned about the money of Israel. See above. then. See above.
On the other hand. Chaim Vital. as explained further on. The pervasive principle that every thing contains holy sparks which man must redeem and restore to their source. thus said: [when] people eat and sit with others and use others.j those "sparks. 2. 3. 141. and it contains holy "sparks" ( n i t z o t z~f )th~a t relate to the very root of your soul. Eikrv.. the cncrgy or benefit generated by them is used for good purposes. sect. God takes it away from you and gives it to someone else because its remaining "sparks" relate to that other per~on.' The object could not exist without that spiritual component. to serve God. as explained abovc.e. I heard that this is the reason why a particular thing is loved by some people and disliked by others who love something else. must be concerned about his objects and everything 1. Eikev. Israel Baal Shem. 5. sect. See abovc. even if you did so for your bodily needs: you rectil." They are rectified by virtue of you using the strength added to your body by the garment. therefore. Thus it may happen that when you complete the rectification of all those "sparks" in that object which relate to the root of your soul. food or other things. 4. sometimes a person is deprived of that opportunity. kosher food) and. .~ R.3 When using some thing or eating food. eat. or make use of anything. Likkrrtei Torah. Sha'ar Hamikvot. When something comes your way it is by Divine Providence and grace.It is an important principle that when you wear. peace be upon him. garments or utensils. 90. sect. 3 1.. as a punishment.g. you derive benefit from the vital force inherent in that object. l. and idenr. and notes 9-10 there. therefore. is explained at length in K. it means that they are dealing with the "sparks" in those things. See below. A person. the natural or innate likes and dislikcs of a person relating to certai n edibles. Provided that you do so in legitimate manner (e. You are given the opportunity to fulfill your mission on earth to redeem the sparks that are nieant to be elevated by you.
and also sect. 15). sect.2 It is inappropriate to feel anguished in considering how to serve God: but always be joyful. however. For fear on its own leads to gloom and dejection. "the foundation of all wisdom and the 'gate to God"' (see above. See above. This coexistence is unique. 44 and 46. Nonetheless. I. 3. For even then you must still serve [God]: and there is no spare time to consider how and what." (Deuteronomy 11:22) How can you attach yourself to [God] when He is a . sect. they do not contradict one another but can go together hand in hand (see Yalkut Shimoni. to show concern for the holy "sparks. 107). sect. and to become attached unto Him. sect. sect.-On the themes of this section see also Keter Shem Tov. See also below. 66.e. It is possible only in the service of God (Keter Shem Tov. It is a prerequisite to the service of God. because of the "sparks" they contain. These are "two friends that do not separate [from each other]. on compounding love and fear in the service of God. sect. Fear and joy related to one thing are two contrary feelings. I. This concern parallels the concept of concern or compassion for the Shechinah . 4. "Fear of Godn is one of the 613 precepts of the Torah (Deuteronomy 613). 623. 2-3. . 128). your prime concern at all times must be to act and serve God.. Psalms. 88. sect. it must coexist simultaneously with joy ("Serve God in joy.. 128.e. joy on its own leads to carelessness and frivolity (see below. or doing so suficiently. sect."h 6. and cf: also end of sect. and to do so with joy. sect. 6 S$e on Deuteronomy 6:5). See above." see above.e. the anguish from worrying whether you are doing the right thing. By the same token. explained above. 44 (especially note 3) and 46. 111 ". 349. Zohar III:56a). i. sect. In the service o f God.. 2."' Fear without joy is melancholy.he has. 194. This wony leads to a sense of worthlessness and dejection. 1. . You are to serve God with [both] fear and joy. which is the unavoidable effect of true faith and trust in God.
See above. It is analogous to the concept of "rafzo ueshou-running and returning. think but of the 1." I That is: Worship of God with hitlahavut (fervor.e. blessed be He. impossible to be in that state continuously. This paragraph is a compound of two statements in . n3 The Gemara thus queries: ''After all. thus ascending and descending."devouring fire" (Deuteronomy 4:24)? It means. so you be merclful. as you reach the supernal level you must w~thdrawb." blessed be He. 108. ecause ~t1 s imposs~ ble to endure the ~ntensicy of the supernal light (see Maggrd Deuarau Leya'akou." How. though. Thus even when speaking to people. too. then. but when doing so later on. sect. This is an oft-cited aphorism of the Baal Shem Tov. . the flame increases and the fire itself comes down. So. 67. and Shabbat 133b (also Sotalz 14a) 2 I e . for it is but "reaching and not reaching" (Zohar 1:16b). He is 'a devouring fire'?" This relates to hitlahavut which ceases from you . whlch appear also as separate statements In the Talmud-Ketiruot Illb. "attach yourself to His attributes: as He 1s merciful. ~t is with hitlahavut: it is "reaching and not reaching." to the "letters.$$re on Deuteronomy 11:22. sect 166. Cj: Moreh Neut~chB 3:24." discussed above. I. 4." for "continuous pleasure is no pleasure. ~t 1s "reachlng and not reaching. [always] moving."4 It is possible to continuously keep thinhng of the letters of the Torah. is it possible to become attached to Him. note 1. burning enthusiasm) implies total deveikut (attachment) to [God]. to His "garments.L like fire: by blowing at fire at the beginning [of kindling it] you extinguish it. sect. and the Torah IS His "garment. It is.. 201 and 225). blessed be He? The answer 1s: "attach yourself to His midot (attributes). 3.
2. The implication is as follows: It cannot be that the Holy One. . . note 3. so that His thought may encompass matter. Thus one must pray for Divine assistance to retain the proper perspective . are from the twenty-two letters of the T ~ r a h .) "As He is rachum (merciful). 1. you retain a degree of dewikut even in the state of "not reaching. should show mercy to turbid matter. 31." when the hithhavut has ceased. note 6. Thus when considering the Divine source of speech. too. for how can the thoughts of the Most Refined encompass turbid mater? He can show mercy to us only when constricting Himself. vests Himself in His "garment" and. ~ 5." (Shabbat 133b) [The word] rachum has the same letters as chomer (matter). sect. sect. 140. sect. 75). (Note. The concept of tzimtzum.2 This is the meaning of "As He is merciful . 84." See above. blessed is He. blessed be He.[letters] of the words. Divinity (see above. and also shows mercy unto him. and contain. [so you be merciful]. sect." and this is how one effects mercy. 107. blessed is He. for they. though. See below. . note 3. These letters originate in. The principle of reciprocity of God relating to man "measure for measure. that mundane speech involves the danger of being led astray by it. and below. 142. he effects that the Holy One. All words are rooted in the 22 letters of the alphabet. as it were. see above. constricts Himself. sect. sect.' How does such tzimtzum (constriction) come about? When man is merciful. 373). whether the speech relates to matters of holiness or to the mundane (see Keter Shem Tov.
" (Proverbs 12:9) The sole sign for the [true] service of the Creator is when you know of yourself that you are lightly esteemed in your own eyes. If. sect..' For then you are on a [spiritual] level. This will diminish alien thought[s] . the rivers may overcome the ice and flow over it.e. I. after the waters of the river passed over it. 51 114 "Better is he who is lightly esteemed and a servant [to himself] than one who is honored but lacks bread. Likewise. 53. 2..I 1. A parable from ice: If there is thick ice which later becomes thin. thus "a servant unto Him.U.e. [for the latter] "lacks bread. and not firm. This interpretation of the term "bread" appears in R. Cf: above. S.' it follows that the ice was not strong to begin with. when we see that one serves [God] some tlmes but not at others. but [the ice] remains firm. we see that the ice is thin." i. This is a duplication of sect. [That is better than] "the one who is honored" in his own eyes.113 Torah-study must be forceful and with great joy. . lechem. [the Divine] effulgence? 1. it is certain that he has not yet served prop1. however. I'ardess Rimonim 23:ll. Mosheh Cordovero." blessed be He.
Yet he must run very fast. 126." (Psalms 85:14) In terms of ethical admonition. (R . Though he will yet perform the mitzvah thereafter. because he is filled with fear and trembling. creates the soul of the angel. sect. and see Keter Shem Too.erly. blessed is He. kavanah (intent). In context of the parablc: "Many waters (of the mundane entanglements) cannot extinguish the love. you will pursue it continuously . sect. and rivers cannot wash it away. 284. This causes him very great suffering." Psalms 34:9). Every meritorious act creates a "good angel.~ 2.. and its body is created by the act of the mitzvah." (Song 8:7) "Righteousness will go before him and will set his footsteps on the path. Thought. His punishment after death will be "measure for measure": various texts state that [after death] one is made to cross a river by a very narrow ford. the Holy One. sends an angel to hinder him. but stop midway to speak to others. Eifz Chayim 40:3.e. I The angel. For the thought (resolve) at home to go and perform the mitzvah. For if he had served once properly. because speedy crossing is of the essence. this means the following: Some people set out to perform a mitzvah. note 2. 58.) See above. had been subjected to suffering. I. This angel is the one created by that mitzvah [mentioned above] . sect.2 Thus just as the creation of his body was delayed by the person stopping to speak with 1. . 17. he would be doing so continuo~sly. however. like praying and so forth. sect. Chaim Vital. and below." and every sin creates a "bad angel. Now in the midst of the way and crossing. it is accounted to him as a sin for not having done so with alacrity." See above. is the soul to its effects in speech or action. note 4. once you have tasted the beauty and delight of the proper service ("Taste and see that God is good. 2.
He knows that you would not listen to that.4 Thus "it will set his footsteps on the path.e. "your righteousness shall go before you" (Isaiah 58:8)." and he will not be hindered when crossing the river.' until he will say to him 'Go and serve idols. ."' This means: The yetzer hara will surely not entice you not to study Torah at all. the yetzer hara achieves his end by gradual enticement which is not recognized by the victim as going astray.others. then. This section is a variation (with different wording but essentially the same idea) on the interpretation of our proof-text above. ch. of the yetzer hara. Every mitzvah or meritorious deed one performs in this world precedes him and walks before him in the world to come. "Such are the wiles of the yetzer hara: to-day he says to [man] 'Do this. too. 2. he has ceased to be wise. as stated above. therefore. "he has ceased to be wise. to do good. people will not esteem you and you will not be called a s~holar. 34. 74. This initial sin provides the yetzer hara with an opening to entan gle man further. came to h~nderh im in the midst of his crossing so that he will be unable to run. These are ulterior motiws that one is not to have when studying Torah (see Nedarim 62b)." (Psalms 36:4) That is. Eliezer.3When going to perform a mitzvah.. to do good." (Shabbat 105b) In other words. sect." in the plain sense. is the meaning of "Righteousness goes before him.' to morrow he tells him 'Do that. one must see to do so with alacrity. See above. 20.) 4. because of "The words of his mouth." i. as it is said.' and he goes and serves [them]. For all Mitzvot go before a person after his death. 3. "The words of his mouth are evil and deceit. Pirkei deR. This. note 2. 3.2 For if you do not study at all. this angel now. sect.~ 1. and not with laziness. (Auodah Zara 5a. see there.
Shemuel Shmelka of Nikolsburg. to teshuvah and good deeds (Berarhof 17a). 119). sect. and below. Menachem Nachum of Czernobyl. for the study of Gemara with iyun breaks asunder the kelipot. The last three sentences-[which appear also in nearly identical wording (with additional requirements) in the Hanhagot Yesharot of the Maggid's senior disciple. 1 (published in Torai Hamapgid. 26a. sect. Sha'ar Hamitzvot. sect. sect. Study Gemara (Talmud) with iyun (intensive. 18a.^ or Shlchan Aruch (the code of Jewish law) from which you would know the law properly. One is to be as studious as possible and observe 'this book of the Torah shall not depart from your mouth' (Joshua 1:8). Thus "one must bc very careful not to neglect Torahstudy. of R. CJ: also Darkri Tzedek V: p. Sha'ar Hanhagat Halimud. Peri Eitz Chayim. Menachern Mendel of Vitebsk. Va'etchanan. but only of the kind that is not lishmah (for its own sake as a Divine precept) and divorced from the religious goal of dewikrrt. 7. quoting the Maggid. to correct what one has blemished. 6. 1. See Keler Shem Tov. ms.The yeker hara thus entices you not to study whatever would bring you to fear of Heaven: such as works of mussar (devotional subject^). Study Mishnah every day. causing delight unto God even when one arrives at mistaken conclusions (Or Torah. sect.~ 4. Talmud-study and pilpul (dialectic discussions of Talmudic subjects) that is lishmah is "kishtrfei kalah--the bridal adornments" of the Shechinah (Zohar Chadarh. ibid.) .. Study TorahNevi'im-KPttrvim (the Books of the Bible) every day until becoming familiar with them. p.. 423. 88). p. on the Baal Shem Tov's insistence on study of Shlchan Aruch. 397. 5. but it must be lishmah. sect. and see also idem. See above. attachment to God (6 above. preceding his Me'or Einayim. deliberate study). 1).6 He entices you to study constantly nothing but the Talmud with all the comrnentarie~. that intensive Talmud-study to the point of discovering new insights (chidushi 'Torah) purifies man's thought for the service of God. Thus making you ignore the admonition that Torah-study is to be the gate leading to the court of fear of Heaven (Shabbat 31b). 1I:ch. Shir:64a). Magqid Devarav Leya'akov. Brooklyn NY 19751-are based on the principles stated in R. Chaim Vital." (Likkut ei Amarim-teachings and instructions of the Maggid of Mezhirechfrom the manuscript of R. This is not a critique of traditional Talmud-study. 29 and 54. on the Baal Shem Tov's insistence on daily study of such works. R.
because every letter causes a stirring Above. On the contents of this section see above.This. 5. and the notes there. and other Rabbinic authorities that preccded Chassidism. when you say the word with great hitkashrut (bonding).. fear of Heaven.e. i. burning enthusiasm). 6)." i. see to pray with great hitkashrut and hitlahvut (fervor. renders: "nothing but pilpirlim (dialectic discussions of Talmudic subjects) that are inauthentic. for surely you then bring about great effects in the supernal worlds. therefore." He prevents man from occupying himself also with that land of study that will have a good effect upon him. Derec h Chayim. ch. 30d).' 1. Netiv Hatorah. ch. 56. The parallel-version of our section in Likkutim Yekarim. It appears not only in the much earlier Shenei LuchDt Haberit but was voiced already earlier by R. Judah Loewe of Prague (see his T+ret Yisrael.75 and 108. p. is the mean~ng of "he ceases. ch. 34. sect. sect. the yetzer hara seeks to make man cease "to be wise. For every letter is a complete world.e. You must. then. Thus when you say the word with great hitkashrut. you are but meditating on those you know. 237. . This critique of the sophistry of "inauthentic pil pul" is riot unique to Chassidism. On the other hand. all kavanot are included in the whole word of themselves and by themselves. to do good. as explained in the sacred Shenei Luchot Haberit" (see there Massechet Shevtr'ot. surely you bestir those supernal worlds and thereby achieve great effects. When meditating in prayer on all the kavanot (mystical dcvotions) known to you. Netivot Olam..
"all slaves" refers to the "enslaved" sparks of holiness in everything. . yovel signifies Binah: Bimh is the World of Freedom (see Zohar I:124b and 11:183a). Cf: above. and. and the notes there). . In context of the exposition following. 54. 90. 51. . every thing came about by the emanation from the Holy One. sect. Heaven forbid. See also above.e. sect. fear and love. he 1. through His attributes of love and fear..When studying Torah have in mind the saying in the Gemara (Berachot 8a)' that "The Holy One. 120 I heard from R. blessed is He." Say to yourself that He. The two Divine attributes of love and fear are reflected in their mundane counterparts. sect. 2. vested in the material. 108. which mufatic mutandir relates no less to the letters o f the Torah. 2. is in exile. which.e. has nothing in the world but the four cubits of Halachah. blessed is He. 78). constricted Himself and dwells here.' This means: As known..' 1. i. when raised to Binah (the Supernal Shechinah) are freed: in Binah they are corrected and freed (see Maggid Devarav Leya'akov. See above. all slaves) shall return to his family. e ach of you (i. thus it is appropriate to study with joy. "You shall sanctify the fiftieth year and proclaim freedom throughout the land for all its inhabitants. The love. Israel Baal Shem. however.2 When man considers that this love is a "garment" unto [God]. peace be upon him: Why is it called 'World of Freedom"? Because even a slave entering there becomes a free man. sect. as in women or food. it shall be yovel (a Jubilee Year) for you . in the love and fear man has towards objects in physical reality (see above. blessed be He. sect. blessed be He." (Leviticus 25:lO) In the Kab balistic scheme of the Sefirot.
e. note 20. 87. and below. 9. When afraid of a h e a t h e ~orf [a weapon like] a sword-he should say to himself: m y should I be afraid of a human like myselt? Surely the Creator. by using his attributes of love and fear (which ultimately originate in the Divine) for the physical and mundane. He ought to feel ashamed and disgraced. blessed be He. say: 'Why did God bring him here to speak while I pray? All this must be by hahgachah peratit (Divine Providence relating to all particulars). he "exiles.e.has divested Him. I. when you hear someone spealng while you pray. prayer' es3." as it were. 5.. the unavoidable disturbance is itself by Divine Providence in order tha t I overcome it. See above. sect.. Speech is identified with the Shechin~hT.e. is vested in that human. sect. blessed be He!"' It is likewise with glorification. then. I. and say to himself: "If I love this which is but a love that fell with the 'breaking [of the vessel^]'^ and is vested in a 'putrid drop. See above. thus how much more should I be afraid of Him. See above. Also. 4. note 7. which accounts for the diffusion of holy sparks throughout creation. sect. 8. must I strengthen myself in the 'service. . 87 and 90. "a descent for the sake of an ascent" (see above. I.e.) he ought to tremble with great anxiety as he remembers his evil deeds. and all the other [attributesl. sect. the sparks of Divinity they contain. in man (see Avot 3:l). blessed be He!"6 The same applies to fear. 6. i. The Kabbalistic metaphor of "sl?evirar hakeilim-the breaking of the vessels" of the Divine attributes in the process of creation. 127.~h e ~he chk ahth us is vested in the mouth of that person in order that I strengthen myself for the service [of God]? How much... 75.'S how much more should I love Him. 64). 7. and 88. sect. from His garment. blessed be He.
then.) The reply appears in Tanya. by occultation and concealment of the original light and vitality: it is an exceedingly minute portion of light and vitality. thus it is but appropriate for you to act with alacrity." Hahra'ah. i. this is possible only because the Shechinah is vested in his mouth. No thing can exist without this investment of vitality. ch. This relates strictly to the realm of holiness. The object of the indwelling merges into the light of God and its reality is completely dissolved in Him."1° It follows. 23. as it were. sect. animal. and 4 ibid. "investment of the Shechinah." implies no more than a flow of light and vitality from the Shechinah by way of kimtuzm.e. blaming it on the incorrect translation into Hebrew of the Baal Shem Tw'sY~ddish (the language in which he taught). vegetable or inorganic matter (though. See Tanya. in that person. notwithstanding the fact that this is stated clearly in the Kabbalah in general. There is a significant difference between the expressions of "dwells in" and "is vested in. that this does not appear to be the opponents' major objection: it seems that they question the basic principle of the Shechinah being vested in every thing. . whether it be human. 10.." Rabbi Schneur Zalman of Liadi was confronted with that complaint and wrote a lengthy reply demonstrating the orthodoxy of this principle. Isaac Luria in particular. Igerei Hakodesh. obviously. Halbashah. Igeref Hakodesh. the amount or degree of the concealed light differs from one object to another). and in the teachings of R. Ostensibly they were disturbed by the original text of Tzava'a~H arivah which states "the Shechinah diuells in the mouth of that person. This reference to a gentile aroused the ire of the opponents to Chassidism." implies a revelation of Divinity. 35 and 48. They regarded it blasphemous to suggest that when a gentile's speech disrupts prayer." (He adds. The light of God does not abide nor manifest itself in any thing whose reality is not completely nullified in Him. He concedes that the term "dwells" is inappropriate. and should be emended to "is vested in. that the Shechinah is. just sufficient to supply the recipient with the necessary "lifefo rcen that allows the recipient to exist ex nihilo and to be in a state of finitude and limitation.pecially if that man speaking is a gentile or a minor.. inclu ding the kelipot. however. sect. "indwelling of the Shahinah. 25.
71. 122.e." (Baba Kam 2a)' Shor (ox) is an expression of "ashurenu-I shall look at him" (Numbers 23:9 and 24:17). See below. below. 16. the mav'eh (consumption). This self-indulgence desensitizes man's spiritual nature and leads astray (Sqre. sect. 29. rage (see above.121 "There are four principal categories of damage: the shor (ox).~ Bor (pit) is an expression of "s'dei boor-an empty (fallow) field. sect. c0nflagration.2. above. See above. 4. sect. On the physical level of torts this relates to one's animals consuming anothe r's foodstuffs. as. On the spiritual level it refers to the cardinal sin of anger." It refers to one who eats every thing4 "Fire" refers to anger.j .."(Baba Metzi'a 104a) It refers to one who does not study but walks around idle.3 Mav'eh denotes "Tooth. 5 and 50. on Deuteronomy 11:15. an expression of looking and gazing. the bor (pit). e. 2. and the fire.W.g. 124 and 138). Here we are taught how they relate no less to the spiritual level. And be as . that is not ploughed and sown. These legal categories of damage relate to torts on the physical level. See above. sect. It refers to the [kind ofj sight that is harmful to pe~ple. 131 5. sect. or by reading them as idioms of similar root-words (a common device in Midrashic and Chassidic writings. i. On the spiritual level it refers to indulging the animal soul's desires for food and drink.-~ 1. and Rashi. On the physical level of torts this relates to one person's kindling of fire causing damage to another.. 1. 3. sect. Berachot 32b). and the notes there. 92. and the notes there. 122 "Rabbi said: Which is the right way that a man yavor (should choose) for himself? matever is g1oriEying to the doer himself and brings him glorification from man. note 1). This is done by implicit extension of the terms.
65. sect." is taken to mean "because (i. that you do not pay attention to) the reward. too. and below. as the opinions of others do not matter to him. .. however. Thus he acts in secret.]" (Avot 2:1) This means: 'Which is the right way" refers to "which character-traits must be avoided?" For [the word] yavor is an expression of [boor. relating strictly to God. I.87 and 114. 121.. 3.55. without [an1.careful with a 'minor' mitzvah as with a 'major' one. he must refrain from all such thoughts ("that a man should clear himsel f of')." for then "you do not know the reward given for the Mitz~ot. In our context. he has "emptied" himself of self-glorification (self-satisfaction) and the desire to be glorified by others.Y"~o u will act solely to bring gratification to the Creator. [and this leads you] to a sense of self-glorification. sect." . 11. for you do not know the reward given for Mitzvot. . note 1. See above.." So.e. The phrase "and be as careful .e. 4. with no one knowing about it2 If. 1." See above. I. and also sect. sect. The sentence thus reads: "Which is the right way of what man is to empty (clear) himself of?" 2. ." If you act in this manner. the Mishnah is not to be read as two separate admonitions. 55 and 64. It does not mean to refrain from performing his religious duties. .] "emptiness. you think to yourself that you serve God. for the very reason that) you do not know (i. . you must refrain from all [such thoughts] ." i." The implication is to perform a mitzvah in secret. even if it be not yet in the "right way.15. sect. let alone [when anticipating that] "it brings him glorification from man." is taken to mean "and then you will be as careful . . .. 126.. .e.e. the "right way" is to act without any ulterior motives.e. you will be "as careful with a 'minor' mitzvah as with a 'major' one."1 Thus he continues.e.. blessed be He. Cf: above. doing the mitzvah in order to be praised by othersthat they shall say that your are a God-fearing person. the phrase "for you do not know . 'matever is glorifjring for the doer himself.
but both are equally commands of God w~ t hal l that this ~mpliesS. 53: You must consider that you are but like a tool. . thus you will not observe the 'minor' one. pursuit of self-glorification. when uttered with kavanah (proper intent). the lower Shechirzah ). Sce above. note 1). sect. the "supernal Shechinah") is reflected in human thought. and one for the beinunim (intermediate)." (Rosh Hashanalz 16b) Tzadikim gemuriwt are those whose speech is altogether in matters of holiness.. to unite the speech with the 'World of Thought.major" mttzvah and a "mmor" one.I. 2. 75.e. will cause you to consider whether a rnilzvah is [merely] 'minor'. ee ~bovcs.e ct 1 and 17 123 "Three books are opened on Rosh Hashanah: [one for the thoroughly wicked. Man must effect the yichud (unification) of these two by infusing his proper speech (words of prayer and Torah) with proper thought (kavanah).ticipation 00 any compensation of reward that may cause selfglorification.."l For one must believe that with every prayer and word of Torah. one for the tzadikim gemurim (perfectly righteous). The 'World of Speech (Malchut. On the other hand. Note Magid Devarav Leya'akov. especially notes 11-12." 5 rhrs is obvrously unacceptable There are legal differences bctwecn a '. Those whose sole intent is to effect that supernal y i h d are the perfectly righteous . Your thought and speech are extensions of the [supernal] worlds (see above. for [only] a 'major' mitzvah will bring you glory. As the "World of Thought" (Binah. the supernal Shechinah) extends the requested effusions to the 'World of Speechn (Malchtct.the 'World of Speech" with the 'World of Thought. prayer and Torah. the "lower Shechinah) is reflected in human speech. Thus the 'World of Speech" (i."2You may not be granted that which -I. you surely unift. this effects also the literal fulfillment of the prayer on the mundane . sect. the Shechinah) beseeches the 'World of Thought" for the spiritual aspects of the prayer's content. The 'World of Thought" (Binah.
and see there also sect." effects the same on high. Thus man must beware never to assume that his prayers are of no avail.' h~mility)"w~:h en one prays with kavanah. blessed is He. the Holy One. 81. see there. he should not think of self-glorification on account of praying with great kavanah. that the prayer will then be answered 4. in terms of the universe as a whole. sect. blessed is He. sect.. therefore. i. 176 and 214. except that] this is concealed from the petitioner . This happens if his sole intent is but to join the World of Speech' to the World of Thought. sect. 73. This Talmudic statement is explained above. 80) All prayers are effective in the upper worlds.) "When man attaches himself to the words [of speech]. which is a brief version of this section. is glorified in the 'World of Speech. (aid.4 These people. This is the meaning of our sages' saying (Berachot 30b) that "One should not rise to pray but with koved rosh ('heaviness of the head. Their effect is according to what omniscient God determines to be for the best interests of man and the world. however. sect 73. Thus he must be careful not to cease from the deveikut (attachment [to God]). 58. note 2. notwithstanding what was said above. grant them the level. they intercede on his behalf. The beinunim (intermediate) are those who in prayer have in mind also that the Holy One. In fact. ." they are tzadikimgemurim. 142). whose sole intent is to unify the World of Speech" with the 'World of Thought." This brings glorification into all worlds. sect. 138 and 145.you requested in your prayer? Nonetheless.'" (Maggid Devarau Leya'akoo." (Keter Shem Tou. It may be asked. that at times the fulfillment of the request is not perceived.) 3. .e. I. [A stirring (initiative) from below.e." unifying the 'World of Speech" with the 'World of Thought. and sometimes in other parts of the universe. (CJ above. one is answered for what has been requested. Zohar I:77b and 86b. [the prayer has been answered. the "stirring from below. II:3lb elpassim (and see below. sect.. effects a reciprocal stirring from Above .. and also upon [the one who prays]. .] "One must believe that as soon as the prayer has been uttered.) 5.
. the judgment of thc intermediate is suspended until Yom Kippur. to free them for the service [of God].h). 7. 58) 9. . but when they do so not for self-~ndulgence. [The phrase] "three books" denotes [forms of] ~peech. too. They "remain suspended6 from Rosh Hashanah until Yorn &ppurV (Ro-qh Hashanah 16b).e. th~s. blessed be He. unlike the perfectly righteous." (Exodus 1 :1-2) R. the 'World of Thought" which is referred to as Yom &ppur. Tikunim 93b).e. their kavanah (intent): if their intent in requesting mundane needs is for the sake of Heaven.. but for the sake of Heaven.' This means. for the life of the world to come. Thought' and every thought ascends. grant them then [personal] w~shs. Shimon. Reuben. they. the 'World of Thought. who arc inscribed for life immediately on Rosh Hashanah." i. .I. and the commentaries thereon.b ut also that the Holy One. his memory is for a blessing." See also Zohzr 11:185a and 1II:IOObJ 8. sect.g For the World of Speech" and the 'World of Thought" are unified by virtue of their kavatzah. thus speech. blessed 1s He. shall be inscribed for life. The intermediate worry also about their own needs on earth. "These are the shemot (names) of the children of lsrael [coming to Mitzrayim (Egypt) . The beintrnim's s e ~ i c ies not as great as that of the perfectly righteous whose concern is exclusively tzorech gevohah (for the purely spiritual effects on hig.t and suspended unt~lY om Kippur~m. 1s mentonous and acceptable. . Yom Kippur is identified with Binah (Zohar Cludash." (Maggid Deuarav Leya'akov. and they are rnscr~bed for life "The intern~edratew.request of their mundane needs. too. Israel Baal Shem. hose Intent rs [not only] to un~fy. Thus their thought.f or then there 1s a man~festat~oonf the 'World of . [interpreted] the verses "They . will be effective. too. i. the suspension remains until [the examination ofJ the "thought.e.~ 6. See Sefer Yekirak 1:1.. The term sefrr (book) is an idiom of siper (relate. I. communicate).. Levi .
it will not ascend on high. What caused this? The fact that he turned his deed into a nevel (lyre). are turned into selfs e ~ nmgu sical instruments. 3. . this refers to the spiritual Jerusalem. 5.e.. but as one playing the lyre." i." which denotes the kelipot. as of Torah or prayer and so forth. an idiomatic interpretation of nivlai avadecha: the deeds in the Divine service (of those who ostensibly are 'Your servants"). I. .": What caused the gaiut and the shima1. or some perfection. I. he does so not with fear and love.. that is. by the performance of a mitzvah.c. The term Yerushalayim is a compound ofyirah (fear) and shalem (whole.e. Moreover. pride and arrogance.4 This causes.' When performing a [good] deed. This is the meaning of "nivlat avadecha as food for the birds of the sky . to the beasts of the earth. by de scending to the kelipot it will strengthen them as well (see above. into self-elevation.turned Jerusalem into heaps (of rubble)." In the same vein one can interpret [our text] "These are the shemot (names) .. .e. but descend to the kelipot. [the flesh of Your devoted ones to the beasts of the earth]" (Psalms 79:l-2): Galut (exile) came about in this world by our many sins because "they turned Yerushalayim (Jerusalem) into heaps (of rubble). . I."' That is. when a person attained some fear [of God]. into a large.. As the seq uel explains. This is the meaning of "they turned [Yerushalayim]"-their yirah-shaiem (perfect fear)2--"into heaps. he turns it into a nevel (lyre) and harp. Bereishit Rabba 56:10. 4. this leads him to a sense of pride. the destruction ofJerusalem is not the effect but the cause. "as food for the birds of the sky. 2.. they have given the nivlat (the corpse) of avadecha (Your servants) as food to the birds of the sky. sect.e.5 Thus it is written. perfect ). . Midrash Tehilim 76:3. high pile. I. 87). Thus it signifies the aspects of fear of God and perfection in the service of God. his avodah (service of God) to move-Heaven forbid-to the kelipot (forces of evil) .
" (Psalms 92:13) There are two types of tzadikim (righteous people). sect. and it is only fit that God. See also above. The name Levi is rooted in the word lavah (to join.e. and both are perfectly righteous.e." 6.." Keter Shem Tov. Moreover. they have a counter-part in kelipah.e. 31 and 403 (see there). when performing a deed he says to himself "re'u (see) the difference between me and other p e ~ p l ef." (Genesis 29:34) 11.. Genesis 2932. note 10. Esau). The name Shimon is rooted in the word shama (to hear): "God heard." i. Bereishit Kabba 16:4."'o as alluded in [the names] Shjmon [and Levi]. sect.e. but it app lies to every galut as this is a generic term for every exile (ibid.. note 4. grow tall like a cedar in Lebanon. this (and the subsequent interpretations) are taken in the negative sense. Beraclwt 7b. ap~alment )o~f the "coming to Mitzrayim (Egypt). I. sect. straits)." i. yishma (hear) my voice9 and yilaveh (attach Himself) to me." (Berachot 7b) Here. 1. 13. The difference between them is as follows: . to attach): "My husband will become attached to me. note 2). reading shemor as an idiom of shamah (desolation.. In our context this relates specifically to the galut of Egypt. appalmcnt). readingMitzrayim as an idiom of mei~rar (distress.mon (desolation. and likewise with the other names. 9.). Thus "just as the names of the tribes appear in holiness. "A righteous person will flour~sh like a date-palm." (Genesis 29:33) 10. too. into the meitzar (straits)' of thegalut? The answer is: "Reuben.. Leah.e. The name Reuben is rooted in the word ra'ah (to see). his mother. 64. Everything in holiness has a counterpart in impurity (see abovc. may He be blessed. 7. 8. though.o~r I perform my service [of God] perfectly. had in mind: "Re'u-ben--see the difference between my [first-born] son and the son of my mother-in-law (i. so. see below.
is perfectly righteom3 1. and not for others. the tzadik becomes the cause of teshuvah of the wicked. this second type of tzadik is called ba'al teshuvah..487 and 489. thus said that "the perfect tzadikim cannot stand in the place where the ba'alei teshuvah (penitent) stand." (Berachot 34b) That is. bringing others back to goodness so that tzadikim may multiply and be fruitful in the world. of blessed memory. he "brings out the precious from the vile" (Jeremiah 15:19). He is a tzadik. 3. which produces fruits: "he will flourish like a date-palm. See Zohar I1:128b: "The worthy person must pursue the wicked to remove from him the filth [of sin] and to subdue the sitra achara. ch. That is. He is the one who is compared to a cedar of which our sages. said that it does not bear fruits. he causes goodness to flourish and multiply in the world.' For he restores others to goodness.One is in a continuous state of deveikut (attachment) to God and performs the service incumbent upon him. of blessed memory. he is the proprietor and master of teshuvah. sect. and this exaltation is greater than all oth . This interpretation of the term ba'al teshuvah in the literal sense of "maste r (in Kabbalistic context: 'husband') of teshuvah. sect. i. Bet Elokim. Sha'ar Hateshuvah. He is concerned but about himself. Our sages. 15. This is a praisewor thy act effecting an exaltation of the Holy One. (Ta'anit 25b) For he is a tzadik just to himself and does not produce fruits. i. No'ach. "turned many away from iniquity7' (Malachi 2:6). more than from any other praiseworthy act.) In this context. and effected teshuvah in the world. and the Mamd's Or Torah.. just for himself." that is. 270.e. he does not make his righteousness affect others. 486. see Keter Shem Tov.e.2 though the latter. (This concept of the tzadik as ba'al hshuvah is discussed at length in R. His reward is doubled and redoubled far beyond that of the first type of tzadik. too. 2.. and Aggndot. blessed is He. however. The second type of tzadik is compared to a date-palm. to "grow tall" and enhance his reward. sect." appears in Zohar II:106b. Mosheh de Tirani.
" (see the sequel there and on the next page). Thus first of all submit to your obligti ons and do the mitzvah. CJ the differentiations between Noah. and the inwardness of the vessel is produced by the intent.e. is an important principle: When you think of performing a mitzvah. blessed be 1. . as known. (Scc above. 106a and 254b. The performance of a mitzvah has an objective validity on its own. sect. Come and see: whoever takes the hand of the wicked and induces llirn to forsake his evil way.2 After this choice you must see to it that "your mouth and heart harmonizeW4 to believe with absolute faith. 2. sect. note 1. "Out of [acting] shelo Eishmah (not for its own sake) [one comes (to act) lishmah (for its own sake)]. while the kawanah (the person's proper intent) is its soul (cf: above. to make an effort to harmonize (lit. sect. Up to here is a brief restatement of the principle stated above. 55. I. sect. too. 4. For. and also in Devarim Rabba 11:3. I.. without any ulterior thought. do not refrain from doing it for [fear of-a sense of] pride or whatever ulterior motive related to it. 131 and 389). This.. cautioning that the wicked must be restored to goodness with empathy and kindness..' First of all must be the [good. The emphasis on kauanah and deveikrrt is never meant to over-ride the Halachic obligations. that "the whole earth is full of His glory" (Isaiah 6:3) and that everything is possessed of His vital force. 55." (Pesachim 50b)' The very act of a good deed already effects on high a good vessel. even if the proper intent is as yet lacking: the action on its own is like the "body" of the mitzvah (or its effects). 113 and 251 (and scc there also sect.crs. proper] choice. 47. 58 and 116). choosing to act. to perform the mitzvah. 3.c. sect. arid 4 also Keter Shem Tot). Abraham and Moses iri Zohar I:67b.. "make as one") your thought and intcnt with the act of performing a Divine precept. Note the Baal Shem Tov's interpreta tion of this passage in Kefer Shem Tow.) 3. rises with three ascents unlike any other person.
7. everything derives from Him. For at the time of the 'breaking [of the vesselsJ'8 something fell from all the attributes. with all the attributes. [all of] the inorganic. as already discussed above. See above. and humans. blessed be He. will of itself lead to the proper attitude and intent. should I be afraid of a single spark of His which is [vested] in that bad thing? It is better to attach myself to the 'great fear'! The same applies to love. Gevurah. sect. . 84. sect.87. See below. See above. 14. The fear. sect. and all creatures. and of the fact that everything exists but by virtue of it. who put the [aspects ofj fear and love even in bad things. 119. See above. See above. 11. Divine vitality. 6. blessed be He. the vegetative. Thus you are not permitted to love. . 120. 87). fear and all the other attributes-even the bad things in the world6-all come from Him.188 and 396.22. 70.106. blessed be He. it is the vital force within you. 101 and 120. sect. Why. glorie. Corresponding to the attributes of Chesred. which de5. sect. and so. such as wild beasts. 9. Cf: above. sect. you ought to consider: "Whence is this present fear or love? After all. T&et and Netzach (see above. sect. .He. to extract the spark [of holiness] from there and raise it to its root? For this is the ultimate desire of our soul. is from Him.. note 4. the good and the bad . fear. therefore." See also ibid. 8. 120. blessed be He. then.5 Thus every form of love. and likewise with all the other attributes.-The consciousness of Divine omnipresence. 26: "The Shechinah compounds all worlds. Whenever you are afraid of something. for the bad is but a base for the good. 58. 130. too.90. Rather. Cf: Kpter Shem Too. to raise [the fallings of] the 'brealung [of the vessels]''0 to their ~ource. 10. 90 and 119. or love it. sect. sect. or make prevail7 anything beyond Him."~' The same applies to your speech: do not think that it is you who speaks. animals. sect. note 4. This is again the principle of sublimating man's emotive attributes or trait s to holiness.
sect. LC. blessed be He. 12. 16.12 This [attitude] compounds also the [notion of] equanimity. 42 (with greater elaboration in the Maggid's Or Torah. sect. sect. he will be afraid to appr0ach. however. See above. sect. for all derives from Him." Likkutim Yekarim. sect.. The one who has a sense of fear. with everything else. sect. and see there also sect. and Magid Devarav Lqa'akov.l 1. for "continuous pleasure is no pleas ure" (see above. and Maggid Devarav Lqa'akov. sect. will carefully watch to act properly. it would no longer be appreciated. Cf: above. See above. however. sect. 103 and 120.* By virtue of fear joined to [the love]. Cf: above. sect. See Keter Shem Tov. 118). he would lose the sense of reverence. for familiarity breeds contempt. And so. sect. the love would be so impressed upon him that it would become his very nature. 111). "He who acts with love [only] .rives from the Creator. Vayechi. 2 and 10. will sometimes not sense to act scrupulously . too. . The reason why [both] love and fear [are necessary]: If man had only love of God. 349.I3 because the faculty of speech is the same in another as it is with you. your Intent should be to extract the vitality [from the food] to elevate it to Above through the service of the Creator. 3. 109. . 59). explaining how the seemingly contrary feelings of love and fear can be .Ih 12.! Moreover.15 Your intent in everything should be to effect that you attach yourself to Above. blessed is He. he would be accustomed to being continuously with God. 15. end of sect.. 14. 7 and 203.14 Likewise when eatlng. 115. I. See above. 2. 88. 2-3. blessed be He. that speaks through you and raises the speech to its source.e. 13.
except that it is the 1. 67. and.joined in the service of God. his mind is not complete. The [states of] katnut and gadlut relate likewise to prayer and every mitzvah performed by man. One might wonder: In context of the creation. Evil cannot be a real entity on its own. By the same token one cannot say that there is real evil. sect. for that would imply the heresy of dualism. Yet we do experience evil on earth." too." expanded consciousness): When a person sits and studies Torah. is good. independent of (and opposed to) goodness and holiness. sect. the Torah itself states "I have placed before you.69 and 96. he is in a state of katnut." and at the conclusion thereof (Genesis 1:31)] "and behold it was very good.] the "evil. I have placed before you life and the good. death and the evil. See above. however. when he studies with discernment and hitlahavut (fervor. it is written. for example. and death and the evil.' 1. as said." In the Book of Deuteronomy. On the other hand. and does so without discernment. because he is attached to the supernal levels. and below. albeit created by God: God is the very essence of pure goodness. 110 with regards to compound ing fear and joy. 135 and 137." (Deuteronomy 30:15) Where did the evil come from? One cannot interpret this in line with our speaking of real evil. thus only good can come from Him. 129 To understand what is katnut ("smallness. sect.' [In actuality.. See also above. enthusiasm) he is on the level ofgadlut." What then is that which we call evil? ." constricted consciousness) and what is gadlut ("greatness. "See. the Torah states several times ["it was good.
a process of devolution brought about crude matter and the lowest entities to be found on earth. is. however. All that God created is good. "seat") for good" (see above." though mile'eil (fronr above) it is really good. therefore. They lend themselves to our context: milera (from below) is interpreted as an expression of ra (evil). See also b elow. and through her the prince became worthy of his rewards and an intensified love from his father. but are synonymous with the terms in that passage. The reference appears to be to Zohr 1:49b which discusses how things below are rooted in the spiritual categories of above: the yetzer hara has a spiritual source.lowest level of absolute good. The things the Torah calls evil are truly evil relative to ourselves. The terms mile'eil and milera do not actually appear there. In their origin (and their intended purpose). it is rooted in goodness above.) That which we call evil. but he rejected her allurements. The source and core of all beings. and constitute that which we call evil. Without the Divine spark inherent in all beings. 126-127. sect. a "base (lit. "from below" it is "evil. sect. "death and the evil"). this brought great joy to the king and he rewarded his son with precious gifts and honors. they are really good.2 This is alluded in the Zohar's reference to "mile'eil umile'ra-from above and from below."' 2. Thus even those things that are forbidden and condemned by the Torah. . the good is altogether concealed and invisible. To test his son's obedience and devotion. in effect. This principle is explained in terms of a popular parable in the Zohar l1:163a: A king provided his son with the best education and instructions to lead an exemplary moral life. Now. In essence. it is good. however. in terms of its origin (and purpose). 3. who was instrumental in bringing all that glory to the prince? None other but the temptress! Thus she is to be praised on all counts: she fulfilled the king's orders. is pure spirituality. note 6). Needless to say. absolute good.. arc rooted in Divine goodness. 138. but it itself becomes manifest in evil below. they could not exist. and all we see is but the truly evil shell. however . he h~red a beautiful and clever woman and ordercd her to seduce the prince That woman used every blandishment to tempt the prince. note 7. They came about to enable man's selfrealization by proving him with the options of frec choice ("life and the good" vs. 132. As it descends to its mundane manifestation. ((3 also below. sect. By means of tzimtzum (Divine Selfcontraction). that is.
Thus when effecting good, the evil, too, becomes good.4 But when sinning, Heaven forbid, it becomes real evil.5 Take, for example, a broom for sweeping the house: in context of clearing the house it has some good quality. It [may be] a low level, but it is still good. But when it is used to hit a child doing some wrong, the broom becomes truly evil when hitting the child.6 4. See above, note 2. 5. The kelipo~ (i.e., the realm of evil) exist only by virtue of the Divine will . They are sustained by sparks of holiness deeply embedded within them, albeit in limited measure that is just sufficient for their intended purpose. When man sins, however, he infuses additional vitality and energy into the kelipor (see above, sect. 9) which empowers them to go beyond tempting man, to try and "conquer and prevail with full force." Thus it becomes real evil. 6. The broomper se is morally neutral. In essence it is mere potentiality: when used for good, its potential for good is realized and confers goodness upon itself. When used for evil, its potential for evil is realized and confers evil upon itself. 131 "All the days of the poor are bad." (Proverbs 15:15) Our sages said, "No one is poor except for him who lacks knowledge." (Nedarim 41a) In this context, [our text] means the following: "All the days of the poorm-in knowledge-"are bad," because his prayer and Torah-study are not considered at all before [God], blessed be He. For surely they are devoid of fear and love, thus they do not ascend on high.' But the question is raised : "There are the Sabbaths and festivals?" (Ketuvot 110b)2 That is, surely in these days there is 1. Torah studied without fear and love does not ascend on high. (Tikunei Zohar 10:25b) This applies to prayer as well; see above, sect. 87. 2. I.e., how can you say that "all the days of the poor are bad" when there are the Sabbaths and festivals when even the poor are provided with good food?
a "stirring from Above" unto man, and he will certainly pray on these with devotion?3 The answer is : "A change of diet [is the beginning of bowel-disease]." (Ibid.) That is, though he does pray now with devotion, and regards himself as praying with devotion, this leads him to pride arid a sense of greatness, imagining himself to have ascended now to a sublime level! Thus even now [his days] are bad. For "a change of diet is the beginning of bowel-disease;" that is, "the yetzer Cmra is provoked only by eating and drinhng" (Zohar 1:llOa) and that is what led him to pride. And a word to the wise is sufficient. 3. Just as there is a beneficial change on Sabbaths and festivals in terms of physical food, so, too, it is in terms of "spiritual food": on the Sabbaths and festivals there is a manifestation of holiness, "the Shechinah never departs from Israel on the Sabbaths and festivals" (Zohar III:179b; and see there also I:75b: "On the Sabbath.. all [the kelkot] are removed and have no dominion.. and the world is in joy and is sustained from [holiness].") See also above, sect. 85. 4. I.e., the special condition of the Sabbaths and festivals will lead him to a sense of self-satisfaction, and the error of imagining that he need not improve. God must be served every day. (See above, sect. 85.) The service restricted to Sabbaths and festivals, albeit elevated, thus proves counterproduc tive. Cf: above, sect. 74. An interpretation of the verse in Psalms [which reads]: "I will thank God with all my heart, I will relate all Your wondrous works." (Psalms 9:2) The plain sense of this verse requires careful consideration. Granted that the phrase "I will thank God with all my heart" is well and good. The verse's conclusion, however, "I will relate all Your wondrous works," presents a difficulty. Is it not written (Psalms 106:2) "Who can express the mighty acts of God, make all of His praise to be heard?!" Thus how could he say "I will relate all ofyour wondrous works?"
TZAVA'AHTA RNASH 127 This can be explained in context of the Zohur's comment [on the verse (Genesis 22:1)] "And God nissah (tested) et Avraham (lit. "the Abraham;" Abraham)," that it should have said "nissah hlvraham-tested Abraham" [without the particle et]. (Zohar 119b) This will be understood in view of the wellknown premise that chessed (love; kindness) is the attribute of Abraham, as it is said, "chessed unto Abraham." (Micah 7:20)l Our Sages, of blessed memory, said (Chulin 91b) that there are angels who recite hymns only once every seven years, and according to some only once every fifty years. Their recitals are brief: some say [but the single word] kadosh (ho1y);Z some say "baruch-blessed bey's. (Ibid.) Some [angels] say one verse, as it is said of certain angels that each of them recites one verse from the psalm "Thank God, for He is good." (Psalms 136);4 and so forth. Any one of Israel, however, is allowed to speak and laud at any time and occasion, and to prolong this with every kind of laudations, songs and praise^.^ This will be understood with the parable of a king, all of whose servants and ministers came to recite hymns before him and to laud him. Now each one is allotted a certain time and limit for his laudation, corresponding to the individual's rank and importance. Moreover, all this happens [only] when the king is favorably inclined. If, however, the king is in an angry mood, Heaven forbid, they are afraid to laud him at all, as it is said, "How can you laud the King at a time of wrath?" (Kinot for the Ninth of Av) When apprehensive because of doubt whether the king is angry, Heaven forbid, or lest he become 1. See above, sect. 87, note 11. 2. I.e., of the verse "Holy, holy, holy is God." (Isaiah 6:3) 3. Ezekiel 3:12 4. See Siddur R. Isaac Luria, ed. R. Shabtai of Rashkov, s.v. Shacharit LeShabba t (p. 70b), listing the respective angels reciting each verse. 5. See Chulin 91b.
angry for whatever reason, they would be as brief as possible and immediately leave his presence. On the other hand, when the king's beloved and loving son enters to laud (his father], he is not concerned about all that. For even if the king is angry, seeing his beloved son enter effects joy and delight in the father. Now, we said that anger departs with the advent ofjoy and love. To be sure, this is only natural. Nonetheless, we must understand why this is so. It can be explained [as follows]: When love and joy prevail, they cause the anger and wrath to ascend to their source above where they are "sweetened;" for, as known, "dinim (judgments; severe decrees) can be sweetened only at their root."" This, then, is the meaning of the verse "And Elokim (God) nissah et Avrahm": Elokim, which denotes dinim,' nissah-was made to a s ~ e n di;t~. , they departed all the way to above and 6. A basic Kabbalistic premise; see R. Chaim Vital, Eitz Chayim 13:l; and Mikdas h Melech on Zohar 1:151a. In the human or earthly experience of dinim, they are "bad": they are manifest in suffering. Thcy originate in the Divine attribute of Cevurah, which itself is rooted in the Sefirah of Binah. The Divine attributes, however, are altogether good. Thc root and source of dinim, therefore, is good, and their ultimate purpose is for good as well, except that they devolve to their mundane manifestation and perception as something bad or evil. (See above, sect 130 ) The consciousness of then true nature, rcallz~ngt hen Inherent goodness ("Whatever the Merc~fuld oes IS for good"-Berachot Wb) thus traces the evrl below to rts goodness above, and this effccts a "sweetening of the ~udgmentI n ~ t sso urce" the evil is annulled and ~ t sin tended goodness becomes manifest. See firer Shem Tov, sect. 33. 7. See above, sect. 102, note I . 8. The word nissah, generally translated "tested," also means "clevated; raised" (as in Isaiah 30:17, 4922 and 62:lO; see Mechilta and Lekach Tov on Exodus 20:17, cited by Rashi ad loc.). These two meanings converge in the fact that every test is for the purpose of elevation. Thus in our context, too, both meaning are given to "God nissah Abraham"--see Bereishit Rabba, ch. 55, and Zohar I:140a.
he is his father and lung.. indicates that [His] love for me. [so is the heart of man to man]. "And Leah said. too. Why? [Because ofj "et Av~aharn. ) . Leah assumed that her share would be three of the twelve sons of Jacob. As she gave birth to a fourth son.I0 Let us return to the above parable. Bereishit Rabba 7:4." 9. aside of the fact that I am dutybound to offer praise and laudation [unto God] because of the filial obligation to a father." 10. the dinim (signified by Elokim) were made to ascend and become sweeten ed." that is. blessed be He. We said that the son lauds without restriction. (Tamhum. For the offering of thanks applies whenever one is granted some additional privilege from Above. this. by virtue of the love and chessed (kindness) signified by Abraham who is compared to the King's son. with (by virtue of) the attribute of Ckssed (signified by "Abraham"). thus obligating him to offer thanks and to praise exceedingly.were sweetened. unlike any other minister and marshal." That is to say. the love for [God]. she expressed special gratitude. "with Abraham. is firmly inserted in His heart. This time let me [gratefully] praise [God]." (Genesis 29:35)11 Our text may then possibly read as follows: "I will thank God with all my heart. thus more than her share. is itself reason to praise his father. For a son is obligated to praise his father to no end and limit for two reasons.e. the king. especially as he has no reason to be apprehensive [as stated above]. Moreover.e. as it is said with the birth of Judah." (Proverbs 27:19) For this very reason He permitted me to "relate all Your wondrous works. I will thank Him also because "God is in all my heart. for "as water (reflects) face to face."t~ha t is. in turn. Vayeitze:9. 11. the very fact that he. was granted permission to laud beyond any limit. First of all. is firmly inserted in my heart.. I. cited by Rashi ad loc. I.
blessed be He. silence is much more preferable. 105.e." The parallel version of our text in Hanhagot Yesharot adds (in brackets) that this applies only to one who has attained an exalted level of spirituality. shall be accounted as if it would be all of His wondrous works. For all others it is preferable that they engage in words of Torah. 2. but at that very time he is actually in solitude with the Creator. and join oneself unto Him.~ Sometimes one can be lying in bed. Cf: above." because there is no limit and end to them.. and 1 Kings 1:21. sect. For in silence one can think of the greatness of [God]. CJ Likkutim Yekarim. . . 3. See Rashi on Genesis 31:39. more so than the joining by means of ~peech. For I am obligated to relate His praise beyond limit because of the two reasons cited above. sect." That is.. CJ above. Judges 20:16. Thus whatever "I will relate." 1.' Even when speaking with others words of the wisdom of the Torah." The hindrance [of ~nability] is not on my part: it is simply impossible to complete the prase of the Master of the Universe and to relate "all Your wondrous works. blessed be He. This meaning for cheit appears in Genesis 31:39." this is [resolved by the phrase] "I shall relate. 190: "'Silence is a fence for wisdom' (Avo1 3:13) because in silence one is able to become attached to the World of Thought which is [the Sejrah] of Clwchmah (Wisdom). 133 'Whoever engages in excessive talk brings on cheit (sin). 65. the little one 1s able to relate." i. and to others it appears that he is sleeping. the little that I am able to [gratefully] praise and relate should be accounted as ~f I related "all Your wondrous works." (Avot 1:17) [The term cheit] denotes deficiency. sect. blessed be He.As for [the difficulty from the verse] 'Who can express [the mighty acts of God].
sect.' You will have to descend several times during the day. 4. even as one looks upon another person. in order to rest a little from your thought2 At times you can serve only with katnut (restricted consciousness3). then the Creator.[The ability] to always see the Creator. sect.' 1. For the concept of katnut see above. This shall be in your mind constantly. with the mental eye. sect. blessed be He. sect. Cf: above. 137.-The parallel version of our text in Likkutim Yekarim. sect. blessed be He.4 1. sect. 136 and 143. See below. below. with a pure. is looking upon you just as another person does. 209 (and Kekr Shem Tov. [You can do so] by thinhng that . to below. and then you will be able to ascend to Above. sect. 67. 69." At first attach yourself properly unto the Creator. 32 and 69. blessed be He. 137. 2. sect. especially note 1. Bear in mind that when you are continuously with pure and clear thought. Cf: above. and 4 below. blessed be He. is loolung upon you just as another person does. clear and lucid thought. and will not be able to ascend on high. 169. See above. 136 Some times you are able to attach yourself to Above even when you are not praying. 129. sect. below. 232) reads: "Bear in mind that the Creator. 3. and Keter Shem Tov. too. is a high level [of attainment]. and 4 Kefer Shem Tov. sect. 281. too. sect.
sect. .. 67. 137 and 14. Who is En Scf(1nfinite). sect. you will have the strength to ascend beyond all the Firmaments and Thrones.3 This is a service [of God] on the level of katnut (smallness. and then strengthen yourself to ascend even higher. blessed be He. Thus it is only proper for you to trust in Him alone.~n d to speak there in that realm. the Ofanim and the Se~aphirna. but you stand on the small dot that is the earth.2 By virtue of spealung below with fear and love. and you serve with [fear and] love below. 67." Cf: below. 4. 2. beyond the Worlds of hiyalt.' He is "ultimate fineness.2 Think that you look at the Shechinah which is at your side just as you look at physical objects. blessed be He. 3. See above. 2. 1. See above. constricted consciousness). sect.you are beyond the dome of the firmament.' Some times you are unable to ascend to Above even during prayer. sect." He is the Master of all actions in the world." Some times you are able to discern that there are yet many spheres [over you]. See above. sect. and He can effect whatever [you] may desire. 24. It. sect. blessed be He. sect. He effected a 1. 134. Yetzirah and Atzilut which correspond to the categories of "the Firmamcnts and Thrones. See abovc. Sce abovc.7. The whole universe is as naught in relation to the Creator. 84. 3. 69. the Ofonim and the Seraphim. Bear in mind about the Creator that "the whole earth is full of His glory" (Isaiah 63) and His Shechinah is constantly at your side. For man is where his thought is. scc above. and attaching yourself to the Creator.
blessed be He. His holy mountain. his Torah . sect. in whom I shall be glorified" (Isaiah 49:3): God derives much glory. You look at the Creator. sect. See above. are rooted all the good things and the judgments in the world. Always be joyfuL8 Think and believe with perfect faith that the Shechinah is at your side and watches over you. See above. 15. i. looks at The Creator. 10. See above. blessed be He. 134. seeing God from afar. sect. can do anything He desires. He can destroy all the worlds in a single instant and create them in a single instant. "Israel. 129.7 This is perfect worship. but you are still unable to ascend to the supernal worlds.e. 136.10 Thus "I trust only in Him. 9. blessed be He.44-46. See above. 84. blessed be He.. See above. for His effluence and vitality is in all things. This is the meaning of "God appeared to me from afar" (Jeremiah 31:2).5 You may understand this intellectually. and fear Him alone. end of sect. In Him. when you serve [God] on the level of gadfut (greatness." (Psalms 48:2) This may be interpreted in context of the verse. 8. 107 and 110. See above.y~o u strengthen yourself with great force and ascend in thought. sect. sect.tzimtzum (Self-constriction). blessed be He. the Seraphim and the Thrones. 6. 7. and the Creator. delight and pleasure from the tzadik's deeds. 138 "God is great and much praised. 130. penetrating all firmaments in one swoop and ascending higher than the angels." 5. the Ofanim. If He wills it. expanded conscio~sness). "clearing" within Himself a space in which to create the worlds. On the other hand. in the City of our God.
God in His kindness rewards him as if he had done it on his own. for his great affection for him. state: "[The Holy One. It follows. Nonetheless. 'The father. 55. Thus you gave us the strength to overcome the yetzer hara and to 'sweeten' it by means of the Torah. tcr "reward man in accordance with his deeds" implies well-dcserved compensation. and I created the Torah as its tavlin ("spices. says to Israel: 'My children. God. then. in calling us 'children of the Omnipresent' (Avot 3: IB).' This manifests the fierce love. and the additional affection that was made known to us. In effect. sect. 110. 191-193. Nonetheless. [The boy] had no understanding at all of the legal ruling [on which he was to be tested] because of its great profundity and subtlety. and end of 354. visited by a guest who came to examine him. though it is only by Divine grace that man has the ability and opportunity to do good.and prayer. thus not something gratuitous! However. What did the father do? He provided him with an opening to that ruling. for you reward man in accordance with his deeds" (Psalms 62:13)": "Kindness" irnplies gratuitous grace. as if we had done it by the might of our own hands. and rf: ibid."' (Kidushin 30b) This is to say: 'Your love and affection for us is very great! You created the yetzer hara and You created the Torah. God accounts it to mail as if he had accomplished it on his own. This resolves the apparent contradiction in the verse 'You. of blessed memory. man should not gct any credit for these. have kindness. All we accomplished is from You and from Your power." It is like a child dearly loved by his father. sect. Keter Shem Tov. blessed is He. All of man's ach~evenlentsa rc possible only by vlnue of God prov~ditigh rm with the possibility and energy to do them. then.) . so that he would be able 1. and You take pride in us. (Likkufim Yekarinr.] I have created the yeker hra. sect. you take great delight in it. even as spices are used in coohng. Our sages. that everything is from You." antidote). showing him a way to follow. could not bear his beloved son's anguish at being confounded and unable to understand.
trusting in his father. i. his yetzer [hara] is greater than the other's. offering objections and resolving them." (Baba Bathra 16a)* The moral is clearly understood.. our 2. I. and resolves all difficulties.4 as in "He took away the eilei (mighty) of the land. [The son] started to recite the ruling and the visitor asked him several questions. 130. our sages. Moreover. and that this causes delight unto God. and prevails over. [The father knows that the son's] achievement was wholly due to himself. raising a number of difficulties." (Megilah 18a) Eil denotes strength and might. Thus he prevails over the boy with additional questions.e. raising numerous new and complex difficulties. For when [Satan. See Zohr III:132a." (Avot 4:1) In the time to come. 3. with a clear and brilliant mind. blessed is He.. Our Sages. of blessed memory. He just about informed him of the full content of the ruling. note 2. however.to discuss it properly. the yetzer hara] sees that the tzadik subdues him." and [the tzadik] subdues. The son. se ct. His father is joyful. said: "Satan acted for the sake of Heaven. he wants to enhance it further. of blessed memory. This is the meaning of their saying that "he who is greater than another. he strengthens himself against [the tzadik] every day. his yetzer [hara]. Nonetheless. called Jacob Eil. bestirs himself on his own to be wise. Now the guest came to ask [the son] about the ruling and to test him in front of his father. CJ Sukah 52b." (Ezekiel 17:13) This is the meaning of "He called him Eil. he serves the purpose of testing man. delighted and proud seeing this. ." because the tzadik is referred to as "the mighty who subdues his yetzer [hara]. as the visitor notes the father's pleasure.e." (Sukah 52a) Also. He answered appropriately. he has great pleasure [from it]. 4. as in the parable cited above. thus said that "the Holy One.
[he could not overcome (the yetzer hra). this is stated more explicitly: "'Israel in whom I shall be glorified' refers to the Izadikim. still has pleasure and pride. blessed be He. sect.5 Thus it is written: "As now. wrought?.' what do you do. Eil. What has Eil wrought?"' (Numbers 23:23) It is known that "Israel" is a term for the tzndik. of blessed memory said: "If the Holy One.]" (Sukah 52b) Nonetheless. it is said [to Jacob and to] Israel. to the tzadik. 250." just as one inquires after the well-being of another in terms of 'You. blessed be He.G (thus reading be'ir Elokein~ as "by virtue of the stirring] by our God. 5. blessed be He. say. manifest and made famous to all. He.sages. saying to him "What has Ei1 wrought?" That is." it. In the time to come. the yetzer hra "will seem to the righteous to look like a tall mountain" (Sukah 52a). to Israel. See the reference to Isaiah 493 at the beginning of this section. it is said . the tzadik is asked. of blessed memory. For all the greatness and glory that He. and how are you?" The sequence of the text thus reads as follows: "God is great and much praised. In Maggid Devarav Leya'akov. blessed is He. and the might of the righteous in subduing so tall a mountain will be recognized. would not help [man]." 6. and gives us a great reward. "What have you. This interpretation for the word ir is found already in Targrim Yehotlathan o n Numbers 2127. awakening). comes about by means of their good deeds and their cleveikt~l in God. it is incumbent upon us to magnify and praise Him for all the good He bestows upon us. This is alluded in the verse "As now. . . perhaps all will refer to the tzadikiwi with the name Eil. rewarding us as if we had done everything on our own.?' For He: is the one who bestirs us and gives us the strength to serve Him and to prevail.. as our Sages. derives from our worship is altogether "be'ir Elokeintr (in the City of our God)": be'ir is an expression of Izit'orerut (stirring. 'soandso." That is. for His glory. .
"9 7.e. Likkutim Yekarim. Job 31:2.. as it were." (Psalms 97:s) A verse thereafter states: "Mountains will sing together. The Patriarchs are the Chariot described in Ezekiel's vision (Ezekiel 1) which is." (Bereishit Rabba 475)' Now we need to understand how the Patriarchs can be the Chariot. 139 It is written: "The mountains will melt like wax before God. 260. 35. related to the Divine soul in man. 133 and 260. the true service is something that has to come by virtue of our own stirring. to take the initiative on his own in order to deserve what comes his wa y. In this paragraph it is read in terms of the admonition that our service of God must be by means of our own "stirring of the 'part' of our God within us. See Keter Shem Tov. I. 9.In fact. said that "'Mountains' refers to the Fathers (Patriarchs). i. sect. and Jacob signifies the attribute of t@ret (beauty). 1." i. which is the attribute of chessed.' We are "a part of God from on high.e. of our Divine soul and yetzer fov. Isaac signifies the attribute of fear.*8 thus [our service should be] be'ir (by the stirring) of our yetzer [htov]. It is well-known that Abraham signifies the attribute of love." (Shemot Rabba 15:4) They said also that "The Fathers (Patriarchs) are truly the Chariot. Be'ir Ebkeinu is thus given two interpretations: In the preceding paragraph i t is read in terms of our ability to serve God and overcome the yetzer hara "by virtue of the stirring by our God" from Above. of blessed memory." (Psalms 983) How can both verses be affirmed? This may be explained as follows: It is well-known that our sages. . the portion of Divinity within us-"Elokeinu-our God. the "bearer of God": by their total submission to the Divine Will they became the vehicle and channel for Divinity on earth. 8. One is not to rely on gratuitous gifts (which the Talmud refers to as "bread of shame") or the merits of another.e. sect. however...
. 11-12. bashful.. 7. par. referred to as "the Fathers of Imp~rity. The attribute of Chesed. Zohar I:160a. 13. sect. sect. 8. For example. he who loves5 another has compassion6 for him. Tikunei Zohar 34:69a). See above."~ The difference between the two [domains] is as follows: In the realm of holiness the three attributes compound one another. 87. The realm of holiness thus is called "reshut lqach idthe domain of the singularly one" (Zohur 1II:244a.which harmonizes [love and fearj. and see above. Cf: Likkutim Yekarim. See above. The attribute of Ceuurah. and the performance of kindness is the attribute of Abraham. the three attributes are separate: "all the workers of iniquity shall be scaltered" (Psalms 2. 129 and 280. 87 and 124.e. however. for he who is afraid of another is bashful before him." (Yevamot 79a) These [characteristics] are the three attributes of the Patriarchs in ascending order: compassion is the attribute of Jacob. he will be bashful7 before him. bashfulness is the attribute of Isaac. The three thus compound one another and are as one.. Zohar II1:301b-302a. i. everything in the realm of holiness has a corresponding opposite in the realm of the profane and evil. sect. I. The attribute of T$ret. and if at times he is unable to provide the other's desire. Sefer Habahir. and they perform acts of hndness. sect. "God made one thing opposite the other.e. 6. note 2. 5." (Ecclesiastes 7:14)3 These three attributes exist then likewise in the realm of impurity. for holiness is earmarked by absolute unity.s In the realm of impurity. said that "Israelites have three characteristics: they are compassionate. 3. 4. chased. See Zohur 111:70a and 83a.2 Our sages. of blessed memory.
. and shows compassion for yet another thing. .] . Cf: Zohr I:126a and II1:208a. are called "workers of iniquity" because they lead to iniquity itself." implying that there is no unity even among the "workers" [that effect] iniquity. It is "reshuthurabim-the domain of the many" (ibid." (Psalms 27: 11) It is known that derech refers to a trodden road and orach refers to an untrodden road."'T~h at is why the word "together" is not mentioned here.92:10).' On the latter one may sometimes stray and walk towards a place of danger. as stated above. however. speaks of the mountains that are the holy Fathers: they are an absolute unity.9 [There] one loves-with the alien love--one thing. The evil traits in a person. The second verse." as opposed to "the doers of iniquity." The verse "[All the workers of iniquity] shall be scattered" alludes to the above. i. The realm of impurity is earmarked by separation. 9. 10. With a trodden road. and that is why it says "all the workers of iniquity shall be scattered.)." It speaks of the "Mountains of Irnp~rity. ." for they are separate and there is no unity among them. This is the meaning of the verse "The mountains will melt like wax. "God. however.e. but is afraid of another thing. there is no cause for straying. teach me Your derech (way). but only separation. These two aspects relate to man as well: 1. because there is no unity among them. See Zohur II:215a and III:88a. [and lead me on the orach (path) of uprightness . The "alien traits" are not united and joined together. actual sin. thus "Mountains will sing together. divisiveness and pluralism. Heaven forbid. Thus it says also "the workers of iniquity..
203. It refers to one who sometimes converses with others. He speaks. it is easy for man to stray in that way.j For this reason one must pray and petition [God]. For without the help of [God]. which is called orach. and Likkutim Yekarim. "Lead me on the orach [of uprightness]" on which I may stray.. There is also another road that is not trodden. Heaven forbid. i. sect. blessed be He. blessed be He. 'Thesc are letters (with implicit holiness) and 1 shall sublimate them to their source.' Heaven forbid saying such.140 TZAVA'AHTA RNASM Man has a trodden way to serve the Creator. sect.. they involve danger. sect. for he may stray from the proper path and start to speak also idle talk as the masses d0. love of God or fear of God. but it is forbidden to set out and speak it. Thus one must girdle his loins with prayer not to stumble into transgression. and so forth. He will surely not stray from it if he follows it continuously. he is a person who knows how to raise words so that they ascend to holiness. teach me Your derech": teach me so that I may know the trodden road. See MagidDeuarau Leya'akov. for then I can walk it on my own. . . to engage in these lund of conversations is surely permissible. sect." That is. 1 pray that 'You lead 2. 3. Maggid Deuarau Lep'akou." . He converses on nothing beyond essential matters. "God. as known from a number of people. and see ther e also sect. is the meaning of the verse.e. he speaks of things that effect moral guidance. for there is a prohibition against idle talk (see Yoma 19b). 98 and 175. This refers to one who separates himself from everything [mundane] and occupies himself day and night with nothing but Torah [and Mitzvot]. Nonetheless. blessed be He. This. then. 98: "The enthused person is able to sublima te simple talk (that is not of Torah or prayer) when hearing it .2 Now. 366 and 373. One is not to say. that He help him when desiring to walk on this path. This concept is discussed in Keter Shent Tou. 50 and 75. "for the sake of Heaven. though. Alternatively.
2. R. even in a sin he commit^. will straighten them and put into your heart [to know] how to do it lishmah." (Proverbs 3:6) This means: With regard to all trodden roads. the irregular paths. even wood and stones. anger. Likkutei Torah on Proverbs 36: '"In all your ways'--i. sect. Keler Shem Tov. pleasurable activities) for the sake of Heaven. love and fear. because per force man enjoys them and seeks their pleasure. (Maimonides.. Eikev. Sha'ar Hamitzvol. Chaim Vital.me" with the aid. 'and He will straighten your paths (orath). See above. This interpretation parallels the one in R. and so forth. Then "Hen--i. blessed be He-"will straighten your paths (orach)": He will straighten for you even the untrodden roads. . sect. I may stray on it. man must himself know very well how to go and conduct himself thereon. help and support enabling me to go with uprightness and not crooked. He..4 4.e. idem. Though it is difficult to engage in (mundane. This is also alluded in the verse. as mentioned above. 120. blessed be He. Man commits sins because of his desire for the pleasure derived therefrom..' that it be lkhmah (doing them for their own sake).e." This is an important rule: Everything in the universe contains holy sparks.e. sect. hate. Eitz Chayim 39:3.' There are sparks from the "breaking [of the vessel^]"^ even in all of man's deeds. 3. [God]. This desire is rooted in man's appetitive faculty which causes him to desire or loathe something and from which arise the activities of attraction and repuls ion or avoidance. 90.' i. Nothing is devoid of these sparks. See above.^ What are the sparks in 1. a s in 'crooked paths' (Judges 5:6). One is capable of this knowledge and conduct. "Know Him in all your ways [and He will straighten your paths (orach)]. Chaim Vital. and aid and help you so that you will not stray. note 4. Heaven forbid. in the paved road which refers to the commandments-'know Him. 53 and 194. For without Your help.
to be raised and elevated to on high. He bears and elevates the sin to on high. it. There is a form of terhuvah beyond repentance. 1) Virtue and vice. 377. (See Keter Shem Tov. One is unable to do teshuvah. and see there also sect. et passim). however. is not evil.) 4.) are rooted in the seven attributes of the Sefirot (see above. 17. that is. A spark of holiness is then embedded in all actions. i. Shemonah Perakim. ."' 1 T h ~ sIS the princlplc of there bang a rec~procalr elatlonshlp between man's conduct (In thought.e." (Avot 2:l) This may be interpreted as follows: "Know that everything Above is all from you. sect. This is also the meaning of "my sin is too great to be borne" (Genesis 4:13)." (Maggid Devarav Leya'akov. ch.. fear etc. note 6). The appetitive faculty. It leads to good deeds just as it may lead to sin.. 87). and 4 above. t hus in holiness.) This allows for the possibility of feshrrr~ah. if there was no prior sin. one elevates the sparks in it to the Supernal World. Thc various traits that it causes (love. Thus it follows that teshuvah is concealed within sin. sect. forgives. for "he who says 'I will sin and then do teshtrt~ah' is not given the opportunity to do tesluivah" (Yoma 85b). sect. 2. 142 "Know what is above you (lit. speech or deed) below and the effluences or man~festations that come from Above [analomus to the concept of "In the measure with which man measures.a sin? Teshuvah (repentance. sect. 217)-Obviously this does not suggest that one should sin in order to be able to observe the precept of teshuvah. sect. and his commentary on Avot 2:12). 152 and 377. even in sins-though the sin itself is altogether evil.. therefore.: from you). originate there (ibid. of correcting the sin. return unto God)!4 When doing teshuvah for the sin. ~t IS meted out to him" (Sotah 8b). khtrvah is a commandment." of returning to the higher spiritual levels from which the soul originated ($ above. 82. 82. ch. Thus it is written. the observance of Torah and mitzuot and their violations. called "teshuvah ila'ah-the supreme leshrrvah. which applies to the faultless tzadik as well. (See Keter Shem Tov. "Nosei (He bears. lit.: "He lifts up") sin" (Exodus 34:7. one of the 613 precepts [of the Torah]. "Teshrrvah is concealed within sin.
sect. Pesukei DeZimrah to [the World ofj Yetzirah. R. attributing this interpretation to a Midrash. cf: Shenei Ltrchot Haberit. ch. sect. Sha'ar Halefilah. Sha'ar Hagadol. note 41. by man. The Baal Shem Tov thus interpreted "God is your shade. sect. We recite Hodu' between Korbanot (the recitation of the Sacrifices) and Pesukei DeZimrah (the Verses of Praise). 2. therefore. the Mawd's Or Torah. sect. In the Sefardic rite (adopted by R. 145 and 230. so does God relate to man in accordance to his actions. 29. (the reading of the Shema and its blessings) to [the World ofJ Be~i'ah. Isaac Luria. which has the connotation of a wheel. Addenda." (Psalms 1215): As man's shadow copies his every movement. 60. Thus 1. . For the angels in that [world] desire and "roll" to become joined to on high. this chapter is recited before the Pesukei DeZimra (the initial section of the formal morningprayers). and ibid.3 The esoteric meaning of their names is as follows: [The angels] in [the World ofj Asiyah are called Ofanim. sect. as opposed to saying it within the Pesukei DeZimrah.. 3. and Yotzer Or.) The supernal realms are affected. effects a corresponding reaction from on high. the Chayot and the Seraphim.T~h is is the esoteric meaning of the Ofanim. 19. Man's action below. 264 and 300. (Keter Shem Too. 1 and 6-7. 22a. for the following reason: It is well-known that the [segment of] Korbanot relates to [the World ofJ Asiyah. p. These three classes of angels are of the Worlds ofhiyah. Yetzirah and Beri'ah respectively. Addenda. 123. Chaim Vital. See above. 112.sect. Peri Eitz Chayim. A chapter compounding verses of praise to God from I Chronicles 16 and various Psalms. Magid Devarav Leyahkov. Keter Shem Tov. no. as it were. and followed by the Baal Shem Tov and the Chassidk movement)..
they also signify the category of nefesh (soul)$ a term denoting addition and increa~eb.~~'Haat rivarh. however. They derive their life-force from a higher source. 31. In Aramaic.~ec ause they desire for themselves the increase of additional effluence and vitality. was somehow omitted in the printed editions of Tzur. acquiring additional chayut 4. Nalharz. he is purified by means of [the recital of] the Korbanot. That is why Hodu was instituted before. The soul-category of nefejh (which is of the World of Atiyah-Tikunei Zohr 22:68b. The angels of the p o r l d oE] Yetzirah are of a higher rank. Before he can attain great hitiahawl. from here to the end of this section.t (of thc root-word push) means an increasc and expansion." [7 The angels of the p o r l d ofJ Beri'ah are of still higher rank. he starts with lesser hitlahavut. As stated in the Zohar (III:120b). sect. For there is more hitlahavut (burning enthusiasm) in those verses than in Korbanot. etpasim. an Ofan who desires and rolls to be joined unto God. How does [he do so]? By means of the I'esukei DeZimrah. k:3. Hilchot Yessodei Hatorah 2:7). Man is a microcosm which reflects the macrocosm. That is why they are called Seraphim (the "Burning one^"). Thus he is able to be in great hitlahavut when he gets to the Pesukei DeZimra. It is inserted here from Likkutim Yekarim. Z o h r IIl:33b and 257b. That is why they are called Chayot (the "Living Ones"). Avot deR. The different names of the angels relate to their specific ranks (Maimonides. 8. Thus he is in the principle of [the World of] Aslyah. the word nefe. he is without any fear [of God]. Tikunei Zohr 6:23a). Yitro:34h) relates to the Ofanirn (Zohar II:94b. because it is but selected verses which are not really Pesukei DeZimra. 7.^ Man is a miniature universe? When rising from his bed in the morning. Tanhuma. 6. Zohar Chadash. 85. ch. They inflame themselves even more to be joined to on high. as in Targum Onkelos on Genesis 1:22 and Exodus 1:7. . 5. The bracketed part.
vitality) because the hitlahaout is the vitality. and 4 above. . With Yotzer Or he will have yet more hitlahaout and attain the level of the Sera~hirn. 259. sect.~] 9. that in prayer one is t o advance in gradual stages. 32. sect. See Keter Shem Tov.(life-force.
GLOSSARY .
" high. are fully explained in my Mystical Concepts in Chassidism. ~eri'ah*-"porld of] Creation.. ~s s i~a h * . Breaking of the vessels-see below. Avodah trorech gevohah-"service (or worship) for the Supernal 'need' or intent. as ordained in the Torah. marked with an asterisk. ~tzilut*--"[world of] Emanation."wo r lodf ] Action. "standing" as it is a prayer that is to be recited in a standing position). Bitul hayesh-negation of self." the service of God that focuses exclusively on the Divine intent without any mundane or personal considerations. Complex terms. and on its lowest level including the physical universe. the second in the four 'Worlds" or realms in the creative process. and also identified as the level of the Divine Throne. abode of supreme angels and souls. also referred to as Shemoneh Esreh ("eighteen" benedictions).Amidah-(lit. ." lowest of the four 'Worlds" or realms in the creative process. signifying all-embracing * The glossary is restricted to very brief definitions. thus closest to actual Divinity. Shevirat hakeilim Deveikut-"attachment (or cleaving) [unto God]".est of the four Worlds" or realms in the creative process. the state of negating or nullifying ego and all personal considerations in the consciousness of' all-comprehensive Godliness. Deuteronomy 11:22. the main section of all obligatory prayers recited daily.
Hitlahavut-"burning enthusiasm. Gadlut-"greatness". Hislrtavut-"equanimity". Hymns of Praise--see Pesukei deZimra Katnut-"smallness".consciousness of. . Hitbodedut-"seclusion" from the world and people to meditate on. the ecstatic frame of mind in the service and worship of God. thus proper intent in. meditative and ecstatic. Kavanah-"direction [of the mind]". and commune with." and (in Chassidism) referring to the Divine Providence governing every particular entity in the universe. discussions and rulings. opposite of katnut. as opposed to Gadlut (see there). in Chassidic terminology the sublime level of expanded consciousness and apprehension in the service and worship of God. signi+ing strict or rigorous judgments decreed against humans or the world. and concentration on. see there. Hashgachahperatit-lit. fervor". especially in prayer and the observance of Mitzvot. and communion with. Gemara-The major part of the Talmud which consists of the Talmudic traditions. God. * Dinim -"judgments". the state of constricted or restricted (limited) consciousness in the service and worship of God. one's action. "individual supervision. the concept of total indifference to all mundane occurrences in context of the consciousness of allencompassing reality of God. based mainly on the Mishnah. in all human (mundane) engagements just as in worship and other religious involvements. the Divine.
meditating on the "mystical devotions" that relate to the words of prayer (especially the Divine Names) and to the observance of each mitzvah. but assuming a much wider meaning in mystical context. The teachings of R.e. kclipot)*-"shell(s)". Kelipah (pl. attributes". Opposite of shelo lishmah. Mitzvot)-"commandment(s)".. Mikveh-pool for ritual immersion effecting purification from ritual or spiritual defilement. Machshavah zara (pl. Isaac Luria (especially Peri Eitz Chayim and Sha'ar Hakavanot) offer these kavanot. see there. and (b) the corresponding dispositions or charactertraits in the human psyche. Mussar-"instruction for proper behavior". gevurah-rigor or strict justice. i. Mitzvah (pl. Biblical or Rabbinic precepts. (a) The seven "lower" Sefirot or "emotive attributes" of God (chesred-kindness or love. In our context this relates to medieval works . the Kabbalistic term signifying the realms or entities that are evil and impure. machshavot zarot)-"alien thought(s)". any thought extraneous to one's involvement with prayer or worship. and so forth). which include all that is forbidden by the Torah. every Jew's religious obligations. doing something strictly for its own sake as demanded or desired by God. works of mussar offer guidance and inspiration for religous ethics and devotional instructions. Lishmah-"for its own sake". t$ret-beauty or compassion. whether it be a sinful or forbidden thought or simply one inappropriate to the occasion. without any ulterior motives of personal benefit (such as self-aggrandizement or expectation of some reward). ~idot*--"traits. and-in colloquial use-referring to good deeds in general.GLOSSARY 151 Kavanot-plural of Kavanah.
Bachya ibn Pakuda's Chovot Halevovot. Shechinah-"Indwelling".) Nitrotz (pl. Israel Salanter. the Divine Presence or Immanence in creation. (This is not to be confused with the modern Mussar-movement founded in the 19th century by R. and the later writings. Chochmah and Bimh (and in other schemes Chochmah. as distinguished from the Divine Transcendence (usually represented by the term Hahdosh baruch Hu-the . with a mystical slant. evil or forbidden things are nullified when their sparks are extricated by relating to them as prescribed ("passive correction" by abstention or discardment). peniyot)-"ulterior motive(s)" of personal gain or satisfaction. It is man's task to "correct"-"free" or extricate-these sparks by relating to every thing in its Divinely intended context: good or permissible things become sublimated to holiness by using them properly ("active correction").such as R. Peniyah (pl. These sparks "fell" or descended from Above with the shevirat hukeilim. Binah and Da'at). nitzotzim or nitrotrot)*-"spark(s)". thus first praising God before submitting our personal petitions. Pesukei Dezimrah-"verses of praise". such as Reishit Chochmah and Shenei Luchot Haberit. Jewish rnysticism teaches that every entity (good or evil) contains "holy sparks" of Divinity which constitute the very vitality or sustaining force of each. Se$rah (pl. ~e$rot)*-term denoting the ten Divine attributes or emanations through which God manifests Himself in both the creation and sustenance of all beings. These include the seven Midot (see above) and the higher Sefirot of Keter. a collection of Biblical hymns and psalms recited daily at the beginning of the morning-prayers.
in the universe. Joseph Karo. Teshuvah-"return" to God. term for prayer-book Sitra acharaf-"the other side". Shulchan Aruch-title of the standard code of Jewish law. Tikun chatrot-"order of midnight-service". "order". which are to be recited every day and every night. the act of repentance from all sins of omission or commission. thus applying to the nonsinner (the tzadik) no less than to the sinner. as opposed to the side of holiness. but also containing an order of Torah-study. and Numbers 15:37-41.GLOSSARY 153 Holy One. Shcma-"Hear". 11:13-21. midnight-vigil focused on mourning the destruction of the Holy Temple in Jerusalem and the exile of the Jewish people. a central concept in Kabbalistic cosmogony which accounts for the multiplicity. Shelo lishmah-"not for its own sake". which manifests itself in the omission of the proper kavanah or intent. This term is in feminine gender. In the wider sense. Godliness. the first word and title of the Biblical passages of Deuteronomy 6:4-9. the opposite of lishmah (see there). returning to God in the sense of a continuously progressive advance to Godliness. or opposed to. and the presence of evil. a general term for evil. . by scattering the "sparks" from the fragmentation of the "vessels" throughout creation. Sidur-lit. compiled by R. blessed is He). or-in the crudest sense-in the commission of being guided by ulterior motives. while the transcendent aspect is in male gender. compounding anything that is separated from. Shevirat hakeilim*-"breaking of the vessels". In the narrow sense.
but in Chassidic context referring more specifically to extra-ordinary saints. Yetrer hatov-"good impulse". Yichudim-"unifications". * Tzimtzum -"contraction. concealment".g. abode of a lower class of angels than those in Beri'ah. ~etzirah*-"[~orld of] Formation". rooted in the physical nature and "animal soul" of man. World-when this term appears qualified in our text (e. the third of the four "worlds" or realms in the creative process. . the human inclination or impulse to sin by omission or commission. the human inclination or impulse to do good.g. that makes it possible for finite and material substances to come about. Zerizut-"alacrity"... performing obligations with alacrity and zeal. avodah tzorechgevohah. Beri'ah. rooted in the spiritual nature (Divine soul) of man. the four 'Worlds" ofAtzilut." or 'World of Thought") it refers to the relevant spiritual realm or level. the Kabbalistic concept of the contraction and concealment of the consuming intensity of the Divine "light" through a series of stages (e. in the general sense any righteous (pious) person. Yetrer hara-"evil impulse". Yetzirah and Assiyah). acts effecting unifications in the spiritual realms by meditating on the relevant kavanot (see there). Tzorechgevohah-see above. 'World of Atzilut. Ze'eyr anpin*-"small image (or visage)". Kabbalistic term for the compound of the first six midot (chessed to yessod).Tradik (pl. tradikim)-"the righteous". central to Kabbalistic cosmogony.
BIBLIOGRAPHY .
Aaron of Apt. Anthology of teachings of the Baal Shem Tov compiled by R. Kehot. J. ed.] BEN PORAT YOSSEF. Brooklyn NY 1987 . Mosheh Chayim Ephrayim of Sudylkov. Works ARVEI NACHAL. Tzvi Elimelech of Dinov. Jerusalem 1964 KETER SHEM TOV. see DARKEI YESHARIM IGROT KODESH-ADMUR HAZAKEN. Schochet. 2 vol. New York 1954 BE'URIM BETZAVA'AT HARIVASH.. I. Przemysl 1890. R. Lemberg 1921 HANHAGOT YESHAROT. Menachem Mendel of Prezemishlan (Przemysl). Jerusalem 1963 DERECH PIKUDECHA. Schneerson of Lubavitch. 4th edition. Warsaw 1913 DEGEL MACHANEH EPHRAYIM.A. R. David Shelomoh Eibeshitz. attributed to R. Menachem M. Ya'akov Yossef of Polnoy. Levi Yitzchak of Berdichev. Schneur Zalman of Liadi.d. Warsaw [n. R. R. R. Letters by R. ed.. 2nd ed. Brooklyn NY 1980-1993 KEDUSHAT LEV. Chassidic. R. Kehot: Brooklyn NY 1985 DARKEI YESHARIM. with title HANHAGOT YESHAROT.
Brooklyn NY 1954 YOSHER DIVREI EMET. the Maggid of Mezhirech. 3rd edition. Anthology of teachings of the Maggid of Mezhirech. ed. see there. Brooklyn NY 1980 ME'OR EINAYIM. Y. Menachem Nachum of Czernobyl. attributed to R. Anthology of teachings of the Maggid of Mezhirech. R. Ze'ev Wolf of Zhitomir. R. Anthology of teachings of the Maggid of Mezhirech. Ya'akov Yossef of Polnoy. Brooklyn NY 1965 TOLDOT YA'AKOV YOSSEF. . Tel Aviv 1969 TZAFNAT PANE'ACH. Kehot. included in LIKKUTIM YEKARIM. Klapholtz. Yeshivat Toldot Aharon: Jerusalem 1974 MAGGID DEVARAV LEYA'AKOV. Kehot. Ya'akov Yossef of Polnoy. Schneur Zalman of Liadi. ed. Menachem Mendel of Vitebsk. Yechiel Michel of Zloczov. R. Anthology of teachings of the Maggid of Mezhirech. 3rd edition. Brooklyn NY 1962 LIKKUTIM YEMIM. Anthology of teachings of the Baal Shem Tov.LIKKUTEI AMARIM. R. Brooklyn NY 1980 TANYA. and (four of) R. Lemberg 1850 OR TORAH. R. ed. Brooklyn NY 1960 OR HAME'IR. Jerusalem 1960 TORAT HAMAGGID MIMEZHIRECH. Brooklyn NY 1975 OR HIEMET.
London 1960 EITZ CHAYIM. R. R. ed. Warsaw 1891. ed. Judah Loewe.Shabtay of Rashkov. R. Ya'akov Chaim Tzemach. Jerusalem 1963 SIDDUR HA'ARI. in KITVEI RAMBAN. Jerusalem 1980 REISHIT CHOCHMAH. Eleazar Azkari. Mosheh Nachmanides. [Israel] 1975 HA'EMUNAH VEHABITACHON. R. Israel ibn Al-Nakawa. Jerusalem 1976 DERECH CHAYIM. R.1 OR HACHAMAH. n. Menachem Me'iri. R. New York NY 1969 .BIBLIOGRAPHY B. R. Jerusalem 1963 KAD HAKEMACH. Jerusalem 1957 SHENEI LUCHOT HABERIT. New York 1960 MENORAT HAMA'OR. Margolius. Warsaw 1831 CHAREIDIM. R. n. Abraham Brandwein. New York 1929-32 NAGGID UMETZAVEH. R. Jerusalem 1958 CHIBUR I-IATESHWAH. [Israel. Amsterdam 1708 SEFER CHASSIDIM.d. Isaiah Horowitz. R. R. R. Judah Loewe. R. Warsaw. ed. [Israel. Mosheh ofTorani. Chaim Vital. Bachya ben Asher. R.d. R. Other Sources BEIT ELOKIM. Przemysl1896 PEN EITZ CHAYIM. Chaim Vital. ed. Elijah de Vidas. R. Chavel. ed.1 TIFERET YISRAEL. R. Abraham Azulay.
INDEX OF BIBLICAL AND RABBINIC QUOTATIONS IN TEXT .
INDEX OF BIBLICAALN D RABBINIC QUOTATIONINS TEXT* BIBLE Genesis Numbers ch . 1 ................................ 130 12:6 ............................... ... 90 3:6 ...................................... 5 21:23 ............................. ..1 38 3:24 .................................. 58 Deuteronomy 4: 13 ................................. 141 4:22 ............................... .. 111 6:16 .................................. 75 11:16 ............................... . 76 7:l .................................... 75 11:22 .............................. .1 11 12:lO ................................ 64 30:15 ...............................1 30 13:l .................................. 64 I Kings 22: 1 ................................. 132 2:2 ............................... 43, 84 28:21 ............................... 120 Isaiah 29:35 ............................... 132 6:3 .......................5 8, 67, 13 7 37:11 ................................ 17 25: 1 ................................ .. 75 49:14 ............................... 100 49:3 ................................. 1 38 50:2 .................................. 89 Exodus 553 .................................. 76 1:1 ................................... 124 58:14 .............................. .. 87 1:2 ................................... 124 Jeremiah 20:12 ................................ 90 23:24 ................................ 8 4 34:7 ................................. 141 31:2 ................................ . 137 Leviticus Ezekiel 21:12 ................................ 84 17: 13 ............................... 1 38 All references are to the sections in our text . For example. "Genesis 3.6 ... 5 " means that this verse is cited in section 5 .
16 4 TZAVA'AHTA RNASH Michah 98:8 ................................. 139 7:20 ................................. 132 106:2 ............................... 132 Habakuk 119:126 ............................ 46 2:4 .................................... 58 119:160 ............................ 90 Psalms Proverbs 4:5 .................................... 23 3:6 ..................... 94. 102. 1 40 8:5 .................................... 17 3:18 ............................. 2 9, 30 9:2 ................................... 132 12:9 ............................... .. 114 16:8 ....................................2 12:lO 99 17:14 ................................ 90 13:16 ................................ 98 17:15 ................................ 90 15:15 ............................... 131 19:6 .................................. 16 16:3 ................................ .... 4 19:7 .................................. 16 16:5 ................................ .. 92 22:7 ............................. 12, 91 16:28 ................................ 75 24:4 ....................................9 27:19 ............................... 132 27:11 ............................... 140 Job 35:lO ................................. 33 28:12 ............................... . 53 36:4 ........................... 74, 117 33:15 ................................ 90 36:s .................................. 74 33:23 ............................... . 17 41:4 .................................. 43 Song 482 ................................. 138 1:9 .................................. .. 71 48:15 ................................ 64 Ecclesiastes 52:3 .................................. 17 214 ................................. . 90 55:23 .................................. 4 7:14 ................................ . 139 79:1 ................................. 124 7:29 ................................ .. 84 792 ................................. 124 8:5 .................................. .. 17 8514 ............................... 116 Daniel 90:3 ..................................1 8 123. ..............................1. .7 92: 10 ...............................1 39 I Chronicles 92:13 ............................... 125 29: 11 ............................... . 90 97:s ................................1. 39 TALMUD Berachot 8a ..................................... 119 5a 19 30b .......................... ..73, 123 ~ - .
INDEX OF BIBLICALA ND RABBINIC QUOTATIOINN STE XT 165 34b .................................. 125 l1Ob ................................ 131 35b ................................... 47 l l l b ............................. ... 111 43b ................................... 92 Nedarim 55b ................................... 90 41a ................................. ..1 31 Shabbat Sotah 12a .................................... 43 5a ................................. ..... 91 88b ..................................... 9 21b ................................ ... 53 104a ............................. 37. 79 Kidushin 118b ................................. 18 3ob .................................1 . 38 133b ........................ 111. 112 Baba Kamma Pesachim 2a ..................................... 121 50b ........................... .55. 126 Baba Bathra Yoma 16a ................................... 138 39a ................................... 109 Sanhedrin 86b ................................... 43 106b ............................... 1. 1 Sukah Makot 52a ................................... 138 23b ................................ ... 76 52b .................................. 138 Avot Rosh Hashanah 1:14 .............................6 2. 97 16b .................................. 123 1:17 ................................ . 133 Ta'anit 2:l ................. 1. 17. 122. 142 25b .................................. 125 2:lO ................................ .. 96 Megilah 3:14 ................................. 138 18a ................................... 138 4.1 ................................ ... 138 Yevamot Menachot 21a ................................... 138 43b ................................ ..... 5 63b ................................... 43 Chulin 79a ................................... 139 91b ................................ ..1. 32 Ketuvot Nidah 63a .................................... 89 17a ................................ .l Ol a 103a .................................. 90 MIDRASHIM Sifra Sifre . . Shem~nt.. ......................... 84 Va'etchanan ....................1 02
Bereishit Rabba II:128b ........................... 78 47:6 ................................ 139 II:134b ........................... 84 Shemot Rabba 15:4 ................................. 139 Tanchuma Pekudei:3 ........................ 143 Oti'ot deR . Akiva Dalet ................................ 48 Zohar I:221a ............................... 75 I:49b ................................ 130 I:86b ................................. 87 I:100b ................................. 9 I:IIOa .............................. 131 I:119b .............................. 132 I:140a .............................. 132 I:187a 58 III:lOb .............................. 90 III:16b .............................. 75 III:120b ........................... 143 III:159a ............................ '75 111:195a .............................. 7 III:230a ............................ 75 III:281b ......................... 1 . 17 Tikunei Zohar 10:25b ............................. 131 13:27b .............................. 90 18:33b ............................ 43b 21:48b ................................ 6 Zohar Chadash Lech:26a 64
INDEX OF SUBJECTS .
.............. 87. .......... 132 prime cause of spiritual harm .. 139 of impurity ............ 143 created by Mitzvot . obstruction to soul .. 61..... 72.......... in prayer .. Self-esteem.. 120............ ..............136 see Yeridah Tzorech Aliyah Assistance Divine a.......... 71 negation of a......... 89 analogous to begetting rnamzer ......... 138.... 50 Body b.... 11 1. 101 Beinunim ......... 80 b. Sanctimoniousness Ascent 37...... 87 see Self-negation Ba'al teshuvah master of teshvah .......... . 97 identified with Pharaoh ... 71......... ............. 112......... 51......... ..62.............. .... 89 caused by self-esteem........ 113 shame from a.. 97. 169 ..... 139 aspect of soul ..43...... 132..........90..... 55.. 87......... 16..... 116 Alien thoughts a........... 139 see Character-traits Ayin ascent to level of naught.......... 125 Beauty source of b... 20.. 84 Abraham aspect of kindness and love .....I21 Arrogance see Pride............... 140 Attributes of holiness .. .... 89 subduing a.......... 19.I23 Bitul hayesh see Self-negation Blemish ....... 87.. ..... ................. ........ 106 All references are to the sections in our text..... 83..... 64 Absorption ......... 79. 17..... 116 Anger overcome by joy and love .......................................... 62............ 60...... "skin of the snake" ...... 132........................................ 75 Alacrity ..... 87 sublimation of a. 6 health of body affects soul ........Abode man's true abode in upper world ......135...................... 90 Angels ....
............. ..... in part affects the whole ..... 64 Concentration see Kavamh Consciousness c..service of God wlth b.. . 84 Da'at bonding and deveikut ....94............. in Shechinah .. Sadness ......... 104... 131.I43 Choice.... 46 see Teshuvah Coupling attitude to c ............. ............ 105 see Soul Breaking of the vessels see Shevirat hakeilim Brother honoring older brother ................. .. katnut Contemplation....... "workers of iniquity" ....... .. 88 human c.... of Divine Presence .. .... 43........... Day(s) day and night .. with Shechinah ... and soul ... 1 Chatzot see Midnight Chayot ................................. 122 pursuit of good c.66.................. 73 d... 90 Character-traits evil c.............. .. 98................. 14...... 139 evil c.... 98............ 99 conduct with d....... 73 Depression see Melancholy............................. 127 Commandments see Mitzvah-Mitzvot Compassion c. .. ...... 101 prayer is c..................... elicits Divine c.................. 137 restricted c. .... for Shechinah . 58.......................... 90 Mitzvot every day .................................. 83..... .......... 112 Concealment c............................. precluded by continuous worship . 97. 82 Contrariness of holy and impure ... 1 weekdays and Shabbat.... 52 negation of evil c... . 68 Creation ... 129 expanded c......... ................. Freedom of c.............. 85 Deception see Yetzer hara Deficiency d................ of actions .... 139 Contrition ....I29 seegadlut...............
..... mundane d..... .. 101 remedy to negate d... cause of d... 56 for Mitzvot ...... 55 Desires.Descent see Fall........ Yeridah Tzorech Aliya'ah Desire for fasting................ .... 13-14 ....... 5.............. ....
63...... 62.... ...... of thought . ... . .... 29.. 96 f... . 101....... 121 incite yetzer hara .. 6... in speech ......... ..5.5. . . .... .... . 105 initially below. 6.. . 10 leads to ru'ach hakodesh. 10.. ..... 80 d. ....... 59. ............ 97 Dov-Ber of Mezhirech.. ... ..... subdues the kelipot ...... ... . . ...84. 58........ .........137 Elevation see Sublimation Elokim attribute ofjudgment . 135 leads to equanimity ... and Torah-study .. .. ... of tzadik . .. ..scorning d. 39. .. .... .....30. 61... .... . .. 53 Esau . 30...... ..... 136 d.. 10. 67..... 11 I facilitates pure service of soul ... ..38. R 5 Dreams .. . . .... ..... 3 1 Devotion see Kavanah Devotions see Kavanot Din . ... ..58.. ........ .. in prayer .. 32.. .... . ... Kelipot Faith ........ . 82 d. .... 64.......69. to letters of Torah ............. 1 23 attainment of d... 9 Deveikut 3............ ... . .93.......... ............. . .. ... 137 Fall f. ... .... . ...... .... 102 Enthusiasm see Hitlahavut Enticements see Yetzer hara Equanimity ..... ..... . 87 Evil see Good and Evil. 90 Eating and drinking excessive e .... ..30 d.... ... from one's leve1..... 29.... 56 . ..... ...... .. beyond time of prayer ..... 75. .. .I31 proper intent with e.... .. ... 90 Egypt see Mitzrayim Ein Sof. ... ........ . ...dinim see Judgments Divestment from mundane . ....... . ....... 37 d. . . ... 58...... 12..... . ... . 127 generated by deveikut ..91..... 127... . ..I27 spiritual root of tastiness... then Above ....... . 81 d. .. 40.... . 84.... 5... .. ... 96 see Yeridah Tzorech Aliyah Fasting corrects soul ... ... 84.
. . .. . .... .. inseparable .. 43.. ...21.. 78... 11 0 f. . . ... .... 56 proper thoughts when f..... 136 . .79 teshuvah is essence o f f .necessity of both . . .. ..... ... . . 43 ulterior motives for f....... 128 . . and love of God . .. .. 79 Fear of God . and joy... . ... .. .. . 77 yetzer hara opposes f..... 23 f. ...indulge desire for f.. . . ..43.. 131. .. .
gateway to God ................ 66 results from contemplation ....................................... 66 safeguards reverence ..... ,128 Fool ..................................... 98 Forgetfulness caused by quarrels and pride ....................................... 49 caution not to forget .......... 1 Gadlut gadlut and katnut .............. 129 state ofyadlut ...................1 37 Galuf cause of g. ....................... 124 Gazing (Histaklut) effects of g. ....................... 50 g. at mundane things ............................... 90, 121 g. at people ....................... 50 g. for self-gratification. .... 90 g. forsake of deveikut ........ 80 God gazes at man ... 134, 137 see Perception Good and evil ........... 103, 130 Gradualism in worship ............................ 32, 65, 143 Haphazardness. ................ 3 1 Happiness see Joy Harm primary causes of spiritual harm ............................. 121 Hashgachah peratit ..................... .2-3, 4, 84, 120 Havayah denotes mercy ................ 102 Health physical health affects soul ...................................... 106 Heedfulness h. with "minor" Mitzvot ............................1 , 17, 122 Hitlahavut 55, 68, 86, 87, 105, 11 1, 118 Holiness generated by gazing at people with deveikut ............ 50 see Attributes Humility ........... 12, 49, 77, 91 mark of true worship ..... 114 Idolatry diversion from God tantamount to i. .................... 76 self-indulgence tantamount to i . ................................ 90 Illuminations of the Baal Shem Tov .......................... 41 Immersion in mikveh ....... 15 Important principles and
rules 4, 10, 16, 17, 19,25,44,46, 49, 81, 84, 90, 94, 95, 109, 126,141 Intent see Kavamh Isaac aspect of fear .............8 7, 139 Israel term for tzadik ................ 138
INDEX OF SUBJECTS 17'3 Israelites can praise God at all times ............................. 132 Israel Baal Shem Tov. R 1. 10. [17-191. [41]. 75.76. 93. 96. 100. 101. 106. 109. 120. 124 Jacob aspect of tijeret ................. 139 Jerusalem see Yerushalayim Joy .................. 9. 15. 43. 46. 56 constant joyfulness .110. 137 generated by yichudim ...... 75 j . and fear inseparable ..... 110 prayer with j ........... 107. 108 service of God with j . .44. 45 sweetens judgments ....... 132 Torah-study with j .......... 51 Judah see Yehudah Judgments .................... 16. 87 man's j . after death ......... 116 sweetening ofj ............... 132 fitnut k . andgadlut .................... 129 service in state of k . ............ 67. 69. 96. 101. 135 Kavanah ................... 40. 60. 72 k . is soul-aspect ...... 116. 126 Kavanot k . for donning talit ........... 21 k . for eating. ....................1 27 k . for fasting ................ 43. 77 k . for mikveh ..................... 15 k . for prayer .............. 73. 118 k . for sleeping ............. 22. 23 k for Torah-study ........... 119 k . for voidance ................. 22 Kelipot .......... 9. 58. 71. 90. 124 Kindness acts of k . towards God ..... 17 Divine k . that one survives prayer ................. 35. 42. 57 Letters (of the aleph-bet) attachment to 1 . of Torah ...................................... 111 contain 'Worlds. Souls. Di. . vinity" ............................ 75 every letter a complete world ............................1 18 God vested in 1 . of speech ...................................... 108 seeing 1 . of prayers ........... 40 Levels attainment of spiritual levels 37.40.41.58. 64. 65.78.
96 pursuit of spiritual levels ....................................... 4:7 Levi .................................... 124 Love evil love ............................ 87 God's love for Israel ....... 138 holy 1 ................................ 87 1 . of God .............. 36. 84. 132 I . and fear of God ... 131. 136 - necessity of both .......... 128 I . of the mundane ........... 103 Luria. R Isaac .............. 82. 90
.44.......... . Kavanot................. mer~torlou... 17.... 2-3.. 112 . 17.............. Service of God ulterior m.... 42. 90..... 117 Names............ ....... 124.. 64 Mitzvah ... 100 Melancholy ..110 see Sadness Midnight to rise at m. 129 observance of as many m...... 47....................... 132 Negation n............. "for the sake of God" .83 Mikveh see Immersion Mitrrayim aspect ofgalut ....73............ 138 Names of Tribes .. 55.... 77............. 116 act of m.... bodily movements Motives proper m.. 26... 127 ulterior m....... 15....... good in itself ..... 95... 116 heedfulness with "minor" m............. 124.. 11. .......127 see also Kavanah................. 122 katnut andgadlut with every m.............. 55 observance of m... 92 removal of ulterior m... ...................s....... 122......... 123......138 Matter m..... as possible ...................... . creates angel ... .... of Torah-study primary cause of spiritual harm 121 ..Mitrvot act of m............94... 90 Motions see Prayer... every day . 57 Mussar study of m. prompted by self-esteem . 1.................. 47. 17 pursue desire of m ..... 124 aspect of kelipot .46.. . 90..... 84. 102.............. 116 Moses ...................115.. Divine N.. and form .............. 226..................... .. 90 see Self-negation Neglect n....... 1..... .............. 16... 1...... ...Machshavah zara see Alien thoughts Mark of true service 114. 28... 95....... of desires ..... 55 precede man after death... 17.... .. ...............
..... to day by Torah and prayer ...... 109...... to day .96........ 127... .... .................... 109.... 83 Nitxotzin elevation of n........................ 141 n....... 90 joining n.......... ...... 27 emergence of vital force at n. inherent in every thing ......Night converting n... 141 ...............................
129............................... 37..............86..4 ........ in holiness and impurity .. 107.. on weekdays and Shabbat . 86 p .....6 0........... preceded by sense of fear .... is union with Shechinah .................... 131 Prayer alien thoughts in p .................................... 73 p ........ for the sake of the Shechinah ........ 39 innate attributes of Israel . ............... ............ 58 p .................. ..... 84..... Isaac. 84............... with eyes closed . 101.71.....134.2 7...................... 68.. Jacob Pauper to regard oneself as p ......................... 138 Patriarchs aspects of p ................ 137 Parables 72. 97 ascent in p . 109 Ofanim ................... 143 Omnipresence of God awareness of o .... 85........ 67.............. 32.... always effective .. 19. 137 Pilpulim inauthentic p ........ 7 Perception of God . 139 see Abraham......... 106 with hithhavut ........ ....84 requires proper health ..... even when unable to concentrate properly .. 72 "falln during p ... 87............. 16 p ...1. 105......... 115.... 62..6 8 p ....... .....132........... 40 reliance on God's judgment .................... at sunrise ............. 118 with intensity .................. related to individual souls ..... 72.... 104.... 105 deveikut in p .............. in knowledge ... 111.......... 66 p .... 123 p . 40 reading from Sidur.....................8 5. 31. 117 Poverty p .............. 123 p ........................ 58..62............................. 97 effort to pray with kavanah .. are Providential ................................ 139 chariot ......... 61..... 32.....130......... 120 divestment from physicality .n ........... preceded by sense of humility .. 131 p ........ 143 bodily movements in p .... 58 disturbances in p . 59........ 73.. 85..
..35. 108 with kavanah 32..123.. 33... wlth joy . 131 with low voice ....... ...72......126.. 33 Prayerbook see Sidur Pride (Arrogance) . 108 ..122. 34.. 61. 35.......123..... 60. 58.......41..124. 131 .....57. 107...34... 14...42.
......... 48............................... 116......... 56 enticed by yetzer hara ....... 17 r.... Selfesteem... 62... ...... from fasting ... 43 s... 3... to avoid spiritual harm..... 55..........constant worship precludes p .... 142 Remedies r......... 116 see Reciprocity Revelations merited by the Baal Shem Tov . 82................. to negate evil charactertraits ....... 15 prayer in state of s ......... 44.....1 2........... ............................. 63.......... 90 Providence see Haslgachah peratit Psalms recital of P ...... 42.. .......... 55...... 74.. 57.................... 107 repugnant trait ... causes depression .... 31......... 91 Prophecy .. 14 r. from service of God .....48 s.. 44 must be avoided . 43 see Sanctimoniousness.. 133 Self-amiction s.......... 8...... with ulterior motives ..... leads to forget Creator 49 self-esteem from one's service ........ 87 self-esteem from fasting.... 46 Sanctimoniousness see Pride (Arrogance).... Self-righteous Seclusion... 52 p...... 55.... 57..... 48..... 74 Self-satisfaction see Self-esteem.............. 97. 56 s...... cause forgetting God . 49 Reciprocity . 46 caused by self-affliction .. 47 see Fasting Self-esteem (Pride) ..... Selfrighteous ........... 122 see Pride (Arrogance). 38 Quarrels q................. 42.................. 41 Reuben ....... 132....124 Sadness (Depression) barrier to service of God .. 87 s......... blemishes . Self-esteem Pride........... ...... 101 Self-righteous worse than wicked ......... to negate sinful desires 13 Retribution.. 112. 57... Sanctimoniousness Self-negation ........... 92 p.. Positive p............... from performance of Mitzvot ..
........ precludes evil ......... 52 ... and "child" ............. 132 true s................ from God tantamount to idolatry ...... 76 Seraphim ................................. ......Separation s....... ...... 85.................I43 Sewant of God levels of s. 115 Sewice of God continuous s...
....... ....... 130.. 114 on weekdays and Shabbat .... ...... 131 observance of S .... 67..................... 101 s ... 40 Sight all perceptions to be linked to God .... 68........... 143 praying from S ..............122..... mistaken for virtue ... 96 mark of proper s ... ...33 holy sparks hidden in s .................... 2............ 94... 22 in state of katnut . 47 tlves in all possible ways .... 40 see Gazing...... ........ 45....... Shimon bar Yochai..... 115..... see Mo. 18 Divine service on S .. 137 personal effort ...... 69 supports man ... 43 World of Speech ........ 18 Shame sense of s ... 131 perfect s .. Shimon....127. 127.... 89 Shechinah always with man ...... 134 effects of s . when overcome by alien thoughts in prayer ............... over speech . 1....... In face of insults ......... 104........ from alien thoughts . 69...... 84................. 75..... 23....... 5...... 137 compassion for S ...8..................... 44............... 44....2....... 121.... 141 negation of sinful desires 13 repugnance of s ......................... 58................... 5.... 49 s .....levels of S .47...... 49 s.. 120............... 105 Shabbat aspect of teshuvah ....... 138 with animal soul ......46................... 114...... 110 with sou1 ..... 16.... 124 11.. 73 deveikut with S ........ 117 Sidur order of morning-prayers ........ .......85....................... 1..123........ 22..for the sake of Heaven .... 88 "deficienciesn in S ..... 56 ........ 141 Shulchan Aruch essential to study S .. 123 Shema reading of S ... 44.... 133 leads to humility . 99 with joy ......... 73....... 43..... R 95............... 138 marked by humility ............................. '74 Sleeping .... Perception Silence advantage of s ... 88.. with joy and fear .. 19 Shevirat hukeilim .........3. '71 Sin ...
................ 1 2 6 ..... 27 Slothfulness ............. 22.............. 20 avoidance of sleepiness .....................arising at midnight .......... 22 arising from s ........ in day-time ... 23 s . 28 proper intent for s .......... with alacrity ...
........1 03............ 103 garment of the soul ................ 140 s ................... 127.. 87 significance of first t ................... is holy spark inherent in sin ................... 109... 58......... 105 Soul.............. 141 wicked can always do t .... 81 evil s .... 58.................. 17 related to specific sparks in the mundane ....... of speech ......... ... 96..... 31.......... 87............. 21 Teshuvah essence of fasting ............ 68 Stringencies of the law ....Soul Sublimation descent and ascent of s .................. 29 illuminates through Mitzvol ..... 102 Talit .... 109 see Vitality Stirring of self by bodily motions ..................... 18 t ...... joined to Divine service ...... 64 s .. 104. .......1 20 s ............. 71 deveikut in s ................ 30.......... 108 good s ... .......... . 127 s ................... 43 Shabbat is aspect of t. 8 sever1 kinds of t. 103 related to Shechinah........ removes vitality ........ 89 seclusion oft .. 141 s.... inherent in every thing ... 99 Sparks see Nitzutzim Speech aspect of "horses" ................ 87 male and female aspects of t ....... 127 see World of Speech Spirituality s .......... 74 Tetragrammaton see f-lavayah Thought(s) consideration of t...... with Shechinah ............22........ 90 Suffering effects atonement ................. 87...... 90 evil t ....... animal s .... 56 traits ............... of sparks 96........... ...... 1.................. elicits goodness ............................... of thoughts .. 44.......................... 136 vitality of man ... upon . strengthens forces of evil ... 4. of feelings and characterfurbished by Torah-study .. 46........ 109 worship with soul ................. with love and fear of God .. 101..... 120.............
92 t ................ is soul (inner reality) of every thing .... 25 sublimation of t. 84......... in service of G .. 126 ... . 116 ........ 90 t .......... . 69 t . arlsing .8 7... is reality of man ................ is a complete structure .. 104 t .
.. primary cause of spiritual harm ...... 34.......... essential . 112...... and deveikut . 43 u............................ of subjects that promote fear of Heaven .... 54 T....... 113 with joy ............. ofworld of Speech with World of Thought .. 31 t....... 74 t........ for the sake of Heaven Ulterior motives see Motives Unification u.. 113.......................... ........ 29 T............... 96 uniqueness oft.........l25 concerned to increase merits . .. 119 with joy. 139 Universe . 102 conquered his yetzer hura ............................. 121 T....... of soul by fasting . 5. 109 t.. during deveikut ... Kavanah Tikun t.......... 50 referred to as E-1 ............... 117 with intensity ..... 123 "fall" oft............ 56 see Sublimation Torah antidote to yetzer hara ...... blessed is He .. ............ 138 devoid of ulterior motives . 51....30.. 138 concerned about others..... 138 garment of God .... .. 84...................................................................... 96 gazing at t. fear and love ............. . 33................. 138 self-concerned t... 96 unites Worlds of Speech and Thought .. of holy sparks ........ 123 Unifications see Yichudim Unity and separation . of Shechinah and the Holy One.. to become attached on high ........ 137 Tzorech gevoha h see Service of God.........29. 6.....'s level of katnut ... 24..... . 29 T............... 125 self-imagined t .. 31 see Torah-study Torah-study neglect of T...... 51.t.1 23 Tzimtzum ... 58 see Alien thoughts.....I11 guide for human actions... 119 Tzadik causes supernal delight............ enhances personal holiness . furbishes the soul .
......... .... of man .45. 107 Wicked better than selfrighteous .....6... ....... in every thing90.... 74 Wise person .. 84 Vitality.... as naught ......90. 109..127 v. 98 ... 127 Weeping good and bad w....u... ..l03... Vital force speech is v.... ................
.. 34 extending each word ........ 75 w . must be made to shine ... 78 y ................Words of Torah and Prayer each word a complete structure ........... 82 Yom Ke pur ..................... 3............46............. 132 Yeridah Tzorech Aliyah .... 117 promotes depression .......... 34............... ................. 9............. 118 Worlds Supernal World true abode of man ........ 124 Yetzer hara deceptions and enticements of y .... 74... 88 see Shechinah World of Thought ........................... 138 tries to prevent fasting ....................... Yetzirah and Beri'ah .... 123 Worlds ofhsiyah... 12 Worship see Prayer...................... incited by food and drink .. 75.. 135 Yerushalayim ........... 44 subduement of y ..................................... Service of God Yehudah ...39.. 44.. 55............ 231 Yetzer tov .... 9 Yichudim ....... 84 World of Freedom .... 79...4 ...1 20 World of Speech ..... 78....................... 43.......6.1 43 Worms analogy between man and w . ................ 123 ................ 78 Torah is antidote toy .... 70 w ............ 12 serve God ..... to be uttered with intensity ...................................................................... 22.......
APPENDIX .
) . Schatz-Uffenheimer somehow skipped nos. Dov Ber of Mezhirech's Ma& Devarav Laya'akov: 1) ed. SchatzUffenheimer (Jerusalem). 11 and 136 in its numbering. The following table offers the equivalent numbering in the other editions. Toldot Aharon (Jerusalem). All references in this work are to ed. Kehot.There are currently three principal editions of R. (Note that ed. Kehot (New York). and 3) ed. The major difference between them is the editors' division (thus numbering) of the contents. 2) ed.
p nr* *t5 anxn Npwtn ntn .5~ptn)*S ~ N.or5w t t ~ .s*N** 3mn onmi .5 m n~ l n *mn *nn* >D*t Nt**S3 12 Stt2*lN )an524 .n nn*a rt .awn*a tt.ao n ~ a ~ 5nlp lnjrn* pnr* 5 t * *N~J SYWDn a nJn 5't~Vno n ~ n.
|
https://www.scribd.com/document/129676035/Tzava-at-HaRivash-The-Testament-of-Rabbi-Israel-Baal-Shem-Tov
|
CC-MAIN-2018-13
|
en
|
refinedweb
|
This is one of the 100 recipes of the IPython Cookbook, the definitive guide to high-performance scientific computing and data science in Python.
Many frequentist methods for hypothesis testing roughly involve the following steps:
Here, we flip a coin $n$ times and we observe $h$ heads. We want to know whether the coin is fair (null hypothesis). This example is extremely simple yet quite good for pedagogical purposes. Besides, it is the basis of many more complex methods.
We denote by $\mathcal B(q)$ the Bernoulli distribution with unknown parameter $q$ (). A Bernoulli variable:
import numpy as np import scipy.stats as st import scipy.special as sp
n = 100 # number of coin flips h = 61 # number of heads q = .5 # null-hypothesis of fair coin
xbaris the estimated average of the distribution). We will explain this formula in the next section How it works...
xbar = float(h)/n z = (xbar - q) * np.sqrt(n / (q*(1-q))); z
pval = 2 * (1 - st.norm.cdf(z)); pval
You'll find all the explanations, figures, references, and much more in the book (to be released later this summer).
IPython Cookbook, by Cyrille Rossant, Packt Publishing, 2014 (500 pages).
|
http://nbviewer.jupyter.org/github/ipython-books/cookbook-code/blob/master/notebooks/chapter07_stats/02_z_test.ipynb
|
CC-MAIN-2018-13
|
en
|
refinedweb
|
Opened 7 years ago
Closed 7 years ago
Last modified 7 years ago
#8617 closed defect (invalid)
SVN post-commit hook fails
Description (last modified by )
I tried to use the SVN post-commit hook, but was unable to make it work. When I enabled logging (commithook.log) I got the following error:
ERROR while processing: Unable to get database connection within 0 seconds. (TracError(<babel.support.LazyProxy object at 0x898175c>,))
Attachments (0)
Change History (13)
comment:1 Changed 7 years ago by
-?
comment:2 Changed 7 years ago by
Meant to include this snippet above
import trac.env e = trac.env.Environment('/path/to/your/trac')
comment:3 follow-up: 4 Changed 7 years ago by
Replying to bobbysmith007:
-?
1) The database works, I think?
2) No, nothing more in the log
3) I used the post-commit from TimingAndEstimationSVNPostCommitHook
3a) Using the simplified post-commit-script resulted in this in the logs:
[14:01:09] 2011-03-18 in svn post commit : <path/to/repo> : 1634 [14:01:09] TracEnv:</path/to/trac/env> Repo:<path/to/repo> Rev:1634 Auth:fredrik
But nothing shows up in Trac.
4) Could execute the two commands in comment:2 without errors
comment:4 follow-up: 5 Changed 7 years ago by
- I assume you adjusted all the paths appropriately?
- Did the trac post commit log have anything interesting in its log (like more instances of
ERROR while processing: Unable to get database connection within 0 seconds. (TracError?(<babel.support.LazyProxy? object at 0x898175c>,)) )
- Can you execute
/usr/bin/python /var/trac/trac-post-commit.py -p "$TRAC_ENV" -r "$REV" -u "$AUTHOR" -m "$MESSAGE" 2>&1(filling in the appropriate variables?) Does it work at all?
- Are you sure that the user these end up running as all have appropriate permissions?
- The place where that error would be the only one in the log, is on opening the environment. If the user executing the script didnt have permission tot eh filesystem in that location or something, I could imagine it manifesting in this way.
Just shooting in the dark at various troubles I have had in the past and how I debugged them.
comment:5 Changed 7 years ago by
comment:6 Changed 7 years ago by
The new error is different, but seems somewhat related (environment is failing to load correctly). Previously it seemed like connecting to the database was broken, but now it is connecting to the source control repo.
self.env = open_environment(project) repos = self.env.get_repository() repos.sync()
- Do you correctly have the repository you are trying to post from, setup in trac? (You can see it in the browser)
- Is it the "default" repository?
- Do you have more than one repo?
This version of the script has only been tested against a single "default" repository. If you only have a single trac with a single repo, this post-commit should be fine.
The post commit I use is more complex, but does handle multiple repositories. I have not included it because it contains code specific to my environment that is somewhat difficult to disentangle (about building links to gitweb for non trac git repositories and handling differences between git and svn repositories across our various trac instances). I can post that if you think that might meet your needs better, but it will definitely be a more complex setup and will require digging through the code to get it behaving exactly as you desire.
comment:7 Changed 7 years ago by
I do know it is not the "default" repository, but it is the only one present.
comment:8 Changed 7 years ago by
Not sure about the "default", as it seems unnecessary to specify that if there is only one. This is a working repository configuration for me.
[trac] repository_dir = /var/svn/test-svn repository_type = svn
With it I can execute the following in python shell and get a repository object back.
import trac.env e = trac.env.Environment('/var/trac/test-svn/') e.get_repository()
This is what the post commit is complaining about. Can you execute it and get a repository object?
Sorry this has been such a pain to get working. I am sure we will get it eventually though,
Russ
comment:9 Changed 7 years ago by
comment:10 Changed 7 years ago by
comment:11 Changed 7 years ago by
There is only one reference to sync, so the error
'NoneType' object has no attribute 'sync' must come from that one location, which makes it seem very much like that the error is opening the environment.
Perhaps try adding these log messages near where the error messages are occuring, as they might shed light on why this is being problematic.
class CommitHook: def __init__(self, project=options.project, author=options.user, rev=options.rev, url=options.url): log ("About to Open Project: %s", project) self.env = open_environment(project) repos = self.env.get_repository() log ("Got ENV : %s - Repo: %s", self.env, repos) repos.sync() ...
Sorry this was supposed to be posted last friday :(
comment:12 Changed 7 years ago by
Found the problem after adding those log messages: triple checked my trac.ini, and found out that
repository_dir was empty.
Does repository information get stored in different places, since everything else worked before?
comment:13 Changed 7 years ago by
Trac 12 changed how repositories are setup, allowing multiple repos for a single trac instance. The repository_dir key is no longer the only way to configure a repository in trac, but that had previously been "the way" that this was configured.
My guess is that repository configuration dir can also be set as follows and have everything in trac work (other than possibly this post commit (not sure havent tried this alternative config with this post commit)). Perhaps this is how the trac installer installs this by default now; I'm not sure because I use a very custom install process.
[repositories] .alias = design # set design to be default design.dir = /var/svn/Design design.url =
|
https://trac-hacks.org/ticket/8617
|
CC-MAIN-2018-13
|
en
|
refinedweb
|
I am writing a program for class that reads in a set of ordered pairs from a file and implements the k-means algorithm to identify data clusters. This involves the use of the distance formula, which requires the calculation of a square root. As such, I have included the cmath library, and used the sqrt() function, and everything compiles correctly. However, at run-time, the program generates an infinite loop, which I have determined in gdb is caused by the use of the sqrt function, which causes gdb to generate the line "w_sqrt.c: No such file or directory." I have a similar unresolved problem with the rand() function from the cstdlib library, however I am unable to replicate it until the sqrt() problem is resolved.
Note: This is my first time posting a question on StackOverflow so I apologize in advance if I have overlooked any conventions or rule of posting here.
Additional note: Please limit feedback to that directly related to the problem I have described above. For reasons of academic honesty, I am not seeking advice on the implementation of the k-means function, I am simply trying to get the program to run so that, if there are further problems, I can identify and solve them myself.
Thank you in advance.
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cmath>
using namespace std;
const int ARRAY_MAX = 1000;
//DECIMAL_MULT = 10^(required number of decimal places)
const int DECIMAL_MULT = 10000;
struct node{
double xVal;
double yVal;
char symbol;
int clusterIndex;
};
//Returns the distance between the two input nodes
double getDistance(node A, node B) {
double xSquare = ((B.xVal - A.xVal) * (B.xVal - A.xVal));
double ySquare = ((B.yVal - A.yVal) * (B.yVal - A.yVal));
double result = sqrt(xSquare + ySquare);
return result;
}
int main(){
int numNodes = 0;
char temp[ARRAY_MAX];
string filename;
ifstream file;
cout << "Enter the name of the file to be read: ";
getline(cin, filename);
file.open(filename.c_str());
//Check the number of data entries present in the file
while (!(file.eof())) {
numNodes++;
file.getline(temp, ARRAY_MAX);
}
numNodes--;
file.close();
node list[numNodes];
file.open(filename.c_str());
//Build a list of data points
double xMin, xMax, yMin, yMax;
double value;
file >> value;
file.ignore();
xMin = value;
xMax = value;
list[0].xVal = value;
file >> value;
file.ignore();
yMin = value;
yMax = value;
list[0].yVal = value;
for (int i = 1; i < numNodes; i++) {
file >> value;
file.ignore();
list[i].xVal = value;
if (value < xMin) (xMin = value);
if (value > xMax) (xMax = value);
file >> value;
file.ignore();
list[i].yVal = value;
if (value < yMin) (yMin = value);
if (value > yMax) (yMax = value);
}
//Prompt user for number of clusters and symbol to be used for each
int numClusters;
cout << "Please enter the number of clusters to be analyzed: ";
cin >> numClusters;
cin.ignore();
node centerList[numClusters];
char usedSymbols[numClusters];
char entry;
bool validEntry;
for (int i = 0; i < numClusters; i++) {
centerList[i].clusterIndex = i;
do {
validEntry = true;
cout << "Please enter the character representing "
<< "cluster " << i + 1 << ": ";
cin >> entry;
cin.ignore();
for (int j = 0; j < i; j++) {
if (centerList[j].symbol == entry){
cout << "Character has already been "
<< "used.\n";
validEntry = false;
break;
}
}
} while (!validEntry);
centerList[i].symbol = entry;
}
//Assign random starting points to cluster centers
srand(time(NULL));
int xMaxCast = xMax * DECIMAL_MULT;
int xMinCast = xMin * DECIMAL_MULT;
int yMaxCast = yMax * DECIMAL_MULT;
int yMinCast = yMin * DECIMAL_MULT;
int xRange = xMaxCast - xMinCast;
int yRange = yMaxCast - yMinCast;
int randValue;
for (int i = 0; i < numClusters; i++) {
randValue = std::rand() % xRange + xMinCast;
centerList[i].xVal = randValue / DECIMAL_MULT;
randValue = std::rand() % yRange + yMinCast;
centerList[i].yVal = randValue / DECIMAL_MULT;
}
//Determine the cluster of each node
for (int i = 0; i < numNodes; i++) {
list[i].clusterIndex = centerList[0].clusterIndex;
for (int j = 1; j < numClusters; j++) {
if (getDistance(list[i], centerList[list[i].clusterIndex])
> getDistance(list[i], centerList[j])) {
list[i].clusterIndex = j;
}
}
list[i].symbol = centerList[list[i].clusterIndex].symbol;
}
bool proceed = true;
double average;
int clusterCount;
while (proceed) {
proceed = false;
//Move each cluster center to the centroid of its currently
// assigned points; if all centers are already in the
// correct positions, discontinue this operation
for (int i = 0; i < numClusters; i++) {
average = 0;
clusterCount = 0;
for (int j = 0; j < numNodes; j++) {
if (list[j].clusterIndex == i) {
average += list[j].xVal;
clusterCount++;
}
}
average /= clusterCount;
if (centerList[i].xVal != average) {
proceed = true;
centerList[i].xVal = average;
}
average = 0;
clusterCount = 0;
for (int j = 0; j < numNodes; j++) {
if (list[j].clusterIndex == i) {
average += list[j].yVal;
clusterCount++;
}
}
average /= clusterCount;
if (centerList[i].yVal != average) {
proceed = true;
centerList[i].yVal = average;
}
}
if (proceed) {
//Update cluster assignment of each node
for (int i = 0; i < numNodes; i++) {
for (int j = 0; j < numClusters; j++) {
if (getDistance(list[i],
centerList[list[i].clusterIndex])
> getDistance(list[i],
centerList[j])) {
list[i].clusterIndex = j;
}
}
list[i].symbol =
centerList[list[i].clusterIndex].symbol;
}
}
}
}
Note that in an expression like
centerList[i].xVal != average (i.e., an int is not equal to a double), both values will be compared as doubles. This ends up being a terrible way of comparing floating point numbers, and this is widely discussed.
But here's where the real problem happens.
centerList[i].xVal = average; does not assign
centerList[i].xVal to
average but
(int) average (the nearest integer to
average towards zero). This leads to a condition that is infinitely repeated. If
node::xVal and
node::yVal were doubles or the not-equals comparison was fixed by comparing integers or the not-equals comparison was fixed by appropriately comparing floating point numbers, then the program will likely not loop indefinitely (it did not loop indefinitely for the input that I tried).
Note that using the flag
-Wconversion, warnings for
centerList[i].xVal = average; and
centerList[i].yVal = average; appear. Additionally,
-Wconversion is not covered by either
-Wall or
-Wextra. I have found that
-Wconversion is a worthwhile flag to use when developing code for numerical algorithms even though it may produce many seemingly benign warnings. Everything is fine and dandy until a devastating implicit conversion from a
float to an
int causes a massive relative error.
I would hypothesize that
gdb indicated
sqrt when you inserted a break point because
sqrt is relatively expensive and called frequently.
gdb simply couldn't find the source for
sqrt (maybe because the source isn't installed on your system).
|
https://codedump.io/share/VwqxATCTHVQu/1/functions-from-cmath-generate-run-time-infinite-loop-no-such-file-or-directory
|
CC-MAIN-2018-13
|
en
|
refinedweb
|
Changes for version 0.1.11
- Using dbh_maker in a hash to connect() will not result in connect() passing through your arguments after merging into a single hash.
- Using a code ref for the first argument will now result in connect() passing through your arguments as-is.
- README.pod symlink replaces pod2markdown use (YAY!)
- namespace::clean used to prevent methods from leaking
- Merge functionality replaced with Hash::Merge
- Additional attributes passed to connect() will now overwrite the loaded configuration file.
- Removed Test::MockObject as a dependency
- Improved caching layer to prevent stale cache
- Changed tests to use the correct password attribute
- Updated Documentation
Modules
- DBIx::Class::Schema::Config - Credential Management for DBIx::Class
|
https://metacpan.org/release/DBIx-Class-Schema-Config
|
CC-MAIN-2016-44
|
en
|
refinedweb
|
import org.apache.http.nio.ContentEncoder; 33 34 /** 35 * A content encoder capable of transferring data directly from a {@link FileChannel} 36 * 37 * @since 4.0 38 */ 39 public interface FileContentEncoder extends ContentEncoder { 40 41 /** 42 * Transfers a portion of entity content from the given file channel 43 * to the underlying network channel. 44 * 45 * @param src the source FileChannel to transfer data from. 46 * @param position 47 * The position within the file at which the transfer is to begin; 48 * must be non-negative 49 * @param count 50 * The maximum number of bytes to be transferred; must be 51 * non-negative 52 *@throws IOException, if some I/O error occurs. 53 * @return The number of bytes, possibly zero, 54 * that were actually transferred 55 */ 56 long transfer(FileChannel src, long position, long count) throws IOException; 57 58 }
|
http://hc.apache.org/httpcomponents-core-4.2.x/httpcore-nio/xref/org/apache/http/nio/FileContentEncoder.html
|
CC-MAIN-2016-44
|
en
|
refinedweb
|
On Mon, Nov 10, 2003 at 12:57:02PM +0100, Robert Millan wrote: > On Sun, Nov 09, 2003 at 07:47:37PM -0600, Marcelo E. Magallon wrote: > > Look, if you want to waste time, waste _yours_. OTOH, if you want to > > take part in the discussion, do bother to address the issues you are > > being presented with. > > I'd really LOVE to. But this is my discussion. If I don't take part in > it, who will respond to all these bogus arguments some people enjoy > sending in? > > Rather, this is you and the other trolls who are wasting my time. Oh, I see: anybody who disagrees with you is a troll. That's interesting. > >. I got other > private mails from well-known developers who like my proposal and pity > your trolling attempts. Oh, wow, I was wondering how long it would take for this to appear! The lurkers support me in email! Lurkers etc. The lurkers support me in email "So why don't they post?" you all cry They're scared of your hostile intentions they're not as courageous as I. Lurkers etc. One day I'll round up all my lurkers we'll have a newsgroup of our own without all this flak from you morons my lurkers will post round my throne. Lurkers etc. (credit to Jo Walton) > > Let's have a look at the number of kernel-(image|source) packages for > > i386, and let's just assume that your scheme succeeds and becomes the > > preferred way of distributing Debian kernels, what would we have? The > > following: > > I haven't even thought of my scheme as "becoming the preferred way of > distributing Debian Linux". So I'll ignore your bogus hipothesis. Why not call it "linux-experimental" or "linux-rmh" or similar then? I'm sure a lot of people would be much happier with your proposal if it didn't claim the important namespace of "linux", which implies that it is the preferred kernel package. -- Colin Watson [cjwatson@flatline.org.uk]
|
https://lists.debian.org/debian-devel/2003/11/msg00672.html
|
CC-MAIN-2016-44
|
en
|
refinedweb
|
I have an HMC6343 tilt-compensated magnetometer
a number of its features require me to write values to specific registers (eg to alter the variation angle you write to registers 0x0D & 0x0C).
The documentation for Wire doesn't mention anything about this.
What command causes it to know that the data is for a specific register?
I would be surprised if writing to specific registers of I2C devices wasn't a very common requirement for people using the Wire library.
QuoteI would be surprised if writing to specific registers of I2C devices wasn't a very common requirement for people using the Wire library.The Wire documentation could be expanded a thousand-fold, and still wouldn't cover half the devices that I2C can be used to communicate with.
#include <Wire.h>#define HMC6343_ADDRESS 0x19//==================================================================================== void setup() { Wire.begin(); Serial.begin(115200); /* * Set the 'variation angle correction' (magnetic declination), see p8 in datasheet. * At the cathedral in St Andrews on 07/08/2012 this was 3 degrees 16 seconds West * which is -3.2667 decimal degrees, or -33 tenths of a degree, so MSB/LSB in two's * complement is 11111111/11011111. This is written to EEPROM so technically doesn't * need to be done every time if the device isn't moving to a drastically new * location inbetween use. */ byte deviationMSB = B11111111; Wire.beginTransmission(HMC6343_ADDRESS); Wire.write(0xF1); // 'Write to EEPROM' command Wire.write(0x0D); // EEPROM address of deviation angle MSB Wire.write(deviationMSB); Wire.endTransmission(); byte deviationLSB = B11011111; Wire.beginTransmission(HMC6343_ADDRESS); Wire.write(0xF1); Wire.write(0x0C); // EEPROM address of deviation angle LSB Wire.write(deviationLSB); Wire.endTransmission(); /* * Set the measurement rate to 10Hz (0x02) from default of 5Hz (0x01). * Again this is EEPROM so shouldn't need re-doing unless it is explicitly reset * at some point. */ Wire.beginTransmission(HMC6343_ADDRESS); Wire.write(0xF1); Wire.write(0x05); // EEPROM address of Operational Mode Register 2 Wire.write(0x02); // (OM2_1 = 1 && OM2_0 = 0) == 10Hz operation Wire.endTransmission(); /* * Set the Heading Infinite Impulse Response (IIR) filter from its default of 0 * to something a bit more than 0. Again, this is EEPROM so shouldn't need re-doing * unless it is explicitly reset at some point. */ Wire.beginTransmission(HMC6343_ADDRESS); Wire.write(0xF1); Wire.write(0x14); // EEPROM address of the Heading IIR filter LSB Wire.write(0x00); // 0 is no filtering, 15 is filtered with 15 previous readings Wire.endTransmission(); /* * Set the HMC6343 to 'upright front' orientation. This is temporary, but can be * written to an EEPROM register if required. */ Wire.beginTransmission(HMC6343_ADDRESS); Wire.write(0x74); Wire.endTransmission(); }//==================================================================================== void loop() { /* * Set the HMC6343 to return the information that we want (HeadMSB, HeadLSB, * PitchMSB, PitchLSB, RollMSB, RollLSB). */ Wire.beginTransmission(HMC6343_ADDRESS); Wire.write(0x50); // Command to return the data we want Wire.endTransmission(); byte MSByte, LSByte; Wire.requestFrom(HMC6343_ADDRESS, 6); // request 6 bytes (see command 0x50) while(Wire.available() < 1); // busy wait while no bytes to receive MSByte = Wire.read(); LSByte = Wire.read(); float heading = ((MSByte << 8) + LSByte) / 10.0; // the heading in degrees MSByte = Wire.read(); LSByte = Wire.read(); float pitch = ((MSByte << 8) + LSByte) / 10.0; // the pitch in degrees MSByte = Wire.read(); LSByte = Wire.read(); float roll = ((MSByte << 8) + LSByte) / 10.0; // the roll in degrees Serial.print(heading); Serial.print(" "); Serial.print(pitch); Serial.print(" "); Serial.println(roll); delay(100);}//====================================================================================
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
Thank you for subscribing!
Arduino
via Egeo 16
Torino, 10131
Italy
|
http://forum.arduino.cc/index.php?topic=147002.0;prev_next=next
|
CC-MAIN-2016-44
|
en
|
refinedweb
|
About this project
True Believer
$11,658
FINAL UPDATE:
730% funded. $11,000. 300 backers. These are all figures I could not have dreamed of three weeks ago as I was scrabbling to launch the project while finishing my thesis and trying to graduate from college. What an amazing experience. We're in the home stretch with just under 24 hours to go, but I'm so humbled by this that I've run out of things to ask for.
Keep being yourselves, keep being wonderful. I'll be posting a video update soon.
WEEK 3 UPDATE:
Well, it's official. You're all AWESOME. Thanks to you, True Believer is going international later this month with a trip to the inaugural Vancouver Comic Arts Festival! Since we've got a week to go, I'm going out on a limb and setting the new reach goal, and I really can't believe I'm saying this, at $10,000. I've added even more incentives (nautically-themed this time) to help move things along. If you'd like to get your hands on Baggywrinkles #3 pre-orders or tall ship illustrations, check the incentives bar. To read the whole update (including pics from the Release Party), click here!
WEEK 1 UPDATE:
After receiving such an incredible response in the last week, the campaign has evolved! The new goal is $8,000, and I've added some extra incentives to sweeten the deal. New funds will be going towards the creation of my first full-length graphic novel, Wherefore, which will hopefully be done by early 2013. Check out the full update here.
What's All This Then?
Hello! My name is Lucy Bellwood. I'm a cartoonist and illustrator living in Portland, OR and I want YOU to help me publish an awesome comic called True Believer. It starts something like this.
True Believer is a 36-page autobiographical story about having the courage to do what you love. It's got art, religion, love, death, and all those other Big, Juicy Things, but thankfully also features a healthy amount of sneezing, slapstick, and swear words -- just so we don't take ourselves too seriously.
The story charts my changing attitudes towards art as a personal practice over the course of 12 months. From selling my first comic at a convention to losing one of my mentors -- Portland-based publisher Dylan Williams -- to cancer, the year encompassed a staggering variety of experiences and revelations.
After six months of intense work on this story, it's finally ready to see the light of day. Since I'm a sucker for all things analog (the comic was penciled, inked, lettered, and colored by hand), my goal is to publish it at the highest quality possible. I want this book to feel fantastic. 100 copies of the print run will have regular color covers and interiors, but there will also be a limited edition of 100 copies featuring two-color screen printed covers (with French flaps!) by Matt Davison of Portland's own Dueltone Printing.
The trouble is that printing these large-format color comics can be a bit spendy for a young self-publisher...
Which Is Where You Come In.
With your help, the dream of publishing this comic in all its colorful glory will become a reality.
Kickstarter's model is simple. You pledge an amount (small or large) towards my fundraising goal by clicking the "Back This Project" button on the top righthand side of the page. If I make my goal in pledges by my deadline, May 14th, you will then get charged for your donation, and receive some awesome incentives in return (like the limited edition poster pictured below!). However, if I don't make my goal, your card doesn't get charged and I don't receive any funding. It's an all or nothing kind of game, but I have faith that we're going to make it happen. To check out the various incentives and their corresponding donation levels, peruse the column on the right.
By taking pre-orders through Kickstarter, I can confidently pull out all the stops to print True Believer the way it was meant to be printed. And what's more, I've included a number of Kickstarter-exclusive rewards that go beyond copies of the comic to include custom sketches, limited edition prints, and even dinners and studio tours with yours truly.
Sounds Great! But Where's The Money Going?
I've asked for $1,500 to complete the project. This will assure enough money to print the comic, ship your rewards, and cover Kickstarter and Amazon's processing fees.
The breakdown goes something like this:
- $950 to print 200 copies of the comic through Minuteman Press.
- $150 to screen print 100 limited edition covers with Dueltone Printing.
- $100 to assemble limited edition comics with Eberhardt Press.
- $150 for incentive printing & shipping (posters, archival comic prints, postcards, etc.)
- $150 for Kickstarter and Amazon fees (approximately 10% overall).
In the event that I exceed my funding goal, I'll not only be able to print more copies of the comic and offer some extra incentives, but also begin putting funds towards my graphic novel, Wherefore, and the next issue of my Baggywrinkles series. Baggywrinkles is a nautically-themed comic exploring my life as a tall ship sailor in the 21st century, and this next issue promises to be a lot of fun. Excess donations will allow me to make the new issue twice as long as its predecessors and experiment with some new cover printing styles.
And That's It!
Thanks so much for taking the time to investigate my Kickstarter page. If you feel compelled to pledge towards my goal, thank you even more! I really couldn't do this without you.
If you're a journalist or blogger interested in covering the campaign, you can download a press release for the project here. If you'd like to follow along with the project's process -- or just drop me a line -- check out one of these many fine social media outlets:
And, of course, my main site, lucybellwood.com!
Have a question? If the info above doesn't help, you can ask the project creator directly.
Support this project
Funding period
- (21 days)
|
https://www.kickstarter.com/projects/lucybellwood/true-believer?ref=recommended
|
CC-MAIN-2016-44
|
en
|
refinedweb
|
.java.source.engine;20 21 /**22 * Thrown when a script has no rules declared in it.23 */24 public class EmptyScriptException extends Exception {25 26 /**27 * Creates a new instance of <code>EmptyScriptException</code> without detail message.28 */29 public EmptyScriptException() {30 }31 32 33 /**34 * Constructs an instance of <code>EmptyScriptException</code> with the specified detail message.35 * @param msg the detail message.36 */37 public EmptyScriptException(String msg) {38 super(msg);39 }40 }41
Java API By Example, From Geeks To Geeks. | Our Blog | Conditions of Use | About Us_ |
|
http://kickjava.com/src/org/netbeans/modules/java/source/engine/EmptyScriptException.java.htm
|
CC-MAIN-2016-44
|
en
|
refinedweb
|
Normally you have a single DTD (Document Type Definition) to localize a specific XUL file. But there are situations where you want to use multiple DTDs, for example to localize common widgets used in all your XUL files, additionally to the ones specific to the file.
Single DTD
To make strings in your XUL file localizable, you normally add a DTD declaration at the beginning of the file like this:
<!DOCTYPE window SYSTEM "chrome://myextension/locale/mainwindow.dtd">
where "
window" is the local name of the document (root) element.
Assuming you have an entity called <tt>someButton.label</tt> defined in <tt>mainwindow.dtd</tt>, you can access the entity like this:
<button id="somebutton" label="&someButton.label">
Multiple DTDs
If you want to use multiple DTDs with your XUL file, you can simply list all of the DTDs inside your DTD declaration:
<!DOCTYPE window [ <!ENTITY % commonDTD SYSTEM "chrome://myextensions/locale/common.dtd"> %commonDTD; <!ENTITY % mainwindowDTD SYSTEM "chrome://myextension/locale/mainwindow.dtd"> %mainwindowDTD; ]>
You can now access the entities declared in the DTDs as shown above. Assume you have an entity <tt>okButton.label</tt> defined in file <tt>common.dtd</tt>. Then accessing entities from both DTDs would look like this:
<button id="somebutton" label="&someButton.label"> ... <button id="okbutton" label="&okButton.label">
Note that there is no such thing as namespaces with multiple DTDs. You have to make sure by yourself that the entities defined in the various DTDs do not clash.
|
https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Using_multiple_DTDs
|
CC-MAIN-2016-44
|
en
|
refinedweb
|
A little L10N framework for Python libraries and applications.
Table of contents
verboselib can help you to add verbosity to stand-alone libraries or applications. This includes:
In short, all this looks like translation in Django, but without Django.
A samurai without a sword is like a samurai with one, but only without one.
Here’s a quick usage example:
>>> from verboselib import use_language >>> from verboselib.factory import TranslationsFactory >>> translations = TranslationsFactory(domain="example", locale_dir="locale") >>> _ = translations.ugettext_lazy >>> message = _("Hi there!") >>> use_language('en') >>> print(message) 'Hi there!' >>> use_language('sv') >>> print(message) 'Hej där!'
The key point here is usage of an instance of a TranslationsFactory class called translations. You need to use its methods to make translatable messages. This is done to make sure your translations are really initialized, that they are initialized only once and stored in a single place only.
TIP: instantiate TranslationsFactory at some convenient place (e.g. top-level __init__.py, utils.py, translations.py or any other place you like). Then you will be able to import that instance from any other module, e.g.:from .utils import translations
To create an instance of a TranslationsFactory class you need to tell a domain name and path to directory, where your translation catalogs are stored (locale_dir).
TIP: to keep things simple you can
- set domain name same as the name of your library, application or just a package;
- place locale_dir at the top level of your package;
STRONG RECOMMENDATION: tell the absolute path of your locale_dir while instantiating your translations. This is especially vital if you are going to distribute a public library. Example:# Example '__init__.py' import os from verboselib.factory import TranslationsFactory here = os.path.abspath(os.path.dirname(__file__)) locale_dir = os.path.join(here, "locale") translations = TranslationsFactory("example", locale_dir)
So, you want to get your translated messages. There some way to do that. List of currently supported methods includes:
TIP: Don’t be afraid to use different aliases for different translation methods, e.g.:from .utils import translations _, U_ = translations.gettext, translations.ugettext L_, UL_ = translations.gettext_lazy, translations.ugettext_lazy
If you are developing some application, it makes sence to specify a global default language. This language will be used if current language is not specified. Example:
from verboselib import set_default_language, get_default_language get_default_language() # ==> 'None' set_default_language('en') get_default_language() # ==> 'en'
TIP: set default language somewhere near the place you instantiate the TranslationsFactory class at.
If both current and default languages are not set, original messages will be returned instead of their translations.
You can set up current global language for current thread from any place:
from verboselib import use_language use_language('fr')
You can get the value of currently used language:
from verboselib import get_language get_language()
If current value is None, this means that neither current nor default language is set and original messages will be returned.
You can clear the value of current global language, so next translations will use default language:
from verboselib import drop_language drop_language()
TIP: sometimes it makes sence to restore previous language instead of dropping it, e.g.:from verboselib import get_language, use_language from .utils import translations _ = translations.ugettext def send_greeting_email(user): saved = get_language() use_language(user.language) subject = _("Welcome to our service") message = _("Hello, {:}! Glad to see you among our users!").format(user.first_name) use_language(saved) send_email(subject, message, user.email)
If you wish, you can totally disable translations, so original messages will be used:
from verboselib import use_language_bypass use_language_bypass()
After this get_language function will return None.
Use use_language to enable translations again.
verboselib comes up with a couple of hepler function for converting language to locale:
>>> from verboselib.heplers import to_locale >>> to_locale('en-us') 'en_US' >>> to_locale('en-us', to_lower=True) 'en_us'
and vice versa, for converting locale to language:
>>> from verboselib.heplers import to_language >>> to_language('en_US') 'en-us'
verboselib comes up with management script called verboselib-manage.py. Its purpose is to help you to extract translatable messages from your sources and to compile catalogs of translations.
$ verboselib-manage.py Execute management commands for verboselib. Available commands: - compile (compile '*.po' files into '*.mo' binaries). - extract (extract 'gettext' strings from sources). - help (list available commands or show help for a particular command). - version (show current version of verboselib).
TIP: You can use management script even if you are not going to use verboselib itself. It can make your life a bit easier anyway.
As you can see, there are 4 currently available commands.
Use help to get commands list or to show help for some command, e.g.:
$ verboselib-manage.py help help usage: help [COMMAND] List available commands or show help for a particular command.
extract command will help you to extract or update your messages:
$ verboselib-manage.py help extract usage: extract [-d DOMAIN] [-l LOCALE] [-a] [-o OUTPUT_DIR] [-k KEYWORD] [-e EXTENSIONS] [-s] [-i PATTERN] [--no-default-ignore] [--no-wrap] [--no-location] [--no-obsolete] [--keep-pot] [-v] Extract 'gettext' strings from sources. optional arguments: -d DOMAIN, --domain DOMAIN The domain of the message files (default: "messages"). -l LOCALE, --locale LOCALE Create or update the message files for the given locale(s) (e.g. en_US). Can be used multiple times. -a, --all Update the message files for all existing locales (default: false). -o OUTPUT_DIR, --output-dir OUTPUT_DIR Path to the directory where locales will be stored, a.k.a. 'locale dir' (default: "locale"). -k KEYWORD, --keyword KEYWORD Look for KEYWORD as an additional keyword (e.g., L_). Can be used multiple times. -e EXTENSIONS, --extension EXTENSIONS The file extension(s) to examine. Separate multiple extensions with commas, or use multiple times. -s, --symlinks Follows symlinks to directories when examining sources for translation strings (default: false). -i PATTERN, --ignore PATTERN Ignore files or directories matching this glob-style pattern. Use multiple times to ignore more. --no-default-ignore Don't ignore the common glob-style patterns 'CVS', '.*', '*~', '*.pyc' (default: false). --no-wrap Don't break long message lines into several lines. (default: false). --no-location Don't write '#: filename:line' lines (default: false). --no-obsolete Remove obsolete message strings (default: false). --keep-pot Keep .pot file after making messages. Useful when debugging (default: false). -v, --verbose Use verbose output (default: false).
Help output is quite comprehensive. First 5 options are considered to be used most often.
If you had no translations before, you will need to specify target locale (or their list) to create translation files for:
$ verboselib-manage.py extract --locale 'uk' -l 'en' -l 'it'
If you want just to update all existing files, you may use --all argument.
Default keywords to look for are: gettext, gettext_lazy, ugettext, ugettext_lazy and _. Use --keyword (-k) argument to add extra keyword, e.g.:
$ verboselib-manage.py extract --keyword 'L_' -k 'U_' -k 'UL_'
Use compile command to compile all translation files inside a single locale dir:
$ verboselib-manage.py help compile usage: compile [-l LOCALE] [-d LOCALE_DIR] Compile '*.po' files into '*.mo' binaries. optional arguments: -l LOCALE, --locale LOCALE Locale(s) to process (e.g. en_US). Default is to process all. Can be used multiple times. -d LOCALE_DIR, --locale-dir LOCALE_DIR Path to the directory where locales are stored (default: "locale").
Just for information: locale directory for tests was built using management script.
Initial version
Creation of this library was inspired by translations package from Django and locale module from Sphinx.
Some blocks of code were taken from Django and adopted for general-purpose usage. Links to original sources are included into docstrings.
I would like to thank 3noch for accepting my proposed changes for stringlike library which provides support of lazy strings for verboselib..
|
https://pypi.org/project/verboselib/
|
CC-MAIN-2016-44
|
en
|
refinedweb
|
Products and Services
Downloads
Store
Support
Education
Partners
About
Oracle Technology Network
VM crashes at decompilation of a given method.
Crash does not happen with -Xint.
Crash does not happen with 1.4.2_02
Crash happens with 1.4.2_04_b4 on 64 Bit
Unexpected Signal : 10 occurred at PC=0xFFFFFFFF3841A728
Function=[Unknown.]
Library=(N/A)
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.
Current Java thread:
Dynamic libraries:
0x100000000 /usr/sap/E00/JC00/j2ee/os_libs/jlaunch
0xffffffff7f400000 /usr/lib/sparcv9/libdl.so.1
0xffffffff7f100000 /usr/lib/sparcv9/libnsl.so.1
0xffffffff7ef00000 /usr/lib/sparcv9/libsocket.so.1
0xffffffff7ed00000 /usr/sap/E00/JC00/j2ee/os_libs/libsapu16_mt.so
0xffffffff7ea00000 /usr/lib/sparcv9/libm.so.1
0xffffffff7e800000 /usr/lib/sparcv9/libCrun.so.1
0xffffffff7f300000 /usr/lib/sparcv9/libw.so.1
0xffffffff7e500000 /usr/lib/sparcv9/libthread.so.1
0xffffffff7e300000 /usr/lib/sparcv9/libc.so.1
0xffffffff7e000000 /usr/lib/64/libmp.so.2
0xffffffff7e700000 /usr/platform/SUNW,
Sun-Fire-V240/lib/sparcv9/libc_psr.so.1
0xffffffff7db00000 /usr/sap/E00/JC00/j2ee/os_libs/libicuuc.so.20
0xffffffff7d000000 /usr/sap/E00/JC00/j2ee/os_libs/libicudt20b.so
0xffffffff7ce00000 /usr/lib/sparcv9/libpthread.so.1
0xffffffff7bc00000 /usr/j2sdk1.4.2_04/jre/lib/sparcv9/server/libjvm.so
0xffffffff7ba00000 /usr/lib/64/libsched.so.1
0xffffffff7b100000 /usr/j2sdk1.4.
2_04/jre/lib/sparcv9/native_threads/libhpi.so
0xffffffff7af00000 /usr/j2sdk1.4.2_04/jre/lib/sparcv9/libverify.so
0xffffffff7ad00000 /usr/j2sdk1.4.2_04/jre/lib/sparcv9/libjava.so
0xffffffff7aa00000 /usr/j2sdk1.4.2_04/jre/lib/sparcv9/libzip.so
0xfffffffeee500000 /usr/lib/locale/en_US.ISO8859-1/sparcv9/en_US.
ISO8859-1.so.2
0xfffffffeee300000 /usr/j2sdk1.4.2_04/jre/lib/sparcv9/libjdwp.so
0xfffffffeee000000 /usr/j2sdk1.4.2_04/jre/lib/sparcv9/libdt_socket.so
0xfffffffeede00000 /usr/lib/64/nss_files.so.1
0xfffffffee9f00000 /usr/sap/E00/JC00/j2ee/os_libs/libjperflib.so
0xfffffffee9c00000 /usr/j2sdk1.4.2_04/jre/lib/sparcv9/libnet.so
0xfffffffed4b00000 /usr/j2sdk1.4.2_04/jre/lib/sparcv9/libioser12.so
0xfffffffecf500000 /usr/lib/64/nss_nis.so.1
Heap at VM Abort:
Heap
def new generation total 127232K, used 64767K [0xfffffffeeec00000,
0xfffffffef6c00000, 0xfffffffefec00000)
eden space 123392K, 50% used [0xfffffffeeec00000, 0xfffffffef2914580,
0xfffffffef6480000)
from space 3840K, 57% used [0xfffffffef6480000, 0xfffffffef66ab788,
0xfffffffef6840000)
to space 3840K, 0% used [0xfffffffef6840000, 0xfffffffef6840000,
0xfffffffef6c00000)
tenured generation total 393216K, used 320775K [0xfffffffefec00000,
0xffffffff16c00000, 0xffffffff2ec00000)
the space 393216K, 81% used [0xfffffffefec00000, 0xffffffff12541f48,
0xffffffff12542000, 0xffffffff16c00000)
compacting perm gen total 131072K, used 103876K [0xffffffff2ec00000,
0xffffffff36c00000, 0xffffffff36c00000)
the space 131072K, 79% used [0xffffffff2ec00000, 0xffffffff35171268,
0xffffffff35171400, 0xffffffff36c00000)
Local Time = Mon Mar 1 15:12:35 2004
Elapsed Time = 1095
#
# HotSpot Virtual Machine Error : 10
# Error ID : 4F530E43505002EF 01
# Please report this error at
#
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (20040219141514.kvn.1.4.
2_04_sap mixed mode)
#
# An error report file has been saved as hs_err_pid12523.log.
# Please refer to the file for further information.
ified that the crash happens during deoptimization
of this method. Perfect. Could you, please, gzip the log and
ask Stefan to put it where I can download it.
And if you saw such crash in 1.4.2_01 it may not introduced
by our fixes.
Today I continued to analyze the core file with big help
from Tom R. and John R.
We got disassembled compiled code and bytecode for this method
from the core file using SA. And, it seems, we have a problem with
restoring expression stack during deoptimization or restarting
process in interpreter (bytecode from wich to continue may be wrong)
when we hit uncommon trap. It could be again the edge case which we
never had before.
Dirk, could you, please, rerun fastdebug JVM but WITHOUT those flags
(it should be faster)? And use the file .hotspot_compiler with
this print instruction:
print com/sapportals/portal/prt/util/StringUtils escapeToJS
It will print a pseudo-assembler code generated for this method.
Then gzip and send it to me. It should have more info then in
the core file.
Thanks,
Vladimir
"Marwinski, Dirk" wrote:
>
> Hi Vladimir,
>
> > Ok. So we have the workaround now.
>
> Our results strongly indicate this.
>
> > My main concern here is this problem was introduced by our
> > fixes or it was there before. What is puzzling me is this
> > Stefan's comment:
> > "This crash did never happen with the original VM 1.4.2_02."
>
> > Does it mean you were able to pass the original (4985384) crash
> > and this crash with 1.4.2_02?
>
> This was in fact my statement which I took from the admin of
> the system here. I will try to verify this myself. From what I
> have seen, it looks that the problem did exist in 1.4.2_01, did
> not exist in 1.4.2_02 + 03 and was re-introduced in 1.4.2_04. We
> did have similar crashes on other systems which we could not
> reproduce with 1.4.02_02 that did exist in 01. This is however
> only a suspicion!
>
> > Unfortunately you may not get crash with fastdebug build.
> > You can stop testing if you can grep the log file
> > for "{method} 'escapeToJS'". Which would mean we passed the deoptimization
> > for this method. Stop testing also if the log file is very big:
> > it will be difficult to analyze it anyway.
>
> It did crash. The log is approx 700MB. The following is at the end:
>
> ------------------------
> DEOPT PACKING thread 0x101771678 Compiled frame (sp=0xfffffffee0ffb450, fp=0xfff
> ffffee0ffb520, pc=0xffffffff382bb570)
> nmethod:{method} 'escapeToJS' '(Ljava/lang/String;)Ljava/lang/String;' in '
> com/sapportals/portal/prt/util/StringUtils'
> Virtual frames (innermost first):
> 0 - com.sapportals.portal.prt.util.StringUtils.escapeToJS(StringUtils.ja
> va:90) - invokevirtual @ bci 232
> Created vframeArray 0x103183ef8
> DEOPT UNPACKING thread 0x101771678 vframeArray 0x103183ef8
> {method} 'escapeToJS' '(Ljava/lang/String;)Ljava/lang/String;' in 'com/sapp
> ortals/portal/prt/util/StringUtils' - invokevirtual @ bci 232 sp = 0xfffffffee0f
> fb470
>
> Unexpected Signal : 10 occurred at PC=0xFFFFFFFF3703604C
> Function=[Unknown.]
> Library=(N/A)
>
> NOTE: We are unable to locate the function name symbol for the error
> just occurred. Please refer to release documentation for possible
> reason and solutions.
> [...]
> --------------------------------------------------
>
> Thanks,
> Dirk
CONVERTED DATA
BugTraq+ Release Management Values
COMMIT TO FIX:
1.4.2_05
generic
tiger-beta2
FIXED IN:
1.4.2_05
tiger-beta2
INTEGRATED IN:
1.4.2_05
tiger-beta2
SUGGESTED FIX
###@###.### 2004-03-04
From the 4692404 fix.
###@###.### 2004-03-06
Additional problems were found during full PRT 1.4.2_04_sap testing.
To fix them I have to modify this fix (in parse1.cpp). It seems,
the first implementation of the fix was depend on other changes in 1.5.0
and it was not valid for 1.4.2.
Diffs:
src/share/vm/opto/callGenerator.cpp Thu Mar 4 17:12:47 2004
***************
*** 136,141 ****
--- 136,142 ----
// the call instruction will have a seemingly deficient out-count.
// (The bailout says something misleading about an "infinite loop".)
if (kit.gvn().type(receiver)->higher_equal(TypePtr::NULL_PTR)) {
+ kit.inc_sp(method()->arg_size()); // restore arguments
kit.do_athrow(Deoptimization::Deopt_null_check);
return kit.transfer_exceptions_into_jvms();
}
src/share/vm/opto/parse1.cpp Thu Mar 4 17:14:39 2004
***************
*** 449,455 ****
SafePointNode* entry_map = create_entry_map();
// Check for bailouts during map initialization
! if (parse_failed()) {
show_bailout_info();
if (log) log->done("parse");
return;
--- 449,455 ----
SafePointNode* entry_map = create_entry_map();
// Check for bailouts during map initialization
! if (parse_failed() || entry_map == NULL) {
show_bailout_info();
if (log) log->done("parse");
return;
***************
***68 ----
// If this is an inlined method, we may have to do a receiver null check.
if (_caller->has_method() && is_normal_parse() && !method()->is_static()) {
GraphKit kit(_caller);
! kit.null_check_receiver(method());
_caller = kit.transfer_exceptions_into_jvms();
}
assert(method() != NULL, "parser must have a method");
###@###.### 2004-03-11
The last paragraph of the previous diff needs amendment, I think.
***************
***73 ----
// If this is an inlined method, we may have to do a receiver null check.
if (_caller->has_method() && is_normal_parse() && !method()->is_static()) {
GraphKit kit(_caller);
! kit.null_check_receiver(method());
_caller = kit.transfer_exceptions_into_jvms();
+ if (kit.stopped()) {
+ _exits.add_exception_states_from(_caller);
+ _exits.set_jvms(_caller);
+ return NULL;
+ }
}
assert(method() != NULL, "parser must have a method");
Note especially the "add_exception_states_from" line,
which is new in Tiger also.
------------------------------------------
###@###.### 2004-03-11
About John's suggestion. I tryed it. With this additional "if() {}" we
we will have the problem described at the end of the comment section.
The small test case (the one at the end of the comment section)
will fail if you just add this 'if' into create_entry_map() without
changes in graphKit.cpp & graphKit.hpp.
The changes in graphKit are the addition of the class BuildCutout and
the next replacement:
< // Must throw exception, fall-thru not possible?
< if (iftrue == top()) {
< stop();
< return top(); // No result
< }
---
> // Must throw exception, fall-thru not possible?
> if (stopped()) {
> return top(); // No result
> }
I would like to keep my suggested fix for Mantis.
WORK AROUND
###@###.### 2004-03-04
Exclude from compilation the method
com/sapportals/portal/prt/util/StringUtils escapeToJS
EVALUATION
###@###.### 2004-03-04
According to the log file and the core file the problem occurs
after deoptimization the method:
com/sapportals/portal/prt/util/StringUtils escapeToJS
###@###.### 2004-03-04
Duplicate of 4692404 which was just fixed in 1.5.0.
See Suggested Fix for 1.4.2_04 diffs.
|
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=5007709
|
CC-MAIN-2016-44
|
en
|
refinedweb
|
SeamFramework.orgCommunity Documentation
Seam JCR provides functionality to fire CDI Events based on events found in JCR. The rules of how events are fired are based around the underlying implementation.
To observe an event, use the
@Observes and the additional qualifiers from the
seam-jcr-api module (Check package
org.jboss.seam.jcr.annotations.events).
If you need to watch any JCR event, then avoid using any qualifier at all.
import javax.jcr.observation.Event; public void observeAdded(@Observes @NodeAdded Event evt) { // Called when a node is added } public void observeAll(@Observes javax.jcr.observation.Event evt) { // Called when any node event occurs }
|
http://docs.jboss.org/seam/3/3.1.0.Final/reference/en-US/html/jcr-eventmapping.html
|
CC-MAIN-2016-44
|
en
|
refinedweb
|
Object
SchemaSchema
public class Schema(Hints hints)
public Schema(FilterFactory filterFactory)
public int getAttributeCount(SimpleFeatureType featureType)
used to detect duplicate attributes names (ie override)
featureType-
public List getNames(SimpleFeatureType featureType)
This method does not produce the complete schema (ie derrived restrictions based on attribute facets). It is only used to get a list of the unique attribtues in the resulting schema.
featureType-
public List getNames(SimpleFeatureType featureType, List names)
This method is "faster" then actually constructing the merged AttribtueTypes.
public List getAttributes(SimpleFeatureType featureType)
public List getAttributes(SimpleFeatureType featureType, List list)
This method is "faster" then actually constructing the merged AttribtueTypes.
public Filter getRestrictions(SimpleFeatureType featureType, String name)
featureType-
name-
public int getIndexOf(SimpleFeatureType type, String name)
type-
public AttributeDescriptor getAttribute(SimpleFeatureType type, int index)
type- the FeatureType
index- the position
public AttributeDescriptor getAttribute(SimpleFeatureType type, String name)
public AttributeDescriptor getXPath(SimpleFeatureType type, String xpath)
AttributeType needs a xpath based access
type-
xpath-
public static int attributeCount(SimpleFeatureType featureType)
used to detect duplicate attributes names (ie override)
featureType-
public static AttributeDescriptor attribute(SimpleFeatureType type, int index)
public static AttributeDescriptor attribute(SimpleFeatureType type, String name)
public static List attributes(SimpleFeatureType featureType)
public static List attributes(SimpleFeatureType featureType, List list)
public static int find(SimpleFeatureType type, String name)
public static List names(SimpleFeatureType featureType)
public static List names(SimpleFeatureType featureType, List names)
public static Filter restriction(SimpleFeatureType featureType, String name)
public static AttributeDescriptor xpath(SimpleFeatureType type, String xpath)
|
http://docs.geotools.org/latest/javadocs/org/geotools/feature/Schema.html
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
#include "RTOp.h"
Include dependency graph for RTOp_TOp_add_scalar.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
targ_vec(i) <- targ_vec(i) + alpha, for i = 1...n.
This operator is only defined for a self transformation (
num_vecs == 0).
Definition in file RTOp_TOp_add_scalar.h.
|
http://trilinos.sandia.gov/packages/docs/r7.0/packages/moocho/src/RTOpPack/doc/html/RTOp__TOp__add__scalar_8h.html
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
At 13:48 12/04/05 +0100, Malcolm Wallace wrote: >Henning Thielemann <lemming at henning-thielemann.de> writes: > > > >> predicates a -> Bool > > >> selectors, transformators a -> a > > >> list-valued functions a -> [a] > > > > What about providing combinators for the most common cases and provide > > lifting functions for the uncommon cases, such as > > > > liftPred :: (a -> Bool) -> (a -> [a]) > > liftPred p x = if p x then [x] else [] > > > > liftTrans :: (a -> b) -> (a -> [b]) > > liftTrans f x = [f x] > >Looks good. If you want to come up with a concrete design for an fuller >set of alternative combinators, I'd be happy to include it into HaXml as >a further choice of facility. Obliquely related to this thread: When I added namespace support and other stuff to HaXml, I added (a) and "infoset" type parameter to the XML document type [1], and (b) a new transformation type [2] so that I could create new document types with additional information in the Haskell data to support features like XML namesspaces and xml:base. I think your proposals could also be added into this framework, with the additional wrinkle that using a 'newtype' in the "infoset" value type, one could maybe achieve a degree of type safety, but at the cost of losing some of the algebraic properties of a 'CFilter'. My version is on my web site (sorry I'm offline and can't find the actual URI right now). #g -- [1] From my version of Text.XML.HaXml.Types: [[ data DocumentI i = Document Prolog (SymTab EntityDef) (ElementI i) data ElementI i = Elem QName i [Attribute] [ContentI i] data ElemTag = ElemTag Name [Attribute] -- ^ intermediate for parsing type Attribute = (QName, AttValue) data ContentI i = CElem (ElementI i) | CString Bool CharData -- Bool flags whitespace significance | CRef Reference | CMisc Misc | CErr String -- Fudge to get error diagnostics -- from a filter data ElementInfoset = EI { eiNamespaces :: [Namespace] , eiBase :: String -- Non-infoset values -- (in xml namespace:) , eiLang :: String , eiSpace :: Bool -- True=preserve, False=default -- ? , eiIdent :: String -- xml:id, or other ID value? } deriving Show ]] So that: [[ type Document = DocumentI () type Element = ElementI () type Content = ContentI () ]] Provide compatibility with existing HaXml, but I can use [[ DocumentI ElementInfoset ElementI ElementInfoset ContentI ElementInfoset ]] ... [2] From my version of Text.XML.HaXml.Combinators: [[ type CTransform i1 i2 = ContentI i1 -> [ContentI i2] type CFilterI i = CTransform i i type CFilter = CFilterI () ]] ------------ Graham Klyne For email:
|
http://www.haskell.org/pipermail/haskell-cafe/2005-April/009609.html
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
Articles
Weblogs
Books
School
Short Cuts
Podcasts
Servers/Services as Peers
Category View
|
Alphabetical Listing
|
Detail Listing
.NET
Microsoft.
BXXP
BXXP is an XML-based messaging framework for building application protocols that was used as a starting point for the IETF
BEEP (Blocks Extensible Exchange Protocol)
Working Group's efforts.
BXXP was the brainchild of Marshall Rose, now of Invisible Worlds.
Dynaptics
Dynaptics
Personal E.ssistant
products are designed to analyze visitor behavior within a website and deliver relevant content. The product family consists of the
Personal Sales E.ssistant (PSE)
and the
Personal Information E.ssistant (PIE)
. The sales model is designed to provide predictive on-screen messages and recommendations based on real-time information and historical sales data. The information model is designed to tailor the content and navigation of a website "on-the-fly" by analyzing the information the visitor is viewing. Personal E.ssistants are available from Dynaptics as
stand-alone
or
hosted
applications. More
information
and an
are also available.
HailStorm
HailStorm is a blanket term for a collection of Microsoft technologies, peer-to-peer related and otherwise (e-mail, instant messaging, alerts and notifications, addressbooks and Microsoft's
Passport
authentication technology) that were
announced by Bill Gates
as part of Microsoft's
.NET platform
. Windows XP and Office XP will ship with core elements of HailStorm built into them. The HailStorm architecture is based on
SOAP
and XML, using common identity, security, and data models for each of its HailStorm services so that they may be accessed from any minimally connected device.
Hailstorm: Open Web Services Controlled by Microsoft
by Clay Shirky and
Brewing a HailStorm
by Rael Dornfest.
iMaestro
iMaestro is focused on e-commerce applications of P2P technology. The first product, iMaestro Interact, offers a peer-to-peer auction network.
Interbind
Inter.
JXTA
Juxtapose (JXTA) was originally
one of Bill Joy's research projects aimed at developing a network programming and computing platform able to solve a number of the problems in modern distributed computing. JXTA has since become a community-based open source development platform. The four main concepts of the JXTA project are: the ability to "pipe" from one peer to another, a grouping notion, the ability to monitor and meter, and a security layer. The
JXTA Shell
is a prototype application that illustrates the use of JXTA Technology. The JXTA Shell permits interactive access to the JXTA platform's building blocks through a simple, text based interface (available on Solaris Operating Environment, Linux, or Microsoft Windows). A
Technical Specification
provides a description of the architecture and key elements of the Project JXTA technology including: peers, advertisements, messages, pipes and protocols.
Demonstrations
are available for download. See the
or the
documentation page
for more details.
Project JXTA Developer Contest
.
Meerkat: An Open Wire Service.
Meerkat includes an
Open API
that users and developers can use to incorporate the news feeds into their own sites or web-based applications.
OpenDesign
OpenDesign's goal is to create a distributed application infrastructure by combining the best of client-server and P2P architectures to enable a network to automatically reconfigure itself to the needs of the application. This dynamic configuration of the network guarantees that applications and their underlying services, use only the resources they require, but are always available, fault tolerant, and load balanced. This inherent scalability frees applications from the limitations of a single server, cluster, or data center. Services and applications can exist anywhere in the network and share resources across the network.
PeerMetrics
The PeerMetrics Peer System is a fully-featured Java peer-to-peer platform for developing distributed services. Strengths include dynamic modular protocol binding, peer and resource identification, discovery, and search, extensible metadata, XML UI definitions, remote service display browsing, and extensive API documentation. The power of the platform and available services greatly simplifies writing peer-to-peer applications. Source is included.
Planet 7 Technologies
Planet 7 Technologies is the developer of the
XML Network Server
, a Java-based host for ecommerce or enterprise application integration networks that enables many-to-many sharing of XML data in real time. The architecture is optimized for handling ecommerce requests generated in conformance with standard XML schemas and Document Type Definitions (DTDs). The requests can be routed based on namespaces, applications, or host names. The system has been made extensible and follows a hub and router model where each XML Network Server can act as a hub. The "router" for connecting resources to hubs is created with what the company calls a "full duplex" (or bi-directional) Application Programming Interface (API) called
XML Network Client Objects
.
The network scales up by the addition and connection of servers in a modular fashion. Other distributed systems can use XNS as an XML handling interface. Though an agreement with Extensibility, Inc., Planet 7 is bundling a trial version of Turbo XML (which includes
XML Authority
, XML Instance and XML Console) with the XNS development package to expose developers to a complete network application development environment..
The Mind Electric
The Mind Electric is developing GLUE, a Java based modular platform for building and invoking distributed web services. GLUE has a small footprint (it's distributed as an embeddable 200K JAR file) and can expose any unmodified Java object as a web service. It is designed to be platform, protocol and transport neutral, and to interoperate with Apache SOAP (Simple Object Access Protocol), Microsoft .NET Framework and IBM Web Services Toolkit (WSTK). GLUE includes a micro-web server, servlet engine, SOAP processor, XML parser (Electric XML), dynamic Web Structure Definition Language (WDSL) generator, Universal Description Discovery and Integration (UDDI) client, UDDI server, Wireless Application Protocol (WAP) support, and an XML persistent storage system. GLUE services can be deployed via a browser, runtime APIs, or drag and drop, can be dynamically installed across a network, or stored in JAR files and loaded remotely. The Mind Electric site includes the online GLUE Application Programming Interface (API).
UDDI (Universal Description, Discovery and Integration)
The Universal Description, Discovery and Integration (UDDI) specification is an industry initiative lead by Ariba, IBM, and Microsoft that defines a platform-independent, open framework for describing services, discovering businesses and integrating business services over the Internet.
UDDI was designed to provide existing directories and search engines with a centralized source for programmatic descriptions of business Web services.
The UDDI Business Registry will allow Businesses to publish their preferred terms of conducting e-commerce or other transactions for other UDDI-enabled agents to "discover".
WSDL
The Web Services Description Language 1.1 (WSDL) grammar describes Web services, including: interface and end points (or ports), what a service can do, where it resides and how to invoke it via machine-understandable terms targeted for automated distributed communications between Web applications. WDSL can extend
Simple Object Access Protocol
(SOAP), and this Note describes and includes bindings for using WSDL in combination with SOAP,
Hypertext Transfer Protocol
(HTTP) and
Multipurpose Internet Mail Extension
(MIME) for remote process invocation. WDSL is itself extensible, with a common binding mechanism that may be used to produce binding extensions for other protocols.
XDegrees
XDegrees is developing software that will manage the flow of metadata in Peer-To-Peer networks. CEO (and Adforce founder) Michael Tanne and co-founders Anand Rajaraman and Venky Harinarayan (also co-founders of the Junglee shopping bot company) think P2P metadata, if utilized, can be more valuable than the data itself. In an environment where information and applications will be pushed out onto the network, rather than residing on servers, the software will also provide infrastructure services such as caching, messaging, naming and routing. The platform will also enable the development of P2P applications utilizing existing web development technologies, such as Active Server Pages (ASP) and Common Gateway Interface (CGI) scripts.
XML-RPC
XML-RPC was designed to provide simple cross-platform distributed computing. It uses XML and remote procedure calls to communicate information from one server to another. A precursor to
SOAP
, it was developed in early 1998 by Dave Winer of
Userland
, Don Box of
DevelopMentor
, and Microsoft. The XML-RPC spec and implementations helped develop an awareness that XML was more than just a document format and could be used for standards-based transaction processing.
XOBJEX
X
|
http://www.oreillynet.com/pub/t/82
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
Implements a TextReader that reads characters from a byte stream in a particular encoding.
SystemMarshalByRefObject
System.IOTextReader
System.IOStreamReader
Assembly: mscorlib (in mscorlib.dll)
<[%$TOPIC/6aetdk20_en-us_VS_110_3_0_0_0_0%]> _ <[%$TOPIC/6aetdk20_en-us_VS_110_3_0_0_0_1%](True)> _ Public Class StreamReader _ Inherits [%$TOPIC/6aetdk20_en-us_VS_110_3_0_0_0_2%]
[[%$TOPIC/6aetdk20_en-us_VS_110_3_0_1_0_0%]] [[%$TOPIC/6aetdk20_en-us_VS_110_3_0_1_0_1%](true)] public class StreamReader : [%$TOPIC/6aetdk20_en-us_VS_110_3_0_1_0_2%]
[[%$TOPIC/6aetdk20_en-us_VS_110_3_0_2_0_0%]] [[%$TOPIC/6aetdk20_en-us_VS_110_3_0_2_0_1%](true)] public ref class StreamReader : public [%$TOPIC/6aetdk20_en-us_VS_110_3_0_2_0_2%]
[<[%$TOPIC/6aetdk20_en-us_VS_110_3_0_3_0_0%]>] [<[%$TOPIC/6aetdk20_en-us_VS_110_3_0_3_0_1%](true)>] type StreamReader = class inherit [%$TOPIC/6aetdk20_en-us_VS_110_3_0_3_0_2%] endReaderSynchronized for a thread-safe wrapper.
The Read(Char, Int32, Int32) and Write(Char, Int32, Int32) method overloads read and write the number of characters specified by the count parameter. These are to be distinguished from BufferedStreamRead and BufferedStreamWrite,-.
|
http://msdn.microsoft.com/en-us/vstudio/system.io.streamreader.aspx
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
How can I convert an ANSI string to a OEM string using .NET?
Is there any method in the .NET classes?
Thanks,
Felice Russo
Try reading up on the documentation for the System.Text namespace.
It has conversion functions and coding/decoding methods...
Hope this helps,
.a
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?
|
http://social.msdn.microsoft.com/Forums/vstudio/en-US/d50234d6-5519-4780-8a78-db19ae21ffa1/ansi-to-oem-conversion?forum=netfxbcl
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
Raised by GmresBase::extendBasis() if can't extend basis. More...
#include <BelosGmresBase.hpp>
Raised by GmresBase::extendBasis() if can't extend basis.
The usual cause of a thrown GmresCantExtendBasis is that the allotted maximum number of basis vectors has been reached. Subclasses may choose, instead of throwing this exception, to attempt to allocate more storage for basis vectors.
GmresBase::advance()should use
GmresBase::canAdvance()method rather than a try/catch to limit the number of iterations. GmresCantExtendBasis should never be thrown by correct code.
Definition at line 142 of file BelosGmresBase.hpp.
Definition at line 144 of file BelosGmresBase.hpp.
|
http://trilinos.sandia.gov/packages/docs/r11.2/packages/belos/doc/html/classBelos_1_1GmresCantExtendBasis.html
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
06 March 2013 17:22 [Source: ICIS news]
HOUSTON (ICIS)--Uncertainty may be the norm for the ?xml:namespace>
“We’ve been a part of
Dudley reaffirmed BP’s commitment to the
That number should grow as the company develops more tight, shale and deepwater oil in the future, he said. BP has invested $55bn (€42bn) in the
Part of that commitment is to alternative energy, with BP investing $8bn in the last eight years on renewables. More than half of that has been spent on wind farms, as well as on advanced biofuels,
Altogether, companies such as BP are not just fuelling Americans’ energy needs – they are fuelling economic growth, he said, with oil and gas employment in the
“This industry is not only transforming the energy
|
http://www.icis.com/Articles/2013/03/06/9647004/BP-committed-to-large-role-in-US-energy-future-CEO.html
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
1) Introduction Introduction to Spring Framework. This article will help you to understand the fundamentals of the Spring framework. In another article Introduction to Hibernate explains what is ORM framework and how to start writing the simple hibernate application.
also read: follow us on @twitter and @facebook
2) Spring and Hibernate.
3) Integration Sample
Instead of looking into the various Integration APIs that are available in the Spring Bundle, let us study and understand these APIs as we go through the sample code. The following sections cover the various steps involved in the Spring-Hiberante integration along with a detailed explanation.
3.1) Creating Database
The following sample application uses the MySql database for dealing with data. MySql database can be downloaded from. After installing the database, start the MySql client and create a test database by issuing the following command,
Create database samples;
Note that the character
';' is the statement terminator for every command. Once the
'samples' database is created, use the database for creating tables by using the command,
Use samples;
This uses the
'samples' database for the current database session. It means that whatever operation we do, such as creating tables, will eventually affect the
'samples' database. Now, let us create a sample table called
'employee' which is having four fields namely
id,
name,
age and
salary. The following command creates the
'employee' table in the
'samples' database,
create table employee(id varchar(10), name varchar(20), age int(3), salary int(10));
Now an empty table (table with no records within it) is created.
3.2) The Employee class
Now let us create a class called
Employee for storing the data that are fetched from the
employee table. The class design is such that the column names for the table
'employee' will be mapped as the variable names in the Java class with the appropriate data type. The complete code listing for the Employee class is as follows,
Employee.java
package javabeat.spring.hibernate; public class Employee { private String id; private String name; private int age; private double salary; public Employee() { } public String getId(){ return id; } public void setId(String id){ this.id = id; } public String getName(){ return name; } public void setName(String name){ this.name = name; } public int getAge(){ return age; } public void setAge(int age){ this.age = age; } public double getSalary(){ return salary; } public void setSalary(double salary){ this.salary = salary; } public String toString(){ return "Id = " + id + ", Name = " + name + ", Age = " + age + ", Salary = " + salary; } }
Note that the
toString() method is overridden to give a meaningful display for the employee object.
3.3) Creating the Hibernate Mapping file
We have created
'employee' table in the database and a corresponding Java class in the Application layer. However, we haven’t specified that the
'employee' table should map to the Java class and the column names in the
'employee' table should map to the Java variables in the
Employee class. This is where the Hibernate Mapping files comes into picture. Let us have a look at the Hibernate Mapping file,
employee.hbm.xml
<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "- //Hibernate/Hibernate Mapping DTD 3.0//EN" ""> <hibernate-mapping> <class name="javabeat.spring.hibernate.Employee" table="Employee"> <id name="id" column="Id"> <generator/> </id> <property name="name"> <column name="Name"/> </property> <property name="age"> <column name="Age"/> </property> <property name="salary"> <column name="Salary"/> </property> </class> </hibernate-mapping>
Note that the Mapping file is an Xml file and its name is
employee.hbm.xml. The portion of the string
'hbm' in the mapping file stands for Hibernate Mapping File. Although it is not necessary to follow this convention, it will be easy to figure what type of xml file is this, just by looking at the extension. Xml conforms to a well-defined DTD, the
hibernate-mappings-3.0.dtd.
The root element for the mapping file is the
hibernate-mapping tag which can define one or more mappings, following which we have the
class tag which defines a mapping between the database table name and the Java class. The
'name' attribute must point to a fully qualified Java class name whereas the
table attribte must point to the database table.
The next series of tags define the mapping definition of the column names against its Java variables counterparts. The
'id' tag defines an identifier for a row and it is commonly used as a primary key column. The
property tag has an attribute called
'name' which points to the Java variable name, following which is the name of the column in the database table to which it maps to.
3.4) Creating the Spring Configuration File
This section deals with configuring the various information needed for the Spring Framework. In Spring, all the business objects are configured in Xml file and the configured business objects are called Spring Beans. These Spring Beans are maintained by the IOC which is given to the Client Application upon request. Let us define a data source as follows,
spring-hibernate.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="" xmlns: <bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost/samples"/> <property name="username" value="root"/> <property name="password" value="pwForRoot"/> </bean> … </beans> …
The above bean defines a data-source of type
'org.apache.commons.dbcp.BasicDataSource'. More importantly, it defines the various connection properties that are needed for accessing the database. For accessing the MySql database, we need MySql database driver which can be downloaded from. The first property called
driverClassName should point to the class name of the MySql Database Driver. The second property url represents the URL string which is needed to connect to the MySql Database. The third and the fourth properties represent the database
username and the
password needed to open up a database session.
Now, let us define the second Spring Bean which is the
SessionFactoryBean. If you would have programmed in Hibernate, you will realize that
SessionFactoryBean is responsible for creating
Session objects through which
Transaction and Data accessing is done. Now the same
SessionFactoryBean has to be configured in Spring’s way as follows,
<bean id="mySessionFactory" class="org.springframework.orm.hibernate3 .LocalSessionFactoryBean"> <property name="dataSource" ref="myDataSource"/> <property name="mappingResources"> <list> <value>./resources/employee.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <value>hibernate.dialect=org.hibernate.dialect .HSQLDialect</value> </property> </bean>
To make the
SessionFactoryBean to get properly configured, we have given two mandatory information. One is the data-source information which contains the details for accessing the database. This we have configured already in the previous step and have referred it here using the
'ref' attribute in the
'property' tag. The second one is a list of Mapping files which contains the mapping information between the database tables and the Java class names. We have defined one such mapping file in section 2 and have referenced the same here with the
'list' tag.
The 3rd important Spring Bean is the Hibernate Template. It provides a wrapper for low-level data accessing and manipulation. Precisely, it contains methods for inserting/delting/updating/finding data in the database. For the Hibernate Template to get configured, the only argument is the
SessionFactoryBean object as represented in the following section,
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory"> <ref bean="mySessionFactory"/> </property> </bean>
The final Bean definition is the Dao class which is the client facing class. Since this class has to be defined in the Application level, it can contain any number of methods for wrapping data access to the Client. Since we know that it is the Hibernate Template class that interacts with the database, it will be ideal a refer an instance of Hibernate Template to the Dao class.
<bean id="employeeDao"> <property name="hibernateTemplate"> <ref bean="hibernateTemplate"/> </property> </bean>
Note that a reference is made to
EmployeeDao class which is discussed in the forthcoming section.
3.5) Defining the EmployeeDao class
As described earlier, this
EmployeeDao class can contain any number of methods that can be accessed by the clients. The design of this class can fall under two choices. One is this class can directly depend on the Hibernate Template object which is injected by the IOC for accessing the data. The second one is that it can make use of the Hibernate API for data accessing. The declaration of the class is as follows,
EmployeeDao.java
package javabeat.spring.hibernate; import java.sql.SQLException; import org.hibernate.HibernateException; import org.hibernate.Session; import org.springframework.orm.hibernate3.HibernateCallback; import org.springframework.orm.hibernate3.HibernateTemplate; public class EmployeeDao { private HibernateTemplate hibernateTemplate; public void setHibernateTemplate(HibernateTemplate hibernateTemplate){ this.hibernateTemplate = hibernateTemplate; } public HibernateTemplate getHibernateTemplate(){ return hibernateTemplate; } public Employee getEmployee(final String id){ HibernateCallback callback = new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException,SQLException { return session.load(Employee.class, id); } }; return (Employee)hibernateTemplate.execute(callback); } public void saveOrUpdate(final Employee employee){ HibernateCallback callback = new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException,SQLException { session.saveOrUpdate(employee); return null; } }; hibernateTemplate.execute(callback); } }
This class makes use of Hibernate API (particularly the
Session object) for data accessing. To instruct Spring to access the Hibernate API, we have the put the piece of logic that makes use of the Hibernate API into a particular well defined method in a well known interface that Spring knows. It happens to be the
HibernateCallback interface with the method
doInHibernate() with an instance of Hibernate Session being passed.
Note that we have defined two methods;
getEmployee() and
saveOrUpdate in the
EmployeeDao class. And to make use of the Hibernate APIs, we have defined the code in the
HibernateCallback.doInHibernate() method and have informed Spring to execute this code by passing the interface reference to the
HibernateTemplate.execute() method.
3.6) The Client Application
SpringHibernateTest.java
package javabeat.spring.hibernate; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; import org.springframework.orm.hibernate3.LocalSessionFactoryBean; public class SpringHibernateTest { public static void main(String[] args) { Resource resource = new FileSystemResource( "./src/resources/spring-hibernate.xml"); BeanFactory factory = new XmlBeanFactory(resource); Employee employee = new Employee(); employee.setId("123"); employee.setName("ABC"); employee.setAge(20); employee.setSalary(15000.00d); EmployeeDao employeeDao = (EmployeeDao)factory.getBean( "employeeDao"); employeeDao.saveOrUpdate(employee); Employee empResult = employeeDao.getEmployee("123"); System.out.println(empResult); } }
Finally, we come to the sample client Application for accessing the test data. The control goes like this. When the method
BeanFactory.getBean("employeeDao") is called, Spring finds the references made in the Bean definition of
Employee Dao Bean. It happens to be the Hibernate Template object. Then an attempt will be made to initialize the Hibernate Template object where it will see that a Session Factory Bean object is referenced. Then, while constructing the Session Factory Bean object, the data-source information will get resolved along with the database tables and the Java classes.
also read:
4) Conclusion
This article was aimed at discussing about Integration of Spring with Hibernate. It discussed the need for such an integration and also briefed about the benefits that it offers. Then, a very detailed step-by-step sample was given to clearly illustrate how the integration works.
- JSTL Function fn:replace() - March 7, 2014
- JSTL Function fn:trim() - March 7, 2014
- JSTL Function fn:toUpperCase() - March 7, 2014
super stuff ….
great work
i need some help. i am new to spring and hibernate. so i would like to know that how exaclty it works. Some example related to fetching and displayed data from database and some how to pass parameter in spring . Plz guide
Please read this article:
clear explanation….
Thank you!!
Thank you , Good explanation .. Spring MVC with Hibernate I think this is fantastic technology.
Thank you. Yes. Spring and Hibernate is good combination.
Excellent article!
good article but : myDataSource should be declare as class=”org.apache.commons.dbcp.BasicDataSource”
Thank you for pointing it out. I have updated it correctly.
hello sir,
i am confused with integration of hibernate and
Spring …cam u help me out
Hello Shanu,
What is you issue or error?
Grt article,it helps me a lot………
Tons of thanx…………
This is really a very simple and good article. I was struggling a lot in understanding spring/hibernate concepts but after reading this it seems to be very easy. Thanks
Very good Explanation.
Thanks for reading this article!!
nice example,Tnk U
Thank you for reading this blog!!
Good One …Thnx…
thanx for all tutorial.Please make the source code in a zip file.I’m beginner and i need a complete source code for each tutorial.(sorry for my english)
Thanks sir for this good tutorial!HibernateTemplate
Could you kindly update it with the usage of hibernate 4, which does not use HibernateCallback and HibernateTemplate anymore?
|
http://www.javabeat.net/integrating-spring-framework-with-hibernate-orm-framework/
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
Man Page
Manual Section... (3) - page: usleep
NAMEusleep - suspend execution for microsecond intervals
SYNOPSIS
#include <unistd.h> int usleep(useconds_t usec);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
usleep(): _BSD_SOURCE || _XOPEN_SOURCE >= 500
DESCRIPTIONThe usleep() function suspends execution of the calling process for (at least) usec microseconds. The sleep may be lengthened slightly by any system activity or by the time spent processing the call or by the granularity of system timers.
RETURN VALUE0 on success, -1 on error.
ERRORS
- EINTR
- Interrupted by a signal; see signal(7).
- EINVAL
- usec is not smaller than 1000000. (On systems where that is considered an error.)alarm(2), getitimer(2), nanosleep(2), select(2), setitimer(2), sleep(3), ualarm(3), time
|
http://linux.co.uk/documentation/man-pages/subroutines-3/man-page/?section=3&page=usleep
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
MP4ReadSample - Read a track sample
#include <mp4.h>
bool MP4ReadSample(
MP4FileHandle hFile,
MP4TrackId trackId,
MP4SampleId sampleId, reads the specified sample)
|
http://www.makelinux.net/man/3/M/MP4ReadSample
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
Just tell him that "functions are like all other variables and can therefore be passed by other functions or returned by other functions. " If your friend understands variables and functions and he can't make the "leap" (and assuming you're right, of course) then your friend doesn't understand variables and functions. Happy Friday. Sean On 9/21/07, Cristian <super.sgt.pepper at gmail.com> wrote: > On Sep 21, 3:44 pm, Ron Adam <r... at ronadam.com> wrote: > > > I think key may be to discuss names and name binding with your friend. How > > a name is not the object it self, like a variable is in other languages. > > For example show him how an object can have more than one name. And discus > > how names can be bound to nearly anything, including classes and functions. > > I could discuss name binding but it would be great if Python said this > itself. After all, you can even bind a module with the foo = bar > syntax by using __import__ function. If function definitions followed > the same pattern, I think a beginner would subconsciously (maybe even > consciously) realize that function names are just like everything > else. Actually, this would be helpful for many people. If you come > from a language like Java you're used to thinking of attributes and > methods as living in different namespaces. I think a new syntax will > encourage seasoned programmers think in a more Pythonic way. > > Python has done a very good job in easing people into programming. My > friend doesn't come to me very often because the syntax is clear and > simple and the builtin datatypes allow you to do so much. My goal is > that I would never have to explain to him about name binding; that > he'd pick it up by learning the language on his own. He's learned > lists, dictionaries and even some OOP without me. I don't think name > binding would be a stretch. > > > You could also discus factory functions with him. Once he gets that a > > function can return another function, then it won't be so much of a leap > > for a function to take a function as an argument. > > I think this isn't the most intuitive way of approaching first order > functions. It's true that if a function can return another function > then a function must be first order (i.e., it's just like any other > variable), but that seems almost backwards to me. I think it would > make more sense to have beginners _know_ that functions are like all > other variables and can therefore be passed by other functions or > returned by other functions. That I think would be better accomplished > if they define functions the same way you would define other variables > that you know can be passed and returned. > > > -- > > -- Sean Tierney
|
https://mail.python.org/pipermail/python-list/2007-September/442737.html
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
Yes i know everyone hates homework help but this was a last place i could go I am writing a program that stimulates a vending machine and i have written almost all of the code its just not working correctly I am stressing out because it is due by tomorrow and was wondering if anyone would be able to help me out in any way possible i have attached the *.cpp file and would be willing to do anything if someone would look over it Im not asking for you to completly due it just help me becase i am stuck and do not know were to turn.
In the program it is to give change back which i am having trouble doing so because it breaks it down into half dollars dollars dimes quarters and nickles its really the only problem i have i have written code that i believed to work but it has not if anyone is out there please help
This is what the outcome should look like
Gee, you sure were in a hurry but the lack of full stops really mangles what you say.
This is not really a place to ask for homework answers.But I did look at your code and you use a lot of variables like a,b,c etc for what resonable puprose I cant guess.Also code is a bit messed up in the sense that it too packed where you calculate the vals so I could not understant it too much either.
But here's something :
Lesson1:Code clearly and use spaces and newlines.They will save your life when it comes to debugging.Noodle code is a death trap.(Your code is not too noodlely except in the if else part).
Lesson 2:Use funtions (I dont know if you know funtions)
Now your prob:One Idea would be to convert the entire amount in to the lowest denomintions availble(nickle?) and calulate using that.In the end convert it back to dollars and show what ever remanins as nickles.Dont bother with quaters unless you have to.
Not much but i could not understand you code nor what was you prob,nor do i have a compiler handy right now. :0
I'm writing your program though it might be too late! ;)
ok... it's ready but it doesn't cover the part where the option is invalid ;)
#include <iostream.h> #include <conio.h> int dol,cen; unsigned int cb=0,ch; void convert(int cb) { dol=0;cen=0; while (cb>=100) { cb-=100; dol++; } cen=cb; } void read() { convert(cb); cout <<"The current balance is\t" <<dol << " dollars and "<< cen <<" cents "<<endl; cout <<"Please choose from one of these options"<<endl; cout <<"\n"; cout <<"5 - Deposit a nickle\t"; cout <<"45 - Buy some gum for 45 cents"<<endl; cout <<"10 - Deposit a dime\t"<<"\t"; cout <<"55 - Buy crackers for 55 cents"<<endl; cout <<"25 - Deposit a quarter\t"; cout <<"60 - Buy a soft drink for 60 cents"<<endl; cout <<"50 - Deposit a half dollar\t"; cout <<"70 - Buy a candy bar for 70 cents"<<endl; cout <<"100 - Deposit a dollar bill\t"; cout <<"85 - Buy some chips for 85 cents"<<endl; cout <<"0 - Request coin return and quit\t"; cout <<"\n"; cout << "\n" <<"Enter a number to choose an option:\t"; cin >> ch; } void main() { clrscr(); cout <<"This program simulates a vending machine"<<endl; read(); while (ch!=0) { cout<<"\n\n"; if (ch==5) { cb+=5;ch=-1;} if (ch==10){ cb+=10;ch=-1;} if (ch==25) {cb+=25;ch=-1;} if (ch==50) {cb+=50;ch=-1;} if (ch==100) {cb+=100;ch=-1;} if (ch==0) { cout<<"Quiting\n"; while (cb%100==0&&cb>0) {cout<<"Returning a dollar\n";cb-=100;} while (cb%50==0&&cb>0) {cout<<"Returning a half dollar\n";cb-=50;} while (cb%25==0&&cb>0) {cout<<"Returning a quarter\n";cb-=25;} while (cb%10==0&&cb>0) {cout<<"Returning a dinme\n";cb-=10;} while (cb%5==0&&cb>0) {cout<<"Returning a nickel\n";cb-=5;} ch=-1; } if (ch==45) { if (cb>45) { cout<<"Here is your gum\n"; cb-=45; } else cout<<"Error:Deposit more money\n"; ch=-1;} if (ch==55) { if (cb>55) { cout<<"Here are your crackers\n"; cb-=55; } else cout<<"Error:Deposit more money\n"; ch=-1;} if (ch==60) { if (cb>60) { cout<<"Here is your soft drink\n"; cb-=60; } else cout<<"Error:Deposit more money\n"; ch=-1;} if (ch==70) { if (cb>70) { cout<<"Here is your candy bar\n"; cb-=70; } else cout<<"Error:Deposit more money\n"; ch=-1;} if (ch==85) { if (cb>85) { cout<<"Here are your chips\n"; cb-=85; } else cout<<"Error:Deposit more money\n"; ch=-1;} read(); } cout << "GoodBye\n"; }
:cheesy:
Quite nice,Fili
Thanks Fire Net :D Do you suppose it's too late for it to be of any use?
I dont think so,it will be of some use to someone,hey teachers usally accept a submission even if it a bit late.
I dont think so,it will be of some use to someone
Thank you :cheesy:
I'm not expert but I did programming in my 2 year course just finished and understood that vending machines work on the weight of coins.
:rolleyes:
I'm not expert but I did programming in my 2 year course just finished and understood that vending machines work on the weight of coins.
:rolleyes:
Well, that's what his problem said. Anyway i'm not a US or UK citizen so i'm not great at english :sad: What is a vending machine exactly?! :o
ahh ok I see. Thanks Dave :)
|
http://www.daniweb.com/software-development/cpp/threads/7183/vending-machine
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
This may be perhaps the first time I’ve embraced an article from the Yale Environment 360 forum, the opener reads:
Environmentalists have long sought to use the threat of catastrophic global warming to persuade the public to embrace a low-carbon economy. But recent events, including the tainting of some climate research, have shown the risks of trying to link energy policy to climate science.
Al Gore’s latest book where he had to photoshop in some hurricanes comes to mind.
The NCDC sponsored climate change report where they photoshopped in a flooded house also comes to mind.
And, yes even the snowstorms reportedly caused by global warming this winter are also reminders of how common this bogus linkage to weather is.
From:
Green think tank tells environmentalists: Leave climate change science behind
By Ben Geman
Leaders of a contrarian environmental think tank, The Breakthrough Institute, have a way to get beyond the climate science wars: Break the link between global warming research and the push for low-carbon energy.
Ted Nordhaus and Michael Shellenberger, in a new essay in Yale Environment 360, [Titled: Freeing Energy Policy From The Climate Change Debate] argue that environmentalists are too eager to link natural disasters and dangerous weather to man-made climate change.
…
They.
…
The Yale Environment 360 website has a comments section below the articles. Look for a lively response to their new piece.
Have to agree Anthony, pretty level headed story. Sure wish more environmentalists were not so over the top and full of…………..HOT AIR
Sincerely,
John
Luboš Motl says:
Amen. Stop scaring the children!
There’s no reason for environmentalists to have any say on energy anyway, especially when they don’t know one thing about science and oppose nuclear. Our energy use has been decarbonising for generations as explained by many scientists and writers from Dr Patrick Moore to Michael Crichton.
Whenever environmentalists do get involved, it is to try to steal credit for what is happening anyway or to do the dirty work of western governments in persuading poor nations, especially black people, not to develop or to bribe the political elite of those nations to keep their people in a state of backwardness. They also purchase land for cheap in the name of conservation to prevent productive use of those lands, then after a while sell them on to favourable corporations.
Apart from Patrick Moore’s Greenspirit I can’t think of any environmental organisation which isn’t damn dirty.
I definitely agree. Energy conservation, sustainability, minimizing pollution, etc are good things, but the repeated tying of these things to global warming messes things up royally.
I was trying to explain how CAGW is, at best, a possible hypothesis that is doubtful and he countered with something like – well cutting back on fossil fuels is a good thing. Of course it is (my wife works in a lab working on alternative energy…I don’t know how he could think I didn’t realize this)! I tried to explain to him how the two are very different and shouldn’t be linked (CAGW demands immediate/crazy action, whereas sustainable solutions will likely creep slowly over decades), but I don’t know if he got it.
I’m glad more people are starting to discern between the two.
-Scott
I agree with the message of this particular essay. However, after reading the authors’ 2004 article, The Death Of Environmentalism, it appears they simply blow in the political winds. My kingdom for a progressive who is capable of critical thought.
Well if it smells like a duck, and sheds feathers like a duck; it’s a duck !
So what’s with this LOW CARBON ENERGY GIMMIC; if it is supposed to be divorced from “Climate Science” or “Climate Change”.
The very words LOW CARBON mean they haven’t got the message.
It isn’t the carbon;IT’S THE WATER; STUPID !
So let me understand, they were using climate change nee’ global warming merely as a ploy to get an environmentalist agenda through? In other words, THEY are not even certain whether it’s true, they were using it only to get their agenda through.
What next, the threat of cute polar bears starving to death?
Oh wait, they already used that one.
So, essentially: The fraud isn’t working, time to throw in the towel, and just admit the real motive..>…… an irrational hatred of hydrocarbon fuels…. oh, and a death wish to shut down all civilization.
… the first in a 12 step process?
“George E. Smith (16:55:28) :
[...]
It isn’t the carbon;IT’S THE WATER; STUPID !”
Yeah. We need a low water economy. Dewaterize the economy! No Evian for you.
must’ve been swallowed by the spam filter...
Interesting, they are going back to their original ‘green’ idea. But how will civilisation change to their will when there is no doom to avoid? Are these people a bunch of wingers that cannot accept that progress means destroying old ideas like the sun revolving around the earth or that the earth is flat. In order to make an omelette you must break some eggs – releasing a little bit of plant food into the atmosphere is a good thing :-)
Getting the most out of fossil fuels: Globlal Trade should mean exchange of goods for goods, not pure transfer of wealth at the greatest expenditure of energy.
Excessive importation is the epitomy of energy inefficiency. That stuff doesn’t travel on sailboats, it requires lots of bunker oil to get it here.
Internal transportation should rely most on rail, which is far more energy efficient than semi. It’s out-of-balance.
).
If you want clean, you have to regulate. (Personally, with clean i don’t mean CO2-free but other people have different ideas of clean; in both cases, the same applies: without regulation, no company will do it – it harms their competitiveness)
If one notes trends, one will observe that expanding energy use correlates to HUGELY expanding energy reserves.
(This is one case where correlation may indeed equal causation.)
We now have a climate caste system. The enlightened
progressives and their fear mongering minions.
This is fun; more popcorn please!
One might even ask if carbon-based energy use cannot be convincingly connected with AGW why there is a particularly pressing imperative to reduce use of carbon-based energy in the first place . . .
This is a major step in the right direction. I think the concept of the intertwining of advocacy & science has fired up many of the scientific types on this blog because the degradation of science in general was apparent. This is a good 1st step in separating politics & science & restoring the credibility of science.
To those who still seem offended by the term “low carbon” energy, it is perfectly acceptable to use that term & not imply a global warming link. The other way to interpret it is “high efficiency” energy (ie more work per btu is equivalent to more work per net carbon molecule). Higher efficiency is always better- both personally & societally – regardless of your personal politics.
Well the trouble with that Yale site is they don’t have somebody like Chasmod who is awake at the switch.
When it comes to placing a comment on that site; their moderator process is about as slow as postal chess.
If they ever post my short comment; it will be into its second or third half life.
[Hey! ~dbs, mod]
Uhmm, subtext reads, “change tactic” not common goal. There’s nothing wrong with “carbon free” energy. Except that it won’t happen in my lifetime nor yours. Neither, is there anything wrong with carbon based energy. Yes, we’ll probably run out, eventually. But, again, not in my lifetime nor yours, nor your children’s. I would like to say that I don’t understand the obsession with carbon based energy, but it seems clear to me, that there are too many humanists hell bent on taking humanity out of the human race. Like it or not, human progress and standard of living can still be measured in terms of carbon emissions. Call me strange, but I see upward movement in both as a good thing. Further, I see that the laws of energy/physics/nature still apply to mankind. As far as I know, we still cannot create energy. Find the “perpetual motion machine”, and we should all be living in a utopia soon. Until then, there’s no need to rush efficiency, it’s man’s nature to strive for it. It continually happens regardless of the tactic employed.
My take anyway.
Don’t ethanol and biodiesel have carbon in them … how does their use equate with a low carbon economy? And if we are able to synthesise transport fuel from hydrogen (produced from off-peak nuclear generated electricy) and CO, produced by pyrolysis of biomass, would that count as part of a low carbon economy.
Methinks, if they want to focus on alternative fuel sources – good idea. But they need to forget this nonsense about carbon.?”
Step 1: “Admitted we wanted the world to be powerless
—that we were trying to make everyone’s lives unmanageable….”
It’s a shame the environmental movement has been taken over by such a shoddy argument. There are plenty of real reasons to do many (not all) of the things the AGW preachers want us to do. If the whole environmental movement is discredited, bad things will result.
And then there’s this:
Don’t overreact; this doesn’t prove we’ll have a big recovery in the summer minimum, but it’s a nice start. The facts are “inconvenient” for the AGW faithful right now.
Predicting the end of the world always works well for a while. But when the world doesn’t end as predicted, the preacher’s following melts away.
evanmjones (17:29:45) : “…if carbon-based energy use cannot be convincingly connected with AGW why there is a particularly pressing imperative to reduce use of carbon-based energy in the first place . . .”
Good question. Answer: The United States has the largest reserves of coal in the entire world. China covets these reserves and would like to buy them at 5 cents on the dollar. OPEC would like to increase our dependence on foreign oil and gas. By making coal illegal, our enemies can ruin the US in one fell swoop. US allies (if there are any) will be over-run. Obama will bow.
Looks like the ‘greens’ are going into retreat.
We have plenty of fossil fuels for the foreseeable future and, if industry is left to it’s own devices, alternative sources of energy will be discovered and commercialised.
CAGW and ‘peak oil’ are both false memes.
“evanmjones (17:27:09) :
If one notes trends, one will observe that expanding energy use correlates to HUGELY expanding energy reserves.
(This is one case where correlation may indeed equal causation.)”
It surely does. Expanding energy use leads to a fall in reserves expressed in yearly consumption. This triggers a price rise and an increase in exploration activities and development of new technologies, making previously unviable reserves economically viable.
So is it finally time to put into the dustbin of history one of my pet peeve expressions ” carbon footprint ” ?
I will be happy never to hear that term again!
Lets face it, the truth is finally now out there, and the population are getting it. We have been scammed.
Too many people get caught up in the hype, including scientists and other professional folks, including journalists.
Think about it, the planet is 70 % water , 25 % desert ,mountain, ranges, and ice covered poles..Which leaves 5 % of the planet for all civilization, the most of which live along the coastal regions of the planet, including people , animals , and other aspects of all civilization. Lets also not forget that all of the earths inhabitants could easily fit in the smallest state in the USA. ( tight squeeze albiet ) . Doesn’t matter, it is just an example of how small we are.
The point is, man is an inconsequential presence on this planet. We have zero impact on its climate, but we do inpact local environments with pollution etc. That is something we can affect.
The Global footprint expression parlayed by many in the green movement ( including Al Gore gag me ) always left me with a sick feeling in my gut…….I knew it was wrong, and now finally I am proved right. Its time to put that puppy into historys dustbin.
Thanks for the opportunity to speak my piece.
Ian
ya, this is coming from the guy who said he invited the internet……….i call B.S.
look AL i see were u are going but its just not going to happen, and if it does i will personally kiss your ass……seriously im that confident that your theory is not just flawed but totally wrong. oh btw that volcano in Iceland……..u might want to throw that into the equation.
The other myth that has yet to be exposed, like AGW, is what our carbon based energy situation really is. Supposedly we are running out, while ridiculous alternatives like wind and solar are explored.
This is doubtful. Why?
First some background. The Oil industry is essentially a cartel. Opec is of course the visible face which is the producing cartel. However, they rely on the support and distrubution cartel (formerly called the 7 sisters, Exxon, BP, etc, otherwise known as Big Oil) to get their oil and gas from the ground to the consumer. In effect, the controlling cartel is not the producers, and they have a symbiotic relationship, and may be considered one and the same.
So all we know about reserves comes from this cartel. By claiming shortages, and dwindling reserves, and in effect ensuring supplies just meet demand, they ensure high prices (used to be 3 dollars a barrel 35 years ago) . There is interlocking directorships in Oil and Investment Banking (David Rockefeller says hi) so the financial arm helps drive market prices up with speculation in futures (they also make money shorting these futures when they bring prices down from unsustainable increases)
Big Oil (not using any specific company name) does not pay market price for oil, having entered into long term contracts with producers. However, their refineries pay market price. Profits get hidden in the tax havens (ever wonder why the tankers are registered in places like Pananama?). The off shore company where the tanker is registered buys the oil for say 50% of market price from the oil producer (who is dependent on them for hardware needed to get the oil from the ground, store it and ship it). Then sells it to the refinery in the US at somewhat less than market price (locking up the profits elsewhere, hence less tax in the US). US oil production is problematic in this regard.
In any event, 35 years ago we were supposed to be running out of oil globally, and today have reserves double what they were 35 years ago (of course consumption has also doubled).
One curious thing which proves my point that we have far more oil than Big Oil would like us to know is their obvious reluctance to search for oil in the US. Leased land goes undrilled. Some will mention environmental concerns inhibiting their ability to search for oil. Ask yourself this.
In the aftermath of 9/11, with Arab oil producing nations looked upon as a threat, and this country dependent on oil, not to mention our military which uses more oil than most countries, how could Bush and Cheney, Big Oils biggest buddies, not be able to open up the drilling, especially along the coast. Even if Congress would not go along (it was a Republican Congress), he could have used an Executive Order siting National Security concerns and he would have had the full support of most Americans. He didn’t. Why?
The answer is that Big Oil does not want to increase supplies. Things are doing very well as is thank you.
There is also Thomas Golds abiogenic theory of oil in the deep hot biosphere. He claims some oil wells thought to be depleted are being refilled (although not at the rate in which it was depleted), and that fossil fuels are not of biogenic orgins, but are upwelling from the deep earth, even in areas not thought to have oil do to the lack of sediments (just have to drill deeper). As an astro-physicist at NASA he claimed most planets have plenty of hydrocarbons, and that these compounds exist naturally throughout the universe from the beginning and did not require carbon based life to form them.
Obviously, nobody can prove this but Big Oil. The Russian scientists know, informing Thomas Gold that they developed this theory first, and have implemented their knowledge to increase Russian oil production despite having been thought to be running out of oil 20 years ago . They have no motivation to speak out publicly as this would depress oil prices, a commodity their economy depends on.
This takes us to nuclear energy. An accident at TMI that many say was sabotage cooled Americas interest in nuclear power. At the same time, double digit interest rates caused by the Fed, the banking industries lackey (remember the interlocking interests) made the financing cost for nuclear power plants so high the venture would be unprofitable. In addition, the US refusal to recycle spent nuclear power rods means waste is accumulating (recycle rates can be as high as 97% , and new generation power plants can use the spent power rods from older plants as is), and is used by environmentalists as the key argument against nuclear power.
Thus the biggest threat to Big Oil was removed. Since then, Big Oil through other companies and with the cooperation of the US and European nations and Australia have been acquiring land containing uranium oxide supplies and uranium enrichment plants. Once the cartel for this energy source is ready, there will be a push for nuclear power. Energy prices will of course be kept high since the supplier will be a cartel. In the meantime, those countries seeking to develop enrichment plants will meet with threats and sanctions.
The banking industry will be in a position to make a pile by loaning money to finance nuclear power plant development. This will probably happen when oil prices test 150 dollars a barrel again. Double digit inflation will likely be on the horizon, and the banks making such loans to these nations will need to be bailed out, and in return more resources from these nations will be promised to cover the loan in default. In the meantime, more loans will be available for them to buy oil if needed. Maybe at that time loans will be in the form of carbon credits and payments in carbon dollars.
Richard North,
The claim is that ethanol and biodiesel cause less carbon emissions than the equivalent natural hydrocarbons. Or… that they might eventually. The “cleaner” argument is much stronger when it isn’t focused on the carbon emissions but other emissions – the sulfur content is dramatically lower.
There are a variety of problems with the ‘lower carbon emissions’ position, some crippling. But they keep getting included in the environmentalists lists because the do have the virtue of being “sustainable”. (Or… nearly sustainable. A breakthrough or three on enzymatic of catalytic formation methods would be quite helpful to their argument.)
OT, but related to the eco-zealots desires, our “beloved” (10% approval rating) Congress is emboldened by illegally passing an illegal law to work on passing another illegal law based on this “science”. Here is the link.
This just shows that even with climategate, even with colder winters, even with the house of cards falling, and even with the discredited scientists, our Congress still doesn’t care about the true science, just political goals. You can write your representative 200 times a day and it won’t matter. It didn’t matter when people marched en masse at Washington. It didn’t matter when people called so often to their representative, the phone lines were overloaded. They still voted for a bill despite the will of their representatives. You should write anyway and tell them to back the truth by voting against any carbon tax. But it is clear how our Congress has become drunk with power. If carbon taxes passes, along with the implementation of the 2700+ page health care bill, this country will dream of having living conditions found in North Korea. (Obvious hyperbole.)
(By the way, federal health care controls are illegal because of the 10th Amendment to the US Constitution which prohibits the federal government from taking rights not specifically given to it in the Constitution. The idea is to concentrate power in the states. Managing health care or controlling CO2 emissions is not a power given to the federal government in the Constitution.).
Have you seen the many tax incentives to suppress any new innovation by keeping the current inefficient crap going?
Free markets want to sell more junk energy technology than look at anything that could really make power as it sells more parts and turbines and keeps the price of power high.
So stop scary stories for kids and focus on getting more energy and energy independence. Sounds like the right approach for our country with the highest fossil fuel reserves on the planet.
No? What, that’s not what he means?
I’m sorry, but I don’t see the objectivity of an essay who’s intent is still to de-carbonize our economy, and that the revenues raised would be solely used to develop low carbon industry. It looks like the Precautionary Principle, only now done without a basis to do so.
Clean energy as they described it includes reducing carbon.
Too bad the Green’s ideas for energy are just as wrong as their ideas on the climate.
We had windmills. We got rid of them. Why? Because they suck as a power source.
Solar is just as bad, probably worse because it’s even more expensive than wind.
“Green think tank tells environmentalists: Leave climate change science behind”
Wow. The first major crack from within.
P.S.
Here’s a link to a video showing an example of how truly God-awful the Green’s energy ideas are.
pft (17:59:37) :
Look at the USGS surveys. By the U.S’ own reports, we have more and more recoverable oil and natural gas, seemingly, every year, in this nation. That verifies your assertions except that the real information is out there, but no one cares to look. Given man’s natural propensity for efficiency in all things. There is absolutely no reason for any concern for us running out. (Natural gas, the coal derivative, is NOT a finite resource, but then, I don’t believe oil is either.)
I digress, money makers will continue to make money. It’s their nature. Of course, they feign shortage. Policy makers usurp power. It’s their nature. Our nature should be to ensure they don’t get too carried away. Sadly, too many of our ‘brotherhood of man’ are only too eager to believe people shouldn’t make money and the policy makers have our interests at heart. Liberty and freedoms, apparently are passe ideas.
Doug Badgero,
If “The Death of Environmentalism” is by the same guy I think it is – sorry I don’t have his name handy – he was the rising young star of the environmental movement when he wrote that… almost in a fit of rage about how unyielding, uncompromising, and ineffecive the Green Movement had become. He now works, of all places, with Wal Mart and is making potentially thousad of times more difference with them then he was “fighting the good fight”. If I recall I ran across him on an episode of Penn and Teller’s “BS” (real name of the show is Penn and Teller’s Bullshit but mods feel free to snip)
I was a Boy Scout when I was a kid and me favorite, albeit inconsistent, pastime is going to National Parks… hiking, and photographing nature. I cannot stand for the political advocacy and outright scam groups like the Sierra Club have become. I’d rather burn my money than let a cent of it go their way – they are not about nature, they are anti-humanity.
Kudos to these kids for realizing that reason trumps extremism, and that hitching their wagon to a f…. (not the four letter F-word but the five letter one) will only backfire in the end. I wish them all the best!
This article in this context is a health sign, but I find it confused in 2 ways.
Firstly, if we remove the (phoney) Climate Science argument for low-carbon economy, then why would we continue to work for low carbon economy? Their argument would make sense if it were saying that the CAGW argument should be abandoned as a way of persuade the public to embrace a shift to arenewable energy economy – and I would applaud that!
Secondly, they are too easy on the science advocates of catastrophic global warming when they say:
In 1981 Hansen was already telling the New York Times of 6 – 9F temp rises and 15-20 feet sea level rise in next century. As soon as the 1970s cooling was over, Schneider and Hansen pushed hard with the alarmism, against a background of disapproval from climate scientists still debating the net effect of human caused cooling (aerosol) and warming and all the complex uncertainties surrounding the assessment of these effects. In 1988 Hansen told congress he was 99% certain. These scientist alarmists only slowly won over the support of the environment movement during the course of the 1990s with alarmist rhetoric.
It was these scientists who used their apocalyptic senarios to capture the attention of the environmentalists, not the other way around. And it was these scientists who first characterize all resistance as corrupt (Big Oil), anti-scientific, short-sighted, or ignorant.
ENDGAME by Alex Jones investigates & attempts to join the dots & explain the powerful agendas behind CLIMATEGATE. Greens & Climate Scientists don’t have the power to orchestrate the UN, National Governments, Corporations, Banksters, Media & Science. [SNIP. Aargh! Post the "truther" (and worse) conspiracy theories elsewhere. We don't do those here! ~ Evan]
It is most recently being employed to demonise the truth & libertarian/tea party movements in the US.
Greens & Scientists were just the patsies for what our prime minister loves to refer to as the NEW WORLD ORDER.
Know your opponent. Join the dots. Take back your power. Love & Truth.
Translation-Let’s stop trying to justify inferior energy sources on their benefits to improving the weather, since they don’t, and start propounding their merits, which are non-existent.
Yeah, that’s the ticket.
“rickM (18:29:51) :
I’m sorry, but I don’t see the objectivity of an essay who’s intent is still to de-carbonize our economy, and that the revenues raised would be solely used to develop low carbon industry. ”
Maybe they are Malthusians and see limited resources as a principal problem. As i said, we would have at least 500 years to solve it but some people, especially people paid for, just want to rush it. The German solar industry has a very well-oiled (oops!) lobby, for instance.
evanmjones (17:29:45) :
One might even ask if carbon-based energy use cannot be convincingly connected with AGW why there is a particularly pressing imperative to reduce use of carbon-based energy in the first place . . .
………………………………………………………………………………………………
Class…….class……..I have an announcement:
today’s gold star for making the most sense goes to Evan M Jones.
DirkH (17:02:38) :
Yeah. We need a low water economy. Dewaterize the economy! No Evian for you.”
If you spell “Evian” backwards you get “naivE”. That’s what I consider environmentalists to be.
.”
Yeah but that does not help expand the government and destroy the middle class. No communism no deal.
–
Hm. Problem is that when you “Break the link between global warming research and the push for low-carbon energy,” there’s no reason to suffer the prohibitive costs of “low-carbon energy.”
The combustion of fossil and non-fossil hydrocarbons for the generation of energy obtains not because of collusion or conspiracy or corporate plotting, but because, ceteris paribus, it is the most cost-efficient way to power vehicles, drive railroad transport, fuel aircraft, and power commercial maritime and riverine shipping.
The “low-carbon energy” alternatives – except for light water moderated nuclear reactors in the generation of baseload electrical power – simply aren’t workable. Petrochemicals beat the hell out of everything else.
No global warming scare, no “low-carbon energy” requirement, and that leaves the ‘viros standing there in the street with their pudenda hanging out and no idea how to fumble their zippers up.
–
reuters has a piece on this, but only MSM coverage is NYT Blog. quite a big story really given who the traders are:
30 March: NYT Blog: James Kanter: HSBC Ejects Carbon Traders From Index.
Climate Exchange owns the European Climate Exchange, the Chicago Climate Exchange and the Chicago Climate Futures Exchange. The chairman of Trading Emissions, Neil Eckert, is also the chief executive of Climate Exchange….
the companies HSBC removed from the index had failed to reach the minimum market capitalization of $400 million..
You better sit down for this one….)
If they can convince people on the real merits then more power to them. Just don’t make crap up and – worst of all in my book – try and scare monger little kids with “ZOMG we’re all gonna die” scenarios that are at best worst case scenarios (at worst complete and intentional scams).
TBH, I don’t think it would even come close to working but hey, be honest about it. That I can support.
I have spent my whole working life in nuclear power. I can assure you that the accident at TMI was not sabotage. It was a combination of design deficiencies and operator error, as these things usually are, e.g. Exxon Valdez, etc. Also, since we generate essentially none of our electricity in the USA from oil, the expansion of nuclear will have little or no effect on our demand for oil.
Peak oil theory is idiotic The price of oil, or anything else, is largely determined by monetary policy, in particular the growth of the money supply. Money supply growth has been high since the beginnings of the housing crisis. All you have to do is look at the price of other commodities. Are we also running out of gold, silver, sugar, copper, etc?
[quote openunatedgirl (19:05:59) :]
Talk to any one from New Orleans.
[/quote]
Hurricane Katrina was a category 3 storm, which makes it middle of the road. Katrina was an unprecedented political failure, not an unprecedented natural force.
[quote openunatedgirl (19:05:59) :]
I am not claiming to know all the facts
[/quote]
Good thing, since your entire post is nothing more than repeating the gossip you’ve seen on TV. I simply don’t have the time to go through it and explain why you’re wrong on basically everything you say.
But if you want the public to be educated, start with yourself.
I guess the conclusions of this “Green Think tank is a kind of breakthrough but I simply don’t agree with the entire focus on a low carbon economy.
We simply need carbon fuels, not only to produce steel, aluminum, glass, concrete and other construction materials.
We need oil to produce plastics, clothing, pesticides, fertilizer, medicine, resins, paints, you name it.
For the current and next generation we don’t need to focus on energy at all and we certainly don’t need the climate gang on our shoulders meddling with the very basis of our economies.
Energy in fact is a non item because we have plenty of it.
We have cheap shale gas available to power highly efficient natural gas fueled power plants for a very long time.
We have plenty of oil available, we can generate gasoline from coal and sulfa free diesel from natural gas.
We already know how to handle and burn these fuels without negative effects for the environment and our health. We only need to apply those technologies world wide and further optimize efficiency.
Even if we don’t further optimize efficiency rates, there won’t be a peak oil situation for a long time.
We have all the time in the world available to further develop real innovating technologies that is not only able to replace fossil fuels, fulfill our energy needs, but also our need for raw materials and food production and help humanity through the onset of the next ice age.
The best way is to invest in new propulsion technology for space exploration and power generation.
In terms of time we are at the brink of real quantum jumps in development that are currently underway.
Future technology will enable us to manipulate matter on a molecular level and it will enable us to produce any material we need in any required quantity.
Power and energy will be a spin off of such a process so we will also have sufficient energy available for fresh water production from sea water where ever we need it and hydrogen for transportation.
Within a few decades from now we will look back and laugh about this period in time especially about those who are prepared to role back our civilization for individual profits, power and the desperate attempts to “save the planet” that needs no saving.
I see a bright future for all of us only threatened by wacko politicians, politicized science and a frightened public putting their trust and faith into the hands of the wrong people.
These folks have nothing better to do than stir up $#!t, in order to satisfy their own paranoia and greed. If they can’t do it in the political arena, they will do it in legal arena. Nuisance lawsuits such as those being brought (below) are the stock in trade. Of course their logic is absurd, since the end point of their argument would be that “man-made global warming” (by definition “man-made”) is the result of human existence and therefore everyone on the planet is guilty of being a public nuisance. I wonder if they could get a volume discount on lengthy stays at the Padded Walls Hotel if they went thru Orbitz?
Quote:.
jorgekafkazar (17:54:10) :
Yes, the Chinese and EU are getting our coal:
Who’s getting the best of that deal?
Scott (16:46:37) :
I definitely agree. Energy conservation, sustainability, minimizing pollution, etc are good things, but the repeated tying of these things to global warming messes things up royally.
I gotta disagree with you Scotta.
1. Energy conservation only makes sense in economic terms. Buying twisty bulbs is uneconomic given the light output and energy savings, over their lifetime.
2. Sustainability is unsustainable. The Earth, even the Solar system, is NOT sustainable. The Sun will grow to red Giant size in a few billion (5-15?) years time. It’s not even clear the universe is “sustainable”.
3. Minimize pollution is good, but only up to a point, and at what level is it pollution rather than natural environment. For example, it was good to get rid of the London smogs. But, there is a natural level of organic compounds in the atmosphere; or arsenic in lakes; or lead or uranium in the soil, or radon in the basement. It is folly to attempt to reduce “pollution” to, or even below, natural levels. Just because we can measure it to parts per billion and we know if we give mega-doses to rats for a year, they die, doesn’t make it pollution.
openunatedgirl (19:05:59) :
“You really want to challenge that we are ruining our environment? Really? Talk to any one from New Orleans. True, global warming was not the culprit there, but the rather the destroying of wetlands for profit.”
We were warned for two generations about what would happen in New Orleans if a major hurricane came ashore there. The levees were designed for a fast moving category 3 hurricane and Katrina was a slow moving storm. The city had to be constantly dewatered to keep it from flooding when it wasn’t even raining. Much of it is below sea level for goodness sake. Storm surge did not damage that city, flooding beyond the design capabilities of the levees did.
openunatedgirl,
Couldn’t agree more – and I think Anthony might say the same thing. Out of all the ways we could spend our time, effort and money regarding environmental issues… “decarbonization” of the economy might just be the absolute worst way we can spend it.
For me at least, I am not applauding their goals, just their apparent intent to have the conversation on honest terms.
And why are we having China build our clean-coal technology?
So much for those ‘green’ jobs.
openunatedgirl (19:05:59) :
New Orleans was built below sea level and the levees weren’t rebuilt – opposed by enviromentalists. Go drown in your crypto-socialist misanthropy.
I remember saying back in late November (and in this forum, I believe), that I give AGW another nine months of momentum. That was based on the time between Nixon’s “I am not a crook” speach and his resignation. This latest news , methinks, is right on schedule!
“openunatedgirl (19:05:59) :
[...]
To address the overall tone of this message board, I would like to say that I am completely depressed by the majority of your comments. You really want to challenge that we are ruining our environment? Really?”
You shouldn’t be that depressed, openunatedgirl. I’ve lived through the 70ies in Germany. We had lead paint, leaded gasoline, lots of carbon monoxide and SO2 from the smoke stacks, acid rain, all kinds of funny chemicals for cleaning and other purposes that have lots of C atoms forming funny rings, asbestos in the school buildings i learned in (funnily one day they were cordoned off), in the army i used a cleaning chemical on tanks that was verboten a few weeks later (cancer causing it was they found out after we had exhausted the stuff) and on and on and on it goes… Birds of prey were nearly extinct because DDT made their eggs crack more easily.
All these problems have been solved, long before any wind turbine or PC panel was erected. Car catalysts, prohibition of lead in paint and gasoline, prohibition of asbestos, DDT, desulfurisation of power plant chimney exhaust.
Nothing to do with renewable energy. Germany has become a rather clean country and the only awful smell you get in some places is when you’re downwind from a brewery. And that is probably not even toxic.
Just install some filters on your power plants and you should be done. If you don’t already have that. Doesn’t cost that much.
Monique (18:34:38) :
“Green think tank tells environmentalists: Leave climate change science behind”
Wow. The first major crack from within.
————————–
Reply:
Yup. Who’d want the albatros of “climate change science” around their neck? Now, not even the AGWers!
For the record, I agree with Poptech.
This quote….is worth repeating again….and again. The true CRUX of the matter.
.”
And it also has served to undermine legitimate environmental concerns, such as pollution, habitat destruction, and the disastrous overfishing of the world’s oceans.
One day soon…it will be a matter of historical record…as to the scam of CAGW and thus Al Gore…for the duration of his life…will never, EVER be taken seriously…again.
No loss! And good riddance!
Chris
Norfolk, VA, USA
“Greens pushed climate scientists….”
So Greens are now pushing their Trial Lawyers along with their EPA comrades and activist judges… they don’t need college kids anymore.
The day climategate happened they knew they lost the science battle, the day glaciergate happened and the world actually read IPCC AR4, they knew they lost their momentum and the battle for the worlds collective mindset.
So now they’re going to see if they can win the money battle. Watch out everyone, just when you least expect it, someone will walk up to you and say, “Smile, you’ve been sued by a Greenie!”
Maybe I was just agreeing to part of openunatedwhatshername.. on second read at least
The important part here is *oppurtunity cost*, for each dollar we spend on X we do not spend it on Y (unless, of course, the government has gone completely out of control and just printing money with no thought to its repurcussion… but that would never happen amirite? :P )
That’s what I was trying to get at. To reclaim the wetlands around New Orleans we’d need to shut down the dredged out deep shipping lanes of the Mississippi River – what effect do you think that might have? As others have pointed out, New Orelans had its own economic equation when it came to the levee system, which in hindsight was a complete miss. The wetlands had nothing to do with the storm surge overtaling the levee system through Lake Ponchetrain.
As DirkH mentioned, there are many *very* effective ways by which money can be spent on environmental issues… but they should be debated openly and honestly.
I see no breakthrough. All I see is certain folks distancing themselves from a theory they were only too happy to blindly embrace, defend and use to the max for their own ends until such time as that theory fell on hard times. I find it telling that these mental giants only began their retreat when it became clear that Ma and Pa Kettle were no longer buying that crap.
“NickB. (19:14:47) :)”
Probably you mean sulfate and black carbon particles. As i said in my comment to openunatedgirl, both can be filtered. The sulfur can be filtered with flue gas desulfurization, PM10 and other black carbon particles can be removed with catalysts. In Germany, Diesel is cheaper than gasoline due to less tax – don’t ask me why the tax is lower but it is so – that’s why german carmakers all have a lot of Diesel cars to offer. They now get equipped with catalysts that filter the carbon particles out and when the filter is full they burn the collected particles to CO2. I guess similar filters are used in power plants as these particles are cancerogenous, the smaller the worse.
We have a cogeneration plant near the city center of Braunschweig, my home town. All that you see coming from the smoke stack is some condensed water vapour. You get a little industry snow from it in winter. The plant runs on coal and gas, i think.
R. de Haan (19:17:07) :
Good post Ron.
magicjava (19:15:52) :
[quote openunatedgirl (19:05:59) :]
“Talk to any one from New Orleans.”
“Hurricane Katrina was a category 3 storm, which makes it middle of the road. Katrina was an unprecedented political failure, not an unprecedented natural force.”
I certainly agree about the unprecedented political failure part, magicjava. However, even though Katrina was technically downgraded to a three by the time it made landfall, it was no ordinary three.
It carried with it the energy (especially storm surge and battering wave action) of its recent past, as a strong category five.
The weaknesses of the Saffir-Simpson scale are coming to light. Case in point, in 2008, Ike was a technically a two when it hit Texas, but it carried with it the storm surge energy of a strong four. And the extreme damage on the Bolivar peninsula bears this out.
Also, back to Katrina, the person citing New Orleans was off, as you said, but more than the reason there was political and infrastructure failure in New Orleans. The REAL damage was to the east of New Orleans, on the Mississippi coast, which was obliterated by the worst storm surge since Camille (and in some cases worse) in 1969.
Chris
Norfolk, VA, USA
Quoting DirkH (17:26:25) :
“Actually, no. Energy companies would go for the cheapest energy, and that is hydrocarbons for at least the next 500 years or so (oil, coal, gas, and now huge amounts of shale gas becoming economical).”
Commenting:
First off, you have to be British to use such condescending phrases as “actually, no”. But I digress.
Natural Gas has always been the cleanest fuel of all. Now, we find that we can extract it directly from the gas bearing shale that everyone knew was the Source Rock of the gas they drilled in natural traps above said shale. They never thought they could extract that gas because the shale is impermeable. (i.e., it won’t give up the gas).
Now, with new technology, researched and developed at great (private) expense in North Texas, it is not only possible, but feasible and economical.?
encouraging:
29 March: BusinessGreen: James Murray: “Climategate” blow fragments corporate response to global warming
Survey reveals more than half of respondents believe “jury is still out” on the urgent need to tackle climate change
That is the conclusion of a major new survey from the Economist Intelligence Unit, which polled more than 540 senior executives…
The survey, which was sponsored by the Carbon Trust, IBM, Hitachi and software company 1E, found that just over half of respondents believe the “jury is still out” on the urgent need to tackle climate change, while 32 per cent of companies polled said they do not yet have a coherent strategy in place to address energy use, an increase of seven percentage points on last year.
Moreover, just 12 per cent of businesses said they were introducing new green products to keep up with rivals, and seven out of 10 respondents said that carbon reduction policies are primarily driven by public relations issues…
But report co-editor Chenoa Marquis said that the findings represented “good news for GE, Siemens and those companies that are moving ahead with low-carbon products as they have an opportunity to open up a gap on their competitors.”
Are you comforted by the “Yale to Greens” essay? I am not. The article can be summarized as; “the greens lied and global warming died”. Now that the “cats out of the bag” they say that we only did this to save the planet from carbon pollution. And we are to say, OK all’s forgiven. Not me. Their agenda is still clear and has been stated over and over. They want to create a new society that depends on governmental control, that is devoid of capitalistic ventures, and in which wealth is redistributed by taxing the rich. Oil and coal companies are obstacles to their destroying our free enterprise economy. Yet oil and coal are the only way wealth can be created in underdeveloped countries. The rich politicians want to control small countries by giving carbon credits to the leaders of small countries who will steal all the money from their poor. How does one justify trusting a group that collectively lied to us for 20 years by fabricating a global warming hoax that we are all going to die from exhaling a few parts per million of CO2 to the atmosphere and who are intentionally undermining the development of wealth in underdeveloped portions of the planet? Their “mea culpa” hides their real intensions to control the world’s economy. I won’t buy it!
“openunatedgirl (19:05:59) :
You really want to challenge that we are ruining our environment? Really? Talk to any one from New Orleans. True, global warming was not the culprit there, but the rather the destroying of wetlands for profit.”
Katrina was a category 3 storm. Most of the damage to property (Flooding, not wind) was largely due to poorly built and maintained levees, mostly it appears, in some of the poorest neighbourhoods there. The rest of the damage being attributed to climate change/environmental damage which was pure popaganda.
When you build a city below sea level, in a basin, on a flood plain and don’t maintain your defenses, nature will strike and win out in the end.
@Ian (17:57:31) notes that all of humanity could fit into our smallest state.
Yeah, but only in Manhattan-sized apartments. You could, however, put all of humanity into typical suburbia — dad, mom, 2.3 kids on a sixth of an acre — in an area roughly the size of Texas. It would never work, though; it’d be a couple of hundred miles to the nearest strip mall.
===
This whole “renewable energy” nonsense drives me up the wall. For nearly all of its history, humanity has depended on “renewable energy”; as a result, for example, the entire US east of the Mississippi was basically denuded of forest by the turn of the 20th century. The total remaining whitetail deer herd was estimated at the time at a quarter-million. Then the US went to a fossil-fuel economy and now the East is reforested (just look down while flying over it some time) and the states of Alabama, Wisconsin, and Michigan (the only ones I know off the top of my head) have deer herds of around three million EACH.
But now, of course, we have to fix that by devastating vast swaths of countryside and wildlife habitat with utterly useless turbine monstrosities, which generate nothing actually useful except subsidies and tax breaks for fat cats on Wall Street. Criminal lunacy.
Friends, we next have to save the environment from the environmentalists. Go figure.
I found the cogeneration plant in Braunschweig in the german wikipedia:
Link to various map services:¶ms=52.278611111111_N_10.514722222222_E_dim:1000_region:DE-NI_type:landmark_&title=Heizkraftwerk Braunschweig-Mitte
Link on google maps:
So you see, it’s not far from the city center.
The lefties will never pursue the energy angle, it is too obvious. Sure, for a short time they can claim an energy shortage, but most people will wonder why they don’t create more energy. The energy crisis didn’t work for Carter, it won’t work now. For their scheme to work, they must label the user of the energy as the problem. It’s politics.
For kicks and giggles I went to a “Green” precinct meeting once in the Minneapolis area (and believe me, this is a socialist state). There were about eight shaggy, unshaven individuals there – and they were the women. The Green’s don’t have the same political steam in America that they seem to have in Europe. I can’t see them having any substantial leverage with our Congress or with our culture for that matter. I’ll tell you what does though. The UN and the EU. The UN and the EU have strategically used global warming as the principle attack engine in its endless and relentless campaign for global socialism. It’s the same old bunch, Baby. The usual suspects and their intellectual surrogates in government, media and finance. AGW = social control.
“West Houston (20:19:12) :
[...]?”
I’m a Kraut, mein bester. I’m coming from Lower Saxony, i hear that we have a lot of shale here and i actually enjoy the prospect of some home-grown fossil fuel production.
When i said that industry by itself wouldn’t make energy production clean i had in mind the fact that flue gas desulfurization or filtering out black carbon simply adds cost. If you don’t force industry to install filters they won’t do it. That’s where environmental regulation makes sense, and that’s where lawmakers fulfill a useful role.
And i wish the US all the best with their own projects in this regard.
Robert of Ottawa (19:28:57) :
That type of move (lawsuit your recovery efforts into the dirt) is exactly the m.o. that has ruined much of California’s forests after fires. They go cherry-pick a judge and get an injunction to stop all salvage.
Lawsuiting energy and manufacturing in the US is their next planned move.
The have 3 test cases already in motion.
Pressed Rat: I’ve always wanted to ask, how does Minnesota believe in global warming? How is it possible for people in the coldest state believe that 1. the earth is warming and 2. it is better to be cold?
I am in Washington state and our experienced fraud team made a special trip to Minnesota to ensure that Al Franken is your senator, so I have much to apologize over.
Here’s the story on the ‘nuisance’ angle the Greens are going tort over:
Still don’t understand what they mean by “low carbon economy”. It’s as vague as “carbon emissions” or “carbon footprint”. I get the impression that in the popular imagination carbon is associated with blackness and dirt, a superficial take on the problem that has been encouraged by a plethora of clumsily Photoshopped images of water vapour belching from cooling towers and chimneys. Surely the aim of any development in prime movers (because that is essentially what we are talking about) from James Watt onwards has always been to obtain maximum efficiency. What has changed here? – Well the fact that over the last forty years or so this has been coupled to an increasing demand for the minimum of environmental contamination in the extraction and exploitation of energy sources and the treatment of waste. In all these fields it seems to me that there is still room for improvement and still the need to exercise constant vigilance. But judging by the changes I have seen in my lifetime we’re we’re well on the way towards achieving that goal.
“DirkH (20:47:22) :
[...]
And i wish the US all the best with their own projects in this regard.”
Not to be misunderstood: The best of luck for the shale projects, not for Cap&Trade “projects” which i find rather detrimental.
I object to the use of environmentalists when the correct term is AGWer or the neutral climate concerned. Many environmentalists, especially those old enough to have sought an energy transformation since before climate became an issue, hold contrarian views on climate. Many of us believe the focus on CO2 is actually hindering that transformation.
Re green energy (carbon-less) and carbon-based energy, this might be of interest.
The short version is that OPEC is not going to let oil become sufficiently expensive for alternatives to oil to become economic.
pft:
Further to your oil cartel comment, look what happens to people who were off the grid for their natural gas. The Ontario government shut down a small natural gas well dug in 1931, and being privately operated by an elderly Ontario couple to heat their house (and formerly 3 neighbours’ houses too) ostensibly for health and safety reasons. The couple was forced to pay to have the well capped (to the tune of at least $15,000) out of their private savings.
See
Governments are definitely part of the energy cartel. Anyone who thinks, in this day of global conglomerates, that either privatization OR nationalization of energy will solve the problem of the little people being squeezed for all we’ve got has got bats in his or her belfry. N.B. the last observation is just a general comment, not a response to anybody here. Nor are any of these organizations truly interested in developing more efficient means to utilize energy, so long as there is money to be made the old fashioned way.
What I’ve found most infuriating about the green eco-fascists is their eagerness to help the governments and energy cartels drive up the cost of energy, with no regard to the suffering this will cause many ordinary people, and especially the poor. If only they would be hoist by their own petard on this! But even more infuriating is how many people in urban centres seem to think that raising the price of gas and oil will be just fine – they’ll just continue to ride their bikes and take the subway thank you very much. For the rest of us wood stoves will be the answer to home heating (that’ll put paid to the greenhouse gas problem, eh?), if the ‘green’ scenario comes to pass, but won’t solve the problem of high food and commodity prices. Yikes!
Nordhaus and Shellenberger: “In recent years, bipartisan agreement has grown on the need to decarbonize our energy supply through the expansion of renewables, nuclear power, and natural gas. . .”
Last I heard, natural gas was made of carbon and hydrogen, and when burned produces CO2 and H2O. So you won’t ‘decarbonize’ our economy by using it.
But so what? If not for putative ‘climate change’, why do the greens want to ‘decarbonize’ the economy at all? It is nice to see these two authors admitting that the alarmist warnings of dire catastrophes from imminent ‘global warming’ caused by CO2 are so much poppycock. Clearly they are admitting that most of this vaunted ‘climate science’ was not science at all, but scientism in the service of a political agenda.
Is that agenda the ‘decarbonization’ of the economy? Or is that aim really an excuse for something else, something having to do with control, with an end to the values that have driven our civilization to ever-new heights of prosperity, abundance, and freedom?
Having them retreat from the alarmist tactic is a battle worth winning, and certainly worth posting here. But it’s not winning the war, not yet.
We’ll win when they throw in the towel and admit, ‘carbon’ is good and vital for the continued progress of mankind.
/Mr Lynn
“Greens pushed climate scientists to become outspoken advocates,,, some climate scientists attempted to oblige. The result is that the use, and misuse, of climate science by advocates began to wash back into the science itself”
“the use, and misuse, of climate science by advocates”?
Let’s get to it.
We have been witnessing crimes.
Publicly funded elected officials, bureaucrats and academia, (independently and in many cases in chorus) have been deliberately distorting and fabricating science to advance their causes and self interests.
Their agendas, their careers, their positions and salaries, their departments and institutions all stood to gain and did benefit from their deceit.
It wasn’t non-criminal cheerleading or innocent worry and confusion.
It is calculated and the fraud is still underway.
I have no doubt their are millions of people around the globe who are angered by the deceit and will demand consequences for the perpetrators.
AND,,, CO2 emissions are not pollution and we need the abundant supplies of coal, oil and natural gas for decades to come.
@DirkH (17:26:25) :
).
- – - – - – -
Dirk, you’re only half right. Your figure of 500 years is easily off by more than factor of 10 (I initially thought that “500 years” was a typo, but you repeated that figure again in a later post, so I guess not)..)
One example of an alternative energy scheme which is already less expensive than hydrocarbon fuels is passive solar. I was involved with passive solar energy research almost 30 years ago. People have been utilizing passive solar heating ( I use it myself as an auxiliary), at less than 1/10th the cost of heating with natural gas, heating oil or electricity. Granted passive solar is not a panacea, but it is also acutely under-utilized.
The efficiency of solar panels continues to increase, and the price will continue to decrease as economies of scale begin to affect the price, but that’s a few decades off into the future. If wind turbine manufacturers would get their act together and shift their model to microgeneration, the wind energy industry will thrive. There are numerous alternative energy souces being researched. One is here:
Another is a solid hydrogen fuel:
“The US Air Force finances a project using ammonia borane (H3NBH3) to pack hydrogen gas for using it in fuel cells
. Jadoo Power Systems was given a contract this week to develop ammonia borane pellets for hydrogen generation.”
What every person on the planet should know!
Access to cheap and safe energy should be a human right!
1. Anthropogenic Global Warming or Climate Change is a political induced scam!
CO2 is not a climate driver, temperatures show no significant up or down trend.
Much warmer periods have happened before and each of them saw the rise of great civilizations.
The past ten thousand years we saw the Minoan, the Roman and the Medieval warmth period when it was much warmer than today and the Little Ice Age with much lower temperatures that happened without our current CO2 emissions.
Warming never has been a problem, what we must fear is cold!
See:
The science behind AGW/Climate Change presented by the United Nations IPCC AR-4 report is corrupted! and everything that has been told about melting ice caps and rising sea levels is a lie. and
2. The potential and the benefits of the so called “Green Renewable Energy”, wind, solar and bio fuels is hyped!
It is relative expensive, it can’t deliver the promised output we need to maintain a healthy economy and it certainly can’t replace coal oil and gas.
Bio fuels in terms of land use and prize compete with food production and topical forests (palm oil) promoting famine in the Third World and destruction of our remaining tropical forest.
Bio fuels also consume large amounts of water.
Production requires considerable amounts of fossil fuel.
That’s why renewable fuels and energy at the current level of development are at best niche market solution.
Most Green Renewable Energy is not “Green” at all!
3. The demonizing of carbon fuels is a foolish!
Fossil fuels can be burned safe without harmful emissions.
CO2 is the gas of life, it makes plants and algae grow and it is certainly not a dangerous pollutant.
Without fossil fuels we can not maintain high yield harvests to feed the world
(1 unit of food takes 4 units of oil to produce!), no medicine, no fertilizers, no pesticides, no plastics, no transport and distribution, no steel, no aluminum, no glass, no clothing, paints, resins and no wind mills or solar panels.
To demonize fossil fuels is not only dangerous, it is also plain stupid!
Without fossil fuels our current civilization, standard of living and life expectancy would not be possible.
4. Peak Oil is an illusion!
Oil Companies and the big banks manipulate oil prices based on the popular notion that we are at the end of the oil age and stocks are running low!
This is not the case and current stocks will serve generations to come.
Socialist Governments and the United Nations (IPCC AR-4) use the Peak Oil argument in support of their “Green Agenda”
Their policy is to tax the CO2 emissions released by burning fossil fuels and deny the Third World the opportunity of development.
This is pure fraud.
5. Cheap energy is now available for all of humanity as energy dependence and peak oil NO LONGER EXIST!
THIS CHEAP ENERGY SOURCE IS SHALE GAS AND IT IS FOUND IN ABUNDANCE ALL OVER THE WORLD IN 75% OF THE WORLDS SEDIMENTS!!!!!!!!!!
Shale gas is a clean burning fuel suitable for high efficiency gas power plants to generate cheap electricity, to heat our homes, offices and factories and power trucks, trains and busses.
Some US producers have declared they can make a profit at $1 MMBTU or below, especially considering how close new supplies are to population centers.
This is not only important for the USA where shale gas extraction was invented and immense deposits will serve several generations but it is also important for Europe and especially for the Third World because they now have the opportunity to develop efficient and affordable electrical grids, key for any economic development.
Is Shale gas a peace maker?
On a geopolitical level shale gas is a major game changer as it eliminates potential conflict between Nations over energy resources and makes countries and populations free and independent.
All people have to fear is Government Control and propaganda based rule that limits or even denies access to cheap energy in pursuit of Global Power and Domination.
Governments currently pose the biggest threat to our freedom, prosperity and future as they no longer support the vital interests of their populations.
This goes for all current Governments in power, especially the EU Government and her Member States, the US Obama Administration, the Government of Canada, Australia, New Sealand and Japan and all other Nations that signed the United Nations Copenhagen Accord and the United Nations Chapter 21. See: http//green-agenda.com
This in short is the message that has to go out now.
Energy independence for generations to come and the technology to secure it is the real revolution of our time threatened only by “LACK OF INFORMATION”.
Only elect those politicians who support this vision and reject deny any power or support to any politician, Government or policy that intends you to think otherwise or takes advantage of the fact that we live on a carbon planet, with a carbon based life cycle and a carbon fueled society.
I have to disagree Mr. Watts.
Their goal is still to remake the “entire global energy economy.” They only claim that they can’t do it with the soft climate science any longer. They still want to send us back to the caves.
I wish I was as smart as they are. I wonder if they are as smart as Mao and Stalin, their heros. Get ready to slaughter another hundred million souls, in your name, if they are.
I wish I could dictate the perfect solution, legislate that the Earth will be at the perfect temperature, like they can. Are we to believe that if we cut our carbon emissions there will be no more bad weather? Obama oversaw the worst winter in decades on the east coast. I thought he could control the weather, or have we not done enough to limit our carbon footprint?
Their stated mission remains to decarbonize the blah, blah blah to save us from ourselves.
If we decarbonize like they want us to, we trash all of our fridges, microwaves, stoves, cars, computers, cell phones and light bulbs.
These environmentalists have realized they can’t waste any more time trying to justify their goals with climate science because it is viewed as fraudulent.
What will be the new threat? Meat diets? Dairy products? Ocean acidification? Tundra thaw? Future famine due to droughts and floods? The next doomsday scenario will rear its ugly head very soon, I am sure.
I hope to debate a young Yale environmental evangelist someday.
EJ
Refreshing news.
Now maybe we can get some greens back to doing REAL green things (instead of FAKE climate-catastrophe nonsense)?
Recently a major commercial development was permitted in a public park locally. Years ago there would have been a massive protest, but it seems none of the greens give a sh*t about parks & trees anymore – they just want to run around freaking out about FAKE climate “problems”.
Shame on you fake greens. Protect the parks & natural forests and oppose toxic pollution. Stop wasting your time misrepresenting nature — natural climate variations are a part of nature – show some respect for nature.
Paul Vaughan,
Ecologist, Parks & Natural Forests Advocate
I have to agree with what a lot of other commenters already said. The article is very clear that the climate propoganda has discredited itself, and thus “new” reasons for a “low carbon” economy must be found:
————-
understood in its proper role, as one of many reasons why we should decarbonize the global economy, climate science can even help contribute to the case for taking such action.
————-
They don’t say what those “many reasons” are, and the wording suggests that they simply assume that “high carbon” is bad and should be obvious to everyone that it is. Here lies the ultimate fallacy that somehow a return to “simpler times” and a less industrialized economy is “obviously” better than what we have now. Having read a thing or two about history, this doesn’t seem that obvious to me.
Yes, shale assures that the world will never, ever run out of (or even remotely short of) fossil fuels. It’s purely a matter of cost of extraction, a cost which dramatically declines in the face of hands-on experience and technological progress.
The AGW advocates may be wrong, but we would have to plunge into the heart of the next glacial period in the next five years for them to be as wrong as the Club of Rome (and the various other resource panicmongers). It’s very, very difficult to be as sublimely wrong as the Club of Rome.
Global warming is mere exaggeration and irresponsible, uninformed, damaging speculation. But the Resource Scarcity premise is the third biggest lie in history.
(Number two is that the rich get richer and the poor get poorer, and number one is that wars never solve anything.) But, then, any honest liberal knows that. (Well, half a brain also required.)
Thatcher, while not the mother of AGW, was certainly the wet nurse. I admire the Iron Lady but she did a lot of damage in her madcap scheme to disembowel the coal mining unions and promote nuclear power. The rest of Europe climbed on board because, jealous of America’s strength based on free enterprise and cheap carbon energy, they saw their chance to take her down. Canada and the US should be standing shoulder to shoulder to push back on AGW nonsense. Instead, Obama starting drinking the kool-aid and appears set to help Europe push America down the same dead-end path of socialism. I had such high hopes for him but now I’m somewhere between alarmed and disillusioned.
EJ: EJ (21:33:32) : “What will be the new threat? Meat diets? Dairy products? Ocean acidification? Tundra thaw? Future famine due to droughts and floods? The next doomsday scenario will rear its ugly head very soon, I am sure.
It already has: Ocean Acidification.
As a close half-sister to the CO2 scare, this one follows the same farudulent premise: Reduce manmade CO2 or the world will end.
Unfortunately, sham policies based upon scientific scams [ the spuedo-religion of CAGW] does nothing whatsoever to advance cleaning up the Earth from man-made pollution, habitat destruction, and overfishing.
Rather…it throws all of of those legitimate concerns, under the bus.
Where was Al Gore when he could have spoken up for the wholesale elimination of large sharks in the world’s oceans who have ruled the deep for hundreds of millions of years?
Where was Al Gore when he could have championed finding a solution to the disastrous gigantic Pacific trash gyre?
Where is Al Gore speaking up for 1/4 of the world’s population who does not have electricity, and their chances are even more dire now given that hydrocarbons have been demonized by he and Hansen and others?
The world’s first poised carbon billionaire was conveniently silent…because he KNEW he could not make any money on any of the foregoing.
It is for THAT reason, and for the millions of third world women and children who will die due to some “green” experiment gone bad, that Al Gore’s name will always be a well-deserved curse word on my lips!
Chris
Norfolk, VA, USA
Paul Vaughan (22:07:36) :
I could not agree with you more, Paul.
Chris
Norfolk, VA, USA
The more I think about it…the more I see red…and lightning bolts start to shoot from my eyes:
Al Gore [forgive me but he really is culpable here] can not make money on real and legitimate environmental causes…so, curiously, you never hear him using his platform to speak out on such.
But he CAN make a lot of money…on telling and propagating a lie and a fraud.
That is royally *****d up!
Chris
Norfolk, VA, USA
Any fool knows that the so called “Climate Scientists” need their funding cut, and the key cards disabled.
However, I am all for Sensible Science developing new energy forms and conservation.
I am not for 66 year paybacks as unsubsidized PV systems require – and of course the maximum panel life is 20-30 years – and Anything that requires a subsidy is non-economic.
Insulation, Orientation, Thermal Mass, Daylighting, Stack Ventilation, Sensible Planning, Xeriscape, Telecommuting, etc., and more CO2 (for the plants)
Correction on “spuedo-religion of CAGW”. Meant “pseudo-religion of CAGW”
UGH….I write too fast. Fire that editor [me].
“Where was Al Gore when he could have spoken up for the wholesale elimination of large sharks in the world’s oceans who have ruled the deep for hundreds of millions of years?”
SHOULD have said:
Where was Al Gore when he could have spoken up AGAINST the wholesale elimination of large sharks, who have ruled the deep for hundreds of millions of years, in the world’s oceans?
Sorry for having to keep correcting.
To err is human.
And IPCC.
Marlene Anderson
Canada and the US should be standing shoulder to shoulder to push back on AGW nonsense. Instead, Obama starting drinking the kool-aid>>
Canada will stand “shoulder to shoulder” with the US, only in that our economy is so intertwined with the US that we must adopt the same basic regulations or see our products stopped at the boarder. That said, Obama and Clinton seem more interested in slapping allies like Canada around while apologising to and appeasing enemies. A lot of Canadians were swept up in Obamamania. I wonder how they will feel about being p****ed on for trying to get a converation going between the countries that border the arctic on how to administer it:
The arrogance of being told how we should be dealing with our native peoples (the US having such a stirling record on that), and being told that countries like China and India and others who don’t border on the Arctic should have had a seat at the meeting? Is that the whole list now Hillary? Are you sure you don’t want Al Queda invited too, they’be been complaining about climate change as well. How about Khadaffy and Chavez while we’re at it? Ar are you just ticked that some tiny insignificant country actually took a leadership position on something without you? I thought that the end of the Bush era was no more bullying the planet. Well turns out that meant no more bullying enemies, just allies instead.
The Yale article shows more than it states by its context to a broader issue that surrounds it.
NOTE-doing this on my Blackberry so spell & grammar checking is out the window : )
1) The part of world that is modern is energy intensive.
2) The more wealthy societies in the modern world are the most free.
3) Within that wealth and freedom exist the ability to have a greater ability to promote imtellectual systems (ideaologies).
4) Not all of those ideaologies are compatible with sustaining the production of energy or the freedom.
5) The militant/political green ideaology (activist environmentalism) is one of those that are not compatible with the energetic modern free societies.
6) The more commonsense individualistic approach to living-in-a-healthy-place is compatible with the energetic modern free societies.
7) A tactical retreat by militant/political green ideaology as shown in the Yale is not a strategic defeat for them.
8) Stay vigilant
The more important topic of what is the basis of the militant/political green ideaology is another topic. It is a very important & intriging topic.
John
I still laugh everytime I see that southern hemisphere cyclone off the coast of Mexico on the cover of Al’s book. It’s all about marketing. The science be damned!
Anthony,
I welcome your acknowledgement of this issue and this first signal of open mindedness. I hope you can take it forward.
Best.
You know the tide has turned when President Clinton made jokes about it.
Tide turned you note. Not tide fully in.
What a breath of fresh air! But I strongly doubt that Obama would pay any attention to it..
davidmhoffer (23:06:26) :
David, you forgot Robert Mugabe.
I think this post remind us why this solar minimum should be called “The Gored Minimum”. If it develops.
Because 40 years from now no one will remember the AGW scam. Just like almost everyone today have forgotten the Ice Age scam of the seventhies. (except a few)
But “The Gored Minimum” ….will forever remind the coming genererations about that one man who was such a clever advocate for the AGW scam.
@ pft:
One very good reason the US does not look for oil in the US is that it is foolish to use up a resource when it will only get more expensive. Use the resource as sold by others while it is cheap – when it is expensive, develop your own resource potential to cover local demand, and even make a profit of those with less foresight.
It is what I would do, and as I understand from my father’s girlfriend who has a well in Texas (as many there do), the govt puts strict limits on production in the US. It makes sound economic sense to me.
openunatedgirl (19:05:59) :
Certainly there are problems caused by our abuse of the environment, and even our foolish town planning and useless response to emergencies.
Unfortunately the current misplaced obsession with demonising CO2 is causing most environmental efforts to be misdirected to preventing the addition of just one more molecule of CO2 for every 10,000 molecules of air.
We can address real issues properly and move to a renewable energy cycle, without crippling the western world’s economy, and without imposing massive restrictions on developing counties and enforcing continued poverty on them. But we can only do this if we accept that burning fossil fuels has not changed anything perceptibly, and probably will not in the future, and certainly not more than we can cope with given the expected state of our technology in half a century (assuming we don’t cripple our economy, etc, etc, etc).
Well, I guess it’s time to put these out there again:
We have a functionally unlimited supply of ALREADY DEVELOPED energy technologies. All that matters is what is cheapest and how stupid the various governments can be.
We run out of energy when there are no longer eroding mountains on the earth and the oceans are gone:
And we never run out of resources to use to make things:
The comment about The Club Of Rome being very wrong is “spot on”. The Club Of Rome “running out panic” is horridly and spectacularly wrong. I’ve also seen references that assert they are among the early folks pushing the AGW broken meme as well.
The reality is that we have no need to “conserve” resources. We ought to conserve species and forests as they can be extinguished, but things like copper and iron don’t leave the planet and things like coal just turn into CO2 that goes into limestone that gets cooked back into oil per one of the demonstrated abiotic oil chemical pathways.
So yes, we ought to clean up the trash (it is the treasure from which we can recover resources, like oil and copper) and keep crap out of the air. But ‘decarbonizing’ makes about as much sense as ‘dewatering’ your bathroom or ‘defooding’ your kitchen. I’m all for efficiency improvements where it makes sense, but mandating that I put a mercury filled device prone to breakage in food preparation areas is just crazy. Especially when we have at least 10,000 years of proven energy supply at low costs.
DirkH (19:35:20) :
‘Ere! There is nothing wrong with the smell from a brewery! All of the smells are awesome, even the heavy yeasty one. An in Germany the laws dictate no chemicals too, so it will definitely not be toxic! Drinking it is, of course, but it is enjoyable, so that’s OK.
For gods’ sake, don’t tell the greenies about the CO2 produced or they’ll tax or ban the stuff!
(speaking as an ex-brewer and current full-time amateur ‘quality control officer’)
More than thirty years ago I was convinced that looking after the global environment was what the Green movement was all about and I approved of the movement in general terms. Then I noticed that various individuals of my acquaintance who had joined Green organisations were beginning to display many of the slightly odd mannerisms of other old acquaintances who had become Charismatic Christians.
It was no great cognitive leap to realise the Green movement had, sadly, become a religion and one that was seeking world domination. I put them to one side, in my mind, until Climategate arrived and my personal bull**** detector went into full alert mode. I am grateful that I was steered to this site in my search for information and I am cheered that this group from Yale are at least beginning to distance themselves from CAGW, CC or any of the permutations of doom. But in their pursuit of ‘low carbon energy’ they have missed the very relevant fact that Man continually refines technology; as an example, in the late 1950s I owned a 650cc 4stroke British motorcycle which was grossly unreliable, drank copious quantities of petrol and oil and was generally an exciting beast. My son now rides, among other machines, a 1200cc Yamaha which uses a fraction of the petrol my old 500cc bike did, uses no oil between services and is not only utterly reliable but is increadibly fast compared with my old beast. And sounds about as exciting as a sewing machine. The error many who are clueless about machinery of any kind is that they do not realise just how powerful and dramatic changes in established technology and machinery can be; most Greens shudder when they see a fast car, but Porsche is one manufacturer which has refined current design to the point where they now have built a very fast sports car which uses a fraction of the energy that a Toyota Prius does and yet the Prius with it’s enormous carbon footprint (silly term, I know, but the Greens love their mantras) will no doubt remain a religious icon to the Green movement..
Sorry for a typo; I have referred to the same bike as both 650cc and 500cc – it was a 650cc machine, in fact. And despite its myriad faults, I loved it with a passion only other enthusiasts can understand!
””””Kate (01:29:35) :.”””””’
Kate,
Your excellent points I concur with, but your tone I think should be more hopeful.
Not only do politicians have long memories, the blogosphere has even longer memories . . . . . . and there are a hell of a lot more of us. : ) And people like Watts, M & M, etc etc, too numberous to mention here.
Cheer up.
John
“in the late 1950s I owned a 650cc 4stroke British motorcycle which was grossly unreliable, drank copious quantities of petrol and oil and was generally an exciting beast.” Twenty bucks says it was a Norton Commando. Was my favorite machine also. When it ran.
Point of clarification: Let’s not make the mistake that the socialists do with ‘healthcare’: access to goods and services produced by others is never a ‘right’. It may be eminently desirable, a wish devoutly to be achieved, but not a right.
“True rights,” says Walter E. Williams, “such as those in our Constitution, or those considered to be natural or human rights, exist simultaneously among people. That means exercise of a right by one person does not diminish those held by another.” The government cannot provide goods and services as ‘rights’, because the government has no resources of its own; it must first take in order to give. See Prof. Williams’s illuminating essay here:
That said, the rest of R. de Haan’s contribution is right on the money! I recommend you all print it out and post it prominently for all the alarmists, warmers, doomsayers, Luddites, Marxists, and faux-environmentalists to see and contemplate.
And also read and re-read E.M.Smith’s (03:20:24) seminal “There is no shortage. . .” posts, linked in his comment above.
/Mr Lynn
Come on all you well meaning green folk — there are real problems to address before you lose all your credibility: how about the pollution of the oceans and the depletion of the global fisheries, for example?
I am not sure if this will work. AGW theory has cost many billions in direct and indirect costs, and an accounting should be demanded.
AGW true believers dearly love their apocalypse, and actually believe.
AGW profiteers, like Gore, windmill salesmen, and the industrial groups pushing for cap-n-trade smell trillions in trading revenues.
This is not going to go away easily.
And promoting the idea that non-carbon based energy will work without nuke power is a delusion.
All the talk about wind and solar replacing conventional sources because economy of scale will make those technologies’ economically viable in the future is pure fantasy. The numbers cannot possibly EVER pencil out because of horrendous capital cost that can never be brought to heel due to:
1) Pathetic energy density. It simply requires too much manufactured hardware to product too few kilowatts, even if you assume absurdly optimistic conversion efficiency.
2) Pitiful capacity factor. All that hardware lies idle “when the sun don’t shine and the wind don’t blow”.
3) Huge power plant footprint. As a result of the pathetic energy density, wind and solar have an enormous physical footprint that makes them all but impossible to thread through the U.S. environmental review process where many of the same folks who say they want renewables stand waiting to stop it. T. Boon Pickenss learned this one the hard way; think “Texas Prairie Chickens”.
Do they still count as a think tank when their conclusion is a decade late and patently obvious?
I’m going to start a real estate think tank and issue a report that states that federally fueled real estate speculation is a bad idea.
This is just more of stage 3 in the grief process (a la Judith Curry); bargaining. They’re essentially saying, “see, we’re willing to throw the greenies under the bus, for mucking things up, so please let us CAGW/CC PNS “scientists” continue, OK?” Well, sorry, but no, it’s not OK. It’s way, way past too late. That ship has sailed and reached another continent. The damage is done, and the “climate wars” will continue. This fight is far from over. The fat lady hasn’t even begun to warm up her pipes.
First of all I agree with those who regard the Yale Environment 360 article positively. For too long here has been a concerted effort to link every environmental ill to climate change. (A recent link was between whaling and CO2 emissions). The downside has been that many urgent dangers, hunting, habitat encroachment, etc. have been ignored. There are also good reasons for the long-term future of the planet to develop safe renewable energy sources. The next ice is due in a few centuries time; imagine trying to survive if we’d all used our fossil fuels for long-haul holidays.
openunatedgirl
My understanding is that for the US or Europe to replace 10% of its petrol with ethanol would require 40% of its agricultural land. If these facts are correct then biofuel can only be a small part of the solution.
If we could just divert all this “greenie” energy into building another set of pyramids out in the desert somewhere… all done with hand labor, all funded by their own pockets with no outside contributions whatsoever, and all workers fed with their own organic gardens, maybe we’d be able to contain the envionmental hysteria gripping the gullible masses for the next 40 years.
Just a fanciful wish.
“toyotawhizguy (21:24:04) :
[...]
Dirk, you’re only half right. Your figure of 500 years is easily off by more than factor of 10 (I initially thought that “500 years” was a typo, but you repeated that figure again in a later post, so I guess not)”
You *could* be right. I was thinking about known reserves here. As soon as some other technology is cheaper it will overtake the market. But it needs to become cheaper first! This is more difficult than it seems to be – as Roger Sowell points out, the guys with the oil wells will try to counter any pretender technology by lowering their prizes. Their technology is proven, they can exploit a huge existing infrastructure and economies of scale.
A lot of the shiny new technologies will fall by the wayside.
I (and a lot of other people) place my bet on microcogeneration in individual households, using gas as the fuel (synthesized from wind/solar power if you want or the fossil variant), a fuel cell, producing heat and electricity.
Hydrocarbons are just the best way to carry hydrogene with you.
I’ve commented before on this website, mostly at the very start of Climategate regarding the legal aspects of the FOIL applications. I’ve had 40+ years of interest in climate and technology, but I do not have a professional technical backround, so I read WUWT far more than I comment. But 2 things about this article and the comments. First, the Skeptics have won the debate; CO2 is not proven to be a “climate changer” and it probably is NOT a material climate forcing– this article shows how the AGW true believers are eating their own and using new propaganda. Second, 2 commenters to this article show the stark philosophical difference between Skeptics and AGW true believers– openunated girl and DirkH. ‘Girl’ feels like we should get rid of evil carbon and ‘those evil corporations’ should be forced to do, but since she’s true believer, she assumes no consequences for herself, because in her rainbow and unicorn AGW world, cheap endless wind power will work for her if those evil corporations get out of the way. Total divorce from reality. DirkH on the other hand, looks at the world objectively and clearheadly and offers specific value judgments — he proposes that we should let free people and markets implement an even cleaner world. You can debate details with DirkH, challenge his assumptions, maybe improve on his ideas. You can’t do that with ‘Girl’ –she believes what she believes, and she won’t let reality intrude. DirkH and Girl show the divide between Skeptics and True Believers. There is a third group — the AGW rent seekers. The scientists (Mann, Hansen et al), trading speculators ( Deutsche Bank, ENRON), the politicians (the EU, Obama et al) and propagandists (Gore) who all ride the gravy train of government and foundation funding and who are scamming AGW for profit and political power. They of course are far worse and more dangerous than Girl, and they use people like Girl to further their greed for money and power.
D. King (20:14:04) :
“R. de Haan (19:17:07) :
Good post Ron.”
Thanks for your kind remark, you’re welcome.
When I hear a greenie weenie mention a “low carbon economy” he has fishished convincing me he doesn’t know what he is talking about. even Immelt the Chairman of GE mentioned doing without carbon. If he hangs turbines on tall Sequoia trees, the trees are still made of carbon.
Then they add, “do away with carbon”. Has anyone ever done that? I know of people that move carbon but none that eliminated it.
If they mean a carbon combustion influenced economy, then they are not so bad off. Most of the drive toward electric cars is the theory that electricity generated elswhere by use of carbon to build the plant or build the tower is like the Carbon and CO2 doesn’t exist.
Where are the pictures of the natural gas fired generators to back up the wind turbines?
Now the fetish is for rail transportation. In my area, rail is Amtrak and it stops once a day at 3 in the morning. It means I have to drive my family and luggage 90 miles round trip to a train depot in a gas guzzling Chevy. Of course the urban legendary economists don’t realize travel by rail over a couple hundred miles increases the need for an overnight stay.
Is there a requirement for the “doo gooders” to not think about what they claim solves problems?
toyotawhizguy (21:24:04) :.)
If you’re using the government derived numbers for CPI, then you are off by a factor of at least 4.
Let it be clear the Greens have done their job.
We now have a totally infected political establishment that is determined to push through their concept of a centralized World Government.
A new bi-partisan climate/energy bill is prepared by US Senators as we speak and the G7 are on a similar course.
The power of the electorate is undermined on any possible level as are civil rights and individual freedom.
The only way to stop the current course of events is to confront the political establishment.
For this the window of opportunity is closing fast.
That is the reality.
Pressed Rat (04:52:30) :
I was thinking Triumph Bonneville. You’re probably right though as the Triumph engine was better than the Norton.
On the other hand, the Norton frame was better than the Triumph which is why so many put the Triumph engine in the Norton frame to get the Triton.
DaveE.
Kate, I am so with you. Scientists are not the problem here! Politicians twist whatever the current environmental hot topic is to meet their own political agenda.
To address all the comments on hurricane Katrina, I didn’t really mean to open that can of worms and I apologize. But to be clear, I am not defending environmentalists. I am defending scientists. If you have doubts that the severity of the damage done by Katrina was not in part due to the depletion of the wetlands, you need to give your head a shake, and talk to an ecologist. I know a great one if you want some contact.
And yet, at the end of the article the authors say:
. “
When knowledge becomes institutionalized it turns into politics. This began more than two thousand years ago when some chose knowledge should be officially transmitted through an intitution, the Church, so it involved power and money making, thus the new church was to choose who were the official sages/saints, the knowledge bearers. Then the two currents divided: gnosticism (today´s climate skeptics, among others) and agnosticism (official scientists, settled science, climate change believers, the Neo-pagan-Club of Rome-Gaia Church).
However real knowledge, understanding, not needing institutions, was the work individuals who strive for knowledge, and institutions like the church, and, after the american and french revolutions, the state/government/politicians, missed it and invented fake knowledge, fake philosophy, fake ethics. Pagan churches were founded, like francmasonry which, btw, recognizes what they call the “verbum dismissum”, the lost word, the lost “logos”, the lost knowledge.
If anybody thinks he/she knows and thinks to institutionalize such a knowledge, then he/she simply does not know, as knowledge is everywhere.
spitthedog
My understanding is that Nuclear produced electricity is the cheapest source of electrical energy, with coal the next cheapest but still a lot more expensive. France has predominantly nuclear produced electricity which is divorced from the world price of hydrocarbons. Why have the rest of the higher technology economies not followed this cheaper energy route? Perhaps the market economy is distorted by polital and environmentalist ideology, but apparently not in France. There can be no economic reason for not going nuclear with electricity production. Coal and oil will find plenty of opportunity in the chemical industry.
Cliff
OT but you have been mentioned int he New York Times Anthony.
I’m still in shock because I can’t figure out the combo environment+yale, after all yale hasn’t produced an intelligent environmentalist for, well, ever, but now suddenly they get it together. It’s prolly a trick.
Pressed Rat and Anthony Allan Evans – nearly right, it was a Norton Domiracer.
Cost me a small fortune to rebuild immediately after I bought it in a very shabby state as the front end had been through a small fire which had cooked the front tyre, the paint and the chrome. Looked and sounded marvellous when it ran, but tended to vomit oil on/in my shoes, but only if I was wearing good ones. The electrics were by Joseph ‘Prince of Darkness’ Lucas, which meant lots of walking/pushing in dark and/or rain, but I still loved it immoderately and have been passionate about bikes ever since.
“”". “”"
I believe that Anthony’s citation was to the Yale Environment-360 forum article; not to the Yale Journal article. So I read what the 360 forum article said; and that is what I commented on.
I’ll leave it to the Yale Journal to demand a retraction from those two authors, if they have misrepresented the Journal paper; they are the ones who know what they meant in their forum article.
“”". “”"
Let’s see; so we start at about 1kWatt/m^2 maximum, and we go down from there via conversion efficiency (think of the Carnot efficiency of a wind turbine).
I don’t think you can even cover the ground with Saran wrap for the cost you have to have for an economical green energy plant.
“”" Claude Harvey (06:01:45) :
All the talk about wind and solar replacing conventional sources because economy of scale will make those technologies’ economically viable in the future is pure fantasy. The numbers cannot possibly EVER pencil out because of horrendous capital cost that can never be brought to heel due to: “”"
If you substitute Claude Harvey for Ed Shearon above; you might end up with a combination that makes sense; If you can figure out what I did wrong; please keep it to yourself; it’s embarrassing enough, as it is.
“”" Big Al (22:21:43) :
“”"
Simply wunnerful ! So now we are back to about 1 kW/m^2 max; not counting conversion efficiency. So what makes this better than any other solar clean green free renewable energy scheme.
I bet you can use solar energy to get carbon out of carbon dioxide too; that would give us an endless supply of clean carbon energy so we don’t have to use dirty fossil carbon.
Good article.
Carbon offset traders, environmental CAGW advocates and climate scientists:
Three Little Lambs Who Have Lost Their Way
Cliff (08:50:02) : you have been badly mis-informed on the price of nuclear-based electric power. It is the most expensive of coal, gas, nuclear, geothermal, and hydroelectric, and is more expensive than some forms of solar and wind.
see
There are so many reasons to become better stewards of our beautiful earth. Picking global warming and pointing fingers only served to push people who are not being over the top recyclers further toward a fringe. Hence comments I have seen on here before that say forget the environment, I will let my hummer idol all day, I left my lights on during earth hour for the fun of it. When you ask the same people if they think we should be more energy independent, they agree. When given the option that lowers their monthly bills by 15%, they agree..
Roger Sowell (10:42:09) said:
I will go read the article, but I wonder if this is the same in China, and whether it’s because some players in the energy marked decided to make life difficult for other players in the energy market and used their tame politicians and certain ‘environmental groups’ and their hysteria to cause this to come about.
NK (06:34:24) :
Thanks for the kind words. You should know that my hobby is trading. I have to keep my eyes open. It’s an ideology in its own right if you will.
NK (06:34:24) :
But don’t be so hard on “girl”… she’s right when she says the New Orleans disaster is partly due to the deterioration of the wetlands. You take water for irrigation out of a river and it will deliver less sediment to its delta, and the land in the delta slowly sinks, everybody knows that, the same thing is happening in Bangladesh.
Her only mistake is that she seems to think that “decarbonizing the economy” will somehow help. I blame this mistake on a lack of information on her part, not on ignorance.
As DirkH has pointed out above , we can clean up fossil fuel emissions . Indeed , we’ve done a good job here in the US . We’ve done such a good job , in fact , that about the only major effluent left from burning fossil fuels is co2 . Unfortunately , the greenies have obsessed on fossil fuels for decades , so they had to find something hideous about co2 emissions . Hence the advancement of the AGW theory . Fortunately , the wheels seem to finally be falling off that one .
DirkH–
you are very welcome.
PS: I am not criticizing openunatedgirl, I am just pointing out that her comments show an adherance to a fixed ideology, carbon AGW, to the exclusion of rational analysis. my criticism is for the third group I detest, the rent seekers who want treasure and power from controlling the rest of our free choice of energy supply.
cheers
Not so.
EIA – 2016 Levelized Cost of New Generation Resources from the Annual Energy Outlook 2010
Nuclear is slightly cheaper than hydroelectric, and significantly cheaper than any form of wind, let alone solar power. Nuclear is even cheaper than a couple of forms of natural gas, and one form of coal. On the other hand, it is more expensive than several forms of coal and natural gas, and slightly more expensive than biomass and geothermal.
As for New Orleans, best everyone do a little historical research. There is no good location for a city at the mouth of the Mississippi, not when the city was founded in 1716, and not today. The geology and hydrology are terrible.
Lasciate speranza voi che entrate….
Mr Sowell,
I have worked my entire career at a nuclear plant and you are in part correct about the costs. Nuclear is expensive to build and cheap to operate. Currently constructed nuclear plants are the cheapest base load generation available save hydro. This is, of course, because coal and gas pay much higher fuel costs and those costs vary significantly year to year and month to month.
I am also skeptical of anyone who claims to know how much it costs to build a nuclear plant in the USA today. We have not attempted to build one in 30 years so in my opinion any estimate is a complete WAG. Although I certainly would agree it will be more than a similar sized coal or gas plant. What you get is more price certainty for the future. Nat gas is currently about 4.00, even at that relatively low price it is easily twice as expensive to operate a nat gas plant today than it is a nuke. That is why they are always some of the last resources dispatched as load rises.
Wind and solar don’t even get to play in this discussion because they are not dispatchable and never pay off their capitol cost absent subsidies and mandates. If we build these facilities then we will use them when they are producing power – which we have no control over.
The fact is that GREEN arguments touch the feeling hearts of many people, though the majority of them ignore some simple things as the more you recycle the more uses will have any item, so hurting production economy and decreasing jobs
Or CO2 it is NOT BLACK SOOT or it is what we exhale, etc.
I read it.
Nordhaus, Ted, and Michael Shellenberger. “Freeing Energy Policy From The Climate Change Debate.” Opinion. Environment 360, March 29, 2010.
That dog won’t hunt.
You’ve been had by the nuke folks. The cost of nuclear that you usually see are the variable costs: fuel and operations and maintenance. They do not include capital recovery, which can be enormous. Unless, of course, your utility is an investor owned one and sold its nuclear plants for cents on the dollar. The new owners have virtually no capital recovery costs. But did the unrecovered costs disappear? Nope. You have a neat little item in your bill with some innocuous title where you’re still paying. They spread it out over 20 or 30 years to minimize it, but these sales of nuclear generation happened in the mid-90′s.
As to new nuclear costs, well the two that Southern Company are going to install with federal loan guarantees, cost about $7,000 per installed kilowatt of capacity. Each unit is 1,200,000 kw so do the math. When you figure in the cost of capital for these guys along with variable costs you get a very different picture..
Paul (11:03:05) :
There are so many reasons to become better stewards of our beautiful earth….
I’ve been on a few recent large appliance quests, most notably one to replace a 30-year-old G.E. top-load washer. An awful lot of stuff out there is designed to make the casual shopper feel good about how “green” they are. But I’d argue that a low-flow toilet with a faulty flush mechanism (another story) looks no prettier than a tradional one sitting on a mound of trash in a landfill. And I’d guess a trashed Energy-saving washer is about as green as an older model. A big question is: which lasted longer?
It seems many of the washers may deliver on the promise to use less water and less electricity using just the right settings, but their durability, thanks to sensers and easily-fried electronic elements, appears to be a very big question. Most of the salesmen I talked to just shook their heads at the notion of a 30-year-old washer; they just aren’t designed to last that long, and the “consumer advising” agencies many of us have come to rely on are not reliable. See, here, on the recent Energy Star Fraud:
I have posted to Yale 360 several times and often they have either edited my posts dramatically or simply didn’t post them. It is obviously an organization funded with our tax money dedicated to keeping the flow of “green” coming.
Okay, the “Greens” have given up trying to support manmade warming and instead are trying to convince us that spending hundereds of billions on power that is the world’s most expensive, requires tax credits and grants to build and is wildly variable requiring 100% back-up from fossil fuel plants, cannot measurably clean the air or reduce carbon dioxide either…..and to top it off treats birds (mostly raptors and bats, many endangered) as if they were milk shakes in a Hamilton Beach mixer.
A truly Piriac victory.
Mr Shearon,
I am most definitely including levelized capitol cost in total nuke cost. As does the EIA report referenced by Larry D.
Regarding solar thermal generation you are factually incorrect. There are two ways to make electricity from the sun. PV cells take sunlight and turn it directly to DC current and solar thermal focuses the sun’s rays on a body filled with a fluid (can be water) to create steam. The steam is then used to drive a turbine to make electricity. This is thermal solar energy and it most definitely only works when the sun is shining. Even if you could “store” the energy of the sun for later use, you can not store more energy than has been incident upon your particular part of the globe.
Well scrub that Yale site. Nothing more boring than looking in a mirror that feeds back only one’s own reflection.
Too bad they have the same disease that “Real Climate” has.
Hey chaps, censorship automatically brands you as a bunch of losers; incapable of taking part in a debate.?”
I though it was the first in a Ten step process –
Ten Steps to Dictatorship by Naomi Wolf
1. Invoke a terrifying internal and external threat. check - CAGW and world Financial meltdown
2. Create a secret prison system – a gulag – where torture takes place that is outside the rule of law, perhaps employing military tribunals. Start by targeting people outside the mainstream of society. As the line blurs, more and more ordinary citizens get caught up in the noose. It’s always the same cast of characters: journalists, editors, opposition leaders, labor leaders and outspoken clergy. check – reports of military torture of prisoners and rumors of military type trials being considered on mainland USA
3. Create a paramilitary force – a thug caste. You can’t close down a democracy without one. You can send that paramilitary force to intimidate civilians. Then it doesn’t matter if you still have the essential institutions of a democracy functioning, because people are too intimidated to push back. check – Blackwater
4. Create an internal surveillance apparatus aimed at ordinary citizens. You don’t need to surveil everyone. If everyone thinks they are being surveilled, that’s inhibiting. check – cars with Ron Paul bumper stickers are stop by police check points as Terrorists
5. Infiltrate and harass citizens’ groups. That helps ensure citizens won’t have the trust level to work effectively together. Boy are we seeing this. Food and Water Watch, Organic Consumers all have ties to Rockefeller and the UN so they SUPPORT corporate take over of our food supply.
6. Arbitrarily detain and release citizens. This will frighten them. check farmers/co-ops targeted and all those roadblocks and license checks as well. And do not forget the torture and deaths by tazer of innocent people.
7. Target key individuals: lawyers, people in the press, academics, people in the media, performers, even civil servants, so people see there are repercussions if they stand up against you. Again Ron Paul, Bob Barr, Chuck Baldwin supporters are on the terrorist watch list.
8. Restrict the press. Investigate, intimidate and imprison reporters. Accuse them for treason.. Start using the words of a closing society: terrorist, enemy of the people, sabotage, espionage, treason. Over time, replace the real news with fake news. Derry Brownfield kicked off the air and two Florida reporters fired, not to mention John Munsfield’s story about e-coli contamination at Con Agri being pulled at the last minute. Reporters knocked down and tazered at political demos. Also Wiki leaks is supposed to have a video of reporters being murdered????
9. Expand the definitions of espionage and treason so more and more people are included. Recast criticism as espionage and dissent as treason.
The list is now over a million and that doesn’t include bumper stickers. I was just told by an ex-secret service guy that ALL ex-military, ex-CIA, ex-FBI…. are now on the “Homegrown terrorist” possibles list
10. Suspend the rule of law. Subvert it by decree and/or declare martial law. Is that what the tea parties are about, to start a major confrontation?
Boy can’t you have lots of fun with this list and the scuttle butt drifting around on the internet….
“”" Ed Shearon (15:14:50) :
You’ve been had by the nuke folks. The cost of nuclear that you usually see are the variable costs: fuel and operations and maintenance. They do not include capital recovery, which can be enormous. …..
…..……
So presumably (as judged by your arguments) SoCal Edison, is building these two solar plants entirely using free green clean renewable (solar) energy, sicne you didn’t mention anything about the energy capital costs of their plants.
One thing we know for sure is, that we started off with nothing but free clean green renewable solar energy; it was even quantized and came in chunks called “figs”. But it barely served to sustain just a few of our ancestors; and they didn’t become successful, until they discovered stored chemical energy; and eventually the fossil fuel form of stored chemical energy.
So no matter how you want to cut it, and jigger with the economics calculations; along with the pollution and other environmental costs; we can say assuredly that fossil fuel worked; it got us to where we are; whereas free clean green renewable solar energydid not and could not.
And if you want to figure out the per capita costs of the energy and pollution clean up and other environmental factors, and then compare that to all the damage our few ancestors did to the fig trees; I have no doubt that we are way out in front of their achievements.
If you want your grandchildren to go back to clambering around in fig trees for renewable energy; be my guest.
Do you have any idea what the total pollutant output of a silicon production factory is; not to mention the noxious materials that must be obtained and controlled in the fabrication of free clean green renewable PV solar energy; at a rate of maybe 10 Watts per Square foot (tops).
I’m waiting with bated breath to see the first solar energy plant replicate itself using its own energy output; and have something left over to sell on the open market against its competition.
Of course if you have some other non-solar free clean green renewable energy source that I haven’t heard about yet; well maybe that could be a winner; sell you house and bet on it.
Mr Lynn (05:26:56) :
R. de Haan (21:29:14) :
What every person on the planet should know!
Access to cheap and safe energy should be a human right! . . .
“Point of clarification: Let’s not make the mistake that the socialists do with ‘healthcare’: access to goods and services produced by others is never a ‘right’. It may be eminently desirable, a wish devoutly to be achieved, but not a right”.
Mr. Lynn,
I have made this point to prevent Government from enslaving it’s populations by charging excessive energy taxes and “Cap” policies.
I did not state energy should be made available for free! I only said it should be available to everybody on the planet at an affordable price!
In the case of shale gas, available in 75% of the world’s sediments we have the opportunity to generate affordable electricity all over the world with explortion companies and distributors still making good profits.
I don’t agree with your “Health Care” example because in this case Government is forcing Americans to buy Health Care. If they refuse they will be fined, if they can’t pay the fine, they go to prison and they will have a criminal record!
Besides that, if Government is in a position to force people to buy health care, what will be next? Will they be forced to buy a car from Government Motors?
Anyhow, thanks for your support for the remaining content of my posting.
R. de Haan (17:10:51) said:
Hmmm, the words I have seen suggest that the IRS does not have the power to enforce the fines associated with not buying health care … possibly an oversight on the part of the Democrats, but who could possibly have figured that out given that the bill was some 2000+ pages.
““”” Ed Shearon (15:14:50) :
You’ve been had by the nuke folks. The cost of nuclear that you usually see are the variable costs: fuel and operations and maintenance. They do not include capital recovery, which can be enormous. …”
The capital cost of wind is 1 1/2 times that of nuclear. The cost of manpower for wind is also 1 1/2 times nuclear. The cost of solar is higher.
The arguement that nuclear fuel is energy intensive is provably false. The fuel is a very minor cost. the cost of producing kilowatt hour of nuclear energy is the lowest cost of any power except water power and is a fraction of wind or solar. Another major cost of wind or solar is the requirement to run high power lines to remote locations which, in many cases, doubles the capital cost. Nuclear plants have to be constructed near water sources which coincindentally is where most people live and work. ……..and, of course, nuclear fuel can be recycled as it is for France at the Hague in the Netherlands. A concern is the by-product plutonium which Carter outlawed as being to easy to convert to weapon grade material.
There is no logical reason not to utilize nuclear. We could also continue to utlize coal and clean it by desulphurization and with flyash precipitators. We could burn nutural gas which is pretty clean. I agree there is no economic or ecological reason to build wind and solar. They are pork projects. They clean no air by any measurable amount and they cannot shut down one fossil fuel plant.
Pork, pure and simple.
I understand, and agree with, your reasons. And I understand that you did not say energy should be free to all.
My point is that it is common today, especially on the Left, to assert that human needs create ‘rights’ which can be met only by government: the right to food, to shelter, to a job, to healthcare—and energy? What’s next? A good car? An LCD TV? And I wanted to emphasis that this conception is alien to the concepts that inform the American Experiment.
Our system of restricted and republican (small ‘r’) government is based on the notion of ‘natural rights’, to “Life, Liberty, and the Pursuit of Happiness,” which, as Prof. Walter E. Williams points out, are inherent in our natures and cannot be given by other citizens or government (though government can prevent us from exercising them).
Human needs for goods and services can be satisfied by individual and group endeavor, but not by government, unless the government takes from some and gives to others, because government creates nothing on its own. So a ‘right’ to something enforced by government inevitably becomes a strait-jacket of rules and penalties imposed in the name of ‘fairness’ (hence the ‘mandate’ to buy health insurance).
It ought to be the policy of our government to encourage private industry to provide cheap and plentiful energy for everyone, and the government can best do so by getting out of the way and giving the markets and entrepreneurship free rein. The world has coal, natural gas, uranium, thorium, and other resources in abundance, and the technologies for utilizing these are improving every day.
While no one has a ‘right’ to cheap, abundant energy, no government should have the right to curtail our production of it. It is the key to the continued progress of human civilization, and to the development of the third word. The trick, in this Republic make sure we elect people who understand this imperative, and will not seek to curtail human freedom and enterprise in the name of providing for its citizens what they should be providing for themselves.
We don’t disagree.
/Mr Lynn
Correction (last sentence of penultimate paragraph): The trick, in this Republic, is to make sure we elect people who understand this imperative, and a government that will not seek to curtail human freedom and enterprise in the name of providing for its citizens what they should be providing for themselves. /Mr L
Doug Badgero (16:08:50) : – you might want to check your figures for fully-costed nuclear power from a new power plant in the US. Here’s a link:
Jon:
New nuclear costs between $6,800 and $7,200 /kw. See
Other generation, $/kw installed (the capital costs):
New wind costs $1,208
Solar electric $4,751
Solar Thermal $3,149
“advanced” nuclear (does not commercially exist & same number predicted in 1986) $2,081
Facts are pesky things, Jon.
Mr Sowell,
I provided no figures to check. I referred you to an Energy Information Administration report that LarryD referenced. It shows quite clearly that all in costs for nuclear are competitive with other power sources. Especially when you consider future price uncertainty with coal and gas. That said, it would be foolish to build nuclear for anything but base load generation. They must operate at near full capacity to pay for their fixed capitol costs. That is the unavoidable fault of wind and solar. They cost a fortune to build but cannot operate above about a 35% capability factor. That is the mistake Mr Shearon makes for wind and solar – capitol costs must be adjusted for both capability factor AND the cost to build backup power sources for when the wind doesn’t blow and the sun doesn’t shine (probably gas). The EIA report does not make the capability adjustment mistake. However, it only mentions the non-dispatchable nature of wind and solar in passing.
Note that EIA estimates the all in cost of NEW nuclear generation at about 11cents per Kwh. It is very easy to play with these numbers by simply adjusting the cost of capitol (interest rate assumptions) or future predictions for the cost of coal and oil to make one source look better or worse than another. That is why different studies from different ideological viewpoints come to very different conclusions. There is risk associated with any choice.
openunatedgirl (19:05:59) wrote:
“To address the overall tone of this message board, I would like to say that I am completely depressed by the majority of your comments. You really want to challenge that we are ruining our environment? Really?”
It’s much easier to fault the other person’s tin gods than to admit that one’s own tin gods are melting. That would partially account for the Libertarian perspective of many commentators here at WUWT, since from that Weltanschauung, it’s not difficult to be skeptical about ‘problems’ that require Big Government as a ‘solution’.
Take AGW-abandonment . This particular kind of disillusionment is a much bigger step for Lefties, most of whom were educated to believe that truth is a linear combination of ‘expert’ opinions.
I agree that there are genuine environmental concerns–like overfishing in the world’s oceans. I also think that the mythology of the Flying CO2 Monster is a major distraction from this and other real problems. And I don’t view governmental regulations as bad in their own right, if there’s full public access to the data and reasoning–if any–behind them. Sometimes the Greenies get it right, and sometimes they don’t.
If you haven’t seen it already, please check out jennifermarohasy.com. Jennifer is a biologist and a proponent of evidence-based environmental policy, with an emphasis on issues that affect Australians. However she’s writing a novel at the moment, and there hasn’t been much current stuff on her blog for the last several months. When it was more active, I regarded Jennifer’s blog as the very best on environmental issues other than climate change, even though I’m not an Aussie.
Given your engineering background, I think that you can make a real contribution here. Please don’t feel like the Lone Ranger.
There is nothing mystical about doing levelized cost of electricity calculations. It is a rather straightforward formula.
I suspect that, as is the case with climate, ideology is getting in the way of understanding.
Taking into consideration the availability factors of the various forms of generation, and especially the intermittent forms, new nuclear (the kind you can actually buy today with commercial terms) is the most expensive form of base generation known to man. It is also, by the way, the most subsidized form of ANY kind of generation.
Comparing solar thermal to nuclear is appropriate because both can be base loaded. And solar thermal wins hands down by any metric.
People who try to compare wind or photovoltaics to nuclear are just shouting “I don’t know what I am talking about!” These are intermittent forms that today enter the grid when the power is produced. They compete with whatever other forms of generation are economic at the time they are produced (almost all grids do economic dispatch on at least an hourly basis- as demand rises more expensive units are called). Wind farms with storage – and this is going to happen within 2 to 3 years – using flow batteries or other technologies that are just about commercial will become very competitive as base load generation.
Finally, getting back to ideology, it mystifies me that the right is so pro-nuclear. Nuclear only works at very large scale and in centrally planned electricity grids. That’s why big coal and big nuclear plants are referred to as “central generation.” In fact, you can’t think of a better form of generation for a socialist society. We have huge problems today with the enormous inefficiencies in a grid network that was great for 1935 but makes no sense today. When you plop in a 1 GW nuclear unit in the transmission network it literally has no place to go unless you build a lot more lines. With central generation there are huge losses to get to the end user. Power reliability and quality suffers and gets worse as more customers are added at the distribution end. Distributed sources of power avoid all of these inefficiencies, increase quality and reliability, and put the power in the hands of the end users. The technologies are there, now.
The future US electric power generation will be based on Natural Gas.
Here you find some of the arguments.
For the price of five Nuclear power plant we can build the entire US future energy
requirements based on Natural Gas power plants!
That is if we let free market principles do their work in a free energy market!
Any other energy policies driven by Government grants, semi science and ideology are nothing more but a kind of robbery of the American consumer.
The ignorance, and dogma, on this thread are getting tiresome. Solar of any kind can not be base loaded – period. Go read the company website about how these plants work and then research what base loaded means. They generate power only when the sun is shining on the focusing mirrors. That means, by definition, they can not be dispatched OR base loaded.
You are correct, there is nothing mystical about levelized capitol cost calculations. However, if you assume a 12% weighted cost of capitol you get a very different result than if you assume a 6% cost of capitol. It’s math no mystery involved.
Finally, production subsidies by generation type are found here –:
solar and wind – 23-24 dollars per MwHr mostly direct tax credits
nuclear – $1.59 per MwHr mostly R&D
Subsidies for other generation sources are available at the same link and all of this data I have provided is EASILY verified in this report.
Good day
Legitimate reasons for saving energy:
Make best use of scarce resources
Reduce our dependence on foreign oil and gas
Save money on energy bills (for cheapskates like me).
Illegitimate reason:
Fight AGW.
Dear Doug:
As I said before, solar electric is not baseloaded and cannot be compared to nuclear. Neither can any other intermittently generating technology unless it has storage. Solar thermal, however, because it uses liquid heat storage, has an availability factor of 70% and, at the scale SCE is constructing (750 MWe per unit), is very much baseloaded.
You’re missing the following nuclear subsidies:
Price Anderson liability limit (anything accident over $1 B the feds cover- TMI cleanup was $1.6 B and was very minor)
The enrichment facilities were built with defense funds and are not paid for by commercial nuclear.’
Uranium mill tailings cleanup has been fully funded by the feds.
There is a measly fund to store nuclear wastes paid into by the utilities that is a pittance relating to what has been spent and will have to be spent to solve the problem.
All nuclear units are currently paying into a fund for decommissioning at the mandated total of $300 M per unit. Recently one of the original Yankee units was decommissioned – a unit that was about 250 kW – and it cost $600 M. Think of what the realistic costs of a 1200 MW unit will be. Who do you think pays that? Hint: It ain’t in the cost of power today!
Some nuclear fuel will come from dismantled weapons. This saves enrichment costs, but the buyer will not be paying the actual cost of those weapons in the first place.
An added thought: nuclear is a net negative energy generator.
The hallmark of agendas is making apples and oranges comparisons to those who do not understand the differences to support an argument.
Good Day!
PS. The second most subsidized form of energy is oil.
Another thought regarding efficiency.
There is a common fallacy in the anti-AGW dogma: the one that goes something like “investments in renewables and efficiency are only being done to get carbon credits because they are too expensive otherwise.” Or, “the only people who invest in clean energy plan to make a killing via carbon and thats why they support it.”
No one, and I say again, no one with any business sense develops a project because of carbon. It is icing on the cake if it ever happens, but these projects must stand alone economically. Carbon could be an additional revenue stream but it is way to small to tip the scales one way or the other.
Efficiency is far more cost effective than new generation, of any type. We could take out 20% inefficiency in the transmission grid alone. Think about that. the US generation base is around 1,000 GW. That’s 200 GW of waste. Or 200 large scale nuclear or coal plants. At far lower costs per kW. That’s where the priority needs to be, not on perpetuating a business and regulatory model that has been outdated since WWII.
“”" Ed Shearon (08:28:50) :
……..
I suspect that, as is the case with climate, ideology is getting in the way of understanding.
…..
Comparing solar thermal to nuclear is appropriate because both can be base loaded. And solar thermal wins hands down by any metric….
…..
Finally, getting back to ideology, it mystifies me that the right is so pro-nuclear. Nuclear only works at very large scale and in centrally planned electricity grids. “”"
“”" ideology is getting in the way of understanding. “”"
Having a problem reconciling these two statements; if “ideology is getting in the way of understanding.” then why bring it up, in relation to Nuclear energy ? Perhaps the answer lies in a corollary question:- Why is the left so anti-nuclear ?
Here of course I am using right and left in their usual street public debate connotations; without regard for who or what they actually refer to.
But I can think of some reason why some people (no idea whether they would be your right, or left, or something else) might be pro-nuclear.
It seems to me that “Sources” of energy; in so far as they are of interest to humans, can be separated into two categories.
The first category; which also happens to be the first energy available to “humans” is renewable energy sources. By that I mean that if I consume energy from such a source yesterday, today, or tomorrow (now), I can return (here) say a year from now, and find that source of energy is replaced.
An example of such would be figs from trees; which our ancestors spent a good part of their waking hours trying to get at. There are many others of course; but they all have one thing in common; such renewable energies are forms of solar renewable energy; without the sun’s radiation, they would not exist.
The same is true of proposed modern renewable energies; some of them Hi-tech. They too are sun sourced, and without sun energy, they would not exist.
The second category of energy sources can be loosely described as “Stored energy sources.”
Now arguably figs are also stored energy sources; but they have a finite life after which they are dissipated and become unavailable; which is why I referred to the idea of returning next year to find replacements.
Fossil fuels such as natural gas, petroleum, tar-sands, coal and the like, are stored energy sources. Let’s not quibble about whether coal and petroleum and natural gas are renewable on geologic time scales; that is of no use to our children and granchildren.
Intermediate between renewable and fossil might be things like wood, and peat; which are renewable on longer time scales but shorter than geologic; but also result from sun energy.
Thej “fossil fuels” are pretty much all “Stored Chemical energy sources.” The energy is essentially available only through chemical combustion with atmospheric Oxygen; producing the essentials for life; namely H2O and CO2, as by-products.
Renewable energy from the sun, of course is also available in the form of tidal or hydro-electric ; which are only available in relatively rare locations; with sometimes extreme environmental burdens, as to their usability.
The only thing missing from the list of stored energy sources, turns out to be Nuclear energy; although renewable energy can sometimes be stored by human action in the form of hydroi-electric facilities.
Stored energies have one great advantage over renewable energies. You flip a switch and the energy release process starts immediately. In the case of Hydro, this feature is achieved by using gravitational storage of solar energy to create an always available instant on energy source. With fossils of course you simply strike a match to get the energy.
So perhaps the interest (pro if you like) in Nuclear, stems from the fact that it is the only significant stored energy source available in considerable amounts, besides stored chemical energy.
Stored energy in any form is dangerous; and the greater the energy density the more dangerous it is; which makes nuclear energy quite dangerous. Yet more humans have been killed by hydro-electric energy sources than Nuclear; by far; most often as a result of broken dams; the hydro equivalent of a nuclear containment leak or core melt down. Don’t even start on Nuclear weapons; because “gunpowder” wins that race hands down.
Petroleum in the form of gasoline seems to be one of the safest high energy density stored energy sources available to us; and it puts electricity to shame for portable applications.
So I’m not sure what your point is in asking why the right; whoever that is, is so pro nuclear; maybe you can explain the counter position; because I certainly can’t.
Which gets us back to renewables starting from those figs, and on to today’s hi tech renewables from solar.
There’s that embarrassing 1 kW/m^2 availability rate that we don’t seem to have any practical solution to. Yes it is renewable; but the rate of renewal is just too damn slow.
Arguably, the fossil fuels are also stored sunlight; and it is claimed that we have just about exhausted, what has taken the sun some 4.5 billion years to store up for us. So fat chance that it can continue to supply us at the rate we can consume. Well yes there is plenty of solar energy arriving on earth; but it is so dispersed, that we pretty much would have to spend our every waking minute out trying to gather it up to use.
Seems like we were there once before ; up in those fig trees.
Ed,
You may continue to believe what you like about the SCE solar thermal plants. I have worked all my adult life in thermal power plants and the only difference between what solar thermal does and what coal, nuke, or nat gas do is in the heat source. When the heat source goes away so does the power output. Your 75% availability defies the laws of thermodynamics unless the turbine-generator is grossly undersized compared to the solar array.
The PA act liability pool currently stands at approximately 10 billion. This is the amount that has been funded by industry.
Commercial nuclear power plants pay for their fuel, although can’t own it but that is another issue, that is what pays for the current enrichment facilities.
We are idiots if in the long term we store high level waste – we should reprocess like the rest of the world does. In any case, much more has been paid into this fund than has been spent to solve the problem.
I would love to see your numbers supporting net negative energy generation.
What were my apples and what are your oranges?
Losses in the HV transmission network are closer to about 8-10%. Distributed generation will in part simply relocate those losses to the distribution network. If distributed generation can be made cost effective based on other issues.
Business men most assuredly agree to buy wind power in large part because of the 1.8cent per Kwhr tax credit – including the company I work for.
Doug:
Here’s the story on thermal storage at solar thermal plants:
Price Anderson Act limits commercial insurance coverage to $350 M, sets up a pool with a ceiling of $10.5 B administered by the government, and indemnifies owners from any claim exceeding $10.5 B, You have government artificially reducing the cost of risk management, providing insurance and limiting what people could sue for. That’s a pretty big subsidy. BTW, the Wikipedia discussion of PAA is not accurate.
Commercial nuclear plants pay for their fuel because they own it. Government ownership of fuel ended in 1968. When you buy U3O8 it is yours. After you convert it to UF6 title gets a little odd while it is in the hands of DOE for enrichment. But title is clearly yours once it comes out of enrichment and stays yours until you turn over title when the feds take custody for storage or disposal. You can put liens on nuclear fuel precisely because you have title, and it makes sense to borrow against it because it is in the pipeline for quite a while during processing.
We stopped reprocessing in 1975 under the Ford administration. You know why that happened in a Republican administration? Because even then reprocessing made no economic sense and people were looking for a bailout. The public reason was to mitigate nuclear proliferation. I know because I had contracts with the two reprocessors still in business: West Valley and Barnwell. It still makes no economic sense. No one in the world reprocesses to reuse fuel as MOX or to fuel breeders. MOX fuel is ridiculously expensive (not just to buy, but to keep secure from bad guys) and there are no commercial breeders. The Navy reprocesses highly enriched submarine reactor cores, but this is an organization that will fly a $2 part from Norfolk to Scotland to get a boat underway.
Net negative nuclear energy generatation:
Line losses in transmission are between 8% and 10 % but that’s only one very obvious inefficiency. They occur because of simple resistance in wires that span big distances. If they are eliminated they are NOT transferred to the distribution network, nor to they occur with distributed generation (since the path of the electrons is so much shorter, there is little resistance). A problem faced on the distribution side is harmonic distortions. These (and voltage sags and spikes) wrech havoc with computer systems and are endemic in areas with high growth and old infrastructure. Local generation solves that problem.
If you want to read about other efficiencies possible beyond simple line losses, go to and read some of the papers there.
The tax credits for wind and solar pale in comparison to those provided to nuclear. And regarding business judgments, there’s lots of people building wind and solar, but I only see one utility willing to risk the farm on nuclear, and that’s with all kinds of support and subsidies.
Ed,
This is my last post on this thread.
The first link is to a hypothetical plant. It is not the plant SCE is building. Nothing can overcome the limited energy density of solar. To get a continuous 750Mw you would need to install a 3000-4000Mw peak absorption system and store the peak to use at a later time – with loss of efficiency at every step.
The 10 billion provided by PA is industry funds. To date they have issued a total of 151 million, about half as a result of TMI. These federal insurance schemes are not unique they exist for flooding, agricultural catastrophes, financial failures and maritime accidents. To date it has cost little or nothing to the taxpayers. I do not disagree that like all insurance the protection after the first 10 billion has economic value but to date it has been revenue neutral to the taxpayer. Any value assigned is simply a ledger item. Some of the other federal systems cannot say the same, e.g. financial system failures have cost billions over the years.
What does France, etc do with their transuranic elements if not “reburn” them?
If local generation is both more efficient, more economic, and of better quality why do we not use it now? I could install a wind turbine at my house except it would cost about $40,000+ last I checked and never pay for itself. I suspect I will disagree with your answer. I am curious, what power source do you envision for your distributed generation? Wind and solar with storage? Micro-turbines? I do not disagree that distributed generation has the potential to be more efficient but that has always been the case. The downsides have, to date, outweighed this potential advantage.
I looked at your link regarding negative net energy. It looks like a rather unique calculation and I will have to spend more time reading it to fully understand the author’s assumptions. I did notice one statement describing how if we build out nuclear power plants eventually nuclear plants would have to load follow. This would make them uneconomic based on all of the idle capitol. This is, of course, correct but we would be fools to build out nukes to that point. Any economic asset that has a high capital cost must also have a high utilization. No one I know of is proposing such a plan. For instance, the EIA report assumes a 90 percent capacity factor. About what the industry average is now. Although much better than it was 20 years ago.
I consider your final paragraph simply unsupported by the facts unless some rather curious assumptions are made – such as those about PA.
Doug:
My last post as well, and I feel compelled to recite credentials. I received an MS in Nuclear Engineering in the late 70′s. I was in charge of a soup to nuts nuclear fuel procurement division for 3 reactors. We were the first utility to buy ore (even had a few geologists looking for new sources), and separately contract for all of the services necessary to deliver fabricated fuel. I worked for three nuclear organizations in my career with a total of 5 reactors. I have testified in rate proceedings on nuclear fuel cost and have also been in charge of a utility holding company strategic planning division, where we made decisions regarding new generation and transmission options. Currently I am involved in several alternative energy projects, including smart grid options.
Utilities pay commercial premiums for the first $350 M of an accident. They then pay the government a premium for the next $10.15 B. Under PAA no one can sue beyond $10.5 B in damages. So in the event of a PAA ceiling accident, the utility pays commercial rates on 3.3% of the loss and gets subsidized federal insurance for the other 96.7%. The max payout for any loss in the US was $300 M for TMI, not $151 M like Wikipedia says. The total cost of cleanup at TMI was $1.6 B and that was a) in incomplete job; and b) the core was removed, shipped and stored by the DOE at no cost to the utility. This was for what the NRC would call an “entombment” decommissioning option. Entombment is a generous term. The entire basement and much of the containment vessel concrete is embedded with a soup of isotopes to a depth of a few inches. I know, because I was there.
We don’t use local generation because we operate in a monopolistic regulatory environment. If you are a utility and your customers start putting in their own generation you have two problems: 1) that generation may be out of synch with you and you are both connected to the same network; adn 2) it amounts to a loss of revenue. Both are rather frightening things to utilities, so what you will see across the country are barriers to distributed generation. Economic barriers, such as silly buy back rates and additional interconnection fees that make local generation uneconomic. And regulatory barriers. In NM, for example, the second best solar resource in the country but a major gas and oil producer, it is illegal to install a solar PV array over 50 kW. That means that commercial sized installations don’t exist. There is a fight going on right now- the utility said it would allow up to a MW, but a month later filed another plea that it had to own all commercial scale solar. NM is 15th in overall solar capacity. Number one is New Jersey, with hundreds of MW.
Utilities make their money by getting a return on their capital investment. When you put in big wires, big substations, big generation, you add to the “rate base.” You put in a new substation, costing $25 M, sized to meet demand that occurs less than 1% of the year. The incentives are entirely skewed to large centrally planned and centrally operated utilities. Utilities number one core competency is not reliable operations or least cost operations, it is never allow the regulatory rules to change. And they are very good at it.
I’m afraid you are awash in a sea of what constitute urban myths about how energy works and is valued in this country.
Ed
As I understand it from several sources the actual amount paid out under PA ever is 151 million. Of this, about 75 million was paid out to various plaintiffs and lawyers as a result of TMI. In addition, the collective industry is obligated to pay the excess damages above the 300 million each utility must carry, up to 10 billion total. Paid as a little less than 100 million per reactor in installment payments of 10 million per year max. Again, this has never cost me as a taxpayer anything. I do not question your assumptions on the cost to put TMI into it’s current state but I suspect it was borne primarily by the utility.
Utilities are obligated to serve me but I am not obligated to buy from them. Again I ask what is the system you envision? It seems like from your discussion that you want to provide your own power but use the utilities assets to both sell excess at a rate you determine and probably buy from them when your own generation is insufficient to supply your own needs.
By the way:
I have a BSE in mechanical design and I am about half way done with an MSEE in power systems (I did not quit, I just started).
I held an operating license and senior operating license at a nuclear plant for 14 years.
On paper I guess you win on impressive qualifications but I am sure I could find someone with a PhD who agrees with me. I think we will simply have to agree to disagree.
Yes! I am so happy that you guys have been posting your credentials! I know it can kind of feel like a “my degree/background/opinion is more relevant/important/right than yours” but it can really help to explain some of the bias associated with each argument (not a bad think, just a fact of life :) ) I would really encourage everyone to post their educational and employment industry when making these types of posts, as it can give some great context to the discussions taking place. These discussions are so important to scientific topics, and I hope they continue to happen.
openunatedgirl
Thanks. You do have to look beyond that also though. My qualifications and experience can provide context but it can never be justification for an opinion by itself. I point this out only because this argument has been used so frequently in the AGW debate. It is possible to have an opinion that is not in your own self interest. For instance, it would be completely self serving of me to line up firmly behind the AGW hypothesis. I am definitely not there.
|
http://wattsupwiththat.com/2010/03/29/yale-to-greens-abandon-climate-change-focus-on-energy/
|
CC-MAIN-2014-10
|
en
|
refinedweb
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.