text stringlengths 454 608k | url stringlengths 17 896 | dump stringclasses 91
values | source stringclasses 1
value | word_count int64 101 114k | flesch_reading_ease float64 50 104 |
|---|---|---|---|---|---|
Advanced Connections¶
The following guide contains information specific to certain types of MongoDB configurations.
For an example of connecting to a simple standalone server, see the Tutorial. To establish a connection with authentication options enabled, see the Authentication page.
Connecting to a Replica Set¶
Connecting to a replica set is much like connecting to a standalone MongoDB server. Simply specify the replica set name using the
?replicaSet=myreplset URI option.
#include <bson/bson.h> #include <mongoc¶/bson.h> #include <mongoc¶ with IPv4 and IPv6¶
If connecting to a hostname that has both IPv4 and IPv6 DNS records, the behavior follows RFC-6555. A connection to the IPv6 address is attempted first. If IPv6 fails, then a connection is attempted to the IPv4 address. If the connection attempt to IPv6 does not complete within 250ms, then IPv4 is tried in parallel. Whichever succeeds connection first cancels the other. The successful DNS result is cached for 10 minutes.
As a consequence, attempts to connect to a mongod only listening on IPv4 may be delayed if there are both A (IPv4) and AAAA (IPv6) DNS records associated with the host.
To avoid a delay, configure hostnames to match the MongoDB configuration. That is, only create an A record if the mongod is only listening on IPv4.
Connecting to a UNIX Domain Socket¶ TLS¶
These are instructions for configuring TLS/SSL connections.
To run a server locally (on port 27017, for example):
$ mongod --port 27017 --tlsMode requireTLS --tlsCertificateKeyFile server.pem --tlsCAFile ca.pem
Add
/?tls=true to the end of a client URI.
mongoc_client_t *client = NULL; client = mongoc_client_new ("mongodb://localhost:27017/?tls=true");
MongoDB requires client certificates by default, unless the
--tlsAllowConnectionsWithoutCertificates is provided. The C Driver can be configured to present a client certificate using the URI option
tlsCertificateKeyFile, which may be referenced through the constant
MONGOC_URI_TLSCERTIFICATEKEYFILE.
mongoc_client_t *client = NULL; mongoc_uri_t *uri = mongoc_uri_new ("mongodb://localhost:27017/?tls=true"); mongoc_uri_set_option_as_utf8 (uri, MONGOC_URI_TLSCERTIFICATEKEYFILE, "client.pem"); client = mongoc_client_new_from_uri (uri);
The client certificate provided by
tlsCertificateKeyFile must be issued by one of the server trusted Certificate Authorities listed in
--tlsCAFile, or issued by a CA in the native certificate store on the server when omitted.
See Configuring TLS for more information on the various TLS related options.
Compressing data to and from MongoDB¶
MongoDB 3.4 added Snappy compression support, zlib compression in 3.6, and zstd compression in 4.2. To enable compression support the client must be configured with which compressors to use:
mongoc_client_t *client = NULL; client = mongoc_client_new ("mongodb://localhost:27017/?compressors=snappy,zlib,zstd"); and/or zstd support to enable compression support, any unknown (or not compiled in) compressor value will be ignored. Note: to build with zstd requires cmake 3.12 or higher.
Additional Connection Options¶
The full list of connection options can be found in the mongoc_uri_t docs.
Certain socket/connection related options are not configurable: | http://mongoc.org/libmongoc/1.17.0-rc0/advanced-connections.html | CC-MAIN-2020-50 | refinedweb | 474 | 50.53 |
Customer Churn Modeling With Deep learning | Python
In this post, I am going to predict customer churn based on some of the previous customer preferences data collected using TensorFlow Keras API in Python language. For this purpose, we will use an open-source dataset. Before going to predict our model which is for customer churn, we need to know what is customer churn? , why we want to predict it? and what is the use of this prediction?
Customer churn is one of the most popular use cases in business, basically churn is something which consists of detecting customers who more likely to cancel the subscription to services which they are availing from a company. So why we want to predict this?
As if you will think for a while then you will come to know that a company is having a huge number of customers who are availing services subscription from the company so it is not practical to keep track of each individual customers that when they are canceling their subscription right, so for this problem, we came up with a solution and that is, we will use the data collected from the previous customer preferences and based of this past data only we will try to predict the future scenario that is If the customer will cancel the service subscription or not.
I hope you got an overview of why we are predicting the customer churn.
Customer Churn Prediction Using ANN in Python
As we got an idea of our problem and now it is time to move for the solution and for this purpose we are going create an artificial neural network and also we will take the help of TensorFlow and Keras deep learning API.
So as I have told earlier that I am going to use an open-source dataset and the link for the dataset can be found in the link dataset.
Download the dataset and analyze it, you will find that basically, this is a classification task. So let’s move forward to load the dataset into our notebook.
If you are following this blog site then you must know that you have two approaches to follow this tutorial with me, one is to install all the dependencies into your local system or you can use google colab runtime environment.
import pandas as pd import numpy as np import matplotlib.pyplot as plt
import keras from keras.models import Sequential from keras.layers import Dense from keras.layers import LeakyReLU,PReLU,ELU from keras.layers import Dropout
In the above section of the code, I am importing the libraries which I am going to use in my model. Look carefully at the above code snippet that I am importing a library named Keras and that is the most useful library and it is going to play an important role in our customer churn prediction model.
Hope you have downloaded the dataset now moving forward to load this dataset into our notebook.
data = pd.read_csv('/content/drive/My Drive/Internship/dataaset.csv') data.head()
OUTPUT:
In the above code, I am importing the dataset into the notebook, and to look at the top 10 datasets, I am using the head().
I have already given you the idea that you always try to look at the dataset from the top as well as from the bottom and for looking from the bottom you can use tail() and output can be seen below.
data.tail(5)
OUTPUT:
Let’s get the information about our dataset.
data.info()
OUTPUT:
You can see in the above snippet of code that I am using info() to get the information about the dataset.
Moving forward to get the mathematical description of our dataset.
data.describe()
OUTPUT:
You can see in the above code snippet that I am extracting the mathematical description of the dataset like, count, mean, max, min, and the standard deviation values.
Now let’s plot the labels of our dataset to count the target variables.
import matplotlib as mpl mpl.rcParams['figure.figsize'] = 8,6 plt.bar(data['Exited'].unique(), data['Exited'].value_counts(), color = ['pink', 'green']) plt.xticks([0, 1]) plt.xlabel('Target Classes') plt.ylabel('Count') plt.title('Count of each Target Class')
OUTPUT:
As you can see in the above code snippet, the count of the label of our dataset. If you have seen the count of the dataset than you can say that the given dataset is not balanced, so if you will move for the further advanced concepts and suppose you are needed to create a model where you need to balance your dataset so you can use some algorithm like NEAR-MISS Algorithm. But here I am implementing the basics tutorial for churn modeling so I am not going to do that but you can explore it further.
X = data.iloc[:, 3:13] y = data.iloc[:, 13]
In the above block of code, I am storing the input feature into a separate variable called X a target variable into y.
Moving further to do some more preprocessing with our dataset.
geo=pd.get_dummies(X["Geography"],drop_first=True) gender=pd.get_dummies(X['Gender'],drop_first=True)
In the above code snippet, I am getting the dummy variables of the categorical variable, As if you will see above at the dataset then you will find that dataset is having categorical columns and we must have to convert these categorical columns into their corresponding dummy variable. If you have followed my previous tutorial heart_attack_detection then you must know as I have explained there about getting the dummy variable.
Moving forward to concatenate the columns.
X=pd.concat([X,geo,gender],axis=1)
X=X.drop(['Geography','Gender'],axis=1)
In the above two snippets of code, I am concatenating the new columns into my previous dataset after getting the corresponding dummy variables. And I am also dropping the already existing same columns because we don’t need that.
Now we will split the dataset into train and test sets.
from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)
As you can see in the above snippet of code that I am splitting the dataset into the train and test sets with the help of train_test-split() which is provided by sci-kit learn.
from sklearn.preprocessing import StandardScaler std = StandardScaler() X_train = std.fit_transform(X_train) X_test = std.transform(X_test)
In the above block of code, I am transforming my dataset into standard scalar formate as I have introduced the basic concept about this from my first blog ,so you must have an idea about that. Basically, standard scalar formate is used to remove the means and used to scale each feature to unit variance.
model =Sequential()
model.add(Dense(6, activation='relu', kernel_initializer='he_uniform',input_dim=11)) model.add(Dense(6, activation='relu', kernel_initializer='he_uniform')) model.add(Dense(1, activation='sigmoid', kernel_initializer='he_uniform'))
In the above code block, I am using a sequential model as our dataset is having an input dimension of 11 so I am using the input dimension as 11 in the input layer of this dataset and I am using relu activation function in the input layer as well as in the hidden layer.
I am using the sigmoid activation function at the output layers and if you will look at the output then I am taking it as 1 because we will get only one output either 0 or 1 as an output from this model.
It’s time to compile our model.
model.compile(optimizer = 'SGD', loss = 'binary_crossentropy', metrics = ['accuracy']
history=model.fit(X_train, y_train,validation_split=0.30, batch_size = 10, epochs = 200)
OUTPUT:
You can see in the above code block that I am using the SGD optimizer and training model for 200 epochs. You can verify from the above output that our model is not getting overfitted.
You can also try this model by changing the optimizer from SGD to adam and You can see the changes.
print(history.history.keys()) plt.plot(history.history['accuracy']) plt.plot(history.history['val_accuracy']) plt.title('model accuracy') plt.ylabel('accuracy') plt.xlabel('epoch') plt.legend(['train', 'test'], loc='upper left') plt.show()
OUTPUT:
As in the previous block of code, I have saved my model training into a variable history, Now in the above code, I am plotting the performance of my model provided by each epoch, which is saved into my history variable. You can verify my model accuracy. It is looking quite well but as always you can play with the code and make some changes and make this model more accurate.
plt.plot(history.history['loss']) plt.plot(history.history['val_loss']) plt.title('model loss') plt.ylabel('loss') plt.xlabel('epoch') plt.legend(['train', 'test'], loc='upper left') plt.show()
OUTPUT:
As before I have plotted model accuracy now in the above block of code I am plotting my model loss, you can see the plot and as we will move further you will see the actual numerical values of loss and the accuracy.
Moving further to predict the output using our trained model.
y_pred = model.predict(X_test) y_pred
OUTPUT:
y_test
OUTPUT:
You can see the predicted output with the help of our trained model. I have also extracted the actual output you can verify the actual and predicted output.
Let’s move to extract the confusion matrix of our model.
y_pred = (y_pred > 0.5) from sklearn.metrics import confusion_matrix confu = confusion_matrix(y_test, y_pred) print(confu)
OUTPUT:
[[1501 94] [ 189 216]]
In the above block of code, I am getting the confusion matrix of the trained model. Basically, a confusion matrix is helpful to describe the performance of the classification model. As we are also building a classification model so it will be useful.
We can not discuss everything here because our main goal is to introduce you, how we can make artificial neural networks to train our model for the classification tasks. So you have a small task which I am assigning to you go and search about confusion matrix and have a detailed understanding of it. You are going to enjoy the concept.
from sklearn.metrics import accuracy_score y_pred = (y_pred > 0.5) accu=accuracy_score(y_test, y_pred, normalize=False) print(accu)
OUTPUT:
1717
In the above code, I am taking the predicted value which is greater than 0.5 and I am calculating the accuracy score with the help of accuracy_score(). You can see the printed output in the output block.
from sklearn.metrics import f1_score f1_score(y_test, y_pred)
OUTPUT:
0.6041958041958042
In the above snippet of code, I am calculating the f1_score of the trained model. Basically, f1_score is used to calculate the accuracy.
You must have a question that I have already calculated the accuracy with help of confusion matrix and accuracy_score() then why f1_score() right?
I have the answer for this, actually if you remember in the above line I have told you that our dataset is imbalanced, and also if you will look to the confusion matrix than you will find that here false positive and false negative are crucial so overall I can say that if the dataset is imbalanced and false positive and false negative is more crucial, f1-score will be better matric to calculate the accuracy.
I hope you get my point.
from sklearn.metrics import precision_score, recall_score precision_score(y_test, y_pred)
OUTPUT:
0.6967741935483871
recall_score(y_test, y_pred)
OUTPUT:
0.5333333333333333
In the above code block, I am calculating two scores from my trained model that is precision_score() and recall-score(). the precision score is used when the cost of false positive is high and recall_score is used when the cost of false negative is high. You can see the output but as I have introduced above that overall accuracy can be calculated using f1_score in such cases.
Hope you enjoyed the tutorial please put your suggestions and doubts in the comment box, your feedback means a lot to us.
Thanks for your valuable time.
CONCLUSIONS:
In this tutorial, you have encountered too many concepts that are new to you and I have tried my best to explain to you as things can be explained here. You can always explore the concept and further use in your future model which you will build because as things go on, small concepts become very complicated so even reading small concepts can be very useful.
As we have built a classification model using an artificial neural network and finally we will be able to predict customer churn based on the dataset provided. You can also do some modifications and achieve the model’s performance according to your need.
You can try to build another model with the help of a deep neural network adding some of the denser layers using the same dataset.
Here is a link to the code zip file. | https://valueml.com/customer-churn-modeling-with-deep-learning-python/ | CC-MAIN-2021-25 | refinedweb | 2,145 | 60.85 |
PEP 680 -- tomllib: Support for Parsing TOML in the Standard Library
Contents
- Abstract
- Motivation
- Rationale
- Specification
- Maintenance Implications
- Backwards Compatibility
- Security Implications
- How to Teach This
- Reference Implementation
- Rejected Ideas
- Basing on another TOML implementation
- Including an API for writing TOML
- Assorted API details
- Controlling the type of mappings returned by tomllib.load[s]
- Removing support for parse_float in tomllib.load[s]
- Alternative names for the module
- Previous Discussion
- Appendix A: Differences between proposed API and toml
Abstract
This PEP proposes adding the tomllib module to the standard library for parsing TOML (Tom's Obvious Minimal Language,).
Motivation
TOML is the format of choice for Python packaging, as evidenced by PEP 517, PEP 518 and PEP 621. This creates a bootstrapping problem for Python build tools, forcing them to vendor a TOML parsing package or employ other undesirable workarounds, and causes serious issues for repackagers and other downstream consumers. Including TOML support in the standard library would neatly solve all of these issues.
Further, many Python tools are now configurable via TOML, such as black, mypy, pytest, tox, pylint and isort. Many that are not, such as flake8, cite the lack of standard library support as a main reason why. Given the special place TOML already has in the Python ecosystem, it makes sense for it to be an included battery.
Finally, TOML as a format is increasingly popular (for the reasons outlined in PEP 518), with various Python TOML libraries having about 2000 reverse dependencies on PyPI (for comparison, requests has about 28000 reverse dependencies). Hence, this is likely to be a generally useful addition, even looking beyond the needs of Python packaging and related tools.
Rationale
This PEP proposes basing the standard library support for reading TOML on the third-party library tomli (github.com/hukkin/tomli).
Many projects have recently switched to using tomli, such as pip, build, pytest, mypy, black, flit, coverage, setuptools-scm and cibuildwheel.
tomli is actively maintained and well-tested. It is about 800 lines of code with 100% test coverage, and passes all tests in the proposed official TOML compliance test suite, as well as the more established BurntSushi/toml-test suite.
Specification
A new module tomllib will be added to the Python standard library, exposing the following public functions:
def load( fp: SupportsRead[bytes], /, *, parse_float: Callable[[str], Any] = ..., ) -> dict[str, Any]: ... def loads( s: str, /, *, parse_float: Callable[[str], Any] = ..., ) -> dict[str, Any]: ...
tomllib.load deserializes a binary file-like object containing a TOML document to a Python dict. The fp argument must have a read() method with the same API as io.RawIOBase.read().
tomllib.loads deserializes a str instance containing a TOML document to a Python dict.
The parse_float argument is a callable object that takes as input the original string representation of a TOML float, and returns a corresponding Python object (similar to parse_float in json.load). For example, the user may pass a function returning a decimal.Decimal, for use cases where exact precision is important. By default, TOML floats are parsed as instances of the Python float type.
The returned object contains only basic Python objects (str, int, bool, float, datetime.{datetime,date,time}, list, dict with string keys), and the results of parse_float.
tomllib.TOMLDecodeError is raised in the case of invalid TOML.
Note that this PEP does not propose tomllib.dump or tomllib.dumps functions; see Including an API for writing TOML for details.
Maintenance Implications
Stability of TOML
The release of TOML 1.0.0 in January 2021 indicates the TOML format should now be officially considered stable. Empirically, TOML has proven to be a stable format even prior to the release of TOML 1.0.0. From the changelog, we can see that TOML has had no major changes since April 2020, and has had two releases in the past five years (2017-2021).
In the event of changes to the TOML specification, we can treat minor revisions as bug fixes and update the implementation in place. In the event of major breaking changes, we should preserve support for TOML 1.x.
Maintainability of proposed implementation
The proposed implementation (tomli) is pure Python, well tested and weighs in at under 1000 lines of code. It is minimalist, offering a smaller API surface area than other TOML implementations.
The author of tomli is willing to help integrate tomli into the standard library and help maintain it, as per this post. Furthermore, Python core developer Petr Viktorin has indicated a willingness to maintain a read API, as per this post.
Rewriting the parser in C is not deemed necessary at this time. It is rare for TOML parsing to be a bottleneck in applications, and users with higher performance needs can use a third-party library (as is already often the case with JSON, despite Python offering a standard library C-extension module).
TOML support a slippery slope for other things
As discussed in the Motivation section, TOML holds a special place in the Python ecosystem, for reading PEP 518 pyproject.toml packaging and tool configuration files. This chief reason to include TOML in the standard library does not apply to other formats, such as YAML or MessagePack.
In addition, the simplicity of TOML distinguishes it from other formats like YAML, which are highly complicated to construct and parse.
An API for writing TOML may, however, be added in a future PEP.
Backwards Compatibility
This proposal has no backwards compatibility issues within the standard library, as it describes a new module. Any existing third-party module named tomllib will break, as import tomllib will import the standard library module. However, tomllib is not registered on PyPI, so it is unlikely that any module with this name is widely used.
Note that we avoid using the more straightforward name toml to avoid backwards compatibility implications for users who have pinned versions of the current toml PyPI package. For more details, see the Alternative names for the module section.
Security Implications
Errors in the implementation could cause potential security issues. However, the parser's output is limited to simple data types; inability to load arbitrary classes avoids security issues common in more "powerful" formats like pickle and YAML. Also, the implementation will be in pure Python, which reduces security issues endemic to C, such as buffer overflows.
How to Teach This
The API of tomllib mimics that of other well-established file format libraries, such as json and pickle. The lack of a dump function will be explained in the documentation, with a link to relevant third-party libraries (e.g. tomlkit, tomli-w, pytomlpp).
Reference Implementation
The proposed implementation can be found at
Rejected Ideas
Basing on another TOML implementation
Several potential alternative implementations exist:
- tomlkit is well established, actively maintained and supports TOML 1.0.0. An important difference is that tomlkit supports style roundtripping. As a result, it has a more complex API and implementation (about 5x as much code as tomli). Its author does not believe that tomlkit is a good choice for the standard library.
- toml is a very widely used library. However, it is not actively maintained, does not support TOML 1.0.0 and has a number of known bugs. Its API is more complex than that of tomli. It allows customising output style through a complicated encoder API, and some very limited and mostly unused functionality to preserve input style through an undocumented decoder API. For more details on its API differences from this PEP, refer to Appendix A.
- pytomlpp is a Python wrapper for the C++ project toml++. Pure Python libraries are easier to maintain than extension modules.
- rtoml is a Python wrapper for the Rust project toml-rs and hence has similar shortcomings to pytomlpp. In addition, it does not support TOML 1.0.0.
- Writing an implementation from scratch. It's unclear what we would get from this; tomli meets our needs and the author is willing to help with its inclusion in the standard library.
Including an API for writing TOML
There are several reasons to not include an API for writing TOML.
The ability to write TOML is not needed for the use cases that motivate this PEP: core Python packaging tools, and projects that need to read TOML configuration files.
Use cases that involve editing an existing TOML file (as opposed to writing a brand new one) are better served by a style preserving library. TOML is intended as a human-readable and -editable configuration format, so it's important to preserve comments, formatting and other markup. This requires a parser whose output includes style-related metadata, making it impractical to output plain Python types like str and dict. Furthermore, it substantially complicates the design of the API.
Even without considering style preservation, there are too many degrees of freedom in how to design a write API. For example, what default style (indentation, vertical and horizontal spacing, quotes, etc) should the library use for the output, and how much control should users be given over it? How should the library handle input and output validation? Should it support serialization of custom types, and if so, how? While there are reasonable options for resolving these issues, the nature of the standard library is such that we only get "one chance to get it right".
Currently, no CPython core developers have expressed willingness to maintain a write API, or sponsor a PEP that includes one. Since it is hard to change or remove something in the standard library, it is safer to err on the side of exclusion for now, and potentially revisit this later.
Therefore, writing TOML is left to third-party libraries. If a good API and relevant use cases for it are found later, write support can be added in a future PEP.
Assorted API details
Types accepted as the first argument of tomllib.load
The toml library on PyPI allows passing paths (and lists of path-like objects, ignoring missing files and merging the documents into a single object) to its load function. However, allowing this here would be inconsistent with the behavior of json.load, pickle.load and other standard library functions. If we agree that consistency here is desirable, allowing paths is out of scope for this PEP. This can easily and explicitly be worked around in user code, or by using a third-party library.
The proposed API takes a binary file, while toml.load takes a text file and json.load takes either. Using a binary file allows us to ensure UTF-8 is the encoding used (ensuring correct parsing on platforms with other default encodings, such as Windows), and avoid incorrectly parsing files containing single carriage returns as valid TOML due to universal newlines in text mode.
Type accepted as the first argument of tomllib.loads
While tomllib.load takes a binary file, tomllib.loads takes a text string. This may seem inconsistent at first.
Quoting the TOML v1.0.0 specification:
A TOML file must be a valid UTF-8 encoded Unicode document.
tomllib.loads does not intend to load a TOML file, but rather the document that the file stores. The most natural representation of a Unicode document in Python is str, not bytes.
It is possible to add bytes support in the future if needed, but we are not aware of any use cases for it.
Controlling the type of mappings returned by tomllib.load[s]
The toml library on PyPI accepts a _dict argument in its load[s] functions, which works similarly to the object_hook argument in json.load[s]. There are several uses of _dict found on; however, almost all of them are passing _dict=OrderedDict, which should be unnecessary as of Python 3.7. We found two instances of relevant use: in one case, a custom class was passed for friendlier KeyErrors; in the other, the custom class had several additional lookup and mutation methods (e.g. to help resolve dotted keys).
Such a parameter is not necessary for the core use cases outlined in the Motivation section. The absence of this can be pretty easily worked around using a wrapper class, transformer function, or a third-party library. Finally, support could be added later in a backward-compatible way.
Removing support for parse_float in tomllib.load[s]
This option is not strictly necessary, since TOML floats should be implemented as "IEEE 754 binary64 values", which is equivalent to a Python float on most architectures.
The TOML specification uses the word "SHOULD", however, implying a recommendation that can be ignored for valid reasons. Parsing floats differently, such as to decimal.Decimal, allows users extra precision beyond that promised by the TOML format. In the author of tomli's experience, this is particularly useful in scientific and financial applications. This is also useful for other cases that need greater precision, or where end-users include non-developers who may not be aware of the limits of binary64 floats.
There are also niche architectures where the Python float is not a IEEE 754 binary64 value. The parse_float argument allows users to achieve correct TOML semantics even on such architectures.
Alternative names for the module
Ideally, we would be able to use the toml module name.
However, the toml package on PyPI is widely used, so there are backward compatibility concerns. Since the standard library takes precedence over third party packages, libraries and applications who current depend on the toml package would likely break when upgrading Python versions due to the many API incompatibilities listed in Appendix A, even if they pin their dependency versions.
To further clarify, applications with pinned dependencies are of greatest concern here. Even if we were able to obtain control of the toml PyPI package name and repurpose it for a backport of the proposed new module, we would still break users on new Python versions that included it in the standard library, regardless of whether they have pinned an older version of the existing toml package. This is unfortunate, since pinning would likely be a common response to breaking changes introduced by repurposing the toml package as a backport (that is incompatible with today's toml).
Finally, the toml package on PyPI is not actively maintained, but as of yet, efforts to request that the author add other maintainers have been unsuccessful, so action here would likely have to be taken without the author's consent.
Instead, this PEP proposes the name tomllib. This mirrors plistlib and xdrlib, two other file format modules in the standard library, as well as other modules, such as pathlib, contextlib and graphlib.
Other names considered but rejected include:
- tomlparser. This mirrors configparser, but is perhaps somewhat less appropriate if we include a write API in the future.
- tomli. This assumes we use tomli as the basis for implementation.
- toml under some namespace, such as parser.toml. However, this is awkward, especially so since existing parsing libraries like json, pickle, xml, html etc. would not be included in the namespace.
Previous Discussion
Appendix A: Differences between proposed API and toml
This appendix covers the differences between the API proposed in this PEP and that of the third-party package toml. These differences are relevant to understanding the amount of breakage we could expect if we used the toml name for the standard library module, as well as to better understand the design space. Note that this list might not be exhaustive.
No proposed inclusion of a write API (no toml.dump[s])
This PEP currently proposes not including a write API; that is, there will be no equivalent of toml.dump or toml.dumps, as discussed at Including an API for writing TOML.
If we included a write API, it would be relatively straightforward to convert most code that uses toml to the new standard library module (acknowledging that this is very different from a compatible API, as it would still require code changes).
A significant fraction of toml users rely on this, based on comparing occurrences of "toml.load" to occurrences of "toml.dump".
Different first argument of toml.load
toml.load has the following signature:
def load( f: Union[SupportsRead[str], str, bytes, list[PathLike | str | bytes]], _dict: Type[MutableMapping[str, Any]] = ..., decoder: TomlDecoder = ..., ) -> MutableMapping[str, Any]: ...
This is quite different from the first argument proposed in this PEP: SupportsRead[bytes].
Recapping the reasons for this, previously mentioned at Types accepted as the first argument of tomllib.load:
- Allowing paths (and even lists of paths) as arguments is inconsistent with other similar functions in the standard library.
- Using SupportsRead[bytes] allows us to ensure UTF-8 is the encoding used, and avoid incorrectly parsing single carriage returns as valid TOML.
A significant fraction of toml users rely on this, based on manual inspection of occurrences of "toml.load".
Errors
toml raises TomlDecodeError, vs. the proposed PEP 8-compliant TOMLDecodeError.
A significant fraction of toml users rely on this, based on occurrences of "TomlDecodeError".
toml.load[s] accepts a _dict argument
Discussed at Controlling the type of mappings returned by tomllib.load[s].
As mentioned there, almost all usage consists of _dict=OrderedDict, which is not necessary in Python 3.7 and later.
toml.load[s] support an undocumented decoder argument
It seems the intended use case is for an implementation of comment preservation. The information recorded is not sufficient to roundtrip the TOML document preserving style, the implementation has known bugs, the feature is undocumented and we could only find one instance of its use on.
The toml.TomlDecoder interface exposed is far from simple, containing nine methods.
Users are likely better served by a more complete implementation of style-preserving parsing and writing.
toml.dump[s] support an encoder argument
Note that we currently propose to not include a write API; however, if that were to change, these differences would likely become relevant.
The encoder argument enables two use cases:
- control over how custom types should be serialized, and
- control over how output should be formatted.
The first is reasonable; however, we could only find two instances of this on. One of these two used this ability to add support for dumping decimal.Decimal, which a potential standard library implementation would support out of the box. If needed for other types, this use case could be well served by the equivalent of the default argument in json.dump.
The second use case is enabled by allowing users to specify subclasses of toml.TomlEncoder and overriding methods to specify parts of the TOML writing process. The API consists of five methods and exposes substantial implementation detail.
There is some usage of the encoder API on; however, it appears to account for a tiny fraction of the overall usage of toml.
Timezones
toml uses and exposes custom toml.tz.TomlTz timezone objects. The proposed implementation uses datetime.timezone objects from the standard library.
This document is placed in the public domain or under the CC0-1.0-Universal license, whichever is more permissive. | https://www.python.org/dev/peps/pep-0680/ | CC-MAIN-2022-05 | refinedweb | 3,162 | 54.73 |
Hi guys,
I spent the whole day trying to import a .osm-file into a database on Windows 7. I read many many pages about how to do this, but still I didn't succeed. :-(
The problem is that there are so many different tools available and as a newbie I just can't decide which to use.
I would be so happy, if you could give a step by step instruction on how to do it. It must be possible somehow! ;-) There is no need to be too detailed right now, I will try to follow your steps as good as possible and will just ask if more detail is needed for me.
Thank you so much in advance!
drummer
asked
08 Oct '11, 18:24
drummer83
16●1●1●1
accept rate:
0%
Once you have set up PostGIS on Windows (which is outside the scope of OSM and you should find information about this elsewhere), Osmosis can be used to import data. You will not get a database that is fit for standard rendering with Mapnik, but if all you need is to somehow get the data into PostGIS, that might be the easiest way. Osmosis can write different data schemas and which one you choose depends on what you want to do with the data.
You could also choose an even simpler path and download a set of shape files for your region from the Geofabrik download server, then use the shp2pgsql that comes with PostGIS to load the shape files into a database. Note however that in contrast to the Osmosis approach, this will not give you the complete set of OSM data - just the stuff that the Geofabrik people chose to export in their shape file.
answered
08 Oct '11, 18:41
Frederik Ramm ♦
70.6k●82●639●1105
accept rate:
24%
Hi,
thanks for your answer. I decided to go for your second approach, as it seems to be easier. So I set up PostgreSQL 9.1 and PostGIS 1.5.3 using all the standard settings. I didn't choose to create a spatial database during the PostGIS setup.
When I try to import the shapefile (hamburg.shp -> roads.shp) using shp2pgsql it says the connection succeeded, but I get the following.
What is the problem here?
Thanks for any suggestions.
Using your first approach (osmosis) I guess I have to set up a database with the correct structure first. Is any of the files in this folder doing it for me?
C:Program Filesosmosis-0.39scriptcontrib
apidb_0.6.sql maybe? But what do I have to do to execute the script? I tried pasting the code in the SQL part of pgAdmin but which database has to be selected: postgres? template_postgis? a new one?
Thanks for any help!
Hi, you have to do some tweaking to your postgis database to make it work with osm.
If you understand German, look at my wiki-Page:
Greetings,
ajoessen
answered
14 Oct '11, 07:45
ajoessen
168●2●6
accept rate:
9%
Any chance you'd know of an english version of that?
Once you sign in you will be able to subscribe for any updates here
Answers
Answers and Comments
Markdown Basics
learn more about Markdown
This is the support site for OpenStreetMap.
Question tags:
import ×167
postgis ×121
database ×89
windows ×42
question asked: 08 Oct '11, 18:24
question was seen: 10,628 times
last updated: 25 Nov '12, 19:21
Failed to allocate space for node cache file
import OSM data to PostGIS database via imposm3
Why is my import of planet-latest.osm KILLED?
Lossy and Lossless Methods Getting OSM Data
How to create a development environment with an empty planet map?
Restarting osm2pqsql full planet import because of too low --cache setting? (import runs for 6 days already)
How can I import POIs from a PostGIS database into OpenStreetMap?
XML/Postgresql Rendering
Best way to get all cities of a specific area?
[closed] Missing DB.php
First time here? Check out the FAQ! | https://help.openstreetmap.org/questions/8363/how-to-setup-postgis-server-and-import-osm-file-on-windows?sort=oldest | CC-MAIN-2019-43 | refinedweb | 675 | 81.02 |
Follow @jongalloway
The best way to add a code file (a.k.a. codebehind) to an ASP.NET ASPX page is check the "Place code in separate file" checkbox when you create it:
However, as Fritz Onion wrote, it's nice to avoid creating unnecessary codebehind files "just in case", because the with advanced web controls in ASP.NET 2.0, it's possible that many of your pages won't need any additional code.
The problem: If you're working with a page wasn't created with a codebehind file, there's no "right-click / add code file" option. Mikhail Arkhipov wrote some basic directions on how to do this manually, and Fritz's post goes into a little more detail. Fritz asked for a plugin to add code files to an ASPX page, but I'll settle for a Visual Studio macro. This thing's pretty simple - just select the ASPX file in the solution explorer, then run the macro. There's some error handling, but I'd make sure you save your work before running this.
I've started playing with upgrading it to a Visual Studio Addin (using the MakeAddin macro), but it's not working yet.
Sub AddCodeBehind()
Dim docName
Dim docFullName
Dim nameOfType
Try
DTE.ExecuteCommand("View.ViewCode")
docName = DTE.ActiveDocument.Name
If (docName.ToString().EndsWith(".aspx") = False) Then
Throw New System.Exception()
End If
Catch ex As Exception
Throw New System.Exception("You must select an ASPX file in the Solution Explorer before running this macro.")
End Try
nameOfType = Replace(docName, ".aspx", "")
docFullName = DTE.ActiveDocument.FullName
DTE.ExecuteCommand("Edit.Replace")
DTE.Find.ReplaceWith = "<%@ Page Language=""C#"" CodeFile=""" + nameOfType + ".aspx.cs"" Inherits=""" + nameOfType + """"
DTE.Windows.Item("" + nameOfType + ".aspx").Activate()
DTE.Find.FindWhat = "<%@ Page Language=""VB"""
DTE.Find.ReplaceWith = "<%@ Page Language=""C#"" CodeFile=""" + nameOfType + ".aspx.cs"" Inherits=""" + nameOfType + """"
DTE.Find.FindWhat = "<%@ Page Language=""C#"""
DTE.Find.Action = vsFindAction.vsFindActionReplaceAll
End If
'{CF2DDC32-8CAD-11D2-9302-005345000000} is the GUID for the Find / Replace Dialog
DTE.Windows.Item("{CF2DDC32-8CAD-11D2-9302-005345000000}").Close()
DTE.ActiveDocument.Save()
DTE.ActiveDocument.Close(vsSaveChanges.vsSaveChangesYes)
DTE.ItemOperations.AddNewItem("Web Developer Project Files\Visual C#\Class", docName + ".cs")
DTE.ExecuteCommand("Edit.Replace")
DTE.Windows.Item(nameOfType + ".aspx.cs").Activate()
DTE.Find.FindWhat = "public class " + nameOfType
DTE.Find.ReplaceWith = "public partial class " + nameOfType + " : Page"
Throw New System.Exception("vsFindResultNotFound")
End If
'{CF2DDC32-8CAD-11D2-9302-005345000000} is the GUID for the Find / Replace Dialog in case you missed that earlier comment
DTE.Windows.Item("{CF2DDC32-8CAD-11D2-9302-005345000000}").Close()
DTE.ActiveDocument.Save()
DTE.ActiveDocument.Close(vsSaveChanges.vsSaveChangesYes)
DTE.ItemOperations.OpenFile(docName)
DTE.ItemOperations.OpenFile(docFullName + ".cs")
End Sub..
I'll be speaking at the San Diego .NET User Group on 11/28:.
I'm splitting the evening with Zoiner Tejada, who will be speaking on SSIS.?
PowerShell's great. I'm fired up about the opportunity to use .NET objects from simple scripts. I'll admit I'm still getting up to speed with it, but I'm totally sold on PowerShell.
However, it's not installed on a lot of servers I work with, and I still do a lot of my "clumsy developer attempting DBA and network admin" tasks from DOS Batch files. You can do quite a bit with DOS Batch - the silly fact is the my most popular posts (by a huge margin) are some batch scripts to allow running IE7 and IE6 on the same computer.
So, by way of tribute to the dying art of the DOS Batch file, I present my top ten batch file tricks:
PUSHD "C:\Working Directory\"
::DO SOME WORK
POPD
set FTPADDRESS=
set SITEBACKUPFILE=FileToTransfer.zip
set /p FTPUSERNAME=Enter FTP User Name:
set /p FTPPASSWORD=Enter FTP Password:
CLS
> script.ftp USER
>>script.ftp ECHO %FTPUSERNAME%
>>script.ftp ECHO %FTPPASSWORD%
>>script.ftp ECHO binary
>>script.ftp ECHO prompt n
:: Use put instead of get to upload the file
>>script.ftp ECHO get %SITEBACKUPFILE%
>>script.ftp ECHO bye
FTP -v -s:script.ftp %FTPADDRESS%
TYPE NUL >script.ftp
DEL script.ftp
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" /v SQL2005') DO SET SQLINSTANCE=%%B
osql -E -d master -Q "BACKUP DATABASE [%DATABASENAME%] TO DISK = N'D:\DataBase\Backups\%DATABASENAME%_backup' WITH INIT , NOUNLOAD , NAME = N'%DATABASENAME% backup', NOSKIP , STATS = 10, NOFORMAT"
IF EXIST %SystemRoot%\$NtUninstallKB915865$\ GOTO KB_INSTALLED
ECHO Installing Hotfix (KB915865) to allow tab support
START /D "%~dp0/Installation/Update/" xmllitesetup.exe
ECHO Waiting 15 seconds
PING 1.1.1.1 -n 1 -w 15000 > NUL
IF dummy==dummy%3 (
SET APPLICATIONPATH="C:\Program Files\MyApp\"
) ELSE (
SET APPLICATIONPATH = %3
)
PUSHD %BACKUPDIRECTORY%
FOR %%A in (*.bak) do CALL :Subroutine %%A
POPD
GOTO:EOF
:Subroutine
set DBNAME=%~n1
::RUN SOME OSQL COMMANDS TO RESTORE THE BACKUP
GOTO:EOF
@echo off
echo %%~1 = %~1
echo %%~f1 = %~f1
echo %%~d1 = %~d1
echo %%~p1 = %~p1
echo %%~n1 = %~n1
echo %%~x1 = %~x1
echo %%~s1 = %~s1
echo %%~a1 = %~a1
echo %%~t1 = %~t1
echo %%~z1 = %~z1
echo %%~$PATHATH:1 = %~$PATHATH:1
echo %%~dp1 = %~dp1
echo %%~nx1 = %~nx1
echo %%~dp$PATH:1 = %~dp$PATH:1
echo %%~ftza1 = %~ftza1
C:\Temp>batchparams.bat c:\windows\notepad.exe
%~1 = c:\windows\notepad.exe
%~f1 = c:\WINDOWS\NOTEPAD.EXE
%~d1 = c:
%~p1 = \WINDOWS\
%~n1 = NOTEPAD
%~x1 = .EXE
%~s1 = c:\WINDOWS\NOTEPAD.EXE
%~a1 = --a------
%~t1 = 08/25/2005 01:50 AM
%~z1 = 17920
%~$PATHATH:1 =
%~dp1 = c:\WINDOWS\
%~nx1 = NOTEPAD.EXE
%~dp$PATH:1 = c:\WINDOWS\
%~ftza1 = --a------ 08/25/2005 01:50 AM 17920 c:\WINDOWS\NOTEPAD.EXE %*
What about you? Got any favorite DOS Batch tricks?.:
Mono 1.2 has been released.Go to the downloads page to get a copy.
Mono 1.2 has been released.Go to the downloads page to get a copy.
Hmm...
There are some high level articles on eWeek and wwwCoder which parrot a press release, indicating Mono 1.2 has these features:
I get the feeling that the release was a little rushed to allow for an announcement at TechEd, and the docs aren't up to date. The Mono roadmap indicates the 1.2 release was supposed to have the following:::
Mono 1.2 will also include assemblies from Whidbey (.NET 2.0) available as technology previews:
I've been pretty impressed with Mono's winform support since the 1.1.8 release, so I'm looking forward to seeing how much better 1.2. | http://weblogs.asp.net/jgalloway/archive/2006/11.aspx?PageIndex=1 | CC-MAIN-2013-48 | refinedweb | 1,066 | 59.6 |
Posted on June 11th, 2014
Ok, I’ll admit. I’ve been seriously struggling with AutoLayout ever since it’s been introduced. I understand the concept, and I LOVE the idea of it, but when I actually do it, it almost never behaves as it does in my head.
So when I had a chance to go talk to an actual Apple Engineer about AutoLayout last week at WWDC, I made sure to go. I thought of my most painful experience using AutoLayout recently – when I was making a login screen with username and password fields on a ScrollView (so it scrolls up when the keyboard comes up) – and had the Apple engineer walk me through the example.
Here is what we made:
This is just two input fields centered on a ScrollView. You can see the AutoLayout at work here – the two input fields are centered correctly both on a 4s and a 5s device.
This “simple” solution took the Apple Engineer 40 minutes to solve! However, several senior engineers I know said that they’ve never been able to get AutoLayout working quite right on a ScrollView, so 40 minutes is actually not bad!
Here are the key tricks to getting AutoLayout to work on a ScrollView:
The ScrollView should have only ONE child view. This is forced in Android, so I should have made the connection, but I just didn’t think of it – it’s too easy to put the two input text fields right onto the ScrollView, especially in Interface Builder.
Here is what the View Hierarchy should actually look like:
Again, make sure to put all your fields and custom views inside the one child view of the ScrollView!
I’m going to start with the constraints from the outside (on the main view) in (to the stuff inside the ContentView).
The obvious starting point is to bind the ScrollView to the View – just select the ScrollView from the view hierarchy, and add the following constraints:
The key to getting the constraints to work properly however, is adding anEqual Width constraint between the main View and the ContentView. The ScrollView adjusts to the size of the content inside of it, so setting the ContentView to the Width of the ScrollView leaves the width of the ContentView ambiguous.
To create the Equal Width Constraint between the ContentView and the View, select the ContentView on the view hierarchy and Control + Drag to the View – you should get a pop-up that gives you the “Equal Widths” option:
Your constraints between the main View, ScrollView, and ContentView should look like this:
The constraints between the ScrollView and the ContentView are surprisingly straight forward – just bind the ContentView to the ScrollView (make sure the constant to the bottom layout guide is 0):
The constraints between the ContentView and ScrollView are now as follows with all constants set at 0:
If your storyboard is like mine, you might notice that the actual ContentView is not the full height of the main view or the ScrollView:
However, we do want to make sure the ContentView is centered when it’s rendered on a device. To do that we need to write some code to property set the Content Insets in the ViewController:
// ViewController.swift
import
UIKit
class
ViewController: UIViewController {
@IBOutlet
var
scrollView : UIScrollView
contentView : UIView
override func viewDidLoad() {
super
.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func viewDidLayoutSubviews()
{
let
scrollViewBounds = scrollView.bounds
containerViewBounds = contentView.bounds
scrollViewInsets = UIEdgeInsetsZero
scrollViewInsets.top = scrollViewBounds.size.height/2.0;
scrollViewInsets.top -= contentView.bounds.size.height/2.0;
scrollViewInsets.bottom = scrollViewBounds.size.height/2.0
scrollViewInsets.bottom -= contentView.bounds.size.height/2.0;
scrollViewInsets.bottom += 1
scrollView.contentInset = scrollViewInsets
Once you add the proper constraints into the ContentView (see next step), your final result will look like this:
The ugly colors are meant to differentiate the ScrollView (green) from the ContentView (red). Again, in the storyboard, the ContentView is at the top of the ScrollView, but with our content insets set in code, it now becomes centered.
The final step is to add AutoLayout to the ContentView. This is the same as adding layout normally to any view, so I won’t go into much detail here.
The one thing I did learn that I’d like to share (although now it seems obvious) is how to center the two text fields in the view. Previously, I put the two text fields into a container view, and centered the container view in the parent view. However, that is not necessary.
Instead, you can center each text field horizontally in container (so they’re now centered and on top of each other), and then add a constant of 25 to one (so it’s moved up 25 pixels from the center), and add a constant of -25 to the other (so it’s moved down 25 pixels from the center).
This will leave you with a space of 50 pixels between the two text fields, but the space exactly in between them will be the center of the view.
Do you have any other AutoLayout tips? I’m always looking to learn more and improve, so please let me know in the comments!
You can view the source code on Github here.
Enjoy the article? Join over 8,500+ Swift developers and enthusiasts who get my weekly updates.
Subscribe | https://www.cnblogs.com/ioriwellings/p/5035151.html | CC-MAIN-2018-34 | refinedweb | 899 | 56.49 |
14.1 How Docking Windows Work
It takes a least two objects to create a functional docking window. The first is the primary objectthe object that wants to display a docking window (a namespace extension, BHO, band , etc.). The second object is the docking window itself. It contains all of the implementation code specific to docking windows. In this way, the relationship between the primary object and the docking window is similar to the one between a shell folder and a view; it allows the possibility of a one-to-many relationship.
The docking window object is very much like a band object in that it implements IObjectWithSite and IDockingWindow . IDeskband , which is the primary interface for band objects, is derived from IDockingWindow . So essentially , a docking window must implement the same core functionality as a band object; it must be able to respond to the shell's requests to show, close, and resize the window. Additionally, it must also be able to provide a window handle (of the docking window) to Explorer. This behavior is no different from that of band objects. Well, actually, there is one difference, which we've already talked about: band objects do not have to provide resize information to the shell. Docking windows do.
In order for the primary object to create a docking window, it must first get its hands on an IServiceProvider interface. Depending on the circumstances, this is done in one of two ways. If the component implements IObjectWithSite , as is the case with BHOs, browser extensions, or band objects, all it has to do is query the site pointer passed in by the shell. (See the discussion of site pointers in Chapter 12.) If the component is a namespace extension, it can get to IServiceProvider by means of the IShellBrowser interface that is passed to the component in the IShellView::CreateViewWindow method.
Once the primary object has an IServiceProvider interface pointer, it can then call the QueryService method to get IDockingWindowFrame ; this contains a method called AddToolbar . AddToolbar is the method that is used to add a docking window to Explorer. When the component calls AddToolBar , it passes a reference to an object that implements IDockingWindow (and IObjectWithSite ). This object, of course, is the docking window. From this point, control is transferred from the primary component to the docking window.
Once the shell has access to the docking window object, it calls IObjectWithSite::SetSite . The docking window object uses the site pointer in order to obtain a reference to IDockingWindowSite . This interface will help the docking window negotiate its border space within the client area of Explorer.
After the docking window determines its position, it is displayed.
14.2 Docking Window Interfaces
Docking windows require the use of four interfaces: IObjectWithSite , IDockingWindow , IDockingWindowFrame , and IDockingWindowSite . In the remainder of this section, we'll discuss the four interfaces and their members that are relevant to developing docking windows.
14.2.1 IObjectWithSite
The shell provides a site pointer to the docking window via the IObjectWithSite interface in a manner similar to browser helper objects or band objects. The primary objectthat is, the object that will create the docking windowuses IObjectWithSite to obtain references to IServiceProvider and, optionally , IWebBrowser2 . The secondary component, which is the actual docking window implementation, uses IObjectWithSite to obtain IDockingWindowFrame . IObjectWithSite is summarized in Table 14.2, but for a more complete discussion, please refer to Chapter 12.
Table14.1. IObjectWithSite Methods
14.2.2 IDockingWindow
We have already discussed IDockingWindow . If you remember our discussion of band objects, the IDeskband interface is derived from IDockingWindow . There is nothing new that we need to discuss concerning this interface. Table 14.1 provides a refresher course on the interface and on IOleWindow , the interface from which it is derived, but if you would like more detail, see Chapter 13. Methods marked with an asterisk are not implemented.
Table14.2. IDockingWindow Methods
14.2.3 IDockingWindowFrame
This interface is implemented by Explorer and provides all the methods necessary to add docking windows to a frame (see Table 14.3). It too is derived from IOleWindow .
Table14.3. IDockingWindowFrame Methods
14.2.3.1 AddToolbar
Adds a docking window to Explorer or Internet Explorer's frame. The docking window must implement IDockingWindow . The component that creates the docking window calls this method once it has retrieved a pointer to the IDockingWindowFrame interface by calling IServiceProvider::QueryService . The syntax of AddToolbar is as follows :
HRESULT AddToolbar(IUnknown* punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags);
with the following parameters:
- punkSrc
[in] A reference to the object implementing IDockingWindow (i.e., a reference to the docking window).
- pwszItem
[in] The address of a null- terminated UNICODE string that will be used to identify the docking window. This string can be used later, if necessary, to locate a docking window by calling FindToolbar .
- dwAddFlags
[in] A flag that defines the visibility of the docking window being added. This should either be zero, which specifies that the docking window should be visible, or DWFAF_HIDDEN .
14.2.3.2 FindToolbar
Finds a docking window in the frame. The method is declared as follows:
HRESULT FindToolbar(LPCWSTR pwszItem, REFIID riid, LPVOID* ppvObj);
Its parameters are:
- pwszItem
[in] This is a pointer to the same string that was passed to AddToolbar .
- riid
[in] This is a pointer to the GUID that identifies IDockingWindow .
- ppvOut
[in, out] If the call is successful, this will contain the IDockingWindow interface of the requested docking window.
This method is not necessary for implementing docking windows. The primary component should keep all references to docking windows cached as private member variables ; it would never need to call this method in that circumstance. Presumably, an object that implements a docking window might provide the name of the window (as specified in the call to AddToolbar ) by means of a Public property. Additional components having an interest in the docking window could then locate it in the frame by calling FindToolbar .
14.2.3.3 RemoveToolbar
Removes the specified docking window from the frame. Its syntax is as follows:
HRESULT RemoveToolbar(IUnknown* punkSrc , DWORD dwRemoveFlags );
Its parameters are as follows:
- punkSrc
[in] This is the address of the docking window object. The shell will call IDockingWindow::CloseDW in response to this call.
- dwRemoveFlags
[in] Option flags for removing the docking window object. These flags have no meaning in terms of implementing a docking window. Because the Platform SDK does not document the meaning of these flags, it is assumed they are used by internal Microsoft implementations of the interface. This parameter can be one or more of the following values:
Most likely, this method would not be called under normal circumstances. That's because the docking window itself should have access to the information that the primary component does; it should be able to remove itself. This method is used when the docking window is not your own (well, most likely).
14.2.4 IDockingWindowSite
This interface, which is implemented by Explorer, is used to manage the border space for one or more docking windows. A docking window component can use this interface to obtain its real estate within Explorer's client area. IDockingWindowSite is derived from IOleWindow ; its members are listed in Table 14.4.
Table14.4. IDockingWindowSite
14.2.4.1 GetBorderDW
Retrieves the border space that has been requested by the docking window. RequestBorderSpaceDW must be called first. After a request is made, this method gets the actual space allotted to the docking window. It is important to note that the space requested may be different than the space that is actually reserved. The syntax of GetBorderDW is:
HRESULT GetBorderDW(IUnknown* punkSrc , LPRECT prcBorder );
with the following parameters:
- punkSrc
[in] Address of the docking window interface for the object that has requested space (that is, for the docking window).
- prcBorder
[in] Address of a RECT structure that will contain border coordinates to be used by the docking window upon the successful return of this method.
14.2.4.2 RequestBorderSpaceDW
This method is called to request border space for the docking window; it is either approved, denied , or adjusted to accommodate the shell. If the request is approved or modified the method will return zero. Otherwise, an OLE error will be raised.
The actual space is not allocated until SetBorderSpaceDW is called. Here is the syntax for this method:
HRESULT RequestBorderSpaceDW(IUnknown* punkSrc , LPCBORDERWIDTHS pbw );
with the following parameters:
- punkSrc
[in] The address of the docking window interface for the object that is requesting space.
- pbw
[in] A pointer to a BORDERWIDTHS structure (which is the same thing as a RECT structure) that contains the requested border space.
14.2.4.3 SetBorderSpaceDW
Allocates border space for the docking window. Its syntax is:
HRESULT SetBorderSpaceDW(IUnknown* punkSrc , LPCBORDERWIDTHS pbw );
with the following parameters:
- punkSrc
[in] Address of the docking window interface for which border space is being assigned.
- pbw
[in] Address of a BORDERWITHS ( RECT ) structure containing the coordinates for the space that is being allocated. | http://flylib.com/books/en/1.107.1.94/1/ | CC-MAIN-2017-09 | refinedweb | 1,501 | 54.63 |
In the last four
Todays article is all about the Web API. If you remember, I am developing a Dungeons and Dragons Character Sheet app as a side project. One of the things you need to do is to list and look up spells for your character. So I need a spell reference. To do this, I’m going to add two routes to my project: /api/spells to list all spells and /api/spells/number to get information on a specific spell. This is, after all, just to demonstrate what is required to do an unauthenticated Web API in Node.
I’ve got some spell data in data/spells.json – it’s just a JSON file with a bunch of fields. I could just as easily push this into a database (like SQL Server or MongoDB), but it’s small enough that I can load it at runtime. The json file itself is an array with objects – one for each spell. Each spell has an _id field that uniquely identifies the object.
Don’t like spells? Well, you can replace “spells” with products, books, companies, or whatever you desire.
To start the API, I’ve introduced an API controller in controllers/api.js:
/*eslint-env node */ "use strict"; var express = require("express"), passport = require("passport"), path = require("path"), config = require("../config.json"), spells = require("../data/spells.json"); var router = express.Router(), // eslint-disable-line new-cap controller = path.basename(__filename, ".js"); // Set up the Web API Here module.exports = router;
This is mostly boilerplate code – the same code runs inside the home controller and the account controller. It uses the same routing mechanism, so I can set up my routes just the same way. In fact, the only real difference is that I need to return JSON data rather than HTML.
The /api/spells route is easy, but the /api/spells/number route requires a little explaining. Let’s get the list function out the way first:
function get_all_spells(req, res) { res.status(200).json(spells); } router.get("/spells", get_all_spells);
There is no view in the Web API world. Instead, Express knows how to send JSON directly. In this case, I set the HTTP Response code to 200 (which means success) and then dump out the spells list that I loaded earlier.
Now, back to that special case. Here is the route:
router.get("/spells/:id", get_one_spell);
Here I’m using a standard notation for a route – whatever route segment comes after the colon will be placed into the req.params object and named the same thing. In this case, I am going to get a req.params.id as a string in my function call:
function get_one_spell(req, res) { // Figure out what ID we are actually looking for. If it is non-numeric, // then throw a "Not Found" error back to the user. try { if (req.params && req.params.id) { var id = parseInt(req.params.id); } else { res.status(404).json({ error: "Spell ID must be numeric" }); return; } } catch (e) { res.status(404).json({ error: "Spell ID is always a number" }); return; } // Find the spell by ID - returns empty array if not found var spell = spells.filter(function(o) { return o._id === id; }); if (spell === undefined || spell.length === 0) { res.status(404).json({ error: "Spell ID Not Found" }); } else { res.status(200).json(spell[0]); } }
Step 1 in this method is to convert the thing we get into a number. However, you should never trust the user. The ID may be non-numeric, missing, a space, special characters – pretty much anything. So the code needs to handle those cases. The try-catch block converts what the user gives me to an integer and returns an error to the user in all other cases.
Now that I have an integer, I can try to find the spell. I’m using Array.filter() here. If node was running ECMAScript 6 then I could use Array.find(), but Node is ECMAScript 5 right now. Array.filter() returns an empty array if it doesn’t find any matches. It could be more than one match, but that is improbable if we properly format the data.
If the returned array is undefined or the length is zero, then I tell the user that the spell is not found, otherwise return success (HTTP Response Code 200) and dump the JSON object.
Right now, this is unauthenticated, so I can just test the API using Postman (available on Chrome) or another Web REST API tool:
Authentication
The Web API I’ve developed is unauthenticated right now – anyone can consume it. I probably want it authenticated. I can do this two ways – firstly, I can use the req.isAuthenticated() to adjust the output. For instance, I may want to provide everyone with a set of data, but provide a minimal set of data to everyone and extra data to authenticated users. I can do this in the get_all_spells() method like this:
function get_all_spells(req, res) { // If the user is not authenticated, only show spells on level // 1 or the cantrips. if (!req.isAuthenticated()) { var spell_list = spells.filter(function(o) { return (o.Level === "Cantrip" || o.Level === 1); }); res.status(200).json(spell_list); return; } else { // User is authenticated - show all the spells res.status(200).json(spells); } }
Simulating Authentication in Postman
One of the biggest hurdles for me was this. How do I test my authenticated API code? For that matter, what does an Unauthenticated vs. Authenticated Web API look like? To check this out, I took a look at an authentication request via node in Fiddler.
When I browse to my home page the first time, this is what I get:
The request for / results in a 302 Redirect to /home, which results in a 302 Redirect to /account/login which then returns the view and the view requires a couple of CSS pages. Clicking on Twitter gets me the following:
I’m using Auth0, so clicking on the Twitter Icon really loads my Auth0 page, which then eventually loads Twitter. Once I’ve done the twitter authentication, I’m back at the /account/external-callback URI before redirecting back to the home. Let’s take a look at that final request for the home page:
Note the connect.sid cookie – this is what authenticates the session. I need to include that in any authenticated session.
Let’s say I don’t want the use to be able to use the /api/spells/:id unless authenticated. There is no consensus on how to implement authentication in Web APIs:
- Return a 302 “Redirect” to the login page
- Return a 511 “Network Authentication Required” with a list of authentication providers
- Accept an Authorization header with the information and return 301 “Unauthenticated” if it isn’t provided
If a user tries to use the /api/spells/:id route unauthenticated, I’m going to return a 302 Redirect to /account/login. My code now looks like this:
function get_one_spell(req, res) { // If the user is not authenticated, tell them to authenticate if (!req.isAuthenticated()) { res.redirect("/account/login"); return; } // Rest of the get_one_spell method }
When I run this through the process in Postman, I can see the following:
This isn’t very friendly. When I’m using an API, I don’t want to see HTML that is meant for a human. Let’s instead look at option #2 (the 511 Network Authentication Required version):
function get_login_api() { var connections = config.passport.auth0.connections || [], r = {}, buildurl = function(provider) { var server = config.server.uri || ""; var url = "https://" + config.passport.auth0.domain + "/authorize" + "?response_type=code&scope=openid%20profile" + "&client_id=" + config.passport.auth0.clientid + "&redirect_uri=" + server + "/" + controller + "/external-callback" + "&connection=" + provider; return url; }; for (var i = 0; i < connections.length; i++) { r[connections[i].replace("-","_")] = buildurl(connections[i]); } return r; } function get_one_spell(req, res) { // If the user is not authenticated, tell them to authenticate if (!req.isAuthenticated()) { res.status(511).json(get_login_api()); return; } // Rest of the get_one_spell method }
The get_login_api() converts the configuration we have set up to be an object that we can serialize to JSON. When I run the request in Postman, I get the following:
I’ve obfuscated the client ID. However, you can see that this returns JSON I can work with. A list of the providers and their respective links is provided. As part of a richer login scheme – for instance, with a Single Page Application (SPA) – I can see this working.
Which one you provide is up to you. I like the 511 response code when you are using social logins with a SPA. I’ve seen the 301 Unauthenticated version implemented a few times as well. You have a lot more flexibility, of course, if your interface is only being used by your application.
As always, my code is up on my GitHub Repository. | https://shellmonger.com/2015/05/23/web-api-node-style/ | CC-MAIN-2017-13 | refinedweb | 1,467 | 66.54 |
So it's nice to be able to automatically update your apps, and a lot of people use GitHub these days, so I thought, why not make a little autoupdater that can grab release binaries from GitHub to update itself with?
That's what this is. This little drop-in will take a GitHub repo, find the releases, look for a special tag "Refresh.vMajor.vMinor.vBuild.vRevision" with the highest number, and greater than the current assembly's version, and then grab the zip from that, download it, replace the binaries in the current running folder with the contents of the zip, and finally rerun the updated app with the same command line arguments passed to it originally.
Refresh.vMajor.vMinor.vBuild.vRevision
Woo, that's a lot of churn, but this makes everything relatively automatic.
Disclaimer: It works with winform apps, but I can't necessarily recommend it for console apps because it will interrupt shell redirects and piping operations since it closes the app and reruns it.
Take the ZZupdate0.exe, add it to the root of your project as a file in your project, and then go the properties and choose "Embedded Resource" for the Build Action. This puts the updater into your project. The updater is a small bootstrapper to allow your app to close so your executable files and locked files can be replaced before it runs your app again.
You'll need to use the assembly version information so that the updater can deal with versioning. Make sure you always set your assembly version.
Add the Updater.cs file to your project and add the namespace to the top of Program.cs:
using AutoUpdate;
In your program's Main function, before it does anything else, insert the following code:
Main
// setup the auto update, and exit if there was an update
// change the line below to your github repo where "AutoUpdate" is (YourAppName)/(YourRepoName)
Updater.GitHubRepo = "/codewitch-honey-crisis/AutoUpdate";
if (Updater.AutoUpdate(args))
return;
Please don't do the following except for testing, but if you need to explicitly force an update to a specific version, you can call:
Updater.Update(new Version(major,minor,bld,rev));
I've included the Updater shim in the sample as well. Visual Studio sometimes hiccups when trying to embed its output into the AutoUpdate sample, but just Rebuild again and the error should go away.
AutoUpdate
When running the sample, keep an eye on the version reported by the form. You might see the update window fly by briefly, but then you'll see the form pop back up with the asm version and the args it received from the command line so you can see the update happened. The args were whatever was passed through to the app initially.
These are the steps for adding an update release to GitHub. Please follow them precisely. Look to the enclosed sample for guidance as well:
This works best with a project already using GitHub for source control management, so probably make one of those.
Either way, you'll need a repo to draw from. Make one if you haven't above.
After you've made one, go to releases, and draft a new release.
The tag must be (case-sensitive) Refresh.v<AssemblyVersion>, so for example, Refresh.v1.0.0.5
Refresh.v<AssemblyVersion>
Refresh.v1.0.0.5
The zip file must directly contain the contents of your binary folder, not the folder itself. The application's executable should be in the root directory of the zip. I just go to bin\Release and highlight everything but the .pdb and then go Send To|Compressed Folder...
Name the zipfile <GitRepoName>.Refresh.v<AssemblyVersion> so for example MyApp.Refresh.v1.0.0.5, if MyApp is your repo name and 1.0.0.5 is the assembly version contained in the zip.
<GitRepoName>.Refresh.v<AssemblyVersion>
MyApp.Refresh.v1.0.0.5
MyApp
1.0.0.5
See the sample app's releases page for what this looks like in the real. | https://www.codeproject.com/Articles/5165015/AutoUpdate-A-GitHub-Enabled-autoupdater | CC-MAIN-2019-47 | refinedweb | 676 | 64.71 |
Introduction: Arduino Analog Input Display
hi, this is a simple instructable that shows you how to use an analog input (potentiometer) and display that in percentage form on a 16X2 LCD character display
thanks for looking!
Step 1: Parts Needed
what you will need:
1x arduino
1x 10K pot (for LCD contrast)
1x 100k pot (you may need to modify the code as my pot wasn't exactly 100k, so any pot you have around will do)
1x 6X2 character LCD
a breadboard and wires
Step 2: The Code
paste in arduino compiler:
/* hey, this is a simple code to make your arduino read
the value of a potentiometer and display it in percentage form on
a 16 X 2 LCD screen. I am pretty new at this so sorry if this code
is terrible or if i have no idea what i'm talking about in the
the circuit(pasted from examples):
*)
* Potentiometer attached to analog input 0
* center pin of the potentiometer to the analog pin
* one side pin (either one) to ground
* the other side pin to +5V
*/
#include <LiquidCrystal.h> // include the LCD library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int potPin = A0; //Potentiometer input pin
int potValue1 = 0;
int potValue2 = 0; // final display variable
void setup() {
lcd.begin(16, 2); // lcd rows and columns
lcd.print("Potentiometer"); // title of sorts
}
void loop() {
// read then divide the input(max 1020 in this case) by 10
potValue1 = analogRead(potPin) / 10;
// divide by 1.02 to get percentage
potValue2 = potValue1 / 1.02;
// set cursor to second row, first column
lcd.setCursor(0, 1);
//display final percentage
lcd.print(potValue2);
//print the percent symbol at the end
lcd.print("%");
//wait 0.1 seconds
delay(100);
//wipe the extra characters
lcd.print(" ");
delay(1);
}
Recommendations
We have a be nice policy.
Please be positive and constructive.
8 Comments
I used two 10K potentiometers. It worked great.
nice idea! try make my LCD shield for this project, that would be cool! :)
Excelent! works great! thanks!
Excelent! works great! thanks!
this is brilliant. thanks so much for sharing.
Works fine here, uploaded it and I could adjust exacly as I wanted it to...
Thank you Tesla Warrior...
nevermind, I got it
I did this exactly how its posted and I couldnt get it to work. Any suggestions and I used two 10k pots. It just shows underlines with one underline flipped up,lol | http://www.instructables.com/id/Arduino-analog-input-display/ | CC-MAIN-2018-26 | refinedweb | 403 | 63.9 |
{- TupleSections, FlexibleInstances, MultiParamTypeClasses #-} module Cgm.Control.Monad.State( StateT(..), State, mState, runState, focus, viewState, partialState, partialStateE, eitherState, maybeState, toStandardState, mapStateT, pairStateT, module Control.Monad.State.Class, module Control.Monad.Trans.Class, module Control.Monad.IO.Class ) where import Control.Applicative import Control.Monad import Control.Arrow import Data.Functor.Identity import Data.Maybe import Control.Monad.State.Class import Control.Monad.Trans.Class import Control.Monad.IO.Class import Control.Concurrent.MVar import qualified Control.Monad.State.Strict as Std import Data.Lens hiding (focus) import Control.Comonad.Trans.Store -- | runStateT and runState do not have the usual types: for now we do not make it too easy to discard the precious 'Nothing' newtype StateT s m a = StateT {runStateT :: s -> m (a, Maybe s)} type State s = StateT s Identity mState :: (s -> (a, Maybe s)) -> State s a mState = StateT . fmap Identity runState :: State s a -> s -> (a, Maybe s) runState = fmap runIdentity . runStateT instance Functor m => Functor (StateT s m) where fmap f = StateT . fmap (fmap $ first f) . runStateT instance (Functor m, Monad m) => Applicative (StateT s m) where pure = return (<*>) = ap instance Monad m => Monad (StateT s m) where return = lift . return (StateT c) >>= fd = StateT $ \s -> c s >>= \(a, ms) -> -- We are strict in the state. We do as in Control.Monad.Trans.State.Strict (not .Lazy) let d = runStateT (fd a) in maybe (d s) (\s' -> liftM (second $ Just . fromMaybe s') $ d s') ms instance MonadTrans (StateT s) where lift = StateT . const . liftM (, Nothing) instance MonadIO m => MonadIO (StateT s m) where liftIO = lift . liftIO instance Monad m => MonadState s (StateT s m) where get = StateT $ return . (, Nothing) put = StateT . const . return . ((), ) . Just focus :: Monad m => Lens t s -> StateT s m a -> StateT t m a focus l (StateT smas) = StateT $ (\(st, s) -> liftM (second $ fmap st) $ smas s) . runStore . runLens l -- | functions st and ts should form a bijection since a StateT t with no changes will become a StateT s with no changes, no matter what st and ts are viewState :: Monad m => (s -> t, t -> s) -> StateT t m a -> StateT s m a viewState (st, ts) (StateT tf) = StateT $ liftM (second $ fmap ts) . tf . st -- Work on a part of the state, that may not exist for some inputs partialState :: Monad m => m a -> (s -> Maybe t, t -> s) -> StateT t m a -> StateT s m a --partialState d (smt, ts) (StateT tf) = get >>= \s -> maybe (lift d) ((>>= \(a, mt) -> maybe (return ()) (put . ts) mt >> return a) . lift . tf) $ smt s partialState d (smt, ts) t = viewState (\s -> maybe (Left s) Right $ smt s, either id ts) $ eitherState (lift d) t -- note that we use a view 's -> Either s t' -- Like partialState, but remembers which path was taken partialStateE :: Monad m => m a -> (s -> Maybe t, t -> s) -> StateT t m b -> StateT s m (Either a b) partialStateE d fs t = partialState (liftM Left d) fs (liftM Right t) eitherState :: Monad m => StateT s m a -> StateT t m a -> StateT (Either s t) m a eitherState (StateT sf) (StateT tf) = StateT $ either (liftM (second $ fmap Left) . sf) (liftM (second $ fmap Right) . tf) maybeState :: Monad m => m a -> StateT s m a -> StateT (Maybe s) m a maybeState n s = viewState (maybe (Left ()) Right, either (const Nothing) Just) $ eitherState (lift n) s toStandardState :: Monad m => StateT s m a -> Std.StateT s m a toStandardState (StateT f) = Std.StateT $ \s -> liftM (second $ fromMaybe s) $ f s mapStateT :: (m (a, Maybe s) -> n (b, Maybe s)) -> StateT s m a -> StateT s n b mapStateT f m = StateT $ f . runStateT m pairStateT :: Functor m => StateT s (StateT t m) a -> StateT (s, t) m a pairStateT (StateT sf) = StateT $ \(s, t) -> fmap (\((a, ms), mt) -> (a, combineMaybes s t ms mt)) $ runStateT (sf s) t where combineMaybes s t ms = maybe (fmap (, t) ms) (Just . (fromMaybe s ms,)) | http://hackage.haskell.org/package/cognimeta-utils-0.1.2/docs/src/Cgm-Control-Monad-State.html | CC-MAIN-2016-40 | refinedweb | 649 | 72.56 |
Aflați mai multe despre abonamentul Scribd
Descoperiți tot ce are Scribd de oferit, inclusiv cărți și cărți audio de la editori majori.
NAME OF WORK:
CONSTRUCTION OF SEWERAGE SYSTEM FOR SEWERAGE DISTRICT - III OF BHUBANESWAR CITY
2.12
Valves
2.12.1 General
Valves shall be suitable for use with the fluid being conveyed at the temperatures and pressures required for the application. Generally, pressure designation shall not be less than PN 1.0.valves shall have integral flanges drilled as specified in relevant latest IS specifications or BS: 4504. Flanges to other standards shall be used only if approved and provided that any differences do not affect mating dimensions. Back faces of flanges shall be machined. Sluice valves and butterfly valves shall be suitable for flow in either direction. Sluice valves shall comply with IS: 14846 or other relevant latest IS specifications, IS: 2685:1971, IS: 2906:1984
441
and IS specifications or BS: 5155/ WWA-C 504/1980. Reflux /check valves shall conform to IS: 5312 or BS: 5153.
Valves shall be suitable for frequent operation, and for infrequent operation after long periods of standing either open or closed. Rubber used in valves shall be ethylene propylene rubber (EPDM or EPM) or styrene butadiene rubber (SBR). It shall comply with the requirements of Appendix B of BS: 5155 or of latest I S specifications, be suitable for making a long term flexible seals, and be resistant to anything causing deterioration of the flexible seal. 2.12.2 Eccentric Plug Valve
Eccentric Plug Valves shall be of the tight closing, resilient faced, non-lubricating variety and shall be of eccentric design such that the valves pressure member (plug) rises off the body seat contact area immediately upon shaft rotation during the opening movement. Valves shall be drop-tight at the rated pressure (175 psi through 12", 150 psi 14" and above) and shall be satisfactory for applications involving throttling service as well as frequent or infrequent on-off service. The valve closing member should rotate approximately 90 degrees from the full-open to full-close position and vice-versa. The valve body shall be constructed of cast iron (semi-steel) conforming to ASTM A126, Class B. Body ends shall be:
1. Flanged with dimensions, facing, and drilling in full conformance with A-ANSI B16.1, Class 125. This includes flange thickness. 2. Mechanical joint to meet requirements of AWWA C111/ANSI A21.11. 3. Grooved ends to meet requirements of AWWA C606.
Eccentric plug valves shall have a rectangular or circular shaped port. Port areas for 3” – 20” valves shall be a minimum 80% of full pipe area.
Valve seat surface shall be welded-in overlay, cylindrically shaped of not less that 90% pure nickel. Seat area shall be raised, with raised areas completely covered with weld to insure proper seal contact. The machined seat area shall be a minimum of .125 thick and .500" wide.
The valve plug shall be constructed of cast iron (semi-steel) conforming to ASTM - A126, Class B. The plug shall have cylindrical seating surface that is offset from the center of the plug shafts. The plug shafts shall be integral. The entire plug shall be 100% encapsulated with Buna-N rubber in all valve sizes. The rubber compound shall be approximately 70 (Shore A) durometer hardness. The rubber to metal bond must withstand 75 lbs. pull under test procedure ASTM D - 429 - 73 Method B. Shaft bearings, upper and lower, shall be sleeve type metal bearings, centered; oil impregnated and permanently lubricated type 316 stainless steel conforming to ASTM A743 Grade CF-8M. Thrust bearings shall be Nylatron.
Plug valve shaft seals shall be on the multiple V-ring type (Chevron) and shall be adjustable. All packing shall be replaceable without removing the bonnet or actuator and while the valve is in service. Shaft seals shall be made of Buna-N.
Each valve shall be given a test against the seat at the full rated working pressure and a hydrostatic shell test at twice the rated working pressure. Certified copies of individual tests shall be submitted when requested. Certified copies of proof-of- design tests shall be submitted upon request. Manual valves shall have lever or worm gear type actuators with hand wheels, 2" square nuts, or chain wheels attached. Lever actuators shall be furnished on valves 8" and smaller where the maximum unseating pressure is 25 psig or less.
442
Worm gear type actuators shall be furnished on all 4" or larger valves where the maximum unseating pressure is 25 psig or more.
100% port eccentric plug valves shall be designed and/or tested to meet the following standards:
1. AWWA C517-05 Resilient-Seated Cast-Iron Eccentric Plug Valve.
2. ANSI flange drilling conforms to ANSI B16.1, Class 125 and ANSI B16.5, Class 150.
3. Mechanical-joint end connections conform to ANSI/AWWA C111/A21.11.
4. MSS-SP91 guidelines for manual operation of valves.
5. Metric 10 bar flange drilling conform to the NP 10 requirements ISO 2084, to the 10 bar requirements of BS: 4504
6. Metric 16 bar flange drilling conform to the NP 16 requirements of ISO 2084, to the 16 bar requirements of BS: 4504
7. British Table D flange drilling and Table E flange drilling conform to BS:
10.
2.12.3 Gate Valves (Sluice Valves)
The design, manufacture and construction features of sluice valves shall comply with IS 14846 or equivalent international standards. The valve shall be suitable for installation with the valves or spindle in any position. Valve flange shall be parallel to each other and flange face shall be right angle to valves center line. Backside of the valves flanges shall be machined or spot faced for proper seating of bolt head and nut. Sluice valves shall be double flanged rising stem type. The valves shall be provided with hand wheel. The valves shall be closed with clockwise rotation of the hand wheel. The direction of closing and opening shall be marked on the hand wheel. Valves of 350mm & above shall be provided with renewable shoe channel arrangement so that gate shall be guided throughout its travel. Valves up to 300mm shall be provided with manual wheel arrangement. Valves above 300mm & up to 500mm shall be provided with manual enclosed gear arrangement and above 600mm size shall be provided with electric actuator arrangement. All the valves shall be subjected to hydraulic test as per relevant code.
Martial of construction:
1. Body and wedge
-
CI as per IS 210 Gr FG-260
2. Spindle 19 Ni 9)
Stain less steel IS: 6603(04cr
3. Spindle nut
Bronze IS: 318 LTB-2
4. Body and seat ring
SS-316/CF-8M
5. Shoe and channel lining
SS-304
6. Fasteners
SS-304.
7. Bearing
SKG/FAG.
2.12.4 Non-return (Check) Valves
Non return Valve shall be of swing or Ball type. Swing Type Non Return Valve:- The design, manufacture & construction features of Non- return valves comply with IS 5312 I for single door type & IS-5312 II for multi door type or equivalent international standards. Non-return swing check valves shall be designed for rapid closing without slamming no later than the moment forward flow stops. The valve design shall be chosen to give the best performance possible. Taking in to
443
account of the system where valve is installed, the effect of any surge in the system as well as static & dynamic heads shall be included in the assessment. If self-closing without slamming cannot be achieved, external mechanism may be used to control the closure rate. Details of mechanism will be subjected to approval. Non return valve used in sludge system shall not be installed vertically positioned so that solids can settle against the valve flap when flap is closed. Direction of flow shall be clearly embossed on the valve body. Valves of size
600m & above shall be of multi door type. The materials of construction of different parts of swing type check valve shall be as follows.
1. Body & door
Cl conforming to IS 210 Gr FG260
2. Body rings
conforming to SS-316.
3. Door rings
4. Bearing bushes
Leaded tin bronze IS 318GrLTB-2.
5. Ball (if applicable)
To be covered with EPDM rubber.
6. Bolt & nuts
Test: The necessary tests shall be carried out as relevant code.
2.12.5 Butterfly Valves
All butterfly valves shall be of PN-1 rating manually operated having double- flanged sturdy valve body with face-to-face length & flange drilled (IS 1538) generally conforming to IS13095 requirement. The material of construction of various components shall be suitable for handling sewage.
Body, Disc and Disc Cover
Cast Iron- IS210 –Grade- FG 300 SG Iron SG 400/12 IS:1865
Disc Seal
EPDM rubber
Body Seat ring
Stainless steel- ASTM A-276, Grade AISI: 316
Split thrust ring
Bronze IS:318 LTB-2
Flanged bush bearing Stub shaft NDE
Bronze IS :318 LTB-2 Stainless Steel: 316
sleeve
SS-410
Dowel Pin
Stainless Steel: 316
Drive Shaft
Gasket
CAF IS: 2712
O ring
Nitrile rubber
Fasteners
Bearings
Gunmetal, BS1400, Grade: LG2
Seat leakage test: All valves shall be tested for leakage through the seat at 1.5 times the rated pressure. Hydrostatic body test: All valves are tested at 1.5 times the rated pressure for verifying the strength of the body and check for porosity in castings. Disc strength test at body test pressure. All valves shall have mechanical indicator arrangement for disc position indication and mechanical stops to limit over travel of disc. All valves shall be checked for correct mechanical operation, dimensions and finish.
2.12.6 Pressure-Relief Valves (PRV)
Pressure relief valves shall be designed to prevent the pressure in the pipeline upstream of the valve rising above present level. The valve shall remain closed at lower pressures. The pressure at which the valve opens shall be adjustable. A
444
pressure gauge shall be provided to indicate upstream pressure over the operating range of the valve. Safety valves shall comply with BS: 6759: part 1.
They shall be designed to open at the specified pressure and re-close and prevent further release of fluid after normal pressure has been restored. The pressure/temperature rating shall be in accordance with table PE-1 in BS: 1560:
Part 2. Shell materials shall be from the materials listed in table PE-1 BS: 1560:
part 2. Flanged ends shall be class 900, raised face type complying with ANSI B16.25 or Table PE-1 of BS: 1560. Butt-welded ends shall be in accordance with Section 8 of BS: 1868.
2.12.7 Ball Valves
Ball valves shall conform where applicable to BS:5159. Multi piece bodies shall be used where work on the ball and seats when installed may be needed. If valves need removal for servicing, one-piece bodies may be used. Seat materials shall be chosen for long life, with erosion and corrosion resistance. Ball supports shall be of the floating ball or trunnion type. If line pressure is too low to ensure a positive leak-free seal, built-in seat loading devices, or specially shaped seating’s shall be used to ensure sealing.
2.12.8 Knife Gate Valves
The valve shall meet requirements of MSS SP 81 Outer body shall be provided with inner liner in corrosion resistant stainless steel which shall extend in to the gland. The body shall be devoid of any wedge/dead pockets to avoid setting of suspended particles and solid in the service fluid. The gate /plate shall be precision buffed and the edge contoured to a knife edge. The gate move along /is guided by the seat ring to ensure that it scraps any deposit/scale enabling smooth uninterrupted movement. Seat shall be so designed that there is no recess /relieve groove to harbor deposition that could build up and swamp the valve. The design shall also in-corporate bosses that guide the gate and avoid deflection ensuring positive shut off. The stem shall have double start threads cut in order to ensure smooth and speedy operation. Gland packing shall offer minimum frictional resistance. As positive sealing element; the packing shall also include a resilient rubber ring. The knife edge and seat face in flow path shall be hard faced to a hardness of 400 to 450 BHN to counter erosion. In such cases, provision shall be made to ensure the fluid contact with seat ring is minimal.
The material of construction of valve shall be as follows.
Component
Material
y
IS .210 Gr FG-260/DI
lining e gate /plate
.
BS.970 Gr 316
BS.970 Gr 316.
ing/Boss
d
housing
.IS-210 Gr FG260
on impregnated with asbestos rubber
445
2.12.9 Fire Hydrant Valve
Supply, delivery and fixing brand new underground CI Fire Hydrant (sluice type) valve conforming to IS:909-1992 with 63.5 mm Instantaneous pattern single outlet fitted with bolts and nuts, CI loose cap fitted with wrought iron chain, tested to a pressure of 10 Kg/Cm2 and providing, fixing and jointing true to line, alignment and gradient suitable dia. CI double flanged sluice valve (IS:14846), DI D/F pipe, tail pieces, duck foot bend, connecting sleeves as per relevant IS.
The Fire hydrant valve shall be along with surface box. The material of construction of various components shall be as follows:
Valve Body /Bonnet
:Cast Iron- IS210 –Grade- FG 200
Valve
:GM IS-318
Valve seat
Spindle
: Brass IS :319
Spindle Nut
:
: GM IS-318
Retainer/ clamping ring
: MS 2062 GR .F e 410
Chain
: Galvanized MS
Spindle Cap/ Cap
: C.I IS-210
outlet
Gland
: G.I IS 1367/SS
446
2.14 Valve Operation
Shafts and caps for tee-key operated valves. Operating and extension shafts for valves operated by the tee key shall be caped. Extensions shafts shall be circular section. For valves installed in chambers, extension shafts shall be provided with split bearings, rigidly held on brackets spaced not more than 1500mm apart. For buried valves, the shaft shall be supported inside a protecting tube held on a purpose made support, which shall be fixed to top of the valve and provided with a shaft guide. Bearings and shafts shall be suitably protected against corrosion. Extension shaft couplings shall be provided with locking arrangements.
447
2.15
Manual Operating Mechanisms
Manual closing of valves shall be by the clockwise rotation of a tee key or hand wheel. Tee-key operated valves shall be provided with detachable cast iron shaft caps, with keys to match the cap. One key shall be supplied for every five valves installed, with a minimum requirement of two keys in any one size. Hand wheels shall be shaped to give a safe grip without sharp projections clearly marked with the direction of opening and closing and shall be fitted with integral locking devices. A padlock and chain will not be acceptable for locking. Manually operated valves and penstock shall be capable of being opened and closed by one person, when the specified max. Unbalanced pressure id applied to the valve or penstock. Under this condition the total force required at the rim of the hand wheel or at the tee key to open the valve or penstock from the closed position shall not exceed 30 kg (15 kg each hand).
Where necessary, gearing and bearings shall be provided and the hand wheel sized to fulfill this requirement. Gearboxes shall be totally enclosed oil bath lubricated. Thrust bearings shall be provided so that the gear case may be opened for inspection or be dismantled without releasing the stem thrust or taking the valve or penstock out of service. Oil and grease lubricated gearing, bearings and glands shall be protected against the ingress of dust and moisture. Operating mechanism shall be of the weatherproof type and those parts subject to submergence shall have a degree of protection IP68 to BS: 5490 at a depth of submergence of 5m. Where practicable, operating mechanisms shall be fitted with mechanical position indicators clearly visible from the operating position. Headstocks of the non rising shaft type shall each have an index pointer working over a graduated, open-to-closed position indicator fixed to the side of the pillar.
2.16 Electric Actuators
Electric actuators shall operate valves and penstocks at opening and closing rates that will not impose unacceptable surge pressures on the pipe work. Actuators shall be rated at not less than 20 percent in excess of the power required to operate the valve or penstock under maximum working conditions. Actuator enclosures shall have a minimum protection IPW 65 to BS: EN 60529. Actuator electric motors shall permit the successive full travel operation of the travel from open to closed and vice versa but shall not be less than 15 minutes. For modulating type actuators the motor shall have a duty-type rating (DTR) to meet the varying cyclic load requirements of the valve. Electric motors shall be provided with built-in thermal protection complying with BS: 4999 Part 111. Actuators shall be complete with:
1. An alternative system for manual hand wheel and reduction gear operation which shall be lockable.
2. An interlock, to prevent engagement of the hand wheel whilst the actuator is being power drive and to disengage the manual drive positively when the power drive is started.
3. Reserving type motor starter complete with isolating switch.
4. Local and remote control selector switch when specified, which shall be lockable.
5. Open, stop and close push-buttons.
6. Potentiometer for remote valve position indication when remote control is specified.
7. Torque switches for mechanical disengagement of the drive at the extremes of valve operation to limit excess torque.
448
8.
Supply failure and remote control available monitoring relays. The supply failure relay shall operate under single phasing relays as necessary.
9. Auxiliary and interposing relay as necessary.
10. Voltage-free changeover type contacts for the remote indication of
11. Motor tripped on overload
12. Fully open
13. Fully closed
14. Operating
15. Supply failed
16. Remote control available
The rating of volt-free contacts shall be not less than 15A at 240 V A.C and 2 A at 50 D.C unless otherwise specified. The contacts shall be suitable for inductive load switching. Anti-condensation heater: Separate or segregated terminal boxes shall be provided for the connection motor, heater and control cables.
2.17 Valve Packaging and Installation
The Contractor shall provide all equipment needed to handle and install valves and associated equipment without damage to any coatings. The equipment shall include lifting beams, reinforced canvas slings, protective padding, cradles and the like. Wire rope or chain slings shall not be used for handling these items. Temporary packing, coverings or crates provided for protection in transit shall not be removed (except for inspection purposes after which they shall be replaced) until immediately before installation.
2.17.1 Marking and Packing
Each valve shall be indelibly marked with the diameter pressures rating and shall carry a unique reference number to enable each item to be clearly identified with works fabrication records; works test certificates, delivery notes and the like.
Wherever possible, the identification marks shall be painted on the outside of the item but where there is not enough smooth surface area for the identification marks they shall be put on rust proofed metal tags secured to the item with gal vanished wire or chain (not through flange holes). Valves shall be packed in the ‘closed’ position except that uncrated resilient seat gate valves for transport to tropical areas shall be in the ‘open’ position.
2.17.2 Valve Installation
Valves shall be installed and commissioned in accordance with the manufacturer’s instructions. After installation, valves shall be cleaned, gates, discs, seats and other moving parts closely inspected, foreign matter removed, and the valves checked for ease of operation. Moving parts shall be lightly greased or otherwise treated in accordance with the manufacturer’s recommendations.
Unless otherwise specified or directed by the Engineer, butterfly valves shall be enclosed in chambers, installed with the shaft horizontal, and supported as detailed on the drawings. They shall be installed so that when the valve is opening the lower portion of the disc moves in the direction of the main or normal flow. Unless shown otherwise on the drawings, gates valves shall be installed with their shafts vertical.
Gate valves without external gearing, and not otherwise required to be in a
449
chamber, may be buried. The buried part of the valve shall be protected as specified. Unless otherwise specified, backfilling shall be to just below the top of the valve or shaft shroud, and a surface box shall be provided. Jointing, sleeving, external wrapping, anchor and thrust blocks, valve chambers, valve marker posts and the cleaning and disinfections of valves shall be executed as specified for the associated pipeline.
450
Mult mai mult decât documente.
Descoperiți tot ce are Scribd de oferit, inclusiv cărți și cărți audio de la editori majori.Anulați oricând. | https://ro.scribd.com/document/352441133/07-Valves-Operation | CC-MAIN-2020-29 | refinedweb | 3,510 | 63.9 |
12 December 2007 16:39 [Source: ICIS news]
LONDON (ICIS news)--Uralkali’s profits and sales are expected to rise as increased demand for crops lifts the need for fertilizers Citigroup analysts said in a report released to the media on Wednesday.
?xml:namespace>
“A growing global population, a need for increased crop yields, changing dietary trends in ?xml:namespace>
This will increase demand for the global potash producer, which already intends to grow production by 12% until 2010 through debottlenecks at current plants, it said.
Through BPC, its 50/50 joint venture with Belaruskali, Uralkali controls 34% of the global market for exported potash while its joint venture Canpotex controls another 23% of the market, the report added.
Citigroup estimates that Uralkali’s earning before interest and tax in 2009 will be nearly double its estimated EBIT in 2007 at $849m (€577m) while estimated net sales are expected to increase 54% to $1.7bn.
Uralkali shares were trading up -3.81% at $28.95 on Wednesday. Citigroup has a target share price of $36.00.
( | http://www.icis.com/Articles/2007/12/12/9086386/uralkali-profit-and-revenue-set-to-rise-analyst.html | CC-MAIN-2015-18 | refinedweb | 176 | 52.9 |
setgid()
Set the real, effective and saved group IDs
Synopsis:
#include <unistd.h> int setgid( gid_t gid );
Since:
BlackBerry 10.0.0
Arguments:
- gid
- The group ID that you want to use for the process.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The setgid() function lets the calling process set the real, effective and saved group IDs, based on the following:
- If the process has the PROCMGR_AID_SETGID ability enabled (see procmgr_ability()), the setgid() function sets the real group ID, effective group ID and saved group ID to gid.
- If the process doesn't have the PROCMGR_AID_SETGID ability enabled, but gid is equal to the real group ID, setgid() sets the effective group ID to gid; the real and saved group IDs aren't changed.
This function doesn't change any supplementary group IDs of the calling process.
If you wish to change only the effective group ID, you should consider using the setegid() function.
Errors:
- EINVAL
- The value of gid is invalid.
- EPERM
- The process doesn't have the PROCMGR_AID_SETGID ability enabled, and gid doesn't match the real group ID.
Examples:
#include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <stdlib.h> int main( void ) { gid_t ogid; ogid = getgid(); if( setgid( 2 ) == -1 ) { perror( "setgid" ); return EXIT_FAILURE; } printf( "group id is now 2, was %d\n", ogid ); return EXIT_SUCCESS; }
Classification:
Last modified: 2014-06-24
Got questions about leaving a comment? Get answers from our Disqus FAQ.comments powered by Disqus | http://developer.blackberry.com/native/reference/core/com.qnx.doc.neutrino.lib_ref/topic/s/setgid.html | CC-MAIN-2015-18 | refinedweb | 258 | 66.33 |
Return to namespace (thing)
Also, the 3rd edition of The C++ Programming Language introduces the
separate concept of namespace
as a keyword in its own right, which allows the programmer to assign an
identifier or group of identifiers to a namespace. This helps reduce global namespace pollution which the linker hates so much, especially when
there is a collision. Namespaces use the same
qualification syntax as classes , but the two are not interchangeable.
Namespaces are simpler, in that they only do encapsulation. Stroustrup
says1 they are better than classes when you
need namespace encapsulation, but don't
need type checking and object overhead provided by a class.
In C++ (post 1997), all of the libraries have their own namespaces.
The standard library lives in std:: of course. The standard C libraries are also
in the std:: namespace.
The using keyword allows you to alias an identifier into the current
scope; otherwise the namespace must be qualified for each use.
Single identifiers from a namespace can be imported this way, or the entire
namespace can be imported. If imported namespaces have overlapping
symbols, they must be resolved at compile time, rather than link time, and thus
symbol collision errors are caught sooner. The using keyword can clarify which
namespace's function is used, if the results are not as desired.
Note well that if you just import all the namespaces, you will be back where
you started, with the compiler complaining about ambiguous duplicate functions.
Unlike classes, namespaces are "open". The same namespace can be mentioned
in different places, adding symbols to it in each place.
Namespaces don't have to be named, just like enums don't have to be named.
The effect of an unnamed namespace is that the symbols in the namespace
will not be exported
out of this compilation unit. Global static has nearly the same effect in C,
but is depreciated in C++ in favor of namespaces. Global statics are mostly
to prevent name collisions between modules--and namespaces do this better.
Stroustrup2
also recommends giving namespaces long names that include version
numbers and full library names, and then using the namespace aliasing mechanism
to alias back to a short name that is more manageable. This way,
you can change which library you are using just by changing the namespace alias.
If a function is not found in the current namespace (and hasn't been imported
from another namespace), the compiler will search the namespaces of the
argument types to that function in hopes of finding a matching prototype.
Like many other resolution issues, this could seem magical.
For complex examples, check out a book. These examples should be enough to
help figure out syntax, though.
namespace MyStuff {
int f();
} // look, ma, no semicolon
namespace m=MyStuff; // namespace alias
void g() { m::f(); } // must be qualified
namespace MyStuff { // extend it; must use original name, not alias.
int ff();
}
using m::f; // import f into current namespace
void h() { f(); } // qualification no longer needed
int MyStuff::f() // define the function in the namespace
{
return ff(); // this doesn't need qualification to use m::ff
}
using namespace m; // drag in the rest of MyStuff too
void k() { ff(); }
Note that MyStuff could have been used in place of m above
except (obviously) in the alias statement. The alias name can't be used
to add to the namespace, so m could not be used there.
Stroustrup hints that it might be a good idea to put everything except main()
into appropriate namespaces. Certainly this would make resolving unintentional
symbol collisions a lot easier at link time.
For more examples, see using.
Sources:
1 Bjarne Stroustrup: The C++ Programming Language, 3rd edition, section 8.2.7
2 ibid. appendix C.10.3
Rigorous testing of many flawed examples using gnu g++ | http://everything2.com/user/ssd/writeups/namespace?displaytype=linkview | CC-MAIN-2013-48 | refinedweb | 632 | 61.56 |
Re: [Flashcoders] E4X: reading CDATA
If you are getting ![CDATA[ values from using e4x you have html encoded tags. like this: l t ; and $ g t; Open the xml file with notepad and you will see. The text in CDATA should act as a normal text node. HTH/Christoffer Mendelsohn, Michael skrev 2011-06-20 16:35: Hi list... I've searched
Re: [Flashcoders] PureMVC vs Cairngorm // who's better?
PureMVC artur skrev 2008-04-11 21:08: whats the verdict for using one over the other -- for a Flex+AMFphp RIA. thanks ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com
Re: [Flashcoders] Automatic quality toggle
It sounds like it's time to encode the flash animation to video. /Christoffer ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com
Re: [Flashcoders] Embedded Fonts: Works in CS4, Fails in CS5?
I don't know about cs5, but this thing got me a day ago when I needed to use stysheets and fonts, I had to add fontFamily in the embed tag aswell for the font to show. [Embed(arial.ttf, fontName=_Arial, fontFamily=_Arial, mimeType='application/x-font')] HTH/Christoffer Bill S. skrev: One
[Flashcoders] SquishFilter 0.1 Released!
Check out my new filter, the SquishFilter, free for non commersial use: In this demo I’ve animated a wooden box in the timeline. In as3 I added the Pixel Bender filter (that I wrote) in the filters array of the animation. The filter is making the movieclip bulge
[Flashcoders] Preventing duplicate values in string constants (PureMVC)
duplicate an old existing string constant. This is a problem, if I forget to change the value of the duplicated constant, there will be two constants with the same value, leading to unexpected behaviors that are hard to debug. /Christoffer Enedahl
Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?
Piers Cowburn skrev: That way, if I forget to remove the event listener in a destroy method or whatever, it should still end up eligible for GC. Cases where the event doesn't fire because a weak reference was used only happen if there are no strong references anywhere else, so the object
Re: [Flashcoders] AS3 Papervision Question
That site is not using papervision, it's using prerendered clips, which is used celeverly with rotation. I havn't tried using a viewpoint as a material, but I think it should work, performance might be an issue though. /Christoffer Omar Fouad skrev: Hi all, I am wondering if I can create a
Re: [Flashcoders] Getting attributes out of a node with : in it
when you refer to the node write it like this: yweather::condition with double colons HTH/Christoffer Robert Leisle skrev: Check out the Namespace class, as it applies to XML, in the Flash docs. There's also a good explanation in this tutorial by Lee Brimelow:
Re: [Flashcoders] Re: showing code progress with progress bar
You'll have to make your own threading code. ie this var processCursor = 0; var processLength = 1; //example who many lines to parse function onEnterFrame(){ if( processCursor processLength){ processLittlePiece(); updateProgressBar(); }else{ //go to complete
Re: [Flashcoders] back in job hell
If I were you I'd be pissed and ask for half my money now and a written contract with a spec, timeframe and milestones. If it doesn't come Id stop developing for that company on the grounds that the contractor has changed the oral contracts premesis. About asking for cleaning up the code it's
Re: [Flashcoders] I am stuck
Hmm... I guess it could work. Here is how I see it. Why would you do this outside of flash? Cons: The user must have javascript enabled (Often not a problem) The remote data must reside on the html server (sort of) Data source can be detected by viewing source Pros: You already have coded
Re: [Flashcoders] Making dynamic text look the same as static text
You need to embed the font. Google it Alan Neilsen skrev: I have found that when I call text into a dynamic text field from a variable, it does not look the same as the text in a static text field set with the same font, size, etc. The text in the dynamic text field appears with no
Re: [Flashcoders] Debugger Text Field
I do something like this, It can be optimized, Im moving all logs every time when you can have something like a ringbuffer instead: private var _log:Array = new Array(20); public function log(t:*) { for (var i:int = 0; i _log.length-1; i++) {
Re: [Flashcoders] Passing params via url instead of FlashVars
I can't remember where I picked this up but this is a class that handles querystrings in as3: usage: var qs:QueryString = new QueryString(); trace( qs.parameters.id ); HTH Christoffer package your.namespace.here { import flash.external.*; import flash.utils.*; /** * Access the
Re: [Flashcoders] OT: Questions to ask an interviewee
I've done some recruting and what surpised me was why some ppl even applied to the job when they clearly did not know how to code. One part of the questions was a small verbal programming test, I wrote a few questions about programming, ie, whats wrong with this syntax, how would you access
Re: [Flashcoders] Buffer flv from midpoint?
You need to have a flv streaming service running on a server. Ie Flash Media Server. This is an open source alternative:. I have not tried it. /Christoffer Ali Drongo skrev: Cheers Paul. that's a help. I've just realised that youtube's video player will buffer your
Re: [Flashcoders] variable in e4x filtering
Try this: var nodeName:String = agency; _officesXML.[ nodeName ].(@name == NJ Agency) HTH Christoffer Pavel Kru*ek skrev: Hi List, please is possible to substitute node name in e4x with variable? Anywhere in XML: agency name=NJ Agency namemyAgency/name phone123456/phone /agency
Re: [Flashcoders] variable in e4x filtering
oh sorry, email code. it got a dot too much, here this works: _officesXML[ nodeName ].(@name == NJ Agency) Pavel Kru*šek skrev: Hi, Unfortunately this solution is out of action: 1084: Syntax error: expecting identifier before leftbracket. On Jul 9, 2008, at 3:50 PM, Christoffer Enedahl
Re: [Flashcoders] Why do you compile with the Flash IDE?
Glen Pike skrev: Because I needed to produce a projector and I could not work out how to get Flex to do that - don't want an AIR app, just an exe. Open the swf file in flash player, File Create projector /Christoffer ___ Flashcoders mailing list
Re: [Flashcoders] Why isn't my TextField multiline? AS2
Try \n or \r\n HTH/Christoffer Alistair Colling skrev: Thanks guys :) works perfectly. Now it seems my line returns (\r) aren't being recognised (they show up in the textfield). Anyone got any ideas whats going on? Cheers On 7 May 2008, at 18:19, Robert Leisle wrote: Hi Alistair, Try
Re: [Flashcoders] Need Help from Techies
I would hide one layer at a time until you find out which layer it is in. Then hide all other layers and unlock the layer with the placeholder. Select and delete them. If they are within a movieclip, doubleclick them until you can delete them. You might need to unlock more layers.
[Flashcoders] New game: Exxon - The decontaminator
This weekend I participated in ludum dare 48h, A bi-annual 48 hour solo game development competition. In the contest you are given a theme and you have to make a game of that theme from scratch in 48 hours. You must make all content yourself. I made a 2d topdown boat game in as3. Including
Re: [Flashcoders] New game: Exxon - The decontaminator
to work out the concept and add some features here and there On Wed, Apr 23, 2008 at 11:04 AM, Christoffer Enedahl [EMAIL PROTECTED] wrote: This weekend I participated in ludum dare 48h, A bi-annual 48 hour solo game development competition. In the contest you are given a theme and you have
Re: [Flashcoders] better logic statement
Untested email code. But you get the gits of it, I hope // properties var ThumbnailSetSize = 10; var i = 0; var page = 0; /// on next image i++; if (i == ThumbnailSetSize ){ page++; i=0; //Do something } id = (page*ThumbnailSetSize ) + i; HTH/Christoffer natalia Vikhtinskaya skrev: | https://www.mail-archive.com/search?l=flashcoders%40chattyfig.figleaf.com&q=from:%22Christoffer+Enedahl%22&o=newest | CC-MAIN-2021-25 | refinedweb | 1,379 | 68.6 |
Thanks for additional suggestion, Sleiman.
On Thu, Feb 19, 2015 at 12:32 PM, Sleiman Jneidi <jneidi.sleiman@gmail.com>
wrote:
> makes sense. Cheers
>
> On Thu, Feb 19, 2015 at 8:30 PM, Sean Busbey <busbey@cloudera.com> wrote:
>
> > On Thu, Feb 19, 2015 at 2:20 PM, Sleiman Jneidi <
> jneidi.sleiman@gmail.com>
> > wrote:
> >
> > > I usually have a class called BaseTest that every test class extends
> and
> > I
> > > configure me logging there.
> > >
> > >
> > > public class BaseTest {
> > >
> > > @BeforeClass
> > > public static void init(){
> > > BasicConfigurator.configure();
> > > org.apache.log4j.Logger.getRootLogger().setLevel(Level.ERROR);
> > > }
> > > }
> > >
> > >
> > While this works, it's considered an anti-pattern because it becomes
> > difficult to tune log levels for particular components when you need to
> > debug. (or to try out other appenders, etc)
> >
> > --
> > Sean
> >
>
--
Thanks & Regards,
Anil Gupta | http://mail-archives.apache.org/mod_mbox/hbase-user/201502.mbox/%3CCAF1+Vs9F0f07Lo6vi5+dNJEEEcYk0=A5JAPnc-q72S5oZGgQjw@mail.gmail.com%3E | CC-MAIN-2018-09 | refinedweb | 128 | 50.94 |
nghttp2_submit_settings¶
Synopsis¶
#include <nghttp2/nghttp2.h>
- int
nghttp2_submit_settings(nghttp2_session *session, uint8_t flags, const nghttp2_settings_entry *iv, size_t niv)¶
Stores local settings and submits SETTINGS frame. The iv is the pointer to the array of
nghttp2_settings_entry. The niv indicates the number of
nghttp2_settings_entry.
The flags is currently ignored and should be
nghttp2_flag.NGHTTP2_FLAG_NONE.
This function does not take ownership of the iv. This function copies all the elements in the iv.
While updating individual stream's local window size, if the window size becomes strictly larger than NGHTTP2_MAX_WINDOW_SIZE, RST_STREAM is issued against such a stream.
SETTINGS with
nghttp2_flag.NGHTTP2_FLAG_ACKis automatically submitted by the library and application could not send it at its will.
This function returns 0 if it succeeds, or one of the following negative error codes:
nghttp2_error.NGHTTP2_ERR_INVALID_ARGUMENT
The iv contains invalid value (e.g., initial window size strictly greater than (1 << 31) - 1.
nghttp2_error.NGHTTP2_ERR_NOMEM
Out of memory. | https://nghttp2.org/documentation/nghttp2_submit_settings.html | CC-MAIN-2021-25 | refinedweb | 149 | 61.33 |
C/C++ for Hackers: Part 10 (System Commands)
welcome back, fellow hackers! finally, i am releasing part 10 in my series on C++. this will surprisingly be a short article. in this part of my series, we will be looking how to execute system commands!
but first, a disclaimer:
I AM NOT RESPONSIBLE FOR ANY DAMAGE THAT YOU DO TO EITHER YOUR OWN COMPUTER OR SOMEONE ELSE'S! This post is for educational purposes only! do any of the following outside your lab AT YOUR OWN RISK!
so, let's get started!
Why Is Executing System Commands Useful?
on windows, it isn't as useful. but in Unix based systems where the terminal still rules, executing system commands in a virus is vital. we could for example make our virus update itself using the wget command in linux distros. or make a fork bomb and execute it, to make the target system crash after some time (viruses that do this are known as logic bombs.) or do permanent damage using the dd command. the possibilities are almost endless! one thing we can't do unfortunately is make the virus switch directories.
Step 1: Fire Up Ubuntu and Codeblocks
our first step is to fire up Ubuntu and our newly installed IDE called codeblocks. i am on a holiday when i wrote this and i only have my windows laptop., so i will use codeblocks for windows, but the code i am going to write should be the same for you. but for my tutorial, i will execute the "ipconfig" command on windows as a demonstration. you can use the "ifconfig" instead if you want, or any other command.
the function we are going to use is the "system()" function, located in the stdlib.h library. the system function take a string as a parameter. that string is the command we want to execute. so if we for example want to execute the "ifconfig" command, we would type our function as followed:
system("ifconfig");
Step 2: Copy/Paste the Code in Codeblocks and Compile
i already wrote an example, it is located here.
but before we can go and compile our code, we first need to make a project. a project is a way for CodeBlocks to order your code. to make a project, simply open codeblocks, and on the top left, go to file -> new -> project. a popup wizard will open like below:
we will select a console application so we can view the output of our command. so select it, then click "go". then you will be prompted with a welcoming screen. then click next. then you will be asked to choose either C or C++. we will select C++. then you will be asked to name your project and where to save it. you can name it whatever you want, but make sure to use a underscore instead of a space! (this is to avoid problems with the debugger). for example: Phoenix750-Tutorials.
as for where to save it, if you read part 9 of my series, you know we made a folder where we can save our projects, so you should save your new project there. if everything is set up, click next.
then you will see advanced options. leave these at their defaults and just click finished.
congratulations, you just made a new project! but how do you access the main.cpp file? on your left, you will see what is known as your "workspace". there you will also see the name of your project. click on the + symbol, and a folder will appear called "sources" then click on + before sources, and you will see your main.cpp file! to open it, just double click it. but it should be open by default though.
then you can just copy/paste my code and compile/run it in debugging mode. to do the latter, just navigate to the upper bar and click on the gear with the "play" symbol. (sorry for my poor paint skills :P)
and then, you will see the output of the ifconfig command or in my case, the windows ipconfig command!
Conclusion
executing system commands is crucial for computer viruses, especially in Unix based systems. remember that system() can execute any system command, even destructive ones (especially if you have root permission!), so be creative! but be aware of the disclaimer!
also, if you want to know some destructive commands check out This list.
in the next few tutorials, we will start making small viruses that utilize the system() function. so cya then!
-Phoenix750
52 Comments
What I think is that as this is more about hacking... you should assume that the user knows c++... so maybe u shud first post how to use c++ to develop malware or whatever.. and then post how to learn c++..
But ur tutorials are goooood but real slow... it will take months to reach the point where we start building malware ... so maybe u cud start on the tuts to make malware?? Im reaaly lookin forward to that ...
But anyway thank u and really goood work bro
I personally don't know C++ that well, just C. I find these tutorials very interesting, and Phoenix750's content is great. You need a base for a skyscraper; without it, it won't stand. ;)
this is the starting point to make malware. like i said, almost all malware uses the system() function. i was actually planning to make a file extractor for the next tutorial, which is malware on it's own already.
i just wanted to fly over the basics of C++, i wasn't planning to teach everything because like you said, that would take months. but like i said, i'm going to try to write a virus that uploads a specific folder to a server using the Unix scp command.
-Phoenix750
I'm so happy to see this.
When i write C++ program on windows system.
I always add this line at the end: system("pause");
That can't stop it gone so fast.
I learn c plus plus for six months.
But sometimes i can't focus on it.
I think i need more practice and try.
Thank you,Phoenix750 for teaching and sharing.
Hope you have a nice day.
------------------------------------DAGONCHU.
I don't know if you know how, but could you make a short series on using Devkit PPC for WiiBrew? It would be much appreciated. :)
i will have a look at it. but it might take some time.
-Phoenix750
Nice post :D
Looking forward to part 11 :D
i'm a little stuck because i bricked my Ubuntu installation, but i will be up and running in no time again!
-Phoenix750
Yep, I'm always right here waiting for you :D
In part 9, you wrote that will be create a virus to deactivate windows.
I think it will be this code:
system("slmgr -upk");
Is that right?
the code is system("C:\Windows\System32\slmgr.vbs /rearm");
the reason we defined the full path is because the exectutable probably won't be started in the system32 directory.
but there is more to that, because we also need to hide the command prompt window that starts automatically, so the victim won't suspect anything.
-Phoenix750
I think we can use this code:
system("C:\Windows\System32\slmgr.vbs /rearm");
I still do not know why "\" doesnt work in windows environment, i use "/", it run...
Or this code:
system("%windir%/system32/slmgr.vbs /rearm")
Because some people do not install windows on C:\ and we use "%windir%" to auto-detect.
And if we use back slash "\" i think we will use double back slash "\\" for directories. For example: ""C:\\Windows\\System32\\"
you are right. i can't believe i overlooked that...
-Phoenix750
Great tutorial phoenix!
btw, im getting a new laptop, and im setuping my lap, so i am thinking of using one of those:
Which one do you think is the best ?
Thanks in advance.
If you want to use a pentesting distro as a main OS, go with Parrot. Kali isn't really that secure as a daily-use distro. If you don't necessarily want a pen-testing distro as main OS, you should defenitely go with Ubuntu.
-Phoenix750
I read that parrot isn't as stable as kali, and it has many bugs, and update issues, so I doubt it's good as main os!
But, it's way prettier! Can I know what do you personally use ?
Well, I can't speak for Phoenix750, but personally, I use WeakNet Linux 6. It's extremely secure if you know how to use it, and It's based on Debian Jessie, so updates are no problem at all. Lastly, and more importantly, it really looks amazing.
Ninja243
Oh yeah I noticed something if you plan on becoming a professional C++ programmer i suggest not using Namespaces its a good habit to pick up.
why? I do not know this :D
Bara Adnan:
Where did you hear Parrot has a lot of issues? Kali 2.0 has A LOT MORE issues than Parrot atm.
I personally use Parrot. I think it's a great everyday OS for a hacker. And that isn't just judging by it's looks. Tbh, I've never ran into a problem with ParrotSec as a main OS yet.
-Phoenix750
On cybrary!
can i know how you judged about parrot security ? How do you make sure about that it,s security is better than kali's one ?
also, i think offensive security is working on those bugs!
i currently use kali as vm, and i'mm not satisfied, it,s a bit laggy with 4 gb ram!
i prefer kali because i want to take the oscp and the others and they are based on kali os!
Don,t you think that parrot is in its early stage, and we should wait?
Also, did you try parrot on ssd?
And what about cyborg hawk ?
and do you do u use ubuntu as vm in parrot?
Also, why your c tuts arnt on parrot?
sorry for the many questions !
thanks in advance.
1.) even if OffSec is working on those bugs, they are doing a terrible job at it.
2.) Parrot and Kali are both based on Debian. At it's core, where it's security lays, they are somewhat the same.
3.) If you want to take the oscp, use a Kali VM specifically for that.
4.) Parrot has mostly outgrown it's development stage by now, but like with everything, there is still work on it.
5.) I have Parrot dual partitioned on my SSD with Windows 10
6.) Never tried Cyborg Hawk
7.) I use Ubuntu as a VM on my Win10. I might migrate it to Parrot though.
8.) I write my C/C++ series on Ubuntu because Ubuntu is better for coding/developing than either Parrot or Kali
-Phoenix750
Thank you Phoenix!
Very good information :)
I will tell you my decision when I make it.
So you are saying kali's security is the same as parrot security, then why did you say "Kali isn't really that secure as a daily-use distro" ? and advised me to go with parrot if they have the same security ?!
Also, is it gonna be a trouble following kali based null byte tuts on parrot ?!
Thank you !
That's because the way they are configured. Kali always uses the root user by default, Parrot has a seperate, non-root account that is used by default, unlike Kali, which uses a root account by default. Basically, anything you run on Kali is runned with root permissions by default. This isn't the case with Parrot.
This doesn't really make Kali bad, because Kali wasn't really ment to be used as a main distro, but rather as a live USB/CD.
-Phoenix750
But I can easily make a non root user in kali, and this problem would be solved !
Then the problem would be solved, yes. But i've had quite a lot of trouble with non-root users in Kali for some reason.
-Phoenix750
Hmmm, I think I'm gonna go with parrot!
I wish I like it. Also, I'm thinking of using it with oscp.
Bara:
First, not everything you read on the web is true.
Second, if you want to follow the tutorials here on Null Byte, use Kali as that is what we are using.
OTW, can you please give me your opinion about Phoenix's last reply ?
I have 100% confidence in Phoenix. Enough said.
Awesome, thank you!
But don't you think there will be no big difference between kali and parrot ?
Maybe just file places, but same commands i think!
at all, i will take your advice very seriously. thank you.
There are minor differences, but they are pretty significant when following the tutorials on here. Most tools/commands are the same, but the file locations differ mostly.
-Phoenix750
Thank you!
Do you personally find it hard to follow null byte tuts on parrot ?
Not really, but that is probably because I'm used to Parrot.
-Phoenix750
I too feel like the tutorials are going a bit too slow. Maybe you should take a little longer to make one well detailed post that includes more information instead of having short posts with little information. That way you can get the basics across for everyone and get started on the fun stuff everyone here wants to learn.
Also, are you planning on posting more tutorials?
I would love to contribute to this. I've been programming in C++ for about 4 years. I've never tried writing any malware but will soon be taking a course about writing malware at my University. However, it is in Python so I might cover Python while you cover C++...
I clearly stated a few times that this series is hibernated for now.
-Phoenix750
Can u plz continue this series....
I don't have the time at the moment. But I promise, I will continue them later!
You can always read DontTrustMe's articles on C.
-Phoenix750
system is a void, so you cant go std::string = system('whoami'). Is there any way to get stdout and stderr? I understand you are busy, any links would be appreciated.
where is the part 11 ?? :/
Read the comments above.
-Phoenix750
Firstly, thanks for an amazing series. I've got a question about some code I'm trying to run. I've found a command for a reverse shell on this site (thanks to Cameron Glass's article on a reverse shell / backdoor for OSX). I'm trying to run this:
-- Begin Code --
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(){
system("bash -i >& /dev/tcp/127.0.0.1/9001 0>&1");
return 0;
}
-- End Code --
But I get this error when I try to run it:
-- Begin Error --
sh: 1: Syntax error: Bad fd number
-- End Error --
Any ideas?
Ninja243
Edit: I'd like to mention that the code compiles and that I was running this program which was called "backdoor.out"
Did you test it on an OSX or Linux system?
-Phoenix750
This is an issue with your shell command, not the program itself.
Exactly what I was thinking.
-Phoenix750
Yeah, I was running it on WeakNet Linux 6 (revision 12), which is based on Debian 7. The shell command works outside of the script, which is why I'm confused.
Thanks for the help so far
Ninja243
You have to use bash in order to use /dev/tcp/.../. Either change the link on /bin/sh or look for specific instructions for your distribution.
It looks like, if you run bash inside a dash session you do not have access to /dev/tcp/.... As system(cmd) is actually runing /bin/sh -c cmd, your C code does not work.
Hope this helps
It does, thanks for the help
Ninja243
how do we get to next stage part 11?
Share Your Thoughts | https://null-byte.wonderhowto.com/how-to/c-c-for-hackers-part-10-system-commands-0162900/ | CC-MAIN-2017-26 | refinedweb | 2,685 | 84.27 |
- Stackato
- Get Stackato
- Why a Private PaaS?
- Features & Benefits
- Stackato by Language
- Compare Editions
- Events
- Partners
- Resources
- Stackato & Cloud Foundry
- Developer Tools
- Languages
- Support
- Forums
- Resources
- Stackato Training
- Professional Services
- Commercial Support
- FAQs
- Code Recipes
Daniil Kulchenko, November 17, 2011
>>IMAGE.
Each of your apps running with Stackato gets its own partitioned space on your server. What does this mean? From the perspective of your web app, all that is visible of the server is your app's files and processes, and nothing else. The apps can't access other apps running on the same server; can't tamper with your server's configuration; can't mess with hardware, install rogue software, stop other processes, or hack your mail server to send spam to your colleagues (or worse, users!). You get the picture. Stackato ensures that each app has access to everything it needs to operate, and nothing else. Naturally, this means that if someone does manage to hack your app, they won't get far.
At the same time, the LXC infrastructure ensures that all of your apps get a fair share of CPU, and that no one app can grab the entire processor for itself. Also, to prevent an app from going rogue and taking up all of your server's RAM, the Stackato client allows you to set a RAM allocation per-app, ensuring that your server (and your other apps) stay running even if one app is misconfigured. Stackato uses LXC to ensure that no app will go over the RAM limit you set.
(If you're interested in the low-level details of how LXC allows you to keep tight control over your apps, I recommend our article exploring the technical side of setting up LXC, specifically the "Setting resource limits" section.)
Deploy your apps with Stackato and rest easy knowing that your servers and apps are protected from both malicious activity as well as accidental resource-hogging bugs that would otherwise cripple your servers and potentially cause costly downtime and user frustration.
Share this post:
2 comments for Security in the cloud with Stackato and LXC
Submitted by Anonymous (not verified) on Fri, 2012-06-22 14:08.
Permalink:
For further information and some mitigating tactics, see::
'echo b > /proc/sysrq-trigger'.
For further information and some mitigating tactics, see:...
Submitted by Anonymous (not verified) on Fri, 2012-06-22 14:40.
Permalink
Hi Anon,
You raise a good point, and that's exactly why Stackato has configurable root access within containers, which you can enable/disable on a per-user or per-group basis. Up until recently, root within LXC still had inadequate restrictions in a few specific cases, so it's important to only grant root access to those who you trust. For this reason, root is disabled with Stackato apps by default. If you require root access, an administrator can enable sudo by simply running "stackato limits --sudo true" or by flipping the switch in the Management Console in the Users or Groups view.
The next release of Stackato will ship with Ubuntu 12.04 LTS, which has plugged most root-related security concerns surrounding LXC, and user namespace partitioning has greatly improved. Your /proc/sysrq-trigger example has been fixed in 12.04. We're enabling AppArmor within all containers as well, providing aggressive control and auditing to ensure your host servers remain secure.
| http://www.activestate.com/blog/2011/11/security-cloud-stackato-and-lxc | CC-MAIN-2015-14 | refinedweb | 564 | 50.67 |
i'm trying to run a simple hello world kind of ejb program in eclipse. here is what i did.
i created a new enterprise application project. after that there was an option of NEW MODULE . i clicked on it and it gave me option of creating default module. i created application client module and ejb module.
IN EJB MODULE:
i have a POJI and a POJO which is a stateless bean as given below :
in the application client module i have :
package ejb3inaction.example;
import javax.ejb.EJB;
so in project explorer i have an enterprise application project with 2 modules viz. ejb module and client module. i right clicked enterprise project and clicked run on server. then i exported the application client module project as export > application client jar file. i placed the jar file in the location of appclient binary of glassfish. i invoked appclient - client Testclient.jar and it gave me error that it cannot find class HelloUser.
i have included ejb moduel project in build path of application module. Please help ?
if i dont create enterprise application project but just create ejb project and put all 3 files in the single project then it runs fine.
please help
thanks and regards
Saloon Keeper
Trying to access an EJB from a Java SE project or the ACC (Application Client Container) is always a bit tricky as you need to configure some things manually. The best way is to test from a Servlet, as you are now quite familiar with Servlets. Injection of an EJB in a Servlet doesn't need any extra configuration.
Did you read the Oracle ACC article?
You can also try if the lookup from the JNDI (replace ApplicationClientContainerTest with your ear-project name and ApplicationClientContainerTestEJB with your EJB-project name) works:
Regards,
Frits
On the server computer, I have this:
On my client computer, I ran from my Firefox browser, where 123.456.78.90 is replaced by my server's IP address.
It works and prints "Hello George" on the browser.
But on my client computer, I ran HelloClient, which is a standalone client, I got this error:
My conclusion: The standalone client cannot look up the address of the HelloApplication.ear file and cannot even find the HelloApplication-ejb.jar.
The remote servlet client can connect to the server over HTTP.
Ranch Foreman
Once you acquire the right context, the URL that you have mentioned will work.
You might want to go through a good book that explains this or search for articles online.
HTH,
Paul.
Enthuware - Best Mock Exams and Questions for Oracle Java Certifications
Quality Guaranteed - Pass or Full Refund!.
The difficulty of how to get the right Context, as Paul was pointing out, is handled by the ACC.
| https://coderanch.com/t/605687/certification/ejb-program-finding-hard-run | CC-MAIN-2018-05 | refinedweb | 461 | 65.32 |
Table of Contents
1. Pandas groupby() function
Pandas DataFrame groupby() function is used to group rows that have the same values. It’s mostly used with aggregate functions (count, sum, min, max, mean) to get the statistics based on one or more column values.
Pandas gropuby() function is very similar to the SQL group by statement. Afterall, DataFrame and SQL Table are almost similar too. It’s an intermediary function to create groups before reaching the final result.
2. Split Apply Combine
It’s also called the split-apply-combine process. The groupby() function splits the data based on some criteria. The aggregate function is applied to each of the groups and then combined together to create the result DataFrame. The below diagram illustrates this behavior with a simple example.
Split Apply Combine Example
3. Pandas DataFrame groupby() Syntax
The groupby() function syntax is:
groupby( self, by=None, axis=0, level=None, as_index=True, sort=True, group_keys=True, squeeze=False, observed=False, **kwargs )
- The by argument determines the way to groupby elements. Generally, column names are used to group by the DataFrame elements.
- The axis parameter determines whether to grouby rows or columns.
- The level is used with MultiIndex (hierarchical) to group by a particular level or levels.
- as_index specifies to return aggregated object with group labels as the index.
- The sort parameter is used to sort group keys. We can pass it as False for better performance with larger DataFrame objects.
- group_keys: when calling apply, add group keys to index to identify pieces.
- squeeze: Reduce the dimensionality of the return type if possible, otherwise return a consistent type.
- observed: If True: only show observed values for categorical groupers. If False: show all values for categorical groupers.
- **kwargs: only accepts keyword argument ‘mutated’ and is passed to groupby.
The groupby() function returns DataFrameGroupBy or SeriesGroupBy depending on the calling object.
4. Pandas groupby() Example
Let’s say we have a CSV file with the below content.
ID,Name,Role,Salary 1,Pankaj,Editor,10000 2,Lisa,Editor,8000 3,David,Author,6000 4,Ram,Author,4000 5,Anupam,Author,5000
We will use Pandas read_csv() function to read the CSV file and create the DataFrame object.
import pandas as pd df = pd.read_csv('records.csv') print(df)
Output:
ID Name Role Salary 0 1 Pankaj Editor 10000 1 2 Lisa Editor 8000 2 3 David Author 6000 3 4 Ram Author 4000 4 5 Anupam Author 5000
4.1) Average Salary Group By Role
We want to know the average salary of the employees based on their role. So we will use groupby() function to create groups based on the ‘Role’ column. Then call the aggregate function mean() to calculate the average and produce the result. Since we don’t need ID and Name columns, we will remove them from the output.
df_groupby_role = df.groupby(['Role']) # select only required columns df_groupby_role = df_groupby_role[["Role", "Salary"]] # get the average df_groupby_role_mean = df_groupby_role.mean() print(df_groupby_role_mean)
Output:
Salary Role Author 5000 Editor 9000
The indexes in the output don’t look good. We can fix it by calling the reset_index() function.
df_groupby_role_mean = df_groupby_role_mean.reset_index() print(df_groupby_role_mean)
Output:
Role Salary 0 Author 5000 1 Editor 9000
4.2) Total Salary Paid By Role
In this example, we will calculate the salary paid for each role.
df_salary_by_role = df.groupby(['Role'])[["Role", "Salary"]].sum().reset_index() print(df_salary_by_role)
Output:
Role Salary 0 Author 15000 1 Editor 18000
This example looks simple because everything is done in a single line. In the earlier example, I had divided the steps for clarity.
4.3) Total Number of Employees by Role
We can use size() aggregate function to get this data.
df_size_by_role = df.groupby(['Role']).size().reset_index() df_size_by_role.columns.values[1] = 'Count' # renaming the size column print(df_size_by_role)
Output:
Role Count 0 Author 3 1 Editor 2
import pandas as pd
data = {’employees_no’: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],
’employees_name’: [‘Jugal Sompura’, ‘Maya Rajput’, ‘Chaitya Panchal’, ‘Sweta Rampariya’, ‘Prakshal Patel’, ‘Dhruv Panchal’, ‘Prachi Desai’, ‘Krunal Gosai’, ‘Hemil Soni’, ‘Gopal Pithadia’, ‘Jignesh Shah’, ‘Raj Patel’, ‘Shreya Desai’],
‘department_name’: [‘HR’, ‘Administrative Assistant’, ‘Production’, ‘Accountant’, ‘Production’, ‘Engineer’, ‘Finance’, ‘Engineer’, ‘Quality Assurance’, ‘Engineer’, ‘Engineer’, ‘Customer Service’, ‘CEO’],
‘salary’: [130000.0, 65000.0, 45000.0, 65000.0, 47000.0, 40000.0, 90000.0, 45000.0, 35000.0, 45000.0, 30000.0, 40000.0, 250000.0]
}
df = pd.DataFrame (data, columns = [’employees_no’, ’employees_name’, ‘department_name’, ‘salary’])
Hello sir this is my program and I’ve tried lots of times but I can’t get the desired output.
Can you help me out?
I want to: Aggregate employee based on their department and show average salary in each
department. | https://www.journaldev.com/33402/pandas-dataframe-groupby-function | CC-MAIN-2021-25 | refinedweb | 777 | 55.74 |
In this article, we want to introduce and review one of the products that specialize in the field of operating system virtualization. this product is named Docker. To know what is Docker and How does it work, follow this article on the Orcacore website to the end.
What is Docker and How does it work?
Docker is an open-source platform that is set up based on a Linux operation system. It is a tool that can ease the creation, implementation, and performance processes with the containers.
Another answer to what docker is, it is a kind of virtual machine that makes it possible to programs use a Linux kernel unit. and profited by features that aren’t in the host operating system. this will significantly improve the speed and performance of the program and reduce its volume.
What is a container?
The purpose of the new improved software systems is to keep programs in an isolated environment and independent. In this way, their activities aren’t affected by each other, and they work independently.
One of the ways that you can use this technology, is to use a virtual machine that keeps the programs on hardware but separated from each other. in this case, components don’t interfere with each other and reduce the competition of using hardware sources.
But what is a container? against virtual machines, are containers. they can be the best replacement for virtual machines. containers separate the executive environments and share the operation system’s core.
Containers use fewer sources than virtual machines and also they are executable so fast.
Containers can be divided into three parts:
- Builder (technology used to build containers)
- Engine (technology used to container startup)
- Orchestration (technology used for container settings and management)
What is a Docker container?
Even the container concept has existed in the IT field, but introduce and presentation of Docker as an open-source project causes the use of containers to be pervasive again.
The container gives the possibility to developers that make a whole package of their programs with all requirements sections and send them as a whole package unit.
With the containers, developers can be sure that the docker program in every machine is applicable and usable with Linux OS without attention to custom settings. The new machine can have different settings from the machine on which the program is designed.
We have to use different components to build a Docker program as well as work with Docker. In the following, we will introduce and review these components.
Docker File
Every container starts to work with a docker file. To answer the question of what a docker file is, docker files actually are docker settings files that with the use of them we can tell docker how to set up and configure a container. as an example, what services to enable and how to allow access to them.
Actually, the docker file specifies which OS is located behind our container, also uses which languages, local variables, network ports and etc., and which is important more is to specify that after our container is actually run, what is supposed to do.
In the below table we describe keywords used in the docker file:
Docker Image
When you have finished writing the docker file, you call a feature called Docker Build, which is responsible for creating an image based on the contents of your Docker file.
The Docker Image is a portable file that contains a set of instructions that specify which software components the Container should run and how to run it.
Docker Run
Docker run actually, is a kind of command that sets up the container. Every container is an example of an image and the nature of the container is temporary. However, they can be stopped or re-setup again.
Each image can have a large number of containers, provided it has a unique name.
Docker Hub
Docker Hub is a SaaS repository for managing and sharing containers. In this section, you can find the official Docker images, which are usually open-source.
Docker Engine
This section is the core of Docker. In fact, when someone talks about Docker, they are talking about Docker Engine. This feature is offered in both Enterprise and Community versions.
The community version is open-source and totally free. However, the enterprise version with additional features and capabilities costs about $ 1,500 per node per year.
What is the mechanism of action of Docker?
At this point, we know what is Docker and how it works. In this part, we want to discuss what is the mechanism of action of docker.
Docker creates an interface between the main operating system and the software package.
In the Linux operating system, there are capabilities for separating and isolating resources that provide both the core of the operating system and the groups and hardware and software resources of the operating system in isolated and separate software, of which the Docker system is one Uses.
For example, features such as cgroups and kernel namespaces are some of the things that Docker uses. | https://orcacore.com/what-is-docker-and-how-does-it-work/ | CC-MAIN-2022-40 | refinedweb | 849 | 54.42 |
Opened 10 years ago
Closed 10 years ago
#4581 closed (invalid)
Typo - oldforms should be newforms
Description (last modified by )
in the section describing the old form framework it refers to the two ways of setting up forms .. old and new way
It appears as the sample is wrong using:
from django import oldforms as forms # new
where further down is referred to as:
from django import newforms as forms # new
Change History (1)
comment:1 Changed 10 years ago by
Note: See TracTickets for help on using tickets.
(Fixed description formatting.)
I can't see where the second comment appears -- searching for "# new" only shows on occurrence in that file. However, the first comment is using the word "new" to contrast with the previous line (which uses the word "old"). It is explaining the difference between the old and new way of using existing (old-) forms.
There isn't any problem here, it's just a matter of context and I think that is clear to the reader (or should be after a short think). | https://code.djangoproject.com/ticket/4581 | CC-MAIN-2017-17 | refinedweb | 176 | 63.43 |
In a previous post I introduced you to the new DataSift library, a repository of extremely useful classifiers that will help you build great social solutions quickly. In this post using a practical example I'll show just how useful the classifiers are and how they can help you to start tackling a real-world scenario in minutes.
On the 14th of November at 11pm eastern time, Sony held their launch event for the PlayStation 4. Naturally there was a large volume of conversation taking place on social platforms around this time.
I decided to dig into this conversation as I wanted to learn:
To carry out my analysis I would need to:
Although this sounds like a lot of work, with the right tools it was quick and easy:
So these three work perfectly in harmony, but I am missing one piece. How could I make sense of the data?
Tableau is great tool, but I needed to deliver data to it in a structure that made sense for my analysis. In this case I needed to add the following metadata to each social interaction so that I could aggregate data appropriately:
Step in the DataSift Library, the hero of our piece. By using classifiers from the library I could attach the required metadata through tagging rules, taking advantage of the new VEDO features.
By using three library items my life became incredibly easy:
Each of the items in the library has a hash, found on it's library page, which is used to apply it to a stream:
I started by writing a filter to match tweets relating to the launch event. I decided to look for interactions that mentioned PlayStation and keywords (launch, announces, announce). I looked both in the content of the post and also in the title of any content being shared through links.
Note: Links are automatically expanded and decorated with metadata by the Links augmentation.
With my filter created I now wanted to apply metadata to the matching interactions. I used the tags keyword to import the library items I chose, each with the appropriate hash:
My complete stream definition therefore became:
The advantage of using the library definitions is that the data is given meaning through metadata, so that when it reaches the application (Tableau in this case) it is much easier to process.
When an interaction arrives it will have a tag_tree property, containing any matching tags. So for example due to the library classifiers I might receive an interaction with the following metadata under interaction.tag_tree:
To store the historic data, I set up a MySQL Destination for the destination of the historic query.
I created a fresh new database and used this script to create the necessary tables. I used this mapping file as my mapping definition.
I will cover the MySQL destination very soon in a separate post. You can read the technical documentation here.
I then ran a historic query for Twitter between 13th November 2013 5am GMT and 16th November 5am GMT. 5am being midnight eastern time, so giving me data for the day before, day of and day after the launch event.
Finally I wrote some simple SQL views to augment the data ready for Tableau.
I used the tagged_interactions view for my analysis in Tableau.
With the metadata attached to each interaction and exposed through my view, analysis with Tableau was quick and painless. I used Tableau to follow how coverage and engagement changed from before until after the launch.
Firstly I created a time series chart, showing the volume of tweets and retweets during the three day period. I plotted the created_at time against the number of records.
I then created a chart for both professions and news providers. The columns I created for the tags were perfect for Tableau.
For professions, I first filtered by tweets that were created manually (thanks to the Twitter Source library item). I then plotted profession (thanks to the Professions & Roles library item) against the number of records.
Similarly for news providers, I first filtered by tweets that were created manually and then plotted provider (thanks to the News Providers & Topics library item) against the number of records.
Finally I used the time series chart as a filter for the other two charts, combining the three on a dashboard so that I could look at activity across different time periods.
The day before the launch the major news providers didn't see great engagement from their audience. The Guardian and CNET managed to generate most engagement. Certainly both providers have a reputation for excellent technology news coverage.
The launch at this point engaged journalists, technologists, entrepreneurs and creative professions. This story is what I would have expected as these groups follow technology and gaming trends most closely in my experience.
The day of the launch, the audience engages more widely with a variety of providers. Digital Spy takes a huge lead though with users sharing it's content most widely.
As far as professions is concerned, the audience is split similarly. The news of the launch has not been engaged with widely so far.
As the launch was at 11pm, it's not that surprising that only fans would have engaged.
However, looking at the engagement after the launch, at this point major providers such USA Today and CNN are managing to engage their audiences. As you might expect the number of professions engaging broadens as the news of the launch is covered more in the mainstream press.
At this point I could have dug deeper. For instance I could have included further news providers that may specialise in such an event. This example though was designed to show how quickly the library can get you started.
It's difficult to convey in a blog post, but by using the tagging features of VEDO, the ready-made library definitions and the new MySQL destination, what could have been a couple of days work was complete in a couple of hours.
Not having to post-process the data by writing and running scripts, and having reusable rules I could just pull out of the library made the task so much easier. Also the MySQL destination makes the process of extracting data and visualising it in Tableau completely seamless.
I hope this post gives you some insight into how these tools can be combined effectively. Please take a look at the ever-growing library and see it can make your life easier.
To stay in touch with all the latest developer news please subscribe to our RSS feed at
The launch of DataSift VEDO introduced new features to allow you to add structure to social data. Alongside we introduced the DataSift library to help you build solutions faster and learn quicker.
Today we continue this theme by adding further items to the library. These include examples of machine learned classifiers which are sure to whet your appetite and get your creative juices flowing.
Since we announced VEDO there's been a lot of buzz around the possibilities of machine learning. Look out for a blog post coming very soon for an in-depth look.
We've introduced the following classifiers to the library to give you a taste of just what's possible:
These classifiers have been created by our Data Science team. They take a large sample of interactions from the platform, manually classify the interactions and use machine learning to learn key signals, which dictate which category interactions should belong to. The result is a set of scoring rules that form the classifier. The resulting classifier can be run against live or historic data ongoing.
You can try out any of the classifiers now by creating a stream from the example code at the bottom of the library item page. For more details see my previous post.
Knowing a user's location can be extremely valuable for many use cases, yet location as a field can be very tricky to normalise.
As an example of how VEDO can help you with this process, we've introduced the following classifiers, which normalise geo-location information:
Outside of game days you'll see little traffic around sporting venues, but try running these on a match day to see the power of these definitions!
Alongside introducing new classifiers and increasing the library's breadth, we've also worked hard on improving further two existing classifiers. We think you'll find these two extremely useful in your solutions:
We're not stopping here. Expect to see more and more items being added to the library, covering a wider range of use cases and industries. Keep an eye out for new items and please watch this blog for further news.
At this point let me encourage you to sign-up if you're not already a DataSift user, and then jump straight in the library and see it can make your life easier!
The launch of DataSift VEDO introduced new features to allow you to add structure to social data. Alongside VEDO we also introduced the DataSift library - a great new resource to inspire you and make your life easier. Benefit from our experience and build better solutions faster.
We've introduced the DataSift library to help you to benefit from our experience working with our customers. CSDL (our filtering and tagging language) is extremely powerful, but it might not be clear exactly what can be achieved. Using the library we'll share with you definitions we've written for real-world solutions so you can learn quicker and get the most from our platform.
Currently the library contains tagging and scoring definitions that demonstrate the power of VEDO. There are out-of-the-box components you can use straight away, and example rules you can take and run with.
You'll find the new Library as a new tab on the Streams page:
Items marked as 'supported' in the library are definitions you can count on us to maintain. You can confidently use these as part of your solution immediately.
You can also use these definitions as a base to start from. You can copy the definitions into your account and modify the rules to fit your use case. After all 'spam' for one use case can be gold for another!
Supported items include:
Items marked as 'example' in the library are definitions which we've built that will help you learn from real-world samples. You can run these examples directly, but we envisage you using these definitions as starting points and modifying or extending them to fit your solution.
Example items include:
It's easy to make use of a library item. You can either import an item into one of your streams, or copy an item into your account and modify it to your heart's content.
Note that all of the library items are currently tagging and scoring rules. You'll need to use them with a return statement. For more details please see our technical documentation.
At the bottom of the page for each library item you'll find a tab labelled Usage Examples. This tab shows you example code which you can copy and paste into a new stream and run a live preview.
The key here is the tags keyword and hash for the stream. You can copy and paste this line into any of your streams to import the tagging rules.
On each library item page there is a snippet of code that shows you the entire, or part of the definition. You can click the Copy to new stream button to copy the entire definition to your account. You can then inspect and modify the code as you see fit.
We'll work hard on adding more and more items to the library so it becomes an extremely valuable resource. Keep an eye out for new items and please watch this blog for further news.
The launch of DataSift VEDO introduced new features to allow you to add structure to social data. In my last few posts I introduced you to tags, tag namespaces and scoring and explained how you can use these features to classify data before it reaches your application.
In this post I will show you how once you’ve spent time building these rules, you can reuse them across many projects, getting maximum value for your hard work.
On our platform a ‘tag definition’ is a stream you define which contains only tag rules, and no return statement.
To be clear, until now you may have used tags and a filter (as a return statement) together in one stream for example:
You can break out your tags into a reusable tag definition by saving just the tags in a new stream without the return statement:
When you save the stream (or compile using the API) you will be given a hash which represents this definition.
Now that we have a hash for the tag definition, we can make use of it in another stream using the tags keyword.
This will import the tag rules just as if they were written in place in the same stream. The tags will be applied as appropriate to interactions that match the filter in the return statement.
Using this simple but powerful feature you can create a library of valuable tag & scoring rules for your business model and reuse the same definitions across any number of streams.
This is already a great feature but things get even better when we throw in a namespace. Imagine you have a great set of tag rules you like to reuse often in your streams, you might want to organise your namespaces differently depending on the exact stream.
When you import a set of tags you can wrap them within a namespace:
Now the tags will be applied as before, but they will sit within a top-level namespace of user.
In fact, in practice I’ve found that this helps keep tag rules much more concise. You can declare tag rules with a shallow namespace, but when you import them you can wrap them in namespaces to build a very rich taxonomy.
It’s important to note that the hash for your tag definition will change if you update the tag definition itself. If you’ve used the stream keyword before you’ll be familiar with this concept.
This makes sense when you consume streams via the API, allowing you to make changes to definitions on the fly and switching to new definitions when suitable for your application.
You just need to remember that if you make a change to a reusable tag definition, make sure you take the new hash and update the streams which import the definition.
Reusable tag definitions are super powerful because they allow you to build up a library of rules which you can use across projects and throughout your organisation.
For example, you could build the following reusable definitions:
To give you a head start we’ve also released our own library of reusable definitions. In minutes you can benefit from our hard work!
For full details of the all the features see our technical documentation.
This post concludes my series on our new tagging and scoring features. Don’t go away though as there are many more features I’ll cover in the coming weeks, and I’ll also take you through some much richer real-world examples.
The launch of DataSift VEDO introduced new features to allow you to add structure to social data. In my last posts I introduced you to tags and tag namespaces and explained how you can use these features to categorise data before it reaches your application.
Alongside tagging our latest release also introduces scoring, which I’ll cover today. Scoring builds upon tagging by allowing you to attach relative numeric values to interactions. Scoring allows you to reflect the subtleties of quality, priority and confidence, opening up a whole raft of new use cases for your social data.
Whereas tags allow you to attach a metadata label, based on a boolean condition, scoring allows you to build up a numerical score for an interaction over a set of rules. Tags are perfect for classifying into a taxonomy, whereas scoring gives you the power to rate or qualify interactions on a relative scale. Just like tagging, you can apply scores using the full power of CSDL, and save yourself post-processing in your application.
Often our customers look to identify spam in their data to improve analysis. What is considered to be spam is extremely dependent on the use case, and even on the specific question being asked. Here I’m going to rate tweets for how likely they are to be from a bot.
Using scoring I can give each tweet a relative confidence level for suspected bot content. Rather than just tagging a tweet, scoring allows an end application to further the filter on the relative score.
Let’s look at two (stripped down) tweets, the first likely to be a real person, and the second a likely bot:
There are a number of useful metadata properties I can work with to build my rules:
Any one of these qualities hints that the content could be from a bot. The beauty of scoring though is that if we see more than one of these qualities then we can show that we’re more and more confident the tweet is from a bot.
Scoring allows us to build up a final score over multiple rules. For every rule that matches the rule score is added or subtracted.
You use the tag keyword to declare scoring rules, with the following syntax:
tag.[namespace].[tag name] +/-[score] { // CSDL to match interactions }
Any interaction that matches the CSDL in the brackets will have the declared score added or subtracted.
Let’s carry on the example to make this a bit clearer. Notice how I have multiple rules which contribute different scores to the same tag:
When the rules are applied to the two tweets the output is:
For the first interaction the total is 10 as it only matches this rule relating to the number of statuses posted:
tag.quality.suspected_bot +10 { twitter.user.statuses_count < 25 }
For the second interaction the total is 80 because the following rules all match:
tag.quality.suspected_bot +25 { twitter.user.profile_age < 5 }
tag.quality.suspected_bot +10 { twitter.user.statuses_count < 25 }
tag.quality.suspected_bot +25 { twitter.user.follower_ratio < 0.01 }
tag.quality.suspected_bot +20 { interaction.source contains_any "twittbot.net,EasyBotter,hellotxt.com,dlvr.it" }
So our relative scores tell us the first interaction is unlikely to be from a bot, whereas the second is highly likely to be so.
When the data reaches my application I can choose how strict I’d like to be about spam. I might say the score must be 0 or below to be absolutely sure the content is not from a bot, or I might perhaps choose a value of 25 say to include content unlikely to be from a bot. The power is given to the end application or user to make the choice using a simple scale.
My example covered just one scenario where scoring can be helpful, but there are many more. For example:
For inspiration check out our library of tag definitions. For full details of the features see our technical documentation.
In my next post I’ll be explaining how you can reuse all the hard work you’re putting into your tagging and scoring rules by importing these definitions into any number of streams. | http://dev.datasift.com/blog?page=2 | CC-MAIN-2014-41 | refinedweb | 3,277 | 60.45 |
CHAPTER 10Using the F# and .NET Libraries
F# and the .NET Framework offer a rich set of libraries for functional and imperative programming. In this chapter, we step back and give a broader overview of the .NET and F# libraries.
Many of the types and namespaces described here are also covered elsewhere in this book. In these cases, we simply reference the relevant chapter.
A High-Level Overview
One way to get a quick overview of the .NET Framework and the F# library is to simply look at the primary DLLs and namespaces contained in them. Recall from Chapters 2 and 7 that DLLs correspond to the physical organization of libraries and that namespaces and types give the logical organization of a naming hierarchy. Let's look at the physical organization ...
Get Expert F# now with the O’Reilly learning platform.
O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers. | https://www.oreilly.com/library/view/expert-f/9781590598504/chapter10.html | CC-MAIN-2022-27 | refinedweb | 158 | 59.5 |
Yes, Marius got exactly what I meant, this is how I usually make the not-so-pluggable stuff pluggable :) About the fact to release it out of zope.schema, it's also to be able to make it live a bit and prove itself. Then, including it and changing the API can be easily justified. I'm not afraid of the changes in zope.schema. z3c.form is not the only form option, I'll probably use it in dolmen.forms that came from zeam.form. So, whatever you decide, we'll try to make it easy for you to contribute. It tends to get tooooo complicated to do anything in zope, lately :)
Advertising
2012/1/26 Marius Gedminas <mar...@gedmin.as>: > On Thu, Jan 26, 2012 at 04:02:54PM +0200, Jan-Carel Brand wrote: >> On Wed, 2012-01-25 at 18:56 +0100, Souheil CHELFOUH wrote: >> > A quick note : >> > >> > This quite an advanced vocabulary, why not make another package with a >> > dependency on zope.schema ? >> > I don't quite see the point to have that in the "core". >> >> Ok, Charlie also expressed his reservations. I'll put it in a different >> package then. >> >> I'm not too sure what to name it though. For example, under what >> namespace? zope or z3c? > > My gut feeling says "z3c". > > OTOH I don't think a single class warrants a whole separate PyPI > package. Especially if it's going to be used with z3c.form (hint, hint > ;) or that collective.forgotthenamealready you mentioned upthread. > >> I'm guessing zope.vocabulary, or rather zope.treevocabulary? > > (Or z3c.treevocabulary) > > But I'd rather see this in zope.schema. > > Incidentally, since this would be a new feature, it would need a minor > version bump in setup.py (4.0.2dev -> 4.1dev). > >> > Furthermore, for the dict class in use in the vocabulary, you could >> > add a "factory" class that can be overriden easily. >> > That would allow people with OrderDict capabilities to use them >> > without having to re-sort later on. >> >> Could you please elaborate on what you mean? > > I think he meant something like > > class TreeVocabulary(object): > > # you can subclass and use OrderedDictionary instead > dict_factory = dict > > This would mean that you can't subclass dict and would instead have to > delegate __getitem__, __iter__, __len__, keys, values, items and all the > rest by hand. > > I'm actually feeling a bit guilty about raising this question. As I > said, I don't have a use-case for ordered TreeVocabularies myself. (Or > unordered ones either, for that matter ;) The only reason for hashing > this out now is to avoid painful API changes if we ever decide that we > need those. Feel free to cry YAGNI at any time. It's already hard > enough to contribute to zope3-or-is-it-bluebream-or-is-it-ztk-aaaugh as > it is, without us adding extra barriers in place. > >> If I create a factory class to create TreeVocabulary instances, how will >> overriding that factory (without creating a separate >> SortableTreeVocabulary) allow people to use OrderedDict? >> >> Incidentally, I came upon this: >> which provides the OrderedDict to Python 2.4 to 2.7 > > Oh, neat. I've used in the past, but > it doesn't have the blessing of stdlib'ness. > >> I think it might make sense to just subclass OrderedDict and implement >> an ordered tree from the start. > >> > By the way, good work on that, it's something that is often needed in >> > advanced forms. I'll make sure to try it. >> > Thank you for the effort. >> >> Thanks! Much appreciated. > > Thanks! > > - ) | https://www.mail-archive.com/zope-dev@zope.org/msg37058.html | CC-MAIN-2016-44 | refinedweb | 587 | 67.25 |
Build Pipelines with Pandas Using pdpipe
We show how to build intuitive and useful pipelines with Pandas DataFrame using a wonderful little library called pdpipe.
Introduction
Pandas is an amazing library in the Python ecosystem for data analytics and machine learning. They form the perfect bridge between the data world, where Excel/CSV files and SQL tables live, and the modeling world where Scikit-learn or TensorFlow perform their magic.
A data science flow is most often a sequence of steps — datasets must be cleaned, scaled, and validated before they can be ready to be used by that powerful machine learning algorithm.
These tasks can, of course, be done with many single-step functions/methods that are offered by packages like Pandas but a more elegant way is to use a pipeline. In almost all cases, a pipeline reduces the chance of error and saves time by automating repetitive tasks.
In the data science world, great examples of packages with pipeline features are — dplyr in R language, and Scikit-learn in the Python ecosystem.
A data science flow is most often a sequence of steps — datasets must be cleaned, scaled, and validated before they can be ready to be used
Following is a great article about their use in a machine-learning workflow.
Managing Machine Learning Workflows with Scikit-learn Pipelines Part 1: A Gentle Introduction
Are you familiar with Scikit-learn Pipelines? They are an extremely simple yet very useful tool for managing machine ...
Pandas also offer a
.pipe method which can be used for similar purposes with user-defined functions. However, in this article, we are going to discuss a wonderful little library called pdpipe, which specifically addresses this pipelining issue with Pandas DataFrame.
In almost all cases, a pipeline reduces the chance of error and saves time by automating repetitive tasks
Pipelining with Pandas
The example Jupyter notebook can be found here in my Github repo. Let’s see how we can build useful pipelines with this library.
The dataset
For the demonstration purpose, we will use a dataset of US Housing prices (downloaded from Kaggle). We can load the dataset in Pandas and show its summary statistics as follows,
However, the dataset also has an ‘Address’ field which contains text data.
Adding a size qualifier column
For the demo, we add a column to the dataset qualifying the size of the house, with the following code,
The dataset looks like following after this,
The simplest pipeline — one operation
We start with the simplest possible pipeline, consisting of just one operation (don’t worry, we will add complexity soon enough).
Let’s say the machine learning team and the domain experts say that they think we can safely ignore the
Avg. Area House Age data for modeling. Therefore, we will drop this column from the dataset.
For this task, we create a pipeline object
drop_age with the
ColDrop method from pdpipe and pass the DataFrame to this pipeline.
import pdpipe as pdp drop_age = pdp.ColDrop(‘Avg. Area House Age’) df2 = drop_age(df)
The resulting DataFrame, as expected, looks like following,
Chain stages of pipeline simply by adding
Pipelines are useful and practical only when we are able to multiple stages. There are multiple methods by which you can do that in pdpipe. However, the simplest and most intuitive approach is to use the + operator. It is like hand-joining to pipes!
Let’s say, apart from dropping the age column, we also want to one-hot-encode the
House_size column so that a classification or regression algorithm can be run on the dataset easily.
pipeline = pdp.ColDrop(‘Avg. Area House Age’) pipeline+= pdp.OneHotEncode(‘House_size’) df3 = pipeline(df)
So, we created a pipeline object first with the
ColDrop method to drop the
Avg. Area House Age column. Thereafter, we just simply added the
OneHotEncode method to this pipeline object with the usual Python
+=syntax.
The resulting DataFrame looks like the following. Note the additional indicator columns
House_size_Medium and
House_size_Small created from the one-hot-encoding process.
Drop some rows based on their values
Next, we may want to remove rows of data based on their values. Specifically, we may want to drop all the data where the house price is less than 250,000. We have the
ApplybyCol method to apply any user-defined function to the DataFrame and also a method
ValDrop to drop rows based on a specific value. We can easily chain these methods to our pipeline to selectively drop rows (we are still adding to our existing
pipeline object which already does the other jobs of column dropping and one-hot-encoding).
def price_tag(x): if x>250000: return 'keep' else: return 'drop' pipeline+=pdp.ApplyByCols('Price',price_tag,'Price_tag',drop=False) pipeline+=pdp.ValDrop(['drop'],'Price_tag') pipeline+= pdp.ColDrop('Price_tag')
The first method tags the rows based on the value in the
Price column by applying the user-defined function
price_tag(),
The second method looks for the string
drop in the
Price_tag column and drops those rows that match. And finally, the third method removes the
Price_tag column, cleaning up the DataFrame. After all, this
Price_tag column was only needed temporarily, to tag specific rows, and should be removed after it served its purpose.
All of this is done by simply chaining stages of operations on the same pipeline!
At this point, we can look back and see what our pipeline does to the DataFrame right from the beginning,
- drops a specific column
- one-hot-encodes a categorical data column for modeling
- tags data based on a user-defined function
- drops rows based on the tag
- drops the temporary tagging column
All of this — using the following five lines of code,
pipeline = pdp.ColDrop('Avg. Area House Age') pipeline+= pdp.OneHotEncode('House_size') pipeline+= pdp.ApplyByCols('Price',price_tag,'Price_tag',drop=False) pipeline+= pdp.ValDrop(['drop'],'Price_tag') pipeline+= pdp.ColDrop('Price_tag') df5 = pipeline(df)
Scikit-learn and NLTK stages
There are many more useful and intuitive DataFrame manipulation methods available for DataFrame manipulation. However, we just wanted to show that even some operations from Scikit-learn and NLTK package are included in pdpipe for making awesome pipelines.
Scaling estimator from Scikit-learn
One of the most common tasks for building machine learning models is the scaling of the data. Scikit-learn offers a few different types of scaling such as Min-Max scaling, or Standardization based scaling (where mean of a data set is subtracted followed by division by standard deviation).
We can directly chain such scaling operations in a pipeline. Following code demonstrates the use,
pipeline_scale = pdp.Scale('StandardScaler',exclude_columns=['House_size_Medium','House_size_Small']) df6 = pipeline_scale(df5)
Here we applied the
StandardScaler estimator from the Scikit-learn package to transform the data for clustering or neural network fitting. We can selectively exclude columns which do not need such scaling as we have done here for the indicator columns
House_size_Medium and
House_size_Small.
And voila! We get the scaled DataFrame,
Tokenizer from NLTK
We note that the Address field in our DataFrame is pretty useless right now. However, if we can extract zip code or State from those strings, they might be useful for some kind of visualization or machine learning task.
We can use a Word Tokenizer for this purpose. NLTK is a popular and powerful Python library for text mining and natural language processing (NLP) and offers a range of tokenizer methods. Here, we can use one such tokenizer to split up the text in the address field and extract the name of the state from that. We recognize that the name of the state is the penultimate word in the address string. Therefore, following chained pipeline will do the job for us,
def extract_state(token): return str(token[-2]) pipeline_tokenize=pdp.TokenizeWords('Address') pipeline_state = pdp.ApplyByCols('Address',extract_state,result_columns='State') pipeline_state_extract = pipeline_tokenize + pipeline_state df7 = pipeline_state_extract(df6)
The resulting DataFrame looks like following,
Summary
If we summarize all the operations shown in this demo, it looks like the following,
All of these operations may be used frequently on similar types of datasets and it will be wonderful to have a simple set of sequential code blocks to execute as a pre-processing operation before the dataset is ready for the next level of modeling.
Pipelining is the key to achieve that uniform set of sequential code blocks. Pandas is the most widely used Python library for such data pre-processing tasks in a machine learning/data science team and pdpipe provides a simple yet powerful way to build pipelines with Pandas-type operations which can be directly applied to the Pandas DataFrame objects.
Explore this library on your own and build more powerful pipelines for your specific data science task.
If you have any questions or ideas to share, please contact the author at tirthajyoti[AT]gmail.com.:
- How to Speed up Pandas by 4x with one line of code
- 5 Great New Features in Latest Scikit-learn Release
- Data Pipelines, Luigi, Airflow: Everything you need to know | https://www.kdnuggets.com/2019/12/build-pipelines-pandas-pdpipe.html | CC-MAIN-2022-21 | refinedweb | 1,492 | 51.58 |
Misbehaving Thread Code?
See output at bottom of code:
package study;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: </p>
* @author JLM
* @version 1.0
*/
//====================================================================
public class LockInvestigation
{
//----------------------------------------------------------
public LockInvestigation()
{
AssignmentThread operator1 =
new AssignmentThread(5222222222222222225L);
AssignmentThread operator2 =
new AssignmentThread(5111111111111111115L);
operator1.start();
operator2.start();
System.out.println(" LockInvestigation Completed.");
}
}
//====================================================================
class AssignmentThread extends Thread
{
private long assignmentValue;
// This is a shared varible between threads
private static long testVariable;
// DEBUG
private volatile long testValue1;
//----------------------------------------------------------
public AssignmentThread(long value)
{
assignmentValue = value;
}
//----------------------------------------------------------
public void run()
{
for (int count=0; count<10000000; count++)
{
// Assign to the shared variable
testVariable = assignmentValue;
try
{
synchronized(Class.forName("study.ValueAssignmentThread"))
{
testValue1 = testVariable;
if (testVariable == 5222222222222222225L || testVariable == 5111111111111111115L)
// Even if there is a mistake, it would be a normal thread
// scheduling problem. We are interested in the long type
// assignment failing as a result of a special kind of failure
continue;
System.err.println(" Value that passed if (x): "+testValue1);
System.err.println(
" Result of second test (should be false):"+
"\n (testVariable == 5222222222222222225L || testVariable == 5111111111111111115L):"+
(testVariable == 5222222222222222225L || testVariable == 5111111111111111115L));
System.err.println(" Supposed to be same x: "+testVariable);
System.err.println();
}
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}
}
}
}
Expected output example (due to threads treating double and long non-atomically):
Value that passed if (x): 5222222224296276427
Result of second test (should be false):
(testVariable == 5222222222222222225L || testVariable == 5111111111111111115L):false
Supposed to be same x: 5222222224296276427
Bad output example:
Value that passed if (x): 5111111109037056913
Result of second test (should be false):
(testVariable == 5222222222222222225L || testVariable == 5111111111111111115L):true
Supposed to be same x: 5222222222222222225
Value that passed if (x): 5111111111111111115
Result of second test (should be false):
(testVariable == 5222222222222222225L || testVariable == 5111111111111111115L):true
Supposed to be same x: 5222222222222222225
<img src="cool.gif" border="0"> <img src="graemlins/beerchug.gif" border="0" alt="[beerchug]" /> <br />SCJP 1.4
Please copy and paste the code and check it out if you think you know threads a bit (or more than a bit.. or whatever).
I'm a bit concerned over this. I think I did my locking propperly and still this weird result occurs. Please see if you know why.
I'm aware that the first assignment in the thread isn't thread safe, but that's the whole point. The thing is.... I don't think the code in the synchronized section ............................
... maybe this is exactly the problem. Sometimes it helps explaining your problem, then you sometimes see it yourself...
I thought that the value of 'testVariable' is guaranteed in the synchronized section. The thing is.. the other thread is free to assign to it at any time.... so... while the tests ('if's etc.) are going on in the synchronized section the value could, and is at times changed at the critical time.
This causes the 'if' fallthrough and later the surprise that the value isn't consistent with what the tested condition was.
mmm. :roll:
Interesting... Feel free to comment. Just don't call me a dumb a'' please. :-)
<img src="cool.gif" border="0"> <img src="graemlins/beerchug.gif" border="0" alt="[beerchug]" /> <br />SCJP 1.4
Sorry I'm supposed to be working, so I do not have time to analyze your code in detail.
-Barry
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Originally posted by Barry Gaunt:
I would update your static variable in a synchronized static method and rely on the JVM do the locking of the class. All that Class.forName stuff makes me shudder...keep it simple and all that.
I needed a class level lock... I reckon the JVM would have allocated the lock on class level....... not sure. I'm not quite clear on all the low level working, but I did study the Java Lang Spec a bit.
<img src="cool.gif" border="0"> <img src="graemlins/beerchug.gif" border="0" alt="[beerchug]" /> <br />SCJP 1.4
and perhaps a getter too:
[ September 09, 2002: Message edited by: Barry Gaunt ]
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Please ident your code withUBB Code.
This is a slighly modied version and output:
The first two paragraphs in the output correspond to a corrupted value assigned to a non volatile long field (testVariable) by two unsynchronized threads. Placing testVariable = assignmentValue; within the synchronized block solves this problem. It's possible also to declare testVariable volatile and no corrupted value appears in the output anymore.
This is how I think the last paragraph in the output was printed:
operator2 assigned 5111111111111111115 to testVariable. It enters the synchronized block and assigns testVariable to testValue1. But before testing the following if, operator1 tries to execute testVariable = assignmentValue;. The if statement and the later assignment are executed "at the same time" because there are not synchronized. operator1 assigns the first 32 bits and before assining the last 32, operator2 executes if with a value of testVariable that is neither 5111111111111111115 nor 5222222222222222225. Therefore operator2 doesn't execute continue but the rest of the pritn statements. However before operator2 executes System.out.println("testValue1 "+testValue1 + " testVariable " + testVariable); , operator1 has already finished its assignment and it's now blocked before the synchronized block. Now testVariable is 5222222222222222225, and the the output shows it.
[ September 10, 2002: Message edited by: Jose Botella ]
SCJP2. Please Indent your code using UBB Code
Question :
Does JDK 1.4 treat the volatile keyword correctly?
I know that some JVMs simply ignore volatile.
That wouldn't be too nice of them. You can test it. Take the code I posted and make the static volitile. You wouldn't get the half long assigned values.
Like (unsynchronized):
x = 111111111111 (whatever.. make it max long size)
and x = 222222222222
then if the volitile didn't work you'd get some values like:
111111837773.
That means the assignment was non-atomic, which was the actual point of the program I wrote.
Cheers.
<img src="cool.gif" border="0"> <img src="graemlins/beerchug.gif" border="0" alt="[beerchug]" /> <br />SCJP 1.4
| https://coderanch.com/t/239214/certification/Misbehaving-Thread-Code | CC-MAIN-2016-44 | refinedweb | 1,019 | 58.18 |
Feature #12697closed
Why shouldn't Module meta programming methods be public?
Description
Methods like alias_method, attr_accessor, define_method, and similar
I don't think Ruby discourages this kind of meta programming, so why make it less convenient, by necessitating
send or
module_eval?
Related issues
Updated by shevegen (Robert A. Heiler) about 5 years ago
This is somewhat an interesting comment made here, epecially in regards to .send().
Take code snippets such as here:
Quote:
require "term/ansicolor" String.send(:include, Term::ANSIColor)
I think I myself has used similar ways for .send(), but in another context. I only vaguely remember
that if I would not have used .send() I would have gotten an error about using a private method.
So that error confused me, since I could overrule it anyway by simply using .send() instead - so
essentially, ruby forced me to use a more verbose way rather than the shorter. It was not a huge
issue for me at all since I really like .send() anyway. I also remember the addition of
.public_send() to respect visibility but I myself just happily use .send() since it is shorter. :)
So on this particular problem, I somewhat concur with "bug hit" on principle. But perhaps there
are other reasons why this is not wanted. After all, .public_send() did not exist in the old
days - I do not precisely know how or why or when it was added but I assume that some people
used a strict separation between private/public in their ruby code.
I think that matz may have once said that private/public do not make as much sense in ruby simply
because ruby is so extremely dynamic and flexible. But perhaps there were other reasons too, e. g.
the .public_send() - it is a bit strange though because to me the public/private distinction does
not really add a lot of "necessary things" other than restricting what can be done - but .send()
can bypass this anyway, at runtime, so I am a bit confused. It's sort of what you get when you
have a very flexible language, which is a good thing whenever you want to be flexible.
I mention .send in particular because it was the only one where I noticed the above - I myself
do not use alias_method(), I prefer the shorter alias, even if it is not fully equivalent (I
am sorry, I think being terse is prettier when it is still readable.)
Last but not least, a lot of the meta method stuff seem to lead to fairly long and complex
code, compared to other ruby code which tends to be much simpler - I only mention it since
I have noticed this in my own code too, so I tend to go "oldschool" rather than "super-meta-
clever".
Updated by marcandre (Marc-Andre Lafortune) about 5 years ago
- Assignee set to matz (Yukihiro Matsumoto)
I made the same proposal years ago (#6539), and Matz stated that he "thinks class/module operations should be done in the scope".
I still strongly believe that
include should be public, so I'll keep this open in case we manage to rally Matz
Updated by matz (Yukihiro Matsumoto) about 5 years ago
- Status changed from Open to Feedback
I still believe
class String include Term::ANSIColor end
is far better than
String.include Term::ANSIColor. It is clearer and has more space to optimize.
Besides that the fact that
include etc may have huge performance penalty is also a reason to prohibit casual class/module modification. Is there any reason to allow this in addition to saving extra few keystrokes?
Matz.
Updated by bughit (bug hit) about 5 years ago
Yukihiro Matsumoto wrote:
I still believeclass String include Term::ANSIColor end
is far better than
String.include Term::ANSIColor. It is clearer and has more space to optimize.
Besides that the fact that
includeetc may have huge performance penalty is also a reason to prohibit casual class/module modification. Is there any reason to allow this in addition to saving extra few keystrokes?
Matz.
In many meta programming scenarios you are not including or defining literals at top level but expressions and in methods, so it's not
class Class1 include Module1 define_method(:method1) attr_accessor(:attr1) end
but
def self.do_some_meta_programming(mod, method, attr) Class1.send(:include, mod) Class1.send(:define_method, method){} Class1.send(:attr_accessor, attr) end
So yes, :send, and :class_eval is less convenient and unnecessary. This is not the way to communicate that meta programming may have a performance penalty, the way to do that is documentation.
Updated by marcandre (Marc-Andre Lafortune) about 5 years ago
Hi,
As stated by bughit, a typical case where we have to resort to
send for these is in meta programming, say:
def self.included(base) base.send(:define_method, :foo) { ... } unless base.column_names.include?(:foo) end
Yukihiro Matsumoto wrote:
I still believeclass String include Term::ANSIColor end
is far better than
String.include Term::ANSIColor. It is clearer and has more space to optimize.
I respect your opinion. Please realize that not everybody agree with this though. I feel that
String.include Term::ANSIColor is clearer as it does one and one thing only. It's a single atomic operation. The
class ... form, for me, means "Reopen the class", followed by "include ANSIColor", followed by "ok, that's actually all we wanted to do for this class".
The same way some people will prefer
if some_condition do_this_single_thing end
I usually prefer
do_this_single_thing if some_condition
Typical scenario of a gem: define modules in
lib/my_gem/..., then in
lib/my_gem.rb:
require_relative 'lib/...' String.include MyGem::StringExtension SomethingElse.extend MyGem::Something
That is my preference over
require_relative 'lib/...' class String include MyGem::StringExtension end class SomethingElse extend MyGem::Something end
Here are some actual examples of other people that feel this way, from a quick github search:
etc.
The search returns over 2.6 million hits (but that includes a lot of duplicates):
Besides that the fact that
includeetc may have huge performance penalty is also a reason to prohibit casual class/module modification.
I'm afraid I don't see this; I feel that if a programmer is calling
include, then it is because
include is needed. It will be called no matter what. I doubt this prevented a single misuse of
include!
Is there any reason to allow this in addition to saving extra few keystrokes?
As I stated in my original request, I feel that calling
send is what should be discouraged, not
include. Using
public_send is fine, but needing to use
send means:
- I'm doing something I shouldn't be doing
- I'm calling a method that was not intended for me to call
- this might break or have unintended consequences, now or in the future
But classes are intended to be augmented, to have methods defined, to have plugins included in them. We shouldn't have to use
send to do that.
Updated by mrkn (Kenta Murata) almost 5 years ago
- Related to Feature #8846: Publicize Module#include added
Updated by shyouhei (Shyouhei Urabe) almost 5 years ago
- Related to Feature #6539: public and private for core methods added
Updated by shyouhei (Shyouhei Urabe) almost 5 years ago
Updated by marcandre (Marc-Andre Lafortune) almost 4 years ago
- Status changed from Feedback to Closed
Also available in: Atom PDF | https://bugs.ruby-lang.org/issues/12697 | CC-MAIN-2021-43 | refinedweb | 1,221 | 61.87 |
>
What I mean by this is my mouse can detect a gameObject when its under it with a script. I woud like to know if I can temporarly name the collided game object in this manner:
NewGameObject == Collided game object with mouse ray
I need this order to duplicate the excat game object under my mouse in this way:
GameObject GameObjectClone = Instantiate(NewGameObject, new Vector3, Quaternion);
Thank you!
Couldn't you just do GameObject GameObjectClone = Instantiate(CollidedGameObject, new Vector3, Quaternion); ?
NewGameObject == ...
What newobject ? didnt want to change the name?
Object.name = new name;
You need learn to explain yourself man....
Answer by nelson182
·
Jan 07 at 07:55 PM
Im sorry, I failed to say im a complete beginner so pardon my poor phrasing. For yotwerde: Is ''CollidedGameObject'' a function (if so I did not know of its existence) or are you telling me enter the name of my prefab (wich is what im trying to avoid as I want to duplicate the object under my mouse no matter what its name is). I will try it tonight but I welcome you to answer my first question anyway. For torment: No im trying to identifie the collided game object under ''NewGameObject'' so I can then instantiate a clone of that collided gameobject (NGO) as GameObjectClone with my second line of code. I want to then change the location of my clone go with a third line of code I did not write using localPosition.
I hope this explains better, thank you for replying in the first place.
To detect over which Game Object the mouse is, you could use the function OnMouseOver() (take a look at the example script in the link). You use OnMouseOver() just like the Start() function, but it is called every frame the mouse is over the Game Object the script is attached to.
Insert the function in a script which you give the object you want to detect and to copy that specific Game Object you just do GameObject cloneObject=Instantiate(gameObject, new Vector3, Quaternion), where gameObject is the variable that refers to the object the mouse is over, not the prefab (this code goes into the OnMouseOver() function). You can then do whatever you want with cloneObject (change position of the clone etc.).
GameObject cloneObject=Instantiate(gameObject, new Vector3, Quaternion)
I tried OnMouseOver but nothing happened. I learned through raycast solution that the canvas mode was giving me problem (I was on Overlay with OMO). Im now on World mode with raycast wich works for detecting the gameobject. I will try OMO again but if you could please answer my question that would be greatly appreciated.
I'm sorry but I don't understand what you're asking. I only understand that something went wrong with OMO.
You mention Raycasts, but when using OMO you don't need Raycasts at all. And when you're using Raycasts then you don't need OMO, you would take the RaycastHit object that you put into the parameters of Physics.Raycast() and to get the Game Object that was hit you would do hit.transform.gameObject;.
Could you please upload the script you're using to detect the Game Object the mouse is over? Would help a lot.
Answer by badadam
·
Jan 15 at 05:44 PM
Your should use tag not name so you can copy all objects copied from main object when you click. Give a tag name to your gameobject you want to copy.
Create a emptyobject add the script below to it as a component. And drag the main camera to camera variable in the script.
public class MouseControl : MonoBehaviour {
public Camera camera;
private RaycastHit raycastHit;
private void Update()
{
if (Input.GetMouseButtonDown(0))
{
Ray rayMouse = camera.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(rayMouse,out raycastHit))
{
if (raycastHit.collider.gameObject.tag=="myobjetag")
{
Vector3 newPos = raycastHit.collider.gameObject.transform.position + new Vector3(0,1,0);
GameObject obj2 = Instantiate(raycastHit.collider.gameObject, newPos .
Internal collisions
1
Answer
How to make my gabeobject collide?
1
Answer
Problem with Javascript updating variables.
1
Answer
How to get the 8 vertices coordinates of a box collider
1
Answer
Trigger GUI working wrong
1
Answer | https://answers.unity.com/questions/1587531/is-it-possible-to-name-a-collided-gameobject.html | CC-MAIN-2019-13 | refinedweb | 695 | 62.98 |
IRC log of forms on 2008-06-11
Timestamps are in UTC.
06:58:50 [RRSAgent]
RRSAgent has joined #forms
06:58:50 [RRSAgent]
logging to
06:59:21 [John_Boyer]
rrsagent, make log public
07:02:16 [wellsk]
wellsk has joined #forms
07:09:50 [klotz]
klotz has joined #forms
07:10:00 [ebruchez]
ebruchez has joined #forms
07:19:20 [Roger]
Roger has joined #forms
07:19:30 [Charlie]
Charlie has joined #forms
07:19:30 [klotz]
scribenick: klotz
07:20:13 [unl]
unl has joined #forms
07:20:13 [Rafael]
Rafael has joined #forms
07:20:35 [klotz]
topic: Streamlined Syntax
07:20:42 [Steven]
Steven has joined #forms
07:20:57 [klotz]
john: we've talked about an xforms aggregator module, really XForms Full Aggregator Module, and a Model Only.
07:21:14 [Steven]
rrsagent, make minutes
07:21:14 [RRSAgent]
I have made the request to generate
Steven
07:21:17 [klotz]
john: then a streamlined module, which adds all the additional attributes to ui controls.
07:21:42 [klotz]
john: does that seem like the right approach? add @relevant to input.
07:21:53 [klotz]
charlie: xf:input or html:input? that may imply a different driver, right?
07:22:13 [klotz]
charlie: it just occurs to me that i don't really recall where we had anticipated them going last month
07:22:20 [klotz]
john: i don't see why they can't go on our elements
07:22:27 [klotz]
charlie: as a streamlined syntax, it's one of our options
07:22:40 [klotz]
john: do we put all those attributes on our elements?
07:22:59 [klotz]
steven: we still have to discuss and resolve whether it's ok for us to import xforms wholesale into xhtml2
07:23:05 [klotz]
john: without namespaces
07:23:14 [klotz]
charlie: there are two uses, for ourselves, and as an onramp
07:23:41 [klotz]
leigh: i think xslt as a way to do it
07:24:22 [klotz]
erik: so what about namespaces? i see people using prefixes now. i don't necessarily agree, but if you want to inject stuff into an html serialization it make some sense. i don't disagree with a language having multiple serializations.
07:25:25 [klotz]
charlie: so we'd be less "religious" about the mechanics of how the concepts are injected into other applications if you implement the semantics. none of this takes away a need for a driver.
07:25:49 [klotz]
leigh: that's why i said that a description, prose or xslt, would be a fine way to describe the mapping of html+extra into xforms
07:26:04 [klotz]
john: so that module gives something for the transformation to aim at
07:26:41 [klotz]
john: we should have a talk about Nick's changes so we can look at them and see if they go into the streamlined syntax module and which go into core submission and core ui control
07:26:48 [klotz]
nick: it's not a lot of adjustments i've made
07:29:20 [klotz]
nick: [projects changes]
07:31:24 [klotz]
nick: i've created two new subsections, common submission attributes for submit and send (same table as before) and common submission child elements
07:31:54 [klotz]
leigh: is there a confusion between ref on submission and ref on submit
07:32:00 [klotz]
john: there is a difference
07:32:10 [klotz]
leigh: they're now defined in the same spot
07:32:20 [klotz]
steven: we use ref on submit
07:33:00 [klotz]
john: but it's a ui binding on submit and not on submission; you also have model attribute. do we now need model on submission? are we putting submission outside a model?
07:33:34 [klotz]
nick: no submission is still in model; i've made the resource optional and the submission element is still in the same place, with common attributes, but I need to redo it because of ref
07:33:37 [klotz]
leigh: and bind
07:33:56 [klotz]
john: it will combine with ref on submit; submit has ref/bind/model; submission doesn't have the model attribute.
07:33:57 [Steven]
Yesterday's minutes now in place at
07:34:02 [klotz]
nick: model wasn't in this list.
07:34:12 [klotz]
nick: then you can't override what is submitted.
07:34:20 [klotz]
charlie: so you use these on the submit element?
07:34:37 [klotz]
charlie: then put submission as child of submit; it will look a little weird but it will be clear
07:35:06 [klotz]
nick: i wrote that local submission elements override the referred submission so you can specify the resource locally.
07:36:24 [klotz]
leigh: so if we had a child submission element it would take precedence in its attributes over the id-referenced submission
07:36:30 [klotz]
charlie: or only its attributes if there is no reference
07:37:31 [klotz]
erik: I see, so you can bind the trigger to another node to control relevance and we'd lose that.
07:37:47 [klotz]
john: why isn't it backwards compatible?
07:37:50 [klotz]
nick: ...
07:38:01 [klotz]
john: you can still do it by using a full submission element.
07:38:29 [klotz]
erik: it has a different behavior for existing code: submit/@ref now implies the data to submit
07:39:30 [klotz]
uli: wouldn't it be much easier to include a child element of submission on submit
07:40:16 [klotz]
charlie: it's not clear where the events get dispatched, to the local submission or the model one; it's clearer when you put hte attributes on submit
07:40:30 [klotz]
erik: what was the initial goal for overriding attributes on the submit button?
07:40:48 [klotz]
nick: it was for streamlined syntax so you don't have to have a submission in the model
07:41:11 [Steven]
Meeting: Forms FtF, Amsterdam, Day 3
07:41:24 [klotz]
nick: it also allows you to change the src attribute in the submission for different submit controls
07:41:28 [Steven]
Chair: John
07:41:29 [klotz]
s/src/resource/
07:41:46 [klotz]
erik: so this is for no model, no submission, all ui?
07:42:07 [Steven]
Present: Charlie, John, Erik, Leigh, Nick, Rogelio, Rafael, Steven
07:42:15 [klotz]
john: i think we can just say ref doesn't override. then it's time to write a submission element.
07:42:23 [Steven]
Regrets: MarkS
07:42:26 [klotz]
charlie: i'm a little worried about special-casing it.
07:42:28 [Steven]
rrsagent, make minutes
07:42:28 [RRSAgent]
I have made the request to generate
Steven
07:43:10 [klotz]
erik: the nested element solution isn't good for simple syntax
07:43:24 [Steven]
Agenda:
07:43:36 [klotz]
john: this has to boil back down to input type="submit" with a couple of other attributes. ref isn't even going to be one of htem.
07:43:50 [klotz]
nick: are we making this change to submit or input?
07:43:54 [Steven]
Remote+Keith(remote)
07:44:12 [klotz]
john: it will happen from streamlined syntax
07:44:12 [klotz]
erik: but we don't have input type="submit"
07:44:31 [Steven]
rrsagent, make minutes
07:44:31 [RRSAgent]
I have made the request to generate
Steven
07:45:08 [klotz]
erik: xslt can produce a submission attribute
07:45:14 [Steven]
Present+Keith(remote)
07:45:23 [klotz]
nick: the sourceforge converter I posted does this, with modes in xslt
07:45:35 [Steven]
rrsagent, make minutes
07:45:35 [RRSAgent]
I have made the request to generate
Steven
07:46:29 [klotz]
john: so it should be possible to write the html or xhtml module for xforms to do this
07:46:52 [klotz]
erik: so input type="submit" is equivalent
07:48:57 [klotz]
leigh: if this is for hte onramp it should be doable with an xslt or a javascript library; for xhtm2 a module is fine
07:49:11 [Steven]
s/hte/the/
07:49:14 [klotz]
erik: so what is the next step for an existing html form? input type="submit". so what's t next step
07:49:56 [klotz]
john: that implies that we should have an input type="submit" that maps on to submission
07:50:49 [klotz]
leigh: we can define our own input type="submit"
07:55:34 [klotz]
leigh: but who would use it? i can understand an xslt that maps html4 input type="submit"
07:56:09 [klotz]
leigh: i can understand a module of xforms core additional support for the output of that transformation
07:56:39 [klotz]
leigh: but i can't understand a module that adds xf:input type="submit" to xforms; who would use it?
07:58:23 [klotz]
charlie: but we want a streamlined syntax for our xforms authors
07:58:48 [klotz]
steven: is it a moment of simplification and a lifetime of grief?
07:59:53 [Steven]
I don't see what it simplifies; MVC gives you long-term simflification
08:00:19 [Steven]
I see streamlines syntax as adding the font tag back into xhtml to help people us stylesheets!
08:00:24 [Steven]
s/lines/lined/
08:00:33 [Steven]
s/us /use /
08:01:36 [klotz]
leigh: i think it's fine to have an html4 syntax library in javascript and an xslt or prose transformation to core xforms, but i don't see that the html4 syntax with javascript is the exact same sequence of characters that should appear in an xforms simplified syntax
08:01:48 [klotz]
uli: is this xml?
08:02:30 [klotz]
john: xml well-formedness is an illusion. they can use the same tags and attributes. they shouldn't have to throw out tag names and switch to xml and give up on attributes.
08:09:29 [klotz]
leigh: i can see the value of the xslt to convert html+stuff into xforms, and the value of a JS implementation of hte same, but no value in an XForms module that adds the exact same attributes to XForms
08:09:46 [klotz]
charlie: but we want a simplified syntax
08:10:14 [nick]
08:10:16 [klotz]
leigh: yes, that's great, but it's not necessarily the same syntax as the additions to html4.
08:11:31 [klotz]
leigh: so I think there should be an XSLT or XSLT-in-prose for converting HTML4+attributes into canonical XForms, and a module that adds any necessary support for that, and an OSS JS library that for some high percentage of cases works the same in HTML4 browsers, and the XSLT could be a W3C note or even a non-W3C Note, but it's not a module of XForms
08:11:45 [klotz]
leigh: Mark Birbeck and Paul Butcher arrive
08:16:26 [Steven]
present+MarkBirbeck
08:17:09 [Steven]
present+PaulButcher
08:17:18 [Steven]
rrsagent, make minutes
08:17:18 [RRSAgent]
I have made the request to generate
Steven
08:21:23 [markbirbeck]
markbirbeck has joined #forms
08:23:43 [markbirbeck]
Hey Keith. Are you managing to stay awake?
08:23:58 [markbirbeck]
:)
08:37:03 [klotz]
mark: I think we should have a legacy module, as in XHTML2, to fully describe the HTML4 forms and it would be optional to implement, but it's an important part of the onramp. An XSLT wrapping isn't the same.
08:37:10 [klotz]
Erik: The DOM is different for example
08:37:52 [klotz]
Nick: There are some HTML4 attributes that are hard to implement.
08:38:31 [klotz]
leigh: I had thought we were going to implement features necessary to transform HTML4 into canonical XForms but just not maintain the HTML4 syntax as a spec.
08:38:42 [klotz]
paul: What attributes are hard to implement?
08:38:50 [klotz]
Erik: I see more of a jump than a progressive ramping up
08:39:28 [klotz]
mark: We've been doing those kinds of things...nobody's produced the finished example yet, but there's been discussion about those kinds of iterative steps
08:39:58 [klotz]
Erik: maybe it's my fault but I don't have it in mind. i think this discussion started with Nick's work on xf:submit and I didn't see how this helped us
08:40:46 [klotz]
Mark: This i old ground...we agreed there are two sides: now HTML form processing (model, logic, lifecycle, events) maps to XForms, and then if there are features in XForms that need tweaking to accommodate the symmetry.
08:41:21 [klotz]
Erik: But the submission can be done with a submission and a submit both, since it turns out we really want input type="submit"
08:41:55 [klotz]
John: I don't want gratuitous differences between submit and input type="submit" so we should add them to both. There are certainly differences between core xforms and streamlined syntax.
08:42:53 [klotz]
John: For the simplification of core xforms tasks, unless there's a good reason to deviate, we should make an effort to make it look the same in both xforms simplified syntax and html4.
08:43:11 [klotz]
Leigh: I don't agree iwth the goal but 40% of example can convince me.
08:43:14 [klotz]
s/iwth/with
08:45:11 [klotz]
Mark: You have to have quite a bit of stuff on the plate to get, for example, a range in a form, then you need to know a lot of stuff.
08:48:10 [klotz]
Leigh: That's the core Canonicalization problem.
08:49:26 [klotz]
Leigh: But the question is whether the xforms simplification and the html4 complification result in the same language; I don't think so, but it's fine for John to want us to go that way for to keep trying for it as a goal, but I think it's a something has to be shown.
08:49:35 [klotz]
Erik: ...
08:49:36 [klotz]
Nick: ..
08:49:38 [klotz]
Leigh: ...
08:50:11 [klotz]
Mark: We're aiming at unobtrusive JavaScript, not arbitrary stuff. We're in the same space and direction and world view as these libraries. We're saying we should attach a particular type of model to this.
08:50:38 [klotz]
Nick: So the goal of ubiquity is an existing html form with all the javascript working? don't you have DOM problems?
08:51:34 [klotz]
Mark: In the modern libraries, it doesn't use the form submission; they use XHR. So they've already marshalled the normal flow. I can say that I can give you an event to start submission and some of them are doing this. We follow the specification for the specification.
08:51:57 [klotz]
Erik: But you're talking about how to implement ubiquity
08:52:39 [klotz]
John: We started this with a discussion of submission attributes on submit and that didn't work because of @ref. Then we talked about adding submission as a child element of submit, but I said that simplification looks different and isn't tag-parallel with input type="submit"
08:53:16 [klotz]
John: So when we do XForms simplifications that aren't going to match HTML complifications, how seriously do we take that problem? That's all we have to resolve here.
08:53:35 [klotz]
Uli: For me the main point is to simplify the syntax without a model, as Mark said. Bt I'm not concerned about HTML4.
09:02:47 [klotz]
Charlie: That's what gets us where we are. But my main concern about Leigh's two tracks is that unless we actively grow it, are we ...
09:02:49 [klotz]
Mark: ...
09:02:53 [klotz]
Leigh: ...
09:03:25 [klotz]
Paul: I'd like to ask about ref on submit and submission. If you're calling submit with these shorthand submission attributes, you're not going to lose behavior on submit by binding it to a particular node.
09:03:59 [klotz]
Nick: The attributes that are local override the submission. In XForms 1.0 or 1.1 you can already have a ref attribute on submit for relevance, so in 1.2 that will override the submission ref.
09:04:05 [klotz]
Paul: OK
09:04:25 [klotz]
Erik: One solution was to say that ref and bind are not overridden; that's possible from a spec level but it doesn't work for authors.
09:04:43 [klotz]
Mark: What's the driving force for the abbreviated syntax?
09:04:47 [klotz]
Leigh: My question exactly
09:05:09 [klotz]
Charlie: It's not a simplification for the onramp. It's a good example of simplification for XForms that's misaligned with the "complification" track.
09:06:03 [klotz]
Mark: We already have a potential child element, send, and the attributes could go there.
09:06:09 [klotz]
Charlie: That also solves the event dispatch problem
09:06:23 [klotz]
John: How does it simplify anything?
09:07:01 [klotz]
Mark: I don't care too much about it anyway as I'm concerned on the HTML transformation
09:07:11 [klotz]
Erik: submit is simplified syntax for trigger+send
09:07:15 [klotz]
Mark: So why complicate it?
09:07:25 [klotz]
John: Because it doesn't have a submission element.
09:07:30 [klotz]
Mark: So what's wrong?
09:08:00 [klotz]
John: I'd rather attack it in the reverse direction. What do we want input type="submit" to look like? Then how do we write that without a submission?
09:08:32 [klotz]
John: Do we need to make cdata-section-elements on submit? Really we only want 2 or 3 on input type="submit" and put those on submit and be done.
09:08:59 [klotz]
Erik: We tried that with the form element. So input type="submit" is all we need.
09:09:28 [klotz]
John: People know stuff about HTML forms today; they want to evolve their capabilities and add it one at a time via attributes
09:09:30 [klotz]
Uli: via javascript libraries
09:10:11 [klotz]
Mark: Dojo could add that feature, an xforms attribute in an unobtrusive javascript library on form. So it's an ideal gradual onramp to add attributes to the form element.
09:10:25 [klotz]
Nick: Nobody uses the action attribute on a form anyway; everybody uses javascript
09:10:52 [klotz]
Mark: You put it in the form action and the javascript does extra clever stuff.
09:11:29 [klotz]
Steven: But don't unknown attributes disappear from the dom in HTML5?
09:11:42 [klotz]
Steven: So doesn't that break adding attributes processed via Javascript?
09:11:48 [klotz]
* Break
09:16:57 [klotz]
Charlie: I quite like this idea of a deprecated chapter.
09:17:09 [klotz]
John: What's the difference between a chapter and another module?
09:17:52 [klotz]
Uli: I thought the idea of modules, for message, for example, does it start an xforms processor?
09:18:11 [klotz]
John: It causes a set of markup to begin working in an implementation specific way.
09:18:49 [klotz]
John: It's not done until we agree it's done...similar to the IDL discussion we had.
09:20:14 [klotz]
John: To control the one submission, it's ok but the submit element lets you say you have more than one.
09:20:21 [klotz]
Erik: Then you create a submission.
09:21:10 [klotz]
John: I'm not necessarily against it. The form element
09:24:41 [klotz]
Leigh: Aren't we automating hte past? We heard from Nick and Mark that people are not doing a lot of work using form/@action but the libraries in Javascript instead, and the behaviors emerging from that may be a better target.
09:35:09 [klotz]
Erik: I see the power of XForms as a way to make bigger forms, not for small form authors.
09:35:10 [klotz]
...
09:35:33 [klotz]
Leigh: I don't see the attributes added to HTML4 necessary to add to core XForms.
09:35:57 [klotz]
Mark: How about an XHTML1.1 module of attributes from XForms?
09:36:16 [klotz]
Charlie: That's what we're proposing but a twist, an XHTML1.1 module, not an XForms module.
09:36:26 [klotz]
leigh: it's a key difference, not a twist.
09:37:53 [klotz]
Charlie: Then we get 40% of the way, as Leigh says, and step back and see if we want to incorporate some of that back into XForms, but that document is a formal work product for us for our charter.
09:41:40 [klotz]
Mark: My proposal was to have a series of modules for XHTML11, not just one module. One for submission attributes, one for message, etc.
09:43:02 [klotz]
Erik: Should we be using the webforms attribute names?
09:43:48 [klotz]
Mark: If they make sense, but the issue is there is an underlying model and MVC and dependency graph in XForms and webforms has this work with events and elements talking to each other.
09:44:06 [klotz]
Charlie: So can we agree to produce the XHTML modules?
09:44:13 [klotz]
Nick: We agreed in Raleigh.
09:44:18 [klotz]
Charlie: That was modules for XForms.
09:44:31 [klotz]
Nick: There is still work, which Mark did, but no concrete module.
09:44:38 [klotz]
John: There is the syntax example for PO.
09:44:51 [klotz]
John: Now we have more clarity and can turn that into a module.
09:45:16 [klotz]
Mark: Sticking with something smaller, submission attributes and message. name and others bring more stuff. Just get one module out, a smaller one.
09:45:52 [klotz]
John: We spent a fair bit of time yesterday...we went through the submission attributes. Some were associated with submission, and some were validity, data, etc modules.
09:46:04 [klotz]
John: So you could have submission without data.
09:46:13 [klotz]
Charlie: We have that yesterday.
09:47:01 [klotz]
Mark: So that would be perfect for XHTML.
09:47:01 [klotz]
Mark: We could have an XHTML modularization module with several attributes, no ref.
09:47:02 [klotz]
Charlie: We did that yesterday for XForms; we can use it on XHTML. Then we go on and do another one.
09:47:08 [klotz]
Mark: Not in the same module.
09:47:18 [klotz]
Charlie: Yes.
09:47:33 [klotz]
John: Does wrap up mean a rec-track document?
09:47:38 [klotz]
Leigh: Yes, that's what Mark is saying.
09:48:43 [klotz]
Mark: Role is a good example; it started with Raman and Steven, but then we added RDF, and then Shane got involved for modularization. Now they put in HTML5. tey have their own specification. So when things are small enough and nimble they're more easily adopted.
09:48:58 [Steven]
s/tey/they/
09:49:25 [klotz]
Erik: I have a question about hte XHTML module. One issue is providing the module. Another is adding hte ramping up, submission elements, repeat, model, etc. Where do we say how this is glued together?
09:49:44 [Steven]
s/ hte / the /G
09:50:05 [klotz]
Mark: If you follow xhtml modularization each spec has to say something about the glue.
09:50:59 [wellsk]
much better
09:51:01 [klotz]
Mark: So maybe we should just pick the uncontroversial attributes, the ones you did yesterday.
09:51:17 [klotz]
Charlie: We scrubbed the modelness out of it.
09:51:51 [klotz]
John: We created the map in the wiki. We'll have to start the work party to create this module, and then there's changing core xforms to be more like the map we've created.
09:52:28 [klotz]
John: Having that module fully developed would be helpful. We saw the XHTML2 modularization and bits look like what we've done in XForms spec. It would be good to have that module written here this week.
09:52:38 [klotz]
Mark: We can use the role attribute as a model.
09:52:51 [klotz]
John: Is it in SpecXML?
09:52:53 [klotz]
Steven: no.
09:53:07 [Steven]
It is in ShaneML
09:53:26 [klotz]
Erik: We have three attributes from wherever; what about xforms submission? Does that stay ? Does it get imported into HTML?
09:53:36 [klotz]
Mark: I believe so. Then it can be imported into SVG, as in the backplane.
09:54:08 [klotz]
Erik: We use terms such as driver or aggregator; it's pretty clear we're going to have that for XForms 1.2. Now we need another one for integrating.
09:54:57 [klotz]
John: For leaf nodes like role, it wasn't very hard. For submission module, there's a group of attributes and child elements that define core submission. if you want to use submission in combination with relevance, validity, or instance module, then you more modules.
09:55:55 [klotz]
John: So you need it seems a higher-level module that pulls together relevance, validity, instance and submission, and then the adds the elements. Erik points out this happens on the XHTML2 side and we can't create a half-dozen specs and see how to combine three of them without another spec.
09:56:31 [klotz]
Mark: In the HTML world it doesn't us ethe same data model (submission) . It's not obviously hierarchical. One problem is that we've used the same attribute name to do different things.
09:56:58 [klotz]
Mark: Let's say ref was used to bind to the data model. So ref on a div or span or svg doesn't matter.
09:57:13 [klotz]
Charlie: We wanted to avoid the submission module knowing about refs.
09:57:24 [klotz]
Charlie: There's a tipping point; at some point you need a place to put that logic.
09:57:57 [klotz]
Erik: That's what I had in mind for the small modules. But what about html input name? We want a flat XML document; we redefine or recast existing things.
09:58:04 [klotz]
John: Those are prose descriptions.
09:58:20 [klotz]
Erik: Then if we include this module, input name creates this data model in the background.
09:58:27 [klotz]
Mark: Submission doesn't care about its data model.
09:58:33 [klotz]
Erik: It assumes it's a data model.
09:58:42 [klotz]
Mark: It's capable of transmitting XML but it can do other things.
09:58:46 [klotz]
Erik: It's not JSON, it's XML.
09:59:04 [klotz]
Mark: We don't have a submission module, but if we did, it wouldn't start with XML. It would start with "something"
09:59:26 [klotz]
Paul: In that sort of module, where do you see relevance and validity? That's about submission?
10:00:08 [klotz]
John: This afternoon we should have the work jam where we look at the module breakdown.
10:01:22 [klotz]
Erik: It seems like a huge amount of work to make submission work with arbitrary data models. We tried that and stopped.
10:01:46 [klotz]
Mark: You want to be explicit about the values in attributes, the names of events, and where they occur, but leave open what's transmitted.
10:02:08 [klotz]
Erik: I can see ideally having that goal. Is it a goal of this group to handle json? If it's a sentence or two, that's fine.
10:02:24 [klotz]
Erik: When we looked at IDL for the data module, we found we'd have to write an XPath API and that wasn't our job.
10:03:51 [klotz]
Erik: And it's not clear that an XPath API is suitable for a JSON data model anyway.
10:03:55 [klotz]
* Lunch
10:04:10 [klotz]
s/* Lunch//
10:06:55 [klotz]
Paul: Can we consider submission and serialization as two separate modules?
10:07:28 [klotz]
Erik: Does this group need to worry about JSON and YAML and everything? In theory we could break up submission into many parts, based on the lifecycle.
10:08:22 [klotz]
Mark: I like Erik's hierarchy description. In theory there could be a markup version of javacsript submission. It's no tour submission because it doesn't do validation, etc. Erik asks if it's our place to define it, but it seems useful for ourselves.
10:08:30 [klotz]
Erik: Just the time and energy.
10:09:12 [klotz]
Erik: I just think it's a lot of effort.
10:09:18 [klotz]
Mark: It would be for adoption.
10:10:38 [klotz]
Mark: Having a markup version of XHR doesn't solve any particular problem, but it begins to chip away at non-standard languages and you get XForms in many places.
10:11:16 [klotz]
Erik: People take what is working and use it, like Dojo.
10:11:47 [klotz]
Charlie: Yes, but people with experience with things like dojo find complexity and want to look for something up a level. It's not an XForms pure play either.
10:12:14 [klotz]
Erik: XForms has complexity as well: we need dialogs, model packaging, etc. Providing submission to others doesn't solve my problems.
10:12:49 [klotz]
Charlie: People will pick up on Flex and Silverlight as pure plays, but I don't see Xforms as a viable competitor unless we have an way to get started.
10:13:32 [klotz]
Erik: XForms does well for forms. I'm not sure Silverlight and Flex are good for forms.
10:13:54 [klotz]
Mark: I'm not sure that's competition. I saw someone with their own framework for text for help, etc. All done in PHP.
10:14:52 [klotz]
Mark: He could have used less PHP and more Dojo, but then he'd have to commit. A standard language would help isolate that.
10:15:04 [klotz]
Charlie: I'm surprised to hear that rich web app pure plays are not competitors.
10:15:29 [klotz]
Mark: It's the architecture. When we've got these architectures going, we can be the onramp for silverlight.
10:16:00 [klotz]
Mark: Flex is different because it is the entire thing.
10:17:00 [klotz]
Erik: Every language is getting bigger and looking for things like namespaces. Calling a submission declaratively in Javscript doesn't solve it for me. I'd rather see help for complexity.
10:17:22 [klotz]
Mark: I agree; src for model is something I've talked about.
10:17:45 [klotz]
John: Why did you boot it out of 1.2, nested modules?
10:17:50 [klotz]
Erik: The whole 1.2 thing isn't it for me.
10:22:51 [klotz]
Leigh: It's natural that Erik would have different interests because he has immediate customer needs, and Charlie is worried about the strategic issue of adoption.
10:23:08 [klotz]
Erik: I'm concerned about all the time I see on modularization and it's not something I want to work on.
10:23:22 [klotz]
Erik: Who here wants to work on HTML compatibility?
10:23:33 [klotz]
John: I agree with Mark that we want more customers.
10:23:48 [klotz]
Erik: Maybe you're achieving this with ubiquity.
10:24:22 [klotz]
John: It's one solution proposed. There were two main complaints about xforms: browser availability and authoring ability.
10:24:27 [klotz]
Erik: Simplification is great.
10:24:50 [klotz]
John: It's a pre-sales problem.
10:28:57 [klotz]
Leigh: I think at this point in the WG life, after 10 years, we should be standardizing implementations based on implementation experience, not working forward from spec XML by committee to start with implementations. If you want a message module, make a message module implementation and show that it works and we'll write the document.
10:29:18 [klotz]
Erik: XProc is moving forward in this way.
10:30:36 [klotz]
John: We're supposed to be the next generation of web forms. We have a different problem. We have a whole bunch of implementations of web forms. All we're trying to do is tease apart the thing we have. It's like a failure of object orientation. Rather than figuring out what we're doing, we add three more variables. It seems like less of a crime every time until you suddenly end up with a class with 20,000 lines and 300 variables.
10:30:50 [klotz]
John: You spend a year and a half trying to modularize everything.
10:31:06 [klotz]
Erik: I don't have that problem. I have the problem of 10,000 line forms.
10:31:19 [klotz]
John: So you don't have modularization within the form.
10:36:21 [prb]
prb has joined #forms
10:43:02 [Steven]
prb is Paul Butcher, webBackplane
12:22:56 [wellsk]
wellsk has joined #forms
12:31:59 [Charlie]
Charlie has joined #forms
12:32:22 [klotz]
klotz has joined #forms
12:34:13 [unl]
unl has joined #forms
12:38:18 [prb]
prb has joined #forms
12:38:26 [John_Boyer]
John_Boyer has joined #forms
12:49:02 [nick]
13:14:52 [Steven]
Steven has joined #forms
13:31:28 [nick]
scribe: nick
13:32:56 [John_Boyer]
13:33:36 [nick]
Topic:Review of XML Http Request
13:33:49 [nick]
s/Topic/TOPIC/
13:34:53 [nick]
MarkB: Reading the spec it looks like they are documenting the current implementations in the current Browsers (based op the MS version)
13:35:32 [nick]
MarkB: Our comments can't be 'they should add event X'
13:36:04 [nick]
MarkB: We should comment on problems that prevent us re-using the spec
13:36:46 [nick]
MarkB: They depend on HTML5 and the Window object which is a problem for us to reuse it
13:37:59 [nick]
MarkB: We should sent a positive response asking to remove the unnecessary dependencies
13:38:32 [nick]
MarkB: We should use it in future versions
13:39:15 [nick]
MarkB: They are already thinking about future versions of the spec
13:39:38 [nick]
MarkB: We should give input on it
13:40:05 [nick]
Charlie: We shouldn't have a one on one mapping if they add events, we could wrap their evenets
13:40:15 [nick]
s/evenets/events/
13:41:31 [nick]
Charlie: Do you think their dependency on window or HTML5 is political
13:41:42 [nick]
MarkB: I think so
13:42:27 [nick]
MarkB: We should say it is good, but the spec should be the object itself. The instantiation should be in the spec that uses this spec
13:43:24 [nick]
Leigh: They can give an abstract spec and add a javascript binding
13:43:48 [nick]
MarkB: They depend on HTML5 because window is defined in it
13:44:41 [nick]
John: LC period is over, but the HTC gave us an extension, so we have to report soon
13:44:48 [nick]
MarkB: I can do it today
13:46:08 [nick]
ACTION: MarkB to respond by Friday 13 June with our comments for Review of XML Http Request
13:46:08 [trackbot]
Sorry, couldn't find user - MarkB
13:47:36 [nick]
John: You want to send some comments on the base URI?
13:49:33 [nick]
MarkB: Yes, the request uses the security using the domain. If we decouple it we want to be more flexible, we want to give the base URI when we create the object used for the security
13:50:28 [nick]
John: Isn't it a security problem?
13:50:45 [nick]
MarkB: It could be read-only in a browser environment?
13:51:22 [nick]
John: Do you not always have a containing document, which provides the base URI
13:51:29 [nick]
Uli: Server side javascript
13:51:33 [nick]
John: OK
13:51:47 [nick]
MarkB: In sidewinder ....
13:52:36 [nick]
MarkB: Explains how a relative URI is resolved in an XML application
13:52:51 [Steven]
rrsagent, here?
13:52:51 [RRSAgent]
See
13:53:46 [nick]
TOPIC: Review of XML Events 2
13:53:53 [nick]
13:54:15 [nick]
13:54:47 [nick]
Charlie: Most is editorial, the spec is overall good
13:55:43 [nick]
13:56:48 [nick]
Charlie: introduction section
13:57:35 [nick]
Charlie:The text isn't up to date with Event flow in DOM3
13:58:47 [nick]
John: The actual diagram still lets me believe that capture goes to the target, which isn't the case
13:59:11 [nick]
MarkB: XML events 2 is based on DOM 2 events
14:00:25 [nick]
... (differences between DOM 3 events and DOM 2 events, groups, hierarchy)
14:00:45 [nick]
John: The abstract states DOM level 3 events
14:01:09 [nick]
MarkB: When we wrote this DOM level 3 didn't had three phases
14:01:54 [nick]
John: DOM level 3 clearly states that capture doesn't goes to the target
14:02:42 [nick]
MarkB: There is a flag atTarget in DOM level 2 events
14:03:17 [nick]
MarkB: DOM level 3 has a notion of a third phase, this is a problem
14:04:27 [nick]
John: The target phase of DOM level 3 is bubble and atTarget in DOM level 2
14:05:23 [nick]
Charlie: Should we request an other version that is based on DOM level 2
14:05:49 [nick]
Steven: XML events is just a syntax
14:07:01 [nick]
MarkB: We should send a comment that DOM level 3 is required, DOM level 2 should be enough
14:07:58 [nick]
John: I would have hoped that events could flow between different documents without changing the phase
14:08:38 [nick]
John: At the cut point the event goes in target phase, this is a problem
14:09:04 [nick]
MarkB: This is well documented in XBL
14:10:27 [nick]
MarkB: He has the notion of forwarding, but you don't need it you can also hide it
14:10:50 [nick]
MarkB: We do this a lot with HTML events
14:11:38 [nick]
John: Is it available somewhere else then in XBL
14:11:51 [nick]
MarkB: NO, maybe it should be in XML events 2
14:11:57 [nick]
John: I think so
14:12:14 [nick]
MarkB: Add it to the comment we send
14:13:01 [nick]
Charlie: Are you allowed to listen for events in another DOM?
14:13:14 [nick]
s/DOM/DOM tree/
14:14:15 [nick]
... talking about remote handlers and remote observers
14:15:38 [nick]
Leigh: XML events just specify that it is just id, does it requires to be in the some DOM, can't we just add an extra attribute
14:16:22 [nick]
Leigh: The resolving can be taking care of by the language
14:16:55 [nick]
MarkB: Observer should be a URI i think
14:17:43 [nick]
MarkB: You should threat as an identifier
14:18:26 [nick]
Steven: It is a security issue
14:18:57 [nick]
MarkB: This can be handled by the engine
14:19:15 [nick]
John: In XForms we have a sandbox of DOMs
14:21:01 [Steven]
s/threat/treat/
14:21:03 [nick]
John: We send xforms-insert and xforms-delete to the instance element not the node because it is in a different DOM tree
14:21:34 [nick]
John: You should be able to say which dom
14:21:48 [nick]
Charlie: you should be able to use XPath to address
14:22:42 [nick]
Paul: XPointer
14:23:20 [nick]
MarkB: I wonder if we can turn everything in XPointer and be backward compatible
14:23:46 [nick]
... for observer and ...
14:24:10 [nick]
Charlie: I have a couple of other editorial comments
14:24:23 [John_Boyer]
It has also been a problem that ev:target was an ID
14:24:39 [Steven]
How was that a problem John?
14:24:53 [John_Boyer]
This is the context for MarkB's comment about turning everything into an XPointer
14:25:00 [John_Boyer]
It is a problem because
14:25:02 [Steven]
Oh I see
14:25:11 [Steven]
Just being able to locate elements without an ID
14:25:38 [John_Boyer]
if I want to observe an event on repeat element but don't want to set it up as a child of repeat
14:25:50 [John_Boyer]
then I have to use ev:target with ID to indicate the repeat
14:26:28 [nick]
Paul: Aren't they classified by name
14:26:53 [nick]
MarkB: But then you need to know all events in front
14:27:56 [nick]
Charlie where done
14:29:32 [nick]
Leigh: Are you going to clarify how ID resolution is done in XML events 2
14:30:41 [nick]
MarkB: Itis section 6 after the editors note
14:31:19 [nick]
Paul: How is the context node found?
14:31:31 [nick]
MarkB: There isn't one
14:32:10 [nick]
* break
14:39:50 [unl]
unl has joined #forms
14:52:46 [nick]
TOPIC: Review of CURIE
14:53:37 [nick]
14:53:49 [nick]
John: Can we send this response
14:54:10 [nick]
Leigh: Should I sent it, or could you do it
14:54:44 [nick]
John: You can do it?
14:55:34 [John_Boyer]
14:56:53 [nick]
TOPIC: Determine relationship of encoding, charset and SOAP
14:57:06 [nick]
John: Paul can you help us?
14:57:33 [nick]
14:59:47 [nick]
15:05:32 [smaug]
smaug has joined #forms
15:08:01 [nick]
TOPIC: XForms Schema data-types
15:08:16 [nick]
Discussion about empty strings
15:08:37 [nick]
MarkB: It is a hack to allow the empty string in the schema data types
15:08:53 [nick]
MarkB: We should create emailOrEmpty
15:09:32 [nick]
John: We decided a long time ago that the xforms data-types should include the empty string
15:10:06 [nick]
MarkB: What is done is done, we can't do much about it
15:10:33 [nick]
Leigh: It is already decided
15:12:40 [nick]
Leigh: We can do that with minOccurrence
15:12:58 [nick]
MarkB: it doesn't apply on list, a list can be empty
15:13:14 [nick]
Leigh: OK, then we don't need to change it
15:13:39 [smaug]
Has anyone gone through the comments I sent over a year go about XML Events 2
?
15:14:28 [Steven]
Hi Smaug, who are you?
15:15:04 [Steven]
Ah, Olli Pettay
15:15:45 [nick]
MarkB: It looks that a list can't be empty and that min and max occurrences applies on it
15:16:12 [nick]
Markb: minLength can be applied on list (this is what we need)
15:16:45 [smaug]
Steven: right
15:17:32 [smaug]
I think the problem mentioned in the latter email is fixed
15:17:43 [smaug]
but not the problems mentioned in the first one
15:19:26 [Steven]
It looks like you sent the comments to the wrong list Smaug
15:19:40 [smaug]
oh
15:19:58 [Steven]
should have been www-html-editor
15:20:12 [smaug]
well, I sent those to markb too
15:20:20 [markbirbeck]
15:20:32 [markbirbeck]
"Any property identified as a having a set, subset or ·list· value may have an empty value unless this is explicitly ruled out: this is not the same as absent."
15:20:43 [Steven]
true, but www-html-editor mails get forwarded to the issue tracker
15:20:50 [markbirbeck]
So listItems can already be empty.
15:22:31 [nick]
So listitems allows the empty string
15:23:26 [nick]
John: listitem doesn't allows the empty string, but if the group thinks we can keep it like it is
15:24:57 [nick]
TOPIC: Submission @resource comment to RDFa
15:25:23 [nick]
15:26:12 [nick]
John: MarkB I want to make sure that we still believe that it just a comment to RDFa and we don't have not to change anything
15:29:22 [nick]
MarkB: As far as the RDFa group there is no problem
15:30:55 [nick]
MarkB: There is no behavior consequence in RDFa for the resource attribute
15:33:06 [nick]
John: Maybe there is nothing to say about it
15:33:15 [nick]
John: So it is done
15:35:29 [smaug]
Steven: should I resend the comments to www-html-editor?
15:40:19 [nick]
*meeting ends
15:41:19 [nick]
rrsagent, make minutes
15:41:19 [RRSAgent]
I have made the request to generate
nick
15:41:26 [nick]
zakim, bye
15:41:37 [nick]
rrsagent, bye
15:41:37 [RRSAgent]
I see 1 open action item saved in
:
15:41:37 [RRSAgent]
ACTION: MarkB to respond by Friday 13 June with our comments for Review of XML Http Request [1]
15:41:37 [RRSAgent]
recorded in | http://www.w3.org/2008/06/11-forms-irc | CC-MAIN-2022-40 | refinedweb | 7,649 | 74.63 |
On Tue, Feb 28, 2012 at 11:06 AM, Jukka Zitting <jukka.zitting@gmail.com>wrote:
> Hi,
>
> On Tue, Feb 28, 2012 at 9:59 AM, Alex Karasulu <akarasulu@apache.org>
> wrote:
> > Cloudera's compatibility issues are not our problem. These packages need
> to
> > go.
>
> Citation needed.
I did not think we needed one: nor do I have one. It's common sense to me
that this causes issues. It combines the namespace of a foreign mark with
our own. We should not be releasing anything in the namespace belonging to
another entity.
> Without a written policy to that effect these things
> are up for each project to decide. Jarek's rationale sounds perfectly
> fine to me.
>
>
I highly respect you opinion here but I disagree regarding this argument
provided. There may be no policy to cite, and there may be examples of
where this was done before for the sake of backwards compatibility. It
still does not justify doing it.
> We have plenty of projects that provide such backwards compatibility
> wrappers or otherwise put stuff in non-apache namespaces for various
> reasons. See for example [1] or [2].
>
>
Understood. Examples are solid points supporting the argument but IMHO I
think this was a mistake that opens the door to several issues. Maybe we
need some clear policy regarding the matter. I'm more than ready to be
proven wrong on this matter so long as it does not present problems down
the line for us.
> [1]
>
> [2]
>
> BR,
>
> Jukka Zitting
>
>
--
Best Regards,
-- Alex | http://mail-archives.apache.org/mod_mbox/incubator-general/201202.mbox/%3CCADwPi+HRRsf53rzmyPEs+QTyRuddFcQn2bT4cjwbgPGNodqNug@mail.gmail.com%3E | CC-MAIN-2017-22 | refinedweb | 254 | 67.04 |
------------------------------------------------------------------------------- -- Copyright (c) 1998: NEWS,v 1.1320 2008/11/02 00:56:22 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started working with Pavel Curtis' original work, pcurses, in 1992. Changes through 1.9.9e are recorded by Zeyd M Ben-Halim. Changes since 1.9.9e are recorded by Thomas E Dickey. Contributors include those who have provided patches (even small ones), as well as those who provide useful information (bug reports, analyses). Changes with no cited author are the work of Thomas E Dickey (TD). A few contributors are given in this file by their initials. They each account for one percent or more of the changes since 1.9.9e. See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information.). + modify some modules to allow them to be reentrant if _REENTRANT is defined: lib_baudrate.c, resizeterm.c (local data only) + eliminate static data from some modules: add_tries.c, hardscroll.c, lib_ttyflags.c, lib_twait.c + improve manpage install to add aliases for the transformed program names, e.g., from --program-prefix. + used linklint to verify links in the HTML documentation, made fixes to manpages as needed. + fix a typo in curs_mouse.3x (report by William McBrine). + fix install-rule for ncurses5-config to make the bin-directory. 20061223 + modify configure script to omit the tic (terminfo compiler) support from ncurses library if --without-progs option is given. + modify install rule for ncurses5-config to do this via "install.libs" + modify shared-library rules to allow FreeBSD 3.x to use rpath. + update config.guess, config.sub 20061217 5.6 release for upload to 20061217 + add ifdef's for <wctype.h> for HPUX, which has the corresponding definitions in <wchar.h>. + revert the va_copy() change from 20061202, since it was neither correct nor portable. + add $(LOCAL_LIBS) definition to progs/Makefile.in, needed for rpath on Solaris. + ignore wide-acs line-drawing characters that wcwidth() claims are not one-column. This is a workaround for Solaris' broken locale support. 20061216 + modify configure --with-gpm option to allow it to accept a parameter, i.e., the name of the dynamic GPM library to load via dlopen() (requested by Bryan Henderson). + add configure option --with-valgrind, changes from vile. + modify configure script AC_TRY_RUN and AC_TRY_LINK checks to use 'return' in preference to 'exit()'. 20061209 + change default for --with-develop back to "no". + add XTABS to tracing of TTY bits. + updated autoconf patch to ifdef-out the misfeature which declares exit() for configure tests. This fixes a redefinition warning on Solaris. + use ${CC} rather than ${LD} in shared library rules for IRIX64, Solaris to help ensure that initialization sections are provided for extra linkage requirements, e.g., of C++ applications (prompted by comment by Casper Dik in newsgroup). + rename "$target" in CF_MAN_PAGES to make it easier to distinguish from the autoconf predefined symbol. There was no conflict, since "$target" was used only in the generated edit_man.sh file, but SuSE's rpm package contains a patch. 20061202 + update man/term.5 to reflect extended terminfo support and hashed database configuration. + updates for test/configure script. + adapted from SuSE rpm package: + remove long-obsolete workaround for broken-linker which declared cur_term in tic.c + improve error recovery in PUTC() macro when wcrtomb() does not return usable results for an 8-bit character. + patches from rpm package (SuSE): + use va_copy() in extra varargs manipulation for tracing version of printw, etc. + use a va_list rather than a null in _nc_freeall()'s call to _nc_printf_string(). + add some see-also references in manpages to show related wide-character functions (suggested by Claus Fischer). 20061125 + add a check in lib_color.c to ensure caller does not increase COLORS above max_colors, which is used as an array index (discussion with Simon Sasburg). + add ifdef's allowing ncurses to be built with tparm() using either varargs (the existing status), or using a fixed-parameter list (to match X/Open). 20061104 + fix redrawing of windows other than stdscr using wredrawln() by touching the corresponding rows in curscr (discussion with Dan Gookin). + add test/redraw.c + add test/echochar.c + review/cleanup manpage descriptions of error-returns for form- and menu-libraries (prompted by FreeBSD docs/46196). 20061028 + add AUTHORS file -TD + omit the -D options from output of the new config script --cflags option (suggested by Ralf S Engelschall). + make NCURSES_INLINE unconditionally defined in curses.h 20061021 + revert change to accommodate bash 3.2, since that breaks other platforms, e.g., Solaris. + minor fixes to NEWS file to simplify scripting to obtain list of contributors. + improve some shared-library configure scripting for Linux, FreeBSD and NetBSD to make "--with-shlib-version" work. + change configure-script rules for FreeBSD shared libraries to allow for rpath support in versions past 3. + use $(DESTDIR) in makefile rules for installing/uninstalling the package config script (reports/patches by Christian Wiese, Ralf S Engelschall). + fix a warning in the configure script for NetBSD 2.0, working around spurious blanks embedded in its ${MAKEFLAGS} symbol. + change test/Makefile to simplify installing test programs in a different directory when --enable-rpath is used. 20061014 + work around bug in bash 3.2 by adding extra quotes (Jim Gifford). + add/install a package config script, e.g., "ncurses5-config" or "ncursesw5-config", according to configuration options. 20061007 + add several GNU Screen terminfo variations with 16- and 256-colors, and status line (Alain Bench). + change the way shared libraries (other than libtool) are installed. Rather than copying the build-tree's libraries, link the shared objects into the install directory. This makes the --with-rpath option work except with $(DESTDIR) (cf: 20000930). 20060930 + fix ifdef in c++/internal.h for QNX 6.1 + test-compiled with (old) egcs-1.1.2, modified configure script to not unset the $CXX and related variables which would prevent this. + fix a few terminfo.src typos exposed by improvments to "-f" option. + improve infocmp/tic "-f" option formatting. 20060923 + make --disable-largefile option work (report by Thomas M Ott). + updated html documentation. + add ka2, kb1, kb3, kc2 to vt220-keypad as an extension -TD + minor improvements to rxvt+pcfkeys -TD 20060916 + move static data from lib_mouse.c into SCREEN struct. + improve ifdef's for _POSIX_VDISABLE in tset to work with Mac OS X (report by Michail Vidiassov). + modify CF_PATH_SYNTAX to ensure it uses the result from --prefix option (from lynx changes) -TD + adapt AC_PROG_EGREP check, noting that this is likely to be another place aggravated by POSIXLY_CORRECT. + modify configure check for awk to ensure that it is found (prompted by report by Christopher Parker). + update config.sub 20060909 + add kon, kon2 and jfbterm terminfo entry (request by Till Maas) -TD + remove invis capability from klone+sgr, mainly used by linux entry, since it does not really do this -TD 20060903 + correct logic in wadd_wch() and wecho_wch(), which did not guard against passing the multi-column attribute into a call on waddch(), e.g., using data returned by win_wch() (cf: 20041023) (report by Sadrul H Chowdhury). 20060902 + fix kterm's acsc string -TD + fix for change to tic/infocmp in 20060819 to ensure no blank is embedded into a termcap description. + workaround for 20050806 ifdef's change to allow visbuf.c to compile when using --with-termlib --with-trace options. + improve tgetstr() by making the return value point into the user's buffer, if provided (patch by Miroslav Lichvar (see Redhat Bugzilla #202480)). + correct libraries needed for foldkeys (report by Stanislav Ievlev) 20060826 + add terminfo entries for xfce terminal (xfce) and multi gnome terminal (mgt) -TD + add test/foldkeys.c 20060819 + modify tic and infocmp to avoid writing trailing blanks on terminfo source output (Debian #378783). + modify configure script to ensure that if the C compiler is used rather than the loader in making shared libraries, the $(CFLAGS) variable is also used (Redhat Bugzilla #199369). + port hashed-db code to db2 and db3. + fix a bug in tgetent() from 20060625 and 20060715 changes (patch/analysis by Miroslav Lichvar (see Redhat Bugzilla #202480)). 20060805 + updated xterm function-keys terminfo to match xterm #216 -TD + add configure --with-hashed-db option (tested only with FreeBSD 6.0, e.g., the db 1.8.5 interface). 20060729 + modify toe to access termcap data, e.g., via cgetent() functions, or as a text file if those are not available. + use _nc_basename() in tset to improve $SHELL check for csh/sh. + modify _nc_read_entry() and _nc_read_termcap_entry() so infocmp, can access termcap data when the terminfo database is disabled. 20060722 + widen the test for xterm kmous a little to allow for other strings than \E[M, e.g., for xterm-sco functionality in xterm. + update xterm-related terminfo entries to match xterm patch #216 -TD + update config.guess, config.sub 20060715 + fix for install-rule in Ada95 to add terminal_interface.ads and terminal_interface.ali (anonymous posting in comp.lang.ada). + correction to manpage for getcchar() (report by William McBrine). + add test/chgat.c + modify wchgat() to mark updated cells as changed so a refresh will repaint those cells (comments by Sadrul H Chowdhury and William McBrine). + split up dependency of names.c and codes.c in ncurses/Makefile to work with parallel make (report/analysis by Joseph S Myers). + suppress a warning message (which is ignored) for systems without an ldconfig program (patch by Justin Hibbits). + modify configure script --disable-symlinks option to allow one to disable symlink() in tic even when link() does not work (report by Nigel Horne). + modify MKfallback.sh to use tic -x when constructing fallback tables to allow extended capabilities to be retrieved from a fallback entry. + improve leak-checking logic in tgetent() from 20060625 to ensure that it does not free the current screen (report by Miroslav Lichvar). 20060708 + add a check for _POSIX_VDISABLE in tset (NetBSD #33916). + correct _nc_free_entries() and related functions used for memory leak checking of tic. 20060701 + revert a minor change for magic-cookie support from 20060513, which caused unexpected reset of attributes, e.g., when resizing test/view in color mode. + note in clear manpage that the program ignores command-line parameters (prompted by Debian #371855). + fixes to make lib_gen.c build properly with changes to the configure --disable-macros option and NCURSES_NOMACROS (cf: 20060527) + update/correct several terminfo entries -TD + add some notes regarding copyright to terminfo.src -TD 20060625 + fixes to build Ada95 binding with gnat-4.1.0 + modify read_termtype() so the term_names data is always allocated as part of the str_table, a better fix for a memory leak (cf: 20030809). + reduce memory leaks in repeated calls to tgetent() by remembering the last TERMINAL* value allocated to hold the corresponding data and freeing that if the tgetent() result buffer is the same as the previous call (report by "Matt" for FreeBSD gnu/98975). + modify tack to test extended capability function-key strings. + improved gnome terminfo entry (GenToo #122566). + improved xterm-256color terminfo entry (patch by Alain Bench). 20060617 + fix two small memory leaks related to repeated tgetent() calls with TERM=screen (report by "Matt" for FreeBSD gnu/98975). + add --enable-signed-char to simplify Debian package. + reduce name-pollution in term.h by removing #define's for HAVE_xxx symbols. + correct typo in curs_terminfo.3x (Debian #369168). 20060603 + enable the mouse in test/movewindow.c + improve a limit-check in frm_def.c (John Heasley). + minor copyright fixes. + change configure script to produce test/Makefile from data file. 20060527 + add a configure option --enable-wgetch-events to enable NCURSES_WGETCH_EVENTS, and correct the associated loop-logic in lib_twait.c (report by Bernd Jendrissek). + remove include/nomacros.h from build, since the ifdef for NCURSES_NOMACROS makes that obsolete. + add entrypoints for some functions which were only provided as macros to make NCURSES_NOMACROS ifdef work properly: getcurx(), getcury(), getbegx(), getbegy(), getmaxx(), getmaxy(), getparx() and getpary(), wgetbkgrnd(). + provide ifdef for NCURSES_NOMACROS which suppresses most macro definitions from curses.h, i.e., where a macro is defined to override a function to improve performance. Allowing a developer to suppress these definitions can simplify some application (discussion with Stanislav Ievlev). + improve description of memu/meml in terminfo manpage. 20060520 + if msgr is false, reset video attributes when doing an automargin wrap to the next line. This makes the ncurses 'k' test work properly for hpterm. + correct caching of keyname(), which was using only half of its table. + minor fixes to memory-leak checking. + make SCREEN._acs_map and SCREEN._screen_acs_map pointers rather than arrays, making ACS_LEN less visible to applications (suggested by Stanislav Ievlev). + move chunk in SCREEN ifdef'd for USE_WIDEC_SUPPORT to the end, so _screen_acs_map will have the same offset in both ncurses/ncursesw, making the corresponding tinfo/tinfow libraries binary-compatible (cf: 20041016, report by Stanislav Ievlev). 20060513 + improve debug-tracing for EmitRange(). + change default for --with-develop to "yes". Add NCURSES_NO_HARD_TABS and NCURSES_NO_MAGIC_COOKIE environment variables to allow runtime suppression of the related hard-tabs and xmc-glitch features. + add ncurses version number to top-level manpages, e.g., ncurses, tic, infocmp, terminfo as well as form, menu, panel. + update config.guess, config.sub + modify ncurses.c to work around a bug in NetBSD 3.0 curses (field_buffer returning null for a valid field). The 'r' test appears to not work with that configuration since the new_fieldtype() function is broken in that implementation. 20060506 + add hpterm-color terminfo entry -TD + fixes to compile test-programs with HPUX 11.23 20060422 + add copyright notices to files other than those that are generated, data or adapted from pdcurses (reports by William McBrine, David Taylor). + improve rendering on hpterm by not resetting attributes at the end of doupdate() if the terminal has the magic-cookie feature (report by Bernd Rieke). + add 256color variants of terminfo entries for programs which are reported to implement this feature -TD 20060416 + fix typo in change to NewChar() macro from 20060311 changes, which broke tab-expansion (report by Frederic L W Meunier). 20060415 + document -U option of tic and infocmp. + modify tic/infocmp to suppress smacs/rmacs when acsc is suppressed due to size limit, e.g., converting to termcap format. Also suppress them if the output format does not contain acsc and it was not VT100-like, i.e., a one-one mapping (Novell #163715). + add configure check to ensure that SIGWINCH is defined on platforms such as OS X which exclude that when _XOPEN_SOURCE, etc., are defined (report by Nicholas Cole) 20060408 + modify write_object() to not write coincidental extensions of an entry made due to it being referenced in a use= clause (report by Alain Bench). + another fix for infocmp -i option, which did not ensure that some escape sequences had comparable prefixes (report by Alain Bench). 20060401 + improve discussion of init/reset in terminfo and tput manpages (report by Alain Bench). + use is3 string for a fallback of rs3 in the reset program; it was using is2 (report by Alain Bench). + correct logic for infocmp -i option, which did not account for multiple digits in a parameter (cf: 20040828) (report by Alain Bench). + move _nc_handle_sigwinch() to lib_setup.c to make --with-termlib option work after 20060114 changes (report by Arkadiusz Miskiewicz). + add copyright notices to test-programs as needed (report by William McBrine). 20060318 + modify ncurses.c 'F' test to combine the wide-characters with color and/or video attributes. + modify test/ncurses to use CTL/Q or ESC consistently for exiting a test-screen (some commands used 'x' or 'q'). 20060312 + fix an off-by-one in the scrolling-region change (cf_ 20060311). 20060311 + add checks in waddchnstr() and wadd_wchnstr() to stop copying when a null character is found (report by Igor Bogomazov). + modify progs/Makefile.in to make "tput init" work properly with cygwin, i.e., do not pass a ".exe" in the reference string used in check_aliases (report by Samuel Thibault). + add some checks to ensure current position is within scrolling region before scrolling on a new line (report by Dan Gookin). + change some NewChar() usage to static variables to work around stack garbage introduced when cchar_t is not packed (Redhat #182024). 20060225 + workarounds to build test/movewindow with PDcurses 2.7. + fix for nsterm-16color entry (patch by Alain Bench). + correct a typo in infocmp manpage (Debian #354281). 20060218 + add nsterm-16color entry -TD + updated mlterm terminfo entry -TD + remove 970913 feature for copying subwindows as they are moved in mvwin() (discussion with Bryan Christ). + modify test/demo_menus.c to demonstrate moving a menu (both the window and subwindow) using shifted cursor-keys. + start implementing recursive mvwin() in movewindow.c (incomplete). + add a fallback definition for GCC_PRINTFLIKE() in test.priv.h, for movewindow.c (report by William McBrine). + add help-message to test/movewindow.c 20060211 + add test/movewindow.c, to test mvderwin(). + fix ncurses soft-key test so color changes are shown immediately rather than delayed. + modify ncurses soft-key test to hide the keys when exiting the test screen. + fixes to build test programs with PDCurses 2.7, e.g., its headers rely on autoconf symbols, and it declares stubs for nonfunctional terminfo and termcap entrypoints. 20060204 + improved test/configure to build test/ncurses on HPUX 11 using the vendor curses. + documented ALTERNATE CONFIGURATIONS in the ncurses manpage, for the benefit of developers who do not read INSTALL. 20060128 + correct form library Window_To_Buffer() change (cf: 20040516), which should ignore the video attributes (report by Ricardo Cantu). 20060121 + minor fixes to xmc-glitch experimental code: + suppress line-drawing + implement max_attributes tested with xterm. + minor fixes for the database iterator. + fix some buffer limits in c++ demo (comment by Falk Hueffner in Debian #348117). 20060114 + add toe -a option, to show all databases. This uses new private interfaces in the ncurses library for iterating through the list of databases. + fix toe from 20000909 changes which made it not look at $HOME/.terminfo + make toe's -v option parameter optional as per manpage. + improve SIGWINCH handling by postponing its effect during newterm(), etc., when allocating screens. 20060111 + modify wgetnstr() to return KEY_RESIZE if a sigwinch occurs. Use this in test/filter.c + fix an error in filter() modification which caused some applications to fail. 20060107 + check if filter() was called when getting the screensize. Keep it at 1 if so (based on Redhat #174498). + add extension nofilter(). + refined the workaround for ACS mapping. + make ifdef's consistent in curses.h for the extended colors so the header file can be used for the normal curses library. The header file installed for extended colors is a variation of the wide-character configuration (report by Frederic L W Meunier). 20051231 + add a workaround to ACS mapping to allow applications such as test/blue.c to use the "PC ROM" characters by masking them with A_ALTCHARSET. This worked up til 5.5, but was lost in the revision of legacy coding (report by Michael Deutschmann). + add a null-pointer check in the wide-character version of calculate_actual_width() (report by Victor Julien). + improve test/ncurses 'd' (color-edit) test by allowing the RGB values to be set independently (patch by William McBrine). + modify test/configure script to allow building test programs with PDCurses/X11. + modified test programs to allow some to work with NetBSD curses. Several do not because NetBSD curses implements a subset of X/Open curses, and also lacks much of SVr4 additions. But it's enough for comparison. + update config.guess and config.sub 20051224 + use BSD-specific fix for return-value from cgetent() from CVS where an unknown terminal type would be reportd as "database not found". + make tgetent() return code more readable using new symbols TGETENT_YES, etc. + remove references to non-existent "tctest" program. + remove TESTPROGS from progs/Makefile.in (it was referring to code that was never built in that directory). + typos in curs_addchstr.3x, some doc files (noticed in OpenBSD CVS). 20051217 + add use_legacy_coding() function to support lynx's font-switching feature. + fix formatting in curs_termcap.3x (report by Mike Frysinger). + modify MKlib_gen.sh to change preprocessor-expanded _Bool back to bool. 20051210 + extend test/ncurses.c 's' (overlay window) test to exercise overlay(), overwrite() and copywin() with different combinations of colors and attributes (including background color) to make it easy to see the effect of the different functions. + corrections to menu/m_global.c for wide-characters (report by Victor Julien). 20051203 + add configure option --without-dlsym, allowing developers to configure GPM support without using dlsym() (discussion with Michael Setzer). + fix wins_nwstr(), which did not handle single-column non-8bit codes (Debian #341661). 20051126 + move prototypes for wide-character trace functions from curses.tail to curses.wide to avoid accidental reference to those if _XOPEN_SOURCE_EXTENDED is defined without ensuring that <wchar.h> is included. + add/use NCURSES_INLINE definition. + change some internal functions to use int/unsigned rather than the short equivalents. 20051119 + remove a redundant check in lib_color.c (Debian #335655). + use ld's -search_paths_first option on Darwin to work around odd search rules on that platform (report by Christian Gennerat, analysis by Andrea Govoni). + remove special case for Darwin in CF_XOPEN_SOURCE configure macro. + ignore EINTR in tcgetattr/tcsetattr calls (Debian #339518). + fix several bugs in test/bs.c (patch by Stephen Lindholm). 20051112 + other minor fixes to cygwin based on tack -TD + correct smacs in cygwin (Debian #338234, report by Baurzhan Ismagulov, who noted that it was fixed in Cygwin). 20051029 + add shifted up/down arrow codes to xterm-new as kind/kri strings -TD + modify wbkgrnd() to avoid clearing the A_CHARTEXT attribute bits since those record the state of multicolumn characters (Debian #316663). + modify werase to clear multicolumn characters that extend into a derived window (Debian #316663). 20051022 + move assignment from environment variable ESCDELAY from initscr() down to newterm() so the environment variable affects timeouts for terminals opened with newterm() as well. + fix a memory leak in keyname(). + add test/demo_altkeys.c + modify test/demo_defkey.c to exit from loop via 'q' to allow leak-checking, as well as fix a buffer size in winnstr() call. 20051015 + correct order of use-clauses in rxvt-basic entry which made codes for f1-f4 vt100-style rather than vt220-style (report by Gabor Z Papp). + suppress configure check for gnatmake if Ada95/Makefile.in is not found. + correct a typo in configure --with-bool option for the case where --without-cxx is used (report by Daniel Jacobowitz). + add a note to INSTALL's discussion of --with-normal, pointing out that one may wish to use --without-gpm to ensure a completely static link (prompted by report by Felix von Leitner). 20051010 5.5 release for upload to 20051008 + document in demo_forms.c some portability issues. 20051001 + document side-effect of werase() which sets the cursor position. + save/restore the current position in form field editing to make overlay mode work. 20050924 + correct header dependencies in progs, allowing parallel make (report by Daniel Jacobowitz). + modify CF_BUILD_CC to ensure that pre-setting $BUILD_CC overrides the configure check for --with-build-cc (report by Daniel Jacobowitz). + modify CF_CFG_DEFAULTS to not use /usr as the default prefix for NetBSD. + update config.guess and config.sub from 20050917 + modify sed expression which computes path for /usr/lib/terminfo symbolic link in install to ensure that it does not change unexpected levels of the path (Gentoo #42336). + modify default for --disable-lp64 configure option to reduce impact on existing 64-bit builds. Enabling the _LP64 option may change the size of chtype and mmask_t. However, for ABI 6, it is enabled by default (report by Mike Frysinger). + add configure script check for --enable-ext-mouse, bump ABI to 6 by default if it is used. + improve configure script logic for bumping ABI to omit this if the --with-abi-version option was used. + update address for Free Software Foundation in tack's source. + correct wins_wch(), which was not marking the filler-cells of multi-column characters (cf: 20041023). 20050910 + modify mouse initialization to ensure that Gpm_Open() is called only once. Otherwise GPM gets confused in its initialization of signal handlers (Debian #326709). 20050903 + modify logic for backspacing in a multiline form field to ensure that it works even when the preceding line is full (report by Frank van Vugt). + remove comment about BUGS section of ncurses manpage (Debian #325481) 20050827 + document some workarounds for shared and libtool library configurations in INSTALL (see --with-shared and --with-libtool). + modify CF_GCC_VERSION and CF_GXX_VERSION macros to accommodate cross-compilers which emit the platform name in their version message, e.g., arm-sa1100-linux-gnu-g++ (GCC) 4.0.1 (report by Frank van Vugt). 20050820 + start updating documentation for upcoming 5.5 release. + fix to make libtool and libtinfo work together again (cf: 20050122). + fixes to allow building traces into libtinfo + add debug trace to tic that shows if/how ncurses will write to the lower corner of a terminal's screen. + update llib-l* files. 20050813 + modify initializers in c++ binding to build with old versions of g++. + improve special case for 20050115 repainting fix, ensuring that if the first changed cell is not a character that the range to be repainted is adjusted to start at a character's beginning (Debian #316663). 20050806 + fixes to build on QNX 6.1 + improve configure script checks for Intel 9.0 compiler. + remove #include's for libc.h (obsolete). + adjust ifdef's in curses.priv.h so that when cross-compiling to produce comp_hash and make_keys, no dependency on wchar.h is needed. That simplifies the build-cppflags (report by Frank van Vugt). + move modules related to key-binding into libtinfo to fix linkage problem caused by 20050430 changes to MKkeyname.sh (report by Konstantin Andreev). 20050723 + updates/fixes for configure script macros from vile -TD + make prism9's sgr string agree with the rest of the terminfo -TD + make vt220's sgr0 string consistent with sgr string, do this for several related cases -TD + improve translation to termcap by filtering the 'me' (sgr0) strings as in the runtime call to tgetent() (prompted by a discussion with Thomas Klausner). + improve tic check for sgr0 versus sgr(0), to help ensure that sgr0 resets line-drawing. 20050716 + fix special cases for trimming sgr0 for hurd and vt220 (Debian #318621). + split-out _nc_trim_sgr0() from modifications made to tgetent(), to allow it to be used by tic to provide information about the runtime changes that would be made to sgr0 for termcap applications. + modify make_sed.sh to make the group-name in the NAME section of form/menu library manpage agree with the TITLE string when renaming is done for Debian (Debian #78866). 20050702 + modify parameter type in c++ binding for insch() and mvwinsch() to be consistent with underlying ncurses library (was char, is chtype). + modify treatment of Intel compiler to allow _GNU_SOURCE to be defined on Linux. + improve configure check for nanosleep(), checking that it works since some older systems such as AIX 4.3 have a nonworking version. 20050625 + update config.guess and config.sub from + modify misc/shlib to work in test-directory. + suppress $suffix in misc/run_tic.sh when cross-compiling. This allows cross-compiles to use the host's tic program to handle the "make install.data" step. + improve description of $LINES and $COLUMNS variables in manpages (prompted by report by Dave Ulrick). + improve description of cross-compiling in INSTALL + add NCURSES-Programming-HOWTO.html by Pradeep Padala (see). + modify configure script to obtain soname for GPM library (discussion with Daniel Jacobowitz). + modify configure script so that --with-chtype option will still compute the unsigned literals suffix for constants in curses.h (report by Daniel Jacobowitz: + patches from Daniel Jacobowitz: + the man_db.renames entry for tack.1 was backwards. + tack.1 had some 1m's that should have been 1M's. + the section for curs_inwstr.3 was wrong. 20050619 + correction to --with-chtype option (report by Daniel Jacobowitz). 20050618 + move build-time edit_man.sh and edit_man.sed scripts to top directory to simplify reusing them for renaming tack's manpage (prompted by a review of Debian package). + revert minor optimization from 20041030 (Debian #313609). + libtool-specific fixes, tested with libtool 1.4.3, 1.5.0, 1.5.6, 1.5.10 and 1.5.18 (all work except as noted previously for the c++ install using libtool 1.5.0): + modify the clean-rule in c++/Makefile.in to work with IRIX64 make program. + use $(LIBTOOL_UNINSTALL) symbol, overlooked in 20030830 + add configure options --with-chtype and --with-mmask-t, to allow overriding of the non-LP64 model's use of the corresponding types. + revise test for size of chtype (and mmask_t), which always returned "long" due to an uninitialized variable (report by Daniel Jacobowitz). 20050611 + change _tracef's that used "%p" format for va_list values to ignore that, since on some platforms those are not pointers. + fixes for long-formats in printf's due to largefile support. 20050604 + fixes for termcap support: + reset pointer to _nc_curr_token.tk_name when the input stream is closed, which could point to free memory (cf: 20030215). + delink TERMTYPE data which is used by the termcap reader, so that extended names data will be freed consistently. + free pointer to TERMTYPE data in _nc_free_termtype() rather than its callers. + add some entrypoints for freeing permanently allocated data via _nc_freeall() when NO_LEAKS is defined. + amend 20041030 change to _nc_do_color to ensure that optimization is applied only when the terminal supports back_color_erase (bce). 20050528 + add sun-color terminfo entry -TD + correct a missing assignment in c++ binding's method NCursesPanel::UserPointer() from 20050409 changes. + improve configure check for large-files, adding check for dirent64 from vile -TD + minor change to configure script to improve linker options for the Ada95 tree. 20050515 + document error conditions for ncurses library functions (report by Stanislav Ievlev). + regenerated html documentation for ada binding. see 20050507 + regenerated html documentation for manpages. + add $(BUILD_EXEEXT) suffix to invocation of make_keys in ncurses/Makefile (Gentoo #89772). + modify c++/demo.cc to build with g++ -fno-implicit-templates option (patch by Mike Frysinger). + modify tic to filter out long extended names when translating to termcap format. Only two characters are permissible for termcap capability names. 20050430 + modify terminfo entries xterm-new and rxvt to add strings for shift-, control-cursor keys. + workaround to allow c++ binding to compile with g++ 2.95.3, which has a broken implementation of static_cast<> (patch by Jeff Chua). + modify initialization of key lookup table so that if an extended capability (tic -x) string is defined, and its name begins with 'k', it will automatically be treated as a key. + modify test/keynames.c to allow for the possibility of extended key names, e.g., via define_key(), or via "tic -x". + add test/demo_termcap.c to show the contents of given entry via the termcap interface. 20050423 + minor fixes for vt100/vt52 entries -TD + add configure option --enable-largefile + corrected libraries used to build Ada95/gen/gen, found in testing gcc 4.0.0. 20050416 + update config.guess, config.sub + modify configure script check for _XOPEN_SOURCE, disable that on Darwin whose header files have problems (patch by Chris Zubrzycki). + modify form library Is_Printable_String() to use iswprint() rather than wcwidth() for determining if a character is printable. The latter caused it to reject menu items containing non-spacing characters. + modify ncurses test program's F-test to handle non-spacing characters by combining them with a reverse-video blank. + review/fix several gcc -Wconversion warnings. 20050409 + correct an off-by-one error in m_driver() for mouse-clicks used to position the mouse to a particular item. + implement test/demo_menus.c + add some checks in lib_mouse to ensure SP is set. + modify C++ binding to make 20050403 changes work with the configure --enable-const option. 20050403 + modify start_color() to return ERR if it cannot allocate memory. + address g++ compiler warnings in C++ binding by adding explicit member initialization, assignment operators and copy constructors. Most of the changes simply preserve the existing semantics of the binding, which can leak memory, etc., but by making these features visible, it provides a framework for improving the binding. + improve C++ binding using static_cast, etc. + modify configure script --enable-warnings to add options to g++ to correspond to the gcc --enable-warnings. + modify C++ binding to use some C internal functions to make it compile properly on Solaris (and other platforms). 20050327 + amend change from 20050320 to limit it to configurations with a valid locale. + fix a bug introduced in 20050320 which broke the translation of nonprinting characters to uparrow form (report by Takahashi Tamotsu). 20050326 + add ifdef's for _LP64 in curses.h to avoid using wasteful 64-bits for chtype and mmask_t, but add configure option --disable-lp64 in case anyone used that configuration. + update misc/shlib script to account for Mac OS X (report by Michail Vidiassov). + correct comparison for wrapping multibyte characters in waddch_literal() (report by Takahashi Tamotsu). 20050320 + add -c and -w options to tset to allow user to suppress ncurses' resizing of the terminal emulator window in the special case where it is not able to detect the true size (report by Win Delvaux, Debian #300419). + modify waddch_nosync() to account for locale zn_CH.GBK, which uses codes 128-159 as part of multibyte characters (report by Wang WenRui, Debian #300512). 20050319 + modify ncurses.c 'd' test to make it work with 88-color configuration, i.e., by implementing scrolling. + improve scrolling in ncurses.c 'c' and 'C' tests, e.g., for 88-color configuration. 20050312 + change tracemunch to use strict checking. + modify ncurses.c 'p' test to test line-drawing within a pad. + implement environment variable NCURSES_NO_UTF8_ACS to support miscellaneous terminal emulators which ignore alternate character set escape sequences when in UTF-8 mode. 20050305 + change NCursesWindow::err_handler() to a virtual function (request by Steve Beal). + modify fty_int.c and fty_num.c to handle wide characters (report by Wolfgang Gutjahr). + adapt fix for fty_alpha.c to fty_alnum.c, which also handled normal and wide characters inconsistently (report by Wolfgang Gutjahr). + update llib-* files to reflect internal interface additions/changes. 20050226 + improve test/configure script, adding tests for _XOPEN_SOURCE, etc., from lynx. + add aixterm-16color terminfo entry -TD + modified xterm-new terminfo entry to work with tgetent() changes -TD + extended changes in tgetent() from 20040710 to allow the substring of sgr0 which matches rmacs to be at the beginning of the sgr0 string (request by Thomas Wolff). Wolff says the visual effect in combination with pre-20040710 ncurses is improved. + fix off-by-one in winnstr() call which caused form field validation of multibyte characters to ignore the last character in a field. + correct logic in winsch() for inserting multibyte strings; the code would clear cells after the insertion rather than push them to the right (cf: 20040228). + fix an inconsistency in Check_Alpha_Field() between normal and wide character logic (report by Wolfgang Gutjahr). 20050219 + fix a bug in editing wide-characters in form library: deleting a nonwide character modified the previous wide-character. + update manpage to describe NCURSES_MOUSE_VERSION 2. + correct manpage description of mouseinterval() (Debian #280687). + add a note to default_colors.3x explaining why this extension was added (Debian #295083). + add traces to panel library. 20050212 + improve editing of wide-characters in form library: left/right cursor movement, and single-character deletions work properly. + disable GPM mouse support when $TERM happens to be prefixed with "xterm". Gpm_Open() would otherwise assert that it can deal with mouse events in this case. + modify GPM mouse support so it closes the server connection when the caller disables the mouse (report by Stanislav Ievlev). 20050205 + add traces for callback functions in form library. + add experimental configure option --enable-ext-mouse, which defines NCURSES_MOUSE_VERSION 2, and modifies the encoding of mouse events to support wheel mice, which may transmit buttons 4 and 5. This works with xterm and similar X terminal emulators (prompted by question by Andreas Henningsson, this is also related to Debian #230990). + improve configure macros CF_XOPEN_SOURCE and CF_POSIX_C_SOURCE to avoid redefinition warnings on cygwin. 20050129 + merge remaining development changes for extended colors (mostly complete, does not appear to break other configurations). + add xterm-88color.dat (part of extended colors testing). + improve _tracedump() handling of color pairs past 96. + modify return-value from start_color() to return OK if colors have already been started. + modify curs_color.3x list error conditions for init_pair(), pair_content() and color_content(). + modify pair_content() to return -1 for consistency with init_pair() if it corresponds to the default-color. + change internal representation of default-color to allow application to use color number 255. This does not affect the total number of color pairs which are allowed. + add a top-level tags rule. 20050122 + add a null-pointer check in wgetch() in case it is called without first calling initscr(). + add some null-pointer checks for SP, which is not set by libtinfo. + modify misc/shlib to ensure that absolute pathnames are used. + modify test/Makefile.in, etc., to link test programs only against the libraries needed, e.g., omit form/menu/panel library for the ones that are curses-specific. + (report by Stanislav Ievlev). 20050115 + minor fixes to allow test-compiles with g++. + correct column value shown in tic's warnings, which did not account for leading whitespace. + add a check in _nc_trans_string() for improperly ended strings, i.e., where a following line begins in column 1. + modify _nc_save_str() to return a null pointer on buffer overflow. + improve repainting while scrolling wide-character data (Eungkyu Song). 20050108 + merge some development changes to extend color capabilities. 20050101 + merge some development changes to extend color capabilities. + fix manpage typo (FreeBSD report docs/75544). + update config.guess, config.sub > patches for configure script (Albert Chin-A-Young): + improved fix to make mbstate_t recognized on HPUX 11i (cf: 20030705), making vsscanf() prototype visible on IRIX64. Tested for on HP-UX 11i, Solaris 7, 8, 9, AIX 4.3.3, 5.2, Tru64 UNIX 4.0D, 5.1, IRIX64 6.5, Redhat Linux 7.1, 9, and RHEL 2.1, 3.0. + print the result of the --disable-home-terminfo option. + use -rpath when compiling with SGI C compiler. 20041225 + add trace calls to remaining public functions in form and menu libraries. + fix check for numeric digits in test/ncurses.c 'b' and 'B' tests. + fix typo in test/ncurses.c 'c' test from 20041218. 20041218 + revise test/ncurses.c 'c' color test to improve use for xterm-88color and xterm-256color, added 'C' test using the wide-character color_set and attr_set functions. 20041211 + modify configure script to work with Intel compiler. + fix an limit-check in wadd_wchnstr() which caused labels in the forms-demo to be one character short. + fix typo in curs_addchstr.3x (Jared Yanovich). + add trace calls to most functions in form and menu libraries. + update working-position for adding wide-characters when window is scrolled (prompted by related report by Eungkyu Song). 20041204 + replace some references on Linux to wcrtomb() which use it to obtain the length of a multibyte string with _nc_wcrtomb, since wcrtomb() is broken in glibc (see Debian #284260). + corrected length-computation in wide-character support for field_buffer(). + some fixes to frm_driver.c to allow it to accept multibyte input. + modify configure script to work with Intel 8.0 compiler. 20041127 + amend change to setupterm() in 20030405 which would reuse the value of cur_term if the same output was selected. This now reuses it only when setupterm() is called from tgetent(), which has no notion of separate SCREENs. Note that tgetent() must be called after initscr() or newterm() to use this feature (Redhat Bugzilla #140326). + add a check in CF_BUILD_CC macro to ensure that developer has given the --with-build-cc option when cross-compiling (report by Alexandre Campo). + improved configure script checks for _XOPEN_SOURCE and _POSIX_C_SOURCE (fix for IRIX 5.3 from Georg Schwarz, _POSIX_C_SOURCE updates from lynx). + cosmetic fix to test/gdc.c to recolor the bottom edge of the box for consistency (comment by Dan Nelson). 20041120 + update wsvt25 terminfo entry -TD + modify test/ins_wide.c to test all flavors of ins_wstr(). + ignore filler-cells in wadd_wchnstr() when adding a cchar_t array which consists of multi-column characters, since this function constructs them (cf: 20041023). + modify winnstr() to return multibyte character strings for the wide-character configuration. 20041106 + fixes to make slk_set() and slk_wset() accept and store multibyte or multicolumn characters. 20041030 + improve color optimization a little by making _nc_do_color() check if the old/new pairs are equivalent to the default pair 0. + modify assume_default_colors() to not require that use_default_colors() be called first. 20041023 + modify term_attrs() to use termattrs(), add the extended attributes such as enter_horizontal_hl_mode for WA_HORIZONTAL to term_attrs(). + add logic in waddch_literal() to clear orphaned cells when one multi-column character partly overwrites another. + improved logic for clearing cells when a multi-column character must be wrapped to a new line. + revise storage of cells for multi-column characters to correct a problem with repainting. In the old scheme, it was possible for doupdate() to decide that only part of a multi-column character should be repainted since the filler cells stored only an attribute to denote them as fillers, rather than the character value and the attribute. 20041016 + minor fixes for traces. + add SP->_screen_acs_map[], used to ensure that mapping of missing line-drawing characters is handled properly. For example, ACS_DARROW is absent from xterm-new, and it was coincidentally displayed the same as ACS_BTEE. 20041009 + amend 20021221 workaround for broken acs to reset the sgr, rmacs and smacs strings as well. Also modify the check for screen's limitations in that area to allow the multi-character shift-in and shift-out which seem to work. + change GPM initialization, using dl library to load it dynamically at runtime (Debian #110586). 20041002 + correct logic for color pair in setcchar() and getcchar() (patch by Marcin 'Qrczak' Kowalczyk). + add t/T commands to ncurses b/B tests to allow a different color to be tested for the attrset part of the test than is used in the background color. 20040925 + fix to make setcchar() to work when its wchar_t* parameter is pointing to a string which contains more data than can be converted. + modify wget_wstr() and example in ncurses.c to work if wchar_t and wint_t are different sizes (report by Marcin 'Qrczak' Kowalczyk). 20040918 + remove check in wget_wch() added to fix an infinite loop, appears to have been working around a transitory glibc bug, and interferes with normal operation (report by Marcin 'Qrczak' Kowalczyk). + correct wadd_wch() and wecho_wch(), which did not pass the rendition information (report by Marcin 'Qrczak' Kowalczyk). + fix aclocal.m4 so that the wide-character version of ncurses gets compiled as libncursesw.5.dylib, instead of libncurses.5w.dylib (adapted from patch by James J Ramsey). + change configure script for --with-caps option to indicate that it is no longer experimental. + change configure script to reflect the fact that --enable-widec has not been "experimental" since 5.3 (report by Bruno Lustosa). 20040911 + add 'B' test to ncurses.c, to exercise some wide-character functions. 20040828 + modify infocmp -i option to match 8-bit controls against its table). + modified configure script CF_XOPEN_SOURCE macro to ensure that if it defines _POSIX_C_SOURCE, that it defines it to a specific value (comp.os.stratus newsgroup comment). 20040821 + fixes to build with Ada95 binding with gnat 3.4 (all warnings are fatal, and gnat does not follow the guidelines for pragmas). However that did find a coding error in Assume_Default_Colors(). + modify several terminfo entries to ensure xterm mouse and cursor visibility are reset in rs2 string: hurd, putty, gnome, konsole-base, mlterm, Eterm, screen (Debian #265784, #55637). The xterm entries are left alone - old ones for compatibility, and the new ones do not require this change. -TD 20040814 + fake a SIGWINCH in newterm() to accommodate buggy terminal emulators and window managers (Debian #265631). > terminfo updates -TD + remove dch/dch1 from rxvt because they are implemented inconsistently with the common usage of bce/ech + remove khome from vt220 (vt220's have no home key) + add rxvt+pcfkeys 20040807 + modify test/ncurses.c 'b' test, adding v/V toggles to cycle through combinations of video attributes so that for instance bold and underline can be tested. This made the legend too crowded, added a help window as well. + modify test/ncurses.c 'b' test to cycle through default colors if the -d option is set. + update putty terminfo entry (Robert de Bath). 20040731 + modify test/cardfile.c to allow it to read more data than can be displayed. + correct logic in resizeterm.c which kept it from processing all levels of window hierarchy (reports by Folkert van Heusden, Chris Share). 20040724 +) > terminfo updates -TD + make ncsa-m rmacs/smacs consistent with sgr + add sgr, rc/sc and ech to syscons entries + add function-keys to decansi + add sgr to mterm-ansi + add sgr, civis, cnorm to emu + correct/simplify cup in addrinfo 20040717 > terminfo updates -TD + add xterm-pc-fkeys + review/update gnome and gnome-rh90 entries (prompted by Redhat Bugzilla #122815). + review/update konsole entries + add sgr, correct sgr0 for kterm and mlterm + correct tsl string in kterm 20040711 + add configure option --without-xterm-new 20040710 + add check in wget_wch() for printable bytes that are not part of a multibyte character. + modify wadd_wchnstr() to render text using window's background attributes. + improve tic's check to compare sgr and sgr0. + fix c++ directory's .cc.i rule. + modify logic in tgetent() which adjusts the termcap "me" string to work with ISO-2022 string used in xterm-new (cf: 20010908). + modify tic's check for conflicting function keys to omit that if converting termcap to termcap format. + add -U option to tic and infocmp. + add rmam/smam to linux terminfo entry (Trevor Van Bremen) > terminfo updates -TD + minor fixes for emu + add emu-220 + change wyse acsc strings to use 'i' map rather than 'I' + fixes for avatar0 + fixes for vp3a+ 20040703 + use tic -x to install terminfo database -TD + add -x to infocmp's usage message. + correct field used for comparing O_ROWMAJOR in set_menu_format() (report/patch by Tony Li). + fix a missing nul check in set_field_buffer() from 20040508 changes. > terminfo updates -TD + make xterm-xf86-v43 derived from xterm-xf86-v40 rather than xterm-basic -TD + align with xterm patch #192's use of xterm-new -TD + update xterm-new and xterm-8bit for cvvis/cnorm strings -TD + make xterm-new the default "xterm" entry -TD 20040626 + correct BUILD_CPPFLAGS substitution in ncurses/Makefile.in, to allow cross-compiling from a separate directory tree (report/patch by Dan Engel). + modify is_term_resized() to ensure that window sizes are nonzero, as documented in the manpage (report by Ian Collier). + modify CF_XOPEN_SOURCE configure macro to make Hurd port build (Debian #249214, report/patch by Jeff Bailey). + configure-script mods from xterm, e.g., updates to CF_ADD_CFLAGS + update config.guess, config.sub > terminfo updates -TD + add mlterm + add xterm-xf86-v44 + modify xterm-new aka xterm-xfree86 to accommodate luit, which relies on G1 being used via an ISO-2022 escape sequence (report by Juliusz Chroboczek) + add 'hurd' entry 20040619 + reconsidered winsnstr(), decided after comparing other implementations that wrapping is an X/Open documentation error. + modify test/inserts.c to test all flavors of insstr(). 20040605 + add setlocale() calls to a few test programs which may require it: demo_forms.c, filter.c, ins_wide.c, inserts.c + correct a few misspelled function names in ncurses-intro.html (report by Tony Li). + correct internal name of key_defined() manpage, which conflicted with define_key(). 20040529 + correct size of internal pad used for holding wide-character field_buffer() results. + modify data_ahead() to work with wide-characters. 20040522 + improve description of terminfo if-then-else expressions (suggested by Arne Thomassen). + improve test/ncurses.c 'd' test, allow it to use external file for initial palette (added xterm-16color.dat and linux-color.dat), and reset colors to the initial palette when starting/ending the test. + change limit-check in init_color() to allow r/g/b component to reach 1000 (cf: 20020928). 20040516 + modify form library to use cchar_t's rather than char's in the wide-character configuration for storing data for field buffers. + correct logic of win_wchnstr(), which did not work for more than one cell. 20040508 + replace memset/memcpy usage in form library with for-loops to simplify changing the datatype of FIELD.buf, part of wide-character changes. + fix some inconsistent use of #if/#ifdef (report by Alain Guibert). 20040501 + modify menu library to account for actual number of columns used by multibyte character strings, in the wide-character configuration (adapted from patch by Philipp Tomsich). + add "-x" option to infocmp like tic's "-x", for use in "-F" comparisons. This modifies infocmp to only report extended capabilities if the -x option is given, making this more consistent with tic. Some scripts may break, since infocmp previous gave this information without an option. + modify termcap-parsing to retain 2-character aliases at the beginning of an entry if the "-x" option is used in tic. 20040424 + minor compiler-warning and test-program fixes. 20040417 + modify tic's missing-sgr warning to apply to terminfo only. + free some memory leaks in tic. + remove check in post_menu() that prevented menus from extending beyond the screen (request by Max J. Werner). + remove check in newwin() that prevents allocating windows that extend beyond the screen. Solaris curses does this. + add ifdef in test/color_set.c to allow it to compile with older curses. + add napms() calls to test/dots.c to make it not be a CPU hog. 20040403 + modify unctrl() to return null if its parameter does not correspond to an unsigned char. + add some limit-checks to guard isprint(), etc., from being used on values that do not fit into an unsigned char (report by Sami Farin). 20040328 + fix a typo in the _nc_get_locale() change. 20040327 + modify _nc_get_locale() to use setlocale() to query the program's current locale rather than using getenv(). This fixes a case in tin which relies on legacy treatment of 8-bit characters when the locale is not initialized (reported by Urs Jansen). + add sgr string to screen's and rxvt's terminfo entries -TD. + add a check in tic for terminfo entries having an sgr0 but no sgr string. This confuses Tru64 and HPUX curses when combined with color, e.g., making them leave line-drawing characters in odd places. + correct casts used in ABSENT_BOOLEAN, CANCELLED_BOOLEAN, matches the original definitions used in Debian package to fix PowerPC bug before 20030802 (Debian #237629). 20040320 + modify PutAttrChar() and PUTC() macro to improve use of A_ALTCHARSET attribute to prevent line-drawing characters from being lost in situations where the locale would otherwise treat the raw data as nonprintable (Debian #227879). 20040313 + fix a redefinition of CTRL() macro in test/view.c for AIX 5.2 (report by Jim Idle). + remove ".PP" after ".SH NAME" in a few manpages; this confuses some apropos script (Debian #237831). 20040306 + modify ncurses.c 'r' test so editing commands, like inserted text, set the field background, and the state of insert/overlay editing mode is shown in that test. + change syntax of dummy targets in Ada95 makefiles to work with pmake. + correct logic in test/ncurses.c 'b' for noncolor terminals which did not recognize a quit-command (cf: 20030419). 20040228 + modify _nc_insert_ch() to allow for its input to be part of a multibyte string. + split out lib_insnstr.c, to prepare to rewrite it. X/Open states that this function performs wrapping, unlike all of the other insert-functions. Currently it does not wrap. + check for nl_langinfo(CODESET), use it if available (report by Stanislav Ievlev). + split-out CF_BUILD_CC macro, actually did this for lynx first. + fixes for configure script CF_WITH_DBMALLOC and CF_WITH_DMALLOC, which happened to work with bash, but not with Bourne shell (report by Marco d'Itri via tin-dev). 20040221 + some changes to adapt the form library to wide characters, incomplete (request by Mike Aubury). + add symbol to curses.h which can be used to suppress include of stdbool.h, e.g., #define NCURSES_ENABLE_STDBOOL_H 0 #include <curses.h> (discussion on XFree86 mailing list). 20040214 + modify configure --with-termlib option to accept a value which sets the name of the terminfo library. This would allow a packager to build libtinfow.so renamed to coincide with libtinfo.so (discussion with Stanislav Ievlev). + improve documentation of --with-install-prefix, --prefix and $(DESTDIR) in INSTALL (prompted by discussion with Paul Lew). + add configure check if the compiler can use -c -o options to rename its output file, use that to omit the 'cd' command which was used to ensure object files are created in a separate staging directory (prompted by comments by Johnny Wezel, Martin Mokrejs). 20040208 5.4 release for upload to + update TO-DO. 20040207 pre-release + minor fixes to _nc_tparm_analyze(), i.e., do not count %i as a param, and do not count %d if it follows a %p. + correct an inconsistency between handling of codes in the 128-255 range, e.g., as illustrated by test/ncurses.c f/F tests. In POSIX locale, the latter did not show printable results, while the former did. + modify MKlib_gen.sh to compensate for broken C preprocessor on Mac OS X, which alters "%%" to "% % " (report by Robert Simms, fix verified by Scott Corscadden). 20040131 pre-release + modify SCREEN struct to align it between normal/wide curses flavors to simplify future changes to build a single version of libtinfo (patch by Stanislav Ievlev). + document handling of carriage return by addch() in manpage. + document special features of unctrl() in manpage. + documented interface changes in INSTALL. + corrected control-char test in lib_addch.c to account for locale (Debian #230335, cf: 971206). + updated test/configure.in to use AC_EXEEXT and AC_OBJEXT. + fixes to compile Ada95 binding with Debian gnat 3.15p-4 package. + minor configure-script fixes for older ports, e.g., BeOS R4.5. 20040125 pre-release + amend change to PutAttrChar() from 20030614 which computed the number of cells for a possibly multi-cell character. The 20030614 change forced the cell to a blank if the result from wcwidth() was not greater than zero. However, wcwidth() called for parameters in the range 128-255 can give this return value. The logic now simply ensures that the number of cells is greater than zero without modifying the displayed value. 20040124 pre-release + looked good for 5.4 release for upload to (but see above) + modify configure script check for ranlib to use AC_CHECK_TOOL, since that works better for cross-compiling. 20040117 pre-release + modify lib_get_wch.c to prefer mblen/mbtowc over mbrlen/mbrtowc to work around core dump in Solaris 8's locale support, e.g., for zh_CN.GB18030 (report by Saravanan Bellan). + add includes for <stdarg.h> and <stdio.h> in configure script macro to make <wchar.h> check work with Tru64 4.0d. + add terminfo entry for U/Win -TD + add terminfo entries for SFU aka Interix aka OpenNT (Federico Bianchi). + modify tput's error messages to prefix them with the program name (report by Vincent Lefevre, patch by Daniel Jacobowitz (see Debian #227586)). + correct a place in tack where exit_standout_mode was used instead of exit_attribute_mode (patch by Jochen Voss (see Debian #224443)). + modify c++/cursesf.h to use const in the Enumeration_Field method. + remove an ambiguous (actually redundant) method from c++/cursesf.h + make $HOME/.terminfo update optional (suggested by Stanislav Ievlev). + improve sed script which extracts libtool's version in the CF_WITH_LIBTOOL macro. + add ifdef'd call to AC_PROG_LIBTOOL to CF_WITH_LIBTOOL macro (to simplify local patch for Albert Chin-A-Young).. + add $(CXXFLAGS) to link command in c++/Makefile.in (adapted from patch by Albert Chin-A-Young).. + fix a missing substitution in configure.in for "$target" needed for HPUX .so/.sl case. + resync CF_XOPEN_SOURCE configure macro with lynx; fixes IRIX64 and NetBSD 1.6 conflicts with _XOPEN_SOURCE. + make check for stdbool.h more specific, to ensure that including it will actually define/declare bool for the configured compiler. + rewrite ifdef's in curses.h relating NCURSES_BOOL and bool. The intention of that is to #define NCURSES_BOOL as bool when the compiler declares bool, and to #define bool as NCURSES_BOOL when it does not (reported by Jim Gifford, Sam Varshavchik, cf: 20031213). 20040110 pre-release + change minor version to 4, i.e., ncurses 5.4 + revised/improved terminfo entries for tvi912b, tvi920b (Benjamin C W Sittler). + simplified ncurses/base/version.c by defining the result from the configure script rather than using sprintf (suggested by Stanislav Ievlev). + remove obsolete casts from c++/cursesw.h (reported by Stanislav Ievlev). + modify configure script so that when configuring for termlib, programs such as tic are not linked with the upper-level ncurses library (suggested by Stanislav Ievlev). + move version.c from ncurses/base to ncurses/tinfo to allow linking of tic, etc., using libtinfo (suggested by Stanislav Ievlev). 20040103 + adjust -D's to build ncursesw on OpenBSD. + modify CF_PROG_EXT to make OS/2 build with EXEEXT. + add pecho_wchar(). + remove <wctype.h> include from lib_slk_wset.c which is not needed (or available) on older platforms. 20031227 + add -D's to build ncursew on FreeBSD 5.1. + modify shared library configuration for FreeBSD 4.x/5.x to add the soname information (request by Marc Glisse). + modify _nc_read_tic_entry() to not use MAX_ALIAS, but PATH_MAX only for limiting the length of a filename in the terminfo database. + modify termname() to return the terminal name used by setupterm() rather than $TERM, without truncating to 14 characters as documented by X/Open (report by Stanislav Ievlev, cf: 970719). + re-add definition for _BSD_TYPES, lost in merge (cf: 20031206). 20031220 + add configure option --with-manpage-format=catonly to address behavior of BSDI, allow install of man+cat files on NetBSD, whose behavior has diverged by requiring both to be present. + remove leading blanks from comment-lines in manlinks.sed script to work with Tru64 4.0d. + add screen.linux terminfo entry (discussion on mutt-users mailing list). 20031213 + add a check for tic to flag missing backslashes for termcap continuation lines. ncurses reads the whole entry, but termcap applications do not. + add configure option "--with-manpage-aliases" extending "--with-manpage-aliases" to provide the option of generating ".so" files rather than symbolic links for manpage aliases. + add bool definition in include/curses.h.in for configurations with no usable C++ compiler (cf: 20030607). + fix pathname of SigAction.h for building with --srcdir (reported by Mike Castle). 20031206 + folded ncurses/base/sigaction.c into includes of ncurses/SigAction.h, since that header is used only within ncurses/tty/lib_tstp.c, for non-POSIX systems (discussion with Stanislav Ievlev). + remove obsolete _nc_outstr() function (report by Stanislav Ievlev <inger@altlinux.org>). + add test/background.c and test/color_set.c + modify color_set() function to work with color pair 0 (report by George Andreou <gbandreo@tem.uoc.gr>). + add configure option --with-trace, since defining TRACE seems too awkward for some cases. + remove a call to _nc_free_termtype() from read_termtype(), since the corresponding buffer contents were already zeroed by a memset (cf: 20000101). + improve configure check for _XOPEN_SOURCE and related definitions, adding special cases for Solaris' __EXTENSIONS__ and FreeBSD's __BSD_TYPES (reports by Marc Glisse <marc.glisse@normalesup.org>). + small fixes to compile on Solaris and IRIX64 using cc. + correct typo in check for pre-POSIX sort options in MKkey_defs.sh (cf: 20031101). 20031129 + modify _nc_gettime() to avoid a problem with arithmetic on unsigned values (Philippe Blain). + improve the nanosleep() logic in napms() by checking for EINTR and restarting (Philippe Blain). + correct expression for "%D" in lib_tgoto.c (Juha Jarvi <mooz@welho.com>). 20031122 + add linux-vt terminfo entry (Andrey V Lukyanov <land@long.yar.ru>). + allow "\|" escape in terminfo; tic should not warn about this. + save the full pathname of the trace-file the first time it is opened, to avoid creating it in different directories if the application opens and closes it while changing its working directory. + modify configure script to provide a non-empty default for $BROKEN_LINKER 20031108 + add DJGPP to special case of DOS-style drive letters potentially appearing in TERMCAP environment variable. + fix some spelling in comments (reports by Jason McIntyre, Jonathon Gray). + update config.guess, config.sub 20031101 + fix a memory leak in error-return from setupterm() (report by Stanislav Ievlev <inger@altlinux.org>). + use EXEEXT and OBJEXT consistently in makefiles. + amend fixes for cross-compiling to use separate executable-suffix BUILD_EXEEXT (cf: 20031018). + modify MKkey_defs.sh to check for sort utility that does not recognize key options, e.g., busybox (report by Peter S Mazinger <ps.m@gmx.net>). + fix potential out-of-bounds indexing in _nc_infotocap() (found by David Krause using some of the new malloc debugging features under OpenBSD, patch by Ted Unangst). + modify CF_LIB_SUFFIX for Itanium releases of HP-UX, which use a ".so" suffix (patch by Jonathan Ward <Jonathan.Ward@hp.com>). 20031025 + update terminfo for xterm-xfree86 -TD + add check for multiple "tc=" clauses in a termcap to tic. + check for missing op/oc in tic. + correct _nc_resolve_uses() and _nc_merge_entry() to allow infocmp and tic to show cancelled capabilities. These functions were ignoring the state of the target entry, which should be untouched if cancelled. + correct comment in tack/output.c (Debian #215806). + add some null-pointer checks to lib_options.c (report by Michael Bienia). + regenerated html documentation. + correction to tar-copy.sh, remove a trap command that resulted in leaving temporary files (cf: 20030510). + remove contact/maintainer addresses for Juergen Pfeifer (his request). 20031018 + updated test/configure to reflect changes for libtool (cf: 20030830). + fix several places in tack/pad.c which tested and used the parameter- and parameterless strings inconsistently, i.e., in pad_rin(), pad_il(), pad_indn() and pad_dl() (Debian #215805). + minor fixes for configure script and makefiles to cleanup executables generated when cross-compiling for DJGPP. + modify infocmp to omit check for $TERM for operations that do not require it, e.g., "infocmp -e" used to build fallback list (report by Koblinger Egmont). 20031004 + add terminfo entries for DJGPP. + updated note about maintainer in ncurses-intro.html 20030927 + update terminfo entries for gnome terminal. + modify tack to reset colors after each color test, correct a place where exit_standout_mode was used instead of exit_attribute_mode. + improve tack's bce test by making it set colors other than black on white. + plug a potential recursion between napms() and _nc_timed_wait() (report by Philippe Blain). 20030920 + add --with-rel-version option to allow workaround to allow making libtool on Darwin generate the "same" library names as with the --with-shared option. The Darwin ld program does not work well with a zero as the minor-version value (request by Chris Zubrzycki). + modify CF_MIXEDCASE_FILENAMES macro to work with cross-compiling. + modify tack to allow it to run from fallback terminfo data. > patch by Philippe Blain: + improve PutRange() by adjusting call to EmitRange() and corresponding return-value to not emit unchanged characters on the end of the range. + improve a check for changed-attribute by exiting a loop when the change is found. + improve logic in TransformLine(), eliminating a duplicated comparison in the clr_bol logic. 20030913 > patch by Philippe Blain: + in ncurses/tty/lib_mvcur.c, move the label 'nonlocal' just before the second gettimeofday() to be able to compute the diff time when 'goto nonlocal' used. Rename 'msec' to 'microsec' in the debug-message. + in ncurses/tty/lib_mvcur.c, Use _nc_outch() in carriage return/newline movement instead of putchar() which goes to stdout. Move test for xold>0 out of loop. + in ncurses/tinfo/setbuf.c, Set the flag SP->_buffered at the end of operations when all has been successful (typeMalloc can fail). + simplify NC_BUFFERED macro by moving check inside _nc_setbuf(). 20030906 + modify configure script to avoid using "head -1", which does not work if POSIXLY_CORRECT (sic) is set. + modify run_tic.in to avoid using wrong shared libraries when cross-compiling (Dan Kegel). 20030830 + alter configure script help message to make it clearer that --with-build-cc does not specify a cross-compiler (suggested by Dan Kegel <dank@kegel.com>). + modify configure script to accommodate libtool 1.5, as well as add an parameter to the "--with-libtool" option which can specify the pathname of libtool (report by Chris Zubrzycki). We note that libtool 1.5 has more than one bug in its C++ support, so it is not able to install libncurses++, for instance, if $DESTDIR or the option --with-install-prefix is used. 20030823 > patch by Philippe Blain: + move assignments to SP->_cursrow, SP->_curscol into online_mvcur(). + make baudrate computation in delay_output() consistent with the assumption in _nc_mvcur_init(), i.e., a byte is 9 bits. 20030816 + modify logic in waddch_literal() to take into account zh_TW.Big5 whose multibyte sequences may contain "printable" characters, e.g., a "g" in the sequence "\247g" (Debian #204889, cf: 20030621). + improve storage used by _nc_safe_strcpy() by ensuring that the size is reset based on the initialization call, in case it were called after other strcpy/strcat calls (report by Philippe Blain). > patch by Philippe Blain: + remove an unused ifdef for REAL_ATTR & WANT_CHAR + correct a place where _cup_cost was used rather than _cuu_cost 20030809 + fix a small memory leak in _nc_free_termtype(). + close trace-file if trace() is called with a zero parameter. + free memory allocated for soft-key strings, in delscreen(). + fix an allocation size in safe_sprintf.c for the "*" format code. + correct safe_sprintf.c to not return a null pointer if the format happens to be an empty string. This applies to the "configure --enable-safe-sprintf" option (Redhat #101486). 20030802 + modify casts used for ABSENT_BOOLEAN and CANCELLED_BOOLEAN (report by Daniel Jacobowitz). > patch by Philippe Blain: + change padding for change_scroll_region to not be proportional to the size of the scroll-region. + correct error-return in _nc_safe_strcat(). 20030726 + correct limit-checks in _nc_scroll_window() (report and test-case by Thomas Graf <graf@dms.at> cf: 20011020). + re-order configure checks for _XOPEN_SOURCE to avoid conflict with _GNU_SOURCE check. 20030719 + use clr_eol in preference to blanks for bce terminals, so select and paste will have fewer trailing blanks, e.g., when using xterm (request by Vincent Lefevre). + correct prototype for wunctrl() in manpage. + add configure --with-abi-version option (discussion with Charles Wilson). > cygwin changes from Charles Wilson: + aclocal.m4: on cygwin, use autodetected prefix for import and static lib, but use "cyg" for DLL. + include/ncurses_dll.h: correct the comments to reflect current status of cygwin/mingw port. Fix compiler warning. + misc/run_tic.in: ensure that tic.exe can find the uninstalled DLL, by adding the lib-directory to the PATH variable. + misc/terminfo.src (nxterm|xterm-color): make xterm-color primary instead of nxterm, to match XFree86's xterm.terminfo usage and to prevent circular links. (rxvt): add additional codes from rxvt.org. (rxvt-color): new alias (rxvt-xpm): new alias (rxvt-cygwin): like rxvt, but with special acsc codes. (rxvt-cygwin-native): ditto. rxvt may be run under XWindows, or with a "native" MSWin GUI. Each takes different acsc codes, which are both different from the "normal" rxvt's acsc. (cygwin): cygwin-in-cmd.exe window. Lots of fixes. (cygwinDBG): ditto. + mk-1st.awk: use "cyg" for the DLL prefix, but "lib" for import and static libs. 20030712 + update config.guess, config.sub + add triples for configuring shared libraries with the Debian GNU/FreeBSD packages (patch by Robert Millan <zeratul2@wanadoo.es>). 20030705 + modify CF_GCC_WARNINGS so it only applies to gcc, not g++. Some platforms have installed g++ along with the native C compiler, which would not accept gcc warning options. + add -D_XOPEN_SOURCE=500 when configuring with --enable-widec, to get mbstate_t declaration on HPUX 11.11 (report by David Ellement). + add _nc_pathlast() to get rid of casts in _nc_basename() calls. + correct a sign-extension in wadd_wch() and wecho_wchar() from 20030628 (report by Tomohiro Kubota). + work around omission of btowc() and wctob() from wide-character support (sic) in NetBSD 1.6 using mbtowc() and wctomb() (report by Gabor Z Papp). + add portability note to curs_get_wstr.3x (Debian #199957). 20030628 + rewrite wadd_wch() and wecho_wchar() to call waddch() and wechochar() respectively, to avoid calling waddch_noecho() with wide-character data, since that function assumes its input is 8-bit data. Similarly, modify waddnwstr() to call wadd_wch(). + remove logic from waddnstr() which transformed multibyte character strings into wide-characters. Rewrite of waddch_literal() from 20030621 assumes its input is raw multibyte data rather than wide characters (report by Tomohiro Kubota). 20030621 + write getyx() and related 2-return macros in terms of getcury(), getcurx(), etc. + modify waddch_literal() in case an application passes bytes of a multibyte character directly to waddch(). In this case, waddch() must reassemble the bytes into a wide-character (report by Tomohiro Kubota <kubota@debian.org>). 20030614 + modify waddch_literal() in case a multibyte value occupies more than two cells. + modify PutAttrChar() to compute the number of character cells that are used in multibyte values. This fixes a problem displaying double-width characters (report/test by Mitsuru Chinen <mchinen@yamato.ibm.com>). + add a null-pointer check for result of keyname() in _tracechar() + modify _tracechar() to work around glibc sprintf bug. 20030607 + add a call to setlocale() in cursesmain.cc, making demo display properly in a UTF-8 locale. + add a fallback definition in curses.priv.h for MB_LEN_MAX (prompted by discussion with Gabor Z Papp). + use macros NCURSES_ACS() and NCURSES_WACS() to hide cast needed to appease -Wchar-subscript with g++ 3.3 (Debian #195732). + fix a redefinition of $RANLIB in the configure script when libtool is used, which broke configure on Mac OS X (report by Chris Zubrzycki <beren@mac.com>). + simplify ifdef for bool declaration in curses.h.in (suggested by Albert Chin-A-Young). + remove configure script check to allow -Wconversion for older versions of gcc (suggested by Albert Chin-A-Young). 20030531 + regenerated html manpages. + modify ifdef's in curses.h.in that disabled use of __attribute__() for g++, since recent versions implement the cases which ncurses uses (Debian #195230). + modify _nc_get_token() to handle a case where an entry has no description, and capabilities begin on the same line as the entry name. + fix a typo in ncurses_dll.h reported by gcc 3.3. + add an entry for key_defined.3x to man_db.renames. 20030524 + modify setcchar() to allow converting control characters to complex characters (report/test by Mitsuru Chinen <mchinen@yamato.ibm.com>). + add tkterm entry -TD + modify parse_entry.c to allow a terminfo entry with a leading 2-character name (report by Don Libes). + corrected acsc in screen.teraterm, which requires a PC-style mapping. + fix trace statements in read_entry.c to use lseek() rather than tell(). + fix signed/unsigned warnings from Sun's compiler (gcc should give these warnings, but it is unpredictable). + modify configure script to omit -Winline for gcc 3.3, since that feature is broken. + modify manlinks.sed to add a few functions that were overlooked since they return function pointers: field_init, field_term, form_init, form_term, item_init, item_term, menu_init and menu_term. 20030517 + prevent recursion in wgetch() via wgetnstr() if the connection cannot be switched between cooked/raw modes because it is not a TTY (report by Wolfgang Gutjahr <gutw@knapp.com>). + change parameter of define_key() and key_defined() to const (prompted by Debian #192860). + add a check in test/configure for ncurses extensions, since there are some older versions, etc., which would not compile with the current test programs. + corrected demo in test/ncurses.c of wgetn_wstr(), which did not convert wchar_t string to multibyte form before printing it. + corrections to lib_get_wstr.c: + null-terminate buffer passed to setcchar(), which occasionally failed. + map special characters such as erase- and kill-characters into key-codes so those will work as expected even if they are not mentioned in the terminfo. + modify PUTC() and Charable() macros to make wide-character line drawing work for POSIX locale on Linux console (cf: 20021221). 20030510 + make typography for program options in manpages consistent (report by Miloslav Trmac <mitr@volny.cz>). + correct dependencies in Ada95/src/Makefile.in, so the builds with "--srcdir" work (report by Warren L Dodge). + correct missing definition of $(CC) in Ada95/gen/Makefile.in (reported by Warren L Dodge <warrend@mdhost.cse.tek.com>). + fix typos and whitespace in manpages (patch by Jason McIntyre <jmc@prioris.mini.pw.edu.pl>). 20030503 + fix form_driver() cases for REQ_CLR_EOF, REQ_CLR_EOL, REQ_DEL_CHAR, REQ_DEL_PREV and REQ_NEW_LINE, which did not ensure the cursor was at the editing position before making modifications. + add test/demo_forms and associated test/edit_field.c demos. + modify test/configure.in to use test/modules for the list of objects to compile rather than using the list of programs. 20030419 + modify logic of acsc to use the original character if no mapping is defined, noting that Solaris does this. + modify ncurses 'b' test to avoid using the acs_map[] array since 20021231 changes it to no longer contain information from the acsc string. + modify makefile rules in c++, progs, tack and test to ensure that the compiler flags (e.g., $CFLAGS or $CCFLAGS) are used in the link command (report by Jose Luis Rico Botella <informatica@serpis.com>). + modify soft-key initialization to use A_REVERSE if A_STANDOUT would not be shown when colors are used, i.e., if ncv#1 is set in the terminfo as is done in "screen". 20030412 + add a test for slk_color(), in ncurses.c + fix some issues reported by valgrind in the slk_set() and slk_wset() code, from recent rewrite. + modify ncurses 'E' test to use show previous label via slk_label(), as in 'e' test. + modify wide-character versions of NewChar(), NewChar2() macros to ensure that the whole struct is initialized. 20030405 + modify setupterm() to check if the terminfo and terminal-modes have already been read. This ensures that it does not reinvoke def_prog_mode() when an application calls more than one function, such as tgetent() and initscr() (report by Olaf Buddenhagen). 20030329 + add 'E' test to ncurses.c, to exercise slk_wset(). + correct handling of carriage-return in wgetn_wstr(), used in demo of slk_wset(). + first draft of slk_wset() function. 20030322 + improved warnings in tic when suppressing items to fit in termcap's 1023-byte limit. + built a list in test/README showing which externals are being used by either programs in the test-directory or via internal library calls. + adjust include-options in CF_ETIP_DEFINES to avoid missing ncurses_dll.h, fixing special definitions that may be needed for etip.h (reported by Greg Schafer <gschafer@zip.com.au>). 20030315 + minor fixes for cardfile.c, to make it write the updated fields to a file when ^W is given. + add/use _nc_trace_bufcat() to eliminate some fixed buffer limits in trace code. 20030308 + correct a case in _nc_remove_string(), used by define_key(), to avoid infinite loop if the given string happens to be a substring of other strings which are assigned to keys (report by John McCutchan). + add key_defined() function, to tell which keycode a string is bound to (discussion with John McCutchan <ttb@tentacle.dhs.org>). + correct keybound(), which reported definitions in the wrong table, i.e., the list of definitions which are disabled by keyok(). + modify demo_keydef.c to show the details it changes, and to check for errors. 20030301 + restructured test/configure script, make it work for libncursesw. + add description of link_fieldtype() to manpage (report by L Dee Holtsclaw <dee@sunbeltsoft.com>). 20030222 + corrected ifdef's relating to configure check for wchar_t, etc. + if the output is a socket or other non-tty device, use 1 millisecond for the cost in mvcur; previously it was 9 milliseconds because the baudrate was not known. + in _nc_get_tty_mode(), initialize the TTY buffer on error, since glibc copies uninitialized data in that case, as noted by valgrind. + modify tput to use the same parameter analysis as tparm() does, to provide for user-defined strings, e.g., for xterm title, a corresponding capability might be title=\E]2;%p1%s^G, + modify MKlib_gen.sh to avoid passing "#" tokens through the C preprocessor. This works around Mac OS X's preprocessor, which insists on adding a blank on each side of the token (report/analysis by Kevin Murphy <murphy@genome.chop.edu>). 20030215 + add configure check for wchar_t and wint_t types, rather than rely on preprocessor definitions. Also work around for gcc fixinclude bug which creates a shadow copy of curses.h if it sees these symbols apparently typedef'd. + if database is disabled, do not generate run_tic.sh + minor fixes for memory-leak checking when termcap is read. 20030208 + add checking in tic for incomplete line-drawing character mapping. + update configure script to reflect fix for AC_PROG_GCC_TRADITIONAL, which is broken in autoconf 2.5x for Mac OS X 10.2.3 (report by Gerben Wierda <Sherlock@rna.nl>). + make return value from _nc_printf_string() consistent. Before, depending on whether --enable-safe-sprintf was used, it might not be cached for reallocating. 20030201 + minor fixes for memory-leak checking in lib_tparm.c, hardscroll.c + correct a potentially-uninitialized value if _read_termtype() does not read as much data as expected (report by Wolfgang Rohdewald <wr6@uni.de>). + correct several places where the aclocal.m4 macros relied on cache variable names which were incompatible (as usual) between autoconf 2.13 and 2.5x, causing the test for broken-linker to give incorrect results (reports by Gerben Wierda <Sherlock@rna.nl> and Thomas Esser <te@dbs.uni-hannover.de>). + do not try to open gpm mouse driver if standard output is not a tty; the gpm library does not make this check (bug report for dialog by David Oliveira <davidoliveira@develop.prozone.ws>). 20030125 + modified emx.src to correspond more closely to terminfo.src, added emx-base to the latter -TD + add configure option for FreeBSD sysmouse, --with-sysmouse, and implement support for that in lib_mouse.c, lib_getch.c 20030118 + revert 20030105 change to can_clear_with(), does not work for the case where the update is made on cells which are blanks with attributes, e.g., reverse. + improve ifdef's to guard against redefinition of wchar_t and wint_t in curses.h (report by Urs Jansen). 20030111 + improve mvcur() by checking if it is safe to move when video attributes are set (msgr), and if not, reset/restore attributes within that function rather than doing it separately in the GoTo() function in tty_update.c (suggested by Philippe Blain). + add a message in run_tic.in to explain more clearly what does not work when attempting to create a symbolic link for /usr/lib/terminfo on OS/2 and other platforms with no symbolic links (report by John Polterak). + change several sed scripts to avoid using "\+" since it is not a BRE (basic regular expression). One instance caused terminfo.5 to be misformatted on FreeBSD (report by Kazuo Horikawa <horikawa@FreeBSD.org> (see FreeBSD docs/46709)). + correct misspelled 'wint_t' in curs_get_wch.3x (Michael Elkins). 20030105 + improve description of terminfo operators, especially static/dynamic variables (comments by Mark I Manning IV <mark4th@earthlink.net>). + demonstrate use of FIELDTYPE by modifying test/ncurses 'r' test to use the predefined TYPE_ALPHA field-type, and by defining a specialized type for the middle initial/name. + fix MKterminfo.sh, another workaround for POSIXLY_CORRECT misfeature of sed 4.0 > patch by Philippe Blain: + optimize can_clear_with() a little by testing first if the parameter is indeed a "blank". + simplify ClrBottom() a little by allowing it to use clr_eos to clear sections as small as one line. + improve ClrToEOL() by checking if clr_eos is available before trying to use it. + use tputs() rather than putp() in a few cases in tty_update.c since the corresponding delays are proportional to the number of lines affected: repeat_char, clr_eos, change_scroll_region. 20021231 + rewrite of lib_acs.c conflicts with copying of SCREEN acs_map to/from global acs_map[] array; removed the lines that did the copying. 20021228 + change some overlooked tputs() calls in scrolling code to use putp() (report by Philippe Blain). + modify lib_getch.c to avoid recursion via wgetnstr() when the input is not a tty and consequently mode-changes do not work (report by <R.Chamberlin@querix.com>). + rewrote lib_acs.c to allow PutAttrChar() to decide how to render alternate-characters, i.e., to work with Linux console and UTF-8 locale. + correct line/column reference in adjust_window(), needed to make special windows such as curscr track properly when resizing (report by Lucas Gonze <lgonze@panix.com>). > patch by Philippe Blain: + correct the value used for blank in ClrBottom() (broken in 20000708). + correct an off-by-one in GoTo() parameter in _nc_scrolln(). 20021221 + change several tputs() calls in scrolling code to use putp(), to enable padding which may be needed for some terminals (patch by Philippe Blain). + use '%' as sed substitute delimiter in run_tic script to avoid problems with pathname delimiters such as ':' and '@' (report by John Polterak). +. 20021214 + allow BUILD_CC and related configure script variables to be overridden from the environment. + make build-tools variables in ncurses/Makefile.in consistent with the configure script variables (report by Maciej W Rozycki). + modify ncurses/modules to allow configure --disable-leaks --disable-ext-funcs to build (report by Gary Samuelson). + fix a few places in configure.in which lacked quotes (report by Gary Samuelson <gary.samuelson@verizon.com>). + correct handling of multibyte characters in waddch_literal() which force wrapping because they are started too late on the line (report by Sam Varshavchik). + small fix for CF_GNAT_VERSION to ignore the help-message which gnatmake adds to its version-message. > Maciej W Rozycki <macro@ds2.pg.gda.pl>: + use AC_CHECK_TOOL to get proper values for AR and LD for cross compiling. + use $cross_compiling variable in configure script rather than comparing $host_alias and $target alias, since "host" is traditionally misused in autoconf to refer to the target platform. + change configure --help message to use "build" rather than "host" when referring to the --with-build-XXX options. 20021206 + modify CF_GNAT_VERSION to print gnatmake's version, and to allow for possible gnat versions such as 3.2 (report by Chris Lingard <chris@stockwith.co.uk>). + modify #define's for CKILL and other default control characters in tset to use the system's default values if they are defined. + correct interchanged defaults for kill and interrupt characters in tset, which caused it to report unnecessarily (Debian #171583). + repair check for missing C++ compiler, which is broken in autoconf 2.5x by hardcoding it to g++ (report by Martin Mokrejs). + update config.guess, config.sub (2002-11-30) + modify configure script to skip --with-shared, etc., when the --with-libtool option is given, since they would be ignored anyway. + fix to allow "configure --with-libtool --with-termlib" to build. + modify configure script to show version number of libtool, to help with bug reports. libtool still gets confused if the installed ncurses libraries are old, since it ignores the -L options at some point (tested with libtool 1.3.3 and 1.4.3). + reorder configure script's updating of $CPPFLAGS and $CFLAGS to prevent -I options in the user's environment from introducing conflicts with the build -I options (may be related to reports by Patrick Ash and George Goffe). + rename test/define_key.c to test/demo_defkey.c, test/keyok.c to test/demo_keyok.c to allow building these with libtool. 20021123 + add example program test/define_key.c for define_key(). + add example program test/keyok.c for keyok(). + add example program test/ins_wide.c for wins_wch() and wins_wstr(). + modify wins_wch() and wins_wstr() to interpret tabs by using the winsch() internal function. + modify setcchar() to allow for wchar_t input strings that have more than one spacing character. 20021116 + fix a boundary check in lib_insch.c (patch by Philippe Blain). + change type for *printw functions from NCURSES_CONST to const (prompted by comment by Pedro Palhoto Matos <plpm@mega.ist.utl.pt>, but really from a note on X/Open's website stating that either is acceptable, and the latter will be used in a future revision). + add xterm-1002, xterm-1003 terminfo entries to demonstrate changes in lib_mouse.c (20021026) -TD + add screen-bce, screen-s entries from screen 3.9.13 (report by Adam Lazur <zal@debian.org>) -TD + add mterm terminfo entries -TD 20021109 + split-out useful fragments in terminfo for vt100 and vt220 numeric keypad, i.e., vt100+keypad, vt100+pfkeys, vt100+fnkeys and vt220+keypad. The last as embedded in various entries had ka3 and kb2 interchanged (report/discussion with Leonard den Ottolander <leonardjo@hetnet.nl>). + add check in tic for keypads consistent with vt100 layout. + improve checks in tic for color capabilities 20021102 + check for missing/empty/illegal terminfo name in _nc_read_entry() (report by Martin Mokrejs, where $TERM was set to an empty string). + rewrote lib_insch.c, combining it with lib_insstr.c so both handle tab and other control characters consistently (report by Philippe Blain). + remove an #undef for KEY_EVENT from curses.tail used in the experimental NCURSES_WGETCH_EVENTS feature. The #undef confuses dpkg's build script (Debian #165897). + fix MKlib_gen.sh, working around the ironically named POSIXLY_CORRECT feature of GNU sed 4.0 (reported by Ervin Nemeth <airwin@inf.bme.hu>). 20021026 + implement logic in lib_mouse.c to handle position reports which are generated when XFree86 xterm is initialized with private modes 1002 or 1003. These are returned to the application as the REPORT_MOUSE_POSITION mask, which was not implemented. Tested both with ncurses 'a' menu (prompted by discussion with Larry Riedel <Larry@Riedel.org>). + modify lib_mouse.c to look for "XM" terminfo string, which allows one to override the escape sequence used to enable/disable mouse mode. In particular this works for XFree86 xterm private modes 1002 and 1003. If "XM" is missing (note that this is an extended name), lib_mouse uses the conventional private mode 1000. + correct NOT_LOCAL() macro in lib_mvcur.c to refer to screen_columns where it used screen_lines (report by Philippe Blain). + correct makefile rules for the case when both --with-libtool and --with-gpm are given (report by Mr E_T <troll@logi.net.au>). + add note to terminfo manpage regarding the differences between setaf/setab and setf/setb capabilities (report by Pavel Roskin). 20021019 + remove redundant initialization of TABSIZE in newterm(), since it is already done in setupterm() (report by Philippe Blain). + add test/inserts.c, to test winnstr() and winsch(). + replace 'sort' in dist.mk with script that sets locale to POSIX. + update URLs in announce.html.in (patch by Frederic L W Meunier). + remove glibc add-on files, which are no longer needed (report by Frederic L W Meunier). 20021012 5.3 release for upload to + modify ifdef's in etip.h.in to allow the etip.h header to compile with gcc 3.2 (patch by Dimitar Zhekov <jimmy@is-vn.bg>). + add logic to setupterm() to make it like initscr() and newterm(), by checking for $NCURSES_TRACE environment variable and enabling the debug trace in that case. + modify setupterm() to ensure that it initializes the baudrate, for applications such as tput (report by Frank Henigman). + modify definition of bits used for command-line and library debug traces to avoid overlap, using new definition TRACE_SHIFT to relate the two. + document tput's interpretation of parameterized strings according to whether parameters are given, etc. (discussion with Robert De Bath). 20021005 pre-release + correct winnwstr() to account for non-character cells generated when a double-width character is added (report by Michael Bienia <michael@vorlon.ping.de>). + modify _nc_viswbuf2n() to provide better results using wctomb(). + correct logic in _nc_varargs() which broke tracing of parameters for formats such as "%.*s". + correct scale factor in linux-c and linux-c-nc terminfo entries (report Floyd Davidson). + change tic -A option to -t, add the same option to infocmp for consistency. + correct "%c" implementation in lib_tparm.c, which did not map a null character to a 128 (cf: 980620) (patch by Frank Henigman <fjhenigman@mud.cgl.uwaterloo.ca>). 20020928 pre-release + modify MKkey_defs.sh to check for POSIX sort -k option, use that if it is found, to accommodate newer utility which dropped the compatibility support for +number options (reported by Andrey A Chernov). + modify linux terminfo entry to use color palette feature from linux-c-nc entry (comments by Tomasz Wasiak and Floyd Davidson). + restore original color definitions in endwin() if init_color() was used, and resume those colors on the next doupdate() or refresh() (report by Tomasz Wasiak <tjwasiak@komputom.com.pl>). + improve debug-traces by modifying MKlib_gen.sh to generate calls to returnBool() and returnAttr(). + add/use _nc_visbufn() and _nc_viswbufn() to limit the debug trace of waddnstr() and similar functions to match the parameters as used. + add/use _nc_retrace_bool() and _nc_retrace_unsigned(). + correct type used by _nc_retrace_chtype(). + add debug traces to some functions in lib_mouse.c + modify lib_addch.c to handle non-spacing characters. + correct parameter of RemAttr() in lib_bkgd.c, which caused the c++ demo's boxes to lose the A_ALTCHARSET flag (broken in 20020629). + correct width computed in _tracedump(), which did not account for the attributes (broken in 20010602). + modify test/tracemunch to replace addresses for windows other than curscr, newscr and stdscr with window0, window1, etc. 20020921 pre-release + redid fix for edit_man.sed path. + workaround for Cygwin bug which makes subprocess writes to stdout result in core dump. + documented getbegx(), etc. + minor fixes to configure script to use '%' consistently as a sed delimiter rather than '@'. > patch by Philippe Blain: + add check in lib_overlay.c to ensure that the windows to be merged actually overlap, and in copywin(), limit the area to be touched to the lines given for the destination window. 20020914 pre-release + modified curses.h so that if the wide-character version is installed overwriting /usr/include/curses.h, and if it relied on libutf8.h, then applications that use that header for wide-character support must define HAVE_LIBUTF8_H. + modify putwin(), getwin() and dupwin() to allow them to operate on pads (request by Philippe Blain). + correct attribute-merging in wborder(), broken in 20020216 (report by Tomasz Wasiak <tjwasiak@grubasek.komputom.com.pl>). > patch by Philippe Blain: + corrected pop-counts in tparam_internal() to '!' and '~' cases. + use sizeof(NCURSES_CH_T) in one place that used sizeof(chtype). + remove some unused variables from mvcur test-driver. 20020907 pre-release + change configure script to allow install of widec-character (ncursesw) headers to overwrite normal (ncurses) headers, since the latter is a compatible subset of the former. + fix path of edit_man.sed in configure script, needed to regenerate html manpages on Debian. + fix mismatched enums in vsscanf.c, which caused warning on Solaris. + update README.emx to reflect current patch used for autoconf. + change web- and ftp-site to invisible-island.net > patch by Philippe Blain: + change case for 'P' in tparam_internal() to indicate that it pops a variable from the stack. + correct sense of precision and width in parse_format(), to avoid confusion. + modify lib_tparm.c, absorb really_get_space() into get_space(). + modify getwin() and dupwin() to copy the _notimeout, _idlok and _idcok window fields. + better fix for _nc_set_type(), using typeMalloc(). 20020901 pre-release + change minor version to 3, i.e., ncurses 5.3 + update config.guess, config.sub + retest build with each configure option; minor ifdef fixes. + make keyname() return a null pointer rather than "UNKNOWN STRING" to match XSI. + modify handling of wide line-drawing character functions to use the normal line-drawing characters when not in UTF-8 locale. + add check/fix to comp_parse.c to suppress warning about missing acsc string. This happens in configurations where raw termcap information is processed; tic already does this and other checks. + modify tic's check for ich/ich1 versus rmir/smir to only warn about ich1, to match xterm patch #70 notes. + moved information for ripped-off lines into SCREEN struct to allow use in resizeterm(). + add experimental wgetch_events(), ifdef'd with NCURSES_WGETCH_EVENTS (adapted from patch by Ilya Zakharevich - see ncurses/README.IZ). + amend check in kgetch() from 20020824 to look only for function-keys, otherwise escape sequences are not resolved properly. > patch by Philippe Blain: + removed redundant assignment to SP->_checkfd from newterm(). + check return-value of setupterm() in restartterm(). + use sizeof(NCURSES_CH_T) in a few places that used sizeof(chtype). + prevent dupwin() from duplicating a pad. + prevent putwin() from writing a pad. + use typeRealloc() or typeMalloc() in preference to direct calls on _nc_doalloc(). 20020824 +). + ensure clearerr() is called before using ferror() e.g., in lib_screen.c (report by Philippe Blain). 20020817 +. + add checks for null pointer in calls to tparm() and tgoto() based on FreeBSD bug report. If ncurses were built with termcap support, and the first call to tgoto() were a zero-length string, the result would be a null pointer, which was not handled properly. + correct a typo in terminfo.head, which gave the octal code for colon rather than comma. + remove the "tic -u" option from 20020810, since it did not account for nested "tc=" clauses, and when that was addressed, was still unsatisfactory. 20020810 + add tic -A option to suppress capabilities which are commented out when translating to termcap. + add tic -u option to provide older behavior of "tc=" clauses. + modified tic to expand all but the final "tc=" clause in a termcap entry, to accommodate termcap libraries which do not handle multiple tc clauses. + correct typo in curs_inopts.3x regarding CS8/CS7 usage (report by Philippe Blain). + remove a couple of redundant uses of A_ATTRIBUTES in expressions using AttrOf(), which already incorporates that mask (report by Philippe Blain). + document TABSIZE variable. + add NCURSES_ASSUMED_COLORS environment variable, to allow users to override compiled-in default black-on-white assumption used in assume_default_colors(). + correct an off-by-one comparison against max_colors in COLORFGBG logic. + correct a use of uninitialized memory found by valgrind (reported by Olaf Buddenhagen <olafBuddenhagen@web.de>). + modified wresize() to ensure that a failed realloc will not corrupt the window structure, and to make subwindows fit within the resized window (completes Debian #87678, #101699) 20020803 + fix an off-by-one in lib_pad.c check for limits of pad (patch by Philippe Blain). + revise logic for BeOS in lib_twait.c altered in 20011013 to restore logic used by lib_getch.c's support for GPM or EMX mouse (report by Philippe Blain) + remove NCURSES_CONST from several prototypes in curses.wide, to make the --enable-const --enable-widec configure options to work together (report by George Goffe <grgoffe@yahoo.com>). 20020727 + finish no-leak checking in cardfile.c, using this for testing changes to resizeterm(). + simplify _nc_freeall() using delscreen(). 20020720 + check error-return from _nc_set_tty_mode() in _nc_initscr() and reset_prog_mode() (report/patch by Philippe Blain). + regenerate configure using patch for autoconf 2.52, to address problem with identifying C++ bool type. + correct/improve logic to produce an exit status for errors in tput, which did not exit with an error when told to put a string not in the current terminfo entry (report by David Gomez <david@pleyades.net>). + modify configure script AC_OUTPUT() call to work around defect in autoconf 2.52 which adds an ifdef'd include to the generated configure definitions. + remove fstat() check from scr_init(), which also fixes a missing include for <sys/stat.h> from 20020713 (reported by David Ellement, fix suggested by Philippe Blain). + update curs_scanw.3x manpage to note that XSI curses differs from SVr4 curses: return-values are incompatible. + correct several prototypes in manpages which used const inconsistently with the curses.h file, and removed spurious const's in a few places from curses.h, e.g., for wbkgd() (report by Glenn Maynard <glenn@zewt.org>). + change internal type used by tparm() to long, to work with LP64 model. + modify nc_alloc.h to allow building with g++, for testing. 20020713 + add resize-handling to cardfile.c test program. + altered resizeterm() to avoid having it fail when a child window cannot be resized because it would be larger than its parent. (More work must be done on this, but it works well enough to integrate). + improve a limit-check in lib_refresh.c + remove check in lib_screen.c relating dumptime to file's modification times, since that would not necessarily work for remotely mounted filesystems. + modify lrtest to simplify debugging changes to resizeterm, e.g., t/T commands to enable/disable tracing. + updated status of multibyte support in TO-DO. + update contact info in source-files (patch by Juergen Pfeifer). 20020706 + add Caps.hpux11, as an example. + modify version_filter(), used to implement -R option for tic and infocmp, to use computed array offsets based on the Caps.* file which is actually configured, rather than constants which correspond to the Caps file. + reorganized lib_raw.c to avoid updating SP and cur_term state if the functions fail (reported by Philippe Blain). + add -Wundef to gcc warnings, adjust a few ifdef's to accommodate gcc. 20020629 + correct parameters to setcchar() in ncurses.c (cf: 20020406). + set locale in most test programs (view.c and ncurses.c were the only ones). + add configure option --with-build-cppflags (report by Maksim A Nikulin <M.A.Nikulin@inp.nsk.su>). + correct a typo in wide-character logic for lib_bkgnd.c (Philippe Blain). + modify lib_wacs.c to not cancel the acsc, smacs, rmacs strings when in UTF-8 locale. Wide-character functions use Unicode values, while narrow-character functions use the terminfo data. + fix a couple of places in Ada95/samples which did not compile with gnat 3.14 + modify mkinstalldirs so the DOS-pathname case is locale-independent. + fix locale problem in MKlib_gen.sh by forcing related variables to POSIX (C), using same approach as autoconf (set variables only if they were set before). Update MKterminfo.sh and MKtermsort.sh to match. 20020622 + add charset to generated html. + add mvterm entry, adapted from a FreeBSD bug-report by Daniel Rudy <dcrudy@pacbell.net> -TD + add rxvt-16color, ibm+16color entries -TD + modify check in --disable-overwrite option so that it is used by default unless the --prefix/$prefix value is not /usr, in attempt to work around packagers, e.g., for Sun's freeware, who do not read the INSTALL notes. 20020615 + modify wgetch() to allow returning ungetch'd KEY_RESIZE as a function key code in get_wch(). + extended resize-handling in test/ncurses 'a' menu to the entire stack of windows created with 'w' commands. + improve $COLORFGBG feature by interpreting an out-of-range color value as an SGR 39 or 49, for foreground/background respectively. + correct a typo in configure --enable-colorfgbg option, and move it to the experimental section (cf: 20011208). 20020601 + add logic to dump_entry.c to remove function-key definitions that do not fit into the 1023-byte limit for generated termcaps. This makes hds200 fit. + more improvements to tic's warnings, including logic to ignore differences between delay values in sgr strings. + move definition of KEY_RESIZE into MKkeydefs.sh script, to accommodate Caps.osf1r5 which introduced a conflicting definition. 20020525 + add simple resize-handling in test/ncurses.c 'a' menu. + fixes in keyname() and _tracechar() to handle negative values. + make tic's warnings about mismatches in sgr strings easier to follow. + correct tic checks for number of parameters in smgbp and smglp. + improve scoansi terminfo entry, and add scoansi-new entry -TD + add pcvt25-color terminfo entry -TD + add kf13-kf48 strings to cons25w terminfo entry (reported by Stephen Hurd <deuce@lordlegacy.org> in newsgroup lucky.freebsd.bugs) -TD + add entrypoint _nc_trace_ttymode(), use this to distinguish the Ottyb and Nttyb members of terminal (aka cur_term), for tracing. 20020523 + correct and simplify logic for lib_pad.c change in 20020518 (reported by Mike Castle). 20020518 + fix lib_pad.c for case of drawing a double-width character which falls off the left margin of the pad (patch by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>) + modify configure script to work around broken gcc 3.1 "--version" option, which adds unnecessary trash to the requested information. + adjust ifdef's in case SIGWINCH is not defined, e.g., with DJGPP (reported by Ben Decker <deckerben@freenet.de>). 20020511 + implement vid_puts(), vid_attr(), term_attrs() based on the narrow- character versions as well. + implement erasewchar(), killwchar() based on erasechar() and killchar(). + modify erasechar() and killchar() to return ERR if the value was VDISABLE. + correct a bug in wresize() in handling subwindows (based on patch by Roger Gammans <rgammans@computer-surgery.co.uk>, report by Scott Beck <scott@gossamer-threads.com>). + improve test/tclock.c by making the second-hand update more often if gettimeofday() is available. 20020429 + workaround for Solaris sed with MKlib_gen.sh (reported by Andy Tsouladze <andyt@mypoints.com>). 20020427 + correct return-value from getcchar(), making it consistent with Solaris and Tru64. + reorder loops that generate makefile rules for different models vs subsets so configure --with-termlib works again. This was broken by logic added to avoid duplicate rules in changes to accommodate cygwin dll's (reported by George.R.Goffe@seagate.com). + update config.guess, config.sub 20020421 + modify ifdef's in write_entry.c to allow use of symbolic links on platforms with no hard links, e.g., BeOS. + modify a few includes to allow compile with BeOS, which has stdbool.h with a conflicting definition for 'bool' versus its OS.h definition. + amend MKlib_gen.sh to work with gawk, which defines 'func' as an alias for 'function'. 20020420 + correct form of prototype for ripoffline(). + modify MKlib_gen.sh to test that all functions marked as implemented can be linked. 20020413 + add manpages: curs_get_wstr.3x, curs_in_wchstr.3x + implement wgetn_wstr(). + implement win_wchnstr(). + remove redefinition of unget_wch() in lib_gen.c (reported by Jungshik Shin <jshin@jtan.com>). 20020406 + modified several of the test programs to allow them to compile with vendor curses implementations, e.g., Solaris, AIX -TD 20020323 + modified test/configure to allow configuring against ncursesw. + change WACS_xxx definition to use address, to work like Tru64 curses. 20020317 + add 'e' and 'm' toggles to 'a', 'A' tests in ncurses.c to demonstrate effect of echo/noecho and meta modes. + add 'A' test to ncurses.c to demonstrate wget_wch() and related functions. + add manpage: curs_get_wch.3x + implement unget_wch(). + implement wget_wch(). 20020310 + regenerated html manpages. + add manpages: curs_in_wch.3x, curs_ins_wch.3x, curs_ins_wstr.3x + implement wins_wch(). + implement win_wch(). + implement wins_nwstr(), wins_wstr(). 20020309 + add manpages: curs_addwstr.3x, curs_winwstr.3x + implement winnwstr(), winwstr(). 20020223 + add manpages: curs_add_wchstr.3x, curs_bkgrnd.3x + document wunctrl, key_name. + implement key_name(). + remove const's in lib_box.c incorrectly leftover after splitting off lib_box_set.c + update llib-lncurses, llib-ncursesw, fix configure script related to these. 20020218 + remove quotes on "SYNOPSIS" in man/curs_box_set.3x, which resulted in spurious symlinks on install. 20020216 + implement whline_set(), wvline_set(), add manpage curs_border_set. + add subtest 'b' to 'F' and 'f' in ncurses.c to demonstrate use of box() and box_set() functions. + add subtest 'u' to 'F' in ncurses.c, to demonstrate use of addstr() given UTF-8 string equivalents of WACS_xxx symbols. + minor fixes to several manpages based on groff -ww output. + add descriptions of external variables of termcap interface to the manpage (report by Bruce Evans <bde@zeta.org.au>). > patches by Bernhard Rosenkraenzer: + correct configure option --with-bool, which was executed as --with-ospeed. + add quotes for parameters of --with-bool and --with-ospeed configure options. > patch by Sven Verdoolaege (report by Gerhard Haering <haering_linux@gmx.de>): + correct typos in definitions of several wide-character macros: waddwstr, wgetbkgrnd, mvaddwstr, mvwadd_wchnstr, mvwadd_wchnstr, mvwaddwstr. + pass $(CPPFLAGS) to MKlib_gen.sh, thereby fixing a missing definition of _XOPEN_SOURCE_EXTENDED, e.g., on Solaris 20020209 + implement wide-acs characters for UTF-8 locales. When in UTF-8 locale, ignore narrow version of acs. Add 'F' test to test/ncurses.c to demonstrate. + correct prototype in keybound manpage (noted from a Debian mailing list item). 20020202 + add several cases to the wscanw() example in testcurs.c, showing the format. +). + add a call to _nc_keypad() in keypad() to accommodate applications such as nvi, which use curses for output but not for input (fixes Debian #131263, cf: 20011215). + add entrypoints to resizeterm.c which provide better control over the process: is_term_resized() and resize_term(). The latter restores the original design of resizeterm() before KEY_RESIZE was added in 970906. Do this to accommodate 20010922 changes to view.c, but allow for programs with their own sigwinch handler, such as lynx (reported by Russell Ruby <russ@math.orst.edu>). 20020127 + fix a typo in change to mk-1st.awk, which broke the shared-library makefile rules (reported by Martin Mokrejs). 20020126 + update config.guess, config.sub + finish changes needed to build dll's on cygwin. + fix a typo in mvwchat() macro (reported by Cy <yam@homerow.net). 20020119 + add case in lib_baudrate.c for B921600 (patch by Andrey A Chernov). + correct missing sed-editing stage in manpage installs which is used to rename manpages, broken in 20010324 fix for Debian #89939 (Debian #78866). + remove -L$(libdir) from linker flags, probably not needed any more since HPUX is handled properly (reported by Niibe Yutaka <gniibe@m17n.org>). + add configure check for mbstate_t, needed for wide-character configuration. On some platforms we must include <wchar.h> to define this (reported by Daniel Jacobowitz). + incorporate some of the changes needed to build dll's on cygwin. 20020112a + workaround for awk did not work with mawk, adjusted shell script. 20020112 + add Caps.osf1r5, as an example. + modify behavior of can_clear_with() so that if an application is running in a non-bce terminals with default colors enabled, it returns true, allowing the user to select/paste text without picking up extraneous trailing blanks (adapted from patch by Daniel Jacobowitz <dmj+@andrew.cmu.edu>). + modify generated curses.h to ifdef-out prototypes for extensions if they are disabled, and to define curses_version() as a string in that case. This is needed to make the programs such as tic build in that configuration. + modified generated headers.sh to remove a gzip'd version of the target file if it exists, in case non-gzip'd manpages are installed into a directory where gzip'd ones exist. In that case, the latter would be found. + corrected a redundant initialization of signal handlers from 20010922 changes. + clarified bug-reporting address in terminfo.src (report by John H DuBois III <spcecdt@armory.com>). > several fixes from Robert Joop: + do not use "-v" option of awk in MKkey_defs.sh because it does not work with SunOS nawk. + modify definitions for libutf8 in curses.h to avoid redefinition warnings for mblen + quoted references to compiler in shell command in misc/Makefile, in case it uses multiple tokens. 20011229 + restore special case from 20010922 changes to omit SA_RESTART when setting up SIGWINCH handler, which is needed to allow wgetch() to be interrupted by that signal. + update configure macro CF_WITH_PATHLIST, to omit some double quotes not needed with autoconf 2.52 + revert configure script to autoconf 2.13 patched with autoconf-2.13-19990117.patch.gz (or later) from because autoconf 2.52 macro AC_PROG_AWK does not work on HPUX 11.0 (report by David Ellement <ellement@sdd.hp.com>). This also fixes a different problem configuring with Mac OS X (reported by Marc Smith <marc.a.smith@home.com>). 20011222 + modify include/edit_cfg.h to eliminate BROKEN_LINKER symbol from term.h + move prototype for _nc_vsscanf() into curses.h.in to omit HAVE_VSSCANF symbol from curses.h, which was dependent upon the ncurses_cfg.h file which is not installed. + use ACS_LEN rather than SIZEOF(acs_map) in trace code of lib_acs.c, to work with broken linker configuration, e.g., cygwin (report by Robert Joop <rj@rainbow.in-berlin.de>). + make napms() call _nc_timed_wait() rather than poll() or select(), to work around broken implementations of these on cygwin. 20011218 + drop configure macro CF_WIDEC_SHIFT, since that was rendered obsolete by Sven Verdoolaege's rewrite of wide-character support. This makes libncursesw incompatible again, but makes the header files almost the same as in the narrow-character configuration. + simplify definitions that combine wide/narrow versions of bkgd, etc., to eliminate differences between the wide/narrow versions of curses.h + correct typo in configure macro CF_FUNC_VSSCANF + correct location of call to _nc_keypad() from 20011215 changes which prevented keypad() from being disabled (reported by Lars Hecking). 20011215 + rewrote ncurses 'a' test to exercise wgetch() and keypad() functions better, e.g., by adding a 'w' command to create new windows which may have different keypad() settings. + corrected logic of keypad() by adding internal screen state to track whether the terminal's keypad-mode has been set. Use this in wgetch() to update the keypad-mode according to whether the associated window's keypad-mode has been set with keypad(). This corrects a related problem restoring terminal state after handling SIGTSTP (reported by Mike Castle). + regenerate configure using patch for autoconf 2.52 autoconf-2.52-patch.gz at + update config.guess, config.sub from + minor changes to quoting in configure script to allow it to work with autoconf 2.52 20011208 + modify final checks in lib_setup.c for line and col values, making them independent. + modify acs_map[] if configure --broken-linker is specified, to make it use a function rather than an array (prompted by an incorrect implementation in cygwin package). + correct spelling of configure option --enable-colorfgbg, which happened to work if --with-develop was set (noted in cygwin package for ncurses). + modify ifdef for genericerror() to compile with SUNWspro Sun WorkShop 6 update 1 C++ 5.2 (patch by Sullivan N Beck <sbeck@cise.ufl.edu>). + add configure checks to see if ncurses' fallback vsscanf() will compile either of the special cases for FILE structs, and if not, force it to the case which simply returns an error (report by Sullivan N Beck <sbeck@cise.ufl.edu> indicates that Solaris 8 with 64-bits does not allow access to FILE's fields). + modify ifdef's for c++/cursesw.cc to use the fallback vsscanf() in the ncurses library if no better substitute for this can be found in the C++ runtime. + modify the build to name dynamic libraries according to the convention used on OS X and Darwin. Rather than something like libncurses.dylib.5.2, Darwin would name it libncurses. 5.dylib. There are a few additional minor fixes, such as setting the library version and compatibility version numbers (patch by Jason Evans <jevans@apple.com>). + use 'sh' to run mkinstalldirs, to work around problems with buggy versions of 'make' on OS/2 (report by John Polterak <jp@eyup.org>). + correct typo in manpage description of curs_set() (Debian #121548). + replace the configure script existence-check for mkstemp() by one that checks if the function works, needed for older glibc and AmigaOS. 20011201 + modify script that generates fallbacks.c to compile a temporary copy of the terminfo source in case the host does not contain all of the entries requested for fallbacks (request by Greg Roelofs). + modify configure script to accommodate systems such as Mac OS X whose <stdbool.h> header defines a 'bool' type inconsistent with ncurses, which normally makes 'bool' consistent with C++. Include <stdbool.h> from curses.h to force consistent usage, define a new type NCURSES_BOOL and related that to the exported 'bool' as either a typedef or definition, according to whether <stdbool.h> is present (based on a bug report for tin 1.5.9 by Aaron Adams <adamsa@mac.com>). 20011124 + added/updated terminfo entries for M$ telnet and KDE konsole -TD 20011117 + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries (Benjamin C W Sittler). + add putty terminfo entry -TD + if configuring for wide-curses, define _XOPEN_SOURCE_EXTENDED, since this may not otherwise be defined to make test/view.c compile. 20011110 + review/correct several missing/generated items in curses.wide, sorted the lists to make subsequent diff's easier to track. 20011103 + add manual pages for add_wch(), echo_wchar(), getcchar(), mvadd_wch(), mvwadd_wch(), setcchar(), wadd_wch() and wecho_wchar(). + implement wecho_wchar() + modify _tracedump() to handle wide-characters by mapping them to '?' and control-characters to '.', to make the trace file readable. Also dynamically allocate the buffer used by _tracedump() for formatting the results. + modify T_CALLED/T_RETURN macros to ease balancing call/return lines in a trace by using curly braces. + implement _nc_viscbuf(), for tracing cchar_t arrays. + correct trace-calls in setcchar() and getcchar() functions, which traced the return values but not the entry to each function. + correct usage message in test/view.c, which still mentioned -u flag. 20011027 + modify configure script to allow building with termcap only, or with fallbacks only. In this case, we do not build tic and toe. + add configure --with-termpath option, to override default TERMPATH value of /etc/termcap:/usr/share/misc/termcap. + cosmetic change to tack: make menu descriptions agree with menu titles. 20011020 + rewrote limit-checks in wscrl() and associated _nc_scroll_window(), to ensure that if the parameter of wscrl() is larger than the size of the scrolling region, then the scrolling region will be cleared (report by Ben Kohlen <bckohlen@yahoo.com>). + add trace/varargs.c, using this to trace parameters in lib_printw.c + implement _tracecchar_t2() and _tracecchar_t(). + split-out trace/visbuf.c + correct typo in lib_printw.c changes from 20010922 (report by Mike Castle). 20011013 + modify run_tic.sh to check if the build is a cross-compile. In that case, do not use the build's tic to install the terminfo database (report by Rafael Rodriguez Velilla <rrv@tid.es>). + modify mouse click resolution so that mouseinterval(-1) will disable it, e.g., to handle touchscreens via a slow connection (request by Byron Stanoszek <gandalf@winds.org>). + correct mouseinterval() default value shown in curs_mouse.3x + remove conflicting definition of mouse_trafo() (reported by Lars Hecking, using gcc 2.95.3). 20011001 + simpler fix for signal_name(), to replace the one overlooked in 20010929 (reported by Larry Virden). 20010929 + add -i option to view.c, to test ncurses' check for non-default signal handler for SIGINT, etc. + add cases for shared-libraries on Darwin/OS X (patch by Rob Braun <bbraun@synack.net>). + modify tset to restore original I/O modes if an error is encountered. Also modify to use buffered stderr consistently rather than mixing with write(). + change signal_name() function to use if-then-else rather than case statement, since signal-values aren't really integers (reported by Larry Virden). + add limit checks in wredrawln(), fixing a problem where lynx was repainting a pad which was much larger than the screen. 20010922 + fix: PutRange() was counting the second part of a wide character as part of a run, resulting in a cursor position that was one too far (patch by Sven Verdoolaege). + modify resizeterm() to not queue a KEY_RESIZE if there was no SIGWINCH, thereby separating the two styles of SIGWINCH handling in test/view.c + simplified lib_tstp.c, modify it to use SA_RESTART flag for SIGWINCH. + eliminate several static buffers in the terminfo compiler, using allocated buffers. + modify MKkeyname.awk so that keyname() does not store its result into a static buffer that is overwritten by the next call. + reorganize the output of infocmp -E and -e options to compile cleanly with gcc -Wwrite-strings warnings. + remove redefinition of chgat/wchgat/mvwchgat from curses.wide 20010915 + add label to test/view.c, showing the name of the last key or signal that made the screen repaint, to make it clearer when a sigwinch does this. + use ExitProgram() consistently in the test-programs to make it simpler to test leaks with dmalloc, etc. + move hashtab static data out of hashmap.c into SCREEN struct. + make NO_LEAK code compile with revised WINDOWLIST structs. 20010908 + modify tgetent() to check if exit_attribute_mode resets the alternate character set, and if so, attempt to adjust the copy of the termcap "me" string which it will return to eliminate that part. In particular, 'screen' would lose track of line-drawing characters (report by Frederic L W Meunier <0@pervalidus.net>, analysis by Michael Schroeder). 20010901 + specify DOCTYPE in html manpages. + add missing macros for several "generated" functions: attr_get(), attr_off(), attr_on(), attr_set(), chgat(), mvchgat(), mvwchgat() and mouse_trafo(). + modify view.c to agree with non-experimental status of ncurses' sigwinch handler: + change the sense of the -r option, making it default to ncurses' sigwinch handler. + add a note explaining what functions are unsafe in a signal handler. + add a -c option, to set color display, for testing. + unset $data variable in MKterminfo.sh script, to address potential infinite loop if shell malfunction (report by Samuel Mikes <smikes@cubane.com>, for bash 2.05.0 on a Linux 2.0.36 system). + change kbs in mach terminfo entries to ^? (Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>). + correct logic for COLORFGBG environment variable: if rxvt is compiled with xpm support, the variable has three fields, making it slightly incompatible with itself. In either case, the background color is the last field. 20010825 + move calls to def_shell_mode() and def_prog_mode() before loop with callbacks in lib_set_term.c, since the c++ demo otherwise initialized the tty modes before saving them (patch by John David Anglin <dave@hiauly1.hia.nrc.ca>). + duplicate logic used to initialize trace in newterm(), in initscr() to avoid confusing trace of initscr(). + simplify allocation of WINDOW and WINDOWLIST structs by making the first a part of the second rather than storing a pointer. This saves a call to malloc for each window (discussion with Philippe Blain). + remove unused variable 'used_ncv' from lib_vidattr.c (Philippe Blain). + modify c++/Makefile.in to accommodate archive programs that are different for C++ than for C, and add cases for vendor's C++ compilers on Solaris and IRIX (report by Albert Chin-A-Young). + correct manpage description of criteria for deciding if the terminal supports xterm mouse controls. + add several configure script options to aid with cross-compiling: --with-build-cc, --with-build-cflags, --with-build-ldflags, and --with-build-libs (request by Greg Roelofs). + change criteria for deciding if configure is cross-compiling from host/build mismatch to host/target mismatch (request by Greg Roelofs <greg.roelofs@philips.com>). + correct logic for infocmp -e and -E options which writes the data for the ext_Names[] array. This is needed if one constructs a fallback table for a terminfo entry which uses extended termcap names, e.g., AX in a color xterm. + fix undefined NCURSES_PATHSEP when configure --disable-database option is given. 20010811 + fix for VALID_BOOLEAN() macro when char is not signed. + modify 'clean' rule for C++ binding to work with Sun compiler, which caches additional information in a subdirectory of the objects. + added llib-ncursesw. 20010804 + add Caps.keys example for experimental extended function keys (adapted from a patch by Ilya Zakharevich). + correct parameter types of vidputs() and vidattr() to agree with header files (report by William P Setzer). + fix typos in several man-pages (patch by William P Setzer). + remove unneeded ifdef for __GNUG__ in CF_CPP_VSCAN_FUNC configure macro, which made ncurses C++ binding fail to build with other C++ compilers such as HPUX 11.x (report by Albert Chin-A-Young). + workaround for bug in HPUX 11.x C compiler: add a blank after NCURSES_EXPORT macro in form.h (report by Albert Chin-A-Young) + ignore blank lines in Caps* files in MKkey_defs.sh script (report by Albert Chin-A-Young). + correct definition of key_end in Caps.aix4, which left KEY_END undefined (report by Albert Chin-A-Young). + remove a QNX-specific fallback prototype for vsscanf(), which is obsolete with QNX RTP. + review/fix some of the T() and TR() macro calls, having noticed that there was no data for delwin() in a trace of dialog because there was no returnVoid call for wtimeout(). Also, traces in lib_twait.c are now selected under TRACE_IEVENT rather than TRACE_CALLS. 20010728 + add a _nc_access() check before opening files listed via $TERMPATH. + using modified man2html, regenerate some of the html manpages to fix broken HREF's where the link was hyphenated. 20010721 + add some limit/pointer checks to -S option of tputs. + updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries (Benjamin C W Sittler). + add a note in curs_termcap.3x regarding a defect in the XSI description of tgetent (based on a discussion with Urs Jansen regarding the HPUX 11.x implementation, whose termcap interface is not compatible with existing termcap programs). + modify manhtml rule in dist.mk to preserve copyright notice on the generated files, as well as to address HTML style issues reported by tidy and weblint. Regenerated/updated corresponding html files. + comment out use of Protected_Character and related rarely used attributes in ncurses Ada95 test/demo to compile with wide-character configuration. 20010714 + implement a simple example in C++ demo to test scanw(). + corrected stdio function used to implement scanw() in cursesw.cc + correct definition of RemAttr() macro from 20010602 changes, which caused C++ SillyDemo to not show line-drawing characters. + modify C++ binding, adding getKey() which can be overridden by user to substitute functions other than getch() for keyboard processing of forms and menus (patch by Juergen Pfeifer). 20010707 + fix some of the trace calls which needed modification to work with new wide-character structures. + modify magic-cookie code in tty_update.c to compile with new wide-character structures (report by <George.R.Goffe@seagate.com>). + ensure that _XOPEN_SOURCE_EXTENDED is defined in curses.priv.h if compiling for wide-character configuration. + make addwnstr() handle non-spacing characters (patch by Sven Verdoolaege). 20010630 + add configure check to define _GNU_SOURCE, needed to prop up glibc header files. + split-out include/curses.wide to solve spurious redefinitions caused by defining _GNU_SOURCE, and move includes for <signal.h> before <curses.h> to work around misdefinition of ERR in glibc 2.1.3 header file. + extended ospeed change to NetBSD and OpenBSD -TD + modify logic in lib_baudrate.c for ospeed, for FreeBSD to make it work properly for termcap applications (patch by Andrey A Chernov). 20010623 + correct an overlooked CharOf/UChar instance (reports by Eugene Lee <eugene@anime.net>, Sven Verdoolaege). + correct unneeded ifdef for wunctrl() (reported by Sven Verdoolaege) 20010618 + change overlooked several CharOf/UChar instances. > several patches from Sven Verdoolaege: + correct a typo in wunctrl(), which made it appear that botwc() was needed (no such function: use btowc()). + reimplement wide-character demo in test/view.c, using new functions. + implement getcchar(), setcchar(), wadd_wchnstr() and related macros. + fix a syntax problem with do/if/while in PUTC macro (curses.priv.h). 20010616 + add parentheses in macros for malloc in test.priv.h, fixes an expression in view.c (report by Wolfgang Gutjahr <gutw@knapp.co.at>). + add Caps.uwin, as an example. + change the way curses.h is generated, making the list of function key definitions extracted from the Caps file. + add #undef's before possible redefinition of ERR and OK in curses.h + modify logic in tic, toe, tput and tset which checks for basename of argv[0] to work properly on systems such as OS/2 which have case-independent filenames and/or program suffixes, e.g., ".ext". 20010609 + add a configure check, if --enable-widec is specified, for putwc(), which may be in libutf8. + remove some unnecessary text from curs_extend.3x and default_colors.3x which caused man-db to make incorrect symbolic links (Debian bug report #99550). + add configure check if cast for _IO_va_list is needed to compile C++ vscan code (Debian bug report #97945). > several patches from Sven Verdoolaege: + correct code that used non-standard auto-initialization of a struct, which gcc allows (report by Larry Virden). + use putwc() in PUTC() macro. + make addstr() work for the special case where the codeset is non-stateful (eg. UTF-8), as well as stateful codesets. 20010603 + correct loop expression in NEXT_CHAR macro for lib_addstr.c changes from 20010602 (report by Mike Castle). 20010602 + modify mvcur() to avoid emitting newline characters when nonl() mode is set. Normally this is not a problem since the actual terminal mode is set to suppress nl/crlf translations, however it is useful to allow the caller to manipulate the terminal mode to avoid staircasing effects after spawning a process which writes messages (for lynx 2.8.4) -TD > several patches from Sven Verdoolaege <skimo@kotnet.org>: + remove redundant type-conversion in fifo_push() + correct definition of addwstr() macro in curses.h.in + remove _nc_utf8_outch() + rename most existing uses of CharOf() to UChar(), e.g., where it is used to prevent sign-extension in ctype macros. + change some chtype's to attr_t's where the corresponding variables are used to manipulate attributes. + UpdateAttr() was applied to both attributes (attr_t) and characters (chtype). Modify macro and calls to it to make these distinct. + add CharEq() macro, use in places where wide-character configuration implementation uses a struct for cchar_t. + moved struct ldat into curses.priv.h, to hide implementation details. + change CharOf() macro to use it for masking A_CHARTEXT data from chtype's. + add L() macro to curses.priv.h, for long-character literals. + replace several assignments from struct ldat entries to chtype or char values with combinations of CharOf() and AttrOf() macros. + add/use intermediate ChAttrOf() and ChCharOf() macros where we know we are using chtype data. + add/use lowlevel attribute manipulation macros AddAttr(), RemAttr() and SetAttr(). + add/use SetChar() macro, to change a cchar_t based on a character and attributes. + convert most internal use of chtype to NCURSES_CH_T, to simplify use of cchar_t for wide-character configuration. Similarly, use ARG_CH_T where a pointer would be more useful. + add stubs for tracing cchar_t values. + add/use macro ISBLANK() + add/use constructors for cchar_t's: NewChar(), NewChar2(). + add/use macros CHREF(), CHDEREF(), AttrOfD(), CharOfD() to facilitate passing cchar_t's by address. + add/use PUTC_DATA, PUTC() macros. + for wide-character configuration, move the window background data to the end of the WINDOW struct so that whether _XOPEN_SOURCE_EXTENDED is defined or not, the offsets in the struct will not change. + modify addch() to work with wide-characters. + mark several wide-character functions as generated in curses.h.in + implement wunctrl(), wadd_wch(), wbkgrndset(), wbkgrnd(), wborder_set() and waddnwstr(). 20010526 + add experimental --with-caps=XXX option to customize to similar terminfo database formats such as AIX 4.x + add Caps.aix4 as an example. + modify Caps to add columns for the the KEY_xxx symbols. + modify configure --with-widec to suppress overwrite of libcurses.so and curses.h + add checks to toe.c to avoid being confused by files and directories where we would expect the reverse, e.g., source-files in the top-level terminfo levels as is the case for AIX. 20010519 + add top-level 'depend' rule for the C sources, assuming that the makedepend program is available. As a side-effect, this makes the generated sources, as in "make sources" (prompted by a report by Mike Castle that "make -j" fails because the resulting parallel processes race to generate ncurses/names.c). + modify configure script so that --disable-overwrite option's action to add a symbolic link for libcurses applies to the static library as well as the shared library when both are configured (report by Felix Natter <f.natter@ndh.net>). + add ELKS terminfo entries (Federico Bianchi <bianchi@>) + add u6 (CSR) to Eterm (Michael Jennings). 20010512 + modify test/ncurses.c to work with xterm-256color, which has fewer color pairs than colors*colors (report by David Ellement <ellement@sdd.hp.com>). 20010505 + corrected screen.xterm-xfree86 entry. + update comment in Caps regarding IBM (AIX) function-key definitions. 20010421 + modify c++/Makefile.in to link with libncurses++w.a when configured for wide-characters (patch by Sven Verdoolaege). + add check in _nc_trace_buf() to refrain from freeing a null pointer. + improve CF_PROG_INSTALL macro using CF_DIRNAME. + update config.guess, config.sub from autoconf 2.49e (alpha). 20010414 + add secondary check in tic.c, similar_sgr() to see if the reason for mismatch was that the individual capabilities used a time-delay while sgr did not. Used this to cleanup mismatches, e.g., in vt100, and remove time-delay from Apple_Terminal entries. + add Apple_Terminal terminfo entries (Benjamin C W Sittler <bsittler@iname.com>). + correct definitions of shifted editing keys for xterm-xfree86 -TD + fix a bug in test/bs.c from 20010407 (patch by Erik Sigra). + prevent relative_move() from doing an overwrite if it detects 8-bit characters when configured for UTF-8 (reported by Sven Verdoolaege <skimo@kotnet.org>). 20010407 + add configure checks for strstream.h vscan function, and similar stdio-based function which may be used in C++ binding for gcc 3.0 (reports by George Goffe, Lars Hecking, Mike Castle). + rewrite parts of configure.in which used changequote(). That feature is broken in the latest autoconf alphas (e.g., 2.49d). + add a missing pathname for ncurses_dll.h, needed when building in a directory outside the source tree (patch by Sven Verdoolaege <skimo@kotnet.org>). > fix 2 bugs in test/bs.c Erik Sigra <sigra@home.se>: + no ships were ever placed in the last row or in the last column. This made the game very easy to win, because you never had to waste any shots there, but the computer did. + the squares around a sunken ship that belonged to the player were not displayed as already hit by the computer, like it does for the player. 20010331 +). 20010324 + change symbols used to guard against repeated includes to begin consistently with "NCURSES_" rather than a leading underscore. There are other symbols defined in the header files which begin with a leading underscore, but they are part of the legacy interface. + reorder includes in c++ binding so that rcs identifiers can be compiled-in. + add .cc.ii rule to c++ makefile, to get preprocessor output for debugging. + correct configure script handling of @keyword@ substitutions when the --with-manpage-renames option is given (cf: 20000715, fixes Debian bug #89939). + report stack underflow/overflow in tparm() when tic -cv option is given. + remove spurious "%|" operator from xterm-xfree86 terminfo entry, (reported by Adam Costello <amc@cs.berkeley.edu>, Debian bug #89222). 20010310 + cleanup of newdemo.c, fixing some ambiguous expressions noted by gcc 2.95.2, and correcting some conflicting color pair initializations. + add missing copyright notice for cursesw.h + review, make minor fixes for use of '::' for referring to C-language interface from C++ binding. + modify configure check for g++ library slightly to accommodate nonstandard version number, e.g., <vendor>-2.7 (report by Ronald Ho <rho@mipos2.intel.com>). + add configure check for c++ <sstream> header, replace hardcoded ifdef. + workaround for pre-release of gcc 3.0 libstdc++, which has dropped vscan from strstreambuf to follow standard, use wrapper for C vscanf instead (report by George Goffe <grgoffe@excite.com> and Matt Taggart <taggart@carmen.fc.hp.com>, fixes Debian . 20010303 + modify interface of _nc_get_token() to pass 'silent' parameter to it, to make quieter loading of /etc/termcap (patch by Todd C Miller). + correct a few typos in curs_slk.3x and curs_outopts.3x manpages (patch by Todd C Miller). 20010224 + compiler-warning fixes (reported by Nelson Beebe). 20010210 + modify screen terminfo entry to use new 3.9.8 feature allowing xterm mouse controls -TD 20010203 + broaden patterns used to match OS/2 EMX in configure script to cover variant used in newer config.guess/config.sub + remove changequote() calls from configure script, since this feature is broken in the autoconf 2.49c alpha, maintainers decline to fix. + remove macro callPutChar() from tty_update.c, since this is no longer needed (reported by Philippe Blain). + add a null-pointer check in tic.c to handle the case when the input file is really empty. Modify the next_char() function in comp_scan.c to allow arbitrarily long lines, and incidentally supply a newline to files that do not end in a newline. These changes improve tic's recovery from attempts to read binary files, e.g., its output from the terminfo database (reported by Bernhard Rosenkraenzer). 20010127 + revert change to c++/demo.cc from 20001209, which changed definition of main() apparently to accommodate cygwin linker, but broke the demo program. + workaround for broken egcs 2.91.66 which calls member functions (i.e., lines() and colors() of NCursesWindow before calling its constructor. Add calls to initialize() in a few constructors which did not do this already. + use the GNAT preprocessor to make the necessary switch between TRACE and NO_TRACE configurations (patch by Juergen Pfeifer). > patches by Bernhard Rosenkraenzer: + modify kterm terminfo entry to use SCS sequence to support alternate character set (it does not work with SI/SO). + --with-ospeed=something didn't work. configure.in checked for a $enableval where it should check for $withval. Also, ncurses/llib-lncurses still had a hardcoded short. 20010114 + correction to my merge of Tom Riddle's patch that broke tic in some conditions (reported by Enoch Wexler <enoch@wexler.co.il>) -TD 20010113 + modify view.c to test halfdelay(). Like other tests, this recognizes the 's' and space commands for stopping/starting polled input, shows a freerunning clock in the header. If given a parameter to 's', that makes view.c use halfdelay() with that parameter rather than nodelay(). + fix to allow compile with the experimental configure option --disable-hashmap. + modify postprocess_termcap() to avoid overwriting key_backspace, key_left, key_down when processing a non-base entry (report/patch by Tom Riddle). + modify _nc_wrap_entry(), adding option to reallocate the string table, needed in _nc_merge_entry() when merging termcap entries. (adapted from report/patch by Tom Riddle <ftr@oracom.com>). + modify a few configure script macros to keep $CFLAGS used only for compiler options, preprocessor options in $CPPFLAGS. 20001230 + correct marker positions in lrtest.c after receiving a sigwinch. + fix ifdef's in ncurses.c to build against pre-5.2 for testing. + fixes to tclock for resizing behavior, redundant computation (report and patch by A M Kuchling <akuchlin@mems-exchange.org>). 20001216 + improved scoansi terminfo entry -TD + modify configure script and makefile in Ada95/src to compile a stub for the trace functions when ncurses does not provide those. 20001209 + add ncurses_dll.h and related definitions to support generating DLL's with cygwin (adapted from a patch by Charles Wilson <cwilson@ece.gatech.edu>, changed NCURSES_EXPORT macro to make it work with 'indent') -TD 20001202 + correct prototypes for some functions in curs_termcap.3x, matching termcap.h, which matches X/Open. > patch by Juergen Pfeifer: + a revised version of the Ada enhancements sent in by "H. Nanosecond", aka Eugene V Melaragno <aldomel@ix.netcom.com>. This patch includes - small fixes to the existing ncurses binding - addition of some more low-level functions to the binding, including termcap and terminfo functions - An Ada implementation of the "ncurses" test application originally written in C. 20001125 + modify logic in lib_setup.c to allow either lines or columns value from terminfo to be used if the screen size cannot be determined dynamically rather than requiring both (patch by Ehud Karni <ehud@unix.simonwiesel.co.il>). + add check in lib_tgoto.c's is_termcap() function to reject null or empty strings (reported by Valentin Nechayev <netch@netch.kiev.ua> to freebsd-bugs). + add definition from configure script that denotes the path-separator, which is normally a colon. The path-separator is a semicolon on OS/2 EMX and similar systems which may use a colon within pathnames. + alter logic to set default for --disable-overwrite option to set it to 'yes' if the --prefix/$prefix value is not /usr/local, thereby accommodating the most common cause of problems: gcc's nonstandard search rules. Other locations such as /usr/local/ncurses will default to overwriting (report by Lars Hecking <lhecking@nmrc.ie>). 20001118 + modify default for --disable-overwrite configure option to disable if the --prefix or $prefix value is not /usr. + add cygwin to systems for which ncurses is installed by default into /usr rather than /usr/local. 20001111 + minor optimization in comp_error.c and lib_termname.c, using strncat() to replace strncpy() (patch by Solar Designer). + add a use_terminfo_vars() check for $HOME/.termcap, and check for geteuid() to use_terminfo_vars() (patch by Solar Designer <solar@false.com>). + improved cygwin terminfo entry, based on patch by <ernie_boyd@yahoo.com>. + modify _nc_write_entry() to allow for the possibility that linking aliases on a filesystem that ignores case would not succeed because the source and destination differ only by case, e.g., NCR260VT300WPP0 on cygwin (report by Neil Zanella). + fix a typo in the curs_deleteln.3x man page (patch by Bernhard Rosenkraenzer <bero@redhat.de>). 20001104 + add configure option --with-ospeed to assist packagers in transition to 5.3 change to ospeed type. + add/use CharOf() macro to suppress sign-extension of char type on platforms where this is a problem in ctype macros, e.g., Solaris. + change trace output to binary format. + correct a missing quote adjustment in CF_PATH_SYNTAX autoconf macro, for OS/2 EMX configuration. + rearrange a few configure macros, moving preprocessor options to $CPPFLAGS (a now-obsolete version of autoconf did not consistently use $CPPFLAGS in both the compile and preprocessor checks). + add a check in relative_move() to guard against buffer overflow in the overwrite logic. 20001028 + add message to configure script showing g++ version. + resync config.guess, config.sub + modify lib_delwin.c, making it return ERR if the window did not exist (suggested by Neil Zanella). + add cases for FreeBSD 3.1 to tdlint and makellib scripts, used this to test/review ncurses library. (Would use lclint, but it doesn't work). + reorganized knight.c to avoid forward references. Correct screen updates when backtracking, especially to the first cell. Add F/B/a commands. 20001021 5.2 release for upload to + update generated html files from manpages. + modify dist.mk to use edit_man.sh to substitute autoconf'd variables in html manpages. + fix an uninitialized pointer in read_termcap.c (report by Todd C Miller, from report/patch by Philip Guenther <guenther@gac.edu>). + correct help-message and array limit in knight.c (patch by Brian Raiter <breadbox@muppetlabs.com>). > patch by Juergen Pfeifer: + fix to avoid warning by GNAT-3.13p about use of inconsistent casing for some identifiers defined in the standard package. + cosmetic change to forms/fty_enum.c 20001014 + correct an off-by-one position in test/railroad.c which could cause wrapping at the right margin. + test/repair some issues with libtool configuration. Make --disable-echo force libtool --silent. (Libtool does not work for OS/2 EMX, works partly for SCO - libtool is still very specific to gcc). + change default of --with-manpage-tbl to "no", since for most of the platforms which do have tbl installed, the system "man" program understands how to run tbl automatically. + minor improvement to force_bar() in comp_parse.c (Bernhard Rosenkraenzer <bero@redhat.de>). + modify lib_tparm.c to use get_space() before writing terminating null character, both for consistency as well as to ensure that if save_char() was called immediately before, that the allocated memory is enough (patch by Sergei Ivanov). + add note about termcap ML capability which is duplicated between two different capabilities: smgl and smglr (reported by Sergei Ivanov <svivanov@pdmi.ras.ru>). + correct parameter counts in include/Caps for dclk as well as some printer-specific capabilities: csnm, defc, scs, scsd, smgtp, smglp. > patch by Johnny C Lam <lamj@stat.cmu.edu>: + add support for building with libtool (apparently version 1.3.5, since old versions do not handle -L../lib), using new configure option --with-libtool. + add configure option --with-manpage-tbl, which causes the manpages to be preprocessed by tbl(1) prior to installation, + add configure option --without-curses-h, which causes the installation process to install curses.h as ncurses.h and make appropriate changes to headers and manpages. 20001009 + correct order of options/parameters in run_tic.in invocation of tic, which did not work with standard getopt() (reported by Ethan Butterfield <primus@veris.org>). + correct logic for 'reverse' variable in lib_vidattr.c, which was setting it true without checking if newmode had A_REVERSE set, e.g., using $TERM=ansi on OS/2 EMX (see 20000917). > patch by Todd C Miller: + add a few missing use_terminfo_vars() and fixes up _nc_tgetent(). Previously, _nc_cgetset() would still get called on cp so the simplest thing is to set cp to NULL if !use_terminfo_vars(). + added checks for an empty $HOME environment variable. > patches for OS/2 EMX (Ilya Zakharevich): + modify convert_configure.pl to support INSTALL. Change compiler options in that script to use multithreading, needed for the mouse. + modify OS/2 mouse support, retrying as a 2-button mouse if code fails to set up a 3-button mouse. + improve code for OS/2 mouse support, using _nc_timed_wait() to replace select() call. 20001007 + change type of ospeed variable back to short to match its use in legacy applications (reported by Andrey A Chernov). + add case to configure script for --enable-rpath on IRIX (patch by Albert Chin-A-Young). + minor fix to position_check() function, to ensure it gets the whole cursor report before decoding. + add configure option --disable-assumed-color, to allow pre-5.1 convention of default colors used for color-pair 0 to be configured (see assume_default_colors()). + rename configure option --enable-hashmap --disable-hashmap, and reorder the configure options, splitting the experimental and development + add configure option --disable-root-environ, which tells ncurses to disregard $TERMINFO and similar environment variables if the current user is root, or running setuid/setgid (based on discussion with several people). + modified misc/run_tic.in to use tic -o, to eliminate dependency on $TERMINFO variable for installs. + add table entry for plab_norm to tput, so it passes in strings for that capability. + modify parse_format() in lib_tparm.c to ignore precision if it is longer than 10000 (report by Jouko Pynnonen). + rewrote limit checks in lib_mvcur.c using new functions _nc_safe_strcat(), etc. Made other related changes to check lengths used for strcat/strcpy (report by Jouko Pynnonen <jouko@solutions.fi>). 20000930 + modify several descriptions, including those for setaf, setab, in include/Caps to indicate that the entries are parameterized. This information is used to tell which strings are translated when converting to termcap. Fixes a problem where the generated termcap would contain a spurious "%p1" for the terminfo "%p1%d". + modify ld -rpath options (e.g., Linux, and Solaris) to use an absolute pathname for the build tree's lib directory (prompted by discussion with Albert Chin-A-Young). + modify "make install.man" and "make uninstall.man" to include tack's man-page. + various fixes for install scripts used to support configure --srcdir and --with-install-prefix (reported by Matthew Clarke <Matthew_Clarke@mindlink.bc.ca>). + make configure script checks on variables $GCC and $GXX consistently compare against 'yes' rather than test if they are nonnull, since either may be set to the corresponding name of the C or C++ compiler (report/patch by Albert Chin-A-Young). 20000923 + modify rs2 capability in xterm-r6 and similar where cursor save/restore bracketed the sequence for resetting video attributes. The cursor restore would undo that (report by John Hawkinson <jhawk@MIT.EDU> (see NetBSD misc/11052)). + using parameter check added to tic, corrected 27 typos in terminfo.src -TD + modify tic to verify that its inputs are really files, in case someone tries to read a directory (or /dev/zero). + add a check for empty buffers returned by fgets() in comp_scan.c next_char() function, in case tic is run on a non-text file (fixes a core dump reported by Aaron Campbell <aaron@cs.dal.ca>). + add to railroad.c some code exercising tgoto(), providing an alternate form of display if the terminal supports cursor addressing. + split-out tgoto() again, this time into new file lib_tgoto.c, and implement a conventional BSD-style tgoto() which is used if the capability string does not contain terminfo-style padding or parameters (requested by Andrey A Chernov). + add check to tic which reports capabilities that do not reference the expected number of parameters. + add error checking to infocmp's -v and -m options to ensure that the option value is indeed a number. + some cleanup of logic in _nc_signal_handler() to verify if SIGWINCH handler is setup. Separated the old/new sigaction data for SIGTSTP from the other signals. 20000917 + add S0, E0 extensions to screen's terminfo entry, which is another way to solve the misconfiguration issue -TD + completed special case for tgoto from 20000916 20000916 + update xterm terminfo entries to match XFree86 xterm patch #146 -TD + add Matrix Orbital terminfo entries (from Eric Z Ayers <eric@ale.org>). + add special case to lib_tparm.c to allow 'screen' program to use a termcap-style parameter "%." to tgoto() for switching character sets. + use LN_S substitution in run_tic.in, to work on OS/2 EMX which has no symbolic links. + updated notes in README.emx regarding autoconf patches. + replace a lookup table in lib_vidattr.c used to decode no_color_video with a logic expression (suggested by Philippe Blain). + add a/A toggle to ncurses.c 'b' test, which clears/sets alternate character set attribute from the displayed text. + correct inequality in parameter analysis of rewritten lib_tparm.c which had the effect of ignoring p9 in set_attributes (sgr), breaking alternate character set (reported by Piotr Majka <charvel@link.pl>). + correct ifdef'ing for GCC_PRINTF, GCC_SCANF which would not compile with Sun WorkShop compilers since these tokens were empty (cf: 20000902, reported by Albert Chin-A-Young). 20000909 + correct an uninitialized parameter to open_tempfile() in tic.c which made "tic -I" give an ambiguous error message about tmpnam. + add special case in lib_vidattr.c to reset underline and standout for devices that have no sgr0 defined (patch by Don Lewis <Don.Lewis@tsc.tdk.com>). Note that this will not work for bold mode, since there is no exit-bold-mode capability. + improved patch for Make_Enum_Type (patch by Juergen Pfeifer). + modify tparm to disallow arithmetic on strings, analyze the varargs list to read strings as strings and numbers as numbers. + modify tparm's internal function spop() to treat a null pointer as an empty string. + modify tput program so it can be renamed or invoked via a link as 'reset' or 'init', producing the same effect as 'tput reset' or 'tput init'. + add private entrypoint _nc_basename(), use to consolidate related code in progs, as well as accommodating OS/2 EMX pathnames. + remove NCURSES_CONST line from edit_cfg.sh to compensate for its removal (except via AC_SUBST) from configure.in, making --enable-const work again (reported by Juergen Pfeifer). + regen'd configure to pick up "hpux*" change from 20000902. 20000902 + modify tset.c to check for transformed "reset" program name, if any. + add a check for null pointer in Make_Enum_Type() (reported by Steven W Orr <steveo@world.std.com>). + change functions _nc_parse_entry() and postprocess_termcap() to avoid using strtok(), because it is non-reentrant (reported by Andrey A Chernov <ache@nagual.pp.ru>). + remove "hpux10.*" case from CF_SHARED_OPTS configure script macro. This differed from the "hpux*" case by using reversed symbolic links, which made the 5.1 version not match the configuration of 5.0 shared libraries (reported by Albert Chin-A-Young). + correct a dependency in Ada95/src/Makefile.in which prevented building with configure --srcdir (patch by H Nanosecond <aldomel@ix.netcom.com>). + modify ifdef's in curses.h.in to avoid warning if GCC_PRINTF or GCC_SCANF was not previously defined (reported by Pavel Roskin <proski@gnu.org>). + add MKncurses_def.sh to generate fallback definitions for ncurses_cfg.h, to quiet gcc -Wundef warnings, modified ifdef's in code to consistently use "#if" rather than "#ifdef". 20000826 + add QNX qansi entries to terminfo -TD + add os2 entry to misc/emx.src (<jmcoopr@webmail.bmi.net>). + add configure option --with-database to allow specifying a different terminfo source-file to install. On OS/2 EMX, this defaults to misc/emx.src + change misc/run_tic.sh to derive it from misc/run_tic.in, to simplify setting .exe extension on OS/2 EMX. + add .exe extension in Ada95/gen/Makefile.in, Ada95/samples/Makefile.in, for OS/2 EMX (reported by <jmcoopr@webmail.bmi.net>). + add configure check for filesystems (such as OS/2 EMX) which do not distinguish between upper/lowercase filenames, use this to fix tags rules in makefiles. + initialize fds[] array to 0's in _nc_timed_wait(); apparently poll() only sets the revents members of that array when there is activity corresponding to the related file (report by Glenn Cooper <gcooper@qantas.com.au>, using Purify on Solaris 5.6). + change configure script to use AC_CANONICAL_SYSTEM rather than AC_CANONICAL_HOST, which means that configure --target will set a default program-prefix. + add note on cross-compiling to INSTALL (which does not rely on the AC_CANONICAL_* macros). 20000819 + add cases for EMX OS/2 to config.guess, config.sub + new version of config.guess, config.sub from lynx 2.8.4dev.7 + add definitions via transform.h to allow tic and tput to check for the transformed aliases rather than the original infotocap, etc. + simplify transform-expressions in progs/Makefile.in, make the uninstall rule work for transformed program names. + change symbol used by --install-prefix configure option from INSTALL_PREFIX to DESTDIR (the latter has become common usage although the name is misleading). + modify programs to use curses_version() string to report the version of ncurses with which they are compiled rather than the NCURSES_VERSION string. The function returns the patch level in addition to the major and minor version numbers. 20000812 + modify CF_MAN_PAGES configure macro to make transformed program names a parameter to that macro rather than embedding them in the macro. + newer config.guess, config.sub (reference version used in lynx 2.8.4dev.7). + add configure option --with-default-terminfo-dir=DIR to allow specifying the default terminfo database directory (request by Albert Chin-A-Young). + minor updates for terminfo.src from FreeBSD termcap change-history. + correct notes in README and INSTALL regarding documentation files that were moved from misc directory to doc (report by Rich Kulawiec <rsk@gsp.org>). + change most remaining unquoted parameters of 'test' in configure script to use quotes, for instance fixing a problem in the --disable-database option (reported by Christian Mondrup <scancm@biobase.dk>). + minor adjustments to work around some of the incompatibilities/bugs in autoconf 2.29a alpha. + add -I/usr/local/include when --with-ncurses option is used in test/configure script. + correct logic in adjust_cancels(), which did not check both alternatives when reclassifying an extended name between boolean, number and string, causing an infinite loop in tic. 20000730 + correct a missing backslash in curses.priv.h 20000729 + change handling of non_dest_scroll_region in tty_update.c to clear text after it is shifted in rather than before shifting out. Also correct row computation (reported by Ruediger Kuhlmann <uck4@rz.uni-karlsruhe.de>). + add/use new trace function to display chtype values from winch() and getbkgd(). + add trace mask TRACE_ATTRS, alter several existing _tracef calls that trace attribute changes under TRACE_CALLS to use this. + modify MKlib_gen.sh so that functions returning chtype will call returnChar(). + add returnChar() trace, for functions returning chtype. + change indent.pro to line up parenthesis. 20000722 + fix a heap problem with the c++ binding (report by <alexander_liberson@ninewest.com>, patch by Juergen Pfeifer). + minor adjustment to ClrToEOL() to handle an out-of-bounds parameter. + modify the check for big-core to force a couple of memory accesses, which may work as needed for older/less-capable machines (if not, there's still the explicit configure option). > fixes based on diff's for Amiga and BeOS found at + alter definition of NCURSES_CONST to make it non-empty. + add amiga-vnc terminfo entry. + redefine 'TEXT' in menu.h for AMIGA, since it is reported to have an (unspecified) symbol conflict. + replaced case-statement in _nc_tracebits() for CSIZE with a table to simplify working around implementations that define random combinations of the related macros to zero. + modify configure test for tcgetattr() to allow for old implementations, e.g., on BeOS, which only defined it as a macro. > patches by Bruno Haible: + when checking LC_ALL/LC_CTYPE/LANG environment variables for UTF-8 locale, ignore those which are set to an empty value, as per SUSV2. + encode 0xFFFD in UTF-8 with 3 bytes, not 2. + modify _nc_utf8_outch() to avoid sign-extension when checking for out-of-range value. 20000715 + correct manlinks.sed script to avoid using ERE "\+", which is not understood by older versions of sed (patch by Albert Chin-A-Young). + implement configure script options that transform installed program names, e.g., --program-prefix, including the manpage names and cross references (patch by Albert Chin-A-Young <china@thewrittenword.com>). + correct several mismatches between manpage filename and ".TH" directives, renaming dft_fgbg.3x to default_colors.3x and menu_attribs.3x to menu_attributes.3x (report by Todd C Miller). + correct missing includes for <string.h> in several places, including the C++ binding. This is not noted by gcc unless we use the -fno-builtin option (reported by Igor Schein <igor@txc.com>). +). 20000708 5.1 release for upload to + document configure options in INSTALL. + add man-page for ncurses trace functions. + correct return value shown in curs_touch.3x for is_linetouched() and is_wintouched(), in curs_initscr.3x for isendwin(), and in curs_termattr.3x for has_ic() and has_il(). + add prototypes for touchline() and touchwin(), adding them to the list of generated functions. + modify fifo_push() to put ERR into the fifo just like other values to return from wgetch(). It was returning without doing that, making end-of-file condition incorrectly return a 0 (reported by Todd C Miller). + uncomment CC_SHARED_OPTS for progs and tack (see 971115), since they are needed for SCO OpenServer. + move _nc_disable_period from free_ttype.c to comp_scan.c to appease dynamic loaders on SCO and IRIX64. + add "-a" option to test/ncurses.c to invoke assume_default_colors() for testing. + correct assignment in assume_default_colors() which tells ncurses whether to use default colors, or the assumed ones (reported by Gary Funck <gary@Intrepid.Com>). + review/correct logic in mk-1st.awk for making symbolic links for shared libraries, in particular for FreeBSD, etc. + regenerate misc/*.def files for OS/2 EMX dll's. + correct quoting of values for CC_SHARED_OPTS in aclocal.m4 for cases openbsd2*, openbsd*, freebsd* and netbsd* (patch by Peter Wemm) (err in 20000610). + minor updates to release notes, as well as adding/updating URLs for examples cited in announce.html > several fixes from Philippe Blain <philippe.blain2@freesbee.fr>: + correct placement of ifdef for NCURSES_XNAMES in function _nc_free_termtype(), fixes a memory leak. + add a call to _nc_synchook() to the end of function whline() like that in wvline() (difference was in 1.9.4). + make ClearScreen() a little faster by moving two instances of UpdateAttr() out of for-loops. + simplify ClrBottom() by eliminating the tstLine data, using for-loops (cf: 960428). 20000701 pre-release + change minor version to 1, i.e., ncurses 5.1 + add experimental configure option --enable-colorfgbg to check for $COLORTERM variable as set by rxvt/aterm/Eterm. + add Eterm terminfo entry (Michael Jennings <mej@valinux.com>). + modify manlinks.sed to pick aliases from the SYNOPSIS section, and several manpages so manlinks.sed can find aliases for creating symbolic links. + add explanation to run_tic.sh regarding extended terminal capabilities. + change message format for edit_cfg.sh, since some people interpret it as a warning. + correct unescaped '$' in sysv5uw7*|unix_sv* rule for CF_SHARED_OPTS configure macro (report by Thanh Ma <Thanh.Ma@casi-rusco.com>). + correct logic in lib_twait.c as used by lib_mouse.c for GPM mouse support when poll() is used rather than select() (prompted by discussion with David Allen <DAllen24@aol.com>). 20000624 pre-release + modify TransformLine() to check for cells with different color pairs that happen to render the same display colors. + apply $NCURSES_NO_PADDING to cost-computation in mvcur(). + improve cost computation in PutRange() by accounting for the use of parm_right_cursor in mvcur(). + correct cost computation in EmitRange(), which was not using the normalized value for cursor_address. + newer config.guess, config.sub (reference version used in TIN 1.5.6). 20000617 + update config.guess, config.sub (reference version used in PCRE 3.2). + resync changes to gnathtml against version 1.22, regenerated html files under doc/html/ada using this (1.22.1.1). + regenerated html files under doc/html/man after correcting top and bottom margin options for man2html in dist.mk + minor fixes to test programs ncurses 'i' and testcurs program to make the subwindow's background color cover the subwindow. + modify configure script so AC_MSG_ERROR is temporarily defined to a warning in AC_PROG_CXX to make it recover from a missing C++ compiler without requiring user to add --without-cxx option (adapted from comment by Akim Demaille <akim@epita.fr> to autoconf mailing list). + modify headers.sh to avoid creating temporary files in the build directory when installing headers (reported by Sergei Pokrovsky <pok@nbsp.nsk.su>) 20000610 + regenerated the html files under doc/html/ada/files and doc/html/ada/funcs with a slightly-improved gnathtml. + add kmous capability to linux terminfo entry to allow it to use xterm-style events provided by gpm patch by Joerg Schoen. + make the configure macro CF_SHARED_OPTS a little smarter by testing if -fPIC is supported by gcc rather than -fpic. The former option allows larger symbol tables. + update config.guess and config.sub (patches by Kevin Buettner <kev@primenet.com> (for elf64_ia64), Bernd Kuemmerlen <bkuemmer@mevis.de> (for MacOS X)). + add warning for 'tic -cv' about use of '^?' in terminfo source, which is an extension. 20000527 + modify echo() behavior of getch() to match Solaris curses for carriage return and backspace (reported by Neil Zanella). + change _nc_flush() to a function. + modify delscreen() to check if the output stream has been closed, and if so, free the buffer allocated for setbuf (this provides an ncurses-specific way to avoid a memory leak when repeatedly calling newterm reported by Chipp C <at_1@zdnetonebox.com>). + correct typo in curs_getch.3x manpage regarding noecho (reported by David Malone <dwmalone@maths.tcd.ie>). + add a "make libs" rule. + make the Ada95 interface build with configure --enable-widec. + if the configure --enable-widec option is given, append 'w' to names of the generated libraries (e.g., libncursesw.so) to avoid conflict with existing ncurses libraries. 20000520 + modify view.c to make a rudimentary viewer of UTF-8 text if ncurses is configured with the experimental wide-character support. + add a simple UTF-8 output driver to the experimental wide-character support. If any of the environment variables LC_ALL, LC_CTYPE or LANG contain the string "UTF-8", this driver will be used to translate the output to UTF-8. This works with XFree86 xterm. + modify configure script to allow building shared libraries on BeOS (from a patch by Valeriy E Ushakov). + modify lib_addch.c to allow repeated update to the lower-right corner, rather than displaying only the first character written until the cursor is moved. Recent versions of SVr4 curses can update the lower-right corner, and behave this way (reported by Neil Zanella). + add a limit-check in _nc_do_color(), to avoid using invalid color pair value (report by Brendan O'Dea <bod@compusol.com.au>). 20000513 + the tack program knows how to use smcup and rmcup but the "show caps that can be tested" feature did not reflect this knowledge. Correct the display in the menu tack/test/edit/c (patch by Daniel Weaver). + xterm-16color does allow bold+colors, removed ncv#32 from that terminfo entry. 20000506 + correct assignment to SP->_has_sgr_39_49 in lib_dft_fgbg.c, which broke check for screen's AX capability (reported by Valeriy E Ushakov <uwe@ptc.spbu.ru>). + change man2html rule in dist.mk to workaround bug in some man-programs that ignores locale when rendering hyphenation. + change web- and ftp-site to dickey.his.com 20000429 + move _nc_curr_token from parse_entry.c to comp_scan.c, to work around problem linking tack on MacOS X DP3. + include <sys/time.h> in lib_napms.c to compile on MacOS X DP3 (reported by Gerben Wierda <wierda@holmes.nl>). + modify lib_vidattr.c to check for ncv fixes when pair-0 is not default colors. + add -d option to ncurses.c, to turn on default-colors for testing. + add a check to _nc_makenew() to ensure that newwin() and newpad() calls do not silently fail by passing too-large limits. + add symbol NCURSES_SIZE_T to use rather than explicit 'short' for internal window and pad sizes. Note that since this is visible in the WINDOW struct, it would be an ABI change to make this an 'int' (prompted by a question by Bastian Trompetter <btrompetter@firemail.de>, who attempted to create a 96000-line pad). 20000422 + add mgterm terminfo entry from NetBSD, minor adjustments to sun-ss5, aixterm entries -TD + modify tack/ansi.c to make it more tolerant of bad ANSI replies. An example of an illegal ANSI resonse can be found using Microsoft's Telnet client. A correct display can be found using a VT-4xx terminal or XFree86 xterm with: XTerm*VT100*decTerminalID: 450 (patch by Daniel Weaver). + modify gdc.c to recognize 'q' for quit, 's' for single-step and ' ' for resume. Add '-n' option to force gdc's standard input to /dev/null, to both illustrate the use of newterm() for specifying alternate inputs as well as for testing signal handling. + minor fix for configure option --with-manpage-symlinks, for target directories that contain a period ('.') (reported by Larry Virden). 20000415 + minor additions to beterm entry (feedback from Rico Tudor) -TD + corrections/updates for some IBM terminfo entries -TD + modify _nc_screen_wrap() so that when exiting curses mode with non-default colors, the last line on the screen will be cleared to the screen's default colors (request by Alexander V Lukyanov). + modify ncurses.c 'r' example to set nonl(), allowing control/M to be read for demonstrating the REQ_NEW_LINE operation (prompted by a question by Tony L Keith <tlkeith@keithconsulting.com>). + modify ncurses.c 'r' example of field_info() to work on Solaris 2.7, documented extension of ncurses which allows a zero pointer. + modify fmt_complex() to avoid buffer overflow in case of excess recursion, and to recognize "%e%?" as a synonym for else-if, which means that it will not recur for that special case. + add logic to support $TERMCAP variable in case the USE_GETCAP symbol is defined (patch by Todd C Miller). + modify one of the m4 files used to generate the Ada95 sources, to avoid using the token "symbols" (patch by Juergen Pfeifer). 20000408 + add terminfo entries bsdos-pc-m, bsdos-pc-mono (Jeffrey C Honig) + correct spelling error in terminfo entry name: bq300-rv was given as bg300-rv in esr's version. + modify redrawwin() macro so its parameter is fully parenthesized (fixes Debian bug report #61088). + correct formatting error in dump_entry() which set incorrect column value when no newline trimming was needed at the end of an entry, before appending "use=" clauses (cf: 960406). 20000401 + add configure option --with-manpage-symlinks + change unctrl() to render C1 characters (128-159) as ~@, ~A, etc. + change makefiles so trace() function is provided only if TRACE is defined, e.g., in the debug library. Modify related calls to _tracechar() to use unctrl() instead. 20000325 + add screen's AX capability (for ECMA SGR 39 and 49) to applicable terminfo entries, use presence of this as a check for a small improvement in setting default colors. + improve logic in _nc_do_color() implementing assume_default_colors() by passing in previous color pair info to eliminate redundant call to set_original_colors(). (Part of this is from a patch by Alexander V Lukyanov). + modify warning in _nc_trans_string() about a possibly too-long string to do this once only rather than for each character past the threshold (600). Change interface of _nc_trans_string() to allow check for buffer overflow. + correct use of memset in _nc_read_entry_source() to initialize ENTRY struct each time before reading new data into it, rather than once per loop (cf: 990301). This affects multi-entry in-core operations such as "infocmp -Fa". 20000319 + remove a spurious pointer increment in _nc_infotocap() changes from 20000311. Add check for '.' in format of number, since that also is not permitted in termcap. + correct typo in rxvt-basic terminfo from temporary change made while integrating 20000318. 20000318 + revert part of the vt220 change (request by Todd C Miller). + add ansi-* terminfo entries from ESR's version. + add -a option to tic and infocmp, which retains commented-out capabilities during source translation/comparison, e.g., captoinfo and infotocap. + modify cardfile.c to display an empty card if no input data file is found, fixes a core dump in that case (reported by Bruno Haible). + correct bracketing in CF_MATH_LIB configure macro, which gave wrong result for OS/2 EMX. + supply required parameter for _nc_resolve_uses() call in read_termcap.c, overlooked in 20000311 (reported by Todd C Miller). > patches by Bruno Haible <haible@ilog.fr>: + fix a compiler warning in fty_enum.c + correct LIB_PREFIX expression for DEPS_CURSES in progs, tack makefiles, which resulted in redundant linking (cf: 20000122). 20000311 + make ifdef's for BROKEN_LINKER consistent (patch by Todd C Miller). + improved tack/README (patch by Daniel Weaver). + modify tput.c to ensure that unspecified parameters are passed to tparm() as 0's. + add a few checks in infocmp to guard against buffer overflow when displaying string capabilities. + add check for zero-uses in infocmp's file_comparison() function before calling _nc_align_termtype(). Otherwise one parameter is indexed past the end of the uses-array. + add an option -q to infocmp to specify the less verbose output, keeping the existing format as the default, though not retaining the previous behavior that made the -F option compare each entry to itself. + adapted patch by ESR to make infocmp -F less verbose -TD (the submitted patch was unusable because it did not compile properly) + modify write_entry.c to ensure that absent or cancelled booleans are written as FALSE, for consistency with infocmp which now assumes this. Note that for the small-core configuration, tic may not produce the same result as before. + change some private library interfaces used by infocmp, e.g., _nc_resolve_uses(). + add a check in _nc_infotocap() to ensure that cm-style capabilities accept only %d codes when converting the format from terminfo to termcap. + modify ENTRY struct to separate the data in 'parent' into the name and link values (the original idea to merge both into 'parent' was not good). + discard repair_acsc(tterm); > patch by Juergen Pfeifer: + drop support for gnat 3.10 + move generated documentation and html files under ./doc directory, adding makefile rules for this to dist.mk 20000304 + correct conflicting use of tparm() in 20000226 change to tic, which made it check only one entry at a time. + fix errors in ncurses-intro.html and hackguide.html shown by Dave Raggett's tidy. + make the example in ncurses-intro.html do something plausible, and corrected misleading comment (reported by Neil Zanella). + modify pnoutrefresh() to set newscr->_leaveok as wnoutrefresh() does, to fix a case where the cursor position was not updated as in Solaris (patch by David Mosberger <davidm@hpl.hp.com>). + add a limit-check for wresize() to ensure that a subwindow does not address out of bounds. + correct offsets used for subwindows in wresize() (patch by Michael Andres <ma@suse.de>). + regenerate html'ized manual pages with man2html 3.0.1 (patch by Juergen Pfeifer). This generated a file with a space in its name, which I removed. + fix a few spelling errors in tack. + modify tack/Makefile.in to match linker options of progs/Makefile.in; otherwise it does not build properly for older HPUX shared library configurations. + add several terminfo entries from esr's "11.0". 20000226 + make 'tput flash' work properly for xterm by flushing output in delay_output() when using napms(), and modifying xterm's terminfo to specify no padding character. Otherwise, xterm's reported baud rate can mislead ncurses into producing too few padding characters (Debian #58530). + add a check to tic for consistency between sgr and the separate capabilities such as smso, use this to check/correct several terminfo entries (Debian #58530). + add a check to tic if cvvis is the same as cnorm, adjusted several terminfo entries to remove the conflict (Debian #58530). + correct prototype shown in attr_set()/wattr_set() manpages (fixes Debian #53962). + minor clarification for curs_set() and leaveok() manpages. + use mkstemp() for creating temporary file for tic's processing of $TERMCAP contents (fixes Debian #56465). + correct two errors from integrating Alexander's changes: did not handle the non-bce case properly in can_erase_with() (noted by Alexander), and left fg/bg uninitialized in the pair-zero case of _nc_do_color() (reported by Dr Werner Fink <werner@suse.de> and Ismael Cordeiro <ismael@cordeiro.com>). 20000219 + store default-color code consistently as C_MASK, even if given as -1 for convenience (adapted from patches by Alexander V Lukyanov). > patches by Alexander V Lukyanov: + change can_clear_with() macro to accommodate logic for assume_default_colors(), making most of the FILL_BCE logic unnecessary. Made can_clear_with() an inline function to make it simpler to read. 20000212 + corrected form of recent copyright dates. + minor corrections to xterm-xf86-v333 terminfo entry -TD > patches by Alexander V Lukyanov: + reworded dft_fgbg.3x to avoid assuming that the terminal's default colors are white on black. + fix initialization of tstLine so that it is filled with current blank character in any case. Previously it was possible to have it filled with old blank. The wrong over-optimization was introduced in 991002 patch. (it is not very critical as the only bad effect is not using clr_eos for clearing if blank has changed). 20000205 + minor corrections/updates to several terminfo entries: rxvt-basic, vt520, vt525, ibm5151, xterm-xf86-v40 -TD + modify ifdef's for poll() to allow it to use <sys/poll.h>, thereby allowing poll() to be used on Linux. + add CF_FUNC_POLL macro to check if poll() is able to select from standard input. If not we will not use it, preferring select() (adapted from patch by Michael Pakovic <mpakovic@fdn.com>). + update CF_SHARED_OPTS macro for SCO Unixware 7.1 to allow building shared libraries (reported/tested by Thanh <thanhma@mediaone.net>). + override $LANGUAGE in build to avoid incorrect ordering of keynames. + correct CF_MATH_LIB parameter, must be sin(x), not sqrt(x). 20000122 + resync CF_CHECK_ERRNO and CF_LIB_PREFIX macros from tin and xterm -TD + modify CF_MATH_LIB configure macro to parameterize the test function used, for reuse in dialog and similar packages. + correct tests for file-descriptors in OS/2 EMX mouse support. A negative value could be used by FD_SET, causing the select() call to wait indefinitely. 20000115 + additional fixes for non-bce terminals (handling of delete_character) to work when assume_default_colors() is not specified. + modify warning message from _nc_parse_entry() regarding extended capability names to print only if tic/infocmp/toe have the -v flag set, and not at all in ordinary user applications. Otherwise, this warning would be shown for screen's extended capabilities in programs that use the termcap interface (reported by Todd C Miller). + modify use of _nc_tracing from programs such as tic so their debug level is not in the same range as values set by trace() function. + small panel header cleanup (patch by Juergen Pfeifer). + add 'railroad' demo for termcap interface. + modify 'tic' to write its usage message to stderr (patch by Todd C Miller). 20000108 + add prototype for erase() to curses.h.in, needed to make test programs build with c++/g++. + add .c.i and .c.h suffix rules to generated makefiles, for debugging. + correct install rule for tack.1; it assumed that file was in the current directory (reported by Mike Castle <dalgoda@ix.netcom.com>). + modify terminfo/termcap translation to suppress acsc before trying sgr if the entry would be too large (patch by Todd C Miller). + document a special case of incompatiblity between ncurses 4.2 and 5.0, add a section for this in INSTALL. + add TRACE_DATABASE flag for trace(). 20000101 + update mach, add mach-color terminfo entries based on Debian diffs for ncurses 5.0 -TD + add entries for xterm-hp, xterm-vt220, xterm-vt52 and xterm-noapp terminfo entries -TD + change OTrs capabilities to rs2 in terminfo.src -TD + add obsolete and extended capabilities to 'screen' terminfo -TD + corrected conversion from terminfo rs2 to termcap rs (cf: 980704) + make conversion to termcap ug (underline glitch) more consistently applied. + fix out-of-scope use of 'personal[]' buffer in 'toe' (this error was in the original pre-1.9.7 version, when $HOME/.terminfo was introduced). + modify 'toe' to ignore terminfo directories to which it has no permissions. + modify read_termtype(), fixing 'toe', which could dump core when it found an incomplete entry such as "dumb" because it did not initialize its buffer for _nc_read_file_entry(). + use -fPIC rather than -fpic for shared libraries on Linux, not needed for i386 but some ports (from Debian diffs for 5.0) -TD + use explicit VALID_NUMERIC() checks in a few places that had been overlooked, and add a check to ensure that init_tabs is nonzero, to avoid divide-by-zero (reported by Todd C Miller). + minor fix for CF_ANSI_CC_CHECK configure macro, for HPUX 10.x (from tin) -TD 19991218 + reorder tests during mouse initialization to allow for gpm to run in xterm, or for xterm to be used under OS/2 EMX. Also drop test for $DISPLAY in favor of kmous=\E[M or $TERM containing "xterm" (report by Christian Weisgerber <naddy@mips.rhein-neckar.de>). + modify raw() and noraw() to clear/restore IEXTEN flag which affects stty lnext on systems such as FreeBSD (report by Bruce Evans <bde@zeta.org.au>, via Jason Evans <jasone@canonware.com>). + fix a potential (but unlikely) buffer overflow in failed() function of tset.c (reported by Todd C Miller). + add manual-page for ncurses extensions, documented curses_version(), use_extended_names(). 19991211 + treat as untranslatable to termcap those terminfo strings which contain non-decimal formatting, e.g., hexadecimal or octal. + correct commented-out capabilities that cannot be translated to termcap, which did not check if a colon must be escaped. + correct termcap translation for "%>" and "%+", which did not check if a colon must be escaped, for instance. + use save_string/save_char for _nc_captoinfo() to eliminate fixed buffer (originally for _nc_infotocap() in 960301 -TD). + correct expression used for terminfo equivalent of termcap %B, adjust regent100 entry which uses this. + some cleanup and commenting of ad hoc cases in _nc_infotocap(). + eliminate a fixed-buffer in tic, used for translating comments. + add manpage for infotocap 19991204 + add kvt and gnome terminfo entries -TD + correct translation of "%%" by infotocap, which was emitted as "%". + add "obsolete" termcap strings to terminfo.src + modify infocmp to default to showing obsolete capabilities rather than terminfo only. + modify write_entry.c so that if extended names (i.e., configure --enable-tcap-names) are active, then tic will also write "obsolete" capabilities that are present in the terminfo source. + modify tic so that when running as captoinfo or infotocap, it initializes the output format as in -C and -I options, respectively. + improve infocmp and tic -f option by splitting long strings that do not have if-then-else construct, but do have parameters, e.g., the initc for xterm-88color. + refine MKtermsort.sh slightly by using bool for the *_from_termcap arrays. 19991127 + additional fixes for non-bce terminals (handling of clear_screen, clr_eol, clr_eos, scrolling) to work when assume_default_colors() is not specified. + several small changes to xterm terminfo entries -TD. + move logic for _nc_windows in lib_freeall.c inside check for nonnull SP, since it is part of that struct. + remove obsolete shlib-versions, which was unintentionally re-added in 970927. + modify infocmp -e, -E options to ensure that generated fallback.c type for Booleans agrees with term.h (reported by Eric Norum <eric@cls.usask.ca>). + correct configure script's use of $LIB_PREFIX, which did not work for installing the c++ directory if $libdir did not end with "/lib" (reported by Huy Le <huyle@ugcs.caltech.edu>). + modify infocmp so -L and -f options work together. + modify the initialization of SP->_color_table[] in start_color() so that color_content() will return usable values for COLORS greater than 8. + modify ncurses 'd' test in case COLORS is greater than 16, e.g., for xterm-88color, to limit the displayed/computed colors to 16. > patch by Juergen Pfeifer: + simplify coding of the panel library according to suggestions by Philippe Blain. + improve macro coding for a few macros in curses.priv.h 19991113 + modify treatment of color pair 0 so that if ncurses is configured to support default colors, and they are not active, then ncurses will set that explicitly, not relying on orig_colors or orig_pair. + add new extension, assume_default_colors() to provide better control over the use of default colors. + modify test programs to use more-specific ifdef's for existence of wresize(), resizeterm() and use_default_colors(). + modify configure script to add specific ifdef's for some functions that are included when --enable-ext-funcs is in effect, so their existence can be ifdef'd in the test programs. + reorder some configure options, moving those extensions that have evolved from experimental status into a new section. + change configure --enable-tcap-names to enable this by default. 19991106 + install tack's manpage (reported by Robert Weiner <robert@progplus.com>) + correct worm.c's handling of KEY_RESIZE (patch by Frank Heckenbach). + modify curses.h.in, undef'ing some symbols to avoid conflict with C++ STL (reported by Matt Gerassimoff <mgeras@ticon.net>) 19991030 + modify linux terminfo entry to indicate that dim does not mix with color (reported by Klaus Weide <kweide@enteract.com>). + correct several typos in terminfo entries related to missing '[' in CSI's -TD + fix several compiler warnings in c++ binding (reported by Tim Mooney for alphaev56-dec-osf4.0f + rename parameter of _nc_free_entries() to accommodate lint. + correct lint rule for tack, used incorrect list of source files. + add case to config.guess, config.sub for Rhapsody. + improve configure tests for libg++ and libstdc++ by omitting the math library (which is missing on Rhapsody), and improved test for the math library itself (adapted from path by Nelson H. F. Beebe). + explicitly initialize to zero several data items which were implicitly initialized, e.g., cur_term. If not explicitly initialized, their storage type is C (common), and causes problems linking on Rhapsody 5.5 using gcc 2.7.2.1 (reported by Nelson H. F. Beebe). + modify Ada95 binding to not include the linker option for Ada bindings in the Ada headers, but in the Makefiles instead (patch by Juergen Pfeifer). 19991023 5.0 release for upload to + effective with release of 5.0, change NCURSES_VERSION_PATCH to 4-digit year. + add function curses_version(), to return ncurses library version (request by Bob van der Poel). + remove rmam, smam from cygwin terminfo entry. + modify FreeBSD cons25 terminfo entry to add cnorm and cvvis, as well as update ncv to indicate that 'dim' conflicts with colors. + modify configure script to use symbolic links for FreeBSD shared libraries by default. + correct ranf() function in rain and worm programs to ensure it does not return 1.0 + hide the cursor in hanoi.c if it is running automatically. + amend lrtest.c to account for optimizations that exploit margin wrapping. + add a simple terminfo demo, dots.c + modify SIGINT/SIGQUIT handler to set a flag used in _nc_outch() to tell it to use write() rather than putc(), since the latter is not safe in a signal handler according to POSIX. + add/use internal macros _nc_flush() and NC_OUTPUT to hide details of output-file pointer in ncurses library. + uncomment CC_SHARED_OPTS (see 971115), since they are needed for SCO OpenServer. + correct CC_SHARED_OPTS for building shared libraries for SCO OpenServer. + remove usleep() from alternatives in napms(), since it may interact with alarm(), causing a process to be interrupted by SIGALRM (with advice from Bela Lubkin). + modify terminal_interface-curses-forms.ads.m4 to build/work with GNAT 3.10 (patch by Juergen Pfeifer). + remove part of CF_GPP_LIBRARY configure-script macro, which did not work with gcc 2.7.2.3 + minor fix to test/tclock.c to avoid beeping more than once per second + add 's' and ' ' decoding to test/rain.c 991016 pre-release + corrected BeOS code for lib_twait.c, making nodelay() function work. 991009 pre-release + correct ncurses' value for cursor-column in PutCharLR(), which was off-by-one in one case (patch by Ilya Zakharevich). + fix some minor errors in position_check() debugging code, found while using this to validate the PutCharLR() patch. + modify firework, lrtest, worm examples to be resizable, and to recognize 'q' for quit, 's' for single-step and ' ' for resume. + restore reverted change to terminal_interface-curses-forms.ads.m4, add a note on building with gnat 3.10p to Ada95/TODO. + add a copy of the standalone configure script for the test-directory to simplify testing on SCO and Solaris. 991002 pre-release + minor fixes for _nc_msec_cost(), color_content(), pair_content(), _nc_freewin(), ClrBottom() and onscreen_mvcur() (analysis by Philippe Blain, comments by Alexander V Lukyanov). + simplify definition of PANEL and eliminate internal functions _nc_calculate_obscure(), _nc_free_obscure() and _nc_override(), (patch by Juergen Pfeifer, analysis by Philippe Blain <bledp@voila.fr>)). + change renaming of dft_fgbg.3x to use_default_colors.3ncurses in man_db.renames, since Debian is not concerned with 14-character, since this does not work for gnat 3.10p + modify tclock example to be resizable (if ncurses' sigwinch handler is used), and in color. + use $(CC) rather than 'gcc' in MK_SHARED_LIB symbols, used for Linux shared library rules. 990925 pre-release + add newer NetBSD console terminfo entries + add amiga-8bit terminfo entry (from Henning 'Faroul' Peters <Faroul@beyond.kn-bremen.de>) + remove -lcurses -ltermcap from configure script's check for the gpm library, since they are not really necessary (a properly configured gpm library has no dependency on any curses library), and if the curses library is not installed, this would cause the test to fail. + modify tic's -C option so that terminfo "use=" clauses are translated to "tc=" clauses even when running it as captoinfo. + modify CF_STDCPP_LIBRARY configure macro to perform its check only for GNU C++, since that library conflicts with SGI's libC on IRIX-6.2 + modify CF_SHARED_OPTS configure macro to support build on NetBSD with ELF libraries (patch by Bernd Ernesti <bernd@arresum.inka.de>). + correct a problem in libpanel, where the _nc_top_panel variable was not set properly when bottom_panel() is called to hide a panel which is the only one on the stack (report/analysis by Michael Andres <ma@suse.de>, patch by Juergen Pfeifer). 990918 pre-release + add acsc string to HP 70092 terminfo entry (patch by Joerg Wunsch <j@interface-business.de>). + add top-level uninstall.data and uninstall.man makefile rules. + correct logic of CF_LINK_FUNCS configure script, from BeOS changes so that hard-links work on Unix again. + change default value of cf_cv_builtin_bool to 1 (suggested by Jeremy Buhler), making it less likely that a conflicting declaration of bool will be seen when compiling with C++. 990911 pre-release + improved configure checks for builtin.h + minor changes to C++ binding (remove static initializations, and make configure-test for parameter initializations) for features not allowed by vendor's C++ compilers (reported by Martin Mokrejs, this applies to SGI, though I found SCO has the same characteristics). + corrected quoting of ETIP_xxx definitions which support old versions of g++, e.g., those using -lg++ + remove 'L' code from safe_sprintf.c, since 'long double' is not widely portable. safe_sprintf.c is experimental, however, and exists mainly as a fallback for systems without snprintf (reported by Martin Mokrejs <mmokrejs@natur.cuni.cz>, for IRIX 6.2) + modify definition of _nc_tinfo_fkeys in broken-linker configuration so that it is not unnecessarily made extern (Jeffrey C Honig). 990904 pre-release + move definition for builtin.h in configure tests to specific check for libg++, since qt uses the same filename incompatibly. + correct logic of lib_termcap.c tgetstr function, which did not copy the result to the buffer parameter. Testing shows Solaris does update this, though of course tgetent's buffer is untouched (reported in Peter Edwards <peter.edwards@ireland.com> in mpc.lists.freebsd.current newsgroup. + corrected beterm terminfo entry, which lists some capabilities which are not actually provided by the BeOS Terminal. + add special logic to replace select() calls on BeOS, whose select() function works only for sockets. + correct missing escape in mkterm.h.awk.in, which caused part of the copyright noticed to be omitted (reported by Peter Wemm <peter@netplex.com.au>). > several small changes to make the c++ binding and demo work on OS/2 EMX (related to a clean reinstall of EMX): + correct library-prefix for c++ binding; none is needed. + add $x suffix to make_hash and make_keys so 'make distclean' works. + correct missing $x suffix for tack, c++ demo executables. + split CF_CXX_LIBRARY into CF_GPP_LIBRARY (for -lg++) and CF_STDCPP_LIBRARY (for -lstdc++) 990828 pre-release + add cygwin terminfo entry -TD + modify CF_PROG_EXT configure macro to set .exe extension for cygwin. + add configure option --without-cxx-binding, modifying the existing --without-cxx option to check only for the C++ compiler characteristics. Whether or not the C++ binding is needed, the configure script checks for the size/type of bool, to make ncurses match. Otherwise C++ applications cannot use ncurses. 990821 pre-release + updated configure macros CF_MAKEFLAGS, CF_CHECK_ERRNO + minor corrections to beterm terminfo entry. + modify lib_setup.c to reject values of $TERM which have a '/' in them. + add ifdef's to guard against CS5, CS6, CS7, CS8 being zero, as more than one is on BeOS. That would break a switch statement. + add configure macro CF_LINK_FUNCS to detect and work around BeOS's nonfunctional link(). + improved configure macros CF_BOOL_DECL and CF_BOOL_SIZE to detect BeOS's bool, which is declared as an unsigned char. 990814 pre-release + add ms-vt100 terminfo entry -TD + minor fixes for misc/emx.src, based on testing with tack. + minor fix for test/ncurses.c, test 'a', in case ncv is not set. 990731 pre-release + minor correction for 'screen' terminfo entry. + clarify description of errret values for setupterm in manpage. + modify tput to allow it to emit capabilities for hardcopy terminals (patch by Goran Uddeborg <goeran@uddeborg.pp.se>). + modify the 'o' (panel) test in ncurses.c to show the panels in color or at least in bold, to test Juergen's change to wrefresh(). > patches by Juergen Pfeifer: + Fixes a problem using wbkgdset() with panels. It has actually nothing to with panels but is a problem in the implementation of wrefresh(). Whenever a window changes its background attribute to something different than newscr's background attribute, the whole window is touched to force a copy to newscr. This is an unwanted side-effect of wrefresh() and it is actually not necessary. A changed background attribute affects only further outputs of background it doesn't mean anything to the current content of the window. So there is no need to force a copy. (reported by Frank Heckenbach <frank@g-n-u.de>). + an upward compatible enhancement of the NCursesPad class in the C++ binding. It allows one to add a "viewport" window to a pad and then to use panning to view the pad through the viewport window. 990724 pre-release + suppress a call to def_prog_mode() in the SIGTSTP handler if the signal was received while not in curses mode, e.g., endwin() was called in preparation for spawning a shell command (reported by Frank Heckenbach <frank@g-n-u.de>) + corrected/enhanced xterm-r5, xterm+sl, xterm+sl-twm terminfo entries. + change test for xterm mouse capability: it now checks only if the user's $DISPLAY variable is set in conjunction with the kmous capability being present in the terminfo. Before, it checked if any of "xterm", "rxvt" or "kterm" were substrings of the terminal name. However, some emulators which are incompatible with xterm in other ways do support the xterm mouse capability. + reviewed and made minor changes in ncurses to quiet g++ warnings about shadowed or uninitialized variables. g++ incorrectly warns about uninitialized variables because it does not take into account short-circuit expression evaluation. + change ncurses 'b' test to start in color pair 0 and to show in the right margin those attributes which are suppressed by no_color_video, i.e., "(NCV)". + modify ifdef's in curses.h so that __attribute__ is not redefined when compiling with g++, but instead disabled the macros derived for __attribute__ since g++ does not consistently recognize the same keywords as gcc (reported by Stephan K Zitz <zitz@erf.net>). + update dependencies for term.h in ncurses/modules (reported by Ilya Zakharevich). 990710 pre-release + modify the form demo in ncurses.c to illustrate how to manipulate the field appearance, e.g, for highlighting or translating the field contents. + correct logic in write_entry from split-out of home_terminfo in 980919, which prevented update of $HOME/.terminfo (reported by Philip Spencer <pspencer@fields.utoronto.ca>). 990703 pre-release + modify linux terminfo description to make use of kernel 2.2.x mods that support cursor style, e.g., to implement cvvis (patch by Frank Heckenbach <frank@g-n-u.de>) + add special-case in setupterm to retain previously-saved terminal settings in cur_term, which happens when curses and termcap calls are mixed (from report by Bjorn Helgaas <helgaas@dhc.net>). + suppress initialization of key-tries in _nc_keypad() if we are only disabling keypad mode, e.g., in endwin() called when keypad() was not. + modify the Ada95 makefile to ensure that always the Ada files from the development tree are used for building and not the eventually installed ones (patch by Juergen Pfeifer). 990626 pre-release + use TTY definition in tack/sysdep.c rather than struct termios (reported by Philippe De Muyter). + add a fallback for strstr, used in lib_mvcur.c and tack/edit.c, not present on sysV68 (reported by Philippe De Muyter). + correct definition in comp_hash.c to build with configure --with-rcs-ids option. 990619 pre-release + modified ifdef's for sigaction and sigvec to ensure we do not try to handle SIGTSTP if neither is available (from report by Philippe De Muyter). > patch by Philippe De Muyter: + in tic.c, use `unlink' if `remove' is not available. + use only `unsigned' as fallback value for `speed_t'. Some files used `short' instead. 990616 pre-release + fix some compiler warnings in tack. + add a check for predefined bool type in CC, based on report that BeOS predefines a bool type. + correct logic for infocmp -e option, i.e., the configure --with-fallbacks option, which I'd not updated when implementing extended names (cf: 990301). The new implementation adds a "-E" option to infocmp -TD > patch by Juergen Pfeifer: + introduce the private type Curses_Bool in the Ada95 binding implementation. This is to clearly represent the use of "bool" also in the binding. It should have no effect on the generated code. + improve the man page for field_buffer() to tell the people, that the whole buffer including leading/trailing spaces is returned. This is a common source of confusion, so it's better to document it clearly. 990614 pre-release > patch by Juergen Pfeifer: + use pragma PreElaborate in several places. + change a few System.Address uses to more specific types. + change interface version-number to 1.0 + regenerate Ada95 HTML files. 990612 pre-release + modify lib_endwin.c to avoid calling reset_shell_mode(), return ERR if it appears that curses was never initialized, e.g., by initscr(). For instance, this guards against setting the terminal modes to strange values if endwin() is called after setupterm(). In the same context, Solaris curses will dump core. + modify logic that avoids a conflict in lib_vidattr.c between sgr0 and equivalent values in rmso or rmul by ensuring we do not modify the data which would be returned by the terminfo or termcap interfaces (reported by Brad Pepers <brad@linuxcanada.com>, cf: 960706). + add a null-pointer check for SP in lib_vidattr.c to logic that checks for magic cookies. + improve fallback declaration of 'bool' when the --without-cxx option is given, by using a 'char' on i386 and related hosts (prompted by discussion with Alexander V Lukyanov). 990605 pre-release + include time.h in lib_napms.c if nanosleep is used (patch by R Lindsay Todd <toddr@rpi.edu>). + add an "#undef bool" to curses.h, in case someone tries to define it, e.g., perl. + add check to tparm to guard against divide by zero (reported by Aaron Campbell <aaron@ug.cs.dal.ca>). 990516 pre-release + minor fix to build tack on CLIX (mismatched const). > patch by Juergen Pfeifer: + change Juergen's old email address with new one in the files where it is referenced. The Ada95 HTML pages are regenerated. + update MANIFEST to list the tack files. 990509 pre-release + minor fixes to make 'tack' build/link on NeXT (reported by Francisco A. Tomei Torres). 990417 pre-release + add 'tack' program (which is GPL'd), updating it to work with the modified TERMTYPE struct and making a fix to support setaf/setab capabilities. Note that the tack program is not part of the ncurses libraries, but an application which can be distributed with ncurses. The configure script will ignore the directory if it is omitted, however. + modify gpm mouse support so that buttons 2 and 3 are used for select/paste only when shift key is pressed, making them available for use by an application (patch by Klaus Weide). + add complete list of function keys to scoansi terminfo entry - TD 990410 pre-release + add a simple test program cardfile.c to illustrate how to read form fields, and showing forms within panels. + change shared-library versioning for the Hurd to be like Linux rather than *BSD (patch by Mark Kettenis <kettenis@wins.uva.nl>). + add linux-lat terminfo entry. + back-out _nc_access check in read_termcap.c (both incorrect and unnecessary, except to guard against a small window where the file's ownership may change). 990403 pre-release + remove conflicting _nc_free_termtype() function from test module lib_freeall.c + use _nc_access check in read_termcap.c for termpaths[] array (noted by Jeremy Buhler, indicating that Alan Cox made a similar patch). > patch by Juergen Pfeifer: + modify menu creation to not inherit status flag from the default menu which says that the associated marker string has been allocated and should be freed (bug reported by Marek Paliwoda" <paliwoda@kki.net.pl>) 990327 pre-release (alpha.gnu.org:/gnu/ncurses-5.0-beta1.tar.gz) + minor fixes to xterm-xfree86 terminfo entry - TD. + split up an expression in configure script check for ldconfig to workaround limitation of BSD/OS sh (reported by Jeff Haas <jmh@mail.msen.com>). + correct a typo in man/form_hook.3x (Todd C Miller). 990318 pre-release + parenthesize and undef 'index' symbol in c++ binding and demo, to accommodate its definition on NeXT (reported by Francisco A. Tomei Torres). + add sigismember() to base/sigaction.c compatibility to link on NeXT (reported by Francisco A. Tomei Torres). + further refinements to inequality in hashmap.c to cover a case with ^U in nvi (patch by Alexander V Lukyanov). 990316 pre-release + add fallback definition for getcwd, to link on NeXT. + add a copy of cur_term to tic.c to make it link properly on NeXT (reported by Francisco A. Tomei Torres). + change inequality in hashmap.c which checks the distance traveled by a chunk so that ^D command in nvi (scrolls 1/2 screen) will use scrolling logic (patch by Alexander V Lukyanov, reported by Jeffrey C Honig). 990314 pre-release + modify lib_color.c to handle a special case where the curscr attributes have been made obsolete (patch by Alexander V Lukyanov). + update BSD/OS console terminfo entries to use klone+sgr and klone+color (patch by Jeffrey C Honig). + update glibc addon configure script for extended capabilities. + correct a couple of warnings in the --enable-const configuration. + make comp_hash build properly with _nc_strdup(), on NeXT (reported by Francisco A. Tomei Torres <francisco.tomei@cwix.com>). 990313 pre-release + correct typos in linux-c initc string - TD + add 'crt' terminfo entry, update xterm-xfree86 entry - TD + remove a spurious argument to tparm() in lib_sklrefr.c (patch by Alexander V Lukyanov). 990307 pre-release + back-out change to wgetch because it causes a problem with ^Z handling in lynx (reported by Kim DeVaughn). 990306 pre-release + add -G option to tic and infocmp, to reverse the -g option. + recode functions in name_match.c to avoid use of strncpy, which caused a 4-fold slowdown in tic (cf: 980530). + correct a few warnings about sign-extension in recent changes. > patch by Juergen Pfeifer: + fixes suggested by Jeff Bradbury <jibradbury@lucent.com>: + improved parameter checking in new_fieldtype(). + fixed a typo in wgetch() timeout handling. + allow slk_init() to be called per newterm call. The internal SLK state is stored in the SCREEN struct after every newterm() and then reset for the next newterm. + fix the problem that a slk_refresh() refreshes stdscr if the terminal has true SLKs. + update HTML documentation for Ada binding. 990301 pre-release + remove 'bool' casts from definitions of TRUE/FALSE so that statements such as "#if TRUE" work. This was originally done to allow for a C++ compiler which would warn of implicit conversions between enum and int, but is not needed for g++ (reported by Kim DeVaughn). + add use_extended_names() function to allow applications to suppress read of the extended capabilities. + add configure option --enable-tcap-names to support logic which allows ncurses' tic to define new (i.e., extended) terminal capabilities. This is activated by the tic -x switch. The infocmp program automatically shows or compares extended capabilities. Note: This changes the Strings and similar arrays in the TERMTYPE struct so that applications which manipulate it must be recompiled. + use macros typeMalloc, typeCalloc and typeRealloc consistently throughout ncurses library. + add _nc_strdup() to doalloc.c. + modify define_key() to allow multiple strings to be bound to the same keycode. + correct logic error in _nc_remove_string, from 990220. > patch for Ada95 binding (Juergen Pfeifer): + regenerate some of the html documentation + minor cleanup in terminal_interface-curses.adb 990220 pre-release + resolve ambiguity of kend/kll/kslt and khome/kfnd/kich1 strings in xterm and ncsa terminfo entries by removing the unneeded ones. Note that some entries will return kend & khome versus kslt and kfnd, for PC-style keyboards versus strict vt220 compatiblity - TD + add function keybound(), which returns the definition associated with a given keycode. + modify define_key() to undefine the given string when no keycode is given. + modify keyok() so it works properly if there is more than one string defined for a keycode. + add check to tic to warn about terminfo descriptions that contain more than one key assigned to the same string. This is shown only if the verbose (-v) option is given. Moved related logic (tic -v) from comp_parse.c into the tic program. + add/use _nc_trace_tries() to show the function keys that will be recognized. + rename init_acs to _nc_init_acs (request by Alexander V Lukyanov). > patch for Ada95 binding (Juergen Pfeifer): + remove all the *_adabind.c from ncurses, menu and form projects. Those little helper routines have all been implemented in Ada and are no longer required. + The option handling routines in menu and form have been made more save. They now make sure that the unused bits in options are always zero. + modify configuration scripts to + use gnatmake as default compiler name. This is a safer choice than gcc, because some GNAT implementations use other names for the compilerdriver to avoid conflicts. + use new default installation locations for the Ada files according to the proposed GNU Ada filesystem standard (for Linux). + simplify the Makefiles for the Ada binding + rename ada_include directory to src. 990213 + enable sigwinch handler by default. + disable logic that allows setbuf to be turned off/on, because some implementations will overrun the buffer after it has been disabled once. 990206 + suppress sc/rc capabilities from terminal description if they appear in smcup/rmcup. This affects only scrolling optimization, to fix a problem reported by several people with xterm's alternate screen, though the problem is more general. > patch for Ada95 binding (Juergen Pfeifer): + removed all pragma Preelaborate() stuff, because the just released gnat-3.11p complains on some constructs. + fixed some upper/lower case notations because gnat-3.11p found inconsistent use. + used a new method to generate the HTML documentation of the Ada95 binding. This invalidates nearly the whole ./Ada95/html subtree. Nearly all current files in this subtree are removed 990130 + cache last result from _nc_baudrate, for performance (suggested by Alexander V Lukyanov). + modify ClrUpdate() function to workaround a problem in nvi, which uses redrawwin in SIGTSTP handling. Jeffrey C Honig reported that ncurses repainted the screen with nulls before resuming normal operation (patch by Alexander V Lukyanov). + generalize is_xterm() function a little by letting xterm/rxvt/kterm be any substring rather than the prefix. + modify lib_data.c to initialize SP. Some linkers, e.g., IBM's, will not link a module if the only symbols exported from the module are uninitialized ones (patch by Ilya Zakharevich). Ilya says that he has seen messages claiming this behavior conforms to the standard.) + move call on _nc_signal_handler past _nc_initscr, to avoid a small window where Nttyb hasn't yet been filled (reported by Klaus Weide). + (patch by Klaus Weide). + correct spelling of ACS_ names in curs_border.3x (reported by Bob van der Poel <bvdpoel@kootenay.com>). + correct a couple of typos in the macros supporting the configure --with-shlib-version option. 990123 + modify fty_regex.c to compile on HAVE_REGEXPR_H_FUNCS machine (patch by Kimio Ishii <ishii@csl.sony.co.jp>). + rename BSDI console terminfo entries: bsdos to bsdos-pc-nobold, and bsdos-bold to bsdos-pc (patch by Jeffrey C Honig). + modify tput to accept termcap names as an alternative to terminfo names (patch by Jeffrey C Honig). + correct a typo in term.7 (Todd C Miller). + add configure --with-shlib-version option to allow installing shared libraries named according to release or ABI versions. This parameterizes some existing logic in the configure script, and is intended for compatiblity upgrades on Digital Unix, which used versioned libraries in ncurses 4.2, but no longer does (cf: 980425). + resync configure script against autoconf 2.13 + patches + minor improvements for teraterm terminfo entry based on the program's source distribution. 990116 + change default for configure --enable-big-core to assume machines do have enough memory to resolve terminfo.src in-memory. + correct name of ncurses library in TEST_ARGS when configuring with debug library. + minor fixes to compile ncurses library with broken-linker with g++. + add --enable-broken-linker configure option, default to environment variable $BROKEN_LINKER (request by Jeffrey C Honig). + change key_names[] array to static since it is not part of the curses interface (reported by Jeffrey C Honig <jch@bsdi.com>). 990110 + add Tera Term terminfo entry - TD 990109 + reviewed/corrected macros in curses.h as per XSI document. + provide support for termcap PC variable by copying it from terminfo data and using it as the padding character in tputs (reported by Alexander V Lukyanov). + corrected iris-ansi and iris-ansi-ap terminfo entries for kent and kf9-kf12 capabilities, as well as adding kcbt. + document the mouse handling mechanism in menu_driver and make a small change in menu_driver's return codes to provide more consistency (patch by Juergen Pfeifer). + add fallback definition for NCURSES_CONST to termcap.h.in (reported by Uchiyama Yasushi <uch@nop.or.jp>). + move lib_restart.c to ncurses/base, since it uses curses functions directly, and therefore cannot be used in libtinfo.so + rename micro_char_size to micro_col_size, adding #define to retain old name. + add set_a_attributes and set_pglen_inch to terminfo structure, as per XSI and Solaris 2.5. + minor makefile files to build ncurses test_progs + update html files in misc directory to reflect changes since 4.2 990102 + disable scroll hints when hashmap is enabled (patch by Alexander V Lukyanov). + move logic for tic's verify of -e option versus -I and -C so that the terminfo data is not processed if we cannot handle -e (reported by Steven Schwartz <steves@unitrends.com>. + add test-driver traces to terminfo and termcap functions. + provide support for termcap ospeed variable by copying it from the internal cur_term member, and using ospeed as the baudrate reference for the delay_output and tputs functions. If an application does not set ospeed, the library behaves as before, except that _nc_timed_wait is no longer used, or needed, since ospeed always has a value. But the application can modify ospeed to adjust the output of padding characters (prompted by a bug report for screen 3.7.6 and email from Michael Schroeder <Michael.Schroeder@informatik.uni-erlangen.de>). + removed some unused ifdef's as part of Alexander's restructuring. + reviewed/updated curses.h, term.h against X/Open Curses Issue 4 Version 2. This includes making some parameters NCURSES_CONST rather than const, e.g., in termcap.h. + change linux terminfo entry to use ncv#2, since underline does not work with color 981226 + miscellaneous corrections for curses.h to match XSI. + change --enable-no-padding configure option to be normally enabled. + add section to ncurses manpage for environment variables. + investigated Debian bug report that pertains to screen 3.7.4/3.7.6 changes, found no sign of problems on Linux (or on SunOS, Solaris) running screen built with ncurses. + check if tmp_fp is opened in tic.c before closing it (patch by Pavel Roskin <pavel_roskin@geocities.com>). + correct several font specification typos in man-pages. 981220 + correct default value for BUILD_CC (reported by Larry Virden). 981219 + modify _nc_set_writedir() to set a flag in _nc_tic_dir() to prevent it from changing the terminfo directory after chdir'ing to it. Otherwise, a relative path in $TERMINFO would confuse tic (prompted by a Debian bug report). + correct/update ncsa terminfo entry (report by Larry Virden). + update xterm-xfree86 terminfo to current (patch 90), smcur/rmcur changes + add Mathew Vernon's mach console entries to terminfo.src + more changes, moving functions, as part of Alexander's restructuring. + modify configure script for GNU/Hurd share-library support, introduce BUILD_CC variable for cross compiling (patch by Uchiyama Yasushi <uch@nop.or.jp>) 981212 + add environment variable NCURSES_NO_SETBUF to allow disabling the setbuf feature, for testing purposes. + correct ifdef's for termcap.h versus term.h that suppress redundant declarations of prototypes (reported by H.J.Lu). + modify Makefile.os2 to add linker flags which allow multiple copies of an application to coexist (reported by Ilya Zakharevich). + update Makefile.glibc and associated configure script so that ncurses builds as a glibc add-on with the new directory configuration (reported by H.J.Lu). 981205 + modify gen_reps() function in gen.c to work properly on SunOS (sparc), which is a left-to-right architecture. + modify relative_move and tputs to avoid an interaction with the BSD-style padding. The relative_move function could produce a string to replace on the screen which began with a numeric character, which was then interpreted by tputs as padding. Now relative_move will not generate a string with a leading digit in that case (overwrite). Also, tputs will only interpret padding if the string begins with a digit; as coded it permitted a string to begin with a decimal point or asterisk (reported by Larry Virden). > patches by Juergen Pfeifer: + fix a typo in m_driver.c mouse handling and improves the error handling. + fix broken mouse handling in the Ada95 binding + make the Ada95 sample application menus work with the new menu mouse support + improve the mouse handling introduced by Ilya; it now handles menus with spacing. + repair a minor bug in the menu_driver code discovered during this rework. + add new function wmouse_trafo() to hide implementation details of _yoffset member of WINDOW struct needed for mouse coordinate transformation. 981128 + modify Ada95/gen/gen.c to avoid using return-value of sprintf, since some older implementations (e.g., SunOS 4.x) return the buffer address rather than its length. > patch by Rick Ohnemus: + modify demo.cc to get it to compile with newer versions of egcs. + trim a space that appears at the end of the table preprocessor lines ('\" t). This space prevents some versions of man from displaying the pages - changed to remove all trailing whitespace (TD) + finally, 'make clean' does not remove panel objects. > patches by Ilya Zakharevich: + allow remapping of OS/2 mouse buttons using environment variable MOUSE_BUTTONS_123 with the default value 132. + add mouse support to ncurses menus. 981121 + modify misc/makedef.cmd to report old-style .def file symbols, and to generate the .def files sorted by increasing names rather than the reverse. + add misc/*.ref which are J.J.G.Ripoll's dll definition files (renamed from misc/*.old), and updated based on the entrypoint coding he used for an older version of ncurses. + add README.emx, to document how to build on OS/2 EMX. + updates for config.guess, config.sub from Lynx > patches by Ilya Zakharevich: + minor fixes for mouse handling mode: a) Do not initialize mouse if the request is to have no mouse; b) Allow switching of OS/2 VIO mouse on and off. + modify Makefile.os2 to support alternative means of generating configure script, by translating Unix script with Perl. > patches by Juergen Pfeifer: + Updates MANIFEST to reflect changes in source structure + Eliminates a problem introduced with my last patch for the C++ binding in the panels code. It removes the update() call done in the panel destructor. + Changes in the Ada95 binding to better support systems where sizeof(chtype)!=sizeof(int) (e.g. DEC Alpha). 981114 + modify install-script for manpages to skip over .orig and .rej files (request by Larry Virden). > patches/discussion by Alexander V Lukyanov: + move base-library sources into ncurses/base and tty (serial terminal) sources into ncurses/tty, as part of Alexander V Lukyanov's proposed changes to ncurses library. + copy _tracemouse() into ncurses.c so that lib_tracemse.c need not be linked into the normal ncurses library. + move macro winch to a function, to hide details of struct ldat > patches by Juergen Pfeifer: + fix a potential compile problem in cursesw.cc + some Ada95 cosmetics + fix a gen.c problem when compiling on 64-Bit machines + fix Ada95/gen/Makefile.in "-L" linker switch + modify Ada95 makefiles to use the INSTALL_PREFIX setting. 981107 + ifdef'd out lib_freeall.c when not configured. + rename _tracebits() to _nc_tracebits(). + move terminfo-library sources into ncurses/tinfo, and trace-support functions into ncurses/trace as part of Alexander V Lukyanov's proposed changes to ncurses library. + modify generated term.h to always specify its own definitions for HAVE_TERMIOS_H, etc., to guard against inclusion by programs with broken configure scripts. 981031 + modify terminfo parsing to accept octal and hexadecimal constants, like Solaris. + remove an autoconf 2.10 artifact from the configure script's check for "-g" compiler options. (Though harmless, this confused someone at Debian, who recently issued a patch that results in the opposite effect). + add configure option --with-ada-compiler to accommodate installations that do not use gcc as the driver for GNAT (patch by Juergen Pfeifer). 981017 + ensure ./man exists in configure script, needed when configuring with --srcdir option. + modify infocmp "-r" option to remove limit on formatted termcap output, which makes it more like Solaris' version. + modify captoinfo to treat no-argument case more like Solaris' version, which uses the contents of $TERMCAP as the entry to format. + modify mk-2nd.awk to handle subdirectories, e.g., ncurses/tty (patch by Alexander V Lukyanov). 981010 + modify --with-terminfo-dirs option so that the default value is the ${datadir} value, unless $TERMINFO_DIRS is already set. This gets rid of a hardcoded list of candidate directories in the configure script. + add some error-checking to _nc_read_file_entry() to ensure that strings are properly terminated (Todd C Miller). + rename manpage file curs_scr_dmp.3x to curs_scr_dump.3x, to correspond with contents (reported by Neil Zanella <nzanella@cs.mun.ca>). + remove redundant configure check for C++ which did not work when $CXX was specified with a full pathname (reported by Andreas Jaeger). + corrected bcopy/memmove check; the macro was not standalone. 981003 + remove unnecessary portion of OS/2 EMX mouse change from check_pending() (reported by Alexander V Lukyanov). 980926 + implement mouse support for OS/2 EMX (adapted from patch against 4.2(?) by Ilya Zakharevich). + add configure-check for bcopy/memmove, for 980919 changes to hashmap. + merge Data General terminfo from Hasufin <hasufin@vidnet.net> - TD + merge AIX 3.2.5 terminfo descriptions for IBM terminals, replaces some older entries - TD + modify tic to compile into %'char' form in preference to %{number}, since that is a little more efficient. + minor correction to infocmp to avoid displaying "difference" between two capabilities that are rendered in equivalent forms. + add -g option to tic/infocmp to force character constants to be displayed in quoted form. Otherwise their decimal values are shown. + modify setupterm so that cancelled strings are treated the same as absent strings, cancelled and absent booleans false (does not affect tic, infocmp). + modify tic, infocmp to discard redundant i3, r3 strings when output to termcap format. > patch by Alexander V Lukyanov: + improve performance of tparm, now it takes 19% instead of 25% when profiling worm. + rename maxlen/minlen to prec/width for better readability. + use format string for printing strings. + use len argument correctly in save_text, and pass it to save_number. 980919 + make test_progs compile (but hashmap does not function). + correct NC_BUFFERED macro, used in lib_mvcur test-driver, modify associated logic to avoid freeing the SP->_setbuf data. + add modules home_terminfo and getenv_num to libtinfo. + move write_entry to libtinfo, to work with termcap caching. + minor fixes to blue.c to build with atac. + remove softscroll.c module; no longer needed for testing. > patches by Todd C Miller: + use strtol(3) instead of atoi(3) when parsing env variables so we can detect a bogus (non-numeric) value. + check for terminal names > MAX_NAME_SIZE in a few more places when dealing with env variables again. + fix a MAX_NAME_SIZE that should be MAX_NAME_SIZE+1 + use sizeof instead of strlen(3) on PRIVATE_INFO since it is a fixed string #define (compile time vs runtime). + when setting errno to ENOMEM, set it right before the return, not before code that could, possibly, set errno to a different value. > patches by Alexander V Lukyanov: + use default background in update_cost_from_blank() + disable scroll-hints when hashmap is configured. + improve integration of hashmap scrolling code, by adding oldhash and newhash data to SP struct. + invoke del_curterm from delscreen. + modify del_curterm to set cur_term to null if it matches the function's parameter which is deleted. + modify lib_doupdate to prefer parm_ich to the enter_insert_mode and exit_insert_mode combination, adjusting InsCharCost to check enter_insert_mode, exit_insert_mode and insert_padding. Add insert_padding in insert mode after each char. This adds new costs to the SP struct. 980912 + modify test-driver in lib_mvcur.s to use _nc_setbuffer, for consistent treatment. + modify ncurses to restore output to unbuffered on endwin, and resume buffering in refresh (see lib_set_term.c and NC_BUFFERED macro). + corrected HTML version numbers (according to the W3C validator, they never were HTML 2.0-compliant, but are acceptable 3.0). 980905 + modify MKterminfo.sh to generate terminfo.5 with tables sorted by capability name, as in SVr4. + modified term.h, termcap.h headers to avoid redundant declarations. + change 'u_int' type in tset.c to unsigned, making this compile on Sequent PRX 4.1 (reported by Michael Sterrett <msterret@coat.com>). 980829 + corrections to mailing addresses, and moving the magic line that causes the man program to invoke tbl to the first line of each manpage (patch by Rick Ohnemus <rick@ecompcon.com>). + add Makefile.os2 and supporting scripts to generate dll's on OS/2 EMX (from J.J.G.Ripoll, with further integration by TD). + correct a typo in icl6404 terminfo entry. + add xtermm and xtermc terminfo entries. > from esr's terminfo version: + Added Francesco Potorti's tuned Wyse 99 entries. + dtterm enacs (from Alexander V Lukyanov). + Add ncsa-ns, ncsa-m-ns and ncsa-m entries from esr version. 980822 + document AT&T acs characters in terminfo.5 manpage. + use EMX _scrsize() function if terminfo and environment do not declare the screen size (reported by Ilya Zakharevich <ilya@math.ohio-state.edu>). + remove spurious '\' characters from eterm and osborne terminfo entries (prompted by an old Debian bug report). + correct reversed malloc/realloc calls in _nc_doalloc (reported by Hans-Joachim Widmaier <hjwidmai@foxboro.com>). + correct misplaced parenthesis which caused file-descriptor from opening termcap to be lost, from 980725 changes (reported by Andreas Jaeger). 980815 + modify lib_setup.c to eliminate unneeded include of <sys/ioctl.h> when termios is not used (patch by Todd C Miller). + add function _nc_doalloc, to ensure that failed realloc calls do not leak memory (reported by Todd C Miller). + improved ncsa-telnet terminfo entry. 980809 + correct missing braces around a trace statement in read_entry.c, from 980808 (reported by Kim DeVaughn <kimdv@best.com> and Liviu Daia). 980808 + fix missing include <errno.h> in ditto.c (reported by Bernhard Rosenkraenzer <bero@k5.sucks.eu.org>) + add NCSA telnet terminfo entries from Francesco Potorti <F.Potorti@cnuce.cnr.it>, from Debian bug reports. + make handling of $LINES and $COLUMNS variables more compatible with Solaris by allowing them to individually override the window size as obtained via ioctl. 980801 + modify lib_vidattr.c to allow for terminal types (e.g., xterm-color) which may reset all attributes in the 'op' capability, so that colors are set before turning on bold and other attributes, but still after turning attributes off. + add 'ditto.c' to test directory to illustrate use of newterm for initializing multiple screens. + modify _nc_write_entry() to recover from failed attempt to link alias for a terminfo on a filesystem which does not preserve character case (reported by Peter L Jordan <PJordan@chla.usc.edu>). 980725 + updated versions of config.guess and config.sub based on automake 1.3 + change name-comparisons in lib_termcap to compare no more than 2 characters (gleaned from Debian distribution of 1.9.9g-8.8, verified with Solaris curses). + fix typo in curs_insstr.3x (patch by Todd C Miller) + use 'access()' to check if ncurses library should be permitted to open or modify files with fopen/open/link/unlink/remove calls, in case the calling application is running in setuid mode (request by Cristian Gafton <gafton@redhat.com>, responding to Duncan Simpson <dps@io.stargate.co.uk>). + arm100 terminfo entries from Dave Millen <dmill@globalnet.co.uk>). + qnxt2 and minitel terminfo entries from esr's version. 980718 + use -R option with ldconfig on FreeBSD because otherwise it resets the search path to /usr/lib (reported by Dan Nelson). + add -soname option when building shared libraries on OpenBSD 2.x (request by QingLong). + add configure options --with-manpage-format and --with-manpage-renames (request by QingLong). + correct conversion of CANCELLED_NUMERIC in write_object(), which was omitting the high-order byte, producing a 254 in the compiled terminfo. + modify return-values of tgetflag, tgetnum, tgetstr, tigetflag, tigetnum and tigetstr to be compatible with Solaris (gleaned from Debian distribution of 1.9.9g-8.8). + modify _nc_syserr_abort to abort only when compiled for debugging, otherwise simply exit with an error. 980711 + modify Ada95 'gen' program to use appropriate library suffix (e.g., "_g" for a debug build). + update Ada95 'make clean' rule to include generics .ali files + add a configure test to ensure that if GNAT is found, that it can compile/link working Ada95 program. + flush output in beep and flash functions, fixing a problem with getstr (patch by Alexander V Lukyanov) + fix egcs 1.0.2 warning for etip.h (patch by Chris Johns). + correct ifdef/brace nesting in lib_sprintf.c (patch by Bernhard Rosenkraenzer <bero@Pool.Informatik.RWTH-Aachen.DE>). + correct typo in wattr_get macro from 980509 fixes (patch by Dan Nelson). 980704 + merge changes from current XFree86 xterm terminfo descriptions. + add configure option '--without-ada'. + add a smart-default for termcap 'ac' to terminfo 'acs_chars' which corresponds to vt100. + change translation for termcap 'rs' to terminfo 'rs2', which is the documented equivalent, rather than 'rs1'. 980627 + slow 'worm' down a little, for very fast machines. + corrected firstchar/lastchar computation in lib_hline.c + simplify some expressions with CHANGED_CELL, CHANGED_RANGE and CHANGED_TO_EOL macros. + modify init_pair so that if a color-pair is reinitialized, we will repaint the areas of the screen whose color changes, like SVr4 curses (reported by Christian Maurer <maurer@inf.fu-berlin.de>). + modify getsyx/setsyx macros to comply with SVr4 man-page which says that leaveok() affects their behavior (report by Darryl Miles, patch by Alexander V Lukyanov). 980620 + review terminfo.5 against Solaris 2.6 curses version, corrected several minor errors/omissions. + implement tparm %l format. + implement tparm printf-style width and precision for %s, %d, %x, %o as per XSI. + implement tparm dynamic variables (reported by Xiaodan Tang). 980613 + update man-page for for wattr_set, wattr_get (cf: 980509) + correct limits in hashtest, which would cause nonprinting characters to be written to large screens. + correct configure script, when --without-cxx was specified: the wrong variable was used for cf_cv_type_of_bool. Compilers up to gcc 2.8 tolerated the missing 'int'. + remove the hardcoded name "gcc" for the GNU Ada compiler. The compiler's name might be something like "egcs" (patch by Juergen Pfeifer). + correct curs_addch.3x, which implied that echochar could directly display control characters (patch by Alexander V Lukyanov). + fix typos in ncurses-intro.html (patch by Sidik Isani <isani@cfht.hawaii.edu>) 980606 + add configure test for conflicting use of exception in math.h and other headers. + minor optimization to 'hash()' function in hashmap.c, reduces its time by 10%. + correct form of LD_SHARED_OPTS for HP-UX 10.x (patch by Tim Mooney). + fix missing quotes for 'print' in MKunctrl.awk script (reported by Mihai Budiu <mihaib@gs41.sp.cs.cmu.edu>). > patch by Alexander V Lukyanov: + correct problem on Solaris (with poll() function) where getch could hang indefinitely even if timeout(x) was called. This turned out to be because milliseconds was not updated before 'goto retry' in _nc_timed_wait. + simplified the function _nc_timed_wait and fixed another bug, which was the assumption of !GOOD_SELECT && HAVE_GETTIMEOFDAY in *timeleft assignment. + removed the cycle on EINTR, as it seems to be useless. 980530 + add makefile-rule for test/keynames + modify run_tic.sh and shlib to ensure that user's .profile does not override the $PATH used to run tic (patch by Tim Mooney). + restore LD_SHARED_OPTS to $(LD_SHARED_FLAGS) when linking programs, needed for HP-UX shared-library path (recommended by Tim Mooney). + remove special case of HP-UX -L options, use +b options to embed $(libdir) in the shared libraries (recommended by Tim Mooney). + add checks for some possible buffer overflows and unchecked malloc/realloc/calloc/strdup return values (patch by Todd C Miller <Todd.Miller@courtesan.com>) 980523 + correct maxx/maxy expression for num_columns/num_lines in derwin (patch by Alexander V Lukyanov). + add /usr/share/lib/terminfo and /usr/lib/terminfo as compatibilty fallbacks to _nc_read_entry(), along with --with-terminfo-dirs configure option (suggested by Mike Hopkirk). + modify config.guess to recognize Unixware 2.1 and 7 (patch by Mike Hopkirk <hops@sco.com>). + suppress definition of CC_SHARED_OPTS in LDFLAGS_SHARED in c++ Makefile.in, since this conflicts when g++ is used with HP-UX compiler (reported by Tim Mooney). + parenthesize 'strcpy' calls in c++ binding to workaround redefinition in some C++ implementations (reported by several people running egcs with glibc 2.0.93, analysis by Andreas Jaeger. 980516 + modify write_entry.c so that it will not attempt to link aliases with embedded '/', but give only a warning. + put -L$(libdir) first when linking programs, except for HP-UX. + modify comp_scan.c to handle SVr4 terminfo description for att477, which contains a colon in the description field. + modify configure script to support SCO osr5.0.5 shared libraries, from comp.unix.sco.programmer newsgroup item (Mike Hopkirk). + eliminate extra GoTo call in lib_doupdate.c (patch by Alexander V. Lukyanov). + minor adjustments of const/NCURSES_CONST from IRIX compile. + add updates based on esr's 980509 version of terminfo.src. 980509 + correct macros for wattr_set, wattr_get, separate wattrset macro from these to preserve behavior that allows attributes to be combined with color pair numbers. + add configure option --enable-no-padding, to allow environment variable $NCURSES_NO_PADDING to eliminate non-mandatory padding, thereby making terminal emulators (e.g., for vt100) a little more efficient (request by Daniel Eisenbud <eisenbud@cs.swarthmore.edu>). + modify configure script to embed ABI in shared libraries for HP-UX 10.x (detailed request by Tim Mooney). + add test/example of the 'filter()' function. + add nxterm and xterm-color terminfo description (request by Cristian Gafton <gafton@redhat.com>). + modify rxvt terminfo description to clear alternate screen before switching back to normal screen, for compatibility with applications which use xterm (reported by Manoj Kasichainula <manojk@io.com>). + modify linux terminfo description to reset color palette (reported by Telford Tendys <telford@eng.uts.edu.au>). + (reported by Daniel Eisenbud <eisenbud@cs.swarthmore.edu>). + minor performance improvement to wnoutrefresh by moving some comparisons out of inner loop. 980425 + modify configure script to substitute NCURSES_CONST in curses.h + updated terminfo entries for xterm-xf86-v40, xterm-16color, xterm-8bit to correspond to XFree86 3.9Ag. + remove restriction that forces ncurses to use setaf/setab if the number of colors is greater than 8. (see 970524 for xterm-16color). + change order of -L options (so that $(libdir) is searched first) when linking tic and other programs, to workaround HP's linker. Otherwise, the -L../lib is embedded when linking against shared libraries and the installed program does not run (reported by Ralf Hildebrandt). + modify configuration of shared libraries on Digital Unix so that versioning is embedded in the library, rather than implied by links (patch by Tim Mooney). 980418 + modify etip.h to avoid conflict with math.h on HP-UX 9.03 with gcc 2.8.1 which redefines 'exception' (reported by Ralf Hildebrandt <R.Hildebrandt@tu-bs.de>). + correct configure tests in CF_SHARED_OPTS which used $CC value to check for gcc, rather than autoconf's $GCC value. This did not work properly if the full pathname of the compiler were given (reported by Michael Yount <yount@csf.Colorado.edu>). + revise check for compiler options to force ANSI mode since repeating an option such as -Aa causes HP's compiler to fail on its own headers (reported by Clint Olsen <olsenc@ichips.intel.com>). 980411 + ifdef'd has_key() and mcprint() as extended functions. + modified several prototypes to correspond with 1997 version of X/Open Curses (affects ABI since developers have used attr_get). + remove spurious trailing blanks in glibc addon-scripts (patch by H.J.Lu). + insert a few braces at locations where gcc-2.8.x asks to use them to avoid ambigous else's, use -fpic rather than -fPIC for Linux (patch by Juergen Pfeifer). 980404 + split SHLIB_LIST into SHLIB_DIRS/SHLIB_LIST to keep -L options before -l to accommodate Solaris' linker (reported by Larry Virden). 980328 + modify lib_color.c to eliminate dependency on orig_colors and orig_pair, since SVr4 curses does not require these either, but uses them when they are available. + add detailed usage-message to infocmp. + correct a typo in att6386 entry (a "%?" which was "?"). + add -f option to infocmp and tic, which formats the terminfo if/then/else/endif so that they are readable (with newlines and tabs). + fixes for glibc addon scripts (patch by H.J.Lu). 980321 + revise configure macro CF_SPEED_TYPE so that termcap.h has speed_t declared (from Adam J Richter <adam@yggdrasil.com>) + remove spurious curs_set() call from leaveok() (J T Conklin). + corrected handling leaveok() in doupdate() (patch by Alexander V. Lukyanov). + improved version of wredrawln (patch by Alexander V. Lukyanov). + correct c++/Makefile.in so install target do not have embedded ../lib to confuse it (patch by Thomas Graf <graf@essi.fr>). + add warning to preinstall rule which checks if the installer would overwrite a curses.h or termcap.h that is not derived from ncurses. (The recommended configuration for developers who need both is to use --disable-overwrite). + modify preinstall rule in top-level Makefile to avoid implicit use of 'sh', to accommodate Ultrix 4.4 (reported by Joao Palhoto Matos <jmatos@math.ist.utl.pt>, patch by Thomas Esser <te@informatik.uni-hannover.de>) + refine ifdef's for TRACE so that libncurses has fewer dependencies on libtinfo when TRACE is disabled. + modify configure script so that if the --with-termlib option is used to generate a separate terminfo library, we chain it to the ncurses library with a "-l" option (reported by Darryl Miles and Ian T. Zimmerman). 980314 + correct limits and window in wredrawln function (reported/analysis by Alexander V. Lukyanov). + correct sed expression in configure script for --with-fallback option (patch by Jesse Thilo). + correct some places in configure script where $enableval was used rather than $withval (patch by Darryl Miles <dlm@g7led.demon.co.uk>). + modify some man-pages so no '.' or '..' falls between TH and SH macros, to accommodate man_db program (reported by Ian T. Zimmerman <itz@rahul.net>). + terminfo.src 10.2.1 downloaded from ESR's webpage (ESR). > several changes by Juergen Pfeifer: + add copyright notices (and rcs id's) on remaining man-pages. + corrected prototypes for slk_* functions, using chtype rather than attr_t. + implemented the wcolor_set() and slk_color() functions + the slk_attr_{set,off,on} functions need an additional void* parameter according to XSI. + fix the C++ and Ada95 binding as well as the man pages to reflect above enhancements. 980307 + use 'stat()' rather than 'access()' in toe.c to check for the existence of $HOME/.terminfo, since it may be a file. + suppress configure CF_CXX_LIBRARY check if we are not using g++ 2.7.x, since this is not needed with g++ 2.8 or egcs (patch by Juergen Pfeifer). + turn on hashmap scrolling code by default, intend to remedy defects by 4.3 release. + minor corrections to terminfo.src changelog. 980302 4.2 release for upload to prep.ai.mit.edu + correct Florian's email address in ncurses-intro.html + terminfo.src 10.2.0 (ESR). 980228 pre-release + add linux-koi8r replace linux-koi8, which is not KOI8 (patch by QingLong <qinglong@Bolizm.ihep.su>). + minor documentation fixes (patch by Juergen Pfeifer). + add setlocale() call to ncurses.c (reported by Claes G. Lindblad <claesg@algonet.se>). + correct sign-extension in lib_insstr.c (reported by Sotiris Vassilopoulos <svas@leon.nrcps.ariadne-t.gr>) 980221 pre-release + regenerated some documentation overlooked in 980214 patch (ncurses-intro.doc, curs_outopts.3x.html) + minor ifdef change to C++ binding to work with gcc 2.8.0 (patch by Juergen Pfeifer). + change maintainer's mailing address to florian@gnu.org, change tentative mailing list address to bug-ncurses-request@gnu.org (patch by Florian La Roche). + add definition of $(REL_VERSION) to c++/Makefile.in (reported by Gran Hasse <gh@raditex.se>). + restore version numbers to Ada95 binding, accidentally deleted by copyright patch (patch by Juergen Pfeifer). 980214 pre-release + remove ncurses.lsm from MANIFEST so that it won't be used in FSF distributions, though it is retained in development. + correct scaling of milliseconds to nanoseconds in lib_napms.c (patch by Jeremy Buhler). + update mailing-list information (bug-ncurses@gnu.org). + update announcement for upcoming 4.2 release. + modify -lm test to check for 'sin()' rather than 'floor()' + remove spurious commas from terminfo.src descriptions. + change copyright notices to Free Software Foundation 980207 + minor fixes for autoconf macros CF_ERRNO, CF_HELP_MESSAGE and CF_SIZECHANGE + modify Makefile.glibc so that $(objpfx) is defined (H.J.Lu). + ifdef-out true-return from _nc_mouse_inline() which depends on merge of QNX patch (pending 4.2 release). > patch to split off seldom-used modules in ncurses (J T Conklin): This reduces size by up to 2.6kb. + move functionality of _nc_usleep into napms, add configuration case for nanosleep(). + moved wchgat() from lib_addch.c to lib_chgat.c + moved clearok(), immedok(), leaveok(), and scrollok() from lib_options.c to lib_clearok.c, lib_immedok.c, lib_leaveok.c and lib_scrollok.c. + moved napms() from lib_kernel.c to lib_napms.c + moved echo() and noecho() from lib_raw.c to lib_echo.c + moved nl() and nonl() from lib_raw.c to lib_nl.c 980131 + corrected conversion in tclock.c (cf: 971018). + updates to Makefile.glibc and associated Linux configure script (patch by H.J.Lu). + workaround a quoting problem on SunOS with tar-copy.sh + correct init_pair() calls in worm.c to work when use_default_colors() is not available. + include <sys/types.h> in CF_SYS_TIME_SELECT to work with FreeBSD 2.1.5 + add ncv capability to FreeBSD console (cons25w), making reverse work with color. + correct sense of configure-test for sys/time.h inclusion with sys/select.h + fixes for Ada95/ada_include/Makefile.in to work with --srcdir option. + remove unused/obsolete test-program rules from progs/Makefile.in (the rules in ncurses/Makefile.in work). + remove shared-library loader flags from test/Makefile.in, etc. + simplify test/configure.in using new version of autoconf to create test/ncurses_cfg.h + suppress suffix rules in test/Makefile.in, provide explicit dependency to work with --srcdir option and less capable 'make' programs. > adapted from patch for QNX by Xiaodan Tang: + initialize %P and %g variables set/used in tparm, and also ensure that empty strings don't return a null result from tparam_internal + add QNX-specific prototype for vsscanf() + move initialization of SP->_keytry from init_keytry() to newterm() to avoid resetting it via a keyok() call by mouse_activate(). + reorganized some functions in lib_mouse() to use case-statements. + remove sgr string from qnx terminfo entry since it is reported to turn off attributes inconsistently. 980124 + add f/F/b/B commands to ncurses 'b' test to toggle colors, providing test for no_color_video. + adjusted emx.src to use no_color_video, now works with ncurses 'b' and 'k' tests. + implement no_color_video attribute, and as a special case, reverse colors when the reverse attribute cannot be combined with color. + check for empty string in $TERM variable (reported by Brett Michaels <brett@xylan.com>). > from reports by Fred Fish: + add configure-test for isascii + add configure-test for -lm library. + modify CF_BOOL_SIZE to check if C++ bool types are unsigned. > patches by J.J.G.Ripoll + add configure/makefile variables to support .exe extension on OS/2 EMX (requires additional autoconf patches). + explicitly initialize variables in lib_data.c to appease OS/2 linker > patches by Fred Fish <fnf@ninemoons.com> + misc/Makefile.in (install.data): Avoid trying to install the CVS directory. + aclocal.m4 (install.includes): Remove files in the include directory where we are going to install new ones, not the original source files. + misc/terminfo.src: Add entry for "beterm", derived from termcap distributed with BeOS PR2 using captoinfo. + aclocal.m4: Wrap $cf_cv_type_of_bool with quotes (contains space) + aclocal.m4: Assume bool types are unsigned. + progs/infocmp.c: workaround mwcc 32k function data limit 980117 + correct initialization of color-pair (cf: 970524) in xmas.c, which was using only one color-pair for all colors (reported by J.J.G.Ripoll). + add multithread options for objects build on EMX, for compatibility with XFree86. + split up an expression in MKlib_gen.sh to work around a problem on OS/2 EMX, with 'ash' (patch by J.J.G.Ripoll). + change terminfo entries xterm (xterm-xf86-v40), xterm-8bit rs1 to use hard reset. + rename terminfo entry xterm-xf86-v39t to xterm-xf86-v40 + remove bold/underline from sun console entries since they're not implemented. + correct _tracef calls in _tracedump(), which did not separate format from parameters. + correct getopt string for tic "-o" option, and add it to man-page synopsis (reported by Darren Hiebert <darren@hmi.com>). + correct typo in panel/Makefile.in, reversed if-statement in scrolling optimization (Alexander V. Lukyanov). + test for 'remove()', use 'unlink() if not found (patch by Philippe De Muyter <phdm@macqel.be>). > patches by Juergen Pfeifer: + Improve a feature of the forms driver. For invisible fields (O_VISIBLE off) only the contents but not the attributes are cleared. We now clear both. (Reported by Javier Kohan <jkohan@adan.fceia.unr.edu.ar>) + The man page form_field_opts.3x makes now clear, that invisible fields are also always inactive. + adjust ifdef's to compile the C++ binding with the just released gcc-2.8.0 c++ and the corresponding new C++ libraries. 980110 + correct "?" command in ncurses.c; it was performing non-screen writes while the program was in screen mode. (It "worked" in 1.9.9e because that version sets OPOST and OCRNL incorrectly). + return error from functions in lib_kernel, lib_raw and lib_ti if cur_term is null, or if underlying I/O fails. + amend change to tputs() so that it does not return an error if cur_term is null, since some applications depend on being able to use tputs without initializing the terminal (reported by Christian J. Robinson <infynity@cyberhighway.net>). 980103 + add a copy of emx.src from J.J.G.Ripoll's OS/2 EMX version of ncurses 1.9.9e, together with fixes/additions for the "ansi" terminal type. + add tic check for save/restore cursor if change_scroll_region is defined (reference: O'Reilly book). + modify read_termcap.c to handle EMX-style pathnames (reported by J.J.G.Ripoll). + modify lib_raw.c to use EMX's setmode (patch from J.J.G.Ripoll). Ripoll says EMX's curses does this. + modify _nc_tic_expand() to generate \0 rather than \200. + move/revise 'expand()' from dump_entry.c to ncurses library as _nc_tic_expand(), for use by tack. + decode \a as \007 for terminfo, as per XSI. + correct translation of terminfo "^@", to \200, like \0. + modify next_char() to treat <cr><lf> the same as <newline>, for cross-platform compatibility. + use new version of autoconf (971230) to work around limited environment on CLIX, due to the way autoconf builds --help message. > patch by Juergen Pfeifer: + check that the Ada95 binding runs against the correct version of ncurses. + insert constants about the library version into the main spec-file of the Ada95 binding. 971227 + modify open/fopen calls to use binary mode, needed for EMX. + modify configure script to work with autoconf 2.10 mods for OS/2 EMX (from J.J.G.Ripoll). + generated ncurses_cfg.h with patch (971222) to autoconf 2.12 which bypasses limited sed buffer length. > several changes from Juan Jose Garcia Ripoll <worm@arrakis.es> (J.J.G.Ripoll) to support OS/2 EMX: + add a _scrolling flag to SP, to set when we encounter a terminal that simply cannot scroll. + corrected logic in _nc_add_to_try(), by ensuring that strings with embedded \200 characters are matched. + don't assume the host has 'link()' function, for linking terminfo entries. 971220 + if there's no ioctl's to support sigwinch handler, disable it. + add configure option --disable-ext-funcs to remove the extended functions from the build. + add configure option --with-termlib to generate the terminfo functions as a separate library. + add 'sources' rule to facilitate cross-compiling. + review/fix order of mostlyclean/clean/distclean rules. + modify install-rule for headers to first remove old header, in case there was a symbolic link that confuses the install script. + corrected substitution for NCURSES_CONST in term.h (cf: 971108) + add null pointer checks in wnoutrefresh(), overlap() (patch by Xiaodan Tang <xtang@qnx.com>) + correct tputs(), which could dereference a null cur_term if invoked before terminal is initialized (patch by Christopher Seawood <cls@seawood.org>) > patch by Juergen Pfeifer: + makes better use of "pragma Inline" in the Ada95 binding + resynchronizes the generated html manpages 971213 + additional fixes for man-pages section-references + add (for debugging) a check for ich/ich1 conflict with smir/rmir to tic, etc. + remove hpa/vpa from rxvt terminal description because they are not implemented correctly, added sgr0. + change ncurses 's' to use raw mode, so ^Q works (reported by Rudolf Leitgeb <leitgeb@leland.stanford.edu>) 971206 + modify protection when installing libraries to (normally) not executable. HP-UX shared libraries are an exception. + add configure check for 'tack'. + implement script for renaming section-references in man-page install, for Debian configuration. + add validity-check for SP in trace code in baudrate() (reported by Daniel Weaver). > patch by Alexander V. Lukyanov (fixes to match sol25 curses) + modify 'overlay()' so that copy applies target window background to characters. + correct 'mvwin()' so that it does not clear the previous locations. + correct lib_acs.c so that 8-bit character is not sign expanded in case of wide characters in chtype. + correct control-char test in lib_addch.c for use with wide chars + use attribute in the chtype when adding a control character in lib_addch.c control char was added with current attribute 971129 + save/restore errno in _tracef() function + change treatment of initialize_color to use a range of 0..1000 (recommended by Daniel Weaver). + set umask in mkinstalldirs, fixing problems reported by users who have set root's umask to 077. + correct bug in tic that caused capabilities to be reprinted at the end of output when they had embedded comments. + rewrote wredrawln to correspond to XSI, and split-out since it is not often used (from report by Alexander V. Lukyanov, 970825) + rewrote Dan Nelson's change to make it portable, as well as to correct logic for handling backslashes. + add code to _nc_tgetent() to make it work more like a real tgetent(). It removes all empty fields, and removes all but the first in a group of duplicate caps. The code was pulled from the BSD libtermcap code in termcap.c (patch by Dan Nelson <dnelson@emsphone.com> + don't include --enable-widec in the --with-develop configure option, since it is not binary-compatible with 4.1 (noted by Alexander V. Lukyanov) > patch by Juergen Pfeifer: + further improvements of the usage of elaboration pragmas in the Ada95 binding + enhanced Ada95 sample to use the user_data mechanism for panels. + a fix for the configuration script to make gnat-3.10 the required version. + resync of the html version of the manpages 971122 > fixes/updates for terminfo.src: + add vt220-js, pilot, rbcomm, datapoint entries from esr's 27-jun-97 version. + add hds200 description (Walter Skorski) + add EMX 0.9b descriptions + correct rmso/smso capabilities in wy30-mc and wy50-mc (Daniel Weaver) + rename xhpterm back to hpterm. > patch by Juergen Pfeifer: + Improves the usage of elaboration pragmas for the Ada95 binding. + Adds a translation of the test/rain.c into Ada95 to the samples. This has been contributed to the project by Laurent Pautet (pautet@gnat.com) 971115 + increase MAX_NAME_SIZE to 512 to handle extremely long alias list in HP-UX terminfo. + correction & simplification of delay computation in tputs, based on comments from Daniel Weaver. + replace test for SCO with more precise header tests. + add configure test for unsigned literals, use in NCURSES_BITS macro. + comment-out the -PIC, etc., flags from c++, progs and test makefiles since they probably are not needed, and are less efficient (noted by Juergen Fluk) + add -L$(libdir) to loader options, after -L../lib so that loaders that record this information will tend to do the right thing if the programs are moved around after installing them (suggested by Juergen Fluk). + add -R option to loader options for programs for Solaris if the --enable-rpath option is specified for the libraries. 971112 + correct installed filename for shared libraries on *BSD (reported by Juergen Fluk). 971108 + cleanup logic for deciding when tputs() should call delay_output(), based on comments from Daniel Weaver. + modified tputs() to avoid use of float. + correct use of trailpad in tputs(), which used the wrong variable in call to delay_output(). + correct inverted expression for null-count in delay_output() (analysis by Daniel Weaver). + apply --enable-rpath option to Solaris (requested by Larry Virden). + correct substitution of EXTRA_CFLAGS for gcc 2.6.3 + correct check for error-return by _nc_tgetent(), which returns 0 for success. + add configure test for BSD 4.4 cgetent() function, modify read_termcap.c to use the host's version of that if found, using the terminal database on FreeBSD (reported by Peter Wemm). + add u8, u9 strings to sun-il description for Daniel Weaver. + use NCURSES_CONST in panel's user-pointer. + modify edit_cfg.sh and MKterm.h.awk.in to substitute NCURSES_CONST so that will work on NeXT. + use _nc_set_screen() rather than assignments to SP to fix port to NeXT (reported by Francisco A. Tomei Torres). 971101 + force mandatory padding in bell and flash_screen, as specified in XSI. + don't allow padding_baud_rate to override mandatory delays (reported by Daniel Weaver). + modify delay_output() to use _nc_timed_wait() if no baudrate has been defined, or if the cur_term pointer is not initialized. XSI treats this as unspecified. (requested by Daniel Weaver). + change getcap-cache ifdef's to eliminate unnecessary chdir/mkdir when that feature is not configured. + remove _nc_err_abort() calls when write_entry.c finds a directory but cannot write to it, e.g., when translating part/all of /etc/termcap (reported by Andreas Jaeger <aj@arthur.rhein-neckar.de>). (this dates back to 951102, in 1.9.7a). + minor ifdef fixes to compile with atac and glibc 2.0.5c + add check for -lgen when configuring regexpr.h + modify Solaris shared-library option "-d y" to "-dy" to workaround incompatibility of gcc 2.7.2 vs vendor's tools. 971026 + correct ifdef's for struct winsize vs struct ttysize in lib_setup.c to compile on SCO. + remove dangling backslash in panel/Makefile.in + modify MKkeyname.awk to work with SCO's nawk, which dumps core in the length() function. + correct length of allocation in _nc_add_to_try(), to allow for trailing null. + correct logic in _nc_remove_key(), which was discarding too many nodes (patch by Alexander V. Lukyanov) 971025 + add definition for $(REL_VERSION) to test/Makefile.in, so *BSD shared libraries link properly (see 970524). + modify Linux shared-library generation to include library dependencies (e.g., -lncurses and -lgpm) in the forms, menu and panel libraries (suggested by Juergen Pfeifer). + modify configure script to use config.guess and config.sub rather than uname, which is unreliable on some systems. + updated Makefile.glibc, test-built with glibc 2.0.5c + modify keyname() to return values consistent with SVr4 curses (patch by Juergen Fluk). > changes requested by Daniel Weaver: + modify delay_output() so that it uses the same output function as tputs() if called from that function. + move _baudrate from SCREEN to TERMINAL so that low-level use of tputs works when SP is not set. > patch by Juergen Pfeifer: + factor lib_menu and lib_form into smaller modules + clean up the interface between panel and SCREEN + minor changes to the Ada95 mouse support implemenation + minor bugfix in C++ binding to ripoff windows + fix a few Ada95 html documentation pages 971018 + split-out lib_ungetch.c, make runtime link to resizeterm() to decouple those modules from lib_restart.c + add xterm-xf86-v39t description to terminfo.src + reset SP->_endwin in lib_tstp.c cleanup() function after calling endwin() to avoid unnecessary repainting if the application has established an atexit function, etc. Encountered this problem in the c++ demo, whose destructors repaint the screen. + combine _nc_get_screensize() and resizeterm() calls as new function _nc_update_screensize(). + minor fixes to allow compile with g++ (suggested by Nelson H. F. Beebe). + implement install-rules for Ada95 makefiles. + use screen_lines or MAXLINES as needed where LINES was coded, as well as screen_columns for COLS, in the ncurses library. > patch by Alexander V. Lukyanov: + modify logic for ripped-off lines to handle several SCREENs. > patch by Juergen Pfeifer: + factors lib_slk.c into some smaller modules + factors panel.c into some smaller modules + puts the static information about the current panel stack into the SCREEN structure to allow different panel stacks on different screens. + preliminary fix for an error adjusting LINES to account for ripped-off lines. 971011 + move _nc_max_click_interval and other mouse interface items to SCREEN struct so that they are associated with a single terminal, and also save memory when the application does not need a mouse (roughly 3k vs 0.5k on Linux). + modify mouseinterval() so that a negative parameter queries the click-interval without modifying it. + modify ncurses 'i' test to work with ncurses' apparent extension from SVr4, i.e., allows nocbreak+noecho (analysis by Alexander V. Lukyanov). + add configure options --with-ada-includes and --with-ada-objects, to drive Ada95 binding install (not yet implemented). + install C++ binding as -lncurses++ and associated headers with the other ncurses headers. + fix header uninstall if configure --srcdir is used. > minor interface changes to support 'tack' program -TD (request by Daniel Weaver <danw@znyx.com>). + export functions _nc_trans_string() and _nc_msec_cost(). + add variable _nc_nulls_sent, to record the number of padding characters output in delay_output(). + move tests for generic_type and hard_copy terminals in setupterm() to the end of that function so that the library will still be initialized, though not generally useful for curses programs. > patches by Alexander V. Lukyanov: + modify ClrBottom() to avoid using clr_eos if there is only one line to erase. + typo in configure --help. > patch by J T Conklin (with minor resync against Juergen's changes) + split-out lib_flash.c from lib_beep.c + split-out lib_hline.c and lib_vline.c from lib_box.c + split-out lib_wattron.c, lib_wattroff.c from lib_addch.c 971005 > patch by Juergen Pfeifer: + correct source/target of c++/edit_cfg.sh 971004 + add color, mouse support to kterm terminfo entry. + modify lib_mouse.c to recognize rxvt, kterm, color_xterm also as providing "xterm"-style mouse. + updated rxvt's terminfo description to correspond to 2.21b, with fixes for the acsc (the box1 capability is incorrect, ech1 does not work). + fix logic in parse_entry.c that discarded acsc when 'synthesizing' an entry from equivalents in XENIX or AIX. This lets ncurses handle the distribution copy of rxvt's terminfo. + modify acsc capability for linux and linux-koi8 terminfo descriptions (from Pavel Roskin <pavel@absolute.spb.su>). + corrected definition in curses.h for ACS_LANTERN, which was 'I' rather than 'i' (see 970802). + updated terminfo.src with reformatted acsc entries, and repaired the trashed entries with spurious '\' characters that this exposed. + add logic to dump_entry.c to reformat acsc entries into canonical form (sorted, unique mapping). + add configure script to generate c++/etip.h + add configure --with-develop option, to enable by default most of the experimental options (requested by Alexander V. Lukyanov). + rename 'deinstall' to 'uninstall', following GNU convention (suggested by Alexander V. Lukyanov). > patches by Alexander V. Lukyanov: + modify tactics 2 and 5 in onscreen_mvcur(), to allow them on the last line of the screen, since carriage return will not cause a newline. + remove clause from PutCharLR() that would try to use eat_newline_glitch since that apparently does not work on some terminals (e.g., M$ telnet). + correct a limit check in scroll_csr_backward() > patches by Juergen Pfeifer: + adds dummy implementations of methods above() and below() to the NCursesPanel class. + fixes missing returncode in NCursesWindow::ripoffline() + fixes missing returncode in TestApplication::run() in demo.cc + We should at least give a comment in etip.h why it is currently a problem to install the C++ binding somewhere + makes the WINDOW* argument of wenclose() a const. + modifies several of the routines in lib_adabind.c to use a const WINDOW* argument. 970927 + add 'deinstall' rules. + use explicit assignments in configure --without-progs option to work around autoconf bug which doesn't always set $withval. + check for ldconfig, don't try to run it if not found. + implement simple/unoptimized case in lib_doupdate.c to handle display with magic cookie glitch, tested with ncurses.c program. + correct missing _tracef in getmouse(), to balance the returnCode macro. + simplify show_attr() in ncurses.c using termattrs(). > patches by Juergen Pfeifer: + provides missing inlines for mvw[hv]line in cursesw.h of the C++ binding + fixes a typo in a comment of frm_driver.c + Enhances Ada95 Makefiles to fulfill the requirement of GNAT-3.10 that generics should be compiled. Proper fixes to the configuration scripts are also provided. 970920 + several modifications to the configure script (requested by Ward Horner): + add configure options --without-progs, to suppress the build of the utility programs, e.g., for cross-compiling. + add $(HOSTCCFLAGS) and $(HOSTLDFLAGS) symbols to ncurses Makefile.in, to simplify setup for cross compiling. + add logic in configure script to recognize "--target=vxworks", and generate load/install actions for VxWorks objects. + move typedef for sigaction_t into SigAction.h to work around problem generating lint library. + modify fty_regex.c to reflect renaming of ifdef's for regular expressions. + simplify ifdef in lib_setup.c for TIOCGWINSZ since that symbol may reside in <sys/ioctl.h>. + merge testcurs.c with version from PDCurses 2.3, clarifying some of the more obscure tests, which rely upon color. + use macros getbegyx() and getmaxyx() in newdemo.c and testcurs.c + modify ncurses.c to use getbegyx() and getmaxyx() macros to cover up implementation difference wrt SVr4 curses, allow 's' test to work. + add missing endwin() to testscanw.c program (reported by Fausto Saporito <fausap@itb.it>). + fixes/updates for Makefile.glibc and related files under sysdeps (patch by H.J.Lu). > patches by Juergen Pfeifer: + add checks for null pointers, especially WINDOW's throughout the ncurses library. + solve a problem with wrong calculation of panel overlapping (reported by Ward Horner): + make sure that a panel's window isn't a pad. + do more error checking in module lib_touch.c + missing files for Ada95 binding from the last patch + synch. of generated html pages (RCS-Id's were wrong in html files) + support for Key_Resize in Ada binding + changed documentation style in ./c++/cursesm.h > patches by Alexander V. Lukyanov: + undo attempt to do recursive inlining for PutChar(), noting that it did not improve timing measurably, but inflated the size of lib_doupdate.o 970913 + modify rain.c to use color. + correct scroll_csr_backward() to match scroll_csr_forward(). + minor adjustment to llib-lncurses, to work with Solaris 2.5.1 + minor fixes to sysdeps/unix/sysv/linux/configure to reflect renaming of configure cache variables in 970906. + correct logic involving changes to O_VISIBLE option in Synchronize_Options function in frm_driver.c (Tony Hoffmann <Tony.Hoffmann@hia.nrc.ca>) + add $(HOSTCC) symbol to ncurses Makefile.in, to simplify setup for cross compiling (suggested by Chris Johns). + modify ifdef in lib_setup.c to only include <sys/ioctl.h> if we can use it to support screen-size calculation (reported by Chris Johns). + #undef unctrl to avoid symbol conflict in port to RTEMS (reported by Chris Johns <cjohns@plessey.com.au>) > patches by Juergen Pfeifer: + simplified, made minor corrections to Ada95 binding to form fieldtype. + The C++ binding has been enhanced: + Improve NCursesWindow class: added additional methods to cover more ncurses functionality. Make refresh() and noutrefresh() virtual members to allow different implementation in the NCursesPanel class. + CAUTION: changed order of parameters in vline() and hline() of NCursesWindow class. + Make refresh() in NCursesPanel non-static, it is now a reimplementation of refresh() in the base class. Added noutrefresh() to NCursesPanel. + Added NCursesForm and related classes to support libform functionality. + Moved most of configuration related stuff from cursesw.h to etip.h + Added NCursesApplication class to support easy configuration of menu and forms related attributes as well as ripped of title lines and Soft-Label-Keys for an application. + Support of Auto-Cleanup for a menu's fieldlist. + Change of return type for current_item() and operator[] for menus. + Enhanced demo. + Fixed a bug in form/fld_def.c: take into account that copyarg and freearg for a fieldtype may be NULL, makearg must not be NULL + Fixed a bug in form/fld_type.c: in set_fieldtype_arg() makearg must not be NULL, copyarg and freearg may be NULL. + Fixed a bug in form/frm_def.c: Allow Disconnect_Fields() if it is already disconnected. + Enhance form/frm_driver.c: Allow growth of dynamic fields also on navigation requests. + Fixed a bug in form/fty_enum.c: wrong position of postincrement in case-insensitiva comparision routine. + Enhanced form/lib_adabind.c with function _nc_get_field() to get a forms field by index. + Enhanced menu/m_adabind.c with function _nc_get_item() to get a menus item by index. + Fixed in curses.h.in: make chtype argument for pechochar() constant. Mark wbkgdset() as implemented, remove wbkgdset macro, because it was broken (didn't handle colors correctly). + Enhanced lib_mouse.c: added _nc_has_mouse() function + Added _nc_has_mouse() prototype to curses.priv.h + Modified lib_bkgd.c: hopefully correct implementation of wbkgdset(); streamlined implementation of wbkgd() + Modified lib_mvwin.c: Disable move of a pad. Implement (costly) move of subwindows. Fixed update behavior of movements of regular windows. + Fixed lib_pad.c: make chtype argument of pechochar() const. + Fixed lib_window.c: dupwin() is not(!) in every bit a really clone of the original. Subwindows become regular windows by doing a dupwin(). + Improved manpage form_fieldtype.3x > patches by Alexander V. Lukyanov: + simplify the PutChar() handling of exit_am_mode, because we already know that auto_right_margin is true. + add a check in PutChar() for ability to insert to the case of shifting character to LR corner. + in terminal initialization by _nc_screen_resume(), make sure that terminal right margin mode is known. + move logic that invokes touchline(), or does the equivalent, into _nc_scroll_window(). + modify scrolling logic use of insert/delete line capability, assuming that they affect the screen contents only within the current scrolling region. + modify rain.c to demonstrate SIGWINCH handler. + remove logic from getch() that would return an ERR if the application called getch() when the cursor was at the lower-right corner of the physical screen, and the terminal does not have insert-character ability. + change view.c so that it breaks out of getch() loop if a KEY_RESIZE is read, and modify logic in getch() so this fix will yield the desired behavior, i.e., the screen is repainted automatically when the terminal window is resized. 970906 + add configure option --enable-sigwinch + modify view.c to test KEY_RESIZE logic, with "-r" option. + modify testcurs.c to eliminate misleading display wrt cursor type by testing if the terminal supports cnorm, civis, cvvis. + several fixes for m68k/NeXT 4.0, to bring cur_term, _nc_curr_line and _nc_curr_col variables into linked programs: move these variables, making new modules lib_cur_term and trace_buf (reported by Francisco Alberto Tomei Torres <fatomei@sandburg.unm.edu>). > patches by Alexander V. Lukyanov: + add pseudo-functionkey KEY_RESIZE which is returned by getch() when the SIGWINCH handler has been called since the last call to doupdate(). + modify lib_twait.c to hide EINTR only if HIDE_EINTR is defined. + add SIGWINCH handler to ncurses library which is used if there is no application SIGWINCH handler in effect when the screen is initialized. + make linked list of all SCREEN structures. + move curses.h include before definition of SCREEN to use types in that structure. + correction to ensure that wgetstr uses only a newline to force a scroll (970831). 970831 + add experimental configure option --enable-safe-sprintf; the normal mode now allocates a buffer as large as the screen for the lib_printw.c functions. + modify wgetch to refresh screen when reading ungetch'd characters, since the application may require this - SVr4 does this. + refine treatment of newline in wgetstr to echo only when this would force the screen to scroll. 970830 + remove override in wgetstr() that forces keypad(), since SVr4 does not do this. + correct y-reference for erasure in wgetstr() when a wrap forces a scroll. + correct x-position in waddch() after a wrap forces a scroll. + echo newline in wgetstr(), making testscanw.c scroll properly when scanw is done. + modify vwscanw() to avoid potential buffer overflow. + rewrote lib_printw.c to eliminate fixed-buffer limits. > patches by Alexander V. Lukyanov: + correct an error in handling cooked mode in wgetch(); processing was in the wrong order. + simplified logic in wgetch() that handles backspace, etc., by using wechochar(). + correct wechochar() so that it interprets the output character as in waddch(). + modify pechochar() to use prefresh() rather than doupdate(), since the latter does not guarantee immediate refresh of the pad. + modify pechochar() so that if called with a non-pad WINDOW, will invoke wechochar() instead. + modify fifo indices to allow fifo to be longer than 127 bytes. 970823 + add xterm-8bit to terminfo.src + moved logic for SP->_fifohold inside check_pending() to make it work properly when we add calls to that function. + ensure that bool functions return only TRUE or FALSE, and TRUE/FALSE are assigned to bool values (patch by H.J.Lu). > patches by Alexander V. Lukyanov: + several fixes to getch: 1. Separate cooked and raw keys in fifo 2. Fix the case of ungetch'ed KEY_MOUSE 3. wrap the code for hiding EINTR with ifdef HIDE_EINTR 4. correctly handle input errors (i.e., EINTR) without loss of raw keys 5. recognize ESC KEY_LEFT and similar 6. correctly handle the case of receiption of KEY_MOUSE from gpm + correct off-by-one indexing error in _nc_mouse_parse(), that caused single mouse events (press/release) to be ignored in favor of composed events (click). Improves on a fix from integrating gpm support in 961229. + add another call to check_pending, before scrolling, for line-breakout optimization + improve hashmap.c by 1. fixed loop condition in grow_hunks() 2. not marking lines with offset 0 3. fixed condition of 'too far' criteria, thus one-line hunks are ignored and two lines interchanged won't pass. + rewrote/simplified _nc_scroll_optimize() by separating into two passes, forward/backward, looking for chunks moving only in the given direction. + move logic that emits sgr0 when initializing the screen to _nc_screen_init(), now invoked from newterm. + move cursor-movement cleanup from endwin() into _nc_mvcur_wrap() function and screen cleanup (i.e., color) into _nc_screen_wrap() function. + add new functions _nc_screen_init(), _nc_screen_resume() and _nc_screen_wrap(). + rename _nc_mvcur_scrolln() to _nc_scrolln(). + add a copy of acs_map[] to the SCREEN structure, where it can be stored/retrieved via set_term(). + move variables _nc_idcok, _nc_idlok, _nc_windows into the SCREEN structure. 970816 + implement experimental _nc_perform_scroll(). + modify newterm (actually _nc_setupscreen()) to emit an sgr0 when initializing the screen, as does SVr4 (reported by Alexander V. Lukyanov). + added test_progs rule to ncurses/Makefile. + modify test/configure.in to check if initscr is already in $LIBS before looking for (n)curses library. + correct version-number in configure script for OSF1 shared-library options (patch by Tim Mooney). + add -DNDEBUG to CPPFLAGS for --enable-assertions (as Juergen originally patched) since the c++ demo files do not necessarily include ncurses_cfg.h + supply default value for --enable-assertions option in configure script (reported by Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu>). > patches by Alexander V. Lukyanov: + correct/simplify logic of werase(), wclrtoeol() and wclrbot(). See example firstlast.c + optimize waddch_literal() and waddch_nosync() by factoring out common subexpressions. + correct sense of NDEBUG ifdef for CHECK_POSITION macro. + corrections to render_char(), to make handling of colored blanks match SVr4 curses, as well as to correct a bug that xor'd space against the background character. + replaced hash function with a faster one (timed it) + rewrote the hashmap algorithm to be one-pass, this avoids multiple cost_effective() calls on the same lines. + modified cost_effective() so it is now slightly more precise. > patches for glibc integration (H.J.Lu): + add modules define_key, keyok, name_match, tries + add makefile rules for some of the unit tests in ncurses (mvcur, captoinfo, hardscroll, hashmap). + update Linux configure-script for wide-character definitions. 970809 + modify _tracebits() to show the character size (e.g., CS8). + modify tparm() to emit '\200' where the generated string would have a null (reported by From: Ian Dall <Ian.Dall@dsto.defence.gov.au> for terminal type ncr7900). + modify install process so that ldconfig is not invoked if the package is built with an install-prefix. + correct test program for chtype size (reported by Tim Mooney). + add configure option --disable-scroll-hints, using this to ifdef the logic that computes indices for _nc_scroll_optimize(). + add module ncurses/softscroll.c, to perform single-stage computation of scroll indices used in _nc_scroll_optimize(). This is faster than the existing scrolling algorithm, but tends to make too-small hunks. + eliminate fixed buffer size in _nc_linedump(). + minor fixes to lib_doupdate.c to add tradeoff between clr_eol (el) and clr_bol (el1), refine logic in ClrUpdate() and ClrBottom() (patch by Alexander V. Lukyanov). + add test/testaddch.c, from a pending patch by Alexander V. Lukyanov. + correct processing of "configure --enable-assertions" option (patch by Juergen Pfeifer). 970802 + add '-s' (single-step) option too test/hashtest.c, correct an error in loop limit for '-f' (footer option), toggle scrollok() when writing footer to avoid wrap at lower-right corner. + correct behavior of clrtoeol() immediately after wrapping cursor, which was not clearing the line at the cursor position (reported by Liviu Daia <daia@stoilow.imar.ro>). + corrected mapping for ACS_LANTERN, which was 'I' rather than 'i' (reported by Klaus Weide <kweide@tezcat.com>). + many corrections to make progs/capconvert work, as well as make it reasonably portable and integrated with ncurses 4.1 (reported by Dave Furstenau <df@ravine.binary.net>). 970726 + add flag SP->_fifohold, corresponding logic to modify the behavior of the line breakout logic so that if the application does not read input, refreshes will not be stopped, but only slowed. + generate slk_attr_off(), slk_attr_on(), slk_attr_set(), vid_attr(), ifdef'd for wide-character support, since ncurses' WA_xxx attribute masks are identical with the A_xxx masks. + modify MKlib_gen.sh to generate ifdef'd functions to support optional configuration of wide-characters. + modify tset to behave more like SVr4's tset, which does not modify the settings of intr, quit or erase unless they are given as command options (reported by Nelson H. F. Beebe <beebe@math.utah.edu>). + baudrate() function. + improve breakout logic by allowing it before the first line updated, which is what SVr4 curses does (patch by Alexander V. Lukyanov). + correct initialization of vcost in relative_move(), for cursor-down case (patch by Alexander V. Lukyanov). > nits gleaned from Debian distribution of 1.9.9g-3: + install symbolic link for intotocap. + reference libc directly when making shared libraries. + correct renaming of curs_scr_dmp.3x in man_db.renames. + guard tgetflag() and other termcap functions against null cur_term pointer. 970719 + corrected initial state of software echo (error in 970405, reported by Alexander V. Lukyanov). + reviewed/added messages to configure script, so that all non-test options should be accompanied by a message. + add configure check for long filenames, using this to determine if it is safe to allow long aliases for terminal descriptions as does SVr4. + add configure options for widec (wide character), hashmap (both experimental). > patch by Alexander V. Lukyanov: + hashmap.c - improved by heuristic, so that scroll test works much better when csr is not available. + hardscroll.c - patched so that it continues to scroll other chunks after failure to scroll one. + lib_doupdate.c - _nc_mvcur_scrolln extended to handle more cases; csr is avoided as it is relative costly. Fixed wrong coordinates in one case and wrong string in TRACE. > patch by Juergen Pfeifer: + modify C++ binding to compile on AIX 4.x with the IBM C-SET++ compiler. 970712 + remove alternate character set from kterm terminfo entry; it uses the shift-out control for a purpose incompatible with curses, i.e., font switching. + disentangle 'xterm' terminfo entry from some derived entries that should be based on xterm-r6 instead. + add cbt to xterm-xf86-xv32 terminfo entry; I added the emulation for XFree86 3.1.2F, but overlooked its use in terminfo then - T.Dickey. + correct logic in lib_mvcur.c that uses back_tab. 970706 + correct change from 970628 to ClrUpdate() in lib_doupdate.c so that contents of curscr are saved in newscr before clearing the screen. This is needed to make repainting work with the present logic of TransformLine(). + use napms() rather than sleep() in tset.c to avoid interrupting I/O. 970705 + add limit checks to _nc_read_file_entry() to guard against overflow of buffer when reading incompatible terminfo format, e.g, from OSF/1. + correct some loop-variable errors in xmc support in lib_doupdate.c + modify ncurses 'b' test to add gaps, specified by user, to allow investigation of interaction with xmc (magic cookie) code. + correct typo in 970524 mods to xmas.c, had omitted empty parameter list from has_colors(), which gcc ignores, but SVr4 does not (reported by Larry Virden). + correct rmso capability in wy50-mc description. + add configure option "--enable-hard-tabs", renamed TABS_OK ifdef to USE_HARD_TABS. > patch by Juergen Pfeifer: + Add bindings for keyok() and define_key() to the Ada95 packages. + Improve man pages menu_post.3x and menu_format.3x + Fix the HTML pages in the Ada95/html directory to reflect the above changes. 970628 + modify change from 970101 to ClrUpdate() in lib_doupdate.c so that pending changes to both curscr and newscr are flushed properly. This fixes a case where the first scrolling operation in nvi would cause the screen to be cleared unnecessarily and repainted before doing the indexing, i.e., by repeatedly pressing 'j' (reported by Juergen Pfeifer). + correct error in trans_string() which added embedded newlines in a terminfo description to the stored strings. + remove spurious newlines from sgr in wyse50 (and several other) terminfo descriptions. + add configure option for experimental xmc (magic cookie) code, "--enable-xmc-glitch". When disabled (the default), attributes that would store a magic cookie are suppressed in vidputs(). The magic cookie code is far from workable at this stage; the configuration option is a stopgap. + move _nc_initscr() from lib_initscr.c to lib_newterm.c + correct path for invoking make_keys (a missing "./"). 970621 + correct sign-extension problem with "infocmp -e", which corrupted acsc values computed for linux fallback data. + correct dependency on ncurses/names.c (a missing "./"). + modify configure script to use '&&' even for cd'ing to existing directories to work around broken shell interpreters. + correct a loop-limit in _nc_hash_map() (patch by Alexander V. Lukyanov). 970615 + restore logic in _nc_scroll_optimize() which marks as touched the lines in curscr that are shifted. + add new utility 'make_keys' to compute keys.tries as a table rather than a series of function calls. + correct include-dependency for tic.h used by name_match + removed buffer-allocation for name and description from m_item_new.c, since this might result in incompatibilities with SVr4. Also fixed the corresponding Ada95 binding module (patch by Juergen Pfeifer, report by Avery Pennarun <apenwarr@foxnet.net>) + removed the mechanism to timestamp the generated Ada95 sources. This resulted always in generating patches for the HTML doc, even when nothing really changed (patch by Juergen Pfeifer). + improve man page mitem_new.3x (patch by Juergen Pfeifer). 970614 + remove ech capability from rxvt description because it does not work. + add missing case logic for infocmp -I option (reported by Lorenzo M. Catucci <lorenzo@argon.roma2.infn.it>) + correct old bug in pnoutrefresh() unmasked by fix in 970531; this caused glitches in the ncurses 'p' test since the area outside the pad was not compared when setting up indices for _nc_scroll_optimize. + rewrote tracebits() to workaround misdefinition of TOSTOP on Ultrix 4.4, as well as to eliminate fixed-size buffer (reported by Chris Tanner <tannerc@aecl.ca>) + correct prototype for termattrs() as per XPG4 version 2. + add placeholder prototypes for color_set(), erasewchar(), term_attrs(), wcolor_set() as per XPG4 version 2. + correct attribution for progs/progs.priv.h and lib_twait.c + improve line-breakout logic by checking based on changed lines rather than total lines (patch by Alexander V. Lukyanov). + correct loop limits for table-lookup of enumerated value in form (patch by Juergen Pfeifer). + improve threshhold computation for determining when to call ClrToEOL (patch by Alexander V. Lukyanov). 970531 + add configure option --disable-database to force the library to use only the fallback data. + add configure option --with-fallbacks, to specify list of fallback terminal descriptions. + add a symbolic link for ncurses.h during install; too many programs still assume there's an ncurses.h + add new terminfo.src entry for xterm-xf86-v33. + restore terminfo.src entry for emu to using setf/setb, since it is not, after all, generating ANSI sequences. Corrected missing comma that caused setf/setb entries to merge. + modify mousemask() to use keyok() to enable/disable KEY_MOUSE, so that applications can disable ncurses' mouse and supply their own handler. + add extensions keyok() and define_key(). These are designed to allow the user's application better control over the use of function keys, e.g., disabling the ncurses KEY_MOUSE. (The define_key idea was from a mailing-list thread started by Kenneth Albanowski <kjahds@kjahds.com> Nov'1995). + restore original behavior in ncurses 'g' test, i.e., explicitly set the keypad mode rather than use the default, since it confuses people. + rewrote the newdemo banner so it's readable (reported by Hugh Daniel). + tidy up exit from hashtest (reported by Hugh Daniel). + restore check for ^Q in ncurses 'g' test broken in 970510 (reported by Hugh Daniel) + correct tput program, checking return-value of setupterm (patch by Florian La Roche). + correct logic in pnoutrefresh() and pechochar() functions (reported by Kriang Lerdsuwanakij <lerdsuwa@scf.usc.edu>). The computation of 'wide' date to eric's #283 (1.9.9), and the pechochar bug to the original implementation (1.9.6). + correct typo in vt102-w terminfo.src entry (patch by Robert Wuest <rwuest@sire.vt.com>) + move calls of _nc_background() out of various loops, as its return value will be the same for the whole window being operated on (patch by J T Conklin). + add macros getcur[xy] getbeg[xy] getpar[xy], which are defined in SVr4 headers (patch by J T Conklin <jtc@NetBSD.ORG>) + modify glibc addon-configure scripts (patch by H.J.Lu). + correct a bug in hashmap.c: the size used for clearing the hashmap table was incorrect, causing stack corruption for large values of LINES, e.g., >MAXLINES/2 (patch by Alexander V. Lukyanov). + eric's terminfo 9.13.23 & 9.13.24 changes: replaced minitel-2 entry, added MGR, ansi-nt (note: the changes described for 9.13.24 have not been applied). > several changes by Juergen Pfeifer: + correct a missing error-return in form_driver.c when wrapping of a field is not possible. + correct logic in form_driver.c for configurations that do not have memccpy() (reported by Sidik Isani <isani@cfht.hawaii.edu>) + change several c++ binding functions to inline. + modify c++ menu binding to inherit from panels, for proper initialization. + correct freeing of menu items in c++ binding. + modify c++ binding to reflect removal of const from user data pointer in forms/menus libraries. 970524 + add description of xterm-16color. + modify name of shared-library on *BSD to end with $(REL_VERSION) rather than $(ABI_VERSION) to match actual convention on FreeBSD (cf: 960713). + add OpenBSD to shared-library case, same as NetBSD and FreeBSD (reported by Hugh Daniel <hugh@rat.toad.com>). + corrected include-dependency in menu/Makefile so that "make install" works properly w/o first doing "make". + add fallback definition for isascii, used in infocmp. + modify xmas to use color, and to exit right away when a key is pressed. + modify gdc so that the scrolled digits function as described (there was no time delay between the stages, and the digits overwrote the bounding box without tidying up). + modify lib_color.c to use setaf/setab only for the ANSI color codes 0 through 7. Using 16 colors requires setf/setb. + modify ncurses 'c' test to work with 16 colors, as well as the normal 8 colors. + remove const qualifier from user data pointer in forms and menus libraries (patch by Juergen Pfeifer). + rewrote 'waddchnstr()' to avoid using the _nc_waddch_nosync() function, thereby not interpreting tabs, etc., as per spec (patch by Alexander V. Lukyanov). 970517 + suppress check for pre-existing ncurses header if the --prefix option is specified. + add configure options "--with-system-type" and "--with-system-release" to assist in checking the generated makefiles. + add configure option "--enable-rpath" to allow installers to specify that programs linked against shared libraries will have their library path embedded, allowing installs into nonstandard locations. + add flags to OSF1 shared-library options to specify version and symbol file (patch by Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>) + add missing definition for ABI_VERSION to c++/Makefile.in (reported by Satoshi Adachi <adachi@wisdom.aa.ap.titech.ac.jp>). + modify link flags to accommodate HP-UX linker which embeds absolute pathnames in executables linked against shared libraries (reported by Jason Evans <jasone@mrc.uidaho.edu>, solved by Alan Shutko <ats@hubert.wustl.edu>). + drop unnecessary check for attribute-change in onscreen_mvcur() since mvcur() is the only caller within the library, and that check in turn is exercised only from lib_doupdate.c (patch by Alexander V. Lukyanov). + add 'blank' parameter to _nc_scroll_window() so _nc_mvcur_scrolln() can use the background of stdscr as a parameter to that function (patch by Alexander V. Lukyanov). + moved _nc_mvcur_scrolln() from lib_mvcur.c to lib_doupdate.c, to use the latter's internal functions, as well as to eliminate unnecessary cursor save/restore operations (patch by Alexander V. Lukyanov). + omit parameter of ClrUpdate(), since it is called only for newscr, further optimized/reduced by using ClearScreen() and TransformLine() to get rid of duplicate code (patch by Alexander V. Lukyanov). + modify scrolling algorithm in _nc_scroll_optimize() to reject hunks that are smaller than the distance to be moved (patch by Alexander V. Lukyanov). + correct a place where the panel library was not ifdef'd in ncurses.c (Juergen Pfeifer) + documentation fixes (Juergen Pfeifer) 970515 4.1 release for upload to prep.ai.mit.edu + re-tag changes since 970505 as 4.1 release. 970510 + modify ncurses 'g' test to allow mouse input + modify default xterm description to include mouse. + modify configure script to add -Wwrite-strings if gcc warnings are enabled while configuring --enable-const (and fixed related warnings). + add toggle, status display for keypad mode to ncurses 'g' test to verify that keypad and scrollok are not inherited from parent window during a call to newwin. + correction to MKexpanded.sh to make it work when configure --srcdir is used (reported by H.J.Lu). + revise test for bool-type, ensuring that it checks if builtin.h is available before including it, adding test for sizeof(bool) equal to sizeof(short), and warning user if the size cannot be determined (reported by Alexander V. Lukyanov). + add files to support configuration of ncurses as an add-on library for GNU libc (patch by H.J.Lu <hjl@lucon.org>) 970506 + correct buffer overrun in lib_traceatr.c + modify change to lib_vidattr.c to avoid redundant orig_pair. + turn on 'echo()' in hanoi.c, since it is initially off. + rename local 'errno' variable in etip.h to avoid conflict with global (H.J.Lu). + modify configure script to cache LD, AR, AR_OPTS (patch by H.J.Lu <hjl@lucon.org>) 970505 4.1 pre-release + regenerate the misc directory html dumps without the link list, which is not useful. + correct dependency in form directory makefile which caused unnecessary recompiles. + correct substitution for ABI_VERSION in test-makefile + modify install rules for shared-library targets to remove the target before installing, since some install programs do not properly handle overwrite of symbolic links. + change order of top-level targets so that 'include' immediate precedes the 'ncurses' directory, reducing the time between new headers and new libraries (requested by Larry Virden). + modify lib_vidattr.c so that colors are turned off only before modifying other attributes, turned on after others. This makes the hanoi.c program display correctly on FreeBSD console. + modify debug code in panel library to print user-data addresses rather than the strings which they (may) point to. + add check to ensure that C++ binding and demo are not built with g++ versions below 2.7, since the binding uses templates. + modify c++ binding and demo to build and run with SGI's c++ compiler. (It also compiles with the Sun SparcWorks compiler, but the demo does not link, due to a vtbl problem). + corrections to demo.cc, to fix out-of-scope variables (Juergen Pfeifer). 970503 + correct memory leak in _nc_trace_buf(). + add configure test for regexpr.h, for Unixware 1.x. + correct missing "./" prefixing names of generated files in ncurses directory. + use single-quotes in configure scripts assignments for MK_SHARED_LIB to workaround shell bug on FreeBSD 2.1.5 + remove tabs from intermediate #define's for GCC_PRINTF, GCC_SCANF that caused incorrect result in ncurses_cfg.h + correct initialization in lib_trace.c, which omitted version info. + remove ech, el1 attributes from cons25w description; they appear to malfunction in FreeBSD 2.1.5 + correct color attributes in terminfo.src and lib_color.c to match SVr4 behavior by interchanging codes 1,4, 3,6 in the setf/setb capabilities. + use curs_set() rather than checks via tigetstr() for test programs that hide the cursor: firework, rain, worm. + ensure that if the terminal lacks change_scroll_region, parm_index and parm_rindex are used only to scroll the whole screen (patch by Peter Wemm). + correct curs_set() logic, which did not return ERR if the requested attributes did not exist, nor did it assume an unknown initial state for the cursor (patch by Alexander V. Lukyanov). + combine IDcTransformLine and NoIDcTransformLine to new TransformLine function in lib_doupdate.c (patch by Alexander V. Lukyanov). + correct hashmap.c, which did not update index information (patch by Alexander V. Lukyanov). + fixes for C++ binding and demo (see c++/NEWS) (Juergen Pfeifer). + correct index in lib_instr.c (Juergen Pfeifer). + correct typo in 970426 patch from Tom's cleanup of lib_overlay.c (patch by Juergen Pfeifer). 970426 + corrected cost computation in PutRange(), which was using milliseconds compared to characters by adding two new members to the SCREEN struct, _hpa_ch_cost and _cup_ch_cost. + drop ncurses/lib_unctrl.c, add ncurses/MKunctrl.awk to generate a const array of strings (suggested by Alexander V. Lukyanov). The original suggestion in 970118 used a perl script. + rewrote ncurses 'b' test to better exercise magic-cookie (xmc), as well as noting the attributes that are not supported by a terminal. + trace the computation of cost values in lib_mvcur.c + modify _nc_visbuf() to use octal rather than hex, corrected sign extension bug in that function that caused buffer overflow. + modify trace in lib_acs.c to use _nc_visbuf(). + suppress trace within _traceattr2(). + correct logic of _tracechtype2(), which did not account for repeats or redefinition within an acsc string. + modify debug-library version baudrate() to use environment variable $BAUDRATE to override speed computation. This is needed for regression testing. + correct problems shown by "weblint -pedantic". + update mailing-list information (now ncurses@bsdi.com). 970419 + Improve form_field_validation.3x manpage to better describe the precision parameter for TYPE_NUMERIC and TYPE_INTEGER. Provide more precise information how the range checking can be avoided. (patch by Juergen Pfeifer, reported by Bryan Henderson) + change type of min/max value of form types TYPE_INTEGER to long to match SVr4 documentation. + set the form window to stdscr in set_form_win() so that form_win() won't return null (patch by Juergen Pfeifer, reported by Bryan Henderson <bryanh@giraffe.netgate.net>). 970412 + corrected ifdef'ing of inline (cf: 970321) for TRACE vs C++. + corrected toggle_attr_off() macro (patch by Andries Brouwer). + modify treatment of empty token in $MANPATH to /usr/man (reported by <Andries.Brouwer@cwi.nl>) + modify traces that record functions-called so that chtype and attr_t values are expressed symbolically, to simplify reuse of generated test-scripts on SVr4 regression testing. + add new trace functions _traceattr2() and _tracechtype2() 970405 + add configure option --enable-const, to support the use of 'const' where XSI should have, but did not, specify. This defines NCURSES_CONST, which is an empty token otherwise, for strict compatibility. + make processing of configure options more verbose by echoing the --enable/--with values. + add configure option --enable-big-core + set initial state of software echo off as per XSI. + check for C++ builtin.h header + correct computation of absolute-path for $INSTALL that dropped "-c" parameter from the expression. + rename config.h to ncurses_cfg.h to avoid naming-conflict when ncurses is integrated into larger systems (adapted from diffs by H.J.Lu for libc). + correct inequality in lib_doupdate.c that caused a single-char to not be updated when the char on the right-margin was not blank, idcok() was true (patch by Alexander V Lukyanov (in 970124), reported by Kriang Lerdsuwanakij <lerdsuwa@scf-fs.usc.edu> in 970329). + modify 'clean' rule in include/Makefile so that files created by configure script are removed in 'distclean' rule instead. 970328 + correct array limit in tparam_internal(), add case to interpret "%x" (patch by Andreas Schwab) + rewrote number-parsing in ncurses.c 'd' test; it did not reset the value properly when non-numeric characters were given (reported by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>) 970321 + move definition of __INTERNAL_CAPS_VISIBLE before include for progs.priv.h (patch by David MacKenzie). + add configuration summary, reordered check for default include directory to better accommodate a case where installer is configuring a second copy of ncurses (reported by Klaus Weide <kweide@tezcat.com>) + moved the #define for 'inline' as an empty token from the $(CFLAGS_DEBUG) symbol into config.h, to avoid redefinition warning (reported by Ward Horner). + modify test for bool builtin type to use 'unsigned' rather than 'unknown' when cross-compiling (reported by Ward Horner). 970315 + add header dependencies so that "make install.libs" will succeed even if "make all" is not done first. + moved some macros from lib_doupdate.c to curses.priv.h to use in expanded functions with ATAC. + correct implementation of lib_instr.c; both XSI and SVr4 agree that the winnstr functions can return more characters than will fit on one line. 970308 + modify script that generates lib_gen.c to support traces of called & return. + add new configure option "--disable-macros", for testing calls within lib_gen.c + corrected logic that screens level-checking of called/return traces. 970301 + use new configure macro NC_SUBST to replace AC_PATH_PROG, better addressing request by Ward Horner. + check for cross-compiling before trying to invoke the autoconf AC_FUNC_SETVBUF_REVERSED macro (reported by Ward Horner) + correct/simplify loop in _nc_visbuf(), 970201 changes omitted a pointer-increment. + eliminate obsolete symbol SHARED_ABI from dist.mk (noted by Florian La Roche). 970215 + add configure option --enable-expanded, together with code that implements an expanded form of certain complex macros, for testing with ATAC. + disable CHECK_POSITION unless --with-assertions is configured (Alexander V Lukyanov pointed out that this is redundant). + use keyname() to show traced chtype values where applicable rather than _tracechar(), which truncates the value to 8-bits. + minor fixes to TRACE_ICALLS, added T_CREATE, TRACE_CCALLS macros. + modify makefiles in progs and test directories to avoid using C preprocessor options on link commands (reported by Ward Horner) + correct ifdef/include-order for nc_alloc.h vs lib_freeall.c (reported by Ward Horner) + modify ifdef's to use configure-defined symbols consistently (reported by Ward Horner) + add/use new makefile symbols AR, AR_OPTS and LD to assist in non-UNIX ports (reported by Ward Horner <whorner@tsi-telsys.com>) + rename struct try to struct tries, to avoid name conflict with C++ (reported by Gary Johnson). + modify worm.c to hide cursor while running. + add -Wcast-qual to gcc warnings, fix accordingly. + use PutChar rather than PutAttrChar in ClrToEOL to properly handle wrapping (Alexander V Lukyanov). + correct spurious echoing of input in hanoi.c from eric's #291 & #292 patches (reported by Vernon C. Hoxie <vern@zebra.alphacdc.com>). + extend IRIX configuration to IRIX64 + supply missing install.libs rule needed after restructuring test/Makefile.in 970208 + modify "make mostlyclean" to leave automatically-generated source in the ncurses directory, for use in cross-compiles. + autogenerated object-dependencies for test directory + add configure option --with-rcs-ids + modify configuration scripts to generate major/minor/patch versions (suggested by Alexander V Lukyanov). + supply missing va_end's in lib_scanw.c + use stream I/O for trace-output, to eliminate fixed-size buffer + add TRACE_ICALLS definition/support to lib_trace.c + modify Ada95 binding to work with GNAT 3.09 (Juergen Pfeifer). 970201 + add/modify traces for called/return values to simplify extraction for test scripts. + changed _nc_visbuf to quote its result, and to dynamically allocate the returned buffer. + invoke ldconfig after installing shared library + modify install so that overwrite applies to shared library -lcurses in preference to static library (reported by Zeyd M Ben-Halim 960928). + correct missing ';' in 961221 mod to overwrite optional use of $(LN_S) symbol. + fixes to allow "make install" to work without first doing a "make all" (suggested by Larry Virden). 970125 + correct order of #ifdef for TABS_OK. + instrumented toe.c to test memory-leaks. + correct memory-deallocation in toe.c (patch by Jesse Thilo). + include <sys/types.h> in configuration test for regex.h (patch by Andreas Schwab) + make infocmp recognize -I option, for SVr4 compatibility (reported by Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>) 970118 + add extension 'use_default_colors()', modified test applications that use default background (firework, gdc, hanoi, knight, worm) to demonstrate. + correct some limit checks in lib_doupdate.c exposed while running worm. + use typeCalloc macro for readability. + add/use definition for CONST to accommodate testing with Solaris (SVr4) curses, which doesn't use 'const' in its prototypes. + modify ifdef's in test/hashtest.c and test/view.c to compile with Solaris curses. + modify _tracedump() to pad pad colors & attrs lines to match change in 970101 showing first/last changes. + corrected location of terminating null on dynamically allocated forms fields (patch by Per Foreby). 970111 + added headers to make view.c compile on SCO with the resizeterm() code (i.e., struct winsize) - though this compiles, I don't have a suitable test configuration since SIGWINCH doesn't pass my network to that machine - T.Dickey. + update test/configure.in to supply some default substitutions. + modify configure script to add -lncurses after -lgpm to fix problem linking against static libraries. + add a missing noraw() to test/ncurses.c (places noted by Jeremy Buhler) + add a missing wclear() to test/testcurs.c (patch by Jeremy Buhler <jbuhler@cs.washington.edu>) + modify headers to accommodate compilers that don't allow duplicate "#define" lines for NCURSES_VERSION (reported by Larry W. Virden <lvirden@cas.org>) + fix formatting glitch in curs_getch.3x (patch by Jesse Thilo). + modify lib_doupdate to make el, el1 and ed optimization use the can_clear_with macro, and change EmitRange to allow leaving cursor at the middle of interval, rather than always at the end (patch by Alexander V Lukyanov). This was originally 960929, resync 970106. 970104 + workaround defect in autoconf 2.12 (which terminates configuration if no C++ compiler is found) by adding an option --without-cxx. + modify several man-pages to use tbl, where .nf/.fi was used (reported by Jesse Thilo). + correct font-codes in some man-pages (patch by Jesse Thilo <Jesse.Thilo@pobox.com>) + use configure script's knowledge of existence of g++ library for the c++ Makefile (reported by Paul Jackson). + correct misleading description of --datadir configuration option (reported by Paul Jackson <pj@sam.engr.sgi.com>) 970101 + several corrections to _nc_mvcur_scrolln(), prompted by a bug report from Peter Wemm: > the logic for non_dest_scroll_region was interchanged between the forward & reverse scrolling cases. > multiple returns from the function allowed certain conditions to do part of an operation before discovering that it couldn't be completed, returning an error without restoring the cursor. > some returns were ERR, where the function had completed the operation, because the insert/delete line logic was improperly tested (this was probably the case Peter saw). > contrary to comments, some scrolling cases were tested after the insert/delete line method. + modify _tracedump() to show first/last changes. + modify param of ClrUpdate() in lib_doupdate.c to 'newscr', fixes refresh problem (reported by Peter Wemm) that caused nvi to not show result of ":r !ls" until a ^L was typed. 961229 (internal alpha) + correct some of the writable-strings warnings (reported by Gary Johnson <gjohnson@season.com>). Note that most of the remaining ones are part of the XSI specification, and can't be "fixed". + improve include-dependencies in form, menu, panel directories. + correct logic of delay_output(), which would return early if there is data on stdin. + modify interface & logic of _nc_timed_wait() to support 2 file descriptors, needed for GPM. + integrate patch by Andrew Kuchling <amk@magnet.com> for GPM (mouse) support, correcting logic in wgetch() and _nc_mouse_parse() which prevented patch from working properly -TD + improve performance of panel algorithm (Juergen Pfeifer 961203). + strip RCS id's from generated .html files in Ada95 subtree. + resync with generated .html files (Juergen Pfeifer 961223). + terminfo.src 10.1.0 (ESR). 961224 4.0 release + release as 4.0 to accommodate Linux ld.so.1.8.5 + correct syntax/spelling, regenerated .doc files from .html using lynx 2.5 + refined forms/menus makefiles (Juergen Pfeifer 961223). 961221 - snapshot + remove logic in read_entry.c that attempts to refine errno by using 'access()' for the directory (from patch by Florian La Roche). + correct configure test/substitution that inhibits generating include-path to /usr/include if gcc is used (reported by Florian La Roche). + modify setupterm() to allocate new TERMINAL for each call, just as solaris' curses does (Alexander V Lukyanov 960829). + corrected memory leaks in read_entry.c + add configure options --with-dbmalloc, --with-dmalloc, and --disable-leaks, tested by instrumenting infocmp, ncurses programs. + move #include's for stdlib.h and string.h to *.priv.h to accommodate use of dbmalloc. + modify use of $(LN_S) to follow recommendation in autoconf 2.12, i.e., set current directory before linking. + split-out panel.priv.h, improve dependencies for forms, menus (Juergen Pfeifer 961204). + modify _nc_freewin() to reset globals curscr/newscr/stdscr when freeing the corresponding WINDOW (found using Purify). + modify delwin() to return ERR if the window to be deleted has subwindows, needed as a side-effect of resizeterm() (found using Purify). Tested and found that SVr4 curses behaves this way. + implement logic for _nc_freeall(), bringing stub up to date. 961215 + modify wbkgd() so that it doesn't set nulls in the rendered text, even if its argument doesn't specify a character (fixes test case by Juergen Pfeifer for bug-report). + set window-attributes in wbkgd(), to simplify comparison against Solaris curses, which does this. 961214 - snapshot + replace most constants in ncurses 'o' test by expressions, making it work with wider range of screen sizes. + add options to ncurses.c to specify 'e' test softkey format, and the number of header/footer lines to rip-off. + add ^R (repaint after resize), ^L (refresh) commands to ncurses 'p' test. + add shell-out (!) command to ncurses 'p' test to allow test of resize between endwin/refresh. + correct line-wrap case in mvcur() by emitting carriage return, overlooked in 960928, but needed due to SVr4 compatibility changes to terminal modes in 960907. + correct logic in wresize that causes new lines to be allocated, broken for the special case of increasing rows only in 960907's fix for subwindows. + modify configure script to generate $(LDFLAGS) with -L and -l options in preference to explicit library filenames. (NOTE: this may require further amending, since I vaguely recall a dynamic loader that did not work properly without the full names, but it should be handled as an exception to the rule, since some linkers do bulk inclusion of libraries when given the full name - T.Dickey). + modify configure script to allow user-supplied $CFLAGS to set the debug-option in all libraries (requested by lots of people) -TD + use return consistently from main(), rather than exit (reported by Florian La Roche). + add --enable-getcap-cache option to configure, normally disabled (requested by Florian La Roche). + make configure test for gettimeofday() and possibly -lbsd more efficient (requested by Florian La Roche <florian@knorke.saar.de>) + minor adjustments to Ada95 binding (patches by Juergen Pfeifer) + correct attributes after emitting orig_pair in lib_vidattr.c (patch by Alexander V Lukyanov). 961208 + corrected README wrt Ada95 (Juergen Pfeifer) 961207 - snapshot + integrate resizeterm() into doupdate(), so that if screen size changes between endwin/refresh, ncurses will resize windows to fit (this needs additional testing with pads and softkeys). + add, for memory-leak testing, _nc_freeall() entrypoint to free all data used in ncurses library. + initialize _nc_idcok, _nc_idlok statically to resolve discrepancy between initscr() and newwin() initialization (reported by Alexander V Lukyanov). + test built VERSION=4.0, SHARED_ABI=4 with Linux ld.so.1.8.5 (set beta versions to those values -- NOTE that subsequent pre-4.0 beta may not be interchangeable). + modify configure script to work with autoconf 2.12 961130 1.9.9g release + add copyright notices to configuration scripts (written by Thomas Dickey). 961127 > patch, mostly for panel (Juergen Pfeifer): + cosmetic improvement for a few routines in the ncurses core library to avoid warning messages. + the panel overlap detection was broken + the panel_window() function was not fool-proof. + Some inlining... + Cosmetic changes (also to avoid warning messages when compiling with -DTRACE). 961126 > patch by Juergen Pfeifer: + eliminates warning messages for the compile of libform. + inserts Per Foreby's new field type TYPE_IPV4 into libform. + Updates man page and the Ada95 binding to reflect this. + Improves inlining in libmenu and libform. 961120 + improve the use of the "const" qualifier in the panel library (Juergen Pfeifer) + change set_panel_userptr() and panel_userptr() to use void* (Juergen Pfeifer) 961119 + change ABI to 3.4 + package with 961119 version of Ada95 binding (fixes for gnat-3.07). (Juergen Pfeifer) + correct initialization of the stdscr pseudo panel in panel library (Juergen Pfeifer) + use MODULE_ID (rcs keywords) in forms and menus libraries (Juergen Pfeifer). > patch #324 (ESR): + typo in curs_termcap man page (reported by Hendrik Reichel <106065.2344@compuserve.com>) + change default xterm entry to xterm-r6. + add entry for color_xterm 961116 - snapshot + lint found several functions that had only #define implementations (e.g., attr_off), modified curses.h.in to generate them as per XSI Curses requirement that every macro be available as a function. + add check in infocmp.c to guard against string compare of CANCELLED_STRING values. + modify firework.c, rain.c to hide cursor while running. + correct missing va_end in lib_tparm.c + modify hanoi.c to work on non-color terminals, and to use timing delays when in autoplay mode. + correct 'echochar()' to refresh immediately (reported by Adrian Garside <94ajg2@eng.cam.ac.uk>) > patch #322 (ESR): + reorganize terminfo.src entries for xterm. 961109 - snapshot + corrected error in line-breakout logic (lib_doupdate.c) + modified newdemo to use wgetch(win) rather than getch() to eliminate a spurious clear-screen. + corrected ifdef's for 'poll()' configuration. + added modules to ncurses, form, menu for Ada95 binding (Juergen Pfeifer). + modify set_field_buffer() to allow assignment of string longer than the initial buffer length, and to return the complete string rather than only the initial size (Juergen Pfeifer and Per Foreby <perf@efd.lth.se>). 961102 - snapshot + configure for 'poll()' in preference to 'select()', since older systems are more likely to have a broken 'select()'. + modified render_char() to avoid OR'ing colors. + minor fixes to testcurs.c, newdemo.c test programs: ifdef'd out the resize test, use wbkgd and corrected box() parameters. + make flushinp() test work in ncurses.c by using napms() instead of sleep(). + undo ESR's changes to xterm-x11r6 (it no longer matched the X11R6.1 distribution, as stated) + terminfo 9.13.18 resync (ESR) + check for getenv("HOME") returning null (ESR). + change buffer used to decode xterm-mouse commands to unsigned to handle displays wider than 128 chars (Juergen Pfeifer). + correct typo curs_outopts.3x (Juergen Pfeifer). + correct limit-checking in wenclose() (Juergen Pfeifer). + correction to Peter Wemm's newwin change (Thomas Fehr <fehr@suse.de>). + corrections to logic that combines colors and attributes; they must not be OR'd (Juergen Pfeifer, extending from report/patch by Rick Marshall). 961026 - snapshot + reset flags in 'getwin()' that might cause refresh to attempt to manipulate the non-existent parent of a window that is read from a file (lib_screen.c). + restructure _nc_timed_wait() to log more information, and to try to recover from badly-behaved 'select()' calls (still testing this). + move define for GOOD_SELECT into configure script. + corrected extra '\' character inserted before ',' in comp_scan.c + corrected expansion of %-format characters in dump_entry.c; some were rendered as octal constants. + modify dump_entry.c to make terminfo output more readable and like SVr4, by using "\s" for spaces (leading/trailing only), "\," for comma, "\^" and "\:" as well. + corrected some memory leaks in ncurses.c, and a minor logic error in the top-level command-parser. + correction for label format 4 (PC style with info line), a slk_clear(), slk_restore() sequence didn't redraw the info line (Juergen Pfeifer). + modified the slk window (if simulated) to inherit the background and default character attributes from stdscr (Juergen Pfeifer). + corrected limit-check in set_top_row (Juergen Pfeifer). 961019 - snapshot + correct loop-limit in wnoutrefresh(), bug exposed during pipe-testing had '.lastchar' entry one beyond '._maxx'. + modify ncurses test-program to work with data piped to it. + corrected pathname computation in run_tic.sh, removing extra "../" (reported by Tim Mooney). + modified configure script to use previous install's location for curses.h + added NetBSD and FreeBSD to platforms that use --prefix=/usr as a default. 961013 + revised xterm terminfo descriptions to reflect the several versions that are available. + corrected a pointer reference in dump_entry.c that didn't test if the pointer was -1. 961005 - snapshot + correct _nc_mvcur_scrolln for terminals w/o scrolling region. + add -x option to hashtest to control whether it allows writes to the lower-right corner. + ifdef'd (NCURSES_TEST) the logic for _nc_optimize_enable to make it simpler to construct tests (for double-check of _nc_hash_map tests). + correct ifdef's for c++ in curses.h + change default xterm type to xterm-x11r6. + correct quoting in configure that made man-pages installed with $datadir instead of actual terminfo path. + correct whitespace in include/Caps, which caused kf11, clr_eol and clr_end to be omitted from terminfo.5 + fix memory leaks in delscreen() (adapted from Alexander V Lukyanov). + improve appearance of marker in multi-selection menu (Juergen Pfeifer) + fix behavior for forms with all fields inactive (Juergen Pfeifer) + document 'field_index()' (Juergen Pfeifer) > patch #321 (ESR): + add some more XENIX keycap translations to include/Caps. + modify newwin to set initial state of each line to 'touched' (from patch by Peter Wemm <peter@spinner.dialix.com>) + in SET_TTY, replace TCSANOW with TCSADRAIN (Alexander V Lukyanov). 960928 - snapshot + ifdef'd out _nc_hash_map (still slower) + add graphic characters to vt52 description. + use PutAttrChar in ClrToEOL to ensure proper background, position. + simplify/correct logic in 'mvcur()' that does wrapping; it was updating the position w/o actually moving the cursor, which broke relative moves. + ensure that 'doupdate()' sets the .oldindex values back to a sane state; this was causing a spurious refresh in ncurses 'r'. + add logic to configure (from vile) to guard against builders who don't remove config.cache & config.status when doing new builds -TD + corrected logic for 'repeat_char' in EmitRange (cf: eric #317), which did not follow the 2-parameter scheme specified in XSI. + corrected logic of wrefresh, wnoutrefresh broken in #319, making clearok work properly (report by Michael Elkins). + corrected problem with endwin introduced by #314 (removing the scrolling-region reset) that broke ncurses.c tests. + corrected order of args in AC_CHECK_LIB (from report by Ami Fischman <fischman@math.ucla.edu>). + corrected formatting of terminfo.5 tables (Juergen Ehling) > patch 320 (ESR): + change ABI to 3.3 + emit a carriage-return in 'endwin()' to workaround a kernel bug in BSDI. (requested by Mike Karels <karels@redrock.bsdi.com>) + reverse the default o configure --enable-termcap (consensus). > patch 319 (ESR): + modified logic for clearok and related functions (from report by Michael Elkins) - untested > patch 318 (ESR): + correction to #317. > patch 317 (ESR): + re-add _nc_hash_map + modify EmitRange to maintain position as per original design. + add hashtest.c, program to time the hashmap optimization. > patch 316 (ESR): + add logic to deal with magic-cookie (how was this tested?) (lib_doupdate.c). + add ncurses.c driver for magic-cookie, some fixes to ncurses.c > patch 315 (ESR): + merged Alexander V Lukyanov's patch to use ech and rep - untested (lib_doupdate.c). + modified handling of interrupted system calls - untested (lib_getch.c, lib_twait.c). + new function _nc_mvcur_resume() + fix return value for 'overlay()', 'overwrite()' 960914 - snapshot + implement subwindow-logic in wresize, minor fixes to ncurses 'g' test. + corrected bracketing of fallback.c (reported/suggested fix by Juergen Ehling <eh@eclipse.aball.de>). + update xterm-color to reflect XFree86 3.1.3G release. + correct broken dtterm description from #314 patch (e.g., spurious newline. The 'pairs' change might work, but no one's tested it either ;-) + clarify the documentation for the builtin form fieldtypes (Juergen Pfeifer) > patch 314 (ESR): + reset scroll region on startup rather than at wrapup time (enhancement suggested by Alexander V Lukyanov). + make storage of palette tables and their size counts per-screen for multi-terminal applications (suggested by Alexander V Lukyanov). + Improved error reporting for infotocap translation errors. + Update terminfo.src to 9.13.14. 960907 - snapshot + rewrote wgetstr to make it erase control chars and also fix bogus use of _nc_outstr which caused the display to not wrap properly (display problem reported by John M. Flinchbaugh <glynis@netrax.net>) + modify ncurses 'f' test to accommodate terminal responses to C1 codes (and split up this screen to accommodate non-ANSI terminals). + test enter_insert_mode and exit_insert_mode in has_ic(). + removed bogus logic in mvcur that assumes nl/nonl set output modes (XSI says they are input modes; SVr4 implements this). + added macros SET_TTY, GET_TTY to term.h + correct getstr() logic that altered terminal modes w/o restoring. + disable ICRNL, etc., during initialization to match SVr4, removing the corresponding logic from raw, cbreak, etc. + disable ONLCR during initialization, to match SVr4 (this is needed for cursor optimization when the cursor-down is a newline). + replaced ESR's imitation of wresize with my original (his didn't work). 960831 - snapshot + memory leaks (Alexander V. Lukyanov). + modified pnoutrefresh() to be more tolerant of too-large screen size (reported by Michael Elkins). + correct handling of terminfo files with no strings (Philippe De Muyter) + correct "tic -s" to take into account -I, -C options. + modify ncurses 'f' test to not print codes 80 through 9F, since they are considered control codes by ANSI terminals. 960824 - snapshot + correct speed variable-type in 'tgetent()' (reported by Peter Wemm) + make "--enable-getcap" configuration-option work (reported by Peter Wemm <peter@spinner.DIALix.COM>) 960820 + correct err in 960817 that changed return-value of tigetflag() (reported by Alexander V. Lukyanov). + modify infocmp to use library default search-path for terminfo directory (Alexander V. Lukyanov). 960817 - snapshot + corrected an err in mvcur that broke resizing-behavior. + correct fall-thru behavior of _nc_read_entry(), which was not finding descriptions that existed in directories past the first one searched (reported by Alexander V. Lukyanov) + corrected typo in dtterm description. > patch 313 (ESR): + add dtterm description + clarify ncurses 'i' test (drop vscanf subtest) 960810 - snapshot + correct nl()/nonl() to work as per SVr4 & XSI. + minor fixes to ncurses.c (use 'noraw()', mvscanw return-code) + refine configure-test for -g option (Tim Mooney). + correct interaction between O_BLANK and NEW_LINE request in form library (Juergen Pfeifer) 960804 + revised fix to tparm; previous fix reversed parameter order. > patch 312 (ESR): correct terminfo.src corrupted by #310 > patch 311 (ESR): + fix idlok() and idcok() and the default of the idlok switch. 960803 - snapshot + corrected tparm to handle capability strings without explicit pop (reported by William P Setzer) + add fallback def for GCC_NORETURN, GCC_UNUSED for termcap users (reported by Tim Mooney). > patch 310 (ESR): + documentation and prototyping errors for has_color, immedok and idcok (reported by William P Setzer <wsetzer@pams.ncsu.edu>) + updated qnx terminfo entry (by Michael Hunter) 960730 + eliminate quoted includes in ncurses subdirectory, ensure config.h is included first. + newterm initializes terminal settings the same as initscr (reported by Tim Mooney). 960727 - snapshot + call cbreak() in initscr(), as per XSI & SVr4. + turn off hardware echo in initscr() as per XSI & SVr4 > patch 309 (ESR): + terminfo changes (9.3.10), from BRL + add more checks to terminfo parser. + add more symbols to infocmp. 960720 - snapshot + save previous-attribute in lib_vidattr.c if SP is null (reported by Juergen Fluk <louis@dachau.marco.de>) + corrected calls on _nc_render so that background character is set as per XSI. + corrected wbkgdset macro (XSI allows background character to be null), and tests that use it. + more corrections to terminfo (xterm & rxvt) + undid change to mcprint prototype (cannot use size_t in curses.h because not all systems declare it in the headers that we can safely include therein). + move the ifdefs for errno into curses.priv.h > patch 308 (ESR): + terminfo changes (9.3.8) + modified logic of error-reporting in terminfo parser 960713 - snapshot + always check for <sys/bsdtypes.h> since ISC needs it to declare fd_set (Juergen Pfeifer) + install shared-libraries on NetBSD/FreeBSD with ABI-version (reported by Juergen Pfeifer, Mike Long) + add LOCAL_LDFLAGS2 symbol (Juergen Pfeifer) + corrected prototype for delay_output() -- bump ABI to 3.2 + terminfo patches #306/307 (ESR). + moved logic that filters out rmul and rmso from setupterm to newterm where it is less likely to interfere with termcap applications. 960707 + rollback ESR's #305 change to terminfo.src (it breaks existing applications, e.g., 'less 290'). + correct path of edit_man.sh, and fix typo that made all man-pages preformatted. + restore man/menu_requestname.3x omitted in Zeyd's resync (oops). + auto-configure the GCC_PRINTFLIKE/GCC_SCANFLIKE macros (reported by Philippe De Muyter). 960706 - snapshot + (reported by David MacKenzie). + add/use gcc __attribute__ for printf and scanf in curses.h + added SGR attributes test-case to ncurses + revised ncurses 't' logic to show trace-disable effect in the menu. + use getopt in ncurses program to process -s and -t options. + make ncurses 'p' legend toggle with '?' + disable scrollok during the ncurses 'p' test; if it is enabled the stdscr will scroll when putting the box-corners in the lower-right of the screen. 960629 - snapshot + check return code of _nc_mvcur_scrolln() in _nc_scroll_optimize() for terminals with no scrolling-support (reported by Nikolay Shadrin <queen@qh.mirea.ac.ru>) + added ^S scrollok-toggle to ncurses 'g' test. + added ^T trace-toggle to ncurses tests. + modified ncurses test program to use ^Q or ESC consistently for terminating tests (rather than ^D), and to use control keys rather than function keys in 'g' test. + corrected misplaced wclrtoeol calls in addch to accommodate wrapping (reported by Philippe De Muyter). + modify lib_doupdate.c to use effective costs to tradeoff between delete-character/insert-character vs normal updating (reported by David MacKenzie). + compute effective costs for screen update operations (e.g., clr_eos, delete_character). + corrected error in knight.c exposed by wrap fixes in 960622; the msgwin needed scrollok set. + corrected last change to IDcTransformLine logic to avoid conflict between PutRange and InsStr + modified run_tic.sh to not use /usr/tmp (reported by David MacKenzie), and further revised it and aclocal.m4 to use $TMPDIR if set. + corrected off-by-one in RoomFor call in read_entry.c 960622 - snapshot + modified logic that wraps cursor in addch to follow the XSI spec, (implemented in SVr4) which states that the cursor position is updated when wrapping. Renamed _NEED_WRAP to _WRAPPED to reflect the actual semantics. + added -s option to tic, to provide better diagnostics in run_tic.sh + improved error-recovery for tabset install. + change ABI to 3.1 (dropped tparam, corrected getbkgd(), added _yoffset to WINDOW). + modified initialization of SP->_ofp so that init_acs() is called with the "right" file pointer (reported by Rick Marshall <rjm@nlc.net.au> + documentation fixes (Juergen Pfeifer). + corrected, using new SCREEN and WINDOW members, the behavior of ncurses if one uses ripoffline() to remove a line from the top of the screen (Juergen Pfeifer). + modified autoconf scripts to prepare for Ada95 (GNAT) binding to ncurses (Juergen Pfeifer). + incorrect buffer-size in _nc_read_entry, reported by ESR. 960617 + corrected two logic errors in read_entry.c, write_entry.c (called by tic, the write/read of terminfo entries used inconsistent rules for locating the entries; the $TERMINFO_DIRS code would find only the first entry in a list). + refined pathname computation in run_tic.sh and shlib. + corrected initialization of $IP in misc/run_tic.sh 960615 - snapshot + ifdef'd out _nc_hash_map() call because it does not improve speed. + display version of gcc if configure script identifies it. + modify configure script to use /usr as Linux's default prefix. + modify run_tic.sh to use shlib script, fixes some problems installing with a shared-library configuration. + adjusted configure script so that it doesn't run tests with the warnings turned on, which makes config.log hard to read. + added 'lint' rule to top-level Makefile. + added configure option '--with-install-prefix' for use by system builders to install into staging locations (requested by Charles Levert <charles@comm.polymtl.ca>). + corrected autoconfigure for Debian man program; it's not installed as "man_db". + set noecho in 'worm'; it was ifdef'd for debug only + updated test/configure.in for timing-display in ncurses 'p' test + corrected misspelled 'getbkgd()'. + corrected wbkgdset to work like observed syvr4 (sets A_CHARTEXT part to blank if no character given, copies attributes to window's attributes). + modified lib_doupdate.c to use lower-level SP's current_attr state instead of curscr's state, since it is redundant. + correction to IDcTransformLine logic which controls where InsStr is invoked (refined by Alexander V Lukyanov). > patch 303 (ESR): + conditionally include Chris Torek's hash function _nc_hash_map(). + better fix for nvi refresh-bug (Rick Marshall) + fix for bug in handling of interrupted keystroke waits, (Werner Fleck). 960601 - snapshot + auto-configure man-page compression-format and renames for Debian. + corrected several typos in curses.h.in (i.e., the mvXXXX macros). + re-order curses.priv.h for lint. + added rules for lintlib, lint + corrected ifdef for BROKEN_LINKER in MKnames.awk.in + corrected missing INSTALL_DATA in misc/Makefile.in + flush output when changing cursor-visibility (Rick Marshall) + fix a minor bug in the _nc_ripoff() routine and improve error checking when creating the label window (Juergen Pfeifer). + enhancement to the control over the new PC-style soft key format. allow caller now to select whether or not one wants to have the index-line; see curs_slk.3x for documentation (Juergen Pfeifer). + typos, don't use inline with -g (Philippe De Muyter) + fixes for menus & wattr-, slk-functions (Juergen Pfeifer) 960526 - snapshot + removed --with-ticdir option altogether, maintain compatibility with existing applications via symbolic link in run_tic.sh + patch for termio.h, signal (Philippe De Muyter) + auto-configure gcc warning options rather than infer from version. + auto-configure __attribute__ for different gcc versions. + corrected special use of clearok() in hardscroll.c by resetting flag in wrefresh(). + include stdlib.h before defs for EXIT_SUCCESS, for OSF/1. + include sys/types.h in case stdlib.h does not declare size_t. + fixes for makefile (Tim Mooney) + fixes for menus & forms (Juergen Pfeifer) 960518 - snapshot + revised ncurses.c panner test, let pad abut all 4 sides of screen. + refined case in lib_doupdate.c for ClrToEOL(). + corrected prior change for PutRange (Alexander V Lukyanov <lav@yars.free.net>). + autoconf mods (Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>). + locale fix for forms (Philippe De Muyter <phdemuyt@ulb.ac.be>) + renamed "--with-datadir" option to "--with-ticdir" to avoid confusion, and made this check for the /usr/lib/terminfo pre-existing directory. > patches 299-301 (ESR): + added hashmap.c + mods to tracing, especially for ACS chars. + corrected off-by-one in IDCtransform. + corrected intermittent mouse bug by using return-value from read(). + mods to parse_entry.c, for smarter defaults. 960512 + use getopt in 'tic'; added -L option and modified -e option to allow list from a file. 960511 + don't use fixed buffer-size in tparm(). + modified tic to create terminfo directory if it doesn't exist. + added -T options to tic and infocmp (for testing/analysis) + refined the length criteria for termcap and terminfo + optimize lib_doupdate with memcpy, PutRange > patches 297, 298 (ESR): + implement TERMINFO_DIRS, and -o option of tic + added TRACE_IEVENT +). + misc cursor & optimization fixes. 960504 - snapshot + modified ncurses 'p' test to allow full-screen range for panner size. + fixes for locale (Philippe De Muyter <phdm@labauto1.ulb.ac.be>) + don't use fixed buffer-size in fmt_entry(). + added usage-message to 'infocmp'. + modified install.includes rules to prepend subdirectory-name to "#include" if needed. 960430 + protect wrefresh, wnoutrefresh from invocation with pad argument. + corrected default CCFLAGS in test/Makefile. 960428 - snapshot + implemented logic to support terminals with background color erase (e.g., rxvt and the newer color xterm). + improved screen update logic (off-by-one logic error; use clr_eos if possible) 960426 - snapshot + change ncurses 'a' test to run in raw mode. + make TIOCGWINSZ configure test less stringent, in case user configures via terminal that cannot get screen size. > patches 295, 296 (ESR): + new "-e" option of tic. + fix for "infocmp -e". + restore working-directory in read_termcap.c + split lib_kernel.c, lib_setup.c and names.c in order to reduce overhead for programs that use only termcap features. 960406 + fixes for NeXT, ISC and HPUX auto-configure + autogenerate development header-dependencies (config.h, *.priv.h) + corrected single-column formatting of "use=" (e.g., in tic) + modify tic to read full terminfo-names + corrected divide-by-zero that caused hang (or worse) when redirecting output + modify tic to generate directories only as-needed (and corrected instance of use of data from function that had already returned). ### ncurses-1.9.8a -> 1.9.9e * fixed broken wsyncup()/wysncdown(), as a result wnoutrefresh() now has copy-changed-lines behavior. * added and documented wresize() function. * more fixes to LOWER-RIGHT corner handling. * changed the line-breakout optimization code to allow some lines to be emitted before the first check. * added option for tic to use symbolic instead of hard links (for AFS) * fix to restore auto-wrap mode. * trace level can be controlled by environment variable. * better handling of NULs in terminal descriptions. * improved compatibility with observed SVR4 behavior. * the refresh behavior of over-lapping windows is now more efficient and behaves like SVR4. * use autoconf 2.7, which results in a working setup for SCO 5.0. * support for ESCDELAY. * small fixes for menu/form code. * the test directory has its own configure. * fixes to pads when optimizing scrolling. * fixed several off-by-one bugs. * fixes for termcap->terminfo translation; less restrictions more correct behavior. ### ncurses-1.9.7 -> 1.9.8a * teach infocmp -i to recognize ECMA highlight sequences * infocmp now dumps all SVr4 termcaps (not just the SVr4 ones) on -C * support infocmp -RBSD. * satisfy XSI Curses requirement that every macro be available as a function. * This represents the last big change to the public interface of ncurses. The ABI_VERSION has now been set at 3.0 and should stay there barring any great catastrophies or acts of God. * The C++ has been cleaned up in reaction to the changes to satisfy XSI's requirements. * libncurses now gets linked to libcurses to help seamless emulation (replacement) of a vendor's curses. --disable-overwrite turns this behavior off. ### ncurses-1.9.6 -> 1.9.7 * corrected return values of setupterm() * Fixed some bugs in tput (it does padding now) * fixed a bug in tic that made it do the wrong thing on entries with more than one `use' capability. * corrected the screen-size calculation at startup time to alter the numeric capabilities as per SVr4, not just LINES and COLS. * toe(1) introduced; does what infocmp -T used to. * tic(1) can now translate AIX box1 and font[0123] capabilities. * tic uses much less core, the dotic.sh kluge can go away now. * fix read_entry() and write_entry() to pass through cancelled capabilities OK. * Add $HOME/.terminfo as source/target directory for terminfo entries. * termcap compilation now automatically dumps an entry to $HOME/.terminfo. * added -h option to toe(1). * added -R option to tic(1) and infocmp(1). * added fallback-entry-list feature. * added -i option to infocmp(1). * do a better job at detecting if we're on SCO. ### ncurses-1.9.5 -> 1.9.6 * handling of TERMCAP environment variables now works correctly. * various changes to shorten termcap translations to less that 1024 chars. * tset(1) added * mouse support for xterm. * most data tables are now const and accordingly live in shareable text space. * Obey the XPG4/SVr4 practice that echo() is initally off. * tic is much better at translating XENIX and AIX termcap entries now. * tic can interpret ko capabilities now. * integrated Juergen Pfeifer's forms library. * taught write_entry() how not to write more than it needs to; this change reduces the size of the terminfo tree by a full 26%! * infocmp -T option added. * better warnings about historical tic quirks from tic. ### ncurses 1.9.4 -> 1.9.5 * menus library is now included with documentation. * lib_mvcur has been carefully profiled and tuned. * Fixed a ^Z-handling bug that was tanking lynx(1). * HJ Lu's patches for ELF shared libraries under Linux * terminfo.src 9.8.2 * tweaks for compiling in seperate directories. * Thomas Dickey's patches to support NeXT's brain-dead linker * Eric Raymond's patches to fix problems with long termcap entries. * more support for shared libraries under SunOS and IRIX. ### ncurses 1.9.3 -> 1.9.4 * fixed an undefined-order-of-evaluation bug in lib_acs.c * systematically gave non-API public functions and data an _nc_ prefix. * integrated Juergen Pfeifer's menu code into the distribution. * totally rewrote the knight test game's interface ### ncurses 1.9.2c -> 1.9.3 * fixed the TERMCAP_FILE Support. * fixed off-by-one errors in scrolling code * added tracemunch to the test tools * took steps to cut the running time of make install.data ### ncurses 1.9.2c -> 1.9.2d * revised 'configure' script to produce libraries for normal, debug, profile and shared object models. ### ncurses 1.9.1 -> 1.9.2 * use 'autoconf' to implement 'configure' script. * panels support added * tic now checks for excessively long termcap entries when doing translation * first cut at eliminating namespace pollution. ### ncurses 1.8.9 -> 1.9 * cleanup gcc warnings for the following: use size_t where 'int' is not appropriate, fixed some shadowed variables, change attr_t to compatible with chtype, use attr_t in some places where it was confused with 'int'. * use chtype/attr_t casts as appropriate to ensure portability of masking operations. * added-back waddchnstr() to lib_addstr.c (it had been deleted). * supplied missing prototypes in curses.h * include <termcap.h> in lib_termcap.c to ensure that the prototypes are consistent (they weren't). * corrected prototype of tputs in <termcap.h> * rewrote varargs parsing in lib_tparm.c (to avoid referencing memory that may be out of bounds on the stack) -- Purify found this. * ensure that TRACE is defined in lib_trace.c (to solve prototype warnings from gcc). * corrected scrolling-region size in 'mvcur_wrap()' * more spelling fixes * use 'calloc()' to allocate WINDOW struct in lib_newwin.c (Purify). * set default value for SP->_ofp in lib_set_term.c (otherwise SunOS dumps core in init_acs()). * include <errno.h> in write_entry.c (most "braindead" includes declare errno in that file). ### ncurses 1.8.8 -> 1.8.9 * compile (mostly) clean with gcc 2.5.8 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wconversion and using __attribute__ to flush out non-portable use of "%x" for pointers, or for chtype data (which is declared as a long). * modified doupdate to ensure that typahead was turned on before attempting select-call (otherwise, some implementations hang). * added trace mask TRACE_FIFO, use this in lib_getch.c to allow finer resolution of traces. * improved bounds checking on several critical functions. * the data directory has been replaced by the new master terminfo file. * -F file-comparison option added to infocmp. * compatibility with XSI Curses is now documented in the man bages. * wsyncup/wsyncdown functions are reliable now; subwindow code in general is much less flaky. * capabilities ~msgr, tilde_glitch, insert_padding, generic_type, no_pad_char, memory_above, memory_below, and hard_copy are now used properly. * cursor-movement optimization has been completely rewritten. * vertical-movement optimization now uses hardware scrolling, il, dl. ### ncurses 1.8.7 -> 1.8.8 * untic no longer exists, infocmp replaces it. * tic can understand termcap now, especially if it is called captoinfo. * The Linux Standard Console terminfo entry is called linux insead of console. It also uses the kernel's new method of changing charsets. * initscr() will EXIT upon error (as the docs say) This wil mostly happen if you try to run on an undefined terminal. * I can get things running on AIX but tic can't compile terminfo. I have to compile entries on another machine. Volunteers to hunt this bug are welcome. * wbkgd() and wbkgdset() can be used to set a windows background to color. wclear()/werase() DO NOT use the current attribute to clear the screen. This is the way SVR4 curses works. PDCurses 2.1 is broken in this respect, though PDCurses 2.2 has been fixed. * cleaned up the test/ directory. * test/worm will segfault after quite a while. * many spelling corrections courtesy of Thomas E. Dickey ### ncurses 1.8.6 -> 1.8.7 * cleaned up programs in test/ directory. * fixed wbkgdset() macro. * modified getstr() to stop it from advancing cursor in noecho mode. * modified linux terminfo entry to work with the latest kernel to get the correct alternate character set. * also added a linux-mono entry for those running on monochrome screens. * changed initscr() so that it behaves like the man page says it does. this fixes the problem with programs in test/ crashing with SIGSEV if a terminal is undefined. * modified addch() to avoid using any term.h #define's * removed duplicate tgoto() in lib_tparm.c * modified dump_entry.c so that infocmp deals correctly with ',' in acsc * modified delwin() to correctly handle deleting subwindows. * fixed Makefile.dist to stop installing an empty curses.h * fixed a couple of out-of-date notes in man pages. ### ncurses 1.8.5 -> 1.8.6 * Implemented wbkgd(), bkgd(), bkgdset(), and wbkgdset(). * The handling of attributes has been improved and now does not turn off color if other attributes are turned off. * scrolling code is improved. Scrolling in subwindows is still broken. * Fixes to several bugs that manifest them on platforms other than Linux. * The default to meta now depends on the status of the terminal when ncurses is started. * The interface to the tracing facility has changed. Instead of the pair of functions traceon() and traceoff(), there is just one function trace() which takes a trace mask argument. The trace masks, defined in curses.h, are as follows: #define TRACE_DISABLE 0x00 /* turn off tracing */ #define TRACE_ORDINARY 0x01 /* ordinary trace mode */ #define TRACE_CHARPUT 0x02 /* also trace all character outputs */ #define TRACE_MAXIMUM 0x0f /* maximum trace level */ More trace masks may be added, or these may be changed, in future releases. * The pad code has been improved and the pad test code in test/ncurses.c has been improved. * The prototype ansi entry has been changed to work with a wider variety of emulators. * Fix to the prototype ansi entry that enables it to work with PC emulators that treat trailing ";m" in a highlight sequence as ";0m"; this doesn't break operation with any emulators. * There are now working infocmp, captoinfo, tput, and tclear utilities. * tic can now compile entries in termcap syntax. * Core-dump bug in pnoutrefresh fixed. * We now recognize and compile all the nonstandard capabilities in Ross Ridge's mytinfo package (rendering it obsolete). * General cleanup and documentation improvements. * Fixes and additions to the installation-documentation files. * Take cursor to normal mode on endwin. ### ncurses 1.8.4 -> 1.8.5 * serious bugs in updating screen which caused erratic non-display, fixed. * fixed initialization for getch() related variable which cause unpredictable results. * fixed another doupdate bug which only appeared if you have parm_char. * implemented redrawln() and redrawwin(). * implemented winsnstr() and related functions. * cleaned up insertln() and deleteln() and implemented (w)insdeln(). * changed Makefile.dist so that installation of man pages will take note of the terminfo directory. * fixed Configure (removed the mysterious 'X'). * Eric S. Raymond fixed the script.* files so that they work with stock awk. #### ncurses 1.8.3 -> 1.8.4 #### #### * fixed bug in refreshing the screen after return from shell_mode. There are still problems but they don't manifest themselves on my machine (Linux 0.99.14f). * added wgetnstr() and modified things accordingly. * fixed the script.src script.test to work with awk not just gawk. * Configure can now take an argument of the target system. * added test/ncurses.c which replaces several other programs and performs more testing. [Thanks to Eric S Raymond for the last 4] * more fixes to lib_overlay.c and added test/over.c to illustrate how it works. * fixed ungetch() to take int instead of ch. * fixes to cure wgetch() if flushinp() is called. One note I forgot to mention in 1.8.3 is that tracing is off by default starting in the version. If you want tracing output, put traceon(); in your code and link with -ldcurses. #### ncurses 1.8.2 -> ncurses 1.8.3 #### #### MAJOR CHANGES: 1) The order of capabilities has been changed in order to achieve binary compatibility with SVR4 terminfo database. This has the unfortunate effect of breaking application currently linked with ncurses. To ensure correct behavior, recompile all such programs. Most programs using color or newer capabilities will break, others will probably continue to work ok. 2) Pavel Curtis has renounced his copyright to the public domain. This means that his original sources (posted to comp.sources.unix, volume 1) are now in the public domain. The current sources are NOT in the public domain, they are copyrighted by me. I'm entertaining ideas on what the new terms ncurses is released under. 3) Eric S. Raymond has supplied a complete set of man pages for ncurses in ?roff format. They will eventually replace most of the current docs. Both sets are included in this release. Other changes and notes from 1.8.2 include: * SIGSEGV during scrolling no longer occurs. * Other problems with scrolling and use of idl have been corrected. * lib_getch.c has been re-written and should perform flawlessly. please use test/getch.c and any other programs to test this. * ripoffline() is implemented (Thanks to Eric) and slk_ functions changed accordingly. * I've added support for terminals that scroll if you write in the bottom-right corner. * fixed more bugs in pads code. If anybody has a program that uses pads I'd love a copy. * correct handling for terminal with back_color_erase capability (such as Linux console, and most PC terminals) * ^Z handling apparently didn't work (I should never trust code sent me to me without extensive testing). It now seems to be fixed. Let me know if you have problems. * I've added support for Apollo and NeXT, but it may still be incomplete, especially when dealing with the lack of POSIX features. * scrolling should be more efficient on terminals with idl capabilities. Please see src/lib_scroll.c for more notes. * The line drawing routines were offset by 1 at both ends. This is now fixed. * added a few missing prototypes and macros (e.g. setterm()) * fixed code in src/lib_overlay.c which used to crash. * added a few more programs in test/ The ones from the PDCurses package are useful, especially if you have SVR4 proper. I'm interested in the results you get on such a systems (Eric? ;-). They already exposed certain bugs in ncurses. * See src/README for porting notes. * The C++ code should really replace ncurses.h instead of working around it. It should avoid name-space clashes with nterm.h (use rows instead of lines, etc.) * The C++ should compile ok. I've added explicit rules to the Makefile because no C++ defaults are documented on the suns. * The docs say that echo() and nocbreak() are mutually exclusive. At the moment ncurses will switch to cbreak() if the case above occurs. Should it continue to do so? How about echo() and noraw()? * PDCurses seem to assume that wclear() will use current attribute when clearing the screen. According to Eric this is not the case with SVR4. * I have discovered, to my chagrin, SunOS 4.x (and probably other systems) * doesn't have vsscanf and God knows what else! I've will do a vsscanf(). * I've also found out that the src/script.* rely on gawk and will not work with stock awk or even with nawk. Any changes are welcome. * Linux is more tolerant of NULL dereferences than most systems. This fact was exposed by hanoi. * ncurses still seems inefficient in drawing the screen on a serial link between Linux and suns. The padding may be the culprit. * There seems to be one lingering problem with doupdate() after shelling out. Despite the fact the it is sending out the correct information to the terminal, nothing takes effect until you press ^L or another refresh takes place. And yes, output does get flushed. #### ncurses 1.8.1 -> ncurses 1.8.2 #### Nov 28, 1993 #### * added support for SVR4 and BSDI's BSD/386. * major update and fix to scrolling routine. * MORE fixes to stuff in lib_getch.c. * cleaned-up configuration options and can now generate Config.* files through an awk script. * changed setupterm() so it can be called more than once, add added set_curterm(), del_curterm(). * a few minor cleanups. * added more prototypes in curses.h #### ncurses 1.8 -> ncurses 1.8.1 #### Nov 4, 1993 #### * added support for NeXTStep 3.0 * added termcap emulation (not well tested). * more complete C++ interface to ncurses. * fixed overlay(), overwrite(), and added copywin(). * a couple of bug fixes. * a few code cleanups. #### ncurses 0.7.2/0.7.3 -> ncurses 1.8 #### Aug 31, 1993 #### * The annoying message "can't open file." was due to missing terminfo entry for the used terminal. It has now been replaced by a hopefully more helpful message. * Problems with running on serial lines are now fixed. * Added configuration files for SunOS, Linux, HP/UX, Ultrix, 386bsd/BSDI (if you have others send'em to me) * Cleaner Makefile. * The documentation in manual.doc is now more uptodate. * update optimization and support for hp terminals, and 386bsd console driver(s). * mvcur optimization for terminals without cursor addressing (doesn't work on Linux) * if cursor moved since last update, getch() will refresh the screen before working. * getch() & alarm() can now live together. in 0.7.3 a signal interrupted getch() (bug or feature?) now the getch is restarted. * scanw() et all were sick, now fixed. * support for 8-bit input (use meta()). * added default screen size to all terminfos. * added c++ Ncursesw class. * several minor bug fixes. #### ncurses 0.7.2 -> ncurses 0.7.3 #### May 27, 1993 #### * Config file to cope with different platforms (386BSD, BSDI, Ultrix, SunOS) * more fixes to lib_getch.c * changes related to Config #### ncurses 0.7 -> ncurses 0.7.2 #### May 22, 1993 #### * docs updated slightly (color usage is now documented). * yet another fix for getch(), this one fixes problems with ESC being swallowed if another character is typed before the 1 second timeout. * Hopefully, addstr() and addch() are 8-bit clean. * fixed lib_tparm.c to use stdarg.h (should run on suns now) * order of capabilities changed to reflect that specified in SYSV this will allow for binary-compatibility with existing terminfo dbs. * added halfdelay() * fixed problems with asc_init() * added A_PROTECT and A_INVIS * cleaned up vidputs() * general cleanup of the code * more attention to portability to other systems * added terminfos for hp70092 (wont work until changes to lib_update.c are made) and 386BSD pcvt drivers. Thanks to Hellmuth Michaelis for his help. optimization code is slated for the next major release, stay tuned! #### ncurses 0.6/0.61 -> ncurses 0.7 #### April 1, 1993 Please note that the next release will be called 1.8. If you want to know about the rationale drop me a line. Included are several test programs in test/. I've split up the panels library, reversi, tetris, sokoban. They are now available separately from netcom.com:pub/zmbenhal/ * color and ACS support is now fully compatible with SYSV at the terminfo level. * Capabilities now includes as many SYSV caps I could find. * tigetflag,tigetnum,tigetstr functions added. * boolnames, boolfnames, boolcodes numnames, numfnames, numcodes, strnames, strfnames, strcodes arrays are now added. * keyname() is added. * All function keys can be defined in terminfo entries. * fixed lin_tparm.c to behave properly. * terminfo entries for vt* and xterm are included (improvements are welcome) * more automation in handling caps and keys. * included fixes from 0.6.1 * added a few more missing functions. * fixed a couple of minor bugs. * updated docs JUST a little (still miles behind in documenting the newer features). #### ncurses 0.6 -> ncurses 0.61 #### 1) Included the missing data/console. 2) allow attributes when drawing boxes. 3) corrected usage of win->_delay value. 4) fixed a bug in lib_getch.c. if it didn't recognize a sequence it would simply return the last character in the sequence. The correct behavior is to return the entire sequence one character at a time. #### ncurses0.5 -> ncurses0.6 #### March 1, 1993 #### * removed _numchngd from struct _win_st and made appropriate changes. * rewritten kgetch() to remove problems with interaction between alarm and read(). It caused SIGSEGV every now and then. * fixed a bug that miscounted the numbers of columns when updating. (in lib_doupdate.c(ClrUpdate() -- iterate to columns not columns-1) * fixed a bug that cause the lower-right corner to be incorrect. (in lib_doupdate.c(putChar() -- check against columns not columns-1) * made resize() and cleanup() static to lib_newterm.c * added notimeout(). * added timeout() define in curses.h * added more function prototypes and fixed napms. * added use_env(). * moved screen size detection to lib_setup.c. * fixed newterm() to confirm to prototype. * removed SIGWINCH support as SYSV does not define its semantics. * cleaned-up lib_touch.c * added waddnstr() and relatives. * added slk_* support. * fixed a bug in wdeleteln(). * added PANEL library. * modified Makefile for smoother installation. * terminfo.h is really term.h #### ncurses 0.4 -> ncurses 0.5 #### Feb 14, 1993 #### * changed _win_st structure to allow support for missing functionality. * Addition of terminfo support for all KEY_*. * Support for nodelay(), timeout(), notimeout(). * fixed a bug with the keypad char reading that did not return ESC until another key is pressed. * nl mapping no longer occur on output (as should be) fixed bug '\n' no causing a LF. * fixed bug that reset terminal colors regardless of whether we use color or not. * Better support for ACS (not quite complete). * fixed bug in wvline(). * added curs_set(). * changed from signal() to sigaction(). * re-included the contents of important.patch into source. #### ncurses 0.3 -> ncurses 0.4 #### Feb 3, 1993 #### * Addition of more KEY_* definitions. * Addition of function prototypes. * Addition of several missing functions. * No more crashes if screen size is undefined (use SIGWINCH handler). * added a handler to cleanup after SIGSEGV (hopefully never needed). * changed SRCDIR from /etc/term to /usr/lib/terminfo. * renamed compile/dump to tic/untic. * New scrolling code. * fixed bug that reversed the sense of nl() and nonl(). #### ncurses 0.2 -> ncurses 0.3 #### Jan 20, 1993 #### * more support for color and graphics see test/ for examples. * fixed various files to allow correct update after shelling out. * more fixes for updates. * no more core dumps if you don't have a terminfo entry. * support for LINES and COLUMNS environment variables. * support for SIGWINCH signal. * added a handler for SIGINT for clean exits. #### ncurses 0.1 -> ncurses 0.2 #### Aug 14, 1992 #### * support for color. * support for PC graphic characters. * lib_trace.c updated to use stdarg.h and vprintf routines. * added gdc.c (Great Digital Clock) as an example of using color. #### ncurses -> ncurses 0.1 #### Jul 31, 1992 #### * replacing sgtty stuff by termios stuff. * ANSIfication of some functions. * Disabling cost analysis 'cause it's incorrect. * A quick hack for a terminfo entry. -- vile:txtmode: | http://opensource.apple.com/source/ncurses/ncurses-27/ncurses/NEWS | CC-MAIN-2014-52 | refinedweb | 56,209 | 59.8 |
current position:Home>Event handling of react
Event handling of react
2022-04-29 12:37:58【youhebuke225】
List of articles
Event handling
- stay React The attribute of event binding in needs to be written in the way of hump naming , Such as
onClick
- React The event in is not DOM Native event , But through React Events handled
Event binding
stay react There are three ways to bind events in , The first method is recommended for binding
Example
import React, { Component, createRef } from "react"; export default class UseRefs extends Component { constructor(props){ super(props) this.handleClick3 = this.handleClick3.bind(this) } // The first way handleClick1 = () => { console.log("hello world"); }; // The third way handleClick3(){ console.log("hello react hooks"); } render() { return ( <> <button onClick={ this.handleClick1}> Click on 1</button> { /* The second way */} <button onClick={ () => console.log("hello react")}> Click on 2</button> <button onClick={ this.handleClick3}> Click on 3</button> </> ); } }
The way
stay DOM Direct binding in
- Write it in the way of the above example
- It should be noted that , Be sure to follow an arrow function , hold
thisPoint to the outside , If you don't use the arrow function , that
thisNamely
undefined
Save the method to the property of the class
Like the example above 1 And way 3
The same thing
- The way 1 And way 3 The same thing is that the method of binding events is the same
Difference
- Mainly in functions this The direction of , Because of the way 3 Own your own
this, So we should bind in the constructor
this, Let him point to the component instance
Parameter passing
Code
import React, { Component } from "react"; export default class UseRefs extends Component { state = { arr:[2,3,4,6] } handleClick = (_index,event) => { console.log("index",_index); console.log("event",event); console.log("event.target",event.target); }; render() { return ( <ul> { this.state.arr.map((_item,_index) => <li key={ _index} onClick={ (event) => this.handleClick(_index,event)}>{ _item}</li>)} </ul> ); } }
The interpretation of the code
Event object
- To get the event object, we must give a callback function when time binding , The first parameter of the callback function is the event object , Call our defined function in the callback function to pass in the corresponding parameters
- adopt
event.targetCan get the element that triggers the event
Event Bubbling
What is event bubbling Click on
import React, { Component } from "react"; export default class UseRefs extends Component { handleClick = () => { console.log("ul Events above "); console.log(this); }; handleClick1 = () => { console.log(" Click on 1 Events "); console.log(this); }; handleClick2 = (event) => { console.log(" Click on 2 Events "); console.log(this); event.stopPropagation(); }; render() { return ( <ul onClick={ this.handleClick}> <li onClick={ this.handleClick1}> Click on 1</li> <li onClick={ event => this.handleClick2(event)}> Click on 2</li> <li> Click on 3</li> </ul> ); } }
Bubbling
When we click Click on 1 When , We'll find that he triggered two events ( Own events and parent Events )
When we click Click on 3 When ,
You'll find that he also triggered the event , But this incident is really his father's incident
Bubbling mechanism
- Child element has no event binding , Click on the child element , If there is a bound click event on its parent element , Then the click time of the parent element will be triggered
- Child elements have binding events , If the parent element has the same type of binding event , Then the binding event on the parent element will also be triggered
Stop the event from bubbling
stay React in , Use
event.stopPropagation() To stop the bubbling of events , If you click 2
author[youhebuke225] | https://en.qdmana.com/2022/119/202204291237539617.html | CC-MAIN-2022-33 | refinedweb | 590 | 54.97 |
Hey everyone , Webpack has released some new cool feature called module federation..
Usecase
Suppose there is a company xyz. It has a web application. It has features like landing page, blog, carrer page, etc and each of this page is managed by different teams. But on the company website it should load as one application. Also there can be case where carrer page is built using react js and landing page using Vue js .
Previously we used to embed iframes in the container app (here it will be landing page). The problem with iframe is it loads all the dependencies again.
Using Micro frontend technique we can combine multiple app in one app and Module federation makes it easier
To learn more about Module federation click here
What we going to do ?
We will be building a web application using Vuejs and react js . Here Vuejs will be our container app and Reactjs will be loaded in vue js. Also we will sync the routes for Vuejs and Reactjs.
Project Structure
root | |-packages |-react-app |-src |-index.js |-bootstrap.js |-App.js |-components |-config |-public |-package.json |-vue-app |-src |-index.js |-bootstrap.js |-App.vue |-components |-config |-public |-package.json |-package.json
Project is setup using lerna.
Setting up Webpack
remote (react-app)
We have one webpack.common.js. It contains all the rules for compiling different types of file like js,css, jpeg,svg etc
Now we have webpack.development.js. It imports the base config as well as run a dev-server and implements Module Federation.
Creating a remote
new ModuleFederationPlugin({ name: "auth", filename: "remoteEntry.js", exposes: { "./AuthApp": "./src/bootstrap" }, shared: dependencies }),
Here we expose bootstrap file from react-app as AuthApp and build file is named as remoteEntry.js
Code on github
host (vue-app)
Creating a Host
We have one webpack.common.js same as remote . In webpack.development.js we'll have webpack-dev-server as well as we specifies the remotes
new ModuleFederationPlugin({ name: "container", remotes: { auth: "auth@", }, shared: dependencies }),
Thats it our webpack setup id done.
To run the application we'll run
lerna setup
in root. It will start both react and vue app.
Mounting React app in Vue app
We will create a ReactComponent.vue file. Here we will import the mount function that we exposed from our react app.
import { mount } from "auth/AuthApp";
Now in template we will create a div where we will mount our react app.
<template> <div id="react"></div> </template>
Next we will call mount function in mounted lifecycle method of vue.
mounted() { this.initialPath = this.$route.matched[0].path; const { onParentNavigate } = mount(document.getElementById("react"), { initialPath: this.initialPath, //... }); this.onParentNavigate = onParentNavigate; }
Thats it .... Now react will be mounted inside vue app
Now only one thing is left that is Routing
Routing
We have to routing events
- From react app to vue app (onNavigate)
- From Vue app to react app (onParentNavigate)
We pass onNavigate callback function from vuejs to react js via mount function.
mounted() { this.initialPath = this.$route.matched[0].path; const { onParentNavigate } = mount(document.getElementById("react"), { initialPath: this.initialPath, onNavigate: ({ pathname: nextPathname }) => { let mext = this.initialPath + nextPathname; console.log("route from auth to container", mext, this.$route.path); if (this.$route.path !== mext) { this.iswatch = false; this.$router.push(mext); } }, onSignIn: () => { console.log("signin"); }, });
We have a history.listen in our react app which will trigger this callback whenever react app route changes. In this callback function we will route our vue app to same sub route as react app route.
Now we need a callback function from react app also to sync the route when vue route changes.
In the above code block we can see a onParentNavigate function from mount function. Now when to trigger this function thats the question.
We will write a watcher function on $route
watch: { $route(to, from) { let innerRoute = this.getInnerRoute(to.path); if (this.iswatch) { if(innerRoute) this.onParentNavigate(innerRoute); else return true } else this.iswatch = true; }, }, methods: { getInnerRoute(path) { let inner = path.split(this.initialPath)[1]; return inner; }, },
This is the way we have integrated the react app in vue app
Discussion (0) | https://practicaldev-herokuapp-com.global.ssl.fastly.net/amitchambial/reactjs-in-vuejs-using-module-federation-inc-routing-5dc7 | CC-MAIN-2021-49 | refinedweb | 690 | 60.31 |
Omnit and operations engineers were fully utilizing the cloud and the agile methodology it enables.
That’s only been the case for the past year, in fact, since Omnitracs began adopting Red Hat OpenShift in partnership with Red Hat Services. Andrew Harrison, lead IT DevOps Engineer and lead of the Agents of Change team at Omnitracs, was tasked with building the company a road to the future of software development, and the pavement on this road was built with OpenShift and Red Hat Open Transformation., Omnitracs engaged Red Hat Services as a partner in designing and implementing transformational change, starting with Harrison's team and a group of Omnitracs developers.. That means introducing devops, automation, agile methodologies, and continuous integration and deployments. This is where Red Hat Open Innovation Labs Residency played a key role in bootstrapping Omnitracs developer teams with core skills and expertise.
And yet, a year later, Harrison said he’s successfully transitioned the company away from a “waterfall” style of development and deployment towards a devops and agile based approach, thanks to the help of the Red Hat Services and OpenShift Container Platform. Instead of code pouring in as it was completed, like a waterfall, developers learned to iterate over time in smaller chunks. While the move began with OpenShift 3.11, the company was also one of the first to roll OpenShift 4.1 out to production systems.
Harrison said the benefits of moving to OpenShift 3.11 were immediately noticeable. “With OpenShift 3.11, we were able to get immediate cost reduction because we moved everything out to the public cloud [eliminating on prem costs]. We got rid of on-premise costs immediately. We wrote custom Ansible playbooks to make sure everything was infrastructure as code and was always repeatable. We reduced our environment deployment times from over a week to less than 2 hours,” said Harrison.
Those technical wins were paralleled by cultural wins as well, he added. “We had a total transformation in the IT department, especially in our organization. Our team, The Agents of Change, evolved from the traditional waterfall style to a real agile methodology which greatly reduced all of our release times.” Omnitracs ran two Red Hat Open Innovation Labs residencies for their developers to facilitate this, and the Agents of Change team worked closely with Red Hat Consulting to define a Lean model tailored to their work.
Soon after moving onto OpenShift, the team at Omnitracs embraced OpenShift 4.1 and the Operators model for services availability.Harrison noted that the Operators model enabled faster integration of services essential to building out a production-grade cluster. The team now uses Splunk for logging, and Ansible for automation.
Software is not the only thing changing inside the Omnitracs OpenShift clusters, however. The company is also using this Kubernetes-based cloud software to improve its internal IT teams. Said Harrison: “We took the SRE [Site Reliability Engineering] model and turned it on its ear a little. We’re spinning up 35 new scrum teams in the coming years, and we’re not going to find SREs for each of those teams; it’s not going to work. So we took a different approach: we’re using a virtual ops approach, where we’re embedding with these teams now and teaching them the ops part of devops. They are going to be their own SREs. They will have the ability and proper permissions in OpenShift to spin up their own namespaces, start projects, give people access to them, and all of that. We’re really giving them the ability to provide care and feeding for their own areas, but at the same time, giving them the ownership of it. So now when they are building their applications, they are actively thinking about the operationalization of it,” said Harrison.
That transition also means internal developers are expanding their skill sets to include more capabilities, enhancing their resumes and growing their careers while also contributing to the growth of the company itself. It’s a win-win situation. “They know that the logs are collected in Splunk and through VictorOps, they get that notification back when something’s gone wrong. It’s just part of how they do their daily job now,” said Harrison.
How did they manage to put all this power into the hands of the developers themselves? “Early adoption of OpenShift 4 was critical to our success. We were very much looking at this as if we were going to be on this for the next five years and didn’t want to get stuck on an older version, so we took that risk. We were very tightly working with Red Hat while doing this. They’ve been embedded with our teams for the last year. They are a part of our team. We drove innovation within our team and within Red Hat. The stuff we were working on was being brought back into Red Hat to bring the platform to where it is today,” said Harrison.
“That transformation we talked about earlier from traditional systems administrators in an operational role to devops engineers, we did that in less than a year. We weren’t doing this a year ago. We were traditional systems administrators in our silos. We had Linux guys, we had VMware guys, we had network guys. Now we’re all on a team together, we’re all doing this stuff every day. It’s been an amazing transformation for the technology we’re working in and for our careers. It’s been great, and that tight partnership [with Red Hat] facilitated that shift very easily. Having Operators available to us allowed us to deliver services to the dev teams almost immediately on day one,” said Harrison.
Categories | https://www.openshift.com/blog/how-omnitracs-transformed-to-a-devops-culture-with-openshift | CC-MAIN-2021-21 | refinedweb | 961 | 54.32 |
Prebuilt Gulp environment for ES6+ web app boilerplates.
It comes with an ES6+ (ES7 async/await are there) to ES3-ish (as IE8 compatible as possible, but you may have to import polyfills, shims and shams accordingly) compilation process, together with a Browserify bundling and Uglifyjs compression.
Plus a CSS compilation task, to choose from one of the following:
as well as an Autoprefixer, post compilation, process (bye bye vendor prefixes).
Also, templates precompilation process, to choose from one of the following:
the task compiles templates in JST format, namespaces them under an
R.templates
globally accessible variable and serves it to you in the form of a
template.js
module inside your static scripts folder.
You can also rely on a Karma tests runner, with PhantomJS and Google Chrome engines (bring your own karma.config.js file, though), plus JSHint code check and JSValidate safety checks on critical tasks.
It also gives you the possibility to serve your own instance of a Node.js server, plus watchers and livereloading for, well, everything really.
Bonus: version bumping and git tagging/pushing tasks.
TODO:
Copy the
gulpfile-sample.js in your app folder and configure it the way you
like. The configuration is pretty straightforward and the comments will help you
out on every bits of it.
You can also take a look at the gladius-draft's
gulpfile.js to see how
you can extend default tasks, add your own tasks or watchers, etc.
By default, the boilerplate will come with the following tasks, which you can extend or override as you please:
DEFAULTS
production: it will run the basic compilation + compression tasks, without tests
other than the JSValidate one to make sure everything worked fine.
development: it will run compilation tasks (no compression) with sourcemaps
support, plus it will run watchers to recompile and livereload everything as soon
as you make some changes, plus Karma in watch mode.
test: it will just run the tests without watchers (useful for CI engines).
release,
feature and
patch are special tasks that handle the bump of the
version on the package.json as well as the bower.json if present, plus the tagging
on your git repo, and the push to master of the newly generated tag.
TODO
The boilerplate comes with a very basic set of dependencies installed via NPM. The remaining modules needed by each task will be lazily installed during the pre-process phase of each default task.
This way makes it possible to have the smallest amount of dependencies needed to
be installed for the
production task, that reflects on an massive reduction of
the installation footprint on production environment.
This boilerplate of mine is just a combination of great tools put together to achieve higher goals (using cutting edge technologies today, greatly simplifying a developer's workflow, etc), and if it weren't for the people who built those tools, I wouldn't have made this little thing so far.
So, thanks goes to:
asyncand
awaitstatements <3). | https://www.npmjs.com/package/es6-gulp-boilerplate | CC-MAIN-2017-22 | refinedweb | 500 | 61.87 |
This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.
On Monday, September 24, 2001, at 08:18 PM, Jim Wilson wrote: > The ia64-java compiler is not working because of a conflict between the > relatively new CFG code, and the LIBCALL/RETVAL support that we have had > for a while. We get a segfault in flow for some testcases. > > The problem arises because java uses -fnon-call-exceptions. IA-64 does > not have a divide instruction, so divides are implemented as libcall > sequences. A divide traps, so these libcall sequences can throw. A > call > that can throw ends a basic block. We thus get libcall sequences that > span > a basic block boundary in the CFG. This is not legal, if i remember what rth told me. I ran into a problem with the new register allocator, store motion, and scheduling. Because of some of the store motion, the scheduler would decide to speculatively move libcall argument sets out of the block in which the libcall existed. This caused propagate_one_insn to fail miserably, because it assumes that this doesn't happen. I produced a patch to make it handle this,but rth said the scheduler was at fault because libcall sequences are required to be entirely in one basic block, and it shouldn't have speculatively moved the argument set into a different basic blocks. Of course, this isn't documented. So unless i'm misremembering, you can't do what you want with libcalls. Not that you shouldn't be able to. In fact, what i'd rather see is a new RTX for calls with arguments, so there would be no problem moving them around in optimization passes. You could mark them as "libcalls" with a flag on the RTL. We can't do this with parallels, at least, if the RTL docs aren't lying (since we can't expect the results of a given set to be available for the next one in the parallel). Otherwise, you end up fixing up all the optimization passes that can move libcall sequences across blocks, to handle a special case where a reg note attached to a set happens to really mean we can't move it across blocks. > > The CFG based optimizations are not aware of the libcall sequences, so > eventually we get basic blocks reordered such that the libcall sequence > is no longer contiguous. The first half is in one basic block, and the > last half is in a different block reachable only via a branch. Then > when we try to handle REG_LIBCALL/REG_RETVAL notes, the compiler > segfaults, > because it can't find the the instruction with the REG_RETVAL note > corresponding to the REG_LIBCALL note. > > I only have a java testcase for this at the moment. Compile at -O2 > with an ia64-java compiler and you get a segfault in flow. > > public class divtest { > private long min_transaction_count = Long.MAX_VALUE; > private long max_transaction_count = Long.MIN_VALUE; > public void set(long z) { min_transaction_count = z; } > public synchronized void displayThreadResults() > { > > // long diff = max_transaction_count - min_transaction_count; > float diff_pct = (float)max_transaction_count / > (float)min_transaction_count; > > } > } > > Removing the REG_LIBCALL/REG_RETVAL notes for trapping libcalls when > -fnon-call-exceptions makes the problem go away, but then we can no > longer > optimize away dead divide libcall sequences. So we have a performance > regression if we do this. > > If we had a high level IL, then the problem would go away. In the high > level IL we would just have a divide operation, and it would be trivial > to optimize away unused divides. Then when we lower the IL we emit the > libcall sequence, and we don't need the REG_LIBCALL/REG_RETVAL notes > anymore. > The REG_LIBCALL/REG_RETVAL notes are only needed for optimizing > operations > implemented via libcalls, and if we have already optimized them at the > high > level we don't need to worry about optimizing them at the low level. > This > however is more work than I can do for a simple bug report. Perhaps > the ast-optimizer-branch will help? > > I am not very familiar with the new CFG support. However, my suspicion > that the only good way to solve the problem (without a higher IL) is > to make the CFG code aware that edges inside libcalls are special. > Perhaps a new EDGE_ABNORMAL_LIBCALL flag bit for CFG edges. Then > every optimization pass that makes use of the CFG needs to be modified > to be aware of these EDGE_ABNORMAL_LIBCALL edges, and handle them > specially. I do not know if this is feasible, or how much work it would > be if it was feasible. Additionally, code that knows how to optimize > away libcall sequences may need to be aware of the CFG, since deleting a > libcall may modify the CFG. I think this part would not be too hard. > > Comments anyone? The ia64 java compiler is broken, so we do need some > kind > of fix. At the moment, the only working fix I have is one that disables > REG_LIBCALL/REG_RETVAL notes when they cause trouble, and this is > undesirable > because it causes a performance regression. But if we can't easily fix > the > CFG code, then I may have to go with this patch to get the java compiler > working again. > > Jim | https://gcc.gnu.org/legacy-ml/gcc/2001-09/msg00961.html | CC-MAIN-2022-05 | refinedweb | 868 | 61.67 |
Read RNTuple data blocks from a TFile container, provided by a RRawFile.
A RRawFile is used for the byte access. The class implements a minimal subset of TFile, enough to extract RNTuple data keys.
Definition at line 108 of file RMiniFile.hxx.
#include <ROOT/RMiniFile.hxx>
Uses the given raw file to read byte ranges.
Definition at line 917 of file RMiniFile.cxx.
Extracts header and footer location for the RNTuple identified by ntupleName.
Definition at line 923 of file RMiniFile.cxx.
Used when the file container turns out to be a bare file.
Definition at line 986 of file RMiniFile.cxx.
Used when the file turns out to be a TFile container.
Definition at line 935 of file RMiniFile.cxx.
Reads a given byte range from the file into the provided memory buffer.
Definition at line 1008 of file RMiniFile.cxx.
Indicates whether the file is a TFile container or an RNTuple bare file.
Definition at line 113 of file RMiniFile.hxx.
The raw file used to read byte ranges.
Definition at line 111 of file RMiniFile.hxx. | https://root.cern.ch/doc/master/classROOT_1_1Experimental_1_1Internal_1_1RMiniFileReader.html | CC-MAIN-2020-40 | refinedweb | 179 | 70.39 |
Mojo UI questions
Hi there. I'm looking to use some mojo for a little tool that involves very quickly (ideally) choosing a glyph. These comments are a bit like splitting hairs, but I hope you can see why.
SelectGlyph()doesn't quite behave the way I'd personally expect it to. Ideally it'd respond to the keyboard more accurately. And be case-sensitive. Video
FindGlyph()would benefit from having some of the ease of use of the
Jump To Glyphfeature. That is, the ability to just hit Enter on the fly.
FindGlyph()seems to rely on Tab. May seem minor, but thinking about incorporating this into a script that would be used very often. Video
When I hit Cancel on an
AskString(), it still commits my input. Video
I'm not sure how to work with
dontShowAgainYesOrNo(). Or maybe I hit "don't show again" once and now don't know how to get it back. Would very much appreciate seeing a short example script with this in use.
TIA,
Ryan
I guess your first option is missing
enableTypingSensitivitywhen creating the vanilla list internally...
import vanilla w = vanilla.Window((400, 400)) w.l = vanilla.List((0, 0, 0, 0), sorted(CurrentFont().keys()), enableTypingSensitivity=True) w.open()
FindGlyphshould indeed work directly when enter is pressed, added to the todo list.
AksStringshould return
Nonewhen cancel is hit.
There is global reset in the preferences for all
dontShowAgainYesOrNodialogs.
result = dontShowAgainYesOrNo("A title", "Are you sure about this question?", dontShowAgainKey="com.myDomain.myTool.myQuestion")
hope this helps!
(a public beta will be published soon!) | https://forum.robofont.com/topic/594/mojo-ui-questions/3 | CC-MAIN-2019-22 | refinedweb | 262 | 61.83 |
DocOnce text looks like ordinary text (much like Markdown ), but there are some almost invisible text constructions that allow you to control the formating. Here are some examples.
*, or
oif the list is to be enumerated.
*. Words in boldface are surrounded by underscores.
verbatim (in a monospace font).
=before and after the heading, e.g.,
===== Here is a subsection heading =====.
!bc(begin code) and
!ec(end code) tags on separate lines. Blocks of computer code can also be imported from source files.
!bt(begin TeX) and
!et(end TeX) tags on separate lines. Inline mathematics is surrounded by dollar signs:
$a=b$.
#and are not visible in the output document.
[name: comment...]
TITLE:,
AUTHOR:,
DATE:,
FIGURE:, and
MOVIE:.
1: In fact, DocOnce allows basic GitHub-extended Markdown syntax as input. This is attractive for newcomers from Markdown or writers who also write Markdown documents (or uses Markdown frequently at GitHub).
LaTeX is ideal for articles, thesis, and books, but the PDF files does not look fresh and modern on tablets and phones or big computer screens. For the latter type of media you need HTML-based documents with strong support for nice layouts. Tools like Sphinx, Markdown, or plain HTML with Bootstrap are then more appropriate than LaTeX, but involves a very different syntax. DocOnce lets you write one text in one place and then generate the most appropriate language for the media you want to target. DocOnce also has many extra features for supporting large documents with much code and mathematics, not found in any of other publishing tool.
LaTeX writers often have their own writing habits with use of their own favorite LaTeX packages. DocOnce is a much simpler format and corresponds to writing in quite plain LaTeX and making the ascii text look nice (be careful with the use of white space!). This means that although DocOnce has borrowed a lot from LaTeX, there are a few points LaTeX writers should pay attention to. Experience shows that these points are so important that we list them before we list typical DocOnce syntax!
Any LaTeX syntax in mathematical formulas is accepted when DocOnce
translates the text to LaTeX, but if output in the
sphinx,
pandoc,
mwiki,
html, or
ipynb formats is also important, one should
follow the rules below.
html,
sphinx, and
ipynbformats.
latex,
html,
sphinx,
markdown, and
ipynb, it is recommended to use only the following equation environments:
\[ ... \],
equation*,
equation,
align*,
align.
alignat*,
alignat. Other environments, such as
split,
multiline,
gatherare supported in modern MathJax in HTML and Sphinx, but may face rendering problems (to a larger extent than
equationand
align). DocOnce performs extensions to
sphinx,
ipynb, and other formats such that labels in
alignand
alignatenvironments work well. If you face problems with fancy LaTeX equation environments in web formats, try rewriting with plain
align,
nonumber, etc.
newcommands*.tex. Use
\newcommandsand not
\def. Each newcommand must be defined on a single line. Use Mako functions if you need macros in the running text.
mwiki) does not support references to equations.
refcommand (no
\eqreffor equations) and references to equations must use parentheses. Never use the tilde
(non-breaking space) character before references to figures, sections, etc., but tilde is allowed for references to equations.(non-breaking space) character before references to figures, sections, etc., but tilde is allowed for references to equations.
\pagerefas pages are not a concept in web documents (there is only a
refcommand in DocOnce and it refers to labels).
subfigureto combine several image files in one figure, but you can combine the files to one file using the
doconce combine_imagestool. Refer to individual image files in the caption or text by (e.g.) "left" and "right", or "upper left", "lower right", etc.
citefor references (e.g.,
\citeauthorhas no counterpart in DocOnce). The bibliography must be prepared in the Publish format, but import from (clean) BibTeX is possible.
idxfor index entries, but put the definitions between paragraphs, not inside them (required by Sphinx).
\bmcommand (from the
bmpackage, always included by DocOnce) for boldface in mathematics.
\begin{}and
\end{}directives should start in column 1.
2: There is an exception: by using user-defined environments
within
!bu-name and
!eu-name directives, it is possible to
label any type of text and refer to it. For example, one can have
environments for examples, tables, code snippets, theorems, lemmas, etc.
One can also use Mako functions to implement enviroments.
#if FORMAT in ("latex", "pdflatex")) to include such special LaTeX code. With an else clause you can easily create corresponding constructions for other formats. This way of using Preprocess or Mako allows advanced LaTeX features, or HTML features for the HTML formats, and thereby fine tuning of the resulting document. More tuning can be done by automatic editing of the output file (e.g.,
.texor
.html) produced by DocOnce using your own scripts or the
doconce replaceand
doconce substcommands.
doconce latex2doconcemay help you translating LaTeX files to DocOnce syntax. However, if you use computer code in floating list environments, special packages for typesetting algorithms, example environments,
subfigurein figures, or a lot of newcommands in the running text, there will be need for a lot of manual edits and adjustments.
For examples, figure environments can be translated by the program
doconce latex2doconce only if the label is inside the caption and
the figure is typeset like
\begin{figure} \centering \includegraphics[width=0.55\linewidth]{figs/myfig.pdf} \caption{This is a figure. \labe{myfig}} \end{figure}
If the LaTeX is consistent with respect to placement of the label, a
simple script can autoedit the label inside the caption, but many
LaTeX writers put the label at different places in different figures,
and then it becomes more difficult to autoedit figures and translate
them to the DocOnce
FIGURE: syntax.
Tables are hard to interpret and translate, because the headings and caption can be typeset in many different ways. The type of table that is recognized looks like
\begin{table} \caption{Here goes the caption.} \begin{tabular}{lr} \hline \multicolumn{1}{c}{$v_0$} & \multicolumn{1}{c}{$f_R(v_0)$}\\ \hline 1.2 & 4.2\\ 1.1 & 4.0\\ 0.9 & 3.7 \hline \end{tabular} \end{table}
Recall that table captions do not make sense in DocOnce since tables must be inlined and explained in the surrounding text.
Footnotes are also problematic for
doconce latex2doconce since DocOnce
footnotes must have the explanation outside the paragraph where the
footnote is used. This calls for manual work. The translator from
LaTeX to DocOnce will insert
_PROBLEM_ and mark footnotes. One
solution is to avoid footnotes in the LaTeX document if fully automatic
translation is desired.
Here is an example of some simple text written in the DocOnce format:
======= First a Section Heading ======= ===== Then a Subsection Heading ===== === Finally a Subsubection Heading === You can also have paragraphs with a paragraph heading surrounded by double underscores are the beginning of a line. __This is a paragraph heading.__ And here comes the text. ===== A Subsection with Sample Text ===== label{my:first:sec} Section ref{my:first:sec}. References to equations, such as (ref{myeq1}), work in the same LaTeX-inspired way. Lists are typeset as you would do in email, * item 1 * item 2, perhaps with a 2nd line * item 3 Note the consistent use of indentation (as in Python programming!). Lists can also have automatically numbered items instead of bullets, o item 1 o item 2 o item 3, but be careful with the indentation of the next lines! __Hyperlinks.__ URLs with a link word are possible, as in "hpl": "". If the word is just URL, the URL itself becomes the link name, as in URL: "tutorial.do.txt". DocOnce distinguishes between paper and screen output. In traditional paper output, in PDF generated from LaTeX generated from DocOnce, the URLs of links appear as footnotes. With screen output, all links are clickable hyperlinks, except in the plain text format which does not support hyperlinks. __Inline comments.__ DocOnce also allows inline comments of the form [name: comment] (with a space after `name:`), e.g., such as [hpl: here I will make some remarks to the text]. Inline comments can be removed from the output by a command-line argument (see Section ref{doconce2formats}[^footnote] is also possible. [^footnote]: The syntax for footnotes is borrowed from Extended Markdown. __Tables.__ Tables are also written in the plain text way, e.g., |--c--------c-----------c--------| |time | velocity | acceleration | |---r-------r-----------r--------| | 0.0 | 1.4186 | -5.01 | | 2.0 | 1.376512 | 11.919 | | 4.0 | 1.1E+1 | 14.717624 | |--------------------------------| The characters `c`, `r`, and `l` can be inserted, as illustrated above, for aligning the headings and the columns (center, right, left). One can also use `X` for potentially very long text in a column (will be left-adjusted). # Lines beginning with # are comment lines.
The DocOnce text above results in the following little document:
You can also have paragraphs with a paragraph heading surrounded by double underscores are the beginning of a line.
This is a paragraph heading. And here comes the text. the section A Subsection with Sample Text. References to equations, such as '\eqref{myeq1}', work in the same LaTeX-inspired way.
Lists are typeset as you would do in email,
Inline comments.
DocOnce also allows inline comments of the form
(name 1: comment)
(with
a space after
name:), e.g., such as
(hpl 2: here I will make some remarks to the text)
. Inline comments can be removed from the output
by a command-line argument (see the section From DocOnce to Other Formats is also possible.
3: The syntax for footnotes is borrowed from Extended Markdown.
Tables. Tables are also written in the plain text way, e.g.,
The characters
c,
r, and
l can be inserted, as illustrated above,
for aligning the headings and the columns (center, right, left).
Inline mathematics, such as \( \nu = \sin(x) \) is written exactly as in LaTeX:
$\nu = \sin(x)$
Blocks of mathematics are typeset with raw LaTeX, inside
!bt and
!et (begin TeX, end TeX) directives:
!bt \begin{align} {\partial u\over\partial t} &= \nabla^2 u + f, label{myeq1}\\ {\partial v\over\partial t} &= \nabla\cdot(q(u)\nabla v) + g \end{align} !et
The result looks like this:
$$
\begin{align}
{\partial u\over\partial t} &= \nabla^2 u + f, \label{myeq1}\\
{\partial v\over\partial t} &= \nabla\cdot(q(u)\nabla v) + g
\label{_auto1}
\end{align}
$$
Of course, such blocks only looks nice in formats with support
for LaTeX mathematics
(this includes
latex,
pdflatex,
html,
sphinx,
ipynb,
pandoc,
and
mwiki). Simpler
formats have to just list the raw
LaTeX syntax.
subfigure(combine image files to one file instead, via
doconce combine_images).
You can have blocks of computer code, starting and ending with
!bc and
!ec instructions, respectively.
!bc pycod from math import sin, pi def myfunc(x): return sin(pi*x) import integrate I = integrate.trapezoidal(myfunc, 0, pi, 100) !ec
Such blocks are formatted as
from math import sin, pi def myfunc(x): return sin(pi*x) import integrate I = integrate.trapezoidal(myfunc, 0, pi, 100)
A code block must come after some plain sentence (at least for successful
output to
sphinx,
rst, and formats close to plain text),
not directly after a section/paragraph heading or a table.
Blocks of computer code has named environments, such as pycod. The py stands for Python and cod indicates a code snippet that cannot be run without more code. Another example is fpro, f for Fortran and pro for a complete program that will run as it stands. There is support for code in C, C++, Fortran, Java, Python, Perl, Ruby, JavaScript, HTML, and LaTeX,
One can also copy computer code directly from files, either the complete file or specified parts, e.g,
@@@CODE src/myprog.py fromto: def regression\(@import mymod
The copying is based on regular expressions and not on line numbers, which
makes the specifications much more robust during software and document
developing. With the
@@@CODE command,
computer code is never
duplicated in the documentation (important for the principle of
avoiding copying information!) and once the software is updated, the
next compilation of the document is up-to-date.
Inclusion of files.
Another DocOnce document or any file can be
included by writing
# #include "mynote.do.txt" at the beginning of a
line. DocOnce documents have extension
do.txt. The
do part stands
for
doconce, while the trailing
.txt denotes a text document so
that editors gives you plain text editing capabilities.
DocOnce supports a type of macros via a LaTeX-style newcommand
construction. The newcommands are defined in files with names
newcommands*.tex, using standard LaTeX syntax. Only newcommands
for use inside LaTeX math environments are supported. (But you can
define any type of macros through Mako functions!)
Labels, corss-references, citations, and support of an index and bibliography are much inspired by LaTeX syntax, but DocOnce features no backslashes. Use labels for sections and equations only, and preceed the reference by "Section" or "Chapter", or in case of an equation, surround the reference by parenthesis.
Here is an example:
===== My Section ===== label{sec:mysec} idx{key equation} idx{$\u$ conservation} We refer to Section ref{sec:yoursec} for background material on the *key equation*. Here we focus on the extension # \Ddt, \u and \mycommand are defined in newcommands_keep.tex !bt \begin{equation} \Ddt{\u} = \mycommand{v}, label{mysec:eq:Dudt} \end{equation} !et where $\Ddt{\u}$ is the material derivative of $\u$. Equation \eqref{mysec:eq:Dudt} is important in a number of contexts, see cite{Larsen_et_al_2002,Johnson_Friedman_2010a}. Also, cite{Miller_2000} supports such a view. As see in Figure ref{mysec:fig:myfig}, the key equation features large, smooth regions *and* abrupt changes. FIGURE: [fig/myfile, width=600 frac=0.9] My figure. label{mysec:fig:myfig} ===== References ===== BIBFILE: papers.pub
DocOnce applies Publish for specifying bibliographies because this tool has more functionality than BibTeX, but any BibTeX database can be automatically converted to the simple Publish format.
For further details on functionality and syntax we refer to the DocOnce manual.
We refer to the manual for detailed information on how to compile a DocOnce document to various formats. Here we just give a glimpse of the possibilities.
Suppose you have some DocOnce text in
mydoc.do.txt. Here is how you
compile that document to an HTML file
mydoc.html, which can be viewed
in a web browser:
Terminal> doconce format html mydoc --html_style=bootswatch_journal
There are lots of styles for HTML files, and
bootswatch_journal is
a fancy one. There are also lots of other command-line options for
tailoring the compilation. Run
doconce format --help to see a list
of all options. Those that start with
--html_ are specific for the
HTML output format.
A DocOnce compilation has three stages:
mydoc.do.txt, resulting in
tmp_preprocess__mydoc.do.txt.
tmp_preprocess__mydoc.do.txt, resulting in
tmp_mako__mydoc.do.txt.
tmp_mako__mydoc.do.txtis translated to the chosen output format.
DocOnce can be translated to many formats. For documents with much mathematics and/or computer code the following formats are suitable:
latex,
pdflatex
html
sphinx
ipynb(IPython/Jupyter notebooks)
matlabnb(Matlab notebooks)
gwiki(Googlecode),
cwiki(Creole),
mwiki(MediaWiki)
plain(pure ascii)
pandoc(various Markdown formats)
DocOnce has strong support for writing slides, see the
slides demo
for examples. Each slide starts with
a subsection heading (5
=), preceded by
!split to indicate a
new slide. Section headings are used to mark parts of the presentation.
The slides are compiled as any other DocOnce file, but there is usually
a second step where the text is modified to become a proper slide text
in the chosen output format. We refer to the manual for details
and the DocOnce slide demo.
Several popular slide formats are supported:
Our short scientific report is a good starting point for seeing how DocOnce documents are written and get a demonstration of the vast choice of output formats and settings that are available.
There is also a demo of different slide formats.
DocOnce has support for responsive HTML documents with design and functionality based on Bootstrap styles. A Bootstrap).
The current text is generated from a DocOnce format stored in the file
doc/tutorial/tutorial.do.txt
The file
make.sh in the
tutorial directory of the
DocOnce source code contains a demo of how to produce a variety of
formats. | http://hplgit.github.io/doconce/doc/pub/tutorial/tutorial.html | CC-MAIN-2018-39 | refinedweb | 2,723 | 57.06 |
Re: Need help to for access programming
- From: "mensanator@xxxxxxx" <mensanator@xxxxxxx>
- Date: 22 Jun 2006 11:13:54 -0700
ma_041964@xxxxxxxx wrote:
I have a query with the name "A" and "B". I want ro write a program
which do following steps:
1. Open the query "A"
2. Copy all the query "A"
3. Create a text file in c:\temp\ab.txt
4. Paste the copied query "A" into c:\temp\ab.txt
5.Open the query "B"
6. Copy all the query "B"
7. Paste the copied query "B" into c:\temp\ab.txt (append mode)
8. close the file c:\temp\ab.txt
9. Open the file c:\temp\ab.txt with the notepad
I was able to do step 1 but the rest goes beyond what i know about
access:
Function TERMINE()
On Error GoTo TERMINE_Err
DoCmd.OpenQuery "A", acViewNormal, acEdit
ND RB NO LOCALISATION", acViewNormal, acEdit
TERMINE_Exit:
Exit Function
TERMINE_Err:
MsgBox Error$
Resume TERMINE_Exit
End Function
Thank You for Your help!
Here's an example that writes a single query to a text file.
It includes more than you asked for, but the examples illustrate
points that are non-intuitive and can burn you later. If your query
doesn't get criteria from forms, just comment out those parts.
You would do the same thing for query B, only you want to
use Open (f) For Append As #1 instead of Open (f) For Output As #1.
Private Sub Command38_Click()
'export incoming to TB
'On Error GoTo Err_Command38_Click
Dim db As Database
Dim qdf As QueryDef
Dim hist As Recordset
Dim rec As Long
Dim the_sql, who, where, f, proj As String
Dim s1, s2 As String
'path & filename taken from Form
proj = [Forms]![terrabase_incoming_SDG_picker]![List36]
who = [Forms]![terrabase_incoming_SDG_picker]![List2]
where = [Forms]![terrabase_incoming_SDG_picker]![path]
f = where & "\" & proj & "_" & who & "_incoming" & ".txt"
'EXAMPLE
' if default path on form is D:\dataout
' if project 1000 selected from form project list
' if SDG 6F666666 selected from form SDG list
' then f = D:\dataout\1000_6F666666_incoming.txt
Set db = CurrentDb()
'use an existing query
'
Set qdf = db.QueryDefs("labdeliverable_SDG_export_to_TB")
'set parameter used by criteria?
'[Forms]![SDG_picker]![List2]
'
'yes, just like xtabs that must have parameters set when using form
' objects as criteria, a regular query that uses such criteria
' must have the corresponding "parameter" set when using VB
' to do an OpenRecordset
'this is the criteria for the [sdg] field in the query. it will not
' be set automatically, we have to get it and stuff it into
' the querydef (even if it is already set in the querydef
parameter list)
'
' add project criteria for those SDGs that have samples from
multiple projects
'
'List2 is the SDG selected
s1 = [Forms]![terrabase_incoming_SDG_picker]![List2]
'List36 is the project selected
s2 = [Forms]![terrabase_incoming_SDG_picker]![List36]
'Note no brackets inside brackets
'
qdf![Forms!terrabase_incoming_SDG_picker!List2] = s1
qdf![Forms!terrabase_incoming_SDG_picker!List36] = s2
'open the query
Set hist = qdf.OpenRecordset
'report how many records query returnd
hist.MoveLast
rec = hist.RecordCount
MsgBox (rec & " lab records")
'skip if query returned nothing
If rec > 0 Then
'open the text file for writing - use "For Append" to add to
existing file
Open (f) For Output As #1
'return to first record to begin output
hist.MoveFirst
'process each record until we run out - note that the record
count
'reported earlier could change while we are running! Better to
'check for EOF than try to track how many we've written.
While Not hist.EOF
'process a single record
'in this example, the text output desired is pipe (|)
delimited
'a single string, properly delimited, will be constructed
and
'then written to the text file. for each field to be
appended,
'modifications may be necessary.
With hist
s1 = .Fields(0) & "|" '[laboratory
id]
s1 = s1 & .Fields(1) & "|" '[project id]
s1 = s1 & .Fields(2) & "|" '[sdg]
s1 = s1 & .Fields(3) & "|" '[analytical
fraction]
'[site sample id] CANNOT exceed 25 chars - will NOT
import into TB!
' excess MUST be trimmed off resulting in truncated
date codes,
' FD markers (which are incorrect format anyway) or
other LABQC
' flags. EDD processing should have set critical fields
already.
s1 = s1 & Left$(.Fields(4), 25) & "|" '[site sample
id]
s1 = s1 & .Fields(5) & "|" '[sample date]
s1 = s1 & .Fields(6) & "|" '[top depth]
s1 = s1 & .Fields(7) & "|" '[middle depth]
s1 = s1 & .Fields(8) & "|" '[bottom depth]
s1 = s1 & .Fields(9) & "|" '[sample point
id]
s1 = s1 & .Fields(10) & "|" '[lab sample
id]
s1 = s1 & .Fields(11) & "|" '[lab sample
type]
s1 = s1 & .Fields(12) & "|" '[matrix]
s1 = s1 & .Fields(13) & "|" '[field sample
classification]
s1 = s1 & .Fields(14) & "|" '[filtration
method]
s1 = s1 & .Fields(15) & "|" '[extraction
date]
s1 = s1 & .Fields(16) & "|" '[prep date]
s1 = s1 & .Fields(17) & "|" '[analysis
date]
s1 = s1 & .Fields(18) & "|" '[instrument
id]
'[rough percent moisture] field in TB can't hold
floating point
'output from Excel. Idiots.
If Not IsNull(.Fields(19)) Then
s2 = Format$(Val(.Fields(19)), "0.0")
Else
s2 = ""
End If
s1 = s1 & s2 & "|" '[rough percent
moisture]
s1 = s1 & .Fields(20) & "|" '[dilution
factor]
s1 = s1 & .Fields(21) & "|" '[analyte type]
s1 = s1 & .Fields(22) & "|" '[analytical
method]
s1 = s1 & .Fields(23) & "|" '[cas]
s1 = s1 & .Fields(24) & "|" '[Parameter]
s1 = s1 & .Fields(25) & "|" '[retention
time]
s1 = s1 & .Fields(26) & "|" '[detection
limit]
s1 = s1 & .Fields(27) & "|" '[result]
s1 = s1 & .Fields(28) & "|" '[lab
qualifier]
s1 = s1 & .Fields(29) '[units]
'done processing record, s1 is now a string containing one
complete
'line for the output file
End With
'write the line to the output file
Print #1, s1
'advance to the next record in the query, EOF with set if
there are no more
hist.MoveNext
Wend
End If
'close the text file
Close #1
'close the query
hist.Close
Exit_Command38_Click:
Exit Sub
Err_Command38_Click:
MsgBox Err.Description
Resume Exit_Command38_Click
End Sub
.
- References:
- Need help to for access programming
- From: ma_041964@xxxxxxxx
- Prev by Date: Re: domain-specific knowledge
- Next by Date: Re: Difference between VC++ and UNIX
- Previous by thread: Re: Need help to for access programming
- Next by thread: question
- Index(es): | http://coding.derkeiler.com/Archive/General/comp.programming/2006-06/msg00932.html | CC-MAIN-2015-32 | refinedweb | 982 | 68.57 |
Use Azure Storage Explorer to manage directories and files in Azure Data Lake Storage Gen2
This article shows you how to use Azure Storage Explorer to create and manage directories and files in storage accounts that has hierarchical namespace (HNS) enabled.
Prerequisites
An Azure subscription. See Get Azure free trial.
A storage account that has hierarchical namespace (HNS) enabled. Follow these instructions to create one.
Azure Storage Explorer installed on your local computer. To install Azure Storage Explorer for Windows, Macintosh, or Linux, see Azure Storage Explorer.
Note
Storage Explorer makes use of both the Blob (blob) & Data Lake Storage Gen2 (dfs) endpoints when working with Azure Data Lake Storage Gen2. If access to Azure Data Lake Storage Gen2 is configured using private endpoints, ensure that two private endpoints are created for the storage account: one with the target sub-resource
blob and the other with the target sub-resource
dfs.
When you first start Storage Explorer, the Microsoft Azure Storage Explorer - Connect window appears. While Storage Explorer provides several ways to connect to storage accounts, only one way is currently supported for managing ACLs.urite storage emulator, Cosmos DB accounts, or Azure Stack environments.
Create a container
A container holds directories and files. To create one, expand the storage account you created in the proceeding step. Select Blob Containers, right-click, and select Create Blob Container. Enter the name for your container. See the Create a container section for a list of rules and restrictions on naming containers. When complete, press Enter to create the container. Once the container has been successfully created, it is displayed under the Blob Containers folder for the selected storage account.
Create a directory
To create a directory, select the container that you created in the proceeding step. In the container ribbon, choose the New Folder button. Enter the name for your directory. When complete, press Enter to create the directory. Once the directory has been successfully created, it appears in the editor window.
Upload blobs to the directory
On the directory ribbon, choose the Upload button. This operation gives you the option to upload a folder or a file.
Choose the files or folder to upload.
When you select OK, the files selected are queued to upload, each file is uploaded. When the upload is complete, the results are shown in the Activities window.
View blobs in a directory
In the Azure Storage Explorer application, select a directory under a storage account. The main pane shows a list of the blobs in the selected directory.
Download blobs
To download files by using Azure Storage Explorer, with a file selected, select Download from the ribbon. A file dialog opens and provides you the ability to enter a file name. Select Save to start the download of a file to the local location.
Next steps
Learn how to manage file and directory permission by setting access control lists (ACLs) | https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-explorer?WT.mc_id=AZ-MVP-5003408 | CC-MAIN-2021-39 | refinedweb | 484 | 57.57 |
9.1.2019 Project Euler Problem 001 with Haskell
Recently I, mostly used to object oriented programming languages like C++ and Java) started learning Haskell to get some untainted impression of the functional programming style. Of course, I’ve used some functional programming in Java 8, JavaScript and Kotlin, but I wanted it pure to get new insights.
About Haskell
Haskell[1] is a purely functional, lazily evaluated, strongly typed programming language with high use of type inference. In Haskell there are no explicit loops, no gotos and no modifiable variables (strict immutability[2]). Sounds rigid? That’s the challenge!
About Project Euler
Then I’ve found Project Euler[3], a collection of programming problems ideal to learn new programming languages. So I started and implemented its first challenge using Haskell:
Problem 001: Sum of Multiples[4]
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000!
{-# LANGUAGE ExtendedDefaultRules #-} -- the pragma above is for some automatic type conversions module Main where import Data.List (nub) -- keeps only the first occurrence of each element import Text.Printf import System.IO -- found this solution by accident while looking up a function for 'unique' in Haskell: simple_euler_001 = (sum . nub) ([3,6..999] ++ [5,10..999]) -- ======================================================== -- and here my solution: -- -------------------------------------------------------- javagil_euler_001 :: Int -> Int-> Int -> Int javagil_euler_001 n m below = sum $ nub $ (multiplesOfBelow n below) ++ (multiplesOfBelow m below) where multiplesOfBelow i below = [i,(2*i)..(below-1)] -- ======================================================== main :: IO () main = do printf "javagil Euler 001: for 3, 5 below 10) = %d (expected: 23)\n" (javagil_euler_001 3 5 10) printf "javagil Euler 001: for 3, 5 below 1000) = %d\n" (javagil_euler_001 3 5 1000) printf " simple Euler 001: for 3, 5 below 1000) = %d\n" simple_euler_001
Isn’t the simple solution amazingly simple?
Speaking about my solution: Seems I over engineered by using a parameterized function instead of constants. Ok, for an excuse, I was not yet used to how Project Euler means it’s problem descriptions ;-=)
Let’s point it out: The core of the solution, not counting the frame of the program like
import
and the
printf is just 1 line of optional[5] type declaration and 3 lines of code.
[1]: Haskell:
[2]: Application state can only be kept either on the stack or outside of the Haskell world which is accessible through IO functions.
[3]: Project Euler Problems:
[4]: Project Euler Problem 1:
[5]: Te type of
javagil_euler_001 could be inferred automatically as done for
simple_euuler_002. | https://michael.hoennig.de/2019/01/09/project-euler-problem-001-with-haskell/ | CC-MAIN-2019-22 | refinedweb | 437 | 58.01 |
gcov
Table of Contents
1 How to run
Compile your program with two flags
gcc -fprofile-arcs -ftest-coverage a.c
This will produce
a.gcda (arcs) and
a.gcno (coverage).
Then run the program by
./a.out
run
gcov in the same directory:
gcov a.c
This will produce the coverage, and create a
a.c.gcov file.
2 Different options
When invoking gcov, you can control the output format:
gcov -b a.c: output branching information
3 .gcov file format
ExeCount : linum : line
# in the ExeCount means no execution.
4 Gprof
Compile and link with the
-pg option.
When running the program, a
gmon.out will be produced.
It will overwrite if the file exists.
Running the
gprof is like:
gprof options exe-file profile-data-file
exe-file defaults to
a.out,
profile-data-file defaults to
gmon.out.
As I tried, this is not friendly for C++ programs. The output is full of STL namespace.
5 Some experience
- The coverage information will accumulate: run a second time, it will possibly increase.
- branches executed is the for the head of branch.
- branches taken at least once is for the ordinary branch coverage | http://wiki.lihebi.com/gcov.html | CC-MAIN-2017-22 | refinedweb | 195 | 71 |
#include <pslib.h>
void PS_begin_glyph(PSDoc *psdoc, const char *glyphname, double wx, double llx, double lly, double urx, double ury)
Starts a new glyph within a Type3 font. The glyph itself can
be created with a subset of the regular drawing functions like
PS_lineto(3). The glyphname is abitrary but usually something found in the input encoding vector
to be accessible by PS_show(3).
The floating point paramters describe the widht and the lower left and upper right corner of the bounding box surrounding the glyph.
Each call of PS_begin_glyph must be accompanied by a call to PS_end_glyph(3).
PS_begin_glyph has been introduced in version 0.4.0 of pslib.
PS_end_glyph(3), PS_begin_font(3), PS_end_font(3)
This manual page was written by Uwe Steinmann uwe@steinmann.cx. | http://www.makelinux.net/man/3/P/PS_begin_glyph | CC-MAIN-2015-22 | refinedweb | 127 | 56.86 |
is there an equivalent for WPF ContentPropertyAttribute in Silverlight clr?
I mean I'm creating some custom control. the control contains a custom children collection. I want the xaml reader to add xaml children to that collection. so instead of
<control>
<control.children>
<child1 />
<child2 />
<child3 />
<control.children>
</control>
I want to be able to write
<child3 />
Hm.... Im wondering then how does XamlReader know that it should add <Canvas>'s xaml tag children to Canvas.Children collection?
The restriction only applies to custom controls, not to Silverlight native objects.
-- bryantBlog | Twitter_________________Dont forget to click "Mark as Answer" on the post that helped you.
I've got this to work before. What I did is import the right namespaces, create a dependency property for the children collection "Collection(of Child)" and decorate the class with the ContentProperty attribute and point it to your collection property name.
Imports
<ContentProperty(
Public
Yes, the ContentPropertyAttribute now exists. It didn't back when this thread was active since that was the 1.1 days. | http://silverlight.net/forums/p/879/1808.aspx | crawl-002 | refinedweb | 170 | 59.8 |
PostgreSql database is by default installed on port number 5432. Python interface to PostgreSql is provided by installing psycopg2 module. Assuming that test database and employee table with fname, sname, age, gender and salary fields is available.
First establish connection and obtain cursor object by following statements in Python script.
import psycopg2 conn = psycopg2.connect(database = "test", user = "postgres", password = "pass123", host = "localhost", port = "5432") cur = conn.cursor()
Data to be inserted in employee table is stored in the form of tuple object
t1=('Mac', 'Mohan', 20, 'M', 2000)
Next set up the insert query using this tuple
sql="insert into employee values(%s,%s,%d,%s,%d)" %t1
Now this query is executed using the cursor object
cursor.execute(sql)
Result of this statement will be that employee table will show new record added in it. | https://www.tutorialspoint.com/How-to-insert-a-Python-tuple-in-a-PostgreSql-database | CC-MAIN-2022-05 | refinedweb | 137 | 55.64 |
I'm failry new to C++ programming, and I'm at the point where I'm starting to learn classes. I'm using C++ for Dummies and various online tutorials, and I was trying to make a very basic program utilizing a class, since a lot of the examples I'm finding are fairly compplex (at least for me right now).
Basically, I'm trying to prompt the user to enter their first and last name, then get them displayed both together, using a class. I know how this could be done using just arrays or strings and displaying each name separately, but it's my understanding that by using a class, you can sort of consolidate the info. If you could steer me in the right direction, I'd really appreciate it - this code is getting all kinds of compile errors.
Code:
#include <stdlib.h>
#include <iostream.h>
using namespace std;
class testClass
{
public:
char firstName[10];
char lastName[12];
};
int main()
{
testClass tc;
cout << "Enter your first name:\n";
cin >> tc.firstName;
cout << "Enter your last name:\n";
cin >> tc.lastName;
cout << "Here's what you entered:\n";
cout << tc;
cin.ignore();
cin.get();
return 0;
}
Also, I know if I wanted to, I could simply put
Code:
cout << tc.firstName << tc.lastName;
and that would display the first and last name, but aren't you supposed to be able to display all components of a class with just one command? I thought that was the magic of a class. | http://cboard.cprogramming.com/cplusplus-programming/79927-basic-help-class-structure-printable-thread.html | CC-MAIN-2014-15 | refinedweb | 252 | 70.53 |
# PVS-Studio for Visual Studio

Many of our articles are focused on anything, but not the PVS-Studio tool itself. Whereas we do a lot to make its usage convenient for developers. Nevertheless, our efforts are often concealed behind the scenes. I decided to remedy this situation and tell you about the PVS-Studio plugin for Visual Studio. If you use Visual Studio, this article is for you.
What is static code analysis and why we need it
-----------------------------------------------
Static code analysis is the process of detecting errors and flaws in the source code of programs. Static analysis can be considered as a process of automated code review. Joint [code review](https://www.viva64.com/en/t/0073/) is a wonderful methodology. However, it has a significant drawback — high cost. It's necessary to gather several programmers to review newly written or rewritten code after the modifications made in it.
On the one hand, we want to review code regularly. On the other hand, it is too expensive. The compromise solution is static analysis tools. They earnestly analyze the source code of programs and give recommendations to programmers on reviewing certain code fragments. Of course, a program won't substitute a full-fledged code review, done by a team of developers. However, the ratio price/benefits makes the static analysis quite a useful practice, applied by many companies. If the reader is interested in precise numbers, I suggest you reading the article "[PVS-Studio ROI](https://www.viva64.com/en/b/0606/)".
There are many commercial and free static code analyzers. A large list of static analyzers is available on Wikipedia: [List of tools for static code analysis](https://en.wikipedia.org/wiki/List_of_tools_for_static_code_analysis). The list of languages for which there are static code analyzers is quite large (C, C++, C#, Java, Ada, Fortran, Perl, Ruby, ...). Needless to say, we will tell you about the PVS-Studio [analyzer](https://www.viva64.com/en/pvs-studio/).
The main advantage of static code analysis is the opportunity to greatly reduce the cost of eliminating defects in a program. The earlier an error is detected, the less expensive it is to correct it. Thus, according to the book «Code Complete» by McConnell, error detection at the code testing stage is ten times more expensive than at the stage of code designing (coding):

*Figure 1. Average cost of correcting defects depending on the time of their appearance and detection in code (data in the table is taken from the book 'Code Complete' by S. McConnell)*
Static analysis tools allow detecting a large number of errors, typical for the stage of code designing, which significantly reduces the cost of the whole project development. For example, the PVS-Studio static code analyzer can be run in a background mode right after compilation and in case of finding potential errors will notify a programmer. More on this mode will be given below.
PVS-Studio Static Code Analyzer
-------------------------------
PVS-Studio is a static analyzer that detects bugs and potential vulnerabilities in the source code of applications in C, C++ (other supported extensions: [C++/CLI](https://ru.wikipedia.org/wiki/C%2B%2B/CLI) and [C++/CX](https://ru.wikipedia.org/wiki/C%2B%2B/CX)), C# and Java on Windows, Linux and macOS platforms. The analyzer is superbly integrated into the Visual Studio 2010 — 2019 and IntelliJ IDEA IDEs. In this article, we'll take a closer look at PVS-Studio, checking the code in C, C++, and C# languages. You can read about how to use PVS-Studio to check Java code in IntelliJ IDEA [here](https://www.viva64.com/en/m/0044/).
After PVS-Studio installation and its integration in Visual Studio, users get an additional item «PVS-Studio» in the main menu and the window for working with error messages:

*Figure 2. The main items that the PVS-Studio analyzer adds when integrating into Visual Studio.*
### Initial Settings
The analyzer is ready to work right after installation. In most cases, you don't need to configure anything for the first run. The only setup you might need in the beginning is the exclusion of third-party libraries. You're not going to fix anything in the original files, for example, the jpeg library, so there's no need to check it. In addition, excluding of unnecessary folders will speed project analysis up. The directory's exceptions are set here: PVS-Studio > Options… > Don't Check Files > PathMasks (see Figure 3).

*Figure 3. Editing a list of directories that the analyzer won't check.*
If in the full file name there is one of specified names, the analysis won't be performed for this file. By default, names of some directories are already included in the list. However, in your project, the directory with the ZLib library can be called not «zlib», but, for example, «zip\_lib». Therefore, this list should be edited. To start editing, you need to click a button with three points.
Examples of acceptable masks for the PathMasks list:
* c:\Libs\ — all files in this directory and its subdirectories will be excluded.
* \Libs\ or \*\Libs\\* — all files in the directories, the path to which contains the subdirectory «Libs» will be excluded. If the symbols "\*" aren't specified, they will be added automatically anyway, so both options are equal.
* Libs or \*Libs\* — all files, the path to which contains the subdirectory, the name of which is equal to or contains 'Libs'. Also in this case all files, containing Libs in their name, for example, c:\project\mylibs.cpp, will be excluded. To avoid confusion, we recommend to always use slashes.
In addition to excluding entire directories, you can set masks to exclude individual files. To do this, there is the setting FileNameMasks. Find out more about how to work with exception lists in the documentation: [Settings: Don't Check Files](https://www.viva64.com/en/m/0014/).
### Project Check
When you complete the initial settings, you can start checking the project. PVS-Studio for Visual Studio supports checking of C++ (.vcxproj) and C# (.csproj) projects. You can also immediately try to check the entire solution, which contains projects of these types. To do this, select the Extensions menu item Extensions > PVS-Studio > Check > Solution (See Figure 4).

*Figure 4. Check of a solution using the PVS-Studio analyzer.*
If there are some difficulties with the check, we recommend referring to the section "[PVS-Studio: Troubleshooting](https://www.viva64.com/en/m/0029/)" on our website. These are not stupid recommendations in the spirit of «check that the plug is inserted into the socket.» The section describes typical situations of users' requests and suggests options.
### Working With a List of Diagnostic Messages
After the check, all diagnostic messages will be displayed in a special window. The window has many control components. All of them serve to show exactly those diagnostic messages that are interesting to the user. However, at the first moment the window may seem complicated. Let's look at all control components (see Figure 5).

*Figure 5. A window with diagnostic messages.*
1. Well, here is the PVS-Studio window.
2. Additional menu. Allows you to access options such as marking warnings as false, hiding messages, adding files to exceptions (read about this below).
3. The button enables messages «something went wrong.» For example, one of the files can't be preprocessed.
4. Go to the previous/next message. This opens the relevant file and the cursor is placed on the line with a potential error. Also you can always select a diagnostic from the list with a double click. You can [set hot keys](https://www.viva64.com/en/b/0296/) for transitions to the previous/next message. By default, it's Alt+'[' and Alt+']'.
5. Buttons that include warnings of different levels. The first two diagnostic levels are now enabled. At the same time, the window shows 90 warnings of the first level, 6700 warning of the second level. The message level is shown on the left side of the window as a strip, corresponding to the strip color on the matching level button. Why are there so many triggerings? Why 6700 warnings? To demonstrate the abilities of the interface, a set of [MISRA](https://www.viva64.com/en/b/0596/) rules is enabled, which is inappropriate for regular applications :).
6. Active sets of diagnostic rules. General — general diagnostics, Optimization — micro-optimization, 64-bit — 64-bit diagnostics, MISRA — MISRA C and MISRA C++ standards diagnostics. All kinds of warnings are now displayed in the window.
7. The indicator shows the number of warnings, marked as false (False Alarms). You can enable/disable display of marked messages in settings — PVS-Studio > Options… > Specific Analyzer Settings > Display False Alarms.
8. Quick filters. For example, you can shorten the list to only messages with V501 code and the ones in the XYZ project.
9. Some diagnostics suggest paying attention not to one, but several lines. In this case, dots appear next to the line number. Clicking on it, you can see the list of lines and choose one of them.
The table with diagnostic messages is divided into the following columns:
* **Level.** The level of certainty which indicates that an error, not a code smell was found. Level 1 (red) shows the most suspicious places. Level 3 (yellow) is probably a non-essential inaccuracy in the code.
* **Star.** It doesn't have a specific purpose. Users can interpret it as they wish. For example, a user can mark the most interesting warnings for further careful analysis. The analogy is the star mark of emails in mail clients like Thunderbird or Outlook.
* **ID.** Unique message number. It can be useful when dealing with a large list. For example, you can go to a message with a specific number (see «Navigate to ID...» in the [context menu](https://www.viva64.com/en/m/0021/)).
* **Code**. Message code. If you click on it, you'll open a page describing the warning.
* **CWE.** Allows you to [identify](https://www.viva64.com/en/cwe/) a warning by the CWE (Common Weakness Enumeration) code. When you click on the link, you can see a description of this CWE in the network.
* **MISRA.** Same as above, but for the [MISRA standard](https://www.viva64.com/en/b/0596/).
* **Message**. The text of the diagnostic message.
* **Project**. Project name (you can disable this column using a context menu).
* **File**. File name.
* **Line**. Line number. **Important!** Note that some lines end with dots. Example: «123 (...)». By clicking on this number, you'll get a list of all the lines of code that relate to this message. At the same time, you can go to each of the lines in the list.
Yes, it was exhausting to read it all. However, I assure you, having started to use it, you will quickly get used to the tool. And you'll rarely click something to set up.
### Context Menu
So, by double clicking on the message, you go to the relevant piece of code. By the click of the right mouse button, the context menu opens.
The menu is quite simple, and I won't clutter the article with the description of each item. If something is not clear, you can look into the documentation.
Nevertheless, I'd like to dwell on one very useful feature. Do you remember that in settings you can add folders/files to be excluded? The thing is that adding something is much simpler than it seems!
Pay attention to the menu option «Don't check files and hide all messages from...». When you click on it, you get a list of paths that you can add to the exceptions (see figure 6).

*Figure 6. Excluding files from the check.*
You can choose a separate file or one of the directories. The picture shows that the folder «SDL2-2.0.9\src\haptic\windows» is chosen. This means that all the files in this folder and all subfolders will be excluded from the analysis. What's more, all messages related to these files will disappear from the list immediately. Very convenient. You don't need to restart the analysis to remove all messages related to the tests.
Incremental Analysis Mode
-------------------------
Introduction to PVS-Studio will be incomplete, if we conceal one of the most important features — [incremental code analysis](https://www.viva64.com/en/m/0021/).
The earlier an error is detected, the less expensive it is to eliminate it. The best option is to highlight errors in the edited program text straight away. However, it is technically difficult and resource-intensive. That's why PVS-Studio runs in the background mode when the fixed code is successfully compiled. In so doing, you look for bugs in the code that has just been changed. The icon in the system notification area indicates that the analysis is running.
When an error is found, a pop-up window appears, warning of danger (see Figure 7).

*Figure 7. A pop-up message, reporting that suspicious places have been found in edited files.*
If you click on the icon, you will open the IDE with the result of the project check (see Figure 2) and you can dig into suspicious code fragments.
In fact, it's easier to try working in this mode than to describe it. You write the code as before. When it is needed, the analyzer will disturb you. Give it a shot!
We use this mode all the time. Yes, we also sometimes make coding errors. The ability to fix them immediately significantly reduces the time for detecting the defect and trying to understand why the program is not behaving as intended. It's very upsetting to spend 15-20 minutes debugging to eventually find a typo in the index. Here's one of the cases when PVS-Studio found an error in PVS-Studio right after it appeared in the code:
```
if (in[0] == '\\' && in[1] == '.' && in[1] == '\\')
{
in += 2;
continue;
}
```
Well, the most interesting is yet to come. The PVS-Studio analyzer can sometimes be much more useful than this. Here's one of the reviews about our analyzer: "[A User's Experience of Working with the Analyzer](https://www.viva64.com/en/b/0221/)". The text makes me wonder.
Let me sum it up. Incremental analysis is something you should definitely try. You'll love it as soon as you find a couple of blunders in the fresh code.
PVS-Studio Capabilities
-----------------------
Let's be brief. It is impossible to succinctly describe all the diagnostics that are available in PVS-Studio. A full list of diagnostics and their detailed description can be found in the documentation: [Description of detected bugs](https://www.viva64.com/en/w/). Let's settle upon the table in which diagnostics are grouped by type. Some diagnostics are in more than one group. The fact is that classification is quite formal. For example, a typo can result in the use of uninitialized memory. Some of the errors, on the contrary, couldn't fit any of the groups, because they were too specific. Nevertheless, this table gives the insight about the functional of the static code analyzer.

*Figure 8. PVS-Studio capabilities.*
As you see, the analyzer is especially useful is such areas as looking for Copy-Paste bugs. It's great at detecting problems related to code security.
To see these diagnostics in action, have a look at the [error base](https://www.viva64.com/en/examples/). We collect all the errors that we've found, checking various open source projects with PVS-Studio.
SAST
----
PVS-Studio is a static application security testing tool. The analyzer can detect potential vulnerabilities in the project's code and show the appropriate error identifier in a certain classification.
PVS-Studio supports the following error classifications:
1. CWE
2. SEI CERT
3. MISRA
You can enable display of CWE codes by the context menu in the analyzer window by the path Show Columns > CWE

*Figure 9. Context menu and the example of CWE output.*
Or in the main menu (Extensions > PVS-Studio > Display CWE Codes in Output Window)

*Figure 10. Extension's menu.*
MISRA diagnostics are enabled separately in the settings:

*Figure 11. A list of detected errors.*
You can read more about these classifications [here](https://www.viva64.com/en/sast/).
Checking Projects From the Command Line
---------------------------------------
PVS-Studio\_Cmd.exe — a utility for checking C++/C# Visual Studio projects (.vcxproj/.csproj) and .sln solutions from the command line. It can be useful to automate the analysis. The program is in the directory where the installation was made — by default it is 'C:\Program Files (x86)\PVS-Studio'.
The program has many [parameters](https://www.viva64.com/en/m/0035/), but first we need only 3 of them:
* --target: project or solution file that needs to be checked.
* --output: plog file where the report needs to be written.
* --progress: show progress of a check.
Here's what the run will look like:

*Figure 12. Output of the PVS-Studio\_Cmd.exe program.*
After running we'll get a plog file with a report, a path to which we specified in the running options. You can convert this report in other formats using the PlogConverter.exe utility. To view the report in IDE, double click a plog file in the finder.
Also you can open the report file in the extension menu by the path Extensions > PVS-Studio > Open/Save > Open Analysis Report…

Detailed information on the utility and its parameters can be found in the [documentation](https://www.viva64.com/en/m/0035/).
False Positives Suppression
---------------------------
Some messages issued by the analyzer will inevitably be false. There's nothing we can do about it. A static analyzer is just a program that doesn't have artificial intelligence and can't pinpoint whether it's a real bug or not.
To fight against false positives, the analyzer provides a set of different mechanisms. They are detailed in the following sections of documentation:
* [Fine tuning](https://www.viva64.com/en/m/0017/).
* A [rough](https://www.viva64.com/en/m/0032/) method that only allows you to work with warnings related to new or modified code.
Conclusion
----------
Of course, we didn't tell you everything about the tool. If I you tell everything, the article will turn into documentation. The aim was to show how easy it is to work with the tool within the Visual Studio environment. You can read about other environments and modes of work in the documentation and other articles on our [website](https://www.viva64.com/en/pvs-studio/). There are a lot of interesting things for programmers, by the way. Come and hang around.
It's worth noting that PVS-Studio doesn't just work in Microsoft environment. We also support the Java language, we can work on Linux and macOS, integrate into CMake and much more. You can find out more in the [documentation](https://www.viva64.com/en/m/).
I wish you bugless bad code and hope you'll enjoy PVS-Studio. If there are any questions, we will always help and give advice. [Write to us](https://www.viva64.com/en/about-feedback/).
Additional links:
-----------------
1. [Code review](https://www.viva64.com/en/t/0073/).
2. [Static Code Analysis](https://www.viva64.com/en/t/0046/).
3. [Static code analysis tools](https://www.viva64.com/en/t/0074/).
4. [SAST](https://www.viva64.com/en/sast/).
5. [Technologies used in the PVS-Studio analyzer](https://www.viva64.com/en/b/0592/).
6. [Download](https://www.viva64.com/en/pvs-studio-download/) and try PVS-Studio.
7. [Visual Studio 2019 Support](https://www.viva64.com/en/b/0630/).
8. Discuss the price of the PVS-Studio analyzer for you team and how to purchase it: [buy PVS-Studio](https://www.viva64.com/en/order/).
9. [Example of using a static analyzer](https://www.viva64.com/en/b/0221/).
10. [Answers](https://www.viva64.com/en/b/0593/) to questions that are often asked at conferences.
11. [How to run PVS-Studio Java](https://www.viva64.com/en/m/0044/)
12. [How to run PVS-Studio on Linux and macOS](https://www.viva64.com/en/m/0036/) | https://habr.com/ru/post/458068/ | null | null | 3,698 | 50.84 |
the actual gimp pkg version is 2.10.24 on Fbsd 13, kde plasma 5.22.4
gimp is basically working, but not the plugins, gmic is not even appearing in the menu, resynthesizer also not as well as other plugins for example some installed FUs are not there
I have py27 installed as default version for gimp and the py plugins should work, I know they are ok, because I have them working through the latest gimp versions since 2.10.something, only that they are linux machines
specialy I am interested in plugin-heal-selection.py because it is important for my work
eventually the point is this startup error
File "/usr/local/libexec/gimp/2.2/plug-ins/plugin-resynth-fill-pattern.py", line 33, in <module>
from gimpfu import *
ModuleNotFoundError: No module named 'gimpfu'
all failing plugins are claiming "No module named 'gimpfu'" but gimpfu is in the expected place, well, I guess it is
/usr/local/libexec/gimp/2.2/plug-ins/script-fu/script-fu*
I created sym links 2.0 and 2.1 to 2.2 because no effect
I hope you can help me here
thanks | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258868 | CC-MAIN-2021-49 | refinedweb | 194 | 55.34 |
I dont know anything about python ,so i begin to read manuals etc from various locations.
But i have a basic question here, please if someone know help
Thanks .
Look at this :
<a href=\"file://", lease, "\">
The "lease" is just a variable that receive a IP address that my python read from a file.
But when i see in the page appear with a space like this
file:// ipaddress
-------|---------
This space can't exist !!!!
How can I avoid this little space problem ? It's just a simple program to read my dhcpd.leases and take the IP'S and Name's of people connected then show into a page.
When the person click on the IP then the browser open the shared resources .
Vary simple, but i don't know how avoid this
Thanks alot !!!
Carlos.
Here is the complete file .
----------------------------------
#!/usr/bin/python
import string, os
from sys import stdout
#-------
#LeaseFile = "/etc/dhcpd.leases" # if you have Redhat before 6.1
LeaseFile = "/var/lib/dhcp/dhcpd.leases" # if you have Redhat 6.1 or later
#------- Markers
# Entries in the /etc/dhcpd.leases file start with the word 'lease',
# may span several lines, and then end with a '}'. Lines that start
# with a TAB (\t) descibe the lease, i.e. mac address, start, etc.
newleaseMarker = 'l' # lease starts with 'l'
endleaseMarker = '}' # ends with a '}'
infoMarker = '\t' # lease informational lines start with a TAB
startsMarker = '\ts' # \tstarts
endMarker = '\te' # \tend
abandonedMarker = '\ta' # \tabandoned
clientMarker = '\tc' # \tclient
uidMarker = '\tu' # \tuid
hardwareMarker = '\th' # \thardware
# ------- Date arrays (pretty print the date)
weekday = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
nthday = ["", "]
#------- HTML Setup
print "Content-Type: text/html\n\n" # CGI header
print "<HTML><HEAD><LINK REL=\"stylesheet\" HREF=\"/lanlord/lanlord.css\">"
#------- Start the real work
indate = os.popen('date +"%A %B %m %r %Y"', 'r') # Get todays date
datedata = string.split(indate.readline())
today = string.atoi(datedata[2]) -1
print "</HEAD><BODY BGCOLOR=\"#ffffff\">"
print "<h3>DHCP Lease Report for", datedata[0], datedata[1], nthday[(today)], datedata[3], datedata[5], dated
ata[4], "</h3>"
input = open(LeaseFile, 'r') # Open the leases file
L = { } # Initialize hash
for line in input.readlines():
if line[:1] != newleaseMarker:
if line[:1] != endleaseMarker:
if line[:2] == startsMarker:
sDayLeased = line[8:9]
sDateLeased= line[10:20]
sHourLeased = line[21:len(line) -2]
elif line[:2] == endMarker:
eDayLeased = line[6:7]
eDateLeased= line[8:18]
eHourLeased = line[19:len(line) -2]
elif line[:2] == abandonedMarker:
macLeased = "<em>Abandoned</em>"
elif line[:2] == clientMarker:
clientLeased = "<b>" +line[18:len(line) -3] + "</b>"
elif line[:2] == uidMarker:
pass # get any MAC address
off hardware line
elif line[:2] == hardwareMarker:
macLeased = line[19:len(line) -2]
else:
## print "**UNKOWN**", # Not one of the 'usual suspe
cts'
pass
else:
sd = string.atoi(sDayLeased)
ed = string.atoi(eDayLeased)
entry = macLeased + "*" + clientLeased + "*" + weekday[sd] + "*" + sDateLeased + "*"
+ sHourLeased + "*" + weekday[ed] + "*" + eDateLeased + "*" + eHourLeased
L[ipLeased] = {`ipLeased` : `entry`}
else:
ipLeased = line[6:len(line) -3]
clientLeased = 'None'
macLeased = 'None'
print "<h5>", len(L), " leases</h5><Table border=\"1\"><th>IP Address</th><th>Hostname</th><th>Lease Start</t
h><th>Lease End</th><th>MAC Address</th>"
dhcpLease = L.keys()
dhcpLease.sort()
for lease in dhcpLease:
infoLease = L[lease]
dataLease = infoLease.values()
infoLease = dataLease
lLease = string.splitfields(`infoLease`,"*")
lMac = lLease[0][3:21]
lDate = lLease[7][0:8]
print "<TR><td>", lease, "</td><td>", lLease[1],"</td><td>", lLease[2], lLease[4], lLease[3], "</td><
td>", lLease[5], lDate, lLease[6], "</td><td>",lMac,"</td></tr>\n"
print "</table><p><a href=\"file://", ipLeased, "\">Test Part</a></p></body></html>"
- End file
Just rename it into the cgi-bin with name test.cgi to see it working.
Can someone help here !!!
Thanks again . | http://forums.devshed.com/python-programming-11/python-http-64425.html | CC-MAIN-2017-22 | refinedweb | 613 | 65.52 |
Neovolve.Schema.Extensions 1.0 released
Neovolve.Schema.Extensions is a project that will do entity mapping for web reference code generations from a WSDL.
When you update a web reference in the Visual Studio IDE, it will get the latest version of the WSDL and generate code to access the web service. As part of this process, it will generate any object types that are exposed by the web service. If you have access to those object definitions on the consumer end point, you will have problems with these object types because the code generated Reference.cs class will use it’s own code generated versions of your object types rather than the ones you really want to use.
The schema extensions get around this problem. When the IDE updates a web reference, it will check against the schema extensions to ask whether the extension understands the object type. The extension has the opportunity to return a different object type, include namespaces and also include assembly references.
This project is configuration driven so that when a web service changes, the configuration can be changed to support the new entity mappings.
After the package is installed, add your object mappings to the configuration file. The configuration for the mappings looks like this:
) | https://www.neovolve.com/2006/10/24/neovolveschemaextensions-10-released/ | CC-MAIN-2020-05 | refinedweb | 212 | 54.12 |
SFTP Transport Reference
The Secure Shell (SSH) File Transfer Protocol (SFTP) transport allows files to be read and written to and from directories over SFTP. Unlike the Virtual File System (VFS) transport, it can handle large files because it streams message payloads. The SFTP transport can be used as an inbound or an outbound endpoint. Files can be retrieved from an SFTP server and processed as Mule messages, or Mule messages can be uploaded as files to an SFTP server. Mule uses the JCraft library for SFTP SSH.
S
Considerations
You can use the SFTP transport to download from or upload to a secured resource accessible via SFTP. This transport does not currently support transactions policies. Some uses for the SFTP transport are downloading data into a database and picking up files and uploading them via SFTP. You can use this transport to implement the file transfer Enterprise Integration Pattern. As explained in the EIP book, the file transfer pattern allows you to loosely couple two applications together, with delays in processing time. If your integration is time-sensitive, you may want to look at implementing the messaging pattern with the JMS transport which can give you closer to real-time processing.
Using the SFTP transport allows you to optionally use streaming support for larger files and asynchronous and synchronously chain other endpoints with an SFTP endpoint. It also allows you to use Mule’s robust error handling in your Mule application.
The examples on this page show how to define SFTP inbound and outbound endpoints in your Mule application.
Features
Streaming support of resources
For inbound endpoints, poll the resource at a specified interval
For outbound endpoints, choices on how to handle duplicate files: throw and exception, overwrite, append a sequence number to the file name
Usage
To include the SFTP transport in your configuration:
Define these namespaces:
Define a connector:
Define an inbound and/or outbound endpoint:
Use an inbound endpoint if you want new files found on the SFTP site to trigger a Mule flow
Use an outbound endpoint if you want to upload files to an SFTP site. These files typically start as Mule messages and are converted to files.
Rules for Using the Transport
On the connector, you define the connection pool size, and your inbound and outbound temporary directories. The endpoint is where you define the authentication information, polling frequency, file name patterns, etc. See below for the full list of configuration options.
One-way and request-response exchange patterns are supported. If an exchange pattern is not defined, 'one-way' is the default.
This is a polling transport. The inbound endpoint for SFTP uses polling to look for new files. The default is to check every second, but it can be changed via the 'pollingFrequency' attribute on the inbound endpoint.
Streaming is supported by the SFTP transport and is enabled by default.
Example Configurations
The following example saves any files found on a remote SFTP server to a local directory. This demonstrates using an SFTP inbound endpoint and a file outbound endpoint.
*Important*: Before running this example, create an SFTP properties file:
Create the s properties file in your Classpath or set your PATH variable to the file’s location. For information on specifying SFTP server access information for a username, password, host, and port, using Anypoint Studio, see SFTP Connector.
Provide these parameters: them in the Mule configuration. | https://docs.mulesoft.com/mule-user-guide/v/3.8/sftp-transport-reference | CC-MAIN-2017-09 | refinedweb | 566 | 52.6 |
The QStyleOptionComboBox class is used to describe the parameter for drawing a combobox. More...
#include <QStyleOptionComboBox>
Inherits: QStyleOptionComplex.
Inherited by:
The QStyleOptionComboBox class is used to describe the parameter for drawing a combobox.
QStyleOptionButton contains all the information that QStyle functions need to draw QComboBComboBox.ComboBox, initializing the members variables to their default values.
Constructs a copy of the other style option.
This variable holds the icon for the current item of the combo box.
The default value is an empty icon, i.e. an icon with neither a pixmap nor a filename.
This variable holds the text for the current item of the combo box.
The default value is an empty string.
This variable holds whether or not the combobox is editable or not.
the default value is false
See also QComboBox::isEditable().
This variable holds whether the combo box has a frame.
The default value is true.
This variable holds the icon size for the current item of the combo box.
The default value is QSize(-1, -1), i.e. an invalid. | http://doc.qt.nokia.com/main-snapshot/qstyleoptioncombobox.html | crawl-003 | refinedweb | 174 | 69.89 |
Draw a curve with control points
Environment: VC++ 6.0
One friend asks me how to draw a curve with a couple of mouse clicking. I know there is way called "cubic spline" to draw the curve based on the control points. I search through the internet, try to find out a piece of existing code. Unfortunately, though there are plenty of webpage talking about it, but few sites really give out the working code. I did found some Java code was presented with mess of the other UI handling code; however, I have not found any C/C++ code to finish this job so far. And I am not really a Java lover....
- Include this header file into your C++ file.
- Create a spline object.
- Pump in the control points.
- Gernearte a curve by a simple code line: spline.generate();
- Get the curve points to your array.
- Paint the curve to your DC.
This is so easy and handy for my future UI curve drawing, and you can also adjust the curve smoothness degree by setting a defined factor in spline.h.
A known bug: the control points should be more than one, if only one control point are pass to the spline, it will crash, I will appreciate it if anybody fix the bug.
Here is the code where I generate the curve, MFC CArray is used for my points array
/ UpdateDialog(pDC->m_hDC);
How can I do for 3D courbe (with x,y and z)Posted by ybenaabud on 09/02/2009 08:35am
Hi, it is possible to make changes to the source code for doing the same thing but with 3D courbes think youReply
How to copy the points to my array?Posted by nidolap on 05/20/2007 07:38am
Hi! Can anyone tell me how can I get the curve points to my own array? Here is my source code : #include "stdafx.h" #includeReply
#include "spline.h"
int main(int argc, char* argv[])
{
float pontox[5] = {2, 4, 5, 8, 12};
float pontoy[5] = {300, 123, 250, 456, 111};
int n = 6;
Spline spline(pontox, pontoy, n);
spline.Generate();
int p = spline.GetCurveCount();
//spline.GetCurve(); ?????
cout << p << "\n";
cout << "\n";
return 0;
}
Thanks a lot in advance!!!
I am very grateful for your work!!!Posted by kuelite on 03/13/2005 08:38am
the header file does work perfectly!! i am excited!! thanks !! Good luck!!Reply
how to move a point using x,y,z co-ordinatesPosted by lakme2india.com on 03/06/2005 01:35am
how can i plot a point using x,y,z co-ordinates
hiPosted by letathien on 04/12/2005 10:32pm
friendReply
How to draw closed splines?Posted by sunkingac on 12/12/2004 01:06pm
Hi , I want to draw closed splines using a given set of points... How can i do that...? Actually , I don't know how to use the GenClosed() and drawClosed()functions. Thanks in advance... Arun ChakaravarthyReply
how to use this header file in IDC_Static of FormViewPosted by country0boy on 03/24/2004 10:46am
how to use this header file in IDC_Static of FormView the curve is not in the IDC_BITMAP why?????? This is my code: ////////////////////////////////////////////// void CTestView3::OnPaint() { CPaintDC dc(this); // device context for painting // TODO: Add your message handler code here CFormView::OnPaint(); // Do not call CFormView::OnPaint() for painting messages } void CTestView3::OnLButtonDown(UINT nFlags, CPoint point) { //check if the mouse left clicking into one of the control points int index = IsInsideControlPoint(point); if(index >= 0) { //we are moving a control point around m_MoveIndex = index; } else //we are adding control points { CDC* pDC =m_bitmap.GetDC();//right?? DrawCross(point, RGB(255,0,0), 4, pDC->m_hDC); m_ControlPoints.Add(point); if(m_ControlPoints.GetSize()>1) { / UpdateFormView(pDC->m_hDC); } //ReleaseDC(pDC); } CFormView::OnLButtonDown(nFlags, point); } void CTestView3::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default if(m_MoveIndex >= 0) { m_ControlPoints[m_MoveIndex] = point; if(m_ControlPoints.GetSize()>1) { Spline spline(m_ControlPoints.GetData(), m_ControlPoints.GetSize()); spline.Generate(); m_CurvePoints.SetSize(spline.GetCurveCount()); int PointCount = 0; spline.GetCurve(m_CurvePoints.GetData(), PointCount); } CDC* pDC = m_bitmap.GetDC(); UpdateFormView(pDC->m_hDC); ReleaseDC(pDC); } CFormView::OnMouseMove(nFlags, point); } void CTestView3::OnLButtonUp(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default m_MoveIndex = -1; CFormView::OnLButtonUp(nFlags, point); } void CTestView3::UpdateFormView(HDC &hDC) { //brush the DC RECT rect; GetDlgItem(IDC_BITMAP)->GetClientRect(&rect);//right?? FillRect(hDC, &rect, (HBRUSH)GetStockObject(IDC_BITMAP));//right?? //draw the control points for(int i=0; i
1)
Polyline(hDC, m_CurvePoints.GetData(), m_CurvePoints.GetSize());
}
int CTestView3::IsInsideControlPoint(POINT& point)
{
int count = m_ControlPoints.GetSize();
if(count>0)
{
for(int i=0; i
Reply
Can you fix Closed Spline case?Posted by Legacy on 10/23/2003 12:00am
Originally posted by: Youngsub Ahn
Program does not work properly when I changed spline.generate() to spline.genClosed().
Can you fix this?
Thank you.
How to change the knotsPosted by Jenniflower on 07/09/2004 05:26am
I want to smooth a closed curve using this method and I am really a green hand. How can I make it work ? Do appreciate your help!Reply
It worksPosted by arereal on 06/05/2004 06:33am
Hi Raffy, yes, that worked. I changed the code to use GenClosed and drawClosed and bingo! Cheers :)Reply
end pointPosted by raffy on 06/02/2004 06:03pm
Hi Arereal, maybe your end point coincides with the starting point. Try to use the functions for closed splines with n-1 knots and let me know. raffyReply
closed splinesPosted by arereal on 05/27/2004 02:21pm
closed splinesPosted by raffy on 05/24/2004 11:05am
bug NP == 1Posted by Legacy on 07/14/2003 12:00am
Originally posted by: Esther
Thanks a lot for your work!
I've searched long and hard for a working solution that
involves the drawing of curves.
Your solution matched my needs perfectly!
I managed to find your bug:
The function Generate contains the following line:
k[NP-2] = 1.0f;
At NP == 1 this means accessing k at index -1.Reply
is it all needed?Posted by Legacy on 11/11/2002 12:00am
Originally posted by: wadim
ever heard of windows GDI function named PolyBezier()?
:-)
wadimReply
Draw a tangent on a spline.Posted by Legacy on 09/28/2002 12:00am
Originally posted by: Raman
We are doing something similar in a graphics project, where we require to draw a tangent at any of the user selected points generated for the spline. please help with ideas.Reply | http://www.codeguru.com/cpp/g-m/gdi/article.php/c3689/Draw-a-curve-with-control-points.htm | CC-MAIN-2016-40 | refinedweb | 1,089 | 65.32 |
If you build a complex application in Vue.js, you may wonder how you can split route paths into multiple files. The idea is not to place and manage all the routes into one single file. It will definitely be a nightmare to manage and handle the routes. This is why by placing a router file to each individual system or module will make your life easier to manage your app.
Let assume we have two separate route files that we want to combine into the main route. Please see the following example structure of the sample Vue.js app I create.
Each of the router.js file will represent individual path for each folder which can be considered as a module or sub system if you want to say. Here is the code for router 1 file.
import Main from '@/components/Admin/Main' const routes = [ { path: '/admin', name: 'Main', component: Main }] export default routes
Here is the code for router 2 file.
import Login from '@/components/Shared/Login' import Register from '@/components/Shared/Register' import ForgotPassword from '@/components/Shared/ForgotPassword' const routes = [ { path: '/', alias: '/login', name: 'Login', component: Login }, { path: '/register', name: 'Register', component: Register }, { path: '/forgot-password', name: 'ForgotPassword', component: ForgotPassword }] export default routes
To combine the code is pretty simple. What you need to do is to create an array variable and using the built in javascript concat to combine the exported router classes. Here is the full code of the main router file.
import Vue from 'vue' import Router from 'vue-router' import SharedRoutes from '@/components/Shared/Router' import AdminRoutes from '@/components/Admin/Router' Vue.use(Router) var allRoutes = [] allRoutes = allRoutes.concat(SharedRoutes, AdminRoutes) const routes = allRoutes export default new Router({ routes })
Pretty simple right? Feel free to post your question below if you have any question. | http://bytutorial.com/blogs/vuejs/how-to-combine-multiple-path-route-files-in-vuejs | CC-MAIN-2018-30 | refinedweb | 301 | 56.55 |
OpenHAB/MQTT Tips & Hints
This topic was split off to discuss tips and hints specific to using MySensors together with MQTT middleware and OpenHAB.
If you made something nice using this combination or have some questions/issues please post them in here!
@kolaf I just started experimenting with openhab and find it quite hard to get started. There's some documentation ( far from complete, especially when you're just starting) but the general impression is that it's very powerful, mainly due to all the programming options. I'm quite sure you could directly talk to a mysensors gateway using the serial protocol, using e.g. rules, if you want.
I doubt however if you want to write your own protocol handler...
Anyway, I'm currently using an Ethernet gateway which tasks to a Perl script I wrote () that does the conversion to and from MQTT. This script is a MQTT client that runs on the same server I run openhab and the mosquitto broker on. This is the only difference compared to @Damme solution who runs a broker on the gateway.
I like the flexibility of storing & accessing all data through an MQTT broker which makes up for the apparent overkill going through MQTT just to connect mysensors to openhab.
As long as your server has enough resources to run it all its not really worth the effort to directly talk to my sensors or create an openhab binding for it.
how do you use the mqtt binding to talk to the sensors?
I'm not at my PC right now so I can't add any actual code, but let's take the switch as an example.
A sensor (with say, id 100) which has the switch connected sends a 1 when pressed and a 0 when released to the gateway, with child I'd 7. This comes out the gateway and is picked up by the perl script. The script publishes this to /mysensors/100/7/V_LIGHT.
You define a switch item in openhab which subscribes to this topic. To read the state of the switch openhab expects either ON or OFF from MQTT instead of 1 or 0 sent by the sensor. I could have changed this on the sensor side, but I choose to implement a map-transformation on the openhab-side. Now the state of the switch changes to ON when pressed on the sensor..
Good idea. If someone made a good, or at least workable and well-documented, solution than I am sure this project would be much utilised by the openHAB crowd as well. Maybe explaining it to me could be a good start for a how to/guide which could also be utilised in their wiki?
I hope I'm not stepping on any Vera toes when saying this?
I hope I'm not stepping on any Vera toes when saying this?
Not everybody owns a vera and IMHO it's only beneficial for this project when multiple home automation systems are supported. Finding a greatest common divider for e.g. the types of variables will only improve things.
- kolaf Hero Member last edited by kolaf
@Yveaux good, I agree, and I am glad to hear it.
How would you solve a toggle switch? The sensor does not know whether the light is on or off since it may be toggled through the controller separately. This means that in my head it will simply send "on" every time and it is up to the item/map to figure out whether it should be turned on or off depending on its current state. I guess this may be required as a rule. Or does your server support sending items dated back to the sensor so that it knows whether the light is off or on currently? In that case it can make the decision itself and send the correct on or off command. Maybe I should ask this question in the openhab group...
@kolaf : I´m not very experienced in Java, so the code reflects my missing knowledge and is much longer than it should be.
The purpose of "Split Message" is to split multilpe messages into single messages and afterward split this single messages into useful informations to set the OpenHAB items accordingly.
First part: common declarations
import org.openhab.core.library.types.* import org.openhab.core.persistence.* import org.openhab.model.script.actions.* var String[] buffer var String[] linebuffer var int SensorID var int transmissions_old = 0 var int transmissions_new = 0 var int transmissions_missed = 0 var int RadioID
Second part: Splitting multiple Messages
rule SplitMessage when Item Arduino changed then /* Split messages separated with NEWLINE */ linebuffer= Arduino.state.toString.split("\n")
Third part: Splitting messages according to the serial protocol
buffer(0) = NODE_ID
buffer(1) = CHILD_ID
buffer(2) = MESSAGE_TYPE
buffer(3) = SUB_TYPE
buffer(4) = Message
for (String element : linebuffer) { buffer = element.split(";") RadioID = new Integer(buffer.get(0)) switch (RadioID) { case 7: { SensorID = new Integer(buffer.get(1)) switch (SensorID) { case 0 : postUpdate (MySensorsT0, buffer.get(4)) case 1 : postUpdate (MySensorsT1, buffer.get(4)) case 2 : postUpdate (MySensorsT2, buffer.get(4)) case 3 : postUpdate (MySensorsT3, buffer.get(4)) } /*switch (SensorID) */ } /* case 7 */ case 6: { /* ExperimentalNode 6 - soll mal NODE 1 werden */ if (buffer.get(1)== "10") { /* child 10 ist der Homematic Anschluss */ postUpdate (HMSerialOut, buffer.get(4)) } /* if */ } /* case 6 */ case 9: { /* eigentlich war das mal NODE 6 */ if (buffer.get(1) == "2") { /* Child 2 ist der Schrittmacher */ transmissions_new = new Integer(buffer.get(4)) logInfo ("TRANS","Transmissions new " + transmissions_new.toString() ) logInfo ("TRANS","Transmissions old " + transmissions_old.toString() ) if (transmissions_old == 0) {transmissions_old = transmissions_new -1 } /* beim ersten mal passiert nichts */ transmissions_missed = transmissions_missed + (transmissions_new - transmissions_old - 1) transmissions_old = transmissions_new postUpdate (Missed_Transmissions, transmissions_missed.intValue.toString) postUpdate (Transmission_Count, transmissions_new.toString()) } } /* case 9 */ case 5: { if (buffer.get(1) == "0") { /* Child 0 ist die Luftfeuchte */ postUpdate (MySensorsMobHum, buffer.get(4)) } if (buffer.get(1) == "1") { /* Child 1 ist die Temperatur */ postUpdate (MySensorsMobTemp, buffer.get(4)) } } /*case 5: */ default: { postUpdate (MySensorsNode, buffer.get(0)) postUpdate (MySensorsChild, buffer.get(1)) postUpdate (MySensorsMtype, buffer.get(2)) postUpdate (MySensorsStype, buffer.get(3)) postUpdate (MySensorsMessage, buffer.get(4)) } } /*switch(RadioID) */ } /*for (String element) */ end
So the drawback of the serial binding becomes obvious - every action has to be coded separately. On the other hand it offers enormous controlling possibilities (eg scene configurations),
Fourth part: some actions triggerd from OpenHAB GUI/Webinterface:
rule ArdSwon when Item ArduinoSwitch changed from OFF to ON then sendCommand(Arduino, "4;2;1;0;2;1\n") end rule ArdSwoff when Item ArduinoSwitch changed from ON to OFF then sendCommand(Arduino, "4;2;1;0;2;0\n") end rule HmArdon when Item ArduinoHMSw1 changed from ON to OFF then sendCommand(Arduino, "1;10;1;0;24;HD01004000000\n") end rule HmArdoff when Item ArduinoHMSw1 changed from OFF to ON then sendCommand(Arduino, "1;10;1;0;24;HD01004010000\n") end
To send commands to the MySensors Network you have to use the same "Arduino"Item. In my oppinion another drawback. A separate way out would be nicer. Despite of my oppinion there is no interference between input and output - so i can live with this.
The above example illustrates controlling a LED connected to an Arduino-UNO with the original Relais-Sketch, the second part controls some of my Homematic devices via another MySensors node (connected to Homematic via USB) .
So at last I got a 2.4Ghz network to communicate with my Homematic and an ethernet connection via OpenHAB. In combination with direct interaction between certain MySensor nodes this results in a very redundant and stress-resistant home controlling network.) ?
The light is entirely separate from the switch. In my specific case it will typically be a Z-wave relay controlling the light, so I will have to map the toggle switch to the light relay in openhab. This is why I assume I have to use a rule to achieve this.
@kolaf Here's my code to use one or two switches to dimm. I hope it gives you some inspiration to connect your zwave switch.
MQTT topics (exposed by the MQTT perl script. Node 120 = switch sensor, node 119 = dimmable light):
/mySensors/120/0/V_LIGHT switch, reporting 1 when pressed, 0 when released /mySensors/120/1/V_LIGHT switch, reporting 1 when pressed, 0 when released /mySensors/120/2/V_LIGHT switch, reporting 1 when pressed, 0 when released /mySensors/119/0/V_DIMMER dimmable light, accepting integer value between 0 and 100
Items:
Switch Switch_Up {[server:/mySensors/119/0/V_DIMMER:state:*:default]"}
switchFromMqtt.map: (in transform folder)
0=OFF 1=ON
Rules for 2-switch dimmer control (short press Switch_Up switches light on, short press Switch_Down switches light off, keep pressed to increase/decrease light level):
val Long DimmerDelayMs = 333L rule "DimUp" when Item Switch_Up received update ON then var Boolean dimmed = false do { Thread::sleep(DimmerDelayMs) if (Switch_Up.state == ON) { sendCommand( Light_Dimmed, INCREASE ) dimmed = true; } } while (dimmed) if (!dimmed) sendCommand( Light_Dimmed, ON ) end rule "DimDown" when Item Switch_Down received update ON then var Boolean dimmed = false do { Thread::sleep(DimmerDelayMs) if (Switch_Down.state == ON) { sendCommand( Light_Dimmed, DECREASE ) dimmed = true; } } while (dimmed) if (!dimmed) sendCommand( Light_Dimmed, OFF ) end
Rules for 1-switch dimmer control (short press switches light on/off (depending on current state), keep pressed to increase/decrease light level):
rule "DimUpDown" when Item Switch_UpDown received update ON then var Boolean dimmed = false var Number percent = 0 if (Light_Dimmed.state instanceof DecimalType) percent = Light_Dimmed.state as DecimalType do { Thread::sleep(DimmerDelayMs) if (Switch_UpDown.state == ON) { // Start cycling up/down until released var Boolean dimmUp = percent < 100 do { if (Light_Dimmed.state instanceof DecimalType) percent = Light_Dimmed.state as DecimalType if (dimmUp) sendCommand( Light_Dimmed, INCREASE ) else sendCommand( Light_Dimmed, DECREASE ) if (percent >= 100) dimmUp = false; if (percent <= 0) dimmUp = true; dimmed = true; Thread::sleep(DimmerDelayMs) } while (Switch_UpDown.state == ON) } } while (dimmed) if (!dimmed) { // Short press: switch on or off, depending on current state if (percent > 0) sendCommand( Light_Dimmed, OFF ) else sendCommand( Light_Dimmed, ON ) } end
Rule for the dimmable light:
rule "MyDimmer0" when Item Light_Dimmed received command then var Number percent = 0 if(Light_Dimmed.state instanceof DecimalType) percent = Light_Dimmed.state as DecimalType if(receivedCommand==INCREASE) percent = percent + 5 if(receivedCommand==DECREASE) percent = percent - 5 if(receivedCommand==ON) percent = 100 if(receivedCommand==OFF) percent = 0 if(percent<0) percent = 0 if(percent>100) percent = 100 postUpdate(Light_Dimmed, percent) end
Some stuff I'm still struggling with (any help/ideas appreciated):
- Not sure if I can wrap (parts of) rules in a function to make re-use easier
- Getting the current value of an item seems complicated first testing for DecimalType, then getting it. Maybe this can be done more efficient?
- I use Thread::sleep to determine the timing of the buttons on the sensor node (pressed short/long). This will be influenced by the jitter on the sensor values received, but currently it seems to work fine. Furthermore Thread::sleep (probably) blocks whole rule processing, so this isn't a nice solution. The short/long presses can also be dermined on the sensor node and reported with different values, but then the sensor node is no longer a dumb switch and has to have knowledge of short/long presses....
@Yveaux Excellent, this is just what I needed, thank you.
I started looking at your Perl script since this seems like the most active solution for openhab integration. I have a couple questions if you don't mind.
Why do you have two versions of the gateway script, and which version should I use as a basis when adding serial support?
Does your gateway take care of node ID assignments? I guess I will figure out that by reading more of code
I'm thinking that I will fork your project to add a serial option to your script, controlled by some kind of commandline argument.
@Yveaux Excellent, this is just what I needed, thank you.
Glad I could help!
Why do you have two versions of the gateway script, and which version should I use as a basis when adding serial support?
The serial format changed from MySensors 1.3 (protocol 1) to 1.4beta (protocol 2). I was lazy and just cloned the 1.3 version to add 1.4 support (the 2-version). Wouldn't be hard to support both, but I really wrote this script for my own usage. It's not documented and I tried to help Damme in the past to build MQTT support. I'm primarily on 1.4b btw, with some 1.3 setup for backwards sniffer support...
If more people start using it I should do some things the nice way
Does your gateway take care of node ID assignments? I guess I will figure out that by reading more of code
Not at the moment. Shouldn't be hard to implement though, but when you implement it you run into another issue of mapping the node-ID's onto the MQTT topic tree, or accessing the right topic from OpenHAB.
Sticking to fixed Node ID's seemed to make more sense to me.
I'm thinking that I will fork your project to add a serial option to your script, controlled by some kind of commandline argument.
Feel free to fork, but the current code is based on AnyEvent. Not that I like it, but it seemed to have the best MQTT support. There is some hacking in the script to get things working, for which I don't know how they behave when switching to serial.
Btw. there's one important thing to understand when using the Perl script. When it receives values from a sensor node through the gateway it's easy to publish the value in the topic-tree.
When a value has to be sent to an actuator node, the story is different as the script has to know which topic to subscribe to at the MQTT broker.
Currently when a mysensor node requests a value from the gateway the script automagically translates this into a subscription of the corresponding topic with the MQTT broker. The dimmer node for example, calls gw.request(childID, V_DIMMER) from setup to subscribe itself to dimmer messages.
Note that sometimes this request gets lost (CRC error or so) and the subscription fails. While not supported by the MySensors library, a robust implementation should wait for a response after requesting this value and retry when it doesn't come.
The Perl script stores all current subscriptions persistent (file subscriptions.storage) so restarting the Perl script will not force you to restart all nodes to subscribe again.
And another small one; an RGB dimmer!
MQTT topics (exposed by the MQTT perl script. Node 118 = 3-channel dimmable light):
/mySensors/118/0/V_DIMMER dimmable light RED, accepting integer value between 0 and 100 /mySensors/118/1/V_DIMMER dimmable light GREEN, accepting integer value between 0 and 100 /mySensors/118/2/V_DIMMER dimmable light BLUE, accepting integer value between 0 and 100
Items:
Dimmer Light_R {[server:/mySensors/118/1/V_DIMMER:state:*:default]"} Dimmer Light_B {mqtt=">[server:/mySensors/118/2/V_DIMMER:state:*:default]"} Color Light_RGB "RGB Dimmer" (Lights)
Rules to distribute colorwheel value over R,G,B dimmers:
rule "Set RGB value" when Item Light_RGB changed then var HSBType hsbValue = Light_RGB.state as HSBType postUpdate( Light_R, hsbValue.red.intValue ) postUpdate( Light_G, hsbValue.green.intValue ) postUpdate( Light_B, hsbValue.blue.intValue ) end
No button control here; just using the colorwheel and on/off buttons in the GUI.
Enjoy!
- Damme Code Contributor last edited by Damme
rule to calculate absolute humidity and dew point from degree Celsius and rH%
import java.lang.Math import java.lang.Integer import java.lang.Double rule "Calculate absolute humidity (g h2o / m3 air) and dew point" when Item temp1 changed or Item hum1 changed then var temp = temp1.state as DecimalType var hum = hum1.state as DecimalType var t1 = (17.271*temp.floatValue) / (237.7+temp.floatValue) + Math::log(hum.floatValue*0.01) var dew = (237.7 * t1) / (17.271 - t1) var Number c1 = ((17.67*temp.floatValue)/(temp.floatValue+243.5)) var abs = (Math::pow(Math::E,c1.doubleValue)*6.112*2.1674*hum.floatValue) /(273.15+temp.floatValue) Dewpoint1.postUpdate(dew) AbsHum1.postUpdate(abs) end
Hi everyone!
I'm new in the topic. I find it very interesting the world of mysensors.
I would like to ask whether there is a description of someone that I can set my mqtt openHAB bindings eg .: an Arduino LED dimmer ?
I already read broker-gateway
I made a Humidity sensor node, and Relay node, too.
It would be good if we had a basic description or example project for beginners from all sensor type.
It is not rocket science to get the openHAB running w/MQTT gateway, see for example my post with DS/Light/Relay in
But sure, it would be great to put a wiki with all sensor settings for openHAB together on one page. I needed to read/search for some days to put the knowledge together...
Example of the openhab screenshots on mobile
There you see also the mapping of the sensor
How can I make openhad respod to gw.request(sensor, V_HEATER_SW,0);
I have a relay actuator sketch and in setup() I have this
for (int sensor=1 ; sensor<=NUMBER_OF_RELAYS;sensor++)
{
gw.present(sensor, S_HEATER);
gw.request(sensor, V_HEATER_SW,0);
}
practically I would like openhab to respond to the gw.request with the actual state of the relay.
My item definition is the follwing. I am able to ON and OFF the relay, but I need to find a way to get the values from openhab of the relays when the relay actuator arduino reboots.
Switch Incalzire_Releu_GF_Living2 "Incalzire Releu Living 2" <heating> (Incalzire) {mqtt=">[mysensor:MyMQTT/3/2/V_HEATER_SW:command:ON:1],>[mysensor:MyMQTT/3/2/V_HEATER_SW:command:OFF:0]"}
is there any sample code for controlling RGB led here?
Sorry to Necro this thread but had a question,
I believe I read somewhere that you can use a serial gateway connected to a pi and have openhab/mqtt run on the pi?
How would one go about setting this up? Currently I have 2 Unos one running as the serial gateway. I plan to replace the serial gateway with a nano I'm still waiting on that.
I just got the pi last night so I'm still working on getting everything up and running on that but I'd rather just connect the gateway directly to the pi rather than have to get a wifi/ethernet module for one of the arduinos.
Also probably outside the scope of this thread (and thats fine) but anyone have a good guide for setting up the pi for openhab/MQTT?
@Chaotic , Try this..
Worked great for me
@mhortman Didn't work for me:
sudo wget --2015-03-27 10:46:51-- Resolving repo.mosquitto.org (repo.mosquitto.org)... 85.119.83.194, 2001:ba8:1f1:f271::2 Connecting to repo.mosquitto.org (repo.mosquitto.org)|85.119.83.194|:80... connected. HTTP request sent, awaiting response... 403 Forbidden 2015-03-27 10:46:51 ERROR 403: Forbidden.'
- quocanhcgd last edited by
My house have 4 floor, i have plan build one gateway for each floor. Each floor has 4-5 sensors (temp, hum, relay, light, door, RF light). Each sensors use NRF24 to connect with gateway. Gateway connect to RAS by ethernet.
My question:
- Can i build 2 gateway mqtt connect to openhab?
if not, what my solution to solve ?
Thanks
- rachmat aditiya27 last edited by
you can build more than 1 gateway for that, but rather than mqtt. I think it's better to use ethernet or serial gateway because mqtt gateway has lot of problem, I tried it for months. You can forward mqtt from fhem to mosquito.
@Yveaux
could you please post your arduino code of controlling your RGB (I guess it´s a RGB LED Strip!?)?
Thanks for your help!!
I build up a mqtt gateway and configured it in openhab.cfg. Now I would like to set up a mosquitto server on a raspberry pi, too. Is it possible to add this new MQTT server to the openhab.cfg beside the already set up MQTT gateway?
Why not setup the Mosquitto broker connect OpenHab to it and use the MQTTClientGateway which connects as a client to the Mosquitto broker. Has been discussed at several places in the forum already. You can find the MQTTClientGateway in the development branch.
- John Connolly last edited by
This post is deleted!
@tomkxy
I´m reading in the forums for weeks now, but I don´t get it to work. I´ve succesfully set up Mosquitto on my raspi, also openHAB is running there. MQTTEthernetGateway (from Startpage) is pingable. One sensor is running and working.
I don´t know how to get the MQTTEthernetGateway communicate with the Mosquitto Broker. I´ve read about "bridging" what made me more confused as I already was.
So, right now, when I subscribe to MyMQTT/# using "mosquitto_sub -t MyMQTT/#" on my Raspi I don´t see any communication coming in.
What do I have to do to get the MQTTEthernetGateway (=MQTTClientGateway I suppose!?!) connecting to Mosquitto?
Or: must I setup the MQTTEthernetGateway like this: instead of using the sketch from?
Thanks for your help!!
@siod I am not sure to what code you are exactly referring to if you say MQTTEthernetGateway.
In the mysensor Github he cleaned up the code I merged from my Github. I did not test that code so far.
So I can only comment on the MQTTClientGateway you can find in my Github in branch MQTTClientGateway.
I suggest you start off ignoring Openhab at the moment. Just test with clients using mosquitto_sub and mosquito_pub commands from mosquito.
In the MQTTClientGateway sketch you need to adapt the IP related infos. See excerpt from my config.
/ };
Depending on whether you use the signing feature or not you have to comment the define MY_SIGNING_FEATURE in my_config.h.
If your sketch is running you should see one additional client connected on your mosquito broker.
You can subscribe with mosquito_sub to $SYS/# which gives you all sorts of statistics.
In order to check whether your Arduino connected to the broker you can also put a debug statement in the loop function. Just check and print the return code from the client.connect() call.
If the connect did not work double check that you configured the correct IP address and port, and make also sure that you fulfill the authentication requirements configured in the broker.
If the connection works publish a message to the broker for a topic like MyMQTT/27/5/V_PRESSURE
The MQTTClientGateway sketch should receive that and you should see that in the log.
Next reset your sensor node. You should see a message being processed by MQTTClientGateway and then being published to the MQTT broker.
Only after all that works you start dealing with OpenHab.
Hope that helps.
Hi tomkxy,
thanks for your detailed answer, I will test all your suggestions after I got my GW work on LAN, right now it´s not answering to pings and I don´t get it why....
I´ve uploaded the ntruchsees sketch from now and configured IP address, port and MAC.
When I was talking about MQTTEthernetGateway I was talking about the MySensors Sketch at.
I will get back to you and give your more info as soon as the Gateway in it´s actual state works in my network!
@siod I adapted the ntruchsees for the MySensors library version 1.5 which you find here
I could compile your code now, unfortunately I still cannot ping the gw.
BTW: In ntruchsess`code I had to enter the Mosquitto broker IP, why isn´t this part in your code?
//replace with ip of server you want to connect to, comment out if using 'remote_host' uint8_t remote_ip[] = { 192, 168, 1, 50 };
It is the same in my code. See the code extract in the previous reply above. The variable is remote_ip[].
sorry, but I can´t fin it in - Created by Daniel Wiegert <daniel.wiegert@gmail.com> * * DESCRIPTION * MyMQTT Broker Gateway 0.1b * Latest instructions found here: * * * *: * */ #include <DigitalIO.h> #include <SPI.h> #include <MySigningNone.h> #include <MyTransportRFM69.h> #include <MyTransportNRF24.h> #include <MyHwATMega328.h> #include <MySigningAtsha204Soft.h> #include <MySigningAtsha204.h> #include <MySensor.h> #include <MsTimer2.h> #include <Ethernet.h> #include "MyMQTT.h" #define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled #define INCLUSION_MODE_PIN 3 // Digital pin used for inclusion mode button // **/ #define TCP_PORT 1883 // Set your MQTT Broker Listening port. IPAddress TCP_IP ( 192, 168, 1, 51 ); // Configure your static ip-address here byte TCP_MAC[] = { 0x02, 0xDE, 0xAD, 0x00, 0x00, 0x42 }; // Mac-address - You should change this! see note *2 above! ////////////////////////////////////////////////////////////////// // NRFRF24L01 radio driver (set low transmit power by default) MyTransportNRF24 transport(RADIO_CE_PIN, RADIO_SPI_SS_PIN, RF24_PA_LEVEL_GW); //MyTransportRFM69 transport; //) MySensor gw(transport, hw /*, signer*/); EthernetServer server = EthernetServer(TCP_PORT); EthernetClient *currentClient = NULL; MyMessage msg; char convBuf[MAX_PAYLOAD*2+1]; char broker[] PROGMEM = MQTT_BROKER_PREFIX; bool MQTTClientConnected = false; uint8_t buffsize; char buffer[MQTT_MAX_PACKET_SIZE]; volatile uint8_t countRx; volatile uint8_t countTx; volatile uint8_t countErr; void writeEthernet(const char *writeBuffer, uint8_t *writeSize) { #ifdef TCPDUMP Serial.print(">>"); char buf[4]; for (uint8_t a=0; a<*writeSize; a++) { sprintf(buf,"%02X ",(uint8_t)writeBuffer[a]); Serial.print(buf); } Serial.println(""); #endif server.write((const uint8_t *)writeBuffer, *writeSize); } void processEthernetMessages() { char inputString[MQTT_MAX_PACKET_SIZE] = ""; byte inputSize = 0; byte readCnt = 0; byte length = 0; EthernetClient client = server.available(); if (client) { while (client.available()) { // Save the current client we are talking with currentClient = &client; byte inByte = client.read(); readCnt++; if (inputSize < MQTT_MAX_PACKET_SIZE) { inputString[inputSize] = (char)inByte; inputSize++; } if (readCnt == 2) { length = (inByte & 127) * 1; } if (readCnt == (length+2)) { break; } } #ifdef TCPDUMP Serial.print("<<"); char buf[4]; for (byte a=0; a<inputSize; a++) { sprintf(buf, "%02X ", (byte)inputString[a]); Serial.print(buf); } Serial.println(); #endif processMQTTMessage(inputString, inputSize); currentClient = NULL; } } void incomingMessage(const MyMessage &message) { rxBlink(1); sendMQTT(message); } void setup() { Ethernet.begin(TCP_MAC, TCP_IP); countRx = 0; countTx = 0; countErr = 0; // Setup led pins pinMode(RADIO_RX_LED_PIN, OUTPUT); pinMode(RADIO_TX_LED_PIN, OUTPUT); pinMode(RADIO_ERROR_LED_PIN, OUTPUT); digitalWrite(RADIO_RX_LED_PIN, LOW); digitalWrite(RADIO_TX_LED_PIN, LOW); digitalWrite(RADIO_ERROR_LED_PIN, LOW); // Set initial state of leds digitalWrite(RADIO_RX_LED_PIN, HIGH); digitalWrite(RADIO_TX_LED_PIN, HIGH); digitalWrite(RADIO_ERROR_LED_PIN, HIGH); // Add led timer interrupt MsTimer2::set(300, ledTimersInterrupt); MsTimer2::start(); // give the Ethernet interface a second to initialize delay(1000); // Initialize gateway at maximum PA level, channel 70 and callback for write operations gw.begin(incomingMessage, 0, true, 0); // start listening for clients server.begin(); Serial.println("Ok!"); Serial.println(TCP_IP); } void loop() { gw.process(); processEthernetMessages(); } inline MyMessage& build (MyMessage &msg, uint8_t destination, uint8_t sensor, uint8_t command, uint8_t type, bool enableAck) { msg.destination = destination; msg.sender = GATEWAY_ADDRESS; msg.sensor = sensor; msg.type = type; mSetCommand(msg,command); mSetRequestAck(msg,enableAck); mSetAck(msg,false); return msg; } char *getType(char *b, const char **index) { char *q = b; char *p = (char *)pgm_read_word(index); while (*q++ = pgm_read_byte(p++)); *q=0; return b; } void processMQTTMessage(char *inputString, uint8_t inputPos) { char *str, *p; uint8_t i = 0; buffer[0]= 0; buffsize = 0; (void)inputPos; if ((uint8_t)inputString[0] >> 4 == MQTTCONNECT) { buffer[buffsize++] = MQTTCONNACK << 4; buffer[buffsize++] = 0x02; // Remaining length buffer[buffsize++] = 0x00; // Connection accepted buffer[buffsize++] = 0x00; // Reserved MQTTClientConnected=true; // We have connection! } if ((uint8_t)inputString[0] >> 4 == MQTTPINGREQ) { buffer[buffsize++] = MQTTPINGRESP << 4; buffer[buffsize++] = 0x00; } if ((uint8_t)inputString[0] >> 4 == MQTTSUBSCRIBE) { buffer[buffsize++] = MQTTSUBACK << 4; // Just ack everything, we actually dont really care! buffer[buffsize++] = 0x03; // Remaining length buffer[buffsize++] = (uint8_t)inputString[2]; // Message ID MSB buffer[buffsize++] = (uint8_t)inputString[3]; // Message ID LSB buffer[buffsize++] = MQTTQOS0; // QOS level } if ((uint8_t)inputString[0] >> 4 == MQTTUNSUBSCRIBE) { buffer[buffsize++] = MQTTUNSUBACK << 4; buffer[buffsize++] = 0x02; // Remaining length buffer[buffsize++] = (uint8_t)inputString[2]; // Message ID MSB buffer[buffsize++] = (uint8_t)inputString[3]; // Message ID LSB } if ((uint8_t)inputString[0] >> 4 == MQTTDISCONNECT) { MQTTClientConnected=false; // We lost connection! } if (buffsize > 0) { writeEthernet(buffer,&buffsize); } // We publish everything we get, we dont care if its subscribed or not! if ((uint8_t)inputString[0] >> 4 == MQTTPUBLISH || (MQTT_SEND_SUBSCRIPTION && (uint8_t)inputString[0] >> 4 == MQTTSUBSCRIBE)) { buffer[0]= 0; buffsize = 0; // Cut out address and payload depending on message type. if ((uint8_t)inputString[0] >> 4 == MQTTSUBSCRIBE) { strncat(buffer,inputString+6,inputString[5]); } else { strncat(buffer,inputString+4,inputString[3]); } #ifdef DEBUG Serial.println(buffer); #endif // TODO: Check if we should send ack or not. for (str = strtok_r(buffer,"/",&p) ; str && i<4 ; str = strtok_r(NULL,"/",&p)) { if (i == 0) { if (strcmp_P(str,broker)!=0) { //look for MQTT_BROKER_PREFIX return; //Message not for us or malformatted! } } else if (i==1) { msg.destination = atoi(str); //NodeID } else if (i==2) { msg.sensor = atoi(str); //SensorID } else if (i==3) { unsigned char match=255; //SensorType #ifdef MQTT_TRANSLATE_TYPES for (uint8_t j=0; strcpy_P(convBuf, (char*)pgm_read_word(&(vType[j]))) ; j++) { if (strcmp((char*)&str[2],convBuf)==0) { //Strip V_ and compare match=j; break; } if (j >= V_TOTAL) break; } #endif if ( atoi(str)!=0 || (str[0]=='0' && str[1] =='\0') ) { match=atoi(str); } if (match==255) { match=V_UNKNOWN; } msg.type = match; } i++; } //Check if packge has payload if ((uint8_t)inputString[1] > (uint8_t)(inputString[3]+2) && !((uint8_t)inputString[0] >> 4 == MQTTSUBSCRIBE)) { strcpy(convBuf,inputString+(inputString[3]+4)); msg.set(convBuf); //Payload } else { msg.set(""); //No payload } txBlink(1); if (!gw.sendRoute(build(msg, msg.destination, msg.sensor, C_SET, msg.type, 0))) errBlink(1); } } void sendMQTT(const MyMessage &inMsg) { MyMessage msg = inMsg; buffsize = 0; if (!MQTTClientConnected) return; //We have no connections - return if (msg.isAck()) { //, msg.sender, 255, C_INTERNAL, I_CONFIG, 0).set(MQTT_UNIT))) errBlink(1); return; }, msg.sender, 255, C_INTERNAL, I_ID_RESPONSE, 0).set(newNodeID))) errBlink(1); return; } } if (mGetCommand(msg)!=C_PRESENTATION) { if (mGetCommand(msg)==C_INTERNAL) msg.type=msg.type+(S_FIRSTCUSTOM-10); //Special message buffer[buffsize++] = MQTTPUBLISH << 4; // 0: buffer[buffsize++] = 0x09; // 1: Remaining length with no payload, we'll set this later to correct value, buffsize -2 buffer[buffsize++] = 0x00; // 2: Length MSB (Remaing length can never exceed ff,so MSB must be 0!) buffer[buffsize++] = 0x08; // 3: Length LSB (ADDR), We'll set this later strcpy_P(buffer+4, broker); buffsize+=strlen_P(broker); #ifdef MQTT_TRANSLATE_TYPES if (msg.type > V_TOTAL) msg.type=V_UNKNOWN;// If type > defined types set to unknown. buffsize+=sprintf(&buffer[buffsize],"/%i/%i/V_%s",msg.sender,msg.sensor,getType(convBuf, &vType[msg.type])); #else buffsize+=sprintf(&buffer[buffsize],"/%i/%i/%i",msg.sender,msg.sensor,msg.type); #endif buffer[3]=buffsize-4; // Set correct address length on byte 4. #ifdef DEBUG Serial.println((char*)&buffer[4]); #endif msg.getString(convBuf); for (uint8_t a=0; a<strlen(convBuf); a++) {// Payload buffer[buffsize++] = convBuf[a]; } buffer[1]=buffsize-2; // Set correct Remaining length on byte 2. writeEthernet(buffer,&buffsize); } } }; } }
Also I must mention I am using a ENC28J60 chip on my Ethernet module. Could that be the problem of not answering to pings?
edit: Ah, sure, got the network problem:
//#include <Ethernet.h> #include <UIPEthernet.h>
But still, remote_ip is not in the code I copied from your github library. Maybe you can post the correct code here!?
edit:
Ok, finally got it. I must admit I am not good in using Github, it´s very new to me...
Question: Do I always have to download the complete branch and overwrite my arduino file with it or ist it enough to only download your MQTTClientGateway example? Just for me to understand this...
Of course, when using the UIPEthernet library, the sketch is too big now...Is there a workaround?
@siod Sorry, i don't know whether that makes sense here. I do not know where this code came from.
I pointed you to the the contribution I made which is here:
in the MQTTClient branch (follow the link, select the branch mqttclient and click through the directories: libraries/MySensors/examples/MQTTClientGateway/ ).
As I wrote before the current development branch of the official MySensors library contains a cleaned up and re-factored version I didn't test and can say nothing about.
I found a W5100 Ethernet Module et voila, everything works fine now!!! Thanks for your help @tomkxy !!
@siod If it works now you probably can give it a try with the latest version in the development branch of the Mysensor library.
And another small one; an RGB dimmer!
I tried this 3-dimmer approach, but I found it not responsive enough. Sometimes the arduino can't be fast enough to process 3 consecutive requests, and the result is lame. (it changes 2 of 3 colors only)
I think this would be more efficient with transmitting just one cummulative message with all 3 colors and decoding it in arduino.
@ericsko sounds to me that you're missing a message instead of the Arduino being too 'slow'.
But go ahead, use a single message to send the rgb value and post your findings in here! | https://forum.mysensors.org/topic/302/openhab-mqtt-tips-hints | CC-MAIN-2020-24 | refinedweb | 5,430 | 57.06 |
strncat - concatenate part of two strings
#include <string.h> char *strncat(char *s1, const char *s2, size_t n);
The strncat() function appends not more than n bytes (a null byte and bytes that follow it are not appended) from the array pointed to by s2 to the end of the string pointed to by s1. The initial byte of s2 overwrites the null byte at the end of s1. A terminating null byte is always appended to the result. If copying takes place between objects that overlap, the behaviour is undefined.
The strncat() function returns s1; no return value is reserved to indicate an error.
No errors are defined.
None.
None.
None.
strcat(), <string.h>.
Derived from Issue 1 of the SVID. | http://pubs.opengroup.org/onlinepubs/7990989775/xsh/strncat.html | CC-MAIN-2016-22 | refinedweb | 122 | 73.27 |
New submission from Christian Heimes: The array module is using a different typecode for unicode array depending on UCS2 or UCS4: #define Py_UNICODE_SIZE 4 #if Py_UNICODE_SIZE >= 4 #define Py_UNICODE_WIDE #endif #ifdef Py_UNICODE_WIDE #define PyArr_UNI 'w' #define PyArr_UNISTR "w" #else #define PyArr_UNI 'u' #define PyArr_UNISTR "u" #endif It's causing a bunch of unit test to fail which depend on 'u' as the type code for an unicode array. I don't see the benefit from specifying an alternative typecode for wide unicode arrays. It may be useful to have an additional typecode that fails for UCS-2 builds. My patch keeps 'u' in every build and adds 'w' as an alias for 'u' in UCS-4 builds only. It also introduces the new module variable typecodes which is a unicode string containing all valid typecodes. ---------- components: Extension Modules files: py3k_array_typecode.patch messages: 56353 nosy: tiran severity: normal status: open title: array unittest problems with UCS4 build versions: Python 3.0 __________________________________ Tracker <report at bugs.python.org> <> __________________________________ -------------- next part -------------- A non-text attachment was scrubbed... Name: py3k_array_typecode.patch Type: text/x-diff Size: 8188 bytes Desc: not available Url : | https://mail.python.org/pipermail/new-bugs-announce/2007-October/000251.html | CC-MAIN-2017-17 | refinedweb | 190 | 53.41 |
0
I'm having a problem with 'os.path.getmtime'.
I've been doing some research into generating '.pyc' files and I am able to retrieve the source modification time (in seconds) as recorded in the '.pyc' file.
It is merely the second set of four bytes unpacked as a long integer.
import random, sys, os, struct #Points to the random.pyc module. testfilepath = os.path.join(sys.prefix, 'lib', 'random' + os.extsep + 'pyc') istream = open(testfilepath, 'rb') #Read and discard the first four bytes (the magic pyc identifier). istream.read(4) #The last modification time of the source according to the file. modtime = istream.read(4) istream.close() #Convert the bytes to an integer. modtime = struct.unpack('L', modtime)[0] print('According to the pyc file the time the source file was last modified measured in the number of seconds from the last epoch is:') print(modtime) print('Retrieving source modification time using os.path.getmtime.') #Points to the random.py module. sourcefilepath = os.path.join(sys.prefix, 'lib', 'random' + os.extsep + 'py') print('According to os.path.getmtime the time the source file was last modified measured in the number of seconds from the last epoch is:') print(os.path.getmtime(sourcefilepath))
Oddly for me, the pyc time is one hour behind the time returned by os.path.getmtime. I suspect it is because of wonky dst errors. I'm using Windows XP SP3. I'd appreciate it if you would execute this code and report your results as well as your os and maybe suggest general purpose solutions to this problem.
Edited by lrh9: n/a | https://www.daniweb.com/programming/software-development/threads/260680/os-path-getmtime-problem | CC-MAIN-2017-17 | refinedweb | 269 | 67.86 |
SpringSource Tool Suite 2.1.0 RC1 Supports Spring 3.0 and OSGi Development Tools
- |
-
-
-
-
-
-
Read later
My Reading List Elastic Cloud Computing (EC2) and VMware tools.
SpringSource Tool Suite enables Spring applications to be packaged and deployed onto a modular OSGi runtime environment as provided by SpringSource dm Server. STS also incorporates a task-focused user interface to speed development, architecture review tools to guide developers toward best practices, and runtime error analysis with automated resolution lookup to help developers solve problems in running applications.
SpringSource Tool Suite was available as a commercial tool in the past but SpringSource's founder Rod Johnson announced back in April, at the SpringOne Europe conference, that they will release STS suite as a free version. Christian Dupuis recently wrote about this announcement and the new features in the latest release.
The new features in SpringSource Tool Suite 2.1.0 RC1 and the recent Milestone releases include:
Development Tools
Spring Project Nature:
The new Spring Bean Definition and Web Flow Definition file wizard provides the option to automatically add the Spring Project Nature to a new project. The other visual tools like the Project Creation Wizard, rich forms-based Spring Configuration Editor, Quick Fixes and Quick Assist, Bean Creation Wizard, Namespace Configuration Dialog also aid in building Spring-based applications.
Project Templates:
The new release contains several project templates to help jumpstart new Spring-based projects. The project templates include the support for Spring Portfolio projects like Spring MVC, Spring Web Flow, Spring Faces, Spring Batch, Spring Roo and OSGi Bundle for SpringSource dm Server.
Type-aware Bean Reference Content Assist:
A long-standing feature request has been added in STS 2.1.0.M2: content assist for Spring bean references now prefers beans that match property and constructor types. Beans that match the property or constructor argument type get a higher priority and are clearly separated in the content assist proposal UI.
Spring 3.0 M3 Support:
STS has been updated to internally use Spring Framework 3.0.0.M3 to use Spring 3.0 features. The new <task:* /> and <jdbc:* /> are both now available and are integrated into STS as the other Spring namespaces with content assist, hyperlinking and validation. STS also supports @Configuration and @Bean, new annotations introduced in Spring 3.0 version. Spring beans configured by @Bean are visible within the Spring Explorer, Dependency Graph and can be referenced in Spring XML. These new annotations have also been added to the Stereotype and Annotation Grouping Support of STS providing the navigation of configuration classes and validation of the configuration classes.
Spring Roo Integration:
The developers can now configure an external Roo installation to be used inside STS instead of the bundled one. This allows usage of new Roo versions and add-ons without the need of a new STS version. In order to make the productivity advantages of Spring Roo available inside the IDE, STS integrates the Roo Shell and provides a Quick Roo Command Prompt (CTRL+R or CMD+R on Mac). The Roo installation can be configured on a per project or workspace level; this allows to target workspace projects to use different versions of Roo and a different set of addons.
Spring Batch Visual Editor:
The new STS release includes some improvements in the visual editor for Spring Batch to support a broad range of editing tasks. To access the Batch Editor open a Spring XML bean definition file with Batch jobs in it with the Spring Config Editor and select the batch-graph tab.
OSGi Development:
The Java developers now have the tools necessary to visualize, package, and deploy modular applications onto SpringSource dm Server. The OSGi development tools support in STS 2.0 includes the validation of the Bundlor template.mf file along MANIFEST.MF and TEST.MF manifest files.
Runtime Integration Tools
tc Server Instance & Group Management:
The new release of STS allows managing of groups and singe instances of tc Server right inside the IDE. The tc Server integration, introduced with STS 2.0.2, has been extended to allow start and stop operations as well as remote application deployment on tc Server instances that are managed by SpringSource AMS. To configure a group or single instance within STS, open the WTP Servers view and create a new server. In the New Server wizard select SpringSource AMS server type and complete the wizard.
Amazon EC2 Integration:
STS allows to deploy WAR applications, OSGi bundle and PAR projects to dm and tc Server running in the Amazon EC2 cloud. Corresponding AMIs for dm and tc Server have been published by SpringSource. The EC2 integration will automatically handle the setup of the application server cluster and load balancer if required.
VMware Lab Manager:
There is also a view called "Lab Manager" which allows the developers to connect to a VMware Lab Manager installation and browse configurations. The users can start and stop configurations and open consoles for the VM instances right inside the IDE. This feature can be installed from the VMware Eclipse update site. The developers deploying Spring applications within virtualized data centers now have the tools to help with testing and debugging the applications running on VMware Workstation.
SpringSource Tool Suite new release also provides good integration with the recently released Eclipse 3.5 version. Christian Dupuis and Adam Fitzgerald recently wrote about how to install SprintSource Tool Suite 2.1.0.RC1 Eclipse plugin in Eclipse 3.5 Galileo version.
From the team collaboration and task management stand-point, STS, a TaskTop certified tool, extends Mylyn's Task-focused user interface to provide a simple workflow to make it easier for developers to navigate the complex hierarchies of modern enterprise applications. It maintains a focused browsing history for all programming elements opened in the IDE as well as Web resources accessed./Grails
by
Raphael Miranda
Re: Groovy/Grails
by
Christian Dupuis
Right now the tools team is working on extending the current Groovy Eclipse plugin with incremental compilation and very tight integration into the Java editing and compilation infrastructure of Eclipse. This is an ongoing process which you can follow at andrewclement.blogspot.com/ and contraptionsforprogramming.blogspot.com/. Please note the both Andy and Andrew are working for SpringSource and we are actively investing in Groovy and Grails support. We are just not there yet.
Certainly you'll be able to install the improved Groovy plugin into STS; most likely we'll bundle it with the next version after 2.1.0.
Stay tuned for more news on that topic.
Christian Dupuis
--
Principal Software Engineer, SpringSource
Lead, Spring IDE & SpringSource Tool Suite
Re: Groovy/Grails
by
owen corpening
Groovy-Eclipse Feature 2.0.0.xx-20091207-1900-M2-e35 org.codehaus.groovy.eclipse.feature.feature.group
Groovy-Eclipse JDT Patch Sources Feature 2.0.0.xx-20091207-1900-M2-e35 org.codehaus.groovy.jdt.patch.source.feature.group
Groovy-Eclipse Sources Feature 2.0.0.xx-20091207-1900-M2-e35 org.codehaus.groovy.eclipse.feature.source.feature.group
SpringSource Tool Suite 2.2.1.200910210131-RELEASE com.springsource.sts.ide
SpringSource Tool Suite Grails Support 2.2.1.200910210131-RELEASE com.springsource.sts.grails.feature.group
Is there more available for grails?
Bean Validator performance
by
Ritesh Nath | https://www.infoq.com/news/2009/07/springsource-tool-suite | CC-MAIN-2017-09 | refinedweb | 1,208 | 54.32 |
Guide: Google Maps V2 for Android: Draw Driving Direction on Map:
This is again one of those popular questions that I stumble upon, I already gave here an
answer for this one, but I decided to put it in here anyways as a post. So let get started.
First of all if you are not familiar with Google’s new Maps API, I suggest you to first of all read
this post: Google Maps API V2 Key to get your own API key which is required to
integrate Google maps in your application. Next follow this post: Google Maps API V2
to actually integrate Google Maps in your application.
If you already have a map integrated in your application and you want to add driving navigation
to it, you came to the right place. Here I will present you the code that will allow you to paint a line
(Polyline object on your map) to show the directions from point A to B. But first I would like
to point your to this quote:
Google Maps/Google Earth APIs Terms of Service Last updated: May 27, 2009 ....9 use the Service or Content with any products, systems, or applications for or in connection with: (a) real time navigation or route guidance, including but not limited to turn-by-turn route guidance that is synchronized to the position of a user's sensor-enabled device; and may be disabled for certain apps (somehow, at least on Android)... FromGeocode scraping in .NET conversation: This is not allowed by the API terms of use. You should not scrape Google Maps to generate geocodes. We will block services that do automated queries of our servers. Bret Taylor Product Manager, Google Maps
I might be mistaken but from my understanding of this quote Google does not allow to show
driving navigation using Google Maps. Now that we covered that I will show you how you can
paint on the map.
1. So lets start with the GMapV2Direction class, this class is responsible to
make a request to Google Directions API and get the navigation instruction for 2 LatLng points:
public class GMapV2Direction { public final static String MODE_DRIVING = "driving"; public final static String MODE_WALKING = "walking"; public GMapV2Direction() { } public Document getDocument(LatLng start, LatLng end, String mode) { String url = "?" + "origin=" + start.latitude + "," + start.longitude + "&destination=" + end.latitude + "," + end.longitude + "&sensor=false&units=metric&mode=" + mode; try { HttpClient httpClient = new DefaultHttpClient(); HttpContext localContext = new BasicHttpContext(); HttpPost httpPost = new HttpPost(url); HttpResponse response = httpClient.execute(httpPost, localContext); InputStream in = response.getEntity().getContent(); DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(in); return doc; } catch (Exception e) { e.printStackTrace(); } return null; } public String getDurationText (Document doc) { NodeList nl1 = doc.getElementsByTagName("duration"); Node node1 = nl1.item(0); NodeList nl2 = node1.getChildNodes(); Node node2 = nl2.item(getNodeIndex(nl2, "text")); Log.i("DurationText", node2.getTextContent()); return node2.getTextContent(); } public int getDurationValue (Document doc) { NodeList nl1 = doc.getElementsByTagName("duration"); Node node1 = nl1.item(0); NodeList nl2 = node1.getChildNodes(); Node node2 = nl2.item(getNodeIndex(nl2, "value")); Log.i("DurationValue", node2.getTextContent()); return Integer.parseInt(node2.getTextContent()); } public String getDistanceText (Document doc) { NodeList nl1 = doc.getElementsByTagName("distance"); Node node1 = nl1.item(0); NodeList nl2 = node1.getChildNodes(); Node node2 = nl2.item(getNodeIndex(nl2, "text")); Log.i("DistanceText", node2.getTextContent()); return node2.getTextContent(); } public int getDistanceValue (Document doc) { NodeList nl1 = doc.getElementsByTagName("distance"); Node node1 = nl1.item(0); NodeList nl2 = node1.getChildNodes(); Node node2 = nl2.item(getNodeIndex(nl2, "value")); Log.i("DistanceValue", node2.getTextContent()); return Integer.parseInt(node2.getTextContent()); } public String getStartAddress (Document doc) { NodeList nl1 = doc.getElementsByTagName("start_address"); Node node1 = nl1.item(0); Log.i("StartAddress", node1.getTextContent()); return node1.getTextContent(); } public String getEndAddress (Document doc) { NodeList nl1 = doc.getElementsByTagName("end_address"); Node node1 = nl1.item(0); Log.i("StartAddress", node1.getTextContent()); return node1.getTextContent(); } public String getCopyRights (Document doc) { NodeList nl1 = doc.getElementsByTagName("copyrights"); Node node1 = nl1.item(0); Log.i("CopyRights", node1.getTextContent()); return node1.getTextContent(); } public ArrayList getDirection (Document doc) { NodeList nl1, nl2, nl3; ArrayList listGeopoints = new ArrayList(); nl1 = doc.getElementsByTagName("step"); if (nl1.getLength() > 0) { for (int i = 0; i < nl1.getLength(); i++) { Node node1 = nl1.item(i); nl2 = node1.getChildNodes(); Node locationNode = nl2.item(getNodeIndex(nl2, "start_location")); nl3 = locationNode.getChildNodes(); Node latNode = nl3.item(getNodeIndex(nl3, "lat")); double lat = Double.parseDouble(latNode.getTextContent()); Node lngNode = nl3.item(getNodeIndex(nl3, "lng")); double lng = Double.parseDouble(lngNode.getTextContent()); listGeopoints.add(new LatLng(lat, lng)); locationNode = nl2.item(getNodeIndex(nl2, "polyline")); nl3 = locationNode.getChildNodes(); latNode = nl3.item(getNodeIndex(nl3, "points")); ArrayList arr = decodePoly(latNode.getTextContent()); for(int j = 0 ; j < arr.size() ; j++) { listGeopoints.add(new LatLng(arr.get(j).latitude, arr.get(j).longitude)); } locationNode = nl2.item(getNodeIndex(nl2, "end_location")); nl3 = locationNode.getChildNodes(); latNode = nl3.item(getNodeIndex(nl3, "lat")); lat = Double.parseDouble(latNode.getTextContent()); lngNode = nl3.item(getNodeIndex(nl3, "lng")); lng = Double.parseDouble(lngNode.getTextContent()); listGeopoints.add(new LatLng(lat, lng)); } } return listGeopoints; } private int getNodeIndex(NodeList nl, String nodename) { for(int i = 0 ; i < nl.getLength() ; i++) { if(nl.item(i).getNodeName().equals(nodename)) return i; } return -1; } private ArrayList decodePoly(String encoded) { ArrayList; LatLng position = new LatLng((double) lat / 1E5, (double) lng / 1E5); poly.add(position); } return poly; } }
2. Because finding the desired route is a potentially long running task,
we need to place this in a AsyncTask in order to avoid blocking the UI-Thread.
So we are going to create the following GetDirectionsAsyncTask:
public class GetDirectionsAsyncTask extends AsyncTask<Map<String, String>, Object, ArrayList> { public static final String USER_CURRENT_LAT = "user_current_lat"; public static final String USER_CURRENT_LONG = "user_current_long"; public static final String DESTINATION_LAT = "destination_lat"; public static final String DESTINATION_LONG = "destination_long"; public static final String DIRECTIONS_MODE = "directions_mode"; private MapFragmentActivity activity; private Exception exception; private ProgressDialog progressDialog; public GetDirectionsAsyncTask(MapFragmentActivity activity) { super(); this.activity = activity; } public void onPreExecute() { progressDialog = new ProgressDialog(activity); progressDialog.setMessage("Calculating directions"); progressDialog.show(); } @Override public void onPostExecute(ArrayList result) { progressDialog.dismiss(); if (exception == null) { activity.handleGetDirectionsResult(result); } else { processException(); } } @Override protected ArrayList doInBackground(Map<String, String>... params) { Map<String, String> paramMap = params[0]; try { LatLng fromPosition = new LatLng(Double.valueOf(paramMap.get(USER_CURRENT_LAT)) , Double.valueOf(paramMap.get(USER_CURRENT_LONG))); LatLng toPosition = new LatLng(Double.valueOf(paramMap.get(DESTINATION_LAT)) , Double.valueOf(paramMap.get(DESTINATION_LONG))); GMapV2Direction md = new GMapV2Direction(); Document doc = md.getDocument(fromPosition, toPosition, paramMap.get(DIRECTIONS_MODE)); ArrayList directionPoints = md.getDirection(doc); return directionPoints; } catch (Exception e) { exception = e; return null; } } private void processException() { Toast.makeText(activity, activity.getString(R.string.error_when_retrieving_data), 3000).show(); } }
3. No we would like to use this AsyncTask to find the road direction from one
location to another. To make the usage of this AsyncTask a little bit more convenient I have
created the following findDirections method in my MapFragmentActivity:
public void findDirections(double fromPositionDoubleLat, double fromPositionDoubleLong, double toPositionDoubleLat, double toPositionDoubleLong, String mode) { Map<String, String> map = new HashMap<String, String>(); map.put(GetDirectionsAsyncTask.USER_CURRENT_LAT, String.valueOf(fromPositionDoubleLat)); map.put(GetDirectionsAsyncTask.USER_CURRENT_LONG, String.valueOf(fromPositionDoubleLong)); map.put(GetDirectionsAsyncTask.DESTINATION_LAT, String.valueOf(toPositionDoubleLat)); map.put(GetDirectionsAsyncTask.DESTINATION_LONG, String.valueOf(toPositionDoubleLong)); map.put(GetDirectionsAsyncTask.DIRECTIONS_MODE, mode); GetDirectionsAsyncTask asyncTask = new GetDirectionsAsyncTask(this); asyncTask.execute(map); }
What I’m doing here is creating a HashMap with the needed coordinates
(Start Lat and Long, End Lat and Long), Passing them to the AsyncTask and executing it.
4. Next, we will create the following handleGetDirectionsResult method,
to handle the AsyncTask result and to actually paint the directions Polyline on the map.
public void handleGetDirectionsResult(ArrayList directionPoints) { Polyline newPolyline; GoogleMap mMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); PolylineOptions rectLine = new PolylineOptions().width(3).color(Color.BLUE); for(int i = 0 ; i < directionPoints.size() ; i++) { rectLine.add(directionPoints.get(i)); } newPolyline = mMap.addPolyline(rectLine); }
5. Finally to get the direction we need to run the findDirections method
with the desired locations in code like );
The final result should look something like that:
As you see a blue directions line is drown on the map, for showing the way you need to
go for your destination. And that’s it, you are finished.
6. UPDATE: Due to many requests I have created a small Android project that
demonstrates the usage of this code. You can download this project from here.
The project show how to navigate from Amsterdam to Paris or to Frankfurt, just
remember to add your Google Maps API V2 Key in the manifest file.
Enjoy and stay tuned.
FILED UNDER :Guide , Guide - Android Development , Guide - Google Maps for Android
thank you very much…It’s very simple and useful example..Posted on July 3rd, 2013 at 1:47 pm | Quote
@Raja Rajan you welcome. I’m glad you found it useful.Posted on July 19th, 2013 at 6:08 pm | Quote
Hi will it be possible if you could give us the full codes for the project? Greatly appreciated!Posted on July 21st, 2013 at 10:16 pm | Quote
@Pearly currently this code is part of a bigger work project that I can’t post here. I will try to take some time and build a new project with only this code in the near future and provide it here for the users.Posted on July 23rd, 2013 at 4:59 pm | Quote
Thanks for code. I am having 2 error in this code.
1. progressDialog = DialogUtils.createProgressDialog(activity,activity.getString(R.string.get_data_dialog_message));
— DialogUtils is undefined. Is there any pakage I need to download and import or need to create manually(any code anywhere)?
2. GoogleMap mMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
— getSupportFragmentManager() is undefined. Although I have already import these 2 reference :
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.SupportMapFragment;
Please help!!!Posted on July 26th, 2013 at 10:44 am | Quote
@sourabh hi, regarding you problems:
1. DialogUtils is a class I created that is responsible to show different kinds of dialogs in my
application. You can just remove those lines from code, or create your own dialog
(I will remove it from the guide as well, forgot to do that).
2. Regarding the SupportMapFragment class, you are doing it the wrong way. you need not to import those files in you activity class, but to refrence the Google-play-services library the way it described in the following guide: Google Maps API V2 Guide in step 3.Posted on July 26th, 2013 at 2:44 pm | Quote
@Emil : It is solved when I extends FragmentActivity instead of Activity.Posted on July 26th, 2013 at 6:52 pm | Quote
@sourabh great news, I’m glad you got it figured out.Posted on July 28th, 2013 at 7:16 am | Quote
Thanks Alot!!! it really works!!Posted on August 7th, 2013 at 9:43 pm | Quote
Thank you, it’s very usefulPosted on September 21st, 2013 at 12:26 pm | Quote
HI it’s awesome stuff ! is it possible to get the live navigation based on the vehicles movement ? I need it for a project ! thanks in advance !Posted on September 23rd, 2013 at 9:30 am | Quote
@Mohan yes, of course it possible to get live navigation. You will have to implement a LocationListener to get your location updates and then repaint the navigation Polyline based on those updates.Posted on September 23rd, 2013 at 9:52 am | Quote
Hi i have problem how to make direction when i click marker, i want to make direction from my location to marker that i clicked.Posted on October 3rd, 2013 at 8:36 pm | Quote
i still cant figured out how to make this problem, would you mind to share full code?Posted on October 3rd, 2013 at 9:05 pm | Quote
Getting error on this line at GMapV2Direction ” longitude cannot be resolved”Posted on October 7th, 2013 at 8:45 am | Quote
listGeopoints.add(new LatLng(arr.get(j).latitude, arr.get(j).longitude));
What should do now
@Jacks Hi, I can’t post the full currently because this is part of a work project I have been working on. But you can post a question in Stackoverflow, post here a link and I will try to help you.Posted on October 7th, 2013 at 10:30 am | Quote
@Kabir Hi, I didn’t understood what exactly is your problem, could you provide more information. Or better, please open an informative question on Stackoverflow and post here a link and I will try to help you.Posted on October 7th, 2013 at 10:35 am | Quote
I am just getting error on this latitued and longitued
listGeopoints.add(new LatLng(arr.get(j).latitude, arr.get(j).longitude));
It says “latitude cannot be resolved or its not a field” & “longitudecannot be resolved or its not a field”Posted on October 7th, 2013 at 11:08 am | Quote
If i press ctrl+space after arr.get(j). it shows no suggestion like latitude/longitude
u understand?
@Kabir so if I understand correctly your objects inside the array don’t have latitude/longitude fields. I would guess that this is the reason you can’t get data from those fields.Posted on October 7th, 2013 at 11:33 am | Quote
Hi emil, i wanted to make a destination marker on another mareker based on latitutde and logitute.
so when i click another marker then the path will routing to place with marker.
like this
Name lat longi
marker place one (-6.12334, 11.0123123)
marker place two (-6.32244, 12.213423)
marker place three(-5.8212, 10.86435)
nah, when marker place one clicked then directions will showing from my locations ( current position) to marker place one.
i can make direcection, but when using im tapping marker(based on longitude and latitude) i cant tapping that marker. i must tapping near the marker to make a direction
this is the code emil on October 8th, 2013 at 3:02 pm | Quote
Hi emil i have this problem, this is my question from stackoverflowPosted on October 8th, 2013 at 8:13 pm | Quote
@Kabir
I got the same problem.Posted on November 7th, 2013 at 3:34 am | Quote
instead of [java]ArrayList[/java] put [java]ArrayList<LatLng>[/java]
Then my problem solved
@ EmilPosted on November 7th, 2013 at 8:10 am | Quote
Thanks a lot. This worked as a charm. But I want to get the co-ordinates of the waypoints (only the turning points) along the drawn path. because i want to calculate the directions between those turning points.
In MapFragmentActivity, );
I detect two error that SGTasksListAppObj, clickMarkerLatLng
what does mean? SGtasksListAppObj, clickMarkerLatLngPosted on November 11th, 2013 at 12:33 pm | Quote
@ultraman Hey, the SGTasksListAppObj is my Application class in which I store the clickMarkerLatLng which is basically a LatLng object on the currently clicked marker, I store it there because I needed to access it’s data from other Activities.Posted on November 12th, 2013 at 7:32 pm | Quote
What is MapFragmentActivity?Is it the name of the main Activity file ?Posted on November 14th, 2013 at 10:07 am | Quote
@bala Yes exactly, This is my Activity that contains the MapFragment on which I paint the direction.Posted on November 14th, 2013 at 12:37 pm | Quote
In your case it can be any other Activity that holds this fragment.
Hey , I figured that out myself. I have a question. How to get the actual directions in text point-by-point?Posted on November 14th, 2013 at 1:52 pm | Quote
Hello, my name is exequiel, I’m from chile. I need to do this in my project, but it throws errors, you could send this project to my mail? My main mistake);
My email is ex.espinoza @ alumnos.duoc.cl, if you can send me this project would be very grateful and would help me a lot in my studiesPosted on November 15th, 2013 at 3:20 am | Quote
@Exequiel Hey, I have added a small project in section 6 that you can download.Posted on November 17th, 2013 at 9:59 pm | Quote
thank you ! thank you! and thank you!Posted on November 19th, 2013 at 5:51 pm | Quote
i tried the project that you created but it gives me an error.
[java]Posted on November 20th, 2013 at 10:21 am | Quote
Caused by: java.lang.IllegalStateException: The meta-data tag in your app’s AndroidManifest.xml does not have the right value. Expected 4030500 but found 0. You must have the following declaration within the element:
[/java]
@Edzel As the error suggests, replace this meta-data:
[java]
<meta-data
android:name="com.google.android.gms.version"
android:
[/java]
with this:Posted on November 20th, 2013 at 6:16 pm | Quote
[java]
<meta-data
android:name="com.google.android.gms.version"
android:
[/java]
Hi Sir,
I get problem when i click navigate button , not show any maps , just dialog calculation process then not any direction.Posted on December 1st, 2013 at 4:46 am | Quote
what’s wrong with my code????
@Ainunnjb Hey, if you are using the provided code then as said in the post: “justPosted on December 1st, 2013 at 5:34 pm | Quote
remember to add your Google Maps API V2 Key in the manifest file.” , So you need to produce an API key to get it started.
@Emil Adjiev i already produce my API key and add to manifest file but no map and direction
this is my manifest file :
Sir , i tried your tutorial creating your google map application and success and i tried this but not success.
i want to ask you about the key , if i make other application i must make new key or i can use previous key?
I’m Newbie in this.Posted on December 1st, 2013 at 9:52 pm | Quote
thank you.
This is my manifest file :Posted on December 1st, 2013 at 9:54 pm | Quote
how we can get audio tracks for all route nodes in that google map v2?Posted on December 11th, 2013 at 12:06 pm | Quote
@Dimpy Hey, Actually it’s a great question, I have no idea. If you find a way please share it with me.Posted on December 11th, 2013 at 11:56 pm | Quote
Hi emi’sPosted on December 27th, 2013 at 7:42 am | Quote
very nice tutorial very much useful in my project.
All is working fine in android device like htc and micromax.
but i found problem when my appication install in samsung and other mobile
google map is not displaying only zoom button are displaying with grey screen
can solve my problem…
Thank u very much, it’s very usefulPosted on December 31st, 2013 at 5:34 am | Quote
Hey. Good day! I have a problem with this:
[java]
for(int j = 0 ; j < arr.size() ; j++) {
listGeopoints.add(new LatLng(arr.get(j).latitude, arr.get(j).longitude));
};
[/java]
".LATITUDE" and ".LONGITUDE" are not working.
it says that it cannot be resolved or is not a field.
can you help me?Posted on February 4th, 2014 at 4:56 pm | Quote
@Jordan, I have a strange feeling that you have made the wrong imports.Posted on February 9th, 2014 at 5:29 pm | Quote
Hi Emil, it’s awesome stuff! Tried it in my C# Xamarin project and I’m glad i found this article!!!Posted on February 11th, 2014 at 1:52 pm | Quote
@Emil Adjiev Alright. I’ll check it.Posted on February 17th, 2014 at 4:09 pm | Quote
Hi Emil, i am working on to search nearby places. Is it possible to use your code to get directions to searched places.Posted on March 5th, 2014 at 10:50 am | Quote
Thanks
@Rhythm Hey, as long as you have the lat, long coordinates of both locations I don’t see why not : )Posted on March 5th, 2014 at 11:07 am | Quote
@Emil Adjiev Thanks for the reply…Posted on March 12th, 2014 at 2:50 am | Quote
Hi Emil Adjiev,
Thanks for the nice tutorial. I have one doubt i their any api available for voice over the navigation. If it is available please give some guidance in the samePosted on March 15th, 2014 at 9:44 pm | Quote
How can i fit the direction in screen.
my direction always out side the screen.can i show both start and end marker to the screen
thanks.Posted on March 20th, 2014 at 2:22 pm | Quote
Thank you so much wonderful coding very helpfulPosted on May 6th, 2014 at 4:23 pm | Quote
Question. why use xml instead of json?Posted on May 11th, 2014 at 6:54 am | Quote
@crushman Hey, both are ways to transfer data over the internet so I don’t really see any difference in using JSON over XML or the other way around in this case.Posted on May 11th, 2014 at 8:30 pm | Quote
Thanks manPosted on June 2nd, 2014 at 11:09 pm | Quote
You saved me a lot of work. Thank you!Posted on June 5th, 2014 at 2:37 pm | Quote
Hi Emil,Posted on August 7th, 2014 at 3:45 pm | Quote
Im trying to connect two cities belonging to two different nations,in some scenarios your code works perfectly,but for many other scenarios it just shows one of the location without any polyline drawn.
@kaleem Hi, When the polyline is not getting drawn, it means that the response you are getting from Google Directions API basically returns you no path from one point to another. This might happen when there is no actual road connection the two location you are trying to show driving direction for.Posted on August 20th, 2014 at 6:27 pm | Quote
Amazing post, really useful and clear information!!!
I just had to make a few changes for Fragment call adaptation, and also on handleGetDirectionsResult it requested a (LatLng) directionPoints.get(i) instead.
Thank you sir!Posted on September 5th, 2014 at 1:28 pm | Quote
great coding man! you really helped me. My question is how can I add more than 2 points for connection on the map?Posted on September 15th, 2014 at 3:24 pm | Quote
@mike no worries I found out that I needed to put waypoints in it! thanks againaPosted on September 15th, 2014 at 4:08 pm | Quote
First ,thank you very much for this post.I am using your code at my project.I have a list containing some location coordinates.I try to draw a path by using these coordinates.While some path drawn correctly others don’t.Do you have any idea?Posted on September 24th, 2014 at 4:03 pm | Quote
@aylin Hi, the paths that are drawn are the paths you receive from Google Directions API. So I don’t really understand what do you mean by not correctly.Posted on September 27th, 2014 at 4:33 pm | Quote
@Emil Adjiev I have some json objects which consist of lat lng points , I put markers on these coordinates and I am trying to draw polyline to link these coordinates.But not all points were linked.Sometimes all points were drawn sometimes some of them is missing.I could’t understand why.Posted on September 29th, 2014 at 10:08 am | Quote
@aylin Hi, My guess would be that the points that are not getting connected are the points that don’t have a clear one way road to connect them. In this case Google Direction API will return you an empty result and no the way point to draw the path.Posted on September 29th, 2014 at 10:58 am | Quote
@Emil AdjievFor example when I give some coordinates in an order, path is drawn correctly.While when I give these coordinates in a reverse order a different path is drawn.How can I solve this issue?Posted on October 9th, 2014 at 4:09 pm | Quote
@Emil Adjiev Thanks man, you have help me a lot with this tutorial. I have a question, how do i can erase a driving direction ?Posted on October 20th, 2014 at 3:18 am | Quote
@Johnny You welcome, to remove a Polyline from the map you have a remove method on this object: on October 30th, 2014 at 9:03 pm | Quote
Thanks, this wonderful example!!! =)Posted on December 3rd, 2014 at 2:48 am | Quote
Thnanks, very nice tutorial very much useful in my projectPosted on December 11th, 2014 at 3:15 pm | Quote
@nisansi
Thanks for the solution. I had the same problem (the Latitude and Longitude does not exist)Posted on December 15th, 2014 at 12:14 pm | Quote
Thanks for this post .Posted on December 16th, 2014 at 12:50 pm | Quote
Basically I copied the project you posted and import Google Play Services Library and change the API key. I manage to compile the code with no errors, but the app stopped running afterwards when I tested on a physical device. Any idea what is causing this?Posted on December 27th, 2014 at 11:52 am | Quote
You are amazing at this! Thank you for all the help you’ve give me. Kudos to you!Posted on January 11th, 2015 at 7:37 pm | Quote
You are great at this! Thank you for the help
I have a question though. When I try to use this code in my project, the Logcat displays the following errors:
01-12 01:04:53.607: E/Google Maps Android API(25838): Authorization failure. Please see for how to correctly set up the map.
01-12 01:04:53.627: E/Google Maps Android API(25838): In the Google Developer Console ()
01-12 01:04:53.627: E/Google Maps Android API(25838): Ensure that the “Google Maps Android API v2″ is enabled.
01-12 01:04:53.627: E/Google Maps Android API(25838): Ensure that the following Android Key exists:
01-12 01:04:53.627: E/Google Maps Android API(25838): API Key: *my key*
01-12 01:04:53.627: E/Google Maps Android API(25838): Android Application (;): EA:43:88:50:0D:7F:DC:D4:26:5B:BD:CF:F2:15:AB:3B:88:14:27:D6;gis.project.f_7explorer
What on earth should I do??Posted on January 11th, 2015 at 10:06 pm | Quote
@Momina You welcome, Make sure you have turned on the right API in the Google Developers console. And verify you API key, I would even go over the process of key generation again and try to register another key in case you continue to face those issues.Posted on January 12th, 2015 at 10:45 am | Quote
@Brendon Hi, do you have any error message?Posted on January 12th, 2015 at 11:04 am | Quote
Thanks man! It’s simple!Posted on January 15th, 2015 at 10:26 pm | Quote
Hi,
I managed to integrate this into my project. The route is drawn (excellent!) but I would also like to add the distance and time to walk information. Well, those are provided by the GMapV2Direction class but I found out that the values are totally incorrect: for about 10 km distance it gives 0.3km / 3 min to walk even though the route is drawn correctly. Any idea what could be wrong? Does it use only the first and second (not the endpoint) point on the route to count the distance and walking time?
CheersPosted on January 20th, 2015 at 9:38 am | Quote
@raki
Found the solution by myself. This is the first time I look into this but by debugging I found out that it’s the last node that tells the distance of the total route – not the first one. Just like I guessed, it used just the starting point and the first turning point to calculate the distance.
As said, I have not deep studied this but it seems to work this way at least in my phone. Please do rise your voice if this is somehow Android version specific. Anyway in case someone else is having trouble with this, here is how I got it working for distance:
public String getDistanceText (Document doc) {
NodeList nl1 = doc.getElementsByTagName(“distance”);
Node node1 = nl1.item(nl1.getLength()-1); // <– The last node
NodeList nl2 = node1.getChildNodes();
Node node2 = nl2.item(getNodeIndex(nl2, "text"));
System.out.println("distance text: "+ node2.getTextContent());
return node2.getTextContent();
}
CheersPosted on January 20th, 2015 at 10:04 am | Quote
Hi, Emil! your code really helped us a lot in our thesis. Thanks for this!Posted on January 30th, 2015 at 1:06 pm | Quote
Hi Emil.Posted on March 22nd, 2015 at 12:31 am | Quote
Grate work I have to say.
I am working on this project for college where i need to set directions from A to B by entering locations in text.
Then map should show directions.
While your are moving it should show your moving location and at the same time the shortest found route by google map.
I am wondering if you have a similar project for me so i could use it as an example for my studies?
Thanks a lot for reply in advance.
Eugene
@Eugene Hi, sorry but this is the only project I have to share on this topic. But you could easily modify this project to handle your needs.Posted on April 15th, 2015 at 5:19 pm | Quote | https://blog-emildesign.rhcloud.com/?p=822 | CC-MAIN-2015-18 | refinedweb | 4,880 | 57.37 |
fgetc()
Read a character from a stream
Synopsis:
#include <stdio.h> int fgetc( FILE* fp );
Since:
BlackBerry 10.0.0
Arguments:
- fp
- The stream from which you want to read a character.
Library:
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
Description:
The fgetc() function reads the next character from the stream specified by fp.
Returns:
The next character from fp, cast as (int)(unsigned char), or EOF if end-of-file has been reached or if an error occurs ( reading.
- EINTR
- The read operation was terminated due to the receipt of a signal, and no data was transferred.
- EIO
- One of the following:
- A physical I/O error occurred.
- The process is in a background process group attempting to read.
- EOVERFLOW
- The file is a regular file, and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.:
Last modified: 2014-06-24
Got questions about leaving a comment? Get answers from our Disqus FAQ.comments powered by Disqus | http://developer.blackberry.com/native/reference/core/com.qnx.doc.neutrino.lib_ref/topic/f/fgetc.html | CC-MAIN-2015-11 | refinedweb | 178 | 67.76 |
I have two questions - one about React & Redux and one about es6.
handleChange = (event, index, value) => {
this.setState({value});
};
export default class AddSterbefallForm extends React.Component {
constructor(props) {
super(props);
this.state = {value: 10};
}
handleChange = (event, index, value) => {
this.setState({value});
};
render() {
return (
<SelectField value="{this.state.value}" onChange {this.handleChange}>
<MenuItem value="Herr" key="m" primaryText="Herr" />
<MenuItem value="Frau" key="w" primaryText="Frau" />
</SelectField>
);
}
}
As you said, you're new to Redux. What I would suggest you is to create Redux example projects on your own. You can find excellent examples here. When I was learning Redux, I studied each and every example and recreated the same projects on my own. That really helped!
Before you go on using Material UI framework in your project, you'll want to have a clear idea about what is Redux, why is it used and how is it used. Let me tell you that using Redux will not completely remove React's
setState(). There is still some use of React's native state management.
For example- If you want to store state of a button, if it is enabled or disabled, you won't necessarily need Redux for that! You can still use React's native state. Like this-
class Button extends React.Component { constructor(props) { super(props); this.state = { active: true }; this.toggle = this.toggle.bind(this); } toggle() { this.setState({ active: !this.state.active }); } render() { return ( <div> <button disabled={this.state.active} onClick={this.toggle}> {this.state.active ? 'Click me!' : 'You cannot click me'} </button> <div> ); } }
See? You don't need Redux here at all! I hope you'll learn Redux before diving into an awesome project! Good luck! | https://codedump.io/share/BN9IZbPUV6JW/1/mix-redux-store-with-states | CC-MAIN-2018-22 | refinedweb | 279 | 53.47 |
Can I make a class implement an interface via Groovy's compile-time metaprogramming, and if so, how? I know that I can implement the methods defined in an interface for a given class. But how can I then cast an object of that class to that interface type?
Let's say I have an interface
public interface MyInterface {
void foo();
}
public class MyClass {
}
bar
MyInterface
MyClass
MyInterface mi = bar();
mi.foo();
ClassCastException
Groovy features a couple of runtime ways to solve that, but I'm not aware of any "compile-time" solutions to it (beside implementing the interface, of course).
Anyway, you can coerce a class/map/closure to an interface easily. Here are some solutions:
asoperator
I think this is the best for your case. A class is coerced into an interface. It is similar to Java proxies.
interface MyInterface { def foo() } class MyClass { def foo() { "foo" } } def bar() { return new MyClass() as MyInterface } MyInterface mi = bar() assert mi.foo() == "foo"
A map can be coerced into an interface. You need to forward the method signatures, but it also gives more control over what is invoked and how it is invoked.
def mapped() { def m = new MyClass() [foo: { m.foo() }] as MyInterface } MyInterface mi2 = mapped() assert mi2.foo() == "foo"
Classical JDK < 8 style for a single method interface implementation.
def anonymous() { def m = new MyClass() new MyInterface() { def foo() { m.foo() } } } MyInterface mi3 = anonymous() assert mi3.foo() == "foo"
This one works a lot like JDK 8 lambda coercion. In this case, the method is returning a method reference to
m.foo coerced into
MyInterface. Be aware closure coercion is way more powerful than this, being able to coerce into abstract classes, concrete classes and splitting the atom:
def coercion() { def m = new MyClass() m.&foo as MyInterface } MyInterface mi4 = coercion() assert mi4.foo() == "foo" | https://codedump.io/share/3FW1UDa3tNS2/1/groovy-make-a-class-implement-an-interface-via-metaprogramming | CC-MAIN-2017-47 | refinedweb | 306 | 58.08 |
03 September 2010 15:57 [Source: ICIS news]
By Nigel Davis
?xml:namespace>
The
Global chemicals output will be directed towards stronger markets - principally in Asia but also in
Underlying the changed market dynamics will be the question of cost. And the opportunities to access faster growing markets will be hard fought. This suggests that most producers will redouble efforts to drive into
The changed feedstock picture in the
Does that mean that further development of the sector continues to lie in the hands of state-run enterprises or of companies with a considerable proportion of state control? Petrochemicals is not necessarily a place for the investing public, as wise heads have said before.
The new feedstock outlook in the
The strains put on C3s and C4s by changed refinery and feedstock dynamics open up opportunities. The careful management of output to demand, driven itself by the financial crisis and the need to retain a much tighter hold on working capital, is a characteristic of this business that will not change any time soon. Subdued demand growth in the second half of 2010 and possibly only slow growth in 2011 will help see to that.
Also, companies will have to start spending again soon if they are to maintain operating reliability. The tight management of cash has put strains on parts of the supply chain and will continue to tell in certain markets.
A critical question for European producers is just how much longer they can continue to benefit from European demand growth.
The news is not all bad. Some analysts believe that the major European economies can continue to grow this year and next.
The second quarter was the strongest so far and it probably is down hill from here for the remainder of 2010. But the
Petrochemicals tend to be early reflectors of good and bad news.
European petrochemicals production was up 42% from the bottom of the slump, Cefic showed this week. But the chemicals trade group’s petrochemicals production index also indicated that output has yet to reach the peak achieved in January 2008.
The recovery has been remarkable, and particularly so in polymers in the first half of 2010, but polymers output was flat in June: probably a sign of things to come.
Chemical industry executives need to be cautious.
Germany’s chemicals trade group VCI on Thursday talked of less optimism in the sector against the backdrop of a looming economic slowdown: in the US, Europe and China.
The days of the big gains in output probably are over. The VCI suggests a return to more ‘normal’ levels of output growth.
The VCI is sticking with its earlier output forecasts for
In the uncertain second-half environment export sales will again be tremendously important. They rely heavily on demand from Asia and from
Bookmark Paul Hodges’ Chemicals & the Economy blog
Read John Richardson and Malini Hariharan’s Asian Chemical Connections blog
Click here to find out more on the North America, | http://www.icis.com/Articles/2010/09/03/9390712/INSIGHT-A-return-to-more-normal-rates-of-growth.html | CC-MAIN-2014-35 | refinedweb | 497 | 59.23 |
Opened 12 years ago
Closed 12 years ago
#2036 closed defect (fixed)
utils/autoreload.py falls over when "thread" module is not installed
Description
Python's thread module is the interface to your systems pthreads library - and it's also an optional module, as not all systems support pthreads. Where pthreads are not available, the "dummy_thread" module can be used as a drop-in replacement..
easy to do..instead of:
import os, sys, thread, time
use:
import os, sys, time try: import thread except: import dummy_thread as thread
Change History (1)
comment:1 Changed 12 years ago by
Note: See TracTickets for help on using tickets.
(In [3020]) Fixed #2036 -- autoreload.py no longer fails for uninstalled 'thread' module. Thanks, plmeister@… | https://code.djangoproject.com/ticket/2036 | CC-MAIN-2018-13 | refinedweb | 121 | 72.05 |
Once you’ve started really taking advantage of Scalaz’s typeclasses
for generic programming, you might have noticed a need to write
typelambdas to use some of your neat abstractions, or use syntax like
traverse or
kleisli with a strangely-shaped type as an argument.
Here’s a simple generalization, a
List-based
traverse.
import scalaz.Applicative, scalaz.syntax.applicative._ def sequenceList[F[_]: Applicative, A](xs: List[F[A]]): F[List[A]] = xs.foldRight(List.empty[A].point[F])((a, b) => ^(a, b)(_ :: _))
This works fine for a while.
scala> import scalaz.std.option._ import scalaz.std.option._ scala> sequenceList(List(some(1),some(2))) res1: Option[List[Int]] = Some(List(1, 2)) scala> sequenceList(List(some(1),none)) res2: Option[List[Int]] = None
The type of the input in the above example,
List[Option[Int]], can be
neatly destructured into the
F and
A type params needed by
sequenceList. It has the “shape”
F[x], so
F can be picked out by
Scala easily.
Consider something else with a convenient
Applicative instance,
though.
scala> import scalaz.\/ import scalaz.$bslash$div scala> sequenceList(List(\/.right(42), \/.left(NonEmptyList("oops")))) <console>:23: error: no type parameters for method sequenceList: (xs: List[F[A]])(implicit evidence$1: scalaz.Applicative[F])F[List[A]] exist so that it can be applied to arguments (List[scalaz.\/[scalaz.NonEmptyList[String],Int]]) --- because --- argument expression's type is not compatible with formal parameter type; found : List[scalaz.\/[scalaz.NonEmptyList[String],Int]] required: List[?F] sequenceList(List(\/.right(42), \/.left(NonEmptyList("oops")))) ^
Here,
?F meaning it couldn’t figure out that you meant
({type λ[α]
= NonEmptyList[String] \/ α})#λ.
scala> sequenceList[({type λ[α] = NonEmptyList[String] \/ α})#λ, Int ](List(\/.right(42), \/.left(NonEmptyList("oops")))) res5: scalaz.\/[scalaz.NonEmptyList[String],List[Int]] = -\/(NonEmptyList(oops))
The problem is that
NonEmptyList[String] \/ Int has the shape
F[A, B], with
F of kind
* -> * -> * after a fashion, whereas the
F it wants must have kind
* -> *, and Scala kinds aren’t curried
at all.
Unapplyinstance
Unapply, though, does have implicit instances matching the
F[A, B] shape,
unapplyMAB1 and
unapplyMAB2, in its companion so
effectively always visible. What’s special about them is that their
type parameters match the “shape” you’re working with,
F[A, B].
You should look at their source to follow along.
Let’s see if one of them works. For implicit resolution to finish, it’s important that exactly one of them works.
scala> import scalaz.Unapply import scalaz.Unapply scala> Unapply.unapplyMAB1[Applicative, \/, NonEmptyList[String], Int] <console>:23: error: could not find implicit value for parameter TC0: scalaz.Applicative[[α]scalaz.\/[α,Int]] Unapply.unapplyMAB1[Applicative, \/, NonEmptyList[String], Int] ^ scala> Unapply.unapplyMAB2[Applicative, \/, NonEmptyList[String], Int] res7: scalaz.Unapply[scalaz.Applicative, scalaz.\/[scalaz.NonEmptyList[String],Int]]{ type M[X] = scalaz.\/[scalaz.NonEmptyList[String],X]; type A = Int } = scalaz.Unapply_0$$anon$13@5402af61
Here, the type
res7.M represents the typelambda being passed to
sequenceList. You can see that work.
scala> sequenceList[res7.M, res7.A]( List(\/.right(42), \/.left(NonEmptyList("oops")))) res8: res7.M[List[res7.A]] = -\/(NonEmptyList(oops)) scala> res8 : NonEmptyList[String] \/ List[Int] res9: scalaz.\/[scalaz.NonEmptyList[String],List[Int]] = -\/(NonEmptyList(oops))
The
res8 conformance test shows that Scala can still reduce the
path-dependent
res7.M and
res7.A types at this level, outside
sequenceList.
Implicit resolution can pick the call to
unapplyMAB2 partly because
it can pick all of its type parameters without weird typelambda
structures. But in Scalaz, we use typeclasses to guide its choice.
Why didn’t
unapplyMAB1 work? In this case, you can trust
scalac
to say exactly the right thing: it looked for
Applicative[[α]scalaz.\/[α,Int]], and didn’t find one. Sure enough,
\/ being right-biased means we don’t offer that instance.
Incidentally, if you were to introduce that instance, you’d break code
relying on right-biased
Unapply resolution to work.
unapplyMAB2 needs evidence of
TC[({type λ[α] = M0[A0, α]})#λ].
But that’s okay, because we have that, where
TC=Applicative,
M0=\/, and
A0=NonEmptyList[String]!
scala> Applicative[({type λ[α] = \/[NonEmptyList[String], α]})#λ] res10: scalaz.Applicative[[α]scalaz.\/[scalaz.NonEmptyList[String],α]] = scalaz.DisjunctionInstances2$$anon$1@2f658816
Scala doesn’t need to figure out any typelambda itself for this to
work; we did everything by putting the typelambda right into
unapplyMAB2’s evidence requirement, so it just has to find the
conforming implicit value.
Unapplygenerically
Now you can write a
sequenceList wrapper that works for
\/ and
many other shapes, including user-provided shapes in the form of new
Unapply implicit instances. If you’re using Scala 2.9 (still?!) you
need to add
-Ydependent-method-types to
scalacOptions to write
this function.
def sequenceListU[FA](xs: List[FA]) (implicit U: Unapply[Applicative, FA] ): U.M[List[U.A]] = sequenceList(U.leibniz.subst(xs))(U.TC)
Instead of
xs being
List[F[A]], it’s
List[FA], and that’s
destructured into
U.M and
U.A. The latter are path-dependent
types on
U, the conventional name of the
Unapply parameter. We
have also followed the convention of naming the
Unapply-taking
variant function ending with a
U.
And that works great!
scala> sequenceListU(List(\/.right(42), \/.left(NonEmptyList("oops")))) res11: scalaz.\/[scalaz.NonEmptyList[String],List[Int]] = -\/(NonEmptyList(oops))
Of course, there’s that strange-looking function body to consider, still.
Uevidence
The type equalities of the original
U.M and
U.A to the original
types can be seen where
res8 is refined to
res9 above. But only
the caller of the function knows those equalities, because it
produced and supplied the
unapplyMAB2 call, which has a structural
type containing those equalities.
The body of
sequenceListU doesn’t know those things. In particular,
it still can’t pick type parameters to pass to
sequenceList
without a little help.
The
leibniz member is a reified type equality of
FA === U.M[U.A],
meaning those are the same at the type level, even though Scala can’t
see it in this context. It represents genuine evidence that those two
types are equal, and is much more powerful than scala-library’s own
=:=. We’re using the core Leibniz operator,
subst, directly to
prove that, as a consequence of that type equality,
List[FA] ===
List[U.M[U.A]] is also a type equality, and that therefore this
[constant-time] coercion is valid. This lifting is applicable in all
contexts, not just covariant ones like
List’s. Take a look at
the full API
for more, though you’ll typically just need to come up with the right
type parameter for
subst.
You can’t ask for an
Unapply and also ask for an
Applicative[U.M]; Scala won’t allow it. So, because we needed to
resolve the typeclass anyway to find the
Unapply implicit to use, we
just cart it along with the
U and give it to the function, which
almost always needs to use it anyway. Because it’s not implicitly
available, you usually need to grab it,
U.TC, and use it directly.
scalaz.syntax
map comes from functor syntax; it’s not a method on
Function1. So
how come this works?
scala> import scalaz.std.function._ import scalaz.std.function._ scala> ((_:Int) + 42) map (_ * 33) res13: Int => Int = <function1> scala> res13(1) res14: Int = 1419
When you import syntax, as
Functor syntax was imported with
scalaz.syntax.applicative._ above, you get at least two conversions:
the plain one, like
ToFunctorOps[F[_],A], which works if you have
the right shape, and the fancy one,
ToFunctorOpsUnapply[FA], which
uses an
Unapply to effectively invoke
ToFunctorOps as in the
above. The latter is lower-priority, so Scala will pick the former if
the value has the
F[A] shape.
That gives access to all the methods in
FunctorOps, and other ops
classes, with only one special
U-taking method. If you have several
functions operating on the same value type, or you can make that type
similar with Leibnizian equality as implicit arguments to your
methods, I suggest grouping them in this way, too, to cut down on
boilerplate.
We sometimes get asked “why not just provide the
Unapply version of
the function or ops?”
We do it, and suggest it for your own code, despite the confusion,
because it’s easier to work with real type equalities than with
Leibnizian equality, which you can do in your “real” function
implementation, and as seen in
res8 above, the path-dependent type
resolution can leave funny artifacts in the inferred result. Here’s
an extreme example from
an earlier demonstration.
scala> val itt = IdentityT lift it itt: IdentityT[scalaz.Unapply[scalaz.Monad,IdentityT[scalaz.Unapply[scalaz.Monad,Identity[Int]] {type M[X] = Identity[X]; type A = Int}#M, Int]] {type M[X] = IdentityT[scalaz.Unapply[scalaz.Monad,Identity[Int]] {type M[X] = Identity[X]; type A = Int}#M, X]; type A = Int}#M, Int] = IdentityT(IdentityT(Identity(42)))
Jason Zaugg implemented Scalaz
Unapply, based on
ideas
from Miles Sabin and
Paul Chiusano.
Leibnizian equality was implemented for Scalaz by Edward Kmett.
Lars Hupel’s talk
(slides,
video)
on the features in the then-upcoming Scalaz 7 at nescala 2013,
including
Unapply, gave me the missing “guided by typeclasses”
detail, inspiring me to tell more people about the whole thing at the
conference, and then, much later, write it down here.
This article was tested with Scala 2.10.2 & Scalaz 7.0.3.
Unless otherwise noted, all content is licensed under a Creative Commons Attribution 3.0 Unported License.Back to blog | https://typelevel.org/blog/2013/09/11/using-scalaz-Unapply.html | CC-MAIN-2019-13 | refinedweb | 1,609 | 58.69 |
Slider is nice to play with the effect. The recent version appears to have changed the drag behavior now, where before it was smooth drag (if the snap was on or off I think) and now it kind of moves on a grid and is a bit choppy.
Hopefully you are saving these in versions. You might want to save your versions as different demos perhaps so people can test the various implementations you have done.
You're still messing around I imagine...looks like high values of the range get some weird behavior where the window binds itself.
I was trying to play with multiple windows as I think the z-index may have an effect here, but I couldn't get far test it with some of the above mentioned problems (not able to turn off snap and reposition windows too easily).
All comments based on viewing with IE7.
Nice work though.MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
Nice work David.
There's a new version available!
Changelog
- v1.1: Added the viewport edges
- v1.2: Rewrote the edge detection algorythm
- v1.3: Increased response time of DropSnap on drag start
- v1.4: Fixed bug where a window would snap to the incorrect area
Last edited by xantus; 15 Dec 2008 at 6:28 PM. Reason: added url
v1.6
v1.6
v1.6 is out! It will snap to the nearest window now, instead of the first window it was close enough to snap to.
Also note that I changed the the namespace in the source to match the advertised namespace.
Ext.ux.SnapWindow.DD -> Ext.ux.WindowSnap.DD
- Join Date
- Mar 2007
- Location
- Notts/Redwood City
- 30,464
- Vote Rating
- 28
Hey xantus, could you make use of these overrides I've been working on to enable my MouseProximityFade plugin to help with your proximity detection algorithm?
Pixel geometry is best delegated to the base lib's "Region" class so it doesn't complicate UI code.
Code:
Ext.override(Ext.lib.Region, { /** * Returns the shortest distance between this Region and another Region. * Either or both Regions may be Points. * @param {Region} r The other Region * @return {Number} The shortest distance in pixels between the two Regions. */ getDistanceBetween: function(r) { // We may need to mutate r, so make a copy. r = Ext.apply({}, r); // Translate r to the left of this if (r.left > this.right) { var rWidth = r.right - r.left; r.left = this.left - (r.left - this.right) - rWidth; r.right = r.left + rWidth; } // Translate r above this if (r.top > this.bottom) { var rHeight = r.bottom - r.top; r.top = this.top - (r.top - this.bottom) - rHeight; r.bottom = r.top + rHeight; } // If r is directly above if (r.right > this.left) { return this.top - r.bottom; } // If r is directly to the left if (r.bottom > this.top) { return this.left - r.right; } // r is on a diagonal path return Math.round(Math.sqrt(Math.pow(this.top - r.bottom, 2) + Math.pow(this.left - r.right, 2))); } }); Ext.override(Ext.Element, { /** * Returns shortest distance between this Element and the specified point * @param {Number} x The x coordinate. * @param {Number} y The y coordinate. * @return {Number} The shortest distance in pixels between this Element and the specified point. */ getDistanceTo: function(x, y) { return this.getRegion().getDistanceBetween(new Ext.lib.Point(x, y)); }, /** * Returns the shortest distance between this Element and another Element. * @param {Element/DOMElement/String} el The other Element, or its ID. * @return {Number} The shortest distance in pixels between the two Elements. */ getDistanceBetween: function(el) { return this.getRegion().getDistanceBetween(Ext.fly(el).getRegion()); } });Search the forum:
Read the docs too:
Scope:
Very nice widget
- Notts/Redwood City
- 30,464
- Vote Rating
- 28
The sample does not appear to work any more. There's no snapping behaviour for me on FF 3.0.6Search the forum:
Read the docs too:
Scope:
Working for me FF3.0.6/FB 1.3X.2/Windows XP/MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow | http://www.sencha.com/forum/showthread.php?55213-Ext.ux.WindowSnap.DD-Window-Edge-Snapping!/page2 | CC-MAIN-2013-48 | refinedweb | 711 | 59.3 |
Dj want a select element? What if you want an autocomplete box?
For me, a solution requires the following:
- maintenance of the separation of concerns, where any Javascript consists of static files loaded separately from the markup
- continued usage of Django’s form binding and validation
- graceful degradation into an HTML Select element
- flexibility to easily add behavior, such as having one autocompletion list clear another
With no offence meant to the people who have build solutions before me, I couldn’t find one that satisfied these. The correct approach, once these requirements have been stated, is obvious. You write the solution entirely in Javascript. What the Javascript will do is progressively enhance the Select elements into autocomplete boxes.
After working on it for a day, I have a production-ready solution. It uses the jquery-ui autocomplete widget, but should be adaptable to others, such as the Twitter Bootstrap typeahead widget Here’s how it works.
- a text box and a hidden input are created, next to the select list so that Django’s validation error messages continue to work
- the text box gets the select element’s id, so that the label continues to work
- the hidden input gets the select element’s name, so that data binding continues to work
- the text box is progressively enhanced into an autocomplete box
- the autocomplete box’s select event is overridden to store the selected item’s value in the hidden input
- the select element is removed
I also store the value and text of the selected element in a closure. On each change event, I check if the autocomplete box’s text is the same as the text that was last selected. If it isn’t, I clear the hidden input. If it is, I set it to the value that was last selected. This is reasonable. The drawback is that it still only works if the user actually selects elements (as opposed to, say, pasting them in).
My demo application uses a Tastypie web services API to provide data to the autompletion list. The data model is as simple as possible:
class School(models.Model): name = models.CharField(max_length=255) class Meta: ordering = ['name'] def __unicode__(self): return unicode(self.name)
The web service provides simplified output:
from tastypie.resources import ModelResource from models import City, School class SimplifiedResource(ModelResource): def alter_list_data_to_serialize(self, request, data): return data['objects'] def dehydrate_id(self, bundle): return int(bundle.data['id']) class Meta: limit = 0 include_resource_uri = False class SchoolsResource(SimplifiedResource): class Meta(SimplifiedtResource.Meta): queryset = School.objects.all() filtering = {'name': 'startswith'}
And here, in CoffeeScript, is the jQuery plugin. It takes the exact same parameters as a jQuery-ui autocomplete box:
jQuery.extend jQuery.fn, modelComplete: (args...) ->" textInput.attr "id", @attr "id" textInput.val text idInput = $ "<input type=\"hidden\">" idInput.val value idInput.attr "name", @attr "name" if args.length is 1 args.push {} if args[1].select? selectFn = args[1].select args[1].select = (event, ui) => handleSelect event, ui selectFn event, ui else args[1].select = handleSelect if args[1].change? changeFn = args[1].change args[1].change = (event, ui) => handleChange event, ui changeFn event, ui args[1].change = handleChange @after textInput textInput.after idInput this.remove() textInput = textInput.autocomplete args... set.add(textInput) set.add(idInput) return set
Using it, and setting its data source to the Tastypie web services API, is the same as if it were a jquery-ui autocompletion widget:
$ -> $("#id_school").modelComplete {"source": (request, response) -> $.getJSON "/api/v1/schools/?name__startswith=#{$.trim request.term}", null, (data) -> response ({"label": x.name, "value": x.id} for x in data)} "select": (event, ui) -> console.log "item #{ui.item.value} selected" | http://duganchen.ca/django-modelchoicefields-as-autocomplete-lists/ | CC-MAIN-2021-17 | refinedweb | 609 | 50.53 |
Re: [Python-Dev] Is msvcr71.dll re-redistributable?
Anders == Anders J Munch [EMAIL PROTECTED] writes: Anders Unless the EULA contains specific language to forbid such Anders multi-stage open-ended redistribution, I'd say you can Anders just re-redistribute away. Anders but-then-I-am-not-a-lawyer-ly y'rs, Anders I am not either,
Re: [Python-Dev] Unicode byte order mark decoding
MAL == M [EMAIL PROTECTED] writes: MAL The BOM (byte order mark) was a non-standard Microsoft MAL invention to detect Unicode text data as such (MS always uses MAL UTF-16-LE for Unicode text files). The Japanese memopado (Notepad) uses UTF-8 signatures; it even adds them to
Re: [Python-Dev] Unicode byte order mark decoding
Martin == Martin v Löwis [EMAIL PROTECTED] writes: Martin Stephen J. Turnbull wrote: However, this option should be part of the initialization of an IO stream which produces Unicodes, _not_ an operation on arbitrary internal strings (whether raw or Unicode). Martin
Re: [Python-Dev] Unicode byte order mark decoding
Walter == Walter Dörwald [EMAIL PROTECTED] writes: Walter Not really. In every encoding where a sequence of more Walter than one byte maps to one Unicode character, you will Walter always need some kind of buffering. If we remove the Walter handling of initial BOMs from the
Re: [Python-Dev] defmacro
Andrew == Andrew Koenig [EMAIL PROTECTED] writes: Andrew Wel Shouldn't you have written Andrew (mapcar car list-of-lists) Andrew or am I missing something painfully obvious? Greg should have written (with-file foo/blarg 'do-something-with) too. I guess I should
Re: [Python-Dev] Re: switch statement
Guido == Guido van Rossum [EMAIL PROTECTED] writes: Guido You mean like this? if x 0: ...normal case... elif y 0: abnormal case... else: ...edge case... The salient example! If it's no accident that those conditions are mutually exclusive and
Re: [Python-Dev] Thoughts on stdlib evolvement
Skip == Skip Montanaro [EMAIL PROTECTED] writes: Skip If you provide the necessary namespace structure for them to Skip nestle into, I suspect most of them could be maintained Skip outside the stdlib just fine. FWIW, this has worked well for XEmacs; it's one of our most popular
Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion
BAW == Barry Warsaw [EMAIL PROTECTED]
Re: [Python-Dev] Pre-PEP: Exception Reorganization for Python 3.0
Willem == Willem Broekema [EMAIL PROTECTED],
Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion
Donovan == Donovan Baarda [EMAIL PROTECTED]
Re: [Python-Dev] Pre-PEP: Exception Reorganization for Python 3.0
Phillip == Phillip J Eby [EMAIL PROTECTED] writes: Phillip You just said, Unhandled, KeyboardInterrupt means... Phillip If the program doesn't *want* to handle Phillip KeyboardInterrupt, then it obviously *isn't* critical, Phillip because it doesn't care. Conversely, if it
Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion
aahz == aahz [EMAIL PROTECTED] writes: aahz I'd rather not rely on licensing of a closed-source system; aahz one of the points made during the talk was that the Linux aahz project had to scramble when they lost their Bitkeeper aahz license Python is unlikely to throw away its
Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion
M == M.-A. Lemburg [EMAIL PROTECTED] writes: M Other non-commercial alternatives are Berlios and Savannah, but M I'm not sure whether they'd offer Subversion support. Savannah doesn't offer great reliability or support, at least to judge by the frequency with which the GNU Emacs and GNU
Re: [Python-Dev] Generalised String Coercion
Martin == Martin v Löwis [EMAIL PROTECTED]
Re: [Python-Dev] PEP: Migrating the Python CVS to Subversion
Donovan == Donovan Baarda [EMAIL PROTECTED] writes: Donovan It all comes down to how painless branch/merge is. Many Donovan esoteric features of version control systems feel like Donovan they are there to workaround the absence of proper Donovan branch/merge histories. It's not
Re: [Python-Dev] Generalised String Coercion
Martin == Martin v Löwis [EMAIL PROTECTED] writes: Martin While this would work, it would still feel wrong: the Martin binary data are *not* latin1 (most likely), so declaring Martin them to be latin1 would be confusing. Perhaps a synonym Martin '8bit' for latin1 could be
Re: [Python-Dev] Collecting SSH keys
Martin == Martin v Löwis [EMAIL PROTECTED] writes: Martin I don't know how this scales in OpenSSH having an Martin authorized_keys file with hundred or more keys. On cvs.xemacs.org (aka SunSITE.dk) ssh+cvs access with cvs access control being handled by a Perl script scales to
Re: [Python-Dev] [Python-checkins] python/dist/src setup.py, 1.219, 1.220
Martin == Martin v Löwis [EMAIL PROTECTED] writes: Martin Raymond Hettinger wrote: Do you have an ANSI-strict option with your compiler? Martin gcc does have an option to force c89 compliance, but there Martin is a good chance that Python stops compiling with option:
Re: [Python-Dev] partition()
Raymond == Raymond Hettinger [EMAIL PROTECTED] writes: Raymond FWIW, I am VERY happy with the name partition(). Raymond ... [I]t is exactly the right word. I won't part with it Raymond easily. +1 I note that Emacs has a split-string function which does not have those happy
Re: [Python-Dev] Proof of the pudding: str.partition()
Greg == Greg Ewing [EMAIL PROTECTED] writes: Greg Er, pardon? I don't think I've ever heard 'piece' used as a Greg verb in English. Can you supply an example sentence? I'll let the reader piece it together. More closely related, I've heard/seen piece out used for task allocation (from
Re: [Python-Dev] Revising RE docs
Greg == Greg Ewing [EMAIL PROTECTED] writes: Greg Stephen J. Turnbull wrote: But you could have string objects (or a derivative) grow a compiled_regexp attribute internally. Greg That would make the core dependent on the re module, which I Greg think would be a bad idea
Re: [Python-Dev] String views
Steve == Steve Holden [EMAIL PROTECTED] writes: Steve Since Python strings *can* contain embedded NULs, doesn't Steve that rather poo on the idea of passing pointers to their Steve data to C functions as things stand? I think it's a consenting adults issue. Ie, C programmers always
Re: [Python-Dev] Replacement for print in Python 3.0
Guido == Guido van Rossum [EMAIL PROTECTED] writes: Guido I'm not at all convinced that we should attempt to find a Guido solution that handles both use cases [print replacement Guido and i18n]; most Python code never needs i18n. It's true that the majority of Python applications
Re: [Python-Dev] Replacement for print in Python 3.0
Guido == Guido van Rossum [EMAIL PROTECTED] writes: Guido Sure, we must provide good i18n support. But the burden on Guido users who don't need i18n should be negligeable; they Guido shouldn't have to type or know extra stuff that only exists Guido for the needs of i18n. Agreed.
Re: [Python-Dev] Replacement for print in Python 3.0
Guido == Guido van Rossum [EMAIL PROTECTED] writes: Guido I certainly didn't mean to rule that out. Speaking for myself, that's all I really wanted to hear at this time. As Bob Ippolito said, currently it's straightforward to internationalize an application, and well worth the minimal
Re: [Python-Dev] Replacement for print in Python 3.0
Greg == Greg Ewing [EMAIL PROTECTED] writes: Greg Stephen J. Turnbull wrote: IMO strings that are being printf'd can probably be assumed to be human readable, and therefore candidates for translation. This Greg That's a dangerous assumption to make, I think. Could
Re: [Python-Dev] unifying str and unicode
M == M.-A. Lemburg [EMAIL PROTECTED] writes: M From what I've read on the web about the Python Unicode M implementation we have one of the better ones compared to other M languages implementations and their choices and design M decisions. Yes, indeed!
Re: [Python-Dev] Event loops, PyOS_InputHook, and Tkinter
Michiel == Michiel Jan Laurens de Hoon [EMAIL PROTECTED] writes: Michiel What is the advantage of Tk in comparison to other GUI Michiel toolkits? IMO, Tk's _advantage_ is that it's there already. As a standard component, it works well for typical simple GUI applications (thus
Re: [Python-Dev] LaTeX and Python doc contributions
Fred == Fred L Drake, [EMAIL PROTECTED] writes: Fred On Thursday 22 December 2005 13:23, [EMAIL PROTECTED] wrote: Who is asking this of potential contributors? I know you, Aahz and I have repeatedly told people on c.l.py that LaTeX knowledge is not necessary. Plain text is
Re: [Python-Dev] a quit that actually quits
Martin == Martin v Löwis [EMAIL PROTECTED] writes: Martin That would assume that the user knows that exit is a Martin function: apparently, people expect it to be a statement Martin (like print), Oh, the irony of that analogy!wink Martin or they are entirely unaware of the
Re: [Python-Dev] a quit that actually quits
Nick == Nick Coghlan [EMAIL PROTECTED] writes: Nick Samuele Pedroni wrote: It's not a matter of defending the status quo, more about what kind of price is reasonable for DWIM. IMHO, +N*10^6 for simplicity, regularity, and discoverability, -1 for DWIM in the interpreter. DWIM is
Re: [Python-Dev] buildbot
skip == skip [EMAIL PROTECTED] writes: Bob The easy fix is to upgrade your OS. I don't think anyone is going Bob to bother with the preprocessor hackery necessary to make that Bob (harmless) warning go away on older versions of the OS. skip Excuse me, but this really pisses me
Re: [Python-Dev] buildbot
Martin == Martin v Löwis [EMAIL PROTECTED] writes: Martin It *is* a bug for Python to emit warnings on major Martin platforms (PEP 7). OK, I'm as big a standards bigot as the next guy, you hooked me. After some consideration, I can't write the patch, though. I'm sorry that all I can
Re: [Python-Dev] Checking in a broken test was: Re: [Python-checkins]r41940 - python/trunk/Lib/test/test_compiler.py
Fredrik == Fredrik Lundh [EMAIL PROTECTED] writes: Fredrik many test frameworks support expected failures for this Fredrik purpose. how hard would it be to add a Fredrik unittest.FailingTestCase Fredrik class that runs a TestCase, catches any errors in it, and Fredrik
Re: [Python-Dev] Building on OS X 10.4 fails
Anthony == Anthony Baxter [EMAIL PROTECTED] writes: Anthony It sounds like configure needs to grow a test to detect Anthony that a libreadline it finds is actually the crackful Anthony libedit and refuse to use it if so. FYI: Real libreadline is GPL, and rms made a point of forcing
Re: [Python-Dev] Building on OS X 10.4 fails
Anthony == Anthony Baxter [EMAIL PROTECTED] writes: Anthony Python's license is GPL-compatible, so this isn't an Anthony issue. I'm sorry, but you seem to misunderstand what GPL compatibility means. It is a _one-way_ street. A license is GPL-compatible if its terms permit the code it
Re: [Python-Dev] str with base
BAW == Barry Warsaw [EMAIL PROTECTED] writes: BAW Unix weenies shouldn't be totally forgotten in P3K. Great idea! Put all this stuff in a weenie module. You can have weenie.unix and weenie.vms and weenie.unicode, besides the weenie.math that got all this started. -- School of Systems
Re: [Python-Dev] / as path join operator
Steven == Steven Bethard [EMAIL PROTECTED] writes: Steven My only fear with the / operator is that we'll end up with Steven the same problems we have for using % in string formatting Steven -- the order of operations might not be what users expect. Besides STeVe's example, (1) I
Re: [Python-Dev] DRAFT: python-dev Summary for 2006-01-01 through 2006-01-15
Thomas == Thomas Heller [EMAIL PROTECTED] writes: Thomas I cannot uinderstand your reasoning. How can 'info Thomas autoconf' incluence the license of the aclocal.m4 file? It doesn't. The point is the documentation explains that all of the other files are _part of autoconf_, and come
Re: [Python-Dev] / as path join operator
Jason == Jason Orendorff [EMAIL PROTECTED] writes: Jason I. Here's an example of the sort of thing you might say if Jason you did *not* think of paths as strings: [...] Jason II. And here is the sort of thing you'd say if you thought Jason of paths *solely* as strings: Please
Re: [Python-Dev] DRAFT: python-dev Summary for 2006-01-01 through 2006-01-15
Martin == Martin v Löwis [EMAIL PROTECTED] writes: BTW. The argument that the readline module should be GPL licensed seems rather stronger, it's designed to work with a GPL-ed library and doesn't work with a BSD licensed work-alike of that library. Martin This is the
Re: [Python-Dev] DRAFT: python-dev Summary for 2006-01-01 through 2006-01-15
Martin == Martin v Löwis [EMAIL PROTECTED] writes: Martin So would you just like to see the readline module to be Martin removed from the Python distribution? No. I would much prefer that the readline module be made compatible with libedit (or whatever the pseudo-readline library is
Re: [Python-Dev] DRAFT: python-dev Summary for 2006-01-01 through 2006-01-15
Tim == Tim Peters [EMAIL PROTECTED] writes: Tim [Martin v. Löwis] Also, I firmly believe that the FSF would *not* sue the PSF, but instead first ask that the status is corrected. They would ask first. That's what they did in the case of Aladdin Ghostscript's use of readline.
Re: [Python-Dev] DRAFT: python-dev Summary for 2006-01-01 through 2006-01-15
Tim == Tim Peters [EMAIL PROTECTED] writes: Tim I'm not making myself clear. Whatever makes you think that?wink In fact, everything you've said about your criteria for behavior was quite clear from the first, and it was fairly easy to infer your beliefs about the implications of history. I
Re: [Python-Dev] / as path join operator
Jason == Jason Orendorff [EMAIL PROTECTED] writes: Jason You seem to think that because I said operating systems, Jason I'm talking about kernel algorithms and such. I can see how you'd get that impression, but it's not true. My reason for mentioning OS-level filesystem was to show
Re: [Python-Dev] Help with Unicode arrays in NumPy
Travis == Travis E Oliphant [EMAIL PROTECTED] writes: Travis Numpy supports arrays of arbitrary fixed-length records. Travis It is much more than numeric-only data now. One of the Travis fields that a record can contain is a string. If strings Travis are supported, it makes
Re: [Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notation
Brett == Brett Cannon [EMAIL PROTECTED] writes: Brett On 2/9/06, Barry Warsaw [EMAIL PROTECTED] wrote: Maybe we can amend your rules to those people who both have commit privileges and have successfully submitted a PEP before. PEP virgins should go through the normal process.
Re: [Python-Dev] PEP 332 revival in coordination with pep 349? [ Was:Re: release plan for 2.5 ?]
M == M.-A. Lemburg [EMAIL PROTECTED] writes: M James Y Knight wrote: Nice and simple. M Albeit, too simple. M The above approach would basically remove the possibility to M easily create bytes() from literals in Py3k, since literals in M Py3k create Unicode objects,
Re: [Python-Dev] bytes type discussion
Fred == Fred L Drake, [EMAIL PROTECTED] writes: Fred On Tuesday 14 February 2006 22:34, Greg Ewing wrote: Seems to me this is a case where you want to be able to change encodings in the middle of reading the stream. You start off reading the data as ascii, and once you've
Re: [Python-Dev] bytes type discussion
Guido == Guido van Rossum [EMAIL PROTECTED] writes: Guido I think that the implementation of encoding-guessing or Guido auto-encoding-upgrade techniques should be left out of the Guido standard library design for now. As far as I can see, little new design is needed. There's no
Re: [Python-Dev] bdist_* to stdlib?
Bob == Bob Ippolito [EMAIL PROTECTED] writes: Bob Huh? What does that have to do with anything? I've never Bob seen a system where /usr/include, /usr/lib, /usr/bin, Bob etc. are not all on the same mount. It's not really any Bob different with OS X either. /usr/share often is
Re: [Python-Dev] bytes.from_hex()
Guido == Guido van Rossum [EMAIL PROTECTED] writes: Guido I'd say there are two symmetric API flavors possible (t Guido and b are text and bytes objects, respectively, where text Guido is a string type, either str or unicode; enc is an encoding Guido name): Guido -
Re: [Python-Dev] bytes.from_hex()
Ian == Ian Bicking [EMAIL PROTECTED] writes: Ian Encodings cover up eclectic interfaces, where those Ian interfaces fit a basic pattern -- data in, data out. Isn't filter the word you're looking for? I think you've just made a very strong case that this is a slippery slope that we
Re: [Python-Dev] bytes.from_hex()
M == M.-A. Lemburg [EMAIL PROTECTED] writes: M Martin v. Löwis wrote: No. The reason to ban string.decode and bytes.encode is that it confuses users. M Instead of starting to ban everything that can potentially M confuse a few users, we should educate those users and tell
Re: [Python-Dev] bytes.from_hex()
M == M.-A. Lemburg [EMAIL PROTECTED] writes: M The main reason is symmetry and the fact that strings and M Unicode should be as similar as possible in order to simplify M the task of moving from one to the other. Those are perfectly compatible with Martin's suggestion. M Still,
Re: [Python-Dev] bdist_* to stdlib?
Guido == Guido van Rossum [EMAIL PROTECTED] writes: Guido On 2/16/06, Stephen J. Turnbull [EMAIL PROTECTED] wrote: /usr/share often is on a different mount; that's the whole rationale for /usr/share. Guido I don't think I've worked at a place where something like Guido
Re: [Python-Dev] bytes.from_hex()
Josiah == Josiah Carlson [EMAIL PROTECTED] writes: Josiah The question remains: is str.decode() returning a string Josiah or unicode depending on the argument passed, when the Josiah argument quite literally names the codec involved, Josiah difficult to understand? I don't
Re: [Python-Dev] bytes.from_hex()
Bob == Bob Ippolito [EMAIL PROTECTED] writes: Bob On Feb 17, 2006, at 8:33 PM, Josiah Carlson wrote: But you aren't always getting *unicode* text from the decoding of bytes, and you may be encoding bytes *to* bytes: Please note that I presumed that you can indeed assume that
Re: [Python-Dev] bytes.from_hex()
Bengt == Bengt Richter [EMAIL PROTECTED] writes: Bengt The characters in b could be encoded in plain ascii, or Bengt utf16le, you have to know. Which base64 are you thinking about? Both RFC 3548 and RFC 2045 (MIME) specify subsets of US-ASCII explicitly. -- School of Systems and
Re: [Python-Dev] bytes.from_hex()
Martin == Martin v Löwis [EMAIL PROTECTED] writes: Martin Stephen J. Turnbull wrote: Bengt The characters in b could be encoded in plain ascii, or Bengt utf16le, you have to know. Which base64 are you thinking about? Both RFC 3548 and RFC 2045 (MIME) specify subsets
Re: [Python-Dev] bytes.from_hex()
Josiah == Josiah Carlson [EMAIL PROTECTED] writes: Josiah I try to internalize it by not thinking of strings as Josiah encoded data, but as binary data, and unicode as text. I Josiah then remind myself that unicode isn't native on-disk or Josiah cross-network (which stores and
Re: [Python-Dev] bytes.from_hex()
Martin == Martin v Löwis [EMAIL PROTECTED] writes: Martin Please do take a look. It is the only way: If you were to Martin embed base64 *bytes* into character data content of an XML Martin element, the resulting XML file might not be well-formed Martin anymore (if the encoding of
Re: [Python-Dev] bytes.from_hex()
Greg == Greg Ewing [EMAIL PROTECTED] writes: Greg Stephen J. Turnbull wrote: What I advocate for Python is to require that the standard base64 codec be defined only on bytes, and always produce bytes. Greg I don't understand that. It seems quite clear to me that Greg
Re: [Python-Dev] bytes.from_hex()
Greg == Greg Ewing [EMAIL PROTECTED] writes: Greg Stephen J. Turnbull wrote: Base64 is a (family of) wire protocol(s). It's not clear to me that it makes sense to say that the alphabets used by baseNN encodings are composed of characters, Greg Take a look
Re: [Python-Dev] bytes.from_hex()
Ron == Ron Adam [EMAIL PROTECTED] writes: Ron Terry Reedy wrote: I prefer the shorter names and using recode, for instance, for bytes to bytes. Ron While I prefer constructors with an explicit encode argument, Ron and use a recode() method for 'like to like' coding.
Re: [Python-Dev] bytes.from_hex()
Ron == Ron Adam [EMAIL PROTECTED] writes: Ron We could call it transform or translate if needed. You're still losing the directionality, which is my primary objection to recode. The absence of directionality is precisely why recode is used in that sense for i18n work. There really isn't a
Re: [Python-Dev] bytes.from_hex()
Greg == Greg Ewing [EMAIL PROTECTED] writes: Greg Stephen J. Turnbull wrote: No, base64 isn't a wire protocol. It's a family[...]. Greg Yes, and it's up to the programmer to choose those code Greg units (i.e. pick an encoding for the characters) that will, Greg in fact
Re: [Python-Dev] bytes.from_hex()
Ron == Ron Adam [EMAIL PROTECTED] writes: Ron So, lets consider a codec and a coding as being two Ron different things where a codec is a character sub set of Ron unicode characters expressed in a native format. And a Ron coding is *not* a subset of the unicode character set,
Re: [Python-Dev] bytes.from_hex()
Greg == Greg Ewing [EMAIL PROTECTED] writes: Greg (BTW, doesn't the fact that you *can* load an XML file into Greg what we call a text editor say something?) Why not answer that question for yourself, and then turn that answer into a description of text semantics? For me, it says that,
Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)
martin == martin [EMAIL PROTECTED] writes: martin I don't understand. How can you use a C++ compiler, but martin not the C++ language? An abbreviation for those features that aren't in C. martin As the recent const dilemma shows, C99 and C++98 have, martin unfortunately,
Re: [Python-Dev] C++ for CPython 3? (Re: str.count is slow)
Anthony == Anthony Baxter [EMAIL PROTECTED] writes: Anthony It's probably worth mentioning that right now, we don't Anthony even come close to compiling with a C++ compiler. A bunch Anthony of the bugs are shallow (casting result from malloc, that Anthony sort of thing) but a
Re: [Python-Dev] Results of the SOC projects
Brett Cannon writes: There was never a formal one to my knowledge. Part of the problem is that the PSF acted as a blanket organization this year so we just basically helped dole out slots to various Python projects. This meant it was not under very centralized control and thus not easy
Re: [Python-Dev] Py_ssize_t
Raymond Hettinger writes: Two people had some difficulty building non-upgraded third-party modules with Py2.5 on 64-bit machines (I think wxPython was one of the problems) In my experience wxPython is problematic, period. It's extremely tightly bound to internal details of everything around
Re: [Python-Dev] bool conversion wart?
Neal Becker writes: Well consider this: str (4) '4' int(str (4)) 4 str (False) 'False' bool(str(False)) True Doesn't this seem a bit inconsisent? The former case is a *conversion* from an expression that *does not* have an interpretation in a numerical context to an
Re: [Python-Dev] Encouraging developers
Giovanni Bajo writes: On 05/03/2007 20.30, Phil Thompson wrote: 1. Don't suggest to people that, in order to get their patch reviewed, they should review other patches. The level of knowledge required to put together a patch is much less than that required to know if a patch is the
Re: [Python-Dev] Encouraging developers
Giovanni Bajo writes: On 05/03/2007 19.46, A.M. Kuchling wrote: At PyCon, there was general agreement that exposing a read-only Bazaar/Mercurial/git/whatever version of the repository wouldn't be too much effort, and might make things easier for external people developing
Re: [Python-Dev] Encouraging developers
Phil Thompson writes: MvL wrote: I doubt this will help. Much of the code isn't owned by anybody specifically. Those parts that are owned typically find their patches reviewed and committed quickly (e.g. the tar file module, maintained by Lars Gustäbel). Doesn't your last
Re: [Python-Dev] Encouraging developers
Mart
Re: [Python-Dev] Encouraging developers
George Brandl writes: As far as I recall, there has been nearly no one who asked for commit rights recently, so why complain that the entry barrier is too great? Surely you cannot expect python-dev to got out and say would you like to have commit privileges?... Why not? It depends on
Re: [Python-Dev] Encouraging developers
J
Re: [Python-Dev] Proposal to revert r54204 (splitext change)
Paul Moore writes: On 16/03/07, Phillip J. Eby [EMAIL PROTECTED] wrote: What's *actually* under dispute here is whether it's acceptable to classify this perfectly useful-as-is behavior, that was documented and tested in released versions of Python for several years (with patches to
Re: [Python-Dev] Proposal to revert r54204 (splitext change)
Martin v. Löwis writes: Phillip J. Eby schrieb: Some other options: 1. Deprecate splitext() and remove it in 3.0 How would that help the problem? Isn't it useful to have a function that strips off the extension? No. It's useful to have a function that performs a
Re: [Python-Dev] A Survey on Defect Management Practices in Free/Open Source Software
Anthony Baxter writes: Just a random aside - is anyone else getting increasingly annoyed by these mass-mailed out survey requests from students? Annoyed, not particularly. Scared, yes: it's long been known that a field=FIELD is moribund when people start getting PhDs in FIELD for
Re: [Python-Dev] Summaries and the New Lists
Brett Cannon writes: All in one is fine. Just be *very* wary of getting burned out. I especially would watch out for python-ideas as any random idea can end up there and just go on and on with no resolution. As basically a lurker, I second that -- these summaries (and the weekly tracker
Re: [Python-Dev] [Python-3000] PEP 30XZ: Simplified Parsing
Barry Warsaw writes: The problem is that _(some string and more of it) is not the same as _(some string + and more of it) Are you worried about translators? The gettext functions themselves will just see the result of the operation. The extraction
Re: [Python-Dev] [Python-3000] PEP 30XZ: Simplified Parsing
Bar
Re: [Python-Dev] [Python-3000] PEP 30XZ: Simplified Parsing
Michael Sparks writes: We generate our component documentation based on going through the AST generated by compiler.ast, finding doc strings (and other strings in other known/expected locations), and then formatting using docutils. Are you talking about I18N and gettext? If so, I'm really
Re: [Python-Dev] Official version support statement
Martin v. Löwis writes: However, I would prefer to not use the verb support at all. We (the PSF) don't provide any technical support for *any* version ever released: '''PSF is making Python available to Licensee on an AS IS basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES [...].''' Of
Re: [Python-Dev] Official version support statement
Terry Reedy writes: This strikes me as an improvement, but 'maintain' is close to 'support' and seems to make a promise that might also have unintended legal consequences. But that is what your legal consel is for. Unilateral statements on a web page do not constitute a contract. Implied
Re: [Python-Dev] Official version support statement
Martin v. Löwis writes: I'm all in favor of formalizing a policy of when Python releases are produced, and what Python releases, and what kinds of changes they may contain. However, such a policy should be addressed primarily to contributors, as a guidance, not to users, as a promise.
[Python-Dev] Draft PEP: Maintenance of Python Releases
Mart
Re: [Python-Dev] Official version support statement
Terry Reedy writes: Stephen J. Turnbull [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | The impression that many people (including python-dev regulars) have | that there is a policy of support for both the current release | (2.5) and the (still very widely used) previous
Re: [Python-Dev] Draft PEP: Maintenance of Python Releases
Martin v. Löwis writes: The objective is to reduce load for the release manager. Any kind of release that is worth anything takes several hours to produce, in my experience (if it could be made completely automatic, it wouldn't be good, since glitches would not be detected). I absolutely
Re: [Python-Dev] Draft PEP: Maintenance of Python Releases
Martin v. Löwis writes: In general, I recognize the burden on the release engineer, and obviously any burdensome policy needs his OK. But I think the policy should be *effective* too, and I just don't see that a policy that allows such long lags is a more effective security response
Re: [Python-Dev] Summary of Tracker Issues
[EMAIL PROTECTED] writes: The orb that shines in the sky during the day. Martin This question I could not answer, because I don't know what an Martin orb is (it's not an object request broker, right?) Martin Is the answer sun? It is indeed. I would use
Re: [Python-Dev] Summary of Tracker Issues
Georg Brandl writes: By requesting a registration form over and over, and recording all questions. A human would then answer them, which is easily done for 50 questions (provided that they are *not* targeted at experienced Python programmers, which shouldn't be done). We are not going to
Re: [Python-Dev] Summary of Tracker Issues
Aaron Brady writes: ISTM you need one only question requiring human attention at a time, because once a spammer assigns a human (or inhuman of equivalent intelligence) to cracking you, you're toast. I can't believe this is still profitable. It's either lucrative or fulfilling,
Re: [Python-Dev] Summary of Tracker Issues
O
Re: [Python-Dev] Summary of Tracker Issues
Terry Reedy writes: Why not simply embargo any post with an off-site link? Tho there might have been some, I can't remember a single example of such at SF. Fine by me; if it doesn't happen often, then embargoing them would be fine. My occasional experience with distro reporting processes
Re: [Python-Dev] The docs, reloaded
Neal Becker writes: Perhaps my comment was misunderstood. I have no objection to a new system, and it does not have to be based on latex. I just hope there will be some escape mechanism that allows math. Docutils already provides the raw directive. I don't know if the latex backend | https://www.mail-archive.com/search?l=python-dev@python.org&q=from:%22Stephen+J.+Turnbull%22 | CC-MAIN-2022-21 | refinedweb | 5,197 | 60.24 |
20 Must-have Firefox Extensions 341
An anonymous reader noted that Computerworld is running a story on the 20 must have Firefox extensions. Several of my favorites are in there so I'm looking forward to playing with the ones I haven't heard of.
No skis take rocks like rental skis!
Adblock? (Score:5, Interesting)
)
Re:Adblock? (Score:4, Interesting):5, Insightful)
Re:Adblock? (Score:4, Insightful)
Re: (Score:3, Informative)
Why not?
If you say "it's not worth it" - how long do you spend reading or posting on slashdot?
Slashdot does actually have a quite good system to pay to remove ads, with good options. And it's cheap. Some other sites assume that there are only "freeloaders" and "premium professionals" and therefore offer only overpriced subscriptions (like IMDB) that are not worthwhile to casual users, but slashdot is not one of those sites.: (Score:2, Interesting)
127.0.0.1 ad.site.com
in my hosts file.
Re: (Score:2)
Re:Adblock? (Score:4, Insightful)
Re: (Score:3, Insightful)
Not being responsible for the success of business model means it's okay to try to circumvent their attempts to charge you for their product? If I shoplift, is that okay because I'm not responsible for the success of their bizarre 'put products where I can get to them but charge me money to use or take them' b
Re: (Score:3, Insightful)
Ads do not make the internet run. The internet was running just fine before banner ads.
We may not have the same amount of free sites that we do, but quantity is not something the internet is short on. Anyone intelligent enough to have something worthwhile to say would be intelligent enough to find a way to do it without ad revenue.
The signal to noise ration is very low on the internet, thanks largely in part to the number of freely available resources. Every jack-ass with some drivel that popped into h
Re: (Score:3, Insightful)
It is just you. In capitalism everybody is supposed to act egotistically. You are not supposed to feel the pain of other players, you are supposed to harm them with everything you've got. They will try to extract as much money/attention out of you as they can, and you will try to give them as little money/attention as you can get away with.
F
Re: (Score:2, Informative)
That's the obvious question. Do people just volunteer and donate all their time and money? Have you ever done that to help something else?
And add in flashblock while you're at it. (Score:5, Informative): (Score:3, Interesting)
Re: (Score:3, Informative)
I don't want to see zero ads anyway. I just don't want them to take over my browser.
Re: (Score:2)
Re:Adblock? (Score:5, Informative)
What I want... (Score:2)
Re: (Score:2)
Re: (Score: (Score:2, Troll)
Maybe that works for surfing pr0n in your mother's basement, but those of us living in the real world have to use IE for things like online learning, internal corporate websites, paying bills, etc. I'd love to be so self-righteous that I never use IE-only websites, but I'd kind of like to finish my degree, keep my job, and keep the lights on, thank you very much.
Re: (Score:2)
I dump my bank if it doesn't support Firefox.
Honestly, it's become stupid to write IE only sites, as you're now alienating 20% of the population...
if a site requires IE it's just ignorant project managers that made it so.
Besides, forge your headers - the site will probably work anyway in Firefox.
Re: (Score:3, Informative)
Re: (Score:3, Informative)
Re: (Score:2, Insightful)
Re: 20 Must-have Firefox Extensions (Score:5, Funny)
or, How I Learned To Stop Worrying and Love the Bloat.
20 is too many (Score:5, Insightful)
Re: (Score:2)
Agreed. After trying a fair number of extensions, the ones I've found most useful for casual surfing are AdBlock Plus, All-in-One Gestures, Download Statusbar, and User Agent Switcher. Throw ForecaseFox in there if you live somewhere where the weather changes often.
Re: (Score:2, Interesting)
Before I'm modded as a troll I'm not saying "Opera rulez, FF sucks", there are features that are superior to Firefox too, like t
Re:20 is too many (Score:4, Insightful)
Re: (Score:3, Interesting)
I agree, but I think that if you ask a hundred users what their "key" features would be, you'd probably get 101 different answers.
Yes, for example, could we get tabs out of the core? I don't like them and it is currently impossible to turn them completely off (for example, install an add-on and restart firefox; home page, current page, and add-on page come up in tabs). I'd also currently like to remove the password manager functionality, as the current version is insecure (it can be fooled into sending passwords to other web sites than the one for which the password was saved).
Rather than putting things in the core, what about two
Re: (Score:2)
Then don't use them?? Seriously, why not hit ctrl-n instead of ctrl-t?
Maybe taking it out won't make the code base any more efficient - it's like comparing sdi vs mdi.
You're probably the only user on the plant who hates tabs, as it's a fewture native now to IE, Opera and FF. As well as epiphany, Konqueror and Safari.
You're an island amongst yourself. If there was a desire for a
Re: (Score:2)
I've found that it depends on what extensions you use. Some extensions are poorly written. I have 29 extensions installed in my daily Firefox profile and have no problems with speed or stability. I created separate Firefox profiles for other purposes and installed different extensions in those profiles:.
Re: (Score:2)
Aren't articles like this bad for Firefox? (Score:2, Insightful)
Re: (Score:3, Interesting)
What about IE? They weren't even going to include tabs in IE7 originally. The evolution of IE has been mostly in its core rendering and ActiveX, and not the interface or functionality of the application. Internet Explorer has basically always been just a bare shell for MS's HTML handling engine. It's the bare minimum!
Re: (Score:2)
Re: (Score:2)
I don't run many add-ons either because of speed and stability problems that arise with too many add-ons. Adblocking too many things also seems to slow down Firefox too. Flashblock helps too because ads are too CPU hungry, if I have a motion flash ad in a window going, it will generally always take 5% of my CPU, not something I want when trying to
Re: (Score:2)
Especially if people are being told that "must have" extensions for Firefox include rainbow colored tabs, "more neat than actually useful" (quoting TFA) popup page previews, and weather forecast gadgets.
Another 4-5 of those "must haves" are strictly for developers (ex. FireBug/WebDev toolbar - I have those, my grandma doesn't need them).
Are you surprised? Shiny title on a worthless article? Wh
Re: (Score:3, Funny)
Re: (Score:2)
I'm talking about mine: she's a nuclear fusion rocket scientist.
Re: (Score:2)
You really need only mouse gestures, addblock, web developer, html validator, downthemall, flashblock, linkification and phpbb user hide, if you are reading phpbb forums. That's only 8.
For those without Adblock (Score:5, Informative)
Re:For those without Adblock (Score:5, Informative)
Oh, for shame! Such an easy chance to plug something on-topic, yet another FF extension...
Resurrect Pages [mozilla.org] lets you check all the major internet cache sites for dead content.
Re: (Score:2, Informative)
Might have been just me . . . (Score:5, Insightful)
Re: (Score:2)
i don't see why anyone else would need those extensions, though.
Re: (Score:2)
sensationalism (Score:5, Informative)
if this list were anywhere near accurate it should have included these extensions:
Most of the authors of these extensions are not yet members of the Pornzilla project.
Re:sensationalism (Score:5, Insightful)
Wow (Score:5, Funny)
Re: (Score:3, Informative)
Re:sensationalism (Score:5, Funny)
You are a first person shooter?
20 must have? (Score:2)
So far, my 'must-have' extension list:
Re: (Score:2)
Google browser sync (Score:2)
Re: (Score:2)
I have several computers with Firefox installed, not suffered issues with bookmark syncing (I barely add more bookmarks -- could be a reason). I'm particularly pleased with how well it syncs passwords and cookies.
It slows down the startup of the browser here. But that's mainly because it's asking for the password to access my encrypted password store. Other than that.
Re: (Score:2)
Well, I have several thousand bookmarks and I change them frequently. I've ended up with duplications, deletions, and other problems.
I don't synchronize passwords or cookies; that's really a privacy issue to me.
Maybe you should raise your concerns with Google? Provide them feedback.
I have, but the
Re: (Score:2)
Re: (Score:2)
And what's less intrusive about it making all your bookmarks searchable for everyone?
Flergh! (Score:2)
Addons memory usage (Score:5, Interesting)
Re: (Score:3, Informative)
Firefox extensions are generally simple JavaScript and XML files that are effectively appended directly to the core JavaScript and XML files that make up the browser. (Obviously I'm oversimplifying a bit here.)
In any case, because extensions just add on to the general browser in the same namespace, there's no way to separate what memory is used by one extension and what memory is used by another or what memory is being used by the core browser itself. They're all in the same namespace. This can cause c
Tabbrowser Extension? (Score:2)
Re: (Score:2)
Re: (Score:2)
Google for this, I've seen a few methods and I think one extension that does this.
Grouped tabs - with the tabs down the side, it would use indentation to maintain tab groups. Pop-up windows would thus be associated with the window they came from, rather than appear somewhere unrelated on the tab
Re: (Score:2)
2. Probably, hell it may cause problems all on it's own. I mean let me quote it's webpage "This extension strongly unrecommended. Tab Mix is recommended instead of this, because it is stable, light, and it covers most useful features of this."
APT-get Extensions? (Score:3, Interesting).
Re: (Score:2)
The point of APT is that it's all collected, centralized and manageable. Including dependencies, the nightmare for upgrades (and downgrades).
Now, if there is an APT tool that can import a directory or files into the DB, registering any files, then that's great. For example, Perl has it's -MCPAN installer, but it's much better to use the APT wrapper. Maybe the way to do it is just to wrap the extensions into
The 2 I use the most (Score:2).
Colorful Tabs? (Score:2)
The ones I use that I consider "must have": Adblock (of course) and the filterset.g updater, forecastfox and target alert. And I'm not even sure about Forecast Fox. It just saves me having to open a weather webpage. I also like StopAutoPlay, Download Embedded, and the Download Manager Tweak so I can make it load in a tab.
how about just being able to install the plugins. (Score:2)
This is probably some security feature.. but actually having installable mac versions might persuade me to dump safari as my primary browser for firefox.
URLParams and Console2 (Score:2)
URLParams is very handy for breaking down get params for web page calls which speeds up debugging of complex calls. I use this almost every day becuase the 3rd party app that I need to extend is heavy on get params.
Console2 is necessary to filter out many annoying css warnings that come out by default since FireFox 1.5.
Cheers,
JsD
lget (Score:2)
threat level (Score:5, Funny)
20 Must-have Firefox Extensions (Score:2, Funny)]):
Tabmix, Geckotip and others (Score:2)
- Tab Mix Plus: Gives you a lot more control of and functionality for your tabs, including multi-level undo for close.
- Videodownloader: Get a local copy of a YouTube video.
- GeckoTip: I have a tablet PC and if you do you MUST get this
- Firebug: Did he include this? If not best way to see what you have open in your tabs.
Needed: Nuke Everything Else (Score:3, Interesting)
Why does Firefox redirect google.com to google.de? (Score:2)
Now I have problem when I type "google.com" into the address bar, google is redirecting me to google.de. That only happends with firefox though, and yes I'm logged on to google so google knows who am I and should have no reason to redirect me.
I only found on
***GOOGLE*** redirects you to localized sites (Score:3, Informative)
Re: (Score:2)
Some of them of very specialized. If you don't use gmail, then your browser doesn't need code in it that treats gmail's pages as a special case that needs to be manipulated.
Some of them, such as adblock, work only due to not being mainstream. If they get too popular, there will be countermeasures.
And some of them have subjective value. So they're "must have" for Person A, but annoying to Person B.
Re: (Score:2)
For example, I use:
- Forecastfox (Great when you can't use the weather channel)
- Morning Coffee (Excellent if you read a lot of webcomics or other weekly features)
- Download Statusbar (I find it less intrusive than the downloads window thing, but remembering what you picked up half an hour ago is harder)
- ChromaTabs (Just picked it up a few minutes ago to see the colors, but the added distinction between tabs is a plus - I wish the damn thing let you
Re: (Score:2)
Re: (Score:3, Insightful)
Re: (Score:2)
Zing! (can't believe I got banned from fark.com
CookieSafe (Score:2)
Re: (Score:3, Informative)
Re: (Score:2)
Re: (Score:2) | http://tech.slashdot.org/story/07/03/11/1448212/20-must-have-firefox-extensions | CC-MAIN-2014-41 | refinedweb | 2,396 | 71.95 |
26 March 2013 01:13 [Source: ICIS news]
SAN ANTONIO, ?xml:namespace>
“We’re going to see a material game-changing event that we’ve not seen in decades,” said Peter Huntsman, who was speaking on the sidelines of the International Petrochemical Conference.
Regions such as the
The shale revolution is occurring on its own without a national energy policy to guide the country into the future, Peter Huntsman said. That needs to change so that the oil, gas and petrochemical companies and the federal government can row in the same economic direction, he said.
“It stymies me that we’re not having a discussion on this nationally,” he said.
Hosted by the American Fuel & Petrochemical Manufacturers, | http://www.icis.com/Articles/2013/03/26/9653256/afpm-13-shale-boom-to-reshape-us-create-millions-of-jobs-ceo.html | CC-MAIN-2015-18 | refinedweb | 117 | 52.7 |
What Are "Tentative" Symbols?
By Ali Bahrami-Oracle on Sep 22, 2006
A tentative symbol is a symbol used to track a global variable when we don't know its size or initial value. In other words, a symbol for which we have not yet assigned a storage address. They are also known as "common block" symbols, because they have their origins in the implementation of Fortran COMMON blocks. They are historical baggage something that needs to work for compatibility with the past, but also something to avoid in new code.
Consider the following two C declarations, made at outer file scope:
int foo; int foo = 0;Superficially, these both appear to declare a global variable named foo with an initial value of 0. However, the first definition is tentative it will have a value of 0 only if some other file doesn't explicitly give it a different value. The outcome depends on what else we link this file against.
To get a better handle on this, let's create two separate C files (t1.c, and t2.c) and experiment:
t1.c
#include <stdio.h> #ifdef TENTATIVE_FOO int foo; #else int foo = 0; #endif int main(int argc, char *argv[]) { printf("FOO: %d\\n", foo); return (0); }
t2.c
int foo = 12;
First, we compile and link t1.c by itself, using both forms of declaration for variable foo:
% cc -DTENTATIVE_FOO t1.c; ./a.out FOO: 0 % cc t1.c; ./a.out FOO: 0
As expected, they give identical results. Now, lets add t2.c to the mix and see what happens:
% cc -DTENTATIVE_FOO t1.c t2.c; ./a.out FOO: 12 % cc t1.c t2.c; ./a.out ld: fatal: symbol `foo' is multiply-defined: (file t1.o type=OBJT; file t2.o type=OBJT); ld: fatal: File processing errors. No output written to a.out ./a.out: No such file or directoryAs you can see, the two different ways of declaring foo are not 100% equivalent. The tentative declaration of foo in t1.c took on the value provided by the declaration in t2.c. In contrast, the linker was unwilling to merge the two non-tentative definitions of foo that had different values, and instead issued a fatal link error.
Normal C rules say that a variable at file scope without an explicit value is assigned an initial value of 0. However, the existence of other global variables with the same name can change this. The C compiler is only able to see the code in the single file it is compiling, and cannot know how to handle this case. So, it marks it as tentative by giving the symbol a type of STT_COMMON, and leaves it for the linker to figure out. The linker is in a position to match up all of these symbols and merge them into a single instance. The linker has no insight into programmer intent though, and it cannot protect you from doing this by accident. The result usually works, but is fragile.
The other declaration form (with a value) causes a non-tentative symbol to be created (STT_OBJECT). In this case, the linker ensures that all the declarations agree. This is the right behavior if you care about robust and scalable code.
It is worth noting that you will never see a tentative symbol with local scope. It can only happen to global symbols, because global symbols in different files are the only way you can get this form of aliasing to occur.
HistoryTentative symbols are bad software engineering. A declaration in one file should not be able to alter one in another file. The need for them dates from the early days of the Fortran language. In Fortran, you can declare a common block in more than one file, with each file independently specifying the number, types, and sizes of the variables. The linker then takes all of these blocks, allocates enough space to satisfy the largest one, and makes all them point at that space. This is a very crude form of a union (variant), and is therefore very useful (and dangerous) Fortran technique.
Sadly, it didn't stop there. We still sometimes find this practice in C code. Two files will both declare:
int foo;and then expect that they are both be referring to a single global variable, with an initial value of 0. This is not necessary. The proper solution has existed for decades. The safe way to do the above is to have exactly one declaration for the global variable in a single file. The other files that need to access to it use the "extern" keyword to let the compiler know what is going on. The statement
extern int foo;is a reference, not a declaration, and it has a single unambiguous interpretation.
Moral: Don't Do That!Don't use common block binding in your code. It was a bad idea 40 years ago, and it hasn't improved with age. The necessity of backward compatibility is such that compilers and linkers must support common block binding. We are stuck with it, but we don't have to use it.
You should always try to minimize or eliminate global variables. However, when you do use them:
- There should be exactly one declaration for each global variable, contained in a single file. When declaring that single instance, always give it an explicit value, even if that value is 0. The C language says that the value is 0 if you don't, but doing it explicitly ensures that you can't accidentally fall into the "tentative trap" if some other module should come along later and define it. Note that this only applies to global variables. Static variables declared at file scope can be safely assumed to have an initial value of 0.
- The module that declares the variable should supply a header file containing an extern statement for the variable. Furthermore, the module must #include its own header file. The compiler allows you to have a declaration and an extern statement for a variable in the same compilation scope, and it will check to make sure they agree. This ensures that your module can't export a bad extern definition to other code.
- Other modules that access the global variable must always #include the header file from the defining module, and must never supply their own explicit extern statement for the variable. This protects them from being stuck with an obsolete and incorrect definition if the variable should change later.
Technorati Tag: OpenSolaris
Technorati Tag: Solaris | https://blogs.oracle.com/ali/entry/what_are_tentative_symbols | CC-MAIN-2015-32 | refinedweb | 1,096 | 65.12 |
On Thu, Sep 16, 2004 at 08:08:05AM -0700, Greg KH wrote:> On Thu, Sep 16, 2004 at 04:10:08PM +0200, Herbert Poetzl wrote:> > On Wed, Sep 15, 2004 at 09:08:21PM -0700, Greg KH wrote:> > >? > > > > most of the time, not at all, but if, then in the> > 'initial' namespace where other userspace helpers> > are handled too (means on the host)> > Ok, then you could handle the kevent message the same way, right?yes probably ...> > > How would you want to handle this kevent notifier?> > > > if there was a notifier telling about mounts - real> > and virtual - then they would make sense _inside_> > the respective namespace they happen .. e.g.> > > > usb-device attached: > > helper is called on host, and does some stuff> > result is a mount of some device, which happens> > on the host/initial namespace, notifier happens> > there ...> > > > process in namespace does --bind mount:> > this might be interesting for the host too, but> > probably it is more useful for the namespace> > where it happened ... > > But in which namespace did it happen? That's probaby the hard part to> determine, right?well, in the mount --bind case, not really, becausethe current process already identifies a namespacewhich could be used for that ...best,Herbert> thanks,> > greg k | http://lkml.org/lkml/2004/9/16/256 | CC-MAIN-2017-43 | refinedweb | 207 | 77.16 |
« itemRenderers: Part 4: States and Transitions | Main | Adobe Media Player »
April 02, 2008
itemRenderers: Part 5: Efficiency
If
Here's an itemRenderer which switches components depending on the value of the data field.
<mx:Canvas> <mx:Script><![CDATA private function lessThanZero() : Boolean { return data.price < 0; } ]]></mx:Script> <mx:Label <mx:Label </mx:Canvas>
This will be faster than setting the style. Some other things to keep in mind:
- start with the example above, switching styles, and write a simple itemRenderer extending UIComponent.
package renderers { import mx.controls.listClasses.IListItemRenderer; import mx.core.UIComponent; public class PriceItemRenderer extends UIComponent implements IListItemRenderer { public function PriceItemRenderer() { super(); } } }
You'll notice that not only did I write the class to extend UIComponent, I also have it implementing the IListItemRenderer interface. It is necessary to do this because a list control will expect any renderer to implement this interface and if you do not, you'll get a runtime error as the list attempts to cast the renderer to this interface.
If you read the documentation on IListItemRenderer you'll see that is an amalgamation of many other interfaces, most of which UIComponent implements for you. But there is one interface extended by IListItemRenderer that UIComponent does not implement: IDataRenderer. This requires you to add the code to give the itemRenderer class the data property you've been using all along.
If you attempt to use this class without implementing IDataRenderer you'll get these errors when you compile the code:.
Edit this class and change it to the following:
package renderers { import mx.controls.listClasses.IListItemRenderer; import mx.core.UIComponent; import mx.events.FlexEvent; public class PriceItemRenderer extends UIComponent implements IListItemRenderer { public function PriceItemRenderer() { super(); } //)); } } }
I took the code directly from the Flex documentation for IDataRenderer, so you don't even have to type it yourself.
With that out of the way make this type of change, and you can do that in this class, too, if you prefer.
override protected function commitProperties():void { super.commitProperties(); posLabel.text = data.price; negLabel.text = data.price; posLabel.visible = Number(data.price) > 0; negLabel.visible = Number(data.price) < 0; }
- Override updateDisplayList() to size and position the labels. You must size the labels because their default size is 0x0. This is another thing a Container class will do for you. Since this is a pretty simple itemRenderer you can just set the labels' size to match the size of the itemRenderer.
override protected function updateDisplayList( unscaledWidth:Number, unscaledHeight:Number ) : void { super.updateDisplayList(unscaledWidth, unscaledHeight); posLabel.move(0,0); posLabel.setActualSize(unscaledWidth,unscaledHeight); negLabel.move(0,0); negLabel.setActualSize(unscaledWidth, unscaledHeight); }
All this probably seems a bit complicated just to do this, but keep in mind that using a container will add a lot more code than this..
Posted by pent at April 2, 2008 11:50 AM
Hi Peter
Thanks for the great articles on Item Renderers.
I am pretty new to item renderers. One of your previous articles helped me fix a problem I was having with my data disappearing.
Thanks.
I do have a question about overriding the measure function when using variableRowHeight.
I created an itemRenderer for a List Component. The list is going to show a word glossary, a word and its definition. Sense the definition can either be long or short. How would you determine the height of the text component holding this string?
Could you please provide some tips/advice?
---------------
Peter: I'll be coming out with an article on text sizing shortly.
Posted by: Jonathan Marecki at April 2, 2008 01:23 PM
These are so awesome! Keep 'em coming!
Posted by: Jim Rutherford at April 2, 2008 04:01 PM
Fantastic post, thanks a ton!
Posted by: Brent at April 30, 2008 01:17 PM
Fantastic set of articles. Now I have to go back and rewrite my code with all this knowledge. Thanks for taking time to do this Peter!
Posted by: Denis at May 7, 2008 04:30 PM
I'm assuming that using graphics.clear() followed by graphics.beginFill,drawRect,endFill would be faster than creating 5 separate shapes of different colors and flipping their visibility?
Posted by: Jed Wood at May 10, 2008 06:55 PM
I would say that using graphics directly would be (marginally) faster than using shapes. Shapes are more convenient to use and the program logic might be easier to understand than having a lot of IF statements and drawing calculations going on. But that's up to you.
Posted by: Peter Ent at May 12, 2008 08:55 AM
Love the article... I got my first renderer up and working great, but my second one has been a huge hassle for me... No matter what I do I just keep getting items bouncing around... it's mainly text based, but text from boxes at the bottom are moving into the item renderers above and vice versa...
Posted by: Luke at May 14, 2008 03:49 PM
Peter, thanks for these articles! Any chance that you'll dive into item editors at some point?
I'm working on a fraction format datagrid item editor that needs to first reformat the data value (decimal to fraction), then validate the new entry (valid fraction string), then reformat the data back into the data object (fraction to decimal). I have the formatters and validators working together within a form, so I just need to apply it to the item editor.
So far I've implemented the formatters using the itemEditBegin and itemEditEnd events from the datagrid. I was planning on implementing the validator and setting the editors errorString within the itemEditEnd handler. I just don't like this approach since I have 3 columns that need the same editor (width, height, depth columns) and handling the formatting and validation through itemEditEnd/Begin has lots of duplicate code that I'd rather put within a self-contained item editor class. Any suggestions?
Posted by: Jason Roberts at May 14, 2008 09:24 PM
Excellent posts guys keep up the great work and Thanks!
Posted by: sesli chat at May 19, 2008 01:54 AM
any clue why in flex set data on the first item calls itself twice ?
Posted by: iongion at May 29, 2008 11:31 AM
The first item is being set twice because it is used to measure the itemRenderer during the Flex framework's measure phase. After that it is set for the layout phase.
Posted by: Peter Ent at May 29, 2008 03:19 PM
Hi Peter, this was a great article, very similar to a blog post on Alex's Flex Closet, (Thinking About Item Renderers). I've been doing flex for a while and I feel there can't be enough of these types of articles. Do you think that you can post something that gets into the nitty gritty when overriding the measure function? Thanks again for the post.
Posted by: Tyler at August 24, 2008 12:31 PM
Light gray text on a white background is hard to read. There's probably good stuff here, but I can't see it. :(
Posted by: bob at September 18, 2008 11:41 PM
There must be something going on with your browser. Are all of the articles appearing that way or just this one? I viewed the site with several browsers and they all look the same to me.
Posted by: Peter Ent at September 19, 2008 08:50 AM
any clue why in flex set data on the first item
Posted by: sesli chat at October 30, 2008 07:28 PM
I do not understand your question.
Posted by: Peter Ent at October 31, 2008 08:50 AM
Fantastic post Peter!
Posted by: Bill at November 14, 2008 07:21 PM
Hi Peter,
I have extended an AdvancedDataGridHeaderRenderer.The set data method is getting called 4 times even though i limit to a single column in my ADG.
Any pointers on how to get rid of this problem?
When does the headererRenderer.setdata method get invoked?
-Vijay
Posted by: Vijay Anand Mareddy at January 16, 2009 03:04 PM
This is a known issue and very frustrating, I agree. I hope they fix this in Flex 4. Please use bugs.adobe.com and search the bugbase. If you find a bug, add your own comment to it; the more people who complain about an issue the more likely it will get fixed. If you don't find a bug, please enter one. The engineering team will evaluate it and if they have a solution, will post it. If they determine it isn't exactly a bug, they should state why and change the entry to something more appropriate.
Posted by: Peter Ent at January 21, 2009 09:22 AM
Any word on the next article regarding text sizing? I have been struggling with itemRenderers that have different sized text fields, and problems displaying when scrolling. I just can't get it to work.
Also I tried using the example above in a List, and I get a null object error in the commitProperties function on the _data object
Posted by: Russ at February 3, 2009 04:04 PM | http://weblogs.macromedia.com/pent/archives/2008/04/itemrenderers_p_4.html | crawl-002 | refinedweb | 1,531 | 64 |
Re: What is “high cardinality” in facet streams?
All in all the index is about 250GB and it’s sharded in two dedicated VMs with 24GB of memory and it’s performing ok so far (queries take about 7 seconds, the worst cases about 10). At some point in the past we needed to transition to SolrCloud because a single Solr core, of course, wouldn’t
Re: What is “high cardinality” in facet streams?
Right now we’re sharding the collection as we hit performance issues in the past with legacy Solr (i.e. a single Solr core), and also we’re experimenting a bit to see which replication factor we can get away with (in terms of resources and cost). Unfortunately, PSQL isn’t yet an option due to
Problems with DocExpirationUpdateProcessor with Secured SolrCloud
Hi, We recently setup a 7.2.1 cloud with the intent to have the documents be automatically deleted from the collection using the DocExpirationUpdateProcessorFactory. We also have the cloud secured using the BasicAuthenticationPlugin. Our current config settings are below. The deployment is 3
AW: Sort by nested field but only in matching nested documents
Thanks for your answer, Mikhail. Florian -Ursprüngliche Nachricht- Von: Mikhail Khludnev [mailto:m...@apache.org] Gesendet: Dienstag, 6. Februar 2018 11:44 An: solr-user
Betreff: Re: Sort by nested field but only in matching nested documents Hello
Response time under 1 second?
Hello With a 3 nodes cluster each 12GB and a corpus of 5GB (CSV format). Is it better to disable completely Solr cache ? There is enough RAM for the entire index. Is there a way for reduce random queries under 1 second? Thanks!
Re: Issue Using JSON Facet API Buckets in Solr 6.6
Thanks Antelmo, I'm trying to reproduce this now. -Yonik On Mon, Feb 19, 2018 at 10:13 AM, Antelmo Aguilar
wrote: > Hi all, > > I was wondering if the information I sent is sufficient to look into the > issue. Let me know if you need anything else from me please. > > Thanks, >
Re: Response time under 1 second?
On 2/22/2018 10:45 AM, LOPEZ-CORTES Mariano-ext wrote: For the moment, I have the following information: 12GB is max java heap. Total memory i don't know. No direct access to host. 2 replicas = Size 1 = 11.51 GB Size 2 = 11.82 GB (Sizes showed in the Core-Overview admin gui)
RE: Response time under 1 second?
For the moment, I have the following information: 12GB is max java heap. Total memory i don't know. No direct access to host. 2 replicas = Size 1 = 11.51 GB Size 2 = 11.82 GB (Sizes showed in the Core-Overview admin gui) Thanks very much! -Message d'origine- De : Shawn
Re: Response time under 1 second?
On 2/22/2018 8:53 AM, LOPEZ-CORTES Mariano-ext wrote: With a 3 nodes cluster each 12GB and a corpus of 5GB (CSV format). Is it better to disable completely Solr cache ? There is enough RAM for the entire index. The size of the input data will have an effect on how big the index is, but it
Re: Solr Swap space
On 2/21/2018 7:58 PM, Susheel Kumar wrote: Below output for prod machine based on the steps you described. Please take a look. The solr searches are returning fine and no issue with performance but since last 4 months swap space started going up. After restart, it comes down to zero and then
SOLR Score Range Changed
I am migrating from SOLR 4.10.2 to SOLR 7.1. All seems to be going well, except for one thing: the score that is coming back for the resulting documents is giving different scores. The core uses a schema. Here's the schema info for the field that i am searching on: When searching
Re: SOLR Score Range Changed
On 2/22/2018 9:50 AM, Hodder, Rick wrote: I am migrating from SOLR 4.10.2 to SOLR 7.1. All seems to be going well, except for one thing: the score that is coming back for the resulting documents is giving different scores. The absolute score has no meaning when you change something -- the
Re: Solr Swap space
Cool, Thanks, Shawn. I was also looking the swapiness and it is set to 60. Will try this out and let you know. Thanks, again. On Thu, Feb 22, 2018 at 10:55 AM, Shawn Heisey
wrote: > On 2/21/2018 7:58 PM, Susheel Kumar wrote: > >> Below output for prod machine based on
Re: Deploying solr to tomcat 7
Dear Shawn, Thanks a lot quick response. I will check with the same. Thanks & Regards Fazulur Rehaman On Wed, Feb 21, 2018 at 4:55 PM, Shawn Heisey
wrote: > On 2/21/2018 3:00 AM, Rehaman wrote: > >> We installed Ensembl server in our environment and not able to query
Turn on/off query based on a url parameter
Hi, I want to enable or disable a SolrFeature in LTR based on efi parameter. In simple the query should be executed only if a parameter is true. Any examples or suggestion on how to accomplish this? Functions queries examples are are using fields to give a value to. In my case I want to
Re: Solr Autoscaling multi-AZ rules
I managed to miss this reply earlier, but: Shard: A logical segment of a collection Replica: A physical core, representing a particular Shard Replication Factor (RF): A set of Replicas, such that a single Replica exists for each Shard in a Collection. Availability Zone (AZ): A partitioned set
RE: Turn on/off query based on a url parameter
I always filter solr request via a proxy (so solr itself is not exposed directly to the web). In that proxy, the query parameters can be broken down and filtered as desired (I examine authorities granted to a session to control even which indexes are being searched) before passing the modified
Re: Issue Using JSON Facet API Buckets in Solr 6.6
I've reproduced the issue and opened -Yonik On Thu, Feb 22, 2018 at 11:03 AM, Yonik Seeley
wrote: > Thanks Antelmo, I'm trying to reproduce this now. > -Yonik > > > On Mon, Feb 19, 2018 at 10:13 AM, Antelmo Aguilar
Solrj SolrServer not converting the Collection of Pojo Objects inside Parent Pojo
We are using Solrj version 4.10.4 as the java client to add documents into Solr version 1.4.1 Sample Pojo Object: @SolrDocument(solrCoreName="customer") public class Customer { private String customerId; private String customerName; private int age; private List addresses; //getters and
Indexing timeout issues with SolrCloud 7.1
I'm trying to debug why indexing in SolrCloud 7.1 is having so many issues. It will hang most of the time, and timeout the rest. Here's an example: time curl -s 'myhost:8080/solr/mycollection/update/json/docs' -d '{"solr_id":"test_001", "data_type":"test"}'|jq . {
Solr not accessible - javax.net.ssl.SSLException
Greetings, Apache Solr community. I'm here to ask for your help and advice about a Solr-related problem I'm having. My company is an e-commerce website and uses Solr in production for the querying of items in our inventory. The Solr installation was done by an engineer who has left the
Re: Limit search queries only to pull replicas
Hi, The use case for this is that our indexing node has more shards than it has CPU cores it is enough for indexing, but not enough to serve the search queries if those queries are heavy. To put it out of serving requests we are using in-house solution that routes the queries to pull replicas | https://www.mail-archive.com/search?l=solr-user@lucene.apache.org&q=date:20180222 | CC-MAIN-2018-34 | refinedweb | 1,287 | 72.05 |
How to authorize the camera on MacBook?
I am learning a bit of OpenCV and have a simple program that grabs images off the Macbook camera and does simple motion detection. I can run it in iTerm2 fine and it works but it fails as "not authorized" when run under Wing debug.
Is there a way to authorize the Wing debug to acess the camera?
[OS=Big Sur (11.3 Beta (20E5196f))]
Here is what I see in the Debug I/O window:
OpenCV: not authorized to capture video (status 0), requesting...
/Applications/WingPro.app/Contents/Resources/bootstrap/launch-env.sh: line 10: 44258 Abort trap: 6 ${WING_ACTIVATE_PYTHON} "$@"
If you open macOS System Preferences and go to Security & Privacy and then under the Privacy tab select Camera, is anything listed as having requested access? Usually a dialog should pop up but if you denied access then I think it lists the app here. Note that it may list Python and not OpenCV but I'm not sure.
No, that's the first place I looked and there is nothing requested. Neither python nor Wing is listed, checked or unchecked. However, iTerm2 IS listed and checked because when I first ran the app it did request access to the camera with a pop-up dialog.
When I
import cv2and
cap=cv2.VideoCapture(0)in the Python Shell window I also get the failure:
Python 3.9.2 (default, Feb 24 2021, 13:26:09) [Clang 12.0.0 (clang-1200.0.32.29)] Type "help", "copyright", "credits" or "license" for more information. import cv2 cap = cv2.VideoCapture(0) OpenCV: not authorized to capture video (status 0), requesting... aborted (disconnected)
That fails and I get a python crash notifiecation:
``` Process: Python [22125] Path: /usr/local/Cellar/python@3.9/3.9.2_1/... Identifier: Python Version: 3.9.2 (3.9.2) Code Type: X86-64 (Native) Parent Process: WingPro [21954] Responsible ...(more)
macOS uses the .app that launches your script as the application that needs permission, so it would be iTerm2 when laughing from it and Wing when debugging (or executing) from Wing. A dialog asking for permission should be displayed the first time the .app tries to use the camera, but apparently this doesn't always work. A way to reset the permissions is explained at...
Well, that didn't change anything. I used
tccutilto reset
Camerafor
com.wingware.wingproand it reported success. But I still get the python failure and no prompt for authorizing the Camera. I did restart Wing after doing the reset ...
Does it work if you use an external console? The OS may determine that the requesting app is the terminal in this case. | https://ask.wingware.com/question/3289/how-to-authorize-the-camera-on-macbook/ | CC-MAIN-2021-17 | refinedweb | 447 | 67.65 |
in reply to
Re^3: chomp() is confusing
in thread Why chomp() is not considering carriage-return
As of today using Strawberry Perl 5.16.0.1 (64bit), Perl doesn't automatically adapt chomp at all to the platform nor converts automatically the carriage return from files that are read.
But Perl doesn’t work like that. As ikegami explained in his post up-thread, removal of the carriage return (CR) character occurs before the string is ever fed to chomp. See the section Defaults and how to override them in PerlIO. On Windows platforms the IO layers default to unix (the lowest level layer) plus a crlf layer on top of this. This crlf is:
A layer that implements DOS/Windows like CRLF line endings. On read converts pairs of CR,LF to a single "\n" newline character. On write converts each "\n" to a CR,LF pair.
So, it is the crlf layer that converts each literal 0d0a to Perl’s logical newline "\n" (0a), and this happens as each line of the file is read in.
The input record separator, $/, defaults to "\n" (0a), Perl’s logical newline character, regardless of the platform. And chomp($string) removes from the end of $string the character(s) (if any) currently assigned to $/. Which all works out fine, because on Windows each CRLF has already been converted into a LF by the crlf IO layer before chomp comes into play.
Now, I can’t test Strawberry Perl 5.16.0.1 (64bit) as I don’t have a 64-bit OS. However, if the latest 64-bit version of Strawberry Perl does handle CRs incorrectly, it’s likely the difference is due to a change in the default IO layers. It’s unlikely to be in any way related to the implementation of the chomp function, for the reasons outlined above. I can confirm that the 32-bit versions of Strawberry Perl 5.14.2 and 5.16.0 (64int) treat carriage returns identically when reading in a text file under Vista.
Of course, the above applies only to text files. If binmode is applied to a file handle before it is read, conversion is suppressed, CRs are retained, and chomp has no effect on these CRs (unless $/ has been re-assigned).
Update: Try specifying the input layer explicitly:
open(my $fh, '<:crlf', $filename) or die ...
[download] | http://www.perlmonks.org/index.pl/jacques?node_id=977349 | CC-MAIN-2015-32 | refinedweb | 397 | 72.26 |
In machine learning, while building a predictive model for some classification or regression task we always split the data set into two different parts that is training and testing. The training part is used to train the machine learning model whereas the testing part is used for predictions by the model. These predictions are then evaluated using different evaluation methods.
But do you think if you are getting an 85% test accuracy you will get the same performance of the model on production data? Does it guarantee the same results? The answer to this question is No we cannot expect the same accuracy. We can just get close to it but not the same. Therefore we need a method that can tell us that this is the range of accuracy that we can expect when we will use the model in production.
This is where K-Fold cross-validation comes into the picture that helps us to give us an estimate of the model performance on unseen data. Often this method is used to give stakeholders an estimate of accuracy or the performance of the model when it will put in production.
Through this article, we will see what exactly is K-fold cross-validation, how it works, and then we will implement it on a data set to check the estimation of accuracy which we can expect on unseen data. For this experiment, we are using the Pima Indian Diabetes data set that can be downloaded from the Kaggle website.
What we will learn from this article?
- What is K-Fold Cross Validation?
- What are the steps to be followed while doing K- Fold Cross-validation?
- How to implement it on a data set to get an estimate of the accuracy?
- What is K-Fold Cross Validation?
It is methods that help a programmer to understand the model estimated accuracy on unseen data or we can say how good the model would be in production. Suppose if we are asked by anyone what would be the accuracy that we can expect when we put this machine learning model in production? To answer this question we can perform K-Fold cross-validation to get an idea of the range of accuracy like 75%-85%. This concludes then when the model would be put in production we can expect this much accuracy on new unseen data points.
This technique creates and validates a model multiple times. This multiple times depends upon us we need to define a value for that. This value is commonly represented as K. If we define it to be 5 then 5 times the model will be validated. Now how to decide the value of K? There is no fixed formula to compute the value of 5 whereas keeping it 10 is a good approach. A random function is used to divide the data into these many folds. Suppose if you have 10 data points in the data set and you have defined K = 5 then 10/5=2, so there would be 2 data points that would be kept for testing for each fold and rest in training.
- What are the steps to be followed while doing K- Fold Cross-validation?
First, we need to split the data set into K folds then keep the fold data separately. Use all other folds as the single training data set and fit the model on the training set and validate it on the testing data. Keep the validation score and repeat the whole process K times. At last, analyze the scores, take the average and divide that by K.
Let us see the implementation of it. We will first import the libraries and will define random data points. We will then check how training and testing data is transformed.
from numpy import array from sklearn.model_selection import KFold data = array([1,2,3,4,5,6,7,8,9,10]) kfolds = KFold(10, True) for train, test in kfolds.split(data): print('Training Data: %s,Testing Data: %s' % (data[train], data[test]))
We had 10 data points in the data set and we defined K=10 that meant there would only be 1 data point present in the testing and all others would be in training. This type of Cross-Validation is also called as Leave One Out Cross-Validation. (LOOCV).
When k_folds is equal to the number of data points.
(LOOCV = n_splits=n)
- How to implement it on a data set to get an estimate of the accuracy?
Now we will implement it on the Pima Indians diabetes data set to check an estimate of the accuracy that we can expect on the production data. We will start by importing the libraries and then the data. Use the below code for the same.
from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import KFold from sklearn.model_selection import cross_val_score import numpy as np import matplotlib.pyplot as plt import pandas as pd df = pd.read_csv('Pima.csv')
Now we will divide this data set into features and targets. We will then define folds, we have set the splits values to be 10 which means there would be 10 folds. After this, we will define our model and check the cross val score. Refer to the below code for the same.
X = df.values[:,0:8] y = df.values[:,8] X_train, X_test, Y_train, Y_test = train_test_split(X, y, test_size=0.50, random_state=1) kfolds = KFold(n_splits=10, random_state=7) model = RandomForestClassifier() score = cross_val_score(model, X, y, cv=kfolds) print(score)
print("Accuracy:",(results.mean()*100))
Now we will check the range that will give us the min and max accuracy that we can expect from the model. Use the below code to check the same.
plt.hist(results) plt.show() alpha = 0.95 p = ((1.0-alpha)/2.0) * 100 value (border) lower = max(0.0, np.percentile(results, p)) p = (alpha+((1.0-alpha)/2.0)) * 100 upper = min(1.0, np.percentile(results, p)) print('%.1f confidence interval %.2f%% and %.2f%%' % (alpha*100, lower*100, upper*100))
Conclusion
In this article, we discussed how we can make use of K- Fold cross-validation to get an estimate of the model accuracy when it is exposed to the production data. The min value of K should be kept as 2 and the max value of K can be equal to the total number of data points. This is also called as Leave one out cross-validation. At last, we discussed how we can implement K fold cross-validation on a data set.
There is one more similar method often used in machine learning for the same purpose that is “BootStrap Sampling”. You can check this article where I have explained about BootStrap Sampling titled “Hands-On Guide To BootStrap Sampling For ML Performance Evaluation”.. | https://analyticsindiamag.com/k-fold-cross-validation-and-loocv/ | CC-MAIN-2020-45 | refinedweb | 1,140 | 65.32 |
How to use Visual Studio 2012 to Download Images from Websites
Introduction
As you might know, I have always been fascinated with Wallpapers and photos. What you might not know is that I appreciate good art as well, seeing the fact that my wife is quite good at painting and creating things out of nothing.
I have a huge collection of wallpapers. Some of you might remember this old dinosaur project of mine, which I still use successfully to change my desktop backgrounds. Because of the tedious nature of collecting new wallpapers, I have decided to make a little tool to do all the hard work for me. With this article I will demonstrate how to download images from a webpage. Note: some pictures are copyrighted, and must not be used in any way. I am not advocating that. I am using pictures from websites that provide them for free.
Design
Fire up Visual Studio 2012 and choose your desired programming language. I will illustrate both VB.NET as well as C#.
Design your form to resemble Figure 1.
Figure 1 - Our Design
Code
Not much coding needed from our side. Let's start with importing the Namespaces.
VB.NET
Imports System.IO 'File Functions
C#
using System.IO; //For File Functions
Now let's handle the navigation button that will enable us to navigate to a site:
VB.NET
Private Sub btnIDGo_Click(sender As Object, e As EventArgs) Handles btnIDGo.Click wbID.Navigate(txtIDURL.Text) 'Navigate To URL End Sub
C#
private void btnIDGo_Click(object sender, EventArgs e) { wbID.Navigate(txtIDURL.Text); //Navigate To URL }
The above code segment instructs the WebBrowser Control to navigate to the entered site. This also assumes your WebBrowser Control was named wbID as was the case with mine.
Now the fun starts!
Add the next code segment:
VB.NET
Private Sub btnIDGet_Click(sender As Object, e As EventArgs) Handles btnIDGet.Click Dim wcObj As New System.Net.WebClient() 'Create New Web Client Object Dim hecImages As HtmlElementCollection = wbID.Document.GetElementsByTagName("img") 'Browse Through HTML Tags Dim strWebTitle As String 'Web Page Title Dim strPath1 As String 'Folder Path Dim strPath2 As String 'Sub Folder Path strWebTitle = Me.wbID.DocumentTitle 'Obtain Web Page Title strPath1 = "c:\" & strWebTitle 'Create Folder Named Web Page Title strPath2 = strPath1 & "\Images" 'Create Images Sub Folder Dim diTitle As DirectoryInfo = Directory.CreateDirectory(strPath1) Dim diImages As DirectoryInfo = Directory.CreateDirectory(strPath2) For i As Integer = 0 To hecImages.Count - 1 'Loop Through All IMG Elements Found 'Download Image(s) To Specified Path wcObj.DownloadFile(hecImages(i).GetAttribute("src"), strPath1 & "\images\" & i.ToString() & ".jpg") Next End Sub
C#
private void btnIDGet_Click(object sender, EventArgs e) { System.Net.WebClient wcObj = new System.Net.WebClient(); //Create New Web Client Object HtmlElementCollection hecImages = wbID.Document.GetElementsByTagName("img"); //Browse Through HTML Tags string strWebTitle; //Web Page Title string strPath1; //Folder Path string strPath2; //Sub Folder Path strWebTitle = this.wbID.DocumentTitle; //Obtain Web Page Title strPath1 = @"c:\" + strWebTitle; //Create Folder Named Web Page Title strPath2 = strPath1 + "\\Images"; //Create Images Sub Folder DirectoryInfo diTitle = Directory.CreateDirectory(strPath1); DirectoryInfo diImages = Directory.CreateDirectory(strPath2); for (int i = 0; i < hecImages.Count; i++) //Loop Through All IMG Elements Found { //Download Image(s) To Specified Path wcObj.DownloadFile(hecImages[i].GetAttribute("src"), strPath1 + "\\images\\" + i.ToString() + ".jpg"); } }
We create a webclient object to assist us later in downloading the images. We then create an HTMLElementCollection object, which helps us identify all Image tags on the webpage. If you do not have a basic understanding of HTML, I suggest you have a look here.
We store the Webpage's title and create a folder on C:\ with the same name. Inside this folder we create a subfolder named Images. This is where we will download our pictures to.
The fun part here is the loop. We use a for loop to loop through all of the images found and save them via the DownloadFile method of the WebClient object. We find the image's location through the HTML IMG Tag's SRC attribute. Voila! Quick and simple.
Conclusion
Although this is but a small tool, its possibilities are endless. I am including the Source files just in case you missed something. Until next time, cheers from a lazy Hannes!
Not working with mePosted by Muhamad on 04/23/2014 01:24am
wbID is not defined , when I try to define it by : Dim wbID As New WebBrowser it points null reference to the line : Dim hecImages As HtmlElementCollection = wbID.Document.GetElementsByTagName("img") I am using VB.NET 2005 thanks.
Not compatiblePosted by Ezequiel on 10/07/2015 08:17am
this code only work in VB 2010+ (100% work for me in vb net 2013) greeting!!Reply | http://www.codeguru.com/columns/vb/how-to-use-visual-studio-2012-to-download-images-from-websites.htm | CC-MAIN-2017-09 | refinedweb | 783 | 50.84 |
,
What’s CRIU?
Snapshotting of virtual machines is used on a daily basis now. Red Hat Enterprise Linux 7.4 beta comes with Checkpoint/Restore In Userspace (CRIU,) version 2.12 which allows snapshot/restore of userland processes, so let’s have a look at that.
Did you ever start a process on a remote system, just to remember seconds later that the process will run for a long time, and will stop in an unpleasant state when you close the remote connection? Of course, having run it in screen/tmux, or with nohup would have helped if you had known that before starting!
CRIU has the potential to help us in this situation with snapshots of long running computing jobs (so you can recover that state in case the system crashes), moving processes to other systems and more.
There were approaches to process migration on Linux in the past, for example:
Berkeley Lab Checkpoint/Restart (BLCR): aimed at HPC workloads, required an extra kernel module which was not upstream, required application code to be prepared for checkpointing, the sockets used by the application (i.e. TCP) get closed on process restore and the project looks inactive since some years.
The HTCondor framework supports process checkpoint/migration: it’s aimed at balancing compute workloads over farms of compute nodes and no source code change is required for snapshot/restore. This project seems to be active.
Snapshot/Restore of a process
We will use a Red Hat Enterprise Linux 7.4 beta (available on the Red Hat Customer Portal) system to illustrate. Here we install CRIU, which is part of the normal Red Hat Enterprise Linux repo, and perform a check:
[root@rhel7u4 ~]# yum install criu [root@rhel7u4 ~]# criu check Looks good. [root@rhel7u4 ~]#
Let’s look at the ‘long running backup script’ situation mentioned before. We logged onto a remote system and then executed a command which is not running in the background but producing output in our terminal, for example, a backup script. Just after starting we notice that closing the terminal will terminate the script.
In our example, we will now create a new directory, store a simple script there which produces output, start the script, and then use CRIU to ‘move’ the script into a screen session.
Let’s first create and run the script.
[root@rhel7u4 ~]# vi /tmp/criutest.sh [root@rhel7u4 ~]# cat /tmp/criutest.sh #!/bin/bash for i in {0..2000}; do echo foobar, step $i sleep 1 done [root@rhel7u4 ~]# chmod +x /tmp/criutest.sh [root@rhel7u4 ~]# /tmp/criutest.sh foobar, step 0 [..]
At this point we log onto the system from a different terminal, ensure that screen is installed, start a screen session and perform further commands from the screen session.
Next, we find out the PID of our script and execute ‘criu dump’ to initiate the snapshot. As we use no additional options, this will remove the original process. File dumplog.txt will contain details from the dump procedure. Using ‘criu restore’ inside the screen session we will then continue the process - having input/output now directed to the screen session.
[root@rhel7u4 ~]# yum install screen [...] [root@rhel7u4 ~]# mkdir /tmp/criu && cd /tmp/criu [root@rhel7u4 criu]# screen -S criu [screen starts] [root@rhel7u4 criu]# PID=$(pgrep criutest.sh) [root@rhel7u4 criu]# criu dump -o dumplog.txt -vvvv -t $PID --shell-job && echo OK OK [root@rhel7u4 criu]# criu restore -o restorelog.txt -vvvv --shell-job Foobar, step 352 [..]
When executing ‘criu dump’, we instructed to produce an output logfile ‘-o dumplog.txt’, be extra verbose ‘-vvvv’, which PID we want to snapshot (the child PIDs below were also snapshot) and that our process uses the terminal and thus needs to be considered differently ‘--shell-job’.
Modifying the process
Using gdb, processes can be inspected and modified. The snapshot is stored in files, in our example in directory /tmp/criu. Modifying these files is another way to influence the process. Let’s kill the example process which we moved into the screen session and investigate the files:
[root@rhel7u4 criu]# killall criutest.sh [root@rhel7u4 criu]# ls core-2056.img ids-2056.img pages-1.img stats-dump core-2491.img ids-2491.img pages-2.img stats-restore dumplog.txt inventory.img pstree.img tty-info.img fdinfo-2.img mm-2056.img reg-files.img tty.img fdinfo-3.img mm-2491.img restorelog.txt fs-2056.img pagemap-2056.img sigacts-2056.img fs-2491.img pagemap-2491.img sigacts-2491.img
The process state is stored in these files. pagemap* files contain details regarding the virtual regions, pages* files contain the process memory. As this is just a test, let’s try a simple modification of the process:
[root@rhel7u4 criu]# cp pages-1.img pages-1.img.orig [root@rhel7u4 criu]# sed -e 's,foobar,barfoo,g' pages-1.img.orig >pages-1.img [root@rhel7u4 criu]# criu restore -o restorelog.txt -vvvv --shell-job barfoo, step 352 barfoo, step 353 [..]
After restoring the modified process, ‘barfoo’ is printed instead of ‘foobar’.
Live migration of a process
With the commands seen so far, we can already snapshot a process. After making the snapshot files available on a different Linux system, for example using NFS or rsync, we can then restore the process on that system. CRIU already implements the ‘page-server’-mode, which sets up a listener, waits for a connection from a ‘criu dump’ over the network, can then receive the process memory and finally runs the process on the destination system.
The effective process downtime depends mostly on:
the amount of memory which is used
how quickly the memory changes
and the network connectivity between both involved systems.
How long is the effective downtime of a process which is getting migrated? I wrote a small script which writes a timestamp into a logfile in 200ms intervals. This process was then migrated to a further Red Hat Enterprise Linux 7.4 system, a second KVM guest on the same hypervisor.
Latency changes of up to 800ms were seen while the process was migrated.
What can we do with this, what are the limits?
Red Hat Enterprise Linux 7.4 is now in beta. CRIU has Technology Preview status at the moment and is not intended to be used on production systems. While playing with this technology, one quickly understands that it’s not yet in production state like KVM live migration.
What are the most important restrictions and characteristics?
The restored process has the same PID as the original process - even when the process gets restored on a different system. This prevented some of my attempts to migrate processes - a process with that PID already existed on the destination. Multiple namespaces can help around this limitation.
Migrations of processes using unknown socket types fail (‘ping’ using ICMP, ‘hping3’ using RAW socket mode)
Shared memory areas are not bound to a single process and are not snapshot by CRIU.
IPs remain untouched by CRIU.
As of today, snapshotting the original process and resuming the process (possibly on a different system) are 2 separate processes, to be executed for example by a script. If resuming fails, the script has to unfreeze the original script. As of today, this process seems more error prone than for example KVM live migration.
CRIU does plain snapshot/restore of the process - there is no rundown of the application, no graceful disconnection of network connections to clients and no closing of files. This is not always a downside: when a system needs to go down for maintenance, one could consider to use CRIU instead of the time-consuming process of shutdown/startup.
Further points are mentioned here:
How can this help us in the future?
Debugging: instead of just taking an application core and finishing the process, we can also snapshot it for debugging on a different system, while keeping it running.
Long running computation jobs: snapshotting them in time intervals allows us to later restore the computation, for example after a system crash.
System upgrades: now there is kpatch to patch live systems. A further idea is to snapshot a process, kexec into a new kernel, and then restore the process.
Assume we have a process which at the beginning takes data via network and then does a lot of computations. We might not trust the memory of the system. Why not snapshot the process and have it finish the calculation on multiple systems, comparing the results?
Further usage scenarios:
Where do I get more information?
An article with more technical details from Adrian, our CRIU package maintainer
Container Live Migration using runC and CRIU, also from Adrian
Our kbase around CRIU:, Virtualization, operations and performance tuning are among the returning topics of this daily. | https://www.redhat.com/zh/blog/how-can-process-snapshotrestore-help-save-your-day | CC-MAIN-2022-33 | refinedweb | 1,464 | 64.1 |
import This should remove the saved password. Is this not working as you are expecting?
Allan:
Though not a solution for your current mxds, maybe a workflow change could resolve this issue in the future. Are the users who share the mxds actually making edits to the Oracle SDE data? Or are they just viewing the data and changing the labels and symbology for a specific project?
You might consider using lyr files for data that is shared in multiple mxds where you have a generic account with only viewing privileges with the password saved so the user does not need to know the credentials for the SDE connection. Then for the data editors, they would have specific SDE connections that only they would use with credentials only known by them. You would have a far greater number of mxds with just viewing privileges and a much lower number of mxds with specific editing privileges. The mxds with the editing privileges would not allowed to be shared so the editing privileges cannot be used by anyone but the individual with the specific editing privileges against the Oracle SDE database. | https://community.esri.com/t5/arcgis-pro-ideas/remove-password-from-mxd/idc-p/974743/highlight/true | CC-MAIN-2022-27 | refinedweb | 189 | 58.62 |
WordPress 5.6 is the next major WordPress release that’s soon going to be available. Today we’re excited to deep dive with you into the most interesting features and additions being merged into Core.
Like previous releases, WordPress 5.6 includes several versions of the Block Editor enhancing the editing experience for WordPress users who don’t have the Gutenberg plugin installed and updated on their websites yet.
Not everything is about the Block Editor, though. Several features have been added to WordPress Core, like a new default Twenty Twenty-One theme, auto-updates for major releases, better support for PHP 8.0, Application Passwords for REST API Authentication.
And there’s much more in WordPress 5.6. We’ll see accessibility improvements, UI enhancements, tons of bug fixes, and a huge list of changes for developers.
If you want to read more about WordPress 5.6 development cycle, check the links below:
- 1 December 2020: RC 2
- 7 December 2020: Dry run for release of WordPress 5.6
- 8 December 2020: Target date for the release of WordPress 5.6
Ready to dive in? Let’s go through:
What’s New with the Block Editor
With WordPress 5.6, several versions of the Gutenberg plugin have been merged into core, so WordPress users and writers should notice several improvements in the editor. We’ll see enhanced block patterns, word counts in the info panel, improved keyboard navigation, improved drag & drop UI, and much more.
For a more comprehensive list of all improvements and changes added to the block editor, check out the release announcement posts: 8.6, 8.7, 8.8, 8.9, 9.0, 9.1, and 9.2. Bug fixes and performance improvements implemented in Gutenberg 9.3 and 9.4 are also included in WordPress 5.6.
Let’s dive into the more interesting changes we’ll see in the block editor.
Blocks, Patterns, and UI Improvements
New block features, enhancements, and bug fixes will improve the overall editing experience. Also, great work has been done on accessibility. Below you’ll find our handpicked selection of the most interesting features you’ll see in the block editor once you update your website to WordPress 5.6.
Position Controls for Videos in Cover Block
Added to Cover Blocks since Gutenberg 8.6, position controls for videos allow users to move the focal point around and set a custom position for videos. This functionality was previously available only for image backgrounds.
Video Position Controls for Cover Block
Position values are set by clicking anywhere on the focal point picker and/or using arrow keys on your keyboard. You can jump values by 10 by holding shift (see also #22531).
Block Pattern Updates
WordPress 5.6 also includes several block pattern improvements added with Gutenberg 8.6.
The layout, text, and color of the Large header and paragraph has been updated (#23858)
The heading in Two columns of text has been moved out of the text block and placed above the columns (#23853)
The Quote pattern now includes an image on top and a separator at the bottom.
The new Quote pattern includes an image and a separator
A new Heading and paragraph pattern has been added with Gutenberg 8.7 (#24143).
Heading and Paragraph pattern in WordPress 5.6
A good usability improvement for the block inserter is the block pattern category dropdown, which allows you to filter patterns by category. This is extremely useful when you have tons of patterns to choose from (#24954).
The block pattern category dropdown
Support for Video Subtitles
Video Blocks now support video subtitles.
Adding video subtitles in Video Block
Editors and content creators should provide video subtitles in WebVTT format (Web Video Text Tracks Format), which is “a format for displaying timed text tracks (such as subtitles or captions) using the
<track> element” (#25861).
Track elements linking to subtitles in different languages
Once you have loaded your .vtt files, site viewers will be allowed to enable subtitles in their favorite language.
Video subtitles user settings
Speaking of videos, make sure to subscribe to Kinsta’s YouTube channel to get new videos every week!
Transform Multiple Blocks into a Columns Block
An interesting usability improvement is the ability to convert multiple selected blocks into a Columns Block.
Select multiple blocks
You just need to select the blocks you want to show in columns, then click the upper right button of the block toolbar.
Each selected block will be converted into a column of a Columns Block.
Tree blocks converted into tree columns
Background Patterns in Cover Block
Cover blocks can now display background patterns.
A cover block with a background pattern
To add a background pattern, upload a pattern image, then toggle on the Repeated background option (here’s everything you need to know about the Media Library in WordPress).
When done, adjust the focal point picker according to your needs and try different combinations with fixed backgrounds.
Image Size Control Added to the Media & Text Block
With Gutenberg 9.1, a new image size control has been added to images in Media & Text Block.
Users can now choose from all the available image sizes (#24795).
Image Size Control in Media & Text Block
Block API V2
A new Block API version enables blocks to render their wrapper element. The goal of the new API version is to lighten the editor’s DOM and make it match the front page content. According to Ella van Durpe:
The biggest benefit of this is that themes and plugins can more easily style the block content if the markup is the same in the editor.
The new version requires to declare the
apiVersion property on block type registration:
registerBlockType( name, { apiVersion: 2 } );
The new API also requires the
useBlockProps hook in the block
Edit function. This hook marks the wrapper element of a block as a block element.
Any property passed to this hook will be merged and returned to the wrapper element. The following example from the dev notes shows a simple use case:
import { useBlockProps } from '@wordpress/block-editor'; function Edit( { attributes } ) { const blockProps = useBlockProps( { className: someClassName, style: { color: 'blue' }, } ); return <p { ...blockProps }>{ attributes.content }</p>; }
For more examples, see Block API version 2.
Additional Features and Improvements for Block Developers
Besides the Block API Version 2, here is a list of additions for developers to go through.
Block Supports API
Block Supports API allows block developers to add features to their blocks. Colors, backgrounds, font sizes are just a few of the many features that can be added to blocks through the Block Supports API.
WordPress 5.6 also introduces several new block supports “to increase consistency and make it easier to introduce these options into blocks”.
Developers can use the new block supports adding the corresponding keys to the
supports property of the block.json file or directly into the
registerBlockType function.
The following example from Block Supports dev note shows hot it works:
supports: { color: { background: true, // Enable background color UI control. gradient: true, // Enable gradient color UI control. text: true // Enable text color UI control. }, fontSize: true, // Enable font size UI control. lineHeight: true // Enable line height UI control. }
The style value will be automatically attached to the wrapper element either through the
has-<value>-<preset-category> class (for preset values) or with a
style element (for custom values).
For this reason, Block Supports are intended to be used with the new Block API V2.
Block Supports can be used with dynamic blocks as well.
createBlocksFromInnerBlocksTemplate API
Developers can use the InnerBlocks component to create custom blocks containing other blocks. Examples are the Columns block and the Social Links block.
The new
createBlocksFromInnerBlocksTemplate Block API allows you to create blocks from the InnerBlocks template.
See dev notes for a depper view and an example of code.
Toolbar Components
A couple of changes affect the Toolbar components as well:
1. ToolbarGroup Component
Before WordPress 5.6, the Toolbar component allowed developers to group related options in a common container. Now, a new ToolbarGroup component should be used instead.
<BlockControls> <ToolbarGroup> <ToolbarButton /> </ToolbarGroup> </BlockControls>
2. ToolbarButton and ToolbarItem Components
Using tabbable elements directly as toolbar items (i.e.
<button>) has been deprecated. Aiming to improve accessibility, toolbar items can be added using ToolbarButton for buttons and ToolbarItem for other controls. The example below shows a button and a dropdown menu:
<BlockControls> <ToolbarItem as="button" /> <ToolbarButton /> <ToolbarItem> { ( itemProps ) => ( <DropdownMenu toggleProps={ itemProps } /> ) } </ToolbarItem> </BlockControls>
Disabling Core Block Patterns
Core patterns can now be disabled using the
core-block-patterns support flag (#24042)
Disabling Inline Image Editor
Gutenberg 8.4 added an Inline Image Editing feature allowing users to edit images directly from the Block Editor.
Inline Image Editing
Developers can now disable the Image Editor using the
block_editor_settings filter (#23966):
add_filter( 'block_editor_settings', function( $settings ) { $settings['imageEditing'] = false; return $settings; } );
Inline Image Editing disabled
Reusable Blocks Moved to a Separate Package
Reusable blocks, previously part of the
@wordpress/editor package, have been moved to the
@wordpress/reusable-blocks package to make them available in other editors.
A New Default Theme: Twenty Twenty-One
WordPress 5.6 includes a brand new default theme. Twenty Twenty-One is a highly accessible, minimalist WordPress theme with a single column layout and a footer sidebar.
The new theme uses a system font stack and a minimal color palette based on pastel background colors.
Twenty Twenty-One theme preview (Image source: Make WordPress Core)
You can read much more about Twenty Twenty-One in our in-depth blog post: Twenty Twenty-One: A Deep Dive into the New Default WordPress Theme.
Auto-Updates for Major Releases
Automatic updates are a core feature introduced in WordPress 3.7 aiming at improving site security and make it easier for site admins to maintain their WordPress websites up-to-date.
While automatic minor core updates have been implemented in earlier versions, with WordPress 5.6 site administrators can now manually enable automatic updates for major releases as well (more on that in a second).
Unfortunately, this crucial maintenance task might still be a little confusing for non-techy users. You can read more about how automatic updates work in our Deep Dive Into WordPress Automatic Updates blog post.
So, WordPress 5.6 introduces a new interface that allows site admins to enable auto-updates for major core releases.
The scope of this feature changed during WordPress 5.6 beta cycle and the original dev note has been replaced. In the words of Jb Audras,
The initial scope of Core auto-updates has moved to:
- Provide some updates to the design of the UI.
- For existing installations, the behavior will remain the same as it is today: opted-in to minor updates by default, but a user must opt-in to major updates (constants and filters that are already in use by hosts or agencies will still take precedence).
- For new installations, the default behavior will change: opted-in to minor updates by default and opted-in to major updates by default.
Starting with WordPress 5.6, you can opt-in to automatic updates for major core versions in the Updates screen, where a new UI provides a checkbox allowing you to Enable automatic updates for all new versions of WordPress.
Enable automatic updates for all new versions of WordPress
Once you have enabled core auto-updates for major releases, you can then enable them to trigger for maintenance and security only by clicking on Switch to automatic updates for maintenance and security releases only.
Switch to automatic updates for maintenance and security releases only
Major Automatic Core Updates for Developers
First, when major core automatic updates are enabled, the
auto_update_core_major option is stored in the database with the
option_value enabled. So, if
get_site_option( 'auto_update_core_major' ) returns
true, the automatic updates checkbox is checked.
Then WordPress checks if major core auto-updates are enabled through the
WP_AUTO_UPDATE_CORE constant or
allow_major_auto_core_updates filter and sets the checkbox accordingly.
Developers can also disable major core auto-updates by setting the
WP_AUTO_UPDATE_CORE constant to
false or
minor as shown below (see also Controlling Background Updates Through wp-config.php):
# Disables all core updates: define( 'WP_AUTO_UPDATE_CORE', false ); # Enables minor updates: define( 'WP_AUTO_UPDATE_CORE', 'minor' );
Note that possible values for
WP_AUTO_UPDATE_CORE are
true (all),
'beta',
'rc',
'minor',
false.
Another option to disable major core auto-updates by default is using the new
allow_major_auto_core_updates filter:
add_filter( 'allow_major_auto_core_updates', '_return_false' );
Back in December 2018, Matt Mullenweg shared the nine priorities for 2019 where “Providing a way for users to opt-in to automatic updates of major Core releases” was number 7. Maybe a bit late, but we are getting there.
Major automatic core updates should have a great impact on WordPress security and overall experience. One thing seems to be clear: from a technical standpoint, the major automatic core updates feature is a complex task that’s not 100% accomplished with the release of WordPress 5.6.
After a thoughtful discussion on Slack, Josepha Haden summarized the concerns and questions coming from Core contributors.
The main long-term goal is to have auto-updates available in the majority of WordPress websites to improve security across the whole WordPress ecosystem (more than 30% of the web).
Anyway, according to Helen Hou-Sandí, Core Lead Developer:
In my mind there are some very difficult technical things to execute on and this needs some VERY disciplined and focused technical product ownership
So we should see additional changes and improvements to the major automatic core updates UI over time. This is what we may expect from now on:
WordPress 5.6:
- In existing installations, major updates must be enabled by the user. Any constant and filter already in use will take precedence. Minor updates are enabled by default.
- In new installations, both minor and major updates are enabled by default.
WordPress 5.6.1:
- We should see some changes to the core auto-updates UI based on feedback.
WordPress 5.7:
- A nudge should be added to the Site Health screen for anyone who opted-out of major auto-updates.
- An auto-updates opt-in should be added to the installation process in WordPress 5.7.
A big concern with core auto-updates is the trust of users. According to Helen:
I believe that we can still do a lot of work to proactively solicit the trust of users, especially those who have had previous bad experiences with WordPress and/or updates
However, each WordPress website is a mix of Core, plugins, and theme. In the words of Helen:
Core updates are broadly pretty safe and there are some protections built-in, but as sites can run any code from any source, there’s no such thing as “100%” for “every kind of WordPress website”.
Users with core auto-updates enabled should regularly back-up their websites or choose a web host providing automatic backups in their plans.
Core auto-updates will also affect the overall update experience, including plugin and theme automatic updates. Joost de Valk noted in a comment:
If we enable WordPress core auto-updates by default, we should do the same for plugins. Otherwise, plugins and themes can’t update for things they need to fix because of core updates. I think users would also expect this: if WordPress auto-updates, plugins and themes should auto-update too.
Site Health Changes in WordPress 5.6
Along with all the features here discussed, WordPress 5.6 also brings an improved version of the Site Health tool, which now behaves differently in the background.
Site Health Check Data Validation
A validator now checks issue responses for Site Health tests. The validator will discard any invalid response, preventing the Site Health tool from causing fatal errors and halting any further controls.
From now on, invalid responses won’t affect the Site Health indicator (#50145).
Asynchronous Checks via REST Endpoind
The Site Health tool is a powerful security tool that allows site owners to be aware of the health status of their websites.
This tool executes a number of security tests providing an overview of your website’s health status.
Need a hosting solution that gives you a competitive edge? Kinsta’s got you covered with incredible speed, state-of-the-art security, and auto-scaling. Check out our plans
These tests fall into two categories: direct tests, running on page load, and async tests, which may require some time to complete, and will run later via JavaScript calls.
Previously, these tests were executed with a call to admin-ajax.php. With WordPress 5.6, things are moving away from admin-ajax.php and a new REST API endpoint will be used instead. Starting in WordPress 5.6, asynchronous tests can be found under the
/wp-json/wp-site-health/v1 namespace.
Thanks to the new REST API enhancement, plugins and themes are also able to make use of REST endpoints and are not limited to Ajax actions for their health tests.
Each asynchronous test can now declare the
has_rest argument, which defaults to
false.
The code below from wp-admin/includes/class-wp-site-health.php shows the array of asynchronous tests in WordPress 5.6:
'async' => array( 'dotorg_communication' => array( 'label' => __( 'Communication with WordPress.org' ), 'test' => rest_url( 'wp-site-health/v1/tests/dotorg-communication' ), 'has_rest' => true, 'async_direct_test' => array( WP_Site_Health::get_instance(), 'get_test_dotorg_communication' ), ), 'background_updates' => array( 'label' => __( 'Background updates' ), 'test' => rest_url( 'wp-site-health/v1/tests/background-updates' ), 'has_rest' => true, 'async_direct_test' => array( WP_Site_Health::get_instance(), 'get_test_background_updates' ), ), 'loopback_requests' => array( 'label' => __( 'Loopback request' ), 'test' => rest_url( 'wp-site-health/v1/tests/loopback-requests' ), 'has_rest' => true, 'async_direct_test' => array( WP_Site_Health::get_instance(), 'get_test_loopback_requests' ), ), 'authorization_header' => array( 'label' => __( 'Authorization header' ), 'test' => rest_url( 'wp-site-health/v1/tests/authorization-header' ), 'has_rest' => true, 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( 'user:pwd' ) ), 'skip_cron' => true, ), ),
Scheduled Site Health checks:
While asynchronous tests have been implemented to prevent slow page loads and timeouts, such concern does not exist with scheduled tests.
With that in mind, in addition to the
has_rest argument we mentioned above, test arrays can also declare the
async_direct_test argument (using the code above), which should be a callable instance of a test.
If a test is run during a scheduled event, the test won’t use the REST API endpoint but will run directly.
Application Passwords for REST API Authentication
Application Passwords is a new system for making authenticated requests to various WordPress APIs.
Passwords are 24-characters long and consist of upper-case, lower-case, and numeric characters, that can be generated either manually or through the REST API.
To manually generate a new application password, browse to your Profile screen and scroll down the page.
Application Passwords in User Profile screen
Choose a name for your Application Password and confirm. WordPress will display your new password.
A new application password
Application passwords are displayed in 4-character chunks, separated by spaces, as shown below:
gsUc UhkU 0ScI gdRd TGoU vrW5
However, passwords can be used with or without spaces:
The application passwords passed back through the authorization flow do not include spaces. They are strictly there to make it easier for someone staring at a long string to keep their place if manually entering it.
They can be used chunked, without spaces, or — heck — if you wanted to, you could probably add a space after every character.
In the User Profile screen, you can view, create, and revoke application passwords. Last Used and Last IP columns make you easily find out passwords no longer used that should be revoked.
Last Used and Last IP fields
At the time of this writing, Application Passwords can be used with REST API authenticated requests and with the legacy XML-RPC API. However, we should see Application Passwords used with additional APIs in the future. George Stephanis explains:
The application passwords authentication scheme can also be applied to future APIs for WordPress as they become available. For example, if GraphQL or other systems are enabled in WordPress, application passwords will provide them with a solid, established authentication infrastructure to build off of out of the box.
An authenticated call to the REST API in Postman
Using Application Passwords on wp-login.php is not possible.
For a closer view of this feature and more technical insights, make sure to check the following resources:
Better Support for PHP 8
PHP 8.0 brings in tons of new features and optimizations making it a true milestone within the evolution of the language. The newer version of PHP introduces many updates breaking backward compatibility and many deprecated features have now been officially removed. So, adding support for PHP 8 in WordPress is a great challenge.
In fact, even if WordPress Core contributors put great efforts into making WordPress 5.6 compatible with PHP 8, we shouldn’t expect that every possible issue would be discovered. The goal here is to reach a point where the whole WordPress ecosystem is compatible with PHP 8, which seems really a tough nut to crack at the moment.
Furthermore, a WordPress website includes at least one theme and a variable number of plugins. So, what we may expect is good support for PHP 8 in WordPress Core, but it’s hard to believe that plugins and themes would quickly add support for PHP 8.
We agree with Jonathan Desrosiers when he states:
The state of PHP 8 support within the broader ecosystem (plugins, themes, etc.) is impossible to know. For that reason, WordPress 5.6 should be considered “beta compatible” with PHP 8.
“Beta compatible with PHP 8” seems a good expression to represent an ongoing process that still requires a lot of effort, but at the same time acknowledges the great work done so far.
However,
All plugin and theme developers, as well as hosting communities, are called on to make their code compatible with PHP 8. This will allow WordPress to attain truly “full compatibility” sooner, and without end-users having to carry the burden.
While the majority of incompatibilities identified through automated tests have been fixed, some manual testing is still required. For this reason, it’s highly recommended to run rigorous compatibility tests on a staging or local environment before upgrading your live website to PHP 8.
Some PHP 8 Changes to Be Aware Of
As we mentioned above, making WordPress fully compatible with PHP 8 is a work in progress. Jonathan Desrosiers provides a list of PHP 8 features and changes WordPress developers should be aware of.
Named Parameters
With PHP named arguments is now possible to pass arguments to a function based on the parameter name, rather than the parameter position. This allows to write code that is self-documenting, arguments are order-independent, and default values can be arbitrarily skipped.
Unfortunately, currently named parameters may cause backward compatibility issues in WordPress. The main reason is that parameter names are subject to change without notice until the current audit is completed. So, at the time of this writing:
Using named parameters when calling WordPress functions and class methods is explicitly not supported and highly discouraged until this audit can be completed, as during the audit, parameter names are subject to change without notice. When this audit has been completed, it will be announced in a future developer note.
Strict Type/Value Validations for Internal Functions
When passing a parameter of illegal type, internal and user-defined functions behave differently. User-defined functions throw a
TypeError, but internal functions behave in a variety of ways, depending on several conditions.
To remove these inconsistencies, in PHP 8 the internal parameter parsing APIs always generate a
ThrowError in case of a parameter type mismatch.
Strict type declaration is not used in WordPress Core. However, Core contributors are working to prevent invalid types to be passed to Core functions. Until that work is completed, this PHP 8 change may lead to
TypeErrors, “especially if a value’s type is incorrectly changed through code hooked to a filter”.
Stricter Type Checks for Arithmetic and Bitwise Operators
In previous versions of PHP, using arithmetic and bitwise operators to an array, resource, or non-overloaded object was allowed, but the behavior was inconsistent and even unreasonable sometimes:
var_dump([] % [42]); // int(0)
With PHP 8, the behavior is always the same and all arithmetic and bitwise operators will throw a
TypeError exception when the operand is an array, resource, or non-overloaded object (see the RFC).
This is another change which requires some extra work from Core contributors, like the many errors, warning, and notice changes.
Again, due to the several issues still unresolved, it’s highly recommended to run compatibility tests on a staging or development environment before you make the switch to PHP 8 on your live website. Read more about WordPress and PHP 8.0.
Additional Changes for Developers
WordPress 5.6 introduces tons of changes for developers and we couldn’t include all in our list. But here the top 3 we think are worth looking at:
1. wp_after_insert_post Action Hook
Before WordPress 5.6 you could use
save_posts or similar actions to run custom code after a post was published. Now WordPress 5.6 introduces the new
wp_after_insert_post action hook, which fires only once terms and metadata have been saved.
In addition, several functions have been updated to prevent those hooks from being fired. The new
$fire_after_hooks parameter has been added to the
wp_insert_posts(),
wp_update_post() and
wp_insert_attachment() functions. If set to
false, it prevents the after insert hooks to be fired.
2. Typecasting
Typecasting functions
intval(),
strval(),
floatval() and
boolval() have been removed from Core in favor of direct typecasting:
intval()→
(int)
strval()→
(string)
floatval()→
(float)
This change has direct effects on performance as direct typecasting is ~6x faster than typecasting functions.
3. WP_Error Objects
The
WP_Error class has been enhanced to allow merging multiple
WP_Error instances into one. Previously you could do that only manually. Now, WordPress 5.6 introduces three new methods to help handle multiple
WP_Error instances. The code below is an example from the dev note:
<?php $error_1 = new WP_Error( 'code1', 'This is my first error message.', 'Error_Data' ); $error_2 = new WP_Error( 'code2', 'This is my second error message.', 'Error_Data2' ); // Merge from another WP_Error. $error_1->merge_from( $error_2 ); // Retrieve all error data, optionally for a specific error code. $error_1->get_all_error_data( 'code2' ); // Export to another WP_Error $error_1->export_to( $error_2 );
Further Readings for Developers
It’s impossible to mention all changes focused on development introduced by WordPress 5.6, but you can read more about them using the following resources:
Summary
WordPress 5.6 is a major release with tons of features and changes for both users and developers. We are always excited to see how the evolution of web technologies directly affects WordPress security, performance, usability, and accessibility.
But evolution never stops and we can already take a peek at future potential release dates.
Up to you now: What do you like the most in WordPress 5.6? And what features would you like to be added to WordPress 5.7?
The post What’s New in WordPress 5.6 (Accessibility, Performance, Security) appeared first on Kinsta. | https://kerbco.com/whats-new-in-wordpress-5-6-accessibility-performance-security/ | CC-MAIN-2022-05 | refinedweb | 4,505 | 53.61 |
I like Arduino devices, but I don’t quite like Arduino IDE. Among all the reasons, one is its
printf() and
sprintf() implementation on floating point support.
In Arduino programming, you often see code like this:
Serial.print("Temperuature = "); Serial.print(temp); Serial.print("c, Humidity = "); Serial.print(humidity); Serial.println("%");
The code is ugly, repeatitive, and feel like written by someone who is learning programming, but you see this kind of code even in the examples that come with popular and well-written libraries. All those 5 lines of code do is to print one line of text like this to Serial Monitor:
Temperature = 32.6c, Humidity = 80.4%
If you are coming from the background of Python programming, you probably know the Zen of Python, it emphasis on ‘Beautiful is better than ugly’ and ‘Readability counts’. I personally think it should apply to all programming languages because after all ‘code is read more often than it is written’.
Beautiful is better than ugly.
Readability counts.
Code is read more often than it is written.
printf() function
If you have experience in C or C++ programming, you probably know the C library function
printf(), so why not using
printf()?
printf("Temperature = %.1fc, Humidity = %.1f%%\n", temp, humidity);
The first argument of the function is a formatter string that contains the text to be written to
stdout. It can optionally contain embedded format tags that are replaced by the values specified in subsequent additional arguments and formatted as requested. The function return an integer that represented the total characters written to the the
stdout if successful, or a -1 is returned if for some reason it is failed to write to
stdout.
The function is available by default in Arduino (
stdio.h is included in
<Arduino.h> automatically), so if you write the code as shown above, it will compiled and run without any problem, but you won’t see any output on the Serial Monitor, this is because Arduino does not use
stdout, all the print (and keyboard input) are done via Serial interface.
sprintf() function
What about
sprintf() which is available in both C and C++?
sprintf() allows you send formatted output to an array of character elements where the resulting string is stored. You can then send the formatted string via
Serial.print() function.
char buffer[50]; sprintf(buffer, "temperature = %.1fc, Humidity = %.1f%%\n", temp, humidity); Serial.print(buffer);
This seems to be a good solution. But if you are rushing to use
sprintf() in your Arduino sketch, not so fast until you see the result from this sketch:
void setup() { Serial.begin(115200); int x = 10; float y = 3.14159; char name[] = "Henry"; char buff[50]; sprintf(buff, "this is an integer %d, and a float %f\n", x, y); Serial.print(buff); sprintf(buff, "Hello %s\n", name); Serial.print(buff); }
If you run the sketch, you will see this result:
this is an integer 10, and a float ? Hello Henry.
This could cost hours of frustration in finding out why the code is not working as it is supposed to be on Arduino. It turns out that Arduino’s
sprintf() does not support floating point formatting.
Why Arduino sprintf() does not support floating point?
So what’s going on? Why the
sprintf() on Arduino behave differently from standard C++ library. To find out why, you have to know where the
sprintf() is coming from. Arduino compiler is based on gcc, or more precisely, avr-gcc for Atmel’s AVR microcontrollers. Together with avr-binutils, and ave-libc form the heart of toolchain for the Atmel AVR microcontrollers. All the printf-like functions in avr-gcc come from
vprintf() function in avr-libc. I found the answer to my question in AVR libc documentation on
vprintf(), it said:
“Since the full implementation of all the mentioned features becomes fairly large, three different flavours of vfprintf() can be selected using linker options. The default vfprintf() implements all the mentioned functionality except floating point conversions… “
it further mentioned that:
“If the full functionality including the floating point conversions is required, the following options should be used:”
-Wl,-u,vfprintf -lprintf_flt -lm
As Arduino compiler options and linker process are hardcoded in its Java code and there is no way for user to select the optional build flags. The problem existed since day 1 of Arduino release and for years people seeking for a solution.
The reason that
Serial.print(float) is able to print the floating point is because Arduino painfully and tediously implemented the
Serial.print() function (the source code can be viewed at ArduinoCore-avr github page, it is almost like a hack) to support the floating point print.
One workaround is to use the
dtostrf() function available in the avr-libc (
dtostrf() is avr-libc specific function, not available in standard gcc:
dtostrf(floatvar, StringLengthIncDecimalPoint, numVarsAfterDecimal, charbuf);
The
dtostrf() converts a float to a string before passing it into the buffer.
float f = 3.14159; char floatString[10]; dtostrf(f,4,2,floatString); sprintf(buffer, "myFloat in string is = %s\n", floatString); Serial.print(buffer);
The
dtostrf() works but it introduce extra line for setup the buffer before printing out the formatted string, it must well just use
Serial.print(). Another workaround looks cleaner but only works for positive number.
sprintf(str, "String value: %d.%02d", (int)f, (int)(f*100)%100);
There is a discussion on Arduino Forum to manually swap out
vprint_std.o (i.e. the standard default version of
vprintf()) from
libc.a and replace it with
vprint_flt.o (the floating point version of
vprintf()). This hack works, it is a little bit terious, but you only need to do it once until you update the Arduino IDE in future, the update process will overide your hack and you will have to re-do it again.
During my search of a solution, I also found PrintEx library on github. The PrintEx offers a clean API and much more features without compromising the performance with reasonable memory footprint, and is the best solution in my opinion.
#include <PrintEx.h> PrintEx myPrint = Serial; void setup(){ Serial.begin(115200); float pi=3.14159; myPrint.printf("pi = %.2f\n", pi); }
Although PrintEx library is almost perfect and solve the problem, but personally I think it is still a workaround. The original problem is trivia to fix, we need all those workarounds, hacking or external library just because the inflexibility of Arduino IDE. So why should we still using Arduino IDE if Arduino is not able to offer a solution for at least the past 8 years?
Fix the sprintf() with PlatformIO
This is when I realised that PlatformIO might be able to solve the problem. I have been using PlatformIO as my Arduino development environment for a couple of years now. PlatformIO is a better IDE than Arduino IDE in terms of project-based library dependency management, configuration and more importantly, allows me to customise my build flags for each project.
If you never use PlatformIO for Arduino programming, the following two videos from Robin Reiter on YouTube provides a quick installation guide for setting up PlatformIO.
PlatformIO put the configuration settings of each project in a file called
platforio.ini, I can add customised
build_flags into my Arduino Nano’s
platformio.ini as:
[env:nanoatmega328] platform = atmelavr board = nanoatmega328 framework = arduino build_flags = -Wl,-u,vfprintf -lprintf_flt -lm
The first three parameters about platform, board and framework were created automatically when I create a project via PlatformIO. The last line about
build_flags is what I need to add manually based the
vprintf information provided by avr-libc. This allows the compiler to replace the default
lprintf_std with
lprintf_flt during the build process so that the compiled code will have floating point support on
vprintf.
I compiled and upload the sketch to my Arduino Nano via PlatformIO, and run the sketch, the correct floating point result shown up on Serial Monitor!
this is an integer 10, and a float 3.14159 Hello Henry
The
vprintf floating point support added about 1500 bytes to the memory usage which might be a big deal when avr libs was developed 20 years ago, but for Arduino adding 1500 bytes extra memory usage out of total 37000+ bytes is not a big deal for many applications, and now I have a fully function
sprintf() instead of the previous half-baked version!
Create a print() function
sprintf() requires some setup and take 2 lines of code to print a formatted string, but it is still better and more readable than the 5 lines that you seen at the beginning of this article. To make it a one liner, I create a function and wrapped all the code with C++ Template Parameter Pack pattern which was introduced since C++11.
template <typename... T> void print(const char *str, T... args) { int len = snprintf(NULL, 0, str, args...); if (len) { char buff[len+1]; snprintf(buff, len+1, str, args...); Serial.print(buff); } }
Now I have a one liner
print() function that is elegant and easy to read:
print("temperature = %.1fc, Humidity = %.1f%%\n", temp, humidity);
What other Arduino-compatible platforms handle floating point
After done all those research and implement my own
ESP8266/ESP32
Both ESP8266 and ESP32 Arduino core implementation added a printf method to its Serial class, so that you can do call
Serial.printf() like the way c
printf() do. What this means is that ESP32 and ESP8266 supports floating point on Arduino out-of-box.
The following code running on ESP32 and ESP8266 will provide the correct floating point results. How nice!
float number = 32.3; char str[30]; void setup() { Serial.begin(115200); // This is ESP32/ESP8266 specific Serial method Serial.printf("floating point = %.2f\n", number); // which is equivalent to this (BTW, this also works) sprintf(str, "floating point = %.3f\n", number); Serial.print(str); } void loop() { }
STM32duino
STM32duino does not supports floating by default, it follows faithfully to the Arduino APIs. However, on the drop down menu of Arduino IDE, you can select the optional c runtime to pull in the printf floating point support during compilation. This is similar to the intention of original AVR implementation and similar to what PlatformIO did, but with an even nicer and user-friendly UI. Why Arduino.cc can’t do that?
Final Word
The avr function
dtostrf() remain a viable workaround because it is part of the Arduino core and implemented across all Arduion-compatible platforms.
The
sprintf() floating point support on Arduino is a well known issue for years, and is actually trivia to fix. Arduino announced the release of alpha version of Arduino Pro IDE in Oct 2019. I have not try the Arduino Pro IDE yet, but I sincerely hope that Arduino.cc learnt something from other platform owners, and gives users more flexibility in project management and build options.
I hope now you will know Arduino a little bit better than before.
10 comments by readers
Thank you for posting this excellent blog article. I learned a huge amount. Many new Arduino developers fall foul of the sprintf/float sinkhole and most developers just write many lines of unsightly code to work around. I agree with you : can do better (and you have!). I used PrintEx but found a bug in PrintEx sprintf (does not write ‘\0’ at end of string sometimes) and I used your elegant C++11 template parameter pack solution to wrap it and fix the problem. I am still using the Arduino and I will give the Pro IDE a go soon…
I found that this works for an esp32 including negative numbers. The following prints out a negative number in two decimals:
Thanks for the tutorial!
For ESP32 (and ESP8266), it supports floating point out of the box. It will be better and simpler to just use
I switched over to PlatformIO – I’ve already used Atom for web pages, anyway. There’s a problem with Beginning Arduino project 10 – “Serial Controlled Mood Lamp”
The Arduino IDE Serial Monitor accumulates your text in a text box until you hit RETURN or click the SEND button, but PlatformIO seems to send characters as soon as they are available. So if you type slowly, or pause, the Arduino board gets only a fraction of your intended command.
Suggestions on how to make the Serial Monitor wait until a complete line has been entered?
It seems that for some reason your device monitor setting for
send_on_enteris enabled, take a look at on how to change it.
Nice effort on Tutorial, just pity you have missed-out the obvious, and a solution…
Due to the tedious work necessary to print More complex data, it is natural need for users to add the printf support themselves. For example:
This should have been first stated and dealt with long before dealing with less common derivations.
Openly, the ESP8266 libraries are far better done then those from Arduino foundation itself, especially when you go into less basic projects, but do have a steeper learning curve…
Yeah… And did you bother to read the full article? At the end it says:.
Thank you for saving my day! As HeatPumper mentioned above, sprintf misses the terminating zero. This is easily fixed in your “Create a print() function”:
Just replace:
by:
Thanks for pointing that out, I took a look at my little function again and made some small changes to use
snprintf()instead of
sprintf()as
snprintf()will always terminate the string with
\0even when it is truncated, so it is safer, and there is no need to manually add
\0.
I just added this in \hardware\arduino\avr\platform.txt to make sprintf work with float:
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=-Wl,-u,vfprintf -lprintf_flt -lm | https://www.e-tinkers.com/2020/01/do-you-know-arduino-sprintf-and-floating-point/ | CC-MAIN-2021-49 | refinedweb | 2,310 | 61.97 |
I am looking for adomain policy or something that will force clients in their particular site to only access the dfs server in that site and not be able to go out over the WAN and try another server.
Does anyone know how to make the clients do this.
Thanks
Geoff.
20 Replies
Mar 29, 2010 at 8:21 UTC
Quick question... you've fully setup sites and subnets in your AD?
Mar 29, 2010 at 8:57 UTC
like martin is pointing to, your subnets all have to be entered in sites and services, your servers then have to have their locations marked as being in the same location as the subnets (do that in users and computers).
dfs will automatically pick the one in the same location if available.
Mar 29, 2010 at 8:59 UTC
Yes it's all working fine.. I want to stop any of the clients finding other dfs servers. If they do happen to access another server over the WAN it slows down a couple of WAN links and causes problems.
Mar 29, 2010 at 9:02 UTC
This would depend on what they are accessing, I think. For example, I use DFS to distribute software via GP. In the policy that I set the software install for, I point it to the DFS share and the users automatically install from their local server.
You would simply point the users to the DFS share name and they would automatically go to the DFS server that is in their subnet.
You can find more information about DFS here.
That site helped me a lot when I started using DFS.
Justin
Mar 29, 2010 at 9:41 UTC
I think I've observed what Geoffrey is talking about... even with sites & subnets setup users will inexplicably attach to another file share and it slows them down pretty badly.
The only fix I've come up with for this is to have 2 DFS trees. Once is for replication and has all the members on it. The other just has the single server (my shares are all seperated by site so I can do this) in the tree and that's the DFS tree I have the users attach to. It kills the automatic failover if a file server dies, but I can add another server in and force AD replication to get the share up and working again usually within 5-10 minutes which is acceptable for us.
Your mileage may vary.
Mar 29, 2010 at 9:55 UTC
I am seeing the same type of issue here. Sites and services are setup correctly, but one of our sites seems to connect to servers in different sites. So far the only thing I can come up with it that it is either related to the slow NAS at that site, or the fact that the NAS is not an AD server which is how our other sites are configured.
Mar 29, 2010 at 10:07 UTC
I thought I read that you could do this using dfsutil or something like that, but unfortunately I can't find what I was reading.
Mar 29, 2010 at 10:11 UTC
ok I found it again... here it is if anyone wants to check it out.
Mar 29, 2010 at 10:16 UTC
Interesting stuff :)
Mar 29, 2010 at 10:50 UTC
Actually I couldn't get those examples to work.. but this does
dfsutil /root:\\demo.test\shared /insite /enable
The end. Thanks for everyones comments..
Geoff.
Mar 30, 2010 at 9:57 UTC
I know you have your answer but why do you want to stop the redundancy access, that is what makes DFS worth using. It is a great tool for keeping data online at all times.
I control my users by setting the Target priority option. This works great an if a server should go bump in the night. The night crew still has data. 99% up time. This also stops the problem of databases being opened on different servers at the same time.
To set this, right click on the folder targets. Then go to Properties, Advanced tab. Click the Override referral ordering and set a First among all targets. Then I set my other folder targets to nothing or Last among all targets.
This is just my two cents...
Happy DFSing
Mar 30, 2010 at 10:14 UTC
@DiodeDave, what you're describing is the default action anyway. If you right click on the DFS namespace, the click on the "Referrals" tab you'll see the "Ordering Method" is set to "Lowest Cost".
I agree that turning off the cross-site feature kills the automatic failover feature, but if DFS randomly (or not so random, we just don't know why) picks the wrong site that can be pretty harmful to performance.
Mar 30, 2010 at 10:19 UTC
Crap I got here too late :-(
DiodeDave, at least he's replicating the data?
We had that issue here, we fixed it. I wasn't involved so I don't know the fix, I'll ask my coworker and see if he remembers.
Mar 30, 2010 at 10:30 UTC
We made some changes to the site and it was fine.
Something odd going on there...
Mar 30, 2010 at 10:49 UTC
Hey Martin9700,
Mar 30, 2010 at 11:05 UTC
There are several reasons to use DFS and what we use it for is to replicate data accoss to other locations, so that our users all have access to the same data. We want the servers to use the WAN bandwith to replicate between themselves and not be competing with clients for the same bandwith. The clients all have their own local servers they should be accessing.
Even though the clients should stay within thier own sites... well in theory.. so if they don't want to do so by their own means, then we shall force them into submission.. ! :)
Mar 30, 2010 at 11:14 UTC
Hey Martin9700,["I agree that turning off the cross-site feature kills the automatic failover feature, but if DFS randomly (or not so random, we just don't know why) picks the wrong site that can be pretty harmful to performance."]We don't seem to ever see any random swapping of users across the DFS Namespaces. I have the Namespace Servers also set up with priorities. The only time there is a swap is if a server is offline.
I must not be understanding the issue?
No, you definitely got it. Geoffrey noticed sometimes the users are going across the WAN even if the primary is available... and I've noticed it too. It doesn't kill me as badly as Geoffrey but was still noticable.
I think it's one of those classic, other then the fact that it doesn't always work, it's fantastic!
Mar 30, 2010 at 11:37 UTC
I will have to keep an extra eye out for abnormal behavior.
My setup uses five servers in five different buildings. So far I have not had any issues of users jumping out of place except when a server was down for maintenance.
Mar 30, 2010 at 1:09 UTC
I do happen to think DFS is the best thing since sliced bread.. or vegemite even... So I am definataly not knocking it.. I'm a strong advocate actually.
Jan 24, 2017 at 3:05 UTC
In DFS - Select the namespace, properties, referrals - check the box for exclude targets outside of the clients site | https://community.spiceworks.com/topic/93723-how-to-force-clients-to-only-access-a-dedicated-dfs-server | CC-MAIN-2017-43 | refinedweb | 1,265 | 80.62 |
The QTabletEvent class contains parameters that describe a Tablet event. More...
#include <QTabletEvent>
Inherits QInputEvent..
Qt uses the following hard-coded names to identify tablet devices from the xorg.conf file on X11 (apart from IRIX): 'stylus', 'pen', and 'eraser'. If the devices have other names, they will not be picked up Qt.
This enum defines what type of point is generating the event.
See also pointerType().
This enum defines what type of device is generating the event.
This enum was introduced in Qt 4 paramater().
Returns the type of device that generated the event.
See also TabletDevice.().
Returns the global x position of the mouse pointer at the time of the event.
See also globalY(), globalPos(), and hiResGlobalX().
Returns the global y position of the tablet device at the time of the event.
See also globalX(), globalPos(), and hiResGlobalY().
The high precision coordinates delivered from the tablet expressed. Sub pixeling information is in the fractional part of the QPointF.
See also globalPos(), hiResGlobalX(), and hiResGlobalY().
The high precision x position of the tablet device.
The high precision y position of the tablet device.
Returns the type of point that generated the event.
Returns the position of the device, relative to the widget that received the event.
If you move widgets around in response to mouse events, use globalPos() instead of this function.
See also x(), y(), and globalPos().
Returns the pressure for the device. 0.0 indicates that the stylus is not on the tablet, 1.0 indicates the maximum amount of pressure for the stylus.
See also tangentialPressure().
Returns the rotation of the current device in degress. This is usually given by a 4D Mouse. If the device doesn't support rotation this value is always 0.0..
See also pressure().().
Returns the x position of the device, relative to the widget that received the event.
See also y() and pos().
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of the x axis. Positive values are towards the tablet's physical right. The angle is in the range -60 to +60 degrees.
See also yTilt().
Returns the y position of the device, relative to the widget that received the event.
See also x() and pos().
Returns the angle between the device (a pen, for example) and the perpendicular in the direction of the y axis. Positive values are towards the bottom of the tablet. The angle is within the range -60 to +60 degrees.
See also xTilt().
Returns the z position of the device. Typically this is represented by a wheel on a 4D Mouse. If the device does not support a Z-axis, this value is always zero. This is not the same as pressure.
See also pressure(). | http://doc.qt.nokia.com/4.6-snapshot/qtabletevent.html#device | crawl-003 | refinedweb | 459 | 70.6 |
Finding the equivalents
Document options requiring JavaScript are not displayed
Help us improve this content
Level: Introductory
Hemang Subramanian (shemang@in.ibm.com), Software Engineer, IBM India
11 Apr 2003
In many application programs, the need for standard data structures, or collection structures, is critical. This article compares the features of the IBM Open Collection Classes and Standard Template Library (STL) Collection Classes. If you need to port applications that use STL Collection Classes to applications that use the IBM Open Class Library, or vice versa, then you might find this article useful.
Introduction
If you migrate a C++ application to Linux written with a VisualAge C++ tool, which in turn uses the IBM Open Class (IOC) Library, you would need to find the equivalents for the various classes used in the GNU-stdlibc++ provided on Linux. Similarly, if you need to migrate any application that uses STL classes to a platform that supports IOC, how would you do it?
This article discusses the nuances of a subset of the IOC Library called the collection classes. It addresses certain classes and gives a general direction for finding the functional equivalent for the collection classes. The STL classes and methods have an equivalent for most of the IBM Open Classes.
Collection classes in the IOC Library
The IOC Library has various class templates for providing things like application control, runtime storage of data, and user interface programming. The collection classes of the IOC library are used to store data in a particular data structure. The collection classes can be classified as:
The most commonly used data structures are: queues, stacks, lists, sets, maps, bags, trees, and tables. Each of these categories have several variations. For example, the queue can be represented many ways in the library, such as IAProrityQueue, Iqueue, IqueueonTabularSequence, IqueueonSortedTabularSequence, and so on.
Most of the methods used for all the classes are unique to the data structure, but there are several methods that are common across the various classes. This article discusses the implementation of those methods and gives a source code example of the STL equivalent in Linux for a simple Queue data structure.
One of the caveats of the Open classes is the presence of a generic class called ICursor that can point to any &element in a collection object. The ICursor can point to any &element in the collection, and is similar to a pointer to an &element in a list.
ICursor
STL organization and container classes
The STL is a generic C++ library of container classes, algorithms, and iterators. It provides many of the known basic algorithms and data structures. Its components have many parameters, and almost every component in the STL is a template.
The STL's main components are:
See Resources for more details about STL and C++.
You can consider an object of type Iterator as being similar to a cursor that points to a particular member of a particular collection. All the data structures that are present and defined are present as a part of the container classes provided by STL.
Iterator
Common methods used by collection classes
Several methods and functions are commonly defined as members to the several classes in the IOC Library. Some of the commonly used methods of these classes are:
Add
AllElementsDo
additionalArgument
Note: For the non-const version of allElementsDo(), the given function must not manipulate the element in the collection in a way that changes the positioning property of the element.
allElementsDo()
retcode = Data.allElementsDo(WriteRecord, rLog)
rLog is the parameter to the WriteRec function
RemoveAll
key
For example, I have structure "abc" with elements a,b,c, and I have a QueueonSortedTabularSequence collection, where each member is of type "abc." The element used to sort the elements of the Queue could be the element "a." The function key would return "a."
QueueonSortedTabularSequence
elementAt
Exception handling and thread safety in the IOC and STL
All methods associated with any particular collection class have several exceptions that are thrown by the various methods in the classes. The exceptions that arise are:
This is a feature unique to the IBM Open Classes. Most of the exceptions are thrown by the method itself, and actions can be taken based on these exceptions.
STL methods internally do not throw out any such exceptions. Take extra care to avoid errors here, since they cannot be automatically detected by the IOC library.
Both classes are not thread-safe. For example, if I have two threads, one of which adds a member to an object and the other deletes it, I would have to use a method to lock either. See Resources for information about achieving this in STL.
IQueue collection class
A queue is a sequence with restricted access. It is an ordered collection of elements with no key and no element equality. The elements are arranged so that each collection has a first and a last element. Each element except the last has a next element, and each element except the first has a previous element. The type and value of the elements are irrelevant and have no effect on the behavior of the collection. One can only add an element as the last element, and can only remove the first element. Consequently, the elements of a queue are in chronological order. A queue is characterized by first-in, first-out (FIFO) behavior.
void enqueue ( Element const &element )
Adds the element to the collection and sets the cursor to the added element. For ordinary queues, the given element is added as the last element.
Exceptions:
IBoolean add ( Element const &element )
Adds an element to the queue and points the cursor to the element that has been added.
INumber numberOfElements ( ) const
Returns the number of elements the collection contains.
void dequeue ( Element &element )
Copies the first element of the collection to the given element and removes it from the collection.
Exception:
IBoolean isEmpty ( ) const
Returns True if the collection is empty.
IBoolean allElementsDo (IBoolean (*function) (Element , void*),void* additionalArgument = 0 )
ls the given function for all elements in the collection until the given function returns False. The elements are visited in iteration order. Additional arguments can be passed to the given function using additionalArgument. The additional argument defaults to zero if no additional argument is given.
ibGood = Data. allElementsDo(WriteRecord, amprLogampamp;);
rLog is the parameter to the WriteRecord function
void removeFirst ( )
Removes the first element from the collection. Element destructors are called as described in RemoveAt.
RemoveAt
Exception:
void addAllFrom ( CLASS_NAME &constamp collection )
Adds or copies all elements of the given collection to the collection. The elements are added in the iteration order of the given collection. The contents of the elements, not the pointers to the elements, are copied. The elements are added according to the definition of add for this collection. The given collection is not changed.
Cursor* newCursor ( ) const
Creates a cursor for the collection and returns a pointer to the cursor. The cursor is initially not valid.
removeAll()
Deletes all the elements in the Queue.
IQueue Collection Class
Equivalent STL class for the IQueue being used as a List.
IQueue
There could be different ways of representing the equivalent class for the Open Class Queue, such as creating a class that inherits from List, but this example just shows the basics. Because the queue class on Linux does not return an iterator, which is needed for simulation of several functions given by the VAC++ classes, the IQueue is implemented as a List.
The List also cannot be used instead of a queue class directly available in the STL library because there is no equivalent for the forAllElementsDo method. The for_each algorithm cannot be considered equivalent to forAllElementsDo because it does not stop performing the operations on the elements if the callback function returns a false for even one element.
forAllElementsDo
A List is a doubly linked list. It is a sequence that supports both forward and backward traversal, and (amortized) constant time insertion and removal of elements at the beginning, end, or in the middle. Lists have the important property that insertion and splicing do not invalidate iterators to list elements. Even removal invalidates only the iterators that point to the elements that are removed.
Enqueue
void push_back(const T&)
NumberOfElements
size_type size() const
Dequeue
void front()
void pop_front()
IsEmpty
allElementsDo
A simple for loop achieves the equivalence to the allElementsDo method:
for (itt=object.begin();itt!=object.end();itt++)
if(!print(*itt)) break;
This traverses the whole list from the first element to the last element in the list. Each element in the list is passed as a parameter to the function print as a pointer to the iterator itt. The prototype of the function print would remain the same as on OS/2, as it would return a data of type Boolean.
RemoveFirst
addAllFrom
for (itt =mergelist.begin();itt != mergelist.end();itt++)
abc.push_front(*itt);
Here, itt is an object of type Iterator.
Note that this section of the code has to be locked with a Mutex in order to be thread-safe.
newCursor
ListClass::iterator itt;
itt = list.begin(); //itt
Queue Implmentation using Open Classes */
#include <iostream.h>
//#define INO_CHECKS // to omit run-time precondition checks
#include <iset.h> // for ISet
//#pragma info (nocmp, nopor) // to omit comparison and non-portable
conversion
#include <iqueue.h>
#include <iglobals.h>
#include <os2.h>
typedef IQueue<int> WordSet;
WordSet abc;
WordSet def;
IBoolean printit(int const &abc, void *bcd)//not used
{
cout<< abc <<endl;
return TRUE;
}
void main(void)
{
int remark;
int temp;
abc.enqueue(1);
abc.enqueue(2);
abc.enqueue(3);
abc.enqueue(4);
//Creation of the second list of items
def.enqueue(99);
def.enqueue(100);
def.enqueue(101);
// abc.allElementsDo(Mult,&remark);
abc.dequeue(temp);
//if list abc is Empty donot print
if (!abc.isEmpty())
cout<<"element " <<temp <<" number of elements
"<<abc.numberOfElements()<<"\n";
//Merger with the second list
abc.addAllFrom(def);
//if list abc is Empty donot print
if (!abc.isEmpty())
cout<<"number of elements "<<abc.numberOfElements()<<"\n";
//All Elements do
abc.allElementsDo(printit); //print all elements
//removeAll elements
abc.removeAll();
if (abc.isEmpty())
cout<<"number of elements "<<abc.numberOfElements()<<"\n";
}
Equivalent Queue Listing */
#include<iostream.h>
#include<list>
#include<iterator>
#include<string>
#include<algorithm>
typedef struct _abc{
int a;
int b;
}sabc;
typedef list<sabc> WordSet;
//Queue is a first in First out mechanism
//(END)D C B A(FRONT)
WordSet abc;
WordSet mergelist;
WordSet::iterator itt;//Equivalent for Cursor
bool print(sabc elem)
{
if(elem.a == 8)
return 0;
else {
cout<<elem.a <<" "<< elem.b<<' '<<'\n';
return 1;
}
}//code needed for returning a TRUE Value
void main(void) {
sabc temp;
sabc temp1;
sabc temp2;
sabc temp3[3];
sabc temp4;
int size;
temp1.a = 1;
temp1.b = 2;
temp2.a = 3;
temp2.b = 4;
temp3[0].a = 5;
temp3[0].b = 6;
temp3[1].a = 6;
temp3[1].b = 7;
temp3[2].a = 8;
temp3[2].b = 9;
//Method for add
abc.push_back(temp1);//1 2
abc.push_back(temp2);//3 4
abc.push_back(*(temp3 + 2));//8 9
abc.push_back(*(temp3 + 1));//6 7
//new list for merging with abc
mergelist.push_back(temp3[0]);// 5 6
mergelist.push_back(temp3[1]);//6 7
//for allElementsDo method
for(itt=abc.begin();itt!=abc.end();itt++)
{
if (!print(*itt))
break;
}
// for IsEmpty
if (!abc.empty())
{
cout<<"list is not empty"<<endl;
}
//Method for dequeue
temp4 = abc.front();
cout <<"DEQUEUE " <<temp4.a<<" "<<temp4.b<<endl;
abc.pop_front();
//End Method for dequeue
temp4 = abc.front();
cout <<"After popping:BACK " <<temp4.a<<" "<<temp4.b<<endl;
if (!abc.empty())
size = abc.size();//Method for numberofElements
cout<<"Size of the Queue is:- "<< size <<endl;
//Method for addAllFrom
for(itt=mergelist.begin();itt!=mergelist.end();itt++)
abc.push_back(*itt);
cout<<"The new merged list is as follows" << endl;
//displaying the merged list
for_each(abc.begin(), abc.end(),print);
//Method for removeAll
abc.clear();
if (!abc.empty())
cout<<"List has not been cleared \n";
else cout<<"List is empty \n";
}
Resources
for_each
About the author
Hemang holds a B.Tech in Computer Science from KREC, Surathkal (now known as the National Institute of Technology, Surathkal). He has been with IBM India working on wired and wireless networking for more than three years. He has a U.S. patent pending, and two publications (one in the IBM technical disclosure bulletin, and the other on the developerWorks Wireless Zone). You can contact Hemang at shemang@in.ibm.com.
Rate this page
Please take a moment to complete this form to help us better serve you.
Did the information help you to achieve your goal?
Please provide us with comments to help improve this page:
How useful is the information? | http://www.ibm.com/developerworks/ibm/library/i-stlclass.html | crawl-001 | refinedweb | 2,106 | 57.27 |
How many 7 segment LEDs can a arduino run before using a LED Driver IC?
Really want to have 4 counting down 60.00 to 00.00 (MM.SS)
How many 7 segment LEDs can a arduino run before using a LED Driver IC?
Really want to have 4 counting down 60.00 to 00.00 (MM.SS)
You can run a 4-digit LED display from the arduino. I have a 4 digit display from digikey(67-1450-ND) running right now. You’ll need 12 IO.
edit:12 IO, not 16.
how about 4 separate 7 segments?
That display is 4 separate segments. There are 8 segments per digit, and 4 common cathodes.
You connect the 8 segments and 4 cathodes to 12 IO and drive each digit sequentially. Here’s some code I threw together to display numbers on that particular display.
note: this code isn’t all that great, or even all that complete.
#include <TimerOne.h> // this is non-standard, download it from the arduino site const int num_digits = 10; const byte num_pins = 8; const byte num_grounds= 4; byte grounds[] = {3,2,1,0}; // g1,g2,g3,g4 byte segments[] = {9,6,13,12,11,8,7,4}; // A,B,C,D,E,F,G,P byte num_to_display[]={0,0,0,0}; int led_nums[num_digits][num_pins]= { {1,1,1,1,1,1,0,0}, // 0 }; void setup() { int i; for (i = 0;i < num_pins;i++) { pinMode(segments[i],OUTPUT); if (i < num_grounds) { pinMode(grounds[i],OUTPUT); digitalWrite(grounds[i],HIGH); } } Timer1.initialize(550); Timer1.attachInterrupt(updateDisplay); } void updateDisplay() { int g,d; for (g = 0; g < num_grounds;g++) { for (d = 0;d < num_pins;d++) if(digitalRead(segments[d]) == 1) digitalWrite(segments[d], LOW); // clear used digitalWrite(grounds[g],digitalRead(grounds[g])^1); // enable digit for (d = 0;d < num_pins;d++) digitalWrite(segments[d], (led_nums[num_to_display[g]][d] == 1) ? HIGH : LOW); //write segments digitalWrite(grounds[g],HIGH); // disable digit } } void loop() { setDigits(1,2,3,4); } void setDigits(byte n1, byte n2, byte n3, byte n4) { num_to_display[0] = n1; num_to_display[1] = n2; num_to_display[2] = n3; num_to_display[3] = n4; }
Hey guys, it doesn’t look like this was ever answered proper. I have a similar need:
I need to run 3 separate 8-segment LED displays independently. Meaning, 1) Stopwatch Timer 2) Temperature 3) Calculation
Is three of these overkill? Sparkfun 7-Segment Serial Display
sku: COM-09230
Can the Arduino handle all that?
Thanks!
These are what I was asking about.
Yes you can control as many as you want with the arduino. Use the SPI interface and then connect the CSN line of each display to an arduino output to enable it. In that way you can talk to as many devices as you have output pins on the arduino, or even more if you use I/O expanding chips.
I don’t know if size/brightness does matter:
But if you want to show just much numbers, maybe an LCD 2x16 is more suitable?
For the 3x13$ you get a nice LCD. For an LCD you normally need 6 digipins, no matter of coulumn and row of the LCD.
If you look at this page:-
You will see the schematic has four 7 segment displays multiplexed. The Text is about a chess computer using an arduino and is in German but fortunately the diagram is in schematic an I read that very well. | https://forum.arduino.cc/t/how-many-7-segment-leds-can-a-arduino-run/4563 | CC-MAIN-2022-21 | refinedweb | 568 | 64.81 |
The Domain Name Not Taken
It appears that all the domain names have been taken - 90% of them by crappy domain name sitting companies. This really ticks me off because I have an idea for an Ajaxy Web 2.0 type site that will make me obscenely wealthy, until the next bubble bursts. Naturally I can't give out details of the site I have in mind, suffice to say it is on the subject of debating. So I would love to get a simple, catchy domain, that says debating, arguing, duscusion or similar. If anyone can suggest such a domain that isn't taken, I would be happy to give you 100 shares when I float on the stock market. And if you are thinking of reserving said domain name and selling it to me, be aware that I have no money - at least until I get venture capital.
To get you started, here are some good domains that are taken...
- loggerheads.com
- allinfavour.com
- debatesite.com
- debaters.com
I particularily like the last one, because visitors that did well on the side could be called master-debaters.).
Analysis?
Food File is now Open Source
>>IMAGE!
Postmarkup 1.0.5
Just uploaded a new version of Postmarkup (1.0.5), my bbcode parsing engine. The only significant change was a fix to a potential thread safety issue. It would only have occurred if you used the
[list] tag, and even then only rarely (if at all). I figured it would be worthwhile since many people are using it in the context of a multi-threaded web application.
I decided not to bother with a win32 installer since its only a single Python file, and can be installed with easy_install. Use the following command line to install, or upgrade, Postmarkup.
easy_install -U postmarkup
If anyone really wants a win32 installer then let me know, I'll probably oblige.
See the Postmarkup homepage on Google Code for more information.
Happy.
Profiling bit-twiddling in Python
After my previous post regarding the the
is_power_of_2 and
next_power_of_2 functions, Richard Jones pointed out that Pyglet has an implementation that used the bit-twiddling method. Since I had something to do a direct comparison with, I wrote a script to test the run time of the two methods.
#!/usr/bin/env python setup_1 = """ from math import log, ceil def is_power_of_2(n): return log(n, 2) % 1.0 == 0.0 def next_power_of_2(n): return (2 ** ceil(log(n, 2))) """ setup_2 = """ def next_power_of_2(v): v -= 1 v |= v >> 1 v |= v >> 2 v |= v >> 4 v |= v >> 8 v |= v >> 16 return v + 1 def is_power_of_2(v): return (v & (v - 1)) == 0 """ from timeit import Timer t1 = Timer("is_power_of_2(128)", setup_1) t2 = Timer("is_power_of_2(128)", setup_2) t3 = Timer("next_power_of_2(125)", setup_1) t4 = Timer("next_power_of_2(125)", setup_2) print "float math is_power_of_2:", t1.timeit() print "bit-tiwddling is_power_of_2:", t2.timeit() print print "float math next power of 2:", t3.timeit() print "bit-twiddling next power of 2:", t4.timeit()
This produced the following results on my humble PC.
float math is_power_of_2: 3.79312203087 bit-tiwddling is_power_of_2: 1.11348704933 float math next power of 2: 4.90055467944 bit-twiddling next power of 2: 2.99615733285
The results are conclusive - bit-twiddling is still a big win in Python. I figured that the bit-twiddling
is_power_of_2 function would be faster than the float math version, but I was surprised by the
next_power_of_2 result. It pays to profile!
I also tested it with Psyco, and got the following results.
float math is_power_of_2: 4.33070460072 bit-tiwddling is_power_of_2: 0.037652550813 float math next power of 2: 5.66786840227 bit-twiddling next power of 2: 0.0600607060395
Wow! The bit-twidding times improved astronomically with Psyco - almost 50 times faster, by my calculations. What is surprising is that the float versions are actually a little slower with Psyco.
Conclusion? If you need to calculate the nearest power of 2 for billions of numbers in a hurry, use Psy | http://www.willmcgugan.com/2007/7/ | CC-MAIN-2015-40 | refinedweb | 664 | 65.22 |
!
form_data = cgi.FieldStorage()
field_name = form_data.getfirst('some_field')
field_value = form_data.getfirst('some_value')
sql = "update some_table set %s = '%s'" % (field_name, field_value)
cursor = conn.execute(sql)
Select all
Open in new window
sql = "update some_table set %s = %%s" % (MySQLdb.escape_string(field_name))
cursor = conn.execute(sql, (field_value,))
"<div> %s %s </div>" % (key, value)
"<div>" + key + ": " + value + "</div>"
"<div> %s %s </div>" % (cgi.escape(key, True), cgi.escape(value,.
class initClass:
def __init__(self):
self.html_form = None
def initPage(self):
self.html_form = template_form
but nothing happens if the methods I'm using aren't nested inside the class, so I presume it's not doing anything or not being read. When my methods are nested inside the class, my script won't execute because they aren't defined (even when adding self as the first argument to each method). What to do?
What form data is returned in each form case for the reset button?
It is the data in the form post that needs to be examined. Have a look at the first page to see what it is posting, and then look at the second form to see what is different about the post.
Presumably the reset button is invoking the same function on form post for both forms.
Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!
if __name__ == '__main__':
print "Content-type: text/html \n"
if 'Submit1' in form:
# run 3 methods that:
- append field names and values to a list that is printed at the top of the destination form (template_form)
- print the html form fields with the user-submitted inputs to file (body.html)
- print a warning message for each required field containing an empty value:
on my lab PC, the form reloads on submit with updated values and warning
message(s) until all required fields have non-null values
# shutil copy the header, body and footer data to the destination form
# load the destination form via python template substitution
elif 'Submit2' in form:
# run 3 methods that:
- append field names and values to a list that is printed at the top of the next page
- print the html form fields with the user inputs to body.html, but this part of the script is not used *
# load a confirmation page with the list of form fields and values submitted; use template substitution for this
# insert the form values into a mysql table with column names corresponding to the form fields
elif 'Reset' in form:
# empty out the list and the form fields dictionary and load the start page.
(The html source for the Reset button on both forms is identical.)
* I added a shutil copy instruction here for consistency which made no difference.
Is the same error message present for Reset or Submit2?
Perhaps supplying the source might make things clearer.
If the user does not complete all required fields, the template_form that is loaded populates the form fields and warns the user that required inputs are missing: in this case, the submit button name is Submit1.
So if there are missing values for required fields, the user must fix this first, and only then can he confirm all of of his form value inputs on the page.
Whatever the situation, the template_form is generated dynamically on each submit action and loaded with form field values as submitted by the user. The only difference between Submit1 and Submit2 form actions is the html template that is loaded.
Modsecurity does not block the first form submit action from a static html page - presumably this default python cgi behavior is supported. But any subsequent submit action is using a dynamically generated web form as its source, with a filename / path that is not identical to the original form that was used.
If this is the problem I don't know how to fix it.
I'm aware that string substitution is vulnerable to sql injection, in particular this syntax:
template_form.write('<div>
template_form.write('<div>
but the apache modsecurity errors are the same.
So for example a text input is built like this:
'<td>' + k + ' <input type="text" name="' + k + '" value="' + v + '"></td>\n'
which prints the stored values to the form fields when executed from my lab PC.
Very tedious, but I can understand and maintain this code.
Open in new window
If that (or something similar) is what you're doing, you shouldn't be doing it. You should be using placeholders in your queries. If placeholders aren't possible and there isn't any other way to build your query other than dynamically, then you have to make sure you're escaping everything that could possibly cause a problem with your query syntax. How and where you'd do that depends on the query that you're trying to run, the database that you're using, and the library that you're using to connect to it. In the above example, if you were using MySQLdb to connect to you database, you should have done this to prevent an injection problem:
Open in new windowIn the above, I used a placeholder to escape the value and I manually escaped the fieldname-- because placeholders can only stand in for values (not syntax elements). Anyway... if it's really a sql injection problem, then you should post the code showing us how you're building and executing your sql statements.
I say "if" because based on some of your comments, it appears that you're also open to html script injection attacks. So not sure which apache would really be complaining about. Unless you've properly escaped your key and value variables beforehand, neither of these statements are safe:
Open in new windowThey're nowhere near as dangerous as a sql injection attack, but they're still problems and it's possible apache would complain about them. I don't think to the point of preventing the page from executing, but who knows. To make them safe, they need to be html escaped-- see the cgi.escape function ().
Open in new window
Experts Exchange Solution brought to you by
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.Start your 7-day free trial
Since I haven't reached the point where sql injection can be an issue, I may or may not have a problem there as well. But one step at a time. I'm not near my lab PC at the moment, and mimicking the script behavior / environment remotely will be difficult. Will do what I can and post my progress as soon as possible. | https://www.experts-exchange.com/questions/28260598/python-cgi-script-fails-with-apache-modsecurity.html | CC-MAIN-2018-39 | refinedweb | 1,141 | 60.04 |
Table of Content
What is Data binding?
Data binding is one of the most key features in Angular. Data binding in Angular works by synchronizing the data in the components with the UI so that it reflects the present value of the data.
When the value in the data changes it is detected by Data binding and the changes are reflected in the View, this will make the HTML dynamic.
- one-way data binding
- two-way data binding
Template expressions {{}} and square braces [] are used for binding a property to the DOM In one-way data binding.
The square braces one-way binding method can also be called property binding because it data-binds data to the property of an element.
What is Property binding?
Property binding is the prime way of binding data in Angular. The square braces [] are used for binding the data to a property of an element. The property is put onto the element enclosed with brackets i.e., [property].
The main purpose of property binding is that it facilitates the developer to control elements' property. Angular Property binding helps the developer to set values for HTML elements’ properties or directives. Property binding involves updating the value of a property in the component and binding it to an element in the view template.
We can do things like toggle button functionality, set paths programmatically, and share values between components, etc. using property binding.
Property Binding is a one-way data-binding mechanism. We bind a DOM element property to a field which is a defined property in our component TypeScript code.
Syntax :
In property binding, value is moved in one direction from a component’s property to a target element property.
The target property is enclosed within the square brackets []. This target property is the DOM property to which we want to assign the value.
Angular evaluates the right-hand side of the assignment as a dynamic expression when the brackets [] appear in the code. When there are no brackets, Angular considers the right-hand side of value as a string literal and sets the property to that static value.
Approach -
- Define a property element in the component class (component.ts) file.
- In the template file (component.html), set the property of the HTML element by assigning the property value to the component class file’s element.
Example
Create an Angular application named “property-binding” by executing this command:
ng new property-binding
We will make use of property binding in four ways in our application.
We will create a form with one text-input field, one password input field, a login button, and an image.
We will set values of the attributes of these elements using property-binding in this application.
We will use bootstrap for designing the form.
app.component.html :
Property Binding in Angular!!
In the template file, we have created a form with 2 input elements and one button. Input elements are for entering username and password. And a login button.
We have set the value property of the input element of form using property binding which will be shown as the default value in the username input element.
We have set a value of the “maxlength” attribute of the password input element using property binding. This means that the user can enter a maximum of 6 characters in the password field.
We have used [attr.maxlength]="max" Because this is an element’s attribute, not a native property
We have set a mechanism where the login button will get disabled after 10 seconds/10000 milliseconds after the page gets loaded/refreshed using property binding. This code is put in the constructor() of the component’s TS file.
As well as we have set the value of the “src”, “height” and “width” attributes of the image tag using the property binding technique.
All the values that are on the right-hand side of the [property] are defined and set in the typescript file of the AppComponent.
app.component.ts :
import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent implements OnInit { Defaultval = 'Enter Username here'; src = ''; max=6; height=300; width=500; buttonDisabled = false; constructor() { setTimeout(() =>{ this.buttonDisabled = true; }, 10000); } ngOnInit() { } }
In the typescript file, we have set values in AppComponent class which we want to assign in the HTML file.
“Defaultval” is for setting the default value in the input field.
“src” is for setting the path of the image tag.
“max” is for setting the maximum allowed characters in the password field.
“height” & “width” are for setting the height and width attribute of the img tag.
“buttonDisabled" is for setting the disabled attribute of the button tag.
We have set the buttonDisabled value to false by default, this allows the user to click the login button. 10 seconds after the page gets loaded/refreshed the login button will be disabled. For this mechanism, we have used the setTimeout() method and set the buttonDisabled value to true.
This will generate the following output:
The Username field has a default value specified in the ts file. And the Login button is enabled when the page got loaded.
The login button is disabled after 10 seconds of the page gets loaded.
The maximum number of characters allowed in the password field is 6. The user will not be allowed to enter more than 6 characters in the field.
Conclusion
Property binding is one of the key features of Angular. Property binding is used for passing the data from the component class (component.ts) and setting the value of the element in the template file (component.html). We can bind data using property binding as well as string interpolation.
The difference between property binding and string interpolation is: Interpolation uses the {{expression}} to send the value to the component’s template whereas Property binding uses [] to send values from the component to the template. | https://www.ifourtechnolab.com/blog/what-is-property-binding-and-how-to-implement-it-in-angular | CC-MAIN-2022-40 | refinedweb | 991 | 55.95 |
.
#
# }}}
#
require("defs.php3");
#
# Verify page arguments.
#
$optargs = OptionalPageArguments("printable", PAGEARG_BOOLEAN);
if (!isset($printable)) {
$printable = 0;
}
#
# Standard Testbed Header
#
if (!$printable) {
PAGEHEADER("Emulab Tutorial: XMLRPC Interface to Emulab");
}
if (!$printable) {
echo "
Printable version of this document
\n"; } # # Drop into html mode # ?>
This page describes the XMLRPC interface to Emulab. Currently, the interface mainly supports experiment creation, modification, swapping, and termination. We also provide interfaces to several other common operations on nodes end experiments such as rebooting, reloading, link delay configuration, etc. This interface is a work in progress; it will improve and grow over time. If there is something missing you need, please send us email.
The Emulab XMLRPC server can be accessed via an SSL based server. You need to request a certificate from the Emulab website in order to use the SSL based server. Go to the "My Emulab" portion of the Emulab website, and click on the "Create SSL Certificate" link. You will be prompted for a passphrase to use to encrypt the private key. Once the key has been created, you will be given a link to download a text version (PEM format). Simply provide this certificate as an input to your SSL client.
The API is described in detail below. A demonstration client written in
Python is also available that you can use on your desktop to invoke
commands from the shell. For example:
which says to create an experiment called "myexp" in the "myproj" project,
swap it in immediately, wait for the exit status (instead of running
asynchronously), passing inline the contents of nsfile.ns in your
home directory on your desktop. By default, the client will contact the RPC
server at , but you can override that by
using the -s hostname option. For example:
sslxmlrpc_client.py startexp batch=false wait=true proj="myproj" exp="myexp" nsfilestr="`cat ~/nsfile.ns`"
which would invoke the RPC server on boss.emulab.net.
You will be prompted for your SSL passphrase.
sslxmlrpc_client.py -s boss.emulab.net startexp ...
The sslxmlrpc_client python program is a simple demonstration of how to use Emulab's RPC server. If you do not provide a method and arguments on the command line, it will enter a command loop where you can type in commands (method and arguments) and wait for responses from the server. It converts your command lines into RPCs to the server, and prints out the results that the server sends back (exiting with whatever status code the server returned).f You can use this client program as is, or you can write your own client program in whatever language you like. Remember to use the --cert= option to tell the demonstration client where to find your certificate. You will be prompted for the private key passphrase when it attempts to contact the server.
A more sophisticated client called
script_wrapper.py provides a
traditional command line interface to Emulab, using the SSL transport
described above. The client should run on any machine that has Python
installed. For example, to swap the myexp
experiment in the testbed project in:
Each command has its own --help option:
script_wrapper.py --server=boss.emulab.net swapexp -e testbed,myexp in
A complete list of Emulab commands available via the script wrapper is
available with the --help command:)
As a convenience, you can symlink script_wrapper.py to each of the
commands listed above, and avoid having to type the wrapper name:
script_wrapper.py --help
Usage: wrapper [wrapper options] command [command args and opts]
Commands:
readycount Get readycounts for nodes in experiment (deprecated).
startexp Start an Emulab experiment.
savelogs Save console tip logs to experiment directory.
endexp Terminate an experiment.
eventsys_control Start/Stop/Restart the event system.
batchexp Synonym for startexp.
node_list Print physical mapping of nodes in an experiment.
expinfo Get information about an experiment.
node_admin Boot selected nodes into FreeBSD MFS.
create_image Create a disk image from a node.
delay_config Change the link shaping characteristics for a link or lan.
modexp Modify experiment.
nscheck Check and NS file for parser errors.
swapexp Swap experiment in or out.
os_load Reload disks on selected nodes or all nodes.
portstats Get portstats from the switches.
link_config Change interface parameters for a wireless link.
node_reboot Reboot selected nodes or all nodes in an experiment.
This has already been done in users.emulab.net:/usr/testbed/bin,
so each of the above commands is already on your path.
ln -s script_wrapper.py swapexp
swapexp --server=boss.emulab.net -e testbed,myexp in
The API for the server is broken into several different modules that
export a number of methods, each of which is described below. Each
method is of the form (in Python speak):
The arguments to each method:
def startexp(version, arguments):
return EmulabResponse(RESPONSE_SUCCESS, value=0, output="Congratulations")
args = {}; args["proj"] = "myproj" args["exp"] = "myexp" args["direction"] = "out" response = server.swapexp(CURRENTVERSION, args)
Unless specifically stated, the return value of most commands is a simple integer reflecting an exit code from the server, and some output to help you determine what went wrong. Otherwise, the return value is documented in each method description.Unless specifically stated, the return value of most commands is a simple integer reflecting an exit code from the server, and some output to help you determine what went wrong. Otherwise, the return value is documented in each method description.
- code: An integer code as defined in emulabclient.py.
- value: A return value. May be any valid data type that can be transfered in XML.
- output: A string (with embedded newlines) to print out. This is useful for debugging and for guiding users through the perils of XMLRPC programming.
Finally, a quick note about the types accepted and returned by methods. Most
methods will accept a real XML-RPC type and try to coerce a string into that
type. For example, in python, passing
True is equivalent to
passing the string, "true". When returning data, the methods will prefer to
return typed values, rather than formatted strings.
The emulab module provides general information about this Emulab installation.
The user module provides access to user-specific information.
The fs module lets you examine the parts of the Emulab file system that can be exported to your experimental nodes.
The experiment module lets you start, control, and terminate experiments.
The node module lets you control nodes in your experiments.
The osid module lets you operate on OS descriptors.
The imageid module lets you operate on Image descriptors. | https://gitlab.flux.utah.edu/emulab/emulab-stable/raw/master/xmlrpc/xmlrpcapi.php3?inline=false | CC-MAIN-2019-43 | refinedweb | 1,070 | 50.43 |
how to use a class written in javascript to qml ?
what need write for a type spot, to use the class written in javascript ?
@import QtQuick 1.0
import "control.js" as ScriptControl
Item
{
property type control: new ScriptControl.Control();@
"var"
on the type of var gives this error "
(qrc:/tank/tank1.qml:10:14: Expected property type)
QDeclarativeComponent: Component is not ready
QGraphicsScene::addItem: cannot add null item"
"Component is not ready" suggests that it takes time for your component to load. You need to wait until it finishes loading, before assigning it to a variable.
Do the assignment inside the Component.onCompleted() signal handler. See:
- chrisadams
The 'var' property type is only available in QtQuick 2.0, not in QtQuick 1.0. (Well, technically, in QtQml 2.0, but yeah.)
Cheers,
Chris.
[quote author="chrisadams" date="1387157603"]The 'var' property type is only available in QtQuick 2.0, not in QtQuick 1.0. (Well, technically, in QtQml 2.0, but yeah.)[/quote]Ah, good catch.
september, are you able to upgrade to Qt Quick 2? Qt Quick 1 is obsolete now. | https://forum.qt.io/topic/35490/how-to-use-a-class-written-in-javascript-to-qml | CC-MAIN-2018-22 | refinedweb | 183 | 72.12 |
I made a simple app to test the PythonEvaluate functionality of Rhino Compute.
You can write Rhino Common code in the text field and have it evaluated and rendered in THREE.js
You can create geometry and return as Brep, you can also reference geometry from viewport for further manipulation.
It’s just a test, so of course very buggy and limited.
In-browser python interpreter
I made a simple app to test the PythonEvaluate functionality of Rhino Compute.
Errr so anybody with access to the app can execute arbitrary Python code on your server?
Nice work @mkarimi! We have another user that is struggling to use rhino3dm with React. If you’re willing (and it’s up to you!) could you share some tips with them?
@Dancergraham we have a couple of things in place to mitigate malicious code execution in our own implementation of the Compute server. Firstly the Compute service runs as a non-administrator and secondly there are some restrictions as to what python code you can run on the server (note that the python endpoint has since been moved out of the Compute project into the IronPython plug-in).
Good idea!
Maybe add
eval to the list of badwords and correct the typo in GetProperty ? It may also be worth checking out the bandit package on PyPi (from OpenStack) for other potential security issues with Python. It is widely used and recommended.
-Graham
We love pull requests!
Edit: actually I’m not sure that’s a typo. I think it’s supposed to cover both
GetProperty() and
GetProperties().
Absolutely @will, happy to share details.
Working in React importing Rhino3dm package like
import * from 'rhino' just doesn’t work. It’ll be much cleaner if that worked, but there are work arounds.
Here’s what I ended up doing, you basically have to make a script tag just like plain html and reference that. One way to do that in React is:
const fetchJsFromCDN = (src, key) => { return new Promise((resolve, reject) => { const script = document.createElement("script"); script.src = src; script.addEventListener("load", () => { resolve(window[key]); }); script.addEventListener("error", reject); document.body.appendChild(script); }); };
Which can be called like:
var rhinoProm = fetchJsFromCDN( "", ["rhino3dm"] ); var computeProm = fetchJsFromCDN( "", ["RhinoCompute"] ); var modules = await Promise.all([rhinoProm, computeProm]); var rhino3dm = modules[0] var compute = modules[1]
No that you have your modules resolved. We need to attach them to our window so we can reference them elsewhere
rhino3dm().then(async rh => { window.rhino3dm = rh; }); compute.authToken = compute.getAuthToken(); window.compute = compute
rhino3dm and compute modules can be referenced anywhere using
window.rhino3dm or
window.compute
I tried forking the repo but can’t find that code in the main branch of my fork …?
EDIT: Found it but it tells me I must be on a branch to edit…?
@Dancergraham I’m sorry, despite having written it shortly before in a post above, I forgot that the code is no longer in the open source Compute repository… @stevebaer, what do you think about adding
eval to the list of banned words?
I’m still trying to figure out how
eval could be used in a malicious way with the other restrictions in place.
I’m concerned about malicious scripts, but also don’t want to limit people. This is really just a prototype server and we do log who is calling compute if we end up with someone making a mess of things. The compute server already supports calls for solving grasshopper definitions and you could include custom scripts in those definitions. The compute server can also be taken down at any time and replaced with a fresh clone.
eval Is similar to
exec and returns a value. Both are generally considered to be major security risks as a way of bypassing other safeguards, but I’m no security expert so I’m just passing on what I’ve heard.
A hint on how we solve these kind of problems at ShapeDiver: We implemented a manual approval process for scripts contained in Grasshopper models (C#, VB, Python). Whenever a model gets uploaded containing a script which has not been approved or denied before, we are notified by our backend system and review the script before approving or denying it. This allows us to ensure security and reliability of the backend systems shared by our customers.
I’ve just seen some discussion of this from someone who knows Python very well… not sure how this fits in with your implementation… | https://discourse.mcneel.com/t/in-browser-python-interpreter/92055 | CC-MAIN-2020-05 | refinedweb | 747 | 64.81 |
Search on MapReduce found various scattered blog posts, some universities courses pages and one book that seems to contain almost everything other sources did.
This post contains MapReduce questions and answers based on the book. Basically, if I would be a student, this is what I would have made as a test preparation notes. If I would be a teacher, this is what I would ask on the exam.
First chapter gives credit where the credit is due, the rest contains questions. Last chapter contains hands-on coding exercises.
The Book
The book is named Data-Intensive Text Processing with MapReduce. If you are unsure whether you want to buy it or not, pre-production manuscript is available for free.
Do not be fooled by the title. The book is more about MapReduce itself and less about text processing. First half of the book describes general purpose tricks (design patterns) useful for any task. Second half contains a chapters on text processing, graph algorithms and expectation maximization.
The book contains almost everything I found on various blogs, university courses pages and much more.
Questions
Questions are split by book chapters. With one minor exception (counters), questions are mostly based on the first half of the book. Second half contains concrete algorithms and I wanted to focus on general purpose knowledge.
It does not mean that learning them is not useful. Especially Graph Algorithms chapter contains easily generalizable ideas.
2 MapReduce Basics
2.2 Mappers and Reducers
Describe general MapReduce algorithm. Split it into phases. For each phase include:
- who is responsible (framework/programmer/customizable),
- what it does,
- phase input,
- phase output.
MapReduce has four phases:
- map,
- combine,
- shuttle and sort,
- reduce.
Map phase is done by mappers. Mappers run on unsorted input key/values pairs. The same physical nodes that keeps input data run also mappers. Each mapper emits zero, one or multiple output key/value pairs for each input key/value pair. Output key/value pairs are called intermediate key/value pairs. Their type is usually different from input key/value pair type. Mapper must be supplied by programmers.
Combine phase is done by combiners. Combiner should combine key/value pairs with the same key together. Each combiner may run zero, once or multiple times. Framework decides whether and how many times to run the combiner, programmer has no control over it. Combiners output key/value pair type must be the same as its input key/value pair types.
Shuttle and sort phase is done by framework. Data from all mappers are grouped by the key, split among reducers and sorted by the key. Each reducer obtains all values associated with the same key. Programmer may supply custom compare function for sorting and partitioner for data split. All key/value pairs going to the same reducer are sorted by the key, but there is no global sorting.
Reducer obtains sorted key/[values list] pairs sorted by the key. Values list contains all values with the same key produced by mappers. Each reducer emits zero, one or multiple output key/value pairs for each input key/value pair. Output key/value pair type is usually different from input key/value pair type. Reducer must be supplied by programmers.
If the algorithm requires multiple MapReduce iterations, each combiner may increment global counter. Driver program would read the counter after the reduce phase. It then decides whether next iteration is needed or not.
Note: chapter 2 does not mention counters. They are explained later, in the chapter 5. Decide if the statement is true or false: All MapReduce implementations implement exactly same algorithm.
False. For example, Google’s implementation does not allow change of key in the reducer, but provides sorting for values. Hadoop does not provide values sorting, but reducer can change the key.
True or false: Each mapper must generate the same number of key/value pairs as its input had.
False. Mapper may generate any number of key/value pairs (including zero).
True or false: Mappers input key/value pairs are sorted by the key.
False. Mapper’s input is not sorted in any way.
True or false: Mappers output key/value must be of the same type as its input.
False. Mapper may produce key/value pairs of any type.
True or false: Reducer is applied to all values associated with the same key.
True. Reducer is applied to all values associated with the same key.
True or false: Reducers input key/value pairs are sorted by the key.
True. Reducers input key/value pairs are sorted by the key.
implementation.
True or false: Each reducer must generate the same number of key/value pairs as its input had.
False. Reducer may generate any number of key/value pairs (including zero).
True or false: Reducers output key/value pair must be of the same type as its input.
False. The statement is false in Hadoop and true in Google’s implementation.
2.3 The Execution Framework
What happens in case of hardware/software failure?
MapReduce framework must be able to recover from both hardware (disk failures, RAM errors) and software (bugs, unexpected exceptions) errors. Both are common and expected.
Is it possible to start reducers while some mappers still run? Why?
No. Reducer’s input is grouped by the key. The last mapper could theoretically produce key already consumed by running reducer.
Define a straggler.
Straggler is either map or reduce task that takes unusually long time to complete.
What is speculative execution (also called backup tasks)? What problem does it solve?
Identical copy of the same task is executed on multiple nodes. Output of the fastest task used.
Speculative execution helps if the task is slow because of hardware problem. It does not help if the distribution of values over keys is skewed.
2.4 Partitioners and Combiners
What does partitioner do?
Partitioner divides key/values pairs produced by map tasks between reducers.
What does combiner do?
Combiner does local aggregation of key/values pairs produced by mapper before or during shuttle and sort phase. In general, it reduces amount of data to be transferred between nodes.
The framework decides how many times to run it. Combiner may run zero, one or multiple times on the same input.
Decide if the statement is true or false: Each combiner runs exactly once.
False. The framework decides whether combiner runs zero, once or multiple times.
2.5 The Distributed File System
Briefly describe HDFS architecture.
HDFS has one namenode and a lot of datanodes. Namenode is master and coordinates file operations, ensures integrity of the system and keeps namespace (metadata, directory structure, file to block mapping etc.).
Data are stored in big blocks on data nodes. Each block is stored on multiple, by default three, data nodes. Name node checks whether data nodes work correctly and manages data replication.
Client contacts name node which answers with data block id and data node id. Data node then sends data directly to the client.
Decide if the statement is true or false: HDFS is good at managing large number of small files.
False. HDFS is good at managing large files.
2.6 Hadoop Cluster Architecture
Explain difference between jobtracker and tasktracker?
Client executes jobs on jobtracker. Jobtracker runs on the master. Jobtracker monitors MapReduce jobs. It also coordinates mappers and reducers.
Tasktracker runs both user code and datanode daemon on slave nodes. It is never contacted by the client.
Explain mapper lifecycle.
Initialization method is called before any other method is called. It has no parameters and no output.
Map method is called separately for each key/value pair. It process input key/value pairs and emits intermediate key/value pairs.
Close method runs after all input key/value have been processed. The method should close all open resources. It may also emit key/value pairs.
Explain reducer lifecycle.
Initialization method is called before any other method is called. It has no parameters and no output.
Reduce method is called separately for each key/[values list] pair. It process intermediate key/value pairs and emits final key/value pairs. Its input is a key and iterator over all intermediate values associated with the same key.
Close method runs after all input key/value have been processed. The method should close all open resources. It may also emit key/value pairs.
3 MapReduce Algorithm Design
3.1 Local Aggregation
What is local aggregation and why is it used? amount of data to be transferred.
If the distribution of values over keys is skewed, data preprocessing in combiner helps to eliminate reduce stragglers.
What is in-mapper combining? State advantages and disadvantages over writing custom combiner.
Local aggregation (combining of key/value pairs) done inside the mapper.
Map method does not emit key/value pairs, it only updates internal data structure. Close method combines and preprocess all stored data and emits final key/value pairs. Internal data structure is initialized in init method.
Advantages:
- It will run exactly once. Combiner may run multiple times or not at all.
- We are sure it will run during map phase. Combiner may run either after map phase or before reduce phase. The latter case provides no reduction in transferred data.
- In-mapper combining is typically more effective. Combiner does not reduce amount of data produced by mappers, it only groups generated data together. That causes unnecessary object creation, destruction, serialization and deserialization.
Disadvantages:
- Scalability bottleneck: the technique depends on having enough memory to store all partial results. We have to flush partial results regularly to avoid it. Combiner use produce no scalability bottleneck.
3.2 Pairs and Stripes
Explain Pair design patter on a co-occurence example. Include advantages/disadvantages against Stripes approach, possible optimizations and their efficacy.
Mapper generates keys composed from pairs of words that occurred together. The value contains the number 1. Framework groups key/value pairs with the same work pairs together and reducer simply counts the number values for each incoming key/value pairs.
Each final pair encodes a cell in co-occurrence matrix. Local aggregation, e.g. combiner or in-mapper combining, can be used.
Advantages:
- Simple values, less serialization/deserialization overhead.
- Simpler memory management. No scalability bottleneck (only if in-mapper optimization would be used).
Disadvantages:
- Huge amount of intermediate key/value pairs. Shuffle and sort phase is slower.
- Local aggregation is less effective – too many distinct keys.
Explain Stripes design patter on a co-occurence example. Include advantages/disadvantages against Pairs approach, possible optimizations and their efficacy.
Mapper generates a distinct key from each encountered word. Associated value contains a map of all co-occurred words as map keys and number of co-occurrences as map values. Framework groups same words together and reducer merges value maps.
Each final pair encodes a row in co-occurrence matrix. Combiner or in-mapper combining can be used.
Advantages:
- Small amount of intermediate key/value pairs. Shuffle and sort phase is faster.
- Intermediate keys are smaller.
- Effective local aggregation – smaller number of distinct keys.
Disadvantages:
- Complex values, more serialization/deserialization overhead.
- More complex memory management. As value maps may grow too big, the approach has potential for scalability bottleneck.
Explain scalability bottleneck caused by stripes approach.
Stripes solution keeps a map of co-occurred words in memory. As the amount of co-occurred words is unlimited, the map size is unlimited too. Huge map does not fit into the memory and causes paging or out of memory errors.
3.3 Computing Relative Frequencies
Relative frequencies of co-occurrences problem:
Input: text documents
key: document id
value: text document
Output: key/value pairs where
key: pair(word1, word2)
value: #co-occurrences(word1, word2)/#co-occurrences(word1, any word)
Fix following solution to relative frequencies of co-occurrences problem:
class MAPPER method INITIALIZE H = new hash map method MAP(docid a, doc d) for all term w in doc d do for all term u patri neighbors(w) do H(w) = H(w) + 1 emit(pair(u, w), count 1) method CLOSE for all term w in H emit(pair(w, *), H(w)) class REDUCER variable total_occurrences = 0 method REDUCE(pair (p, u), counts[c1, c2, ..., cn]) s = 0 for all c in counts[c1, c2, ..., cn] do s = s + c if u = * total_occurrences = s else emit(pair p, s/total_occurrences) class SORTING_COMPARATOR method compare(key (p1, u1), key (p2, u2)) if p1 = p2 AND u1 = * return key1 is lower if p1 = p2 AND u2 = * return key2 is lower return compare(p1, p2)
Partitioner is missing, framework could send key/value pairs with totals to different reducer than key/pairs with word pairs.
class PARTITIONING_COMPARATOR method compare(key (p1, u1), key (p2, u2)) if p1 = p2 return keys are equal return keys are different
Describe order inversion design pattern.
Order inversion is used if the algorithm requires two passes through mapper generated key/value pairs with the same key. The first pass generates some overall statistic which is then applied to data during the second pass. The reducer would need to buffer data in the memory just to be able to pass twice through them.
First pass result is calculated by mappers and stored in some internal data structure. The mapper emits the result in closing method, after all usual intermediate key/value pairs.
The pattern requires custom partitioning and sort. First pass result must come to the reducer before usual key/value pairs. Of course, it must come to the same reducer.
3.4 Secondary Sorting
Describe value-to-key design pattern.
Hadoop implementation does not provide sorting for grouped values in reducers input. Value-to-key is used as a workaround.
Part of the value is added to the key. Custom sort then sorts primary by the key and secondary by the added value. Custom partitioner must move all data with the same original key to the same reducer.
3.5 Relational Joins
Describe reduce side join between tables with one-on-one relationship.
Mapper produces key/value pairs with join ids as keys and row values as value. Corresponding rows from both tables are grouped together by the framework during shuffle and sort phase.
Reduce method in reducer obtains join id and two values, each represents row from one table. Reducer joins the data.
Describe reduce side join between tables with one-to-many relationship.
We assume that the join key is primary key in table called S. Second table is called T. In other words, the table S in on the ‘one’ side of the relationship and the table T is on the ‘many’ side of the relationship. key/value pair generated from the table S right before key/value pair with the same join id from the table T.
Reducers input looks like this:
((JoinId1, s)-> row)
((JoinId1, t)-> [rows])
((JoinId2, s)-> row)
((JoinId2, t)-> [rows])
...
((JoinIdn, s), row)
((JoinIdn, t), [rows])
The reducer joins all rows from
s pair with all rows from following
t pair.
Describe reduce side join between tables with many-to-many relationship.
We assume that data are stored in tables called S and T. The table S is smaller. the key/value pairs generated from the table S is right before all key/value pair with the data from the table T.
Reducers input looks like this:
((JoinId1, s)-> [rows])
((JoinId1, t)-> [rows])
((JoinId2, s)-> [rows])
((JoinId2, t)-> [rows])
...
((JoinIdn, s), [rows])
((JoinIdn, t), [rows])
The reducer buffers all rows with the same JoinId from the table S into the memory and joins them with following T table rows.
All data from the smaller table must fit into the memory – the algorithm has scalability bottleneck problem.
Describe map side join between two database tables.
Map side join works only if following assumptions hold:
- both datasets are sorted by the join key,
- both datasets are partitioned the same way.
Mapper maps over larger dataset and reads corresponding part of smaller dataset inside the mapper. As the smaller set is partitioned the same way as bigger one, only one map task access the same data. As the data are sorted by the join key, we can perform merge join
O(n).
Describe memory backed join.
Smaller set of data is loaded into the memory in every mapper. Mappers loop over larger dataset and joins it with data in the memory. If the smaller set is too big to fit into the memory, dataset is loaded into memcached or some other caching solution.
Which one is faster? Map side join or reduce side join?
Map side join is faster.
Reference: MapReduce Questions and Answers from our JCG partner Maria Jurcovicova at the This is Stuff blog. | http://www.javacodegeeks.com/2012/05/mapreduce-questions-and-answers-part-1.html | CC-MAIN-2015-22 | refinedweb | 2,771 | 59.7 |
Complete newbie to python, only really looked at it this morning. My question is when defining a function how can I set the "return(variable)" statement as a string. I assumed the below would be the correct method however the syntax is incorrect, struggling to find resources online for this particular way of converting the data type. The result is forming as follows:
"The result is:
286"
By converting it to a string it should form: "The result is: 286"
Here is what I thought would work:
def fnc2(a,b,c): total=(a+b)*c print("the result is: ") + str(return(total));
A few things:
- Python spacing matters, so don't forget to indent!
- Check your
One form of correct syntax would be:
def fnc2(a, b, c): total = (a + b) * c print("The result is: " + str(total)) | https://www.codesd.com/item/python-set-the-return-statement-of-the-function-to-the-string.html | CC-MAIN-2021-04 | refinedweb | 139 | 54.56 |
Wheezy
A complete Debian GNU/kFreeBSD system should work within a jail, on a GNU/kFreeBSD or regular FreeBSD host system, with a few limitations.
Jails work a lot like Linux OpenVZ. On the host you can see all processes running in all jails. Within a jail, you can only see the processes running in that jail.
Limitations
Be aware that some files in /proc or /sys, such as /proc/mounts, are not partitioned per jail, and this may leak some (read-only) information about the host, or other guests' mountpoints.
Some features such as sysvipc are not namespaced for individual jails, so for security reasons they are disabled by default. fakeroot requires this to be enabled. Running more than one postgresql-server instance in a shared sysvipc namespace would clash, and not normally work.
The raw_sockets feature is normally disabled, to prevent IP spoofing from inside the jail. The ping tool will not work properly as a result.
Starting or stopping a jail
Assuming a debootstrap'd installation already exists in /srv/jail/$JID/, here is an example of how to start it up inside a jail:
JID=101 # Linux-like /proc and /sys filesystems mount -t linprocfs linprocfs /srv/jail/$JID/proc mount -t linsysfs linsysfs /srv/jail/$JID/sys # Ramdisk required for /run mount -t tmpfs tmpfs /srv/jail/$JID/run # A restricted, read-only /dev filesystem mount -t devfs devfs /srv/jail/$JID/dev # Compatibility symlink from /dev/shm to /run/shm ln -s /run/shm /srv/jail/$JID/dev/ # Optionally enable networking HOSTNAME=jail$JID.example.com # This IP address should also be assigned to one of the host's interfaces IP=10.1.0.$JID mkdir -p /var/run/jail jail -J /var/run/jail/$JID.jid -c jid=$JID \ name=jail$JID \ path=/srv/jail/$JID \ host.hostname=$HOSTNAME \ ip4.addr=$IP \ command=/bin/sh -- -c "/etc/init.d/rc S && /etc/init.d/rc 2"
If openssh-server is installed within the jail, you should be able to SSH into it like a virtual private server.
The devd package may be removed as it will typically not work in a jail.
jls (to list running jails) is not available yet.
jexec is not available yet, but you can probably get by with jail -m jid=$JID command=/bin/bash
A jail stops 'running' when all processes within it exit. (Within the jail, /etc/init.d/rc 0 ; exec kill -1 might be a way to force a shutdown?)
Squeeze
The libjail package was not distributed with Squeeze. The kernel functionality has existed since FreeBSD 4.x however, so it may work if you can build the necessary userland tools. | http://wiki.debian.org/Debian_GNU/kFreeBSD/Jails | CC-MAIN-2013-20 | refinedweb | 447 | 64.61 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.